Section 1
//b2CircleDef (Box2D.Collision.Shapes.b2CircleDef)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
public class b2CircleDef extends b2ShapeDef {
public var localPosition:b2Vec2;
public var radius:Number;
public function b2CircleDef(){
localPosition = new b2Vec2(0, 0);
super();
type = b2Shape.e_circleShape;
radius = 1;
}
}
}//package Box2D.Collision.Shapes
Section 2
//b2CircleShape (Box2D.Collision.Shapes.b2CircleShape)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2CircleShape extends b2Shape {
public var m_radius:Number;
public var m_localPosition:b2Vec2;
public function b2CircleShape(_arg1:b2ShapeDef){
var _local2:b2CircleDef;
m_localPosition = new b2Vec2();
super(_arg1);
_local2 = (_arg1 as b2CircleDef);
m_type = e_circleShape;
m_localPosition.SetV(_local2.localPosition);
m_radius = _local2.radius;
}
override public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
_local3 = _arg1.R;
_local4 = (_arg1.position.x + ((_local3.col1.x * m_localPosition.x) + (_local3.col2.x * m_localPosition.y)));
_local5 = (_arg1.position.y + ((_local3.col1.y * m_localPosition.x) + (_local3.col2.y * m_localPosition.y)));
_local4 = (_arg2.x - _local4);
_local5 = (_arg2.y - _local5);
return ((((_local4 * _local4) + (_local5 * _local5)) <= (m_radius * m_radius)));
}
public function GetLocalPosition():b2Vec2{
return (m_localPosition);
}
override public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):Boolean{
var _local6:b2Mat22;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
_local6 = _arg1.R;
_local7 = (_arg1.position.x + ((_local6.col1.x * m_localPosition.x) + (_local6.col2.x * m_localPosition.y)));
_local8 = (_arg1.position.y + ((_local6.col1.y * m_localPosition.x) + (_local6.col2.y * m_localPosition.y)));
_local9 = (_arg4.p1.x - _local7);
_local10 = (_arg4.p1.y - _local8);
_local11 = (((_local9 * _local9) + (_local10 * _local10)) - (m_radius * m_radius));
if (_local11 < 0){
return (false);
};
_local12 = (_arg4.p2.x - _arg4.p1.x);
_local13 = (_arg4.p2.y - _arg4.p1.y);
_local14 = ((_local9 * _local12) + (_local10 * _local13));
_local15 = ((_local12 * _local12) + (_local13 * _local13));
_local16 = ((_local14 * _local14) - (_local15 * _local11));
if ((((_local16 < 0)) || ((_local15 < Number.MIN_VALUE)))){
return (false);
};
_local17 = -((_local14 + Math.sqrt(_local16)));
if ((((0 <= _local17)) && ((_local17 <= (_arg5 * _local15))))){
_local17 = (_local17 / _local15);
_arg2[0] = _local17;
_arg3.x = (_local9 + (_local17 * _local12));
_arg3.y = (_local10 + (_local17 * _local13));
_arg3.Normalize();
return (true);
};
return (false);
}
override public function ComputeMass(_arg1:b2MassData):void{
_arg1.mass = (((m_density * b2Settings.b2_pi) * m_radius) * m_radius);
_arg1.center.SetV(m_localPosition);
_arg1.I = (_arg1.mass * (((0.5 * m_radius) * m_radius) + ((m_localPosition.x * m_localPosition.x) + (m_localPosition.y * m_localPosition.y))));
}
override public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local4 = _arg2.R;
_local5 = (_arg2.position.x + ((_local4.col1.x * m_localPosition.x) + (_local4.col2.x * m_localPosition.y)));
_local6 = (_arg2.position.y + ((_local4.col1.y * m_localPosition.x) + (_local4.col2.y * m_localPosition.y)));
_local4 = _arg3.R;
_local7 = (_arg3.position.x + ((_local4.col1.x * m_localPosition.x) + (_local4.col2.x * m_localPosition.y)));
_local8 = (_arg3.position.y + ((_local4.col1.y * m_localPosition.x) + (_local4.col2.y * m_localPosition.y)));
_arg1.lowerBound.Set((((_local5 < _local7)) ? _local5 : _local7 - m_radius), (((_local6 < _local8)) ? _local6 : _local8 - m_radius));
_arg1.upperBound.Set((((_local5 > _local7)) ? _local5 : _local7 + m_radius), (((_local6 > _local8)) ? _local6 : _local8 + m_radius));
}
public function GetRadius():Number{
return (m_radius);
}
override public function UpdateSweepRadius(_arg1:b2Vec2):void{
var _local2:Number;
var _local3:Number;
_local2 = (m_localPosition.x - _arg1.x);
_local3 = (m_localPosition.y - _arg1.y);
_local2 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
m_sweepRadius = ((_local2 + m_radius) - b2Settings.b2_toiSlop);
}
override public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
_local3 = _arg2.R;
_local4 = (_arg2.position.x + ((_local3.col1.x * m_localPosition.x) + (_local3.col2.x * m_localPosition.y)));
_local5 = (_arg2.position.y + ((_local3.col1.y * m_localPosition.x) + (_local3.col2.y * m_localPosition.y)));
_arg1.lowerBound.Set((_local4 - m_radius), (_local5 - m_radius));
_arg1.upperBound.Set((_local4 + m_radius), (_local5 + m_radius));
}
}
}//package Box2D.Collision.Shapes
Section 3
//b2FilterData (Box2D.Collision.Shapes.b2FilterData)
package Box2D.Collision.Shapes {
public class b2FilterData {
public var maskBits:uint;// = 0xFFFF
public var groupIndex:int;// = 0
public var categoryBits:uint;// = 1
public function b2FilterData(){
categoryBits = 1;
maskBits = 0xFFFF;
groupIndex = 0;
super();
}
public function Copy():b2FilterData{
var _local1:b2FilterData;
_local1 = new b2FilterData();
_local1.categoryBits = categoryBits;
_local1.maskBits = maskBits;
_local1.groupIndex = groupIndex;
return (_local1);
}
}
}//package Box2D.Collision.Shapes
Section 4
//b2MassData (Box2D.Collision.Shapes.b2MassData)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
public class b2MassData {
public var mass:Number;// = 0
public var center:b2Vec2;
public var I:Number;// = 0
public function b2MassData(){
mass = 0;
center = new b2Vec2(0, 0);
I = 0;
super();
}
}
}//package Box2D.Collision.Shapes
Section 5
//b2PolygonDef (Box2D.Collision.Shapes.b2PolygonDef)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2PolygonDef extends b2ShapeDef {
public var vertexCount:int;
public var vertices:Array;
private static var s_mat:b2Mat22 = new b2Mat22();
public function b2PolygonDef(){
var _local1:int;
vertices = new Array(b2Settings.b2_maxPolygonVertices);
super();
type = b2Shape.e_polygonShape;
vertexCount = 0;
_local1 = 0;
while (_local1 < b2Settings.b2_maxPolygonVertices) {
vertices[_local1] = new b2Vec2();
_local1++;
};
}
public function SetAsOrientedBox(_arg1:Number, _arg2:Number, _arg3:b2Vec2=null, _arg4:Number=0):void{
var _local5:b2Vec2;
var _local6:b2Mat22;
var _local7:int;
vertexCount = 4;
vertices[0].Set(-(_arg1), -(_arg2));
vertices[1].Set(_arg1, -(_arg2));
vertices[2].Set(_arg1, _arg2);
vertices[3].Set(-(_arg1), _arg2);
if (_arg3){
_local5 = _arg3;
_local6 = s_mat;
_local6.Set(_arg4);
_local7 = 0;
while (_local7 < vertexCount) {
_arg3 = vertices[_local7];
_arg1 = (_local5.x + ((_local6.col1.x * _arg3.x) + (_local6.col2.x * _arg3.y)));
_arg3.y = (_local5.y + ((_local6.col1.y * _arg3.x) + (_local6.col2.y * _arg3.y)));
_arg3.x = _arg1;
_local7++;
};
};
}
public function SetAsBox(_arg1:Number, _arg2:Number):void{
vertexCount = 4;
vertices[0].Set(-(_arg1), -(_arg2));
vertices[1].Set(_arg1, -(_arg2));
vertices[2].Set(_arg1, _arg2);
vertices[3].Set(-(_arg1), _arg2);
}
}
}//package Box2D.Collision.Shapes
Section 6
//b2PolygonShape (Box2D.Collision.Shapes.b2PolygonShape)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2PolygonShape extends b2Shape {
public var m_vertices:Array;
public var m_normals:Array;
private var s_supportVec:b2Vec2;
public var m_obb:b2OBB;
public var m_coreVertices:Array;
public var m_centroid:b2Vec2;
public var m_vertexCount:int;
private static var s_computeMat:b2Mat22 = new b2Mat22();
private static var s_sweptAABB1:b2AABB = new b2AABB();
private static var s_sweptAABB2:b2AABB = new b2AABB();
public function b2PolygonShape(_arg1:b2ShapeDef){
var _local2:b2PolygonDef;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
s_supportVec = new b2Vec2();
m_obb = new b2OBB();
m_vertices = new Array(b2Settings.b2_maxPolygonVertices);
m_normals = new Array(b2Settings.b2_maxPolygonVertices);
m_coreVertices = new Array(b2Settings.b2_maxPolygonVertices);
super(_arg1);
m_type = e_polygonShape;
_local2 = (_arg1 as b2PolygonDef);
m_vertexCount = _local2.vertexCount;
_local4 = _local3;
_local5 = _local3;
_local3 = 0;
while (_local3 < m_vertexCount) {
m_vertices[_local3] = _local2.vertices[_local3].Copy();
_local3++;
};
_local3 = 0;
while (_local3 < m_vertexCount) {
_local4 = _local3;
_local5 = (((_local3 + 1) < m_vertexCount)) ? (_local3 + 1) : 0;
_local6 = (m_vertices[_local5].x - m_vertices[_local4].x);
_local7 = (m_vertices[_local5].y - m_vertices[_local4].y);
_local8 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
m_normals[_local3] = new b2Vec2((_local7 / _local8), (-(_local6) / _local8));
_local3++;
};
m_centroid = ComputeCentroid(_local2.vertices, _local2.vertexCount);
ComputeOBB(m_obb, m_vertices, m_vertexCount);
_local3 = 0;
while (_local3 < m_vertexCount) {
_local4 = (((_local3 - 1) >= 0)) ? (_local3 - 1) : (m_vertexCount - 1);
_local5 = _local3;
_local9 = m_normals[_local4].x;
_local10 = m_normals[_local4].y;
_local11 = m_normals[_local5].x;
_local12 = m_normals[_local5].y;
_local13 = (m_vertices[_local3].x - m_centroid.x);
_local14 = (m_vertices[_local3].y - m_centroid.y);
_local15 = (((_local9 * _local13) + (_local10 * _local14)) - b2Settings.b2_toiSlop);
_local16 = (((_local11 * _local13) + (_local12 * _local14)) - b2Settings.b2_toiSlop);
_local17 = (1 / ((_local9 * _local12) - (_local10 * _local11)));
m_coreVertices[_local3] = new b2Vec2(((_local17 * ((_local12 * _local15) - (_local10 * _local16))) + m_centroid.x), ((_local17 * ((_local9 * _local16) - (_local11 * _local15))) + m_centroid.y));
_local3++;
};
}
override public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
var _local3:b2Vec2;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:int;
var _local10:Number;
_local4 = _arg1.R;
_local5 = (_arg2.x - _arg1.position.x);
_local6 = (_arg2.y - _arg1.position.y);
_local7 = ((_local5 * _local4.col1.x) + (_local6 * _local4.col1.y));
_local8 = ((_local5 * _local4.col2.x) + (_local6 * _local4.col2.y));
_local9 = 0;
while (_local9 < m_vertexCount) {
_local3 = m_vertices[_local9];
_local5 = (_local7 - _local3.x);
_local6 = (_local8 - _local3.y);
_local3 = m_normals[_local9];
_local10 = ((_local3.x * _local5) + (_local3.y * _local6));
if (_local10 > 0){
return (false);
};
_local9++;
};
return (true);
}
public function GetCoreVertices():Array{
return (m_coreVertices);
}
override public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):Boolean{
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:b2Mat22;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:int;
var _local19:int;
var _local20:Number;
var _local21:Number;
_local6 = 0;
_local7 = _arg5;
_local8 = (_arg4.p1.x - _arg1.position.x);
_local9 = (_arg4.p1.y - _arg1.position.y);
_local10 = _arg1.R;
_local12 = ((_local8 * _local10.col1.x) + (_local9 * _local10.col1.y));
_local13 = ((_local8 * _local10.col2.x) + (_local9 * _local10.col2.y));
_local8 = (_arg4.p2.x - _arg1.position.x);
_local9 = (_arg4.p2.y - _arg1.position.y);
_local10 = _arg1.R;
_local14 = ((_local8 * _local10.col1.x) + (_local9 * _local10.col1.y));
_local15 = ((_local8 * _local10.col2.x) + (_local9 * _local10.col2.y));
_local16 = (_local14 - _local12);
_local17 = (_local15 - _local13);
_local18 = -1;
_local19 = 0;
while (_local19 < m_vertexCount) {
_local11 = m_vertices[_local19];
_local8 = (_local11.x - _local12);
_local9 = (_local11.y - _local13);
_local11 = m_normals[_local19];
_local20 = ((_local11.x * _local8) + (_local11.y * _local9));
_local21 = ((_local11.x * _local16) + (_local11.y * _local17));
if ((((_local21 < 0)) && ((_local20 < (_local6 * _local21))))){
_local6 = (_local20 / _local21);
_local18 = _local19;
} else {
if ((((_local21 > 0)) && ((_local20 < (_local7 * _local21))))){
_local7 = (_local20 / _local21);
};
};
if (_local7 < _local6){
return (false);
};
_local19++;
};
if (_local18 >= 0){
_arg2[0] = _local6;
_local10 = _arg1.R;
_local11 = m_normals[_local18];
_arg3.x = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y));
_arg3.y = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y));
return (true);
};
return (false);
}
public function GetCentroid():b2Vec2{
return (m_centroid);
}
override public function ComputeMass(_arg1:b2MassData):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:int;
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local7 = 0;
_local8 = (1 / 3);
_local9 = 0;
while (_local9 < m_vertexCount) {
_local10 = m_vertices[_local9];
_local11 = (((_local9 + 1) < m_vertexCount)) ? m_vertices[int((_local9 + 1))] : m_vertices[0];
_local12 = (_local10.x - _local6);
_local13 = (_local10.y - _local7);
_local14 = (_local11.x - _local6);
_local15 = (_local11.y - _local7);
_local16 = ((_local12 * _local15) - (_local13 * _local14));
_local17 = (0.5 * _local16);
_local4 = (_local4 + _local17);
_local2 = (_local2 + ((_local17 * _local8) * ((_local6 + _local10.x) + _local11.x)));
_local3 = (_local3 + ((_local17 * _local8) * ((_local7 + _local10.y) + _local11.y)));
_local18 = _local6;
_local19 = _local7;
_local20 = _local12;
_local21 = _local13;
_local22 = _local14;
_local23 = _local15;
_local24 = ((_local8 * ((0.25 * (((_local20 * _local20) + (_local22 * _local20)) + (_local22 * _local22))) + ((_local18 * _local20) + (_local18 * _local22)))) + ((0.5 * _local18) * _local18));
_local25 = ((_local8 * ((0.25 * (((_local21 * _local21) + (_local23 * _local21)) + (_local23 * _local23))) + ((_local19 * _local21) + (_local19 * _local23)))) + ((0.5 * _local19) * _local19));
_local5 = (_local5 + (_local16 * (_local24 + _local25)));
_local9++;
};
_arg1.mass = (m_density * _local4);
_local2 = (_local2 * (1 / _local4));
_local3 = (_local3 * (1 / _local4));
_arg1.center.Set(_local2, _local3);
_arg1.I = (m_density * _local5);
}
public function Support(_arg1:b2XForm, _arg2:Number, _arg3:Number):b2Vec2{
var _local4:b2Vec2;
var _local5:b2Mat22;
var _local6:Number;
var _local7:Number;
var _local8:int;
var _local9:Number;
var _local10:int;
var _local11:Number;
_local5 = _arg1.R;
_local6 = ((_arg2 * _local5.col1.x) + (_arg3 * _local5.col1.y));
_local7 = ((_arg2 * _local5.col2.x) + (_arg3 * _local5.col2.y));
_local8 = 0;
_local4 = m_coreVertices[0];
_local9 = ((_local4.x * _local6) + (_local4.y * _local7));
_local10 = 1;
while (_local10 < m_vertexCount) {
_local4 = m_coreVertices[_local10];
_local11 = ((_local4.x * _local6) + (_local4.y * _local7));
if (_local11 > _local9){
_local8 = _local10;
_local9 = _local11;
};
_local10++;
};
_local5 = _arg1.R;
_local4 = m_coreVertices[_local8];
s_supportVec.x = (_arg1.position.x + ((_local5.col1.x * _local4.x) + (_local5.col2.x * _local4.y)));
s_supportVec.y = (_arg1.position.y + ((_local5.col1.y * _local4.x) + (_local5.col2.y * _local4.y)));
return (s_supportVec);
}
public function GetVertexCount():int{
return (m_vertexCount);
}
override public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
var _local4:b2AABB;
var _local5:b2AABB;
_local4 = s_sweptAABB1;
_local5 = s_sweptAABB2;
ComputeAABB(_local4, _arg2);
ComputeAABB(_local5, _arg3);
_arg1.lowerBound.Set(((_local4.lowerBound.x < _local5.lowerBound.x)) ? _local4.lowerBound.x : _local5.lowerBound.x, ((_local4.lowerBound.y < _local5.lowerBound.y)) ? _local4.lowerBound.y : _local5.lowerBound.y);
_arg1.upperBound.Set(((_local4.upperBound.x > _local5.upperBound.x)) ? _local4.upperBound.x : _local5.upperBound.x, ((_local4.upperBound.y > _local5.upperBound.y)) ? _local4.upperBound.y : _local5.upperBound.y);
}
public function GetVertices():Array{
return (m_vertices);
}
public function GetNormals():Array{
return (m_normals);
}
public function GetOBB():b2OBB{
return (m_obb);
}
public function GetFirstVertex(_arg1:b2XForm):b2Vec2{
return (b2Math.b2MulX(_arg1, m_coreVertices[0]));
}
public function Centroid(_arg1:b2XForm):b2Vec2{
return (b2Math.b2MulX(_arg1, m_centroid));
}
override public function UpdateSweepRadius(_arg1:b2Vec2):void{
var _local2:b2Vec2;
var _local3:int;
var _local4:Number;
var _local5:Number;
m_sweepRadius = 0;
_local3 = 0;
while (_local3 < m_vertexCount) {
_local2 = m_coreVertices[_local3];
_local4 = (_local2.x - _arg1.x);
_local5 = (_local2.y - _arg1.y);
_local4 = Math.sqrt(((_local4 * _local4) + (_local5 * _local5)));
if (_local4 > m_sweepRadius){
m_sweepRadius = _local4;
};
_local3++;
};
}
override public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:b2Mat22;
var _local6:b2Mat22;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local5 = s_computeMat;
_local3 = _arg2.R;
_local4 = m_obb.R.col1;
_local5.col1.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
_local5.col1.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
_local4 = m_obb.R.col2;
_local5.col2.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
_local5.col2.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
_local5.Abs();
_local6 = _local5;
_local4 = m_obb.extents;
_local7 = ((_local6.col1.x * _local4.x) + (_local6.col2.x * _local4.y));
_local8 = ((_local6.col1.y * _local4.x) + (_local6.col2.y * _local4.y));
_local3 = _arg2.R;
_local4 = m_obb.center;
_local9 = (_arg2.position.x + ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y)));
_local10 = (_arg2.position.y + ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y)));
_arg1.lowerBound.Set((_local9 - _local7), (_local10 - _local8));
_arg1.upperBound.Set((_local9 + _local7), (_local10 + _local8));
}
public static function ComputeCentroid(_arg1:Array, _arg2:int):b2Vec2{
var _local3:b2Vec2;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:int;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
_local3 = new b2Vec2();
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local7 = (1 / 3);
_local8 = 0;
while (_local8 < _arg2) {
_local9 = _arg1[_local8];
_local10 = (((_local8 + 1) < _arg2)) ? _arg1[int((_local8 + 1))] : _arg1[0];
_local11 = (_local9.x - _local5);
_local12 = (_local9.y - _local6);
_local13 = (_local10.x - _local5);
_local14 = (_local10.y - _local6);
_local15 = ((_local11 * _local14) - (_local12 * _local13));
_local16 = (0.5 * _local15);
_local4 = (_local4 + _local16);
_local3.x = (_local3.x + ((_local16 * _local7) * ((_local5 + _local9.x) + _local10.x)));
_local3.y = (_local3.y + ((_local16 * _local7) * ((_local6 + _local9.y) + _local10.y)));
_local8++;
};
_local3.x = (_local3.x * (1 / _local4));
_local3.y = (_local3.y * (1 / _local4));
return (_local3);
}
public static function ComputeOBB(_arg1:b2OBB, _arg2:Array, _arg3:int):void{
var _local4:int;
var _local5:Array;
var _local6:Number;
var _local7:b2Vec2;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:int;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:b2Mat22;
_local5 = new Array((b2Settings.b2_maxPolygonVertices + 1));
_local4 = 0;
while (_local4 < _arg3) {
_local5[_local4] = _arg2[_local4];
_local4++;
};
_local5[_arg3] = _local5[0];
_local6 = Number.MAX_VALUE;
_local4 = 1;
while (_local4 <= _arg3) {
_local7 = _local5[int((_local4 - 1))];
_local8 = (_local5[_local4].x - _local7.x);
_local9 = (_local5[_local4].y - _local7.y);
_local10 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9)));
_local8 = (_local8 / _local10);
_local9 = (_local9 / _local10);
_local11 = -(_local9);
_local12 = _local8;
_local13 = Number.MAX_VALUE;
_local14 = Number.MAX_VALUE;
_local15 = -(Number.MAX_VALUE);
_local16 = -(Number.MAX_VALUE);
_local17 = 0;
while (_local17 < _arg3) {
_local19 = (_local5[_local17].x - _local7.x);
_local20 = (_local5[_local17].y - _local7.y);
_local21 = ((_local8 * _local19) + (_local9 * _local20));
_local22 = ((_local11 * _local19) + (_local12 * _local20));
if (_local21 < _local13){
_local13 = _local21;
};
if (_local22 < _local14){
_local14 = _local22;
};
if (_local21 > _local15){
_local15 = _local21;
};
if (_local22 > _local16){
_local16 = _local22;
};
_local17++;
};
_local18 = ((_local15 - _local13) * (_local16 - _local14));
if (_local18 < (0.95 * _local6)){
_local6 = _local18;
_arg1.R.col1.x = _local8;
_arg1.R.col1.y = _local9;
_arg1.R.col2.x = _local11;
_arg1.R.col2.y = _local12;
_local23 = (0.5 * (_local13 + _local15));
_local24 = (0.5 * (_local14 + _local16));
_local25 = _arg1.R;
_arg1.center.x = (_local7.x + ((_local25.col1.x * _local23) + (_local25.col2.x * _local24)));
_arg1.center.y = (_local7.y + ((_local25.col1.y * _local23) + (_local25.col2.y * _local24)));
_arg1.extents.x = (0.5 * (_local15 - _local13));
_arg1.extents.y = (0.5 * (_local16 - _local14));
};
_local4++;
};
}
}
}//package Box2D.Collision.Shapes
Section 7
//b2Shape (Box2D.Collision.Shapes.b2Shape)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
public class b2Shape {
public var m_type:int;
public var m_sweepRadius:Number;
public var m_density:Number;
public var m_filter:b2FilterData;
public var m_friction:Number;
public var m_next:b2Shape;
public var m_restitution:Number;
public var m_userData;
public var m_isSensor:Boolean;
public var m_proxyId:uint;
public var m_body:b2Body;
public static const e_polygonShape:int = 1;
public static const e_unknownShape:int = -1;
public static const e_circleShape:int = 0;
public static const e_shapeTypeCount:int = 2;
private static var s_resetAABB:b2AABB = new b2AABB();
private static var s_syncAABB:b2AABB = new b2AABB();
private static var s_proxyAABB:b2AABB = new b2AABB();
public function b2Shape(_arg1:b2ShapeDef){
m_userData = _arg1.userData;
m_friction = _arg1.friction;
m_restitution = _arg1.restitution;
m_density = _arg1.density;
m_body = null;
m_sweepRadius = 0;
m_next = null;
m_proxyId = b2Pair.b2_nullProxy;
m_filter = _arg1.filter.Copy();
m_isSensor = _arg1.isSensor;
}
public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
return (false);
}
public function GetSweepRadius():Number{
return (m_sweepRadius);
}
public function GetNext():b2Shape{
return (m_next);
}
public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
}
public function GetType():int{
return (m_type);
}
public function GetRestitution():Number{
return (m_restitution);
}
public function GetFriction():Number{
return (m_friction);
}
public function GetFilterData():b2FilterData{
return (m_filter.Copy());
}
public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):Boolean{
return (false);
}
public function RefilterProxy(_arg1:b2BroadPhase, _arg2:b2XForm):void{
var _local3:b2AABB;
var _local4:Boolean;
if (m_proxyId == b2Pair.b2_nullProxy){
return;
};
_arg1.DestroyProxy(m_proxyId);
_local3 = s_resetAABB;
ComputeAABB(_local3, _arg2);
_local4 = _arg1.InRange(_local3);
if (_local4){
m_proxyId = _arg1.CreateProxy(_local3, this);
} else {
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function SetFilterData(_arg1:b2FilterData):void{
m_filter = _arg1.Copy();
}
public function GetUserData(){
return (m_userData);
}
public function Synchronize(_arg1:b2BroadPhase, _arg2:b2XForm, _arg3:b2XForm):Boolean{
var _local4:b2AABB;
if (m_proxyId == b2Pair.b2_nullProxy){
return (false);
};
_local4 = s_syncAABB;
ComputeSweptAABB(_local4, _arg2, _arg3);
if (_arg1.InRange(_local4)){
_arg1.MoveProxy(m_proxyId, _local4);
return (true);
};
return (false);
}
public function ComputeMass(_arg1:b2MassData):void{
}
public function IsSensor():Boolean{
return (m_isSensor);
}
public function DestroyProxy(_arg1:b2BroadPhase):void{
if (m_proxyId != b2Pair.b2_nullProxy){
_arg1.DestroyProxy(m_proxyId);
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function UpdateSweepRadius(_arg1:b2Vec2):void{
}
public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{
}
public function GetBody():b2Body{
return (m_body);
}
public function CreateProxy(_arg1:b2BroadPhase, _arg2:b2XForm):void{
var _local3:b2AABB;
var _local4:Boolean;
_local3 = s_proxyAABB;
ComputeAABB(_local3, _arg2);
_local4 = _arg1.InRange(_local3);
if (_local4){
m_proxyId = _arg1.CreateProxy(_local3, this);
} else {
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public static function Destroy(_arg1:b2Shape, _arg2):void{
}
public static function Create(_arg1:b2ShapeDef, _arg2):b2Shape{
switch (_arg1.type){
case e_circleShape:
return (new b2CircleShape(_arg1));
case e_polygonShape:
return (new b2PolygonShape(_arg1));
default:
return (null);
};
}
}
}//package Box2D.Collision.Shapes
Section 8
//b2ShapeDef (Box2D.Collision.Shapes.b2ShapeDef)
package Box2D.Collision.Shapes {
public class b2ShapeDef {
public var isSensor:Boolean;// = false
public var density:Number;// = 0
public var type:int;
public var restitution:Number;// = 0
public var userData;// = null
public var filter:b2FilterData;
public var friction:Number;// = 0.2
public function b2ShapeDef(){
type = b2Shape.e_unknownShape;
userData = null;
friction = 0.2;
restitution = 0;
density = 0;
isSensor = false;
filter = new b2FilterData();
super();
}
}
}//package Box2D.Collision.Shapes
Section 9
//b2AABB (Box2D.Collision.b2AABB)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2AABB {
public var upperBound:b2Vec2;
public var lowerBound:b2Vec2;
public function b2AABB(){
lowerBound = new b2Vec2();
upperBound = new b2Vec2();
super();
}
public function IsValid():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:Boolean;
_local1 = (upperBound.x - lowerBound.x);
_local2 = (upperBound.y - lowerBound.y);
_local3 = (((_local1 >= 0)) && ((_local2 >= 0)));
_local3 = ((((_local3) && (lowerBound.IsValid()))) && (upperBound.IsValid()));
return (_local3);
}
}
}//package Box2D.Collision
Section 10
//b2Bound (Box2D.Collision.b2Bound)
package Box2D.Collision {
public class b2Bound {
public var proxyId:uint;
public var stabbingCount:uint;
public var value:uint;
public function Swap(_arg1:b2Bound):void{
var _local2:uint;
var _local3:uint;
var _local4:uint;
_local2 = value;
_local3 = proxyId;
_local4 = stabbingCount;
value = _arg1.value;
proxyId = _arg1.proxyId;
stabbingCount = _arg1.stabbingCount;
_arg1.value = _local2;
_arg1.proxyId = _local3;
_arg1.stabbingCount = _local4;
}
public function IsLower():Boolean{
return (((value & 1) == 0));
}
public function IsUpper():Boolean{
return (((value & 1) == 1));
}
}
}//package Box2D.Collision
Section 11
//b2BoundValues (Box2D.Collision.b2BoundValues)
package Box2D.Collision {
public class b2BoundValues {
public var lowerValues:Array;
public var upperValues:Array;
public function b2BoundValues(){
lowerValues = [0, 0];
upperValues = [0, 0];
super();
}
}
}//package Box2D.Collision
Section 12
//b2BroadPhase (Box2D.Collision.b2BroadPhase)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2BroadPhase {
public var m_quantizationFactor:b2Vec2;
public var m_worldAABB:b2AABB;
public var m_bounds:Array;
public var m_freeProxy:uint;
public var m_proxyCount:int;
public var m_proxyPool:Array;
public var m_queryResultCount:int;
public var m_pairManager:b2PairManager;
public var m_timeStamp:uint;
public var m_queryResults:Array;
public static const b2_nullEdge:uint = b2Settings.USHRT_MAX;
public static const b2_invalid:uint = b2Settings.USHRT_MAX;
public static var s_validate:Boolean = false;
public function b2BroadPhase(_arg1:b2AABB, _arg2:b2PairCallback){
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:b2Proxy;
var _local7:int;
m_pairManager = new b2PairManager();
m_proxyPool = new Array(b2Settings.b2_maxPairs);
m_bounds = new Array((2 * b2Settings.b2_maxProxies));
m_queryResults = new Array(b2Settings.b2_maxProxies);
m_quantizationFactor = new b2Vec2();
super();
m_pairManager.Initialize(this, _arg2);
m_worldAABB = _arg1;
m_proxyCount = 0;
_local3 = 0;
while (_local3 < b2Settings.b2_maxProxies) {
m_queryResults[_local3] = 0;
_local3++;
};
m_bounds = new Array(2);
_local3 = 0;
while (_local3 < 2) {
m_bounds[_local3] = new Array((2 * b2Settings.b2_maxProxies));
_local7 = 0;
while (_local7 < (2 * b2Settings.b2_maxProxies)) {
m_bounds[_local3][_local7] = new b2Bound();
_local7++;
};
_local3++;
};
_local4 = (_arg1.upperBound.x - _arg1.lowerBound.x);
_local5 = (_arg1.upperBound.y - _arg1.lowerBound.y);
m_quantizationFactor.x = (b2Settings.USHRT_MAX / _local4);
m_quantizationFactor.y = (b2Settings.USHRT_MAX / _local5);
_local3 = 0;
while (_local3 < (b2Settings.b2_maxProxies - 1)) {
_local6 = new b2Proxy();
m_proxyPool[_local3] = _local6;
_local6.SetNext((_local3 + 1));
_local6.timeStamp = 0;
_local6.overlapCount = b2_invalid;
_local6.userData = null;
_local3++;
};
_local6 = new b2Proxy();
m_proxyPool[int((b2Settings.b2_maxProxies - 1))] = _local6;
_local6.SetNext(b2Pair.b2_nullProxy);
_local6.timeStamp = 0;
_local6.overlapCount = b2_invalid;
_local6.userData = null;
m_freeProxy = 0;
m_timeStamp = 1;
m_queryResultCount = 0;
}
public function QueryAABB(_arg1:b2AABB, _arg2, _arg3:int):int{
var _local4:Array;
var _local5:Array;
var _local6:uint;
var _local7:uint;
var _local8:Array;
var _local9:Array;
var _local10:int;
var _local11:int;
var _local12:b2Proxy;
_local4 = new Array();
_local5 = new Array();
ComputeBounds(_local4, _local5, _arg1);
_local8 = [_local6];
_local9 = [_local7];
Query(_local8, _local9, _local4[0], _local5[0], m_bounds[0], (2 * m_proxyCount), 0);
Query(_local8, _local9, _local4[1], _local5[1], m_bounds[1], (2 * m_proxyCount), 1);
_local10 = 0;
_local11 = 0;
while ((((_local11 < m_queryResultCount)) && ((_local10 < _arg3)))) {
_local12 = m_proxyPool[m_queryResults[_local11]];
_arg2[_local11] = _local12.userData;
_local11++;
_local10++;
};
m_queryResultCount = 0;
IncrementTimeStamp();
return (_local10);
}
public function Commit():void{
m_pairManager.Commit();
}
public function GetProxy(_arg1:int):b2Proxy{
var _local2:b2Proxy;
_local2 = m_proxyPool[_arg1];
if ((((_arg1 == b2Pair.b2_nullProxy)) || ((_local2.IsValid() == false)))){
return (null);
};
return (_local2);
}
private function IncrementTimeStamp():void{
var _local1:uint;
if (m_timeStamp == b2Settings.USHRT_MAX){
_local1 = 0;
while (_local1 < b2Settings.b2_maxProxies) {
(m_proxyPool[_local1] as b2Proxy).timeStamp = 0;
_local1++;
};
m_timeStamp = 1;
} else {
m_timeStamp++;
};
}
private function Query(_arg1:Array, _arg2:Array, _arg3:uint, _arg4:uint, _arg5:Array, _arg6:uint, _arg7:int):void{
var _local8:uint;
var _local9:uint;
var _local10:b2Bound;
var _local11:uint;
var _local12:int;
var _local13:int;
var _local14:b2Proxy;
_local8 = BinarySearch(_arg5, _arg6, _arg3);
_local9 = BinarySearch(_arg5, _arg6, _arg4);
_local11 = _local8;
while (_local11 < _local9) {
_local10 = _arg5[_local11];
if (_local10.IsLower()){
IncrementOverlapCount(_local10.proxyId);
};
_local11++;
};
if (_local8 > 0){
_local12 = (_local8 - 1);
_local10 = _arg5[_local12];
_local13 = _local10.stabbingCount;
while (_local13) {
_local10 = _arg5[_local12];
if (_local10.IsLower()){
_local14 = m_proxyPool[_local10.proxyId];
if (_local8 <= _local14.upperBounds[_arg7]){
IncrementOverlapCount(_local10.proxyId);
_local13--;
};
};
_local12--;
};
};
_arg1[0] = _local8;
_arg2[0] = _local9;
}
private function TestOverlapValidate(_arg1:b2Proxy, _arg2:b2Proxy):Boolean{
var _local3:int;
var _local4:Array;
var _local5:b2Bound;
var _local6:b2Bound;
_local3 = 0;
while (_local3 < 2) {
_local4 = m_bounds[_local3];
_local5 = _local4[_arg1.lowerBounds[_local3]];
_local6 = _local4[_arg2.upperBounds[_local3]];
if (_local5.value > _local6.value){
return (false);
};
_local5 = _local4[_arg1.upperBounds[_local3]];
_local6 = _local4[_arg2.lowerBounds[_local3]];
if (_local5.value < _local6.value){
return (false);
};
_local3++;
};
return (true);
}
private function ComputeBounds(_arg1:Array, _arg2:Array, _arg3:b2AABB):void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local4 = _arg3.lowerBound.x;
_local5 = _arg3.lowerBound.y;
_local4 = b2Math.b2Min(_local4, m_worldAABB.upperBound.x);
_local5 = b2Math.b2Min(_local5, m_worldAABB.upperBound.y);
_local4 = b2Math.b2Max(_local4, m_worldAABB.lowerBound.x);
_local5 = b2Math.b2Max(_local5, m_worldAABB.lowerBound.y);
_local6 = _arg3.upperBound.x;
_local7 = _arg3.upperBound.y;
_local6 = b2Math.b2Min(_local6, m_worldAABB.upperBound.x);
_local7 = b2Math.b2Min(_local7, m_worldAABB.upperBound.y);
_local6 = b2Math.b2Max(_local6, m_worldAABB.lowerBound.x);
_local7 = b2Math.b2Max(_local7, m_worldAABB.lowerBound.y);
_arg1[0] = (uint((m_quantizationFactor.x * (_local4 - m_worldAABB.lowerBound.x))) & (b2Settings.USHRT_MAX - 1));
_arg2[0] = ((uint((m_quantizationFactor.x * (_local6 - m_worldAABB.lowerBound.x))) & 0xFFFF) | 1);
_arg1[1] = (uint((m_quantizationFactor.y * (_local5 - m_worldAABB.lowerBound.y))) & (b2Settings.USHRT_MAX - 1));
_arg2[1] = ((uint((m_quantizationFactor.y * (_local7 - m_worldAABB.lowerBound.y))) & 0xFFFF) | 1);
}
public function CreateProxy(_arg1:b2AABB, _arg2):uint{
var _local3:uint;
var _local4:b2Proxy;
var _local5:uint;
var _local6:uint;
var _local7:Array;
var _local8:Array;
var _local9:int;
var _local10:int;
var _local11:Array;
var _local12:uint;
var _local13:uint;
var _local14:Array;
var _local15:Array;
var _local16:Array;
var _local17:int;
var _local18:int;
var _local19:b2Bound;
var _local20:b2Bound;
var _local21:b2Bound;
var _local22:int;
var _local23:b2Proxy;
_local5 = m_freeProxy;
_local4 = m_proxyPool[_local5];
m_freeProxy = _local4.GetNext();
_local4.overlapCount = 0;
_local4.userData = _arg2;
_local6 = (2 * m_proxyCount);
_local7 = new Array();
_local8 = new Array();
ComputeBounds(_local7, _local8, _arg1);
_local9 = 0;
while (_local9 < 2) {
_local11 = m_bounds[_local9];
_local14 = [_local12];
_local15 = [_local13];
Query(_local14, _local15, _local7[_local9], _local8[_local9], _local11, _local6, _local9);
_local12 = _local14[0];
_local13 = _local15[0];
_local16 = new Array();
_local18 = (_local6 - _local13);
_local17 = 0;
while (_local17 < _local18) {
_local16[_local17] = new b2Bound();
_local19 = _local16[_local17];
_local20 = _local11[int((_local13 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local18 = _local16.length;
_local22 = (_local13 + 2);
_local17 = 0;
while (_local17 < _local18) {
_local20 = _local16[_local17];
_local19 = _local11[int((_local22 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local16 = new Array();
_local18 = (_local13 - _local12);
_local17 = 0;
while (_local17 < _local18) {
_local16[_local17] = new b2Bound();
_local19 = _local16[_local17];
_local20 = _local11[int((_local12 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local18 = _local16.length;
_local22 = (_local12 + 1);
_local17 = 0;
while (_local17 < _local18) {
_local20 = _local16[_local17];
_local19 = _local11[int((_local22 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local13++;
_local19 = _local11[_local12];
_local20 = _local11[_local13];
_local19.value = _local7[_local9];
_local19.proxyId = _local5;
_local20.value = _local8[_local9];
_local20.proxyId = _local5;
_local21 = _local11[int((_local12 - 1))];
_local19.stabbingCount = ((_local12 == 0)) ? 0 : _local21.stabbingCount;
_local21 = _local11[int((_local13 - 1))];
_local20.stabbingCount = _local21.stabbingCount;
_local3 = _local12;
while (_local3 < _local13) {
_local21 = _local11[_local3];
_local21.stabbingCount++;
_local3++;
};
_local3 = _local12;
while (_local3 < (_local6 + 2)) {
_local19 = _local11[_local3];
_local23 = m_proxyPool[_local19.proxyId];
if (_local19.IsLower()){
_local23.lowerBounds[_local9] = _local3;
} else {
_local23.upperBounds[_local9] = _local3;
};
_local3++;
};
_local9++;
};
m_proxyCount++;
_local10 = 0;
while (_local10 < m_queryResultCount) {
m_pairManager.AddBufferedPair(_local5, m_queryResults[_local10]);
_local10++;
};
m_pairManager.Commit();
m_queryResultCount = 0;
IncrementTimeStamp();
return (_local5);
}
public function DestroyProxy(_arg1:uint):void{
var _local2:b2Bound;
var _local3:b2Bound;
var _local4:b2Proxy;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:Array;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:Array;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:uint;
var _local18:int;
var _local19:b2Proxy;
_local4 = m_proxyPool[_arg1];
_local5 = (2 * m_proxyCount);
_local6 = 0;
while (_local6 < 2) {
_local8 = m_bounds[_local6];
_local9 = _local4.lowerBounds[_local6];
_local10 = _local4.upperBounds[_local6];
_local2 = _local8[_local9];
_local11 = _local2.value;
_local3 = _local8[_local10];
_local12 = _local3.value;
_local13 = new Array();
_local15 = ((_local10 - _local9) - 1);
_local14 = 0;
while (_local14 < _local15) {
_local13[_local14] = new b2Bound();
_local2 = _local13[_local14];
_local3 = _local8[int(((_local9 + 1) + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local15 = _local13.length;
_local16 = _local9;
_local14 = 0;
while (_local14 < _local15) {
_local3 = _local13[_local14];
_local2 = _local8[int((_local16 + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local13 = new Array();
_local15 = ((_local5 - _local10) - 1);
_local14 = 0;
while (_local14 < _local15) {
_local13[_local14] = new b2Bound();
_local2 = _local13[_local14];
_local3 = _local8[int(((_local10 + 1) + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local15 = _local13.length;
_local16 = (_local10 - 1);
_local14 = 0;
while (_local14 < _local15) {
_local3 = _local13[_local14];
_local2 = _local8[int((_local16 + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local15 = (_local5 - 2);
_local17 = _local9;
while (_local17 < _local15) {
_local2 = _local8[_local17];
_local19 = m_proxyPool[_local2.proxyId];
if (_local2.IsLower()){
_local19.lowerBounds[_local6] = _local17;
} else {
_local19.upperBounds[_local6] = _local17;
};
_local17++;
};
_local15 = (_local10 - 1);
_local18 = _local9;
while (_local18 < _local15) {
_local2 = _local8[_local18];
_local2.stabbingCount--;
_local18++;
};
Query([0], [0], _local11, _local12, _local8, (_local5 - 2), _local6);
_local6++;
};
_local7 = 0;
while (_local7 < m_queryResultCount) {
m_pairManager.RemoveBufferedPair(_arg1, m_queryResults[_local7]);
_local7++;
};
m_pairManager.Commit();
m_queryResultCount = 0;
IncrementTimeStamp();
_local4.userData = null;
_local4.overlapCount = b2_invalid;
_local4.lowerBounds[0] = b2_invalid;
_local4.lowerBounds[1] = b2_invalid;
_local4.upperBounds[0] = b2_invalid;
_local4.upperBounds[1] = b2_invalid;
_local4.SetNext(m_freeProxy);
m_freeProxy = _arg1;
m_proxyCount--;
}
public function TestOverlap(_arg1:b2BoundValues, _arg2:b2Proxy):Boolean{
var _local3:int;
var _local4:Array;
var _local5:b2Bound;
_local3 = 0;
while (_local3 < 2) {
_local4 = m_bounds[_local3];
_local5 = _local4[_arg2.upperBounds[_local3]];
if (_arg1.lowerValues[_local3] > _local5.value){
return (false);
};
_local5 = _local4[_arg2.lowerBounds[_local3]];
if (_arg1.upperValues[_local3] < _local5.value){
return (false);
};
_local3++;
};
return (true);
}
public function Validate():void{
var _local1:b2Pair;
var _local2:b2Proxy;
var _local3:b2Proxy;
var _local4:Boolean;
var _local5:int;
var _local6:b2Bound;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:b2Bound;
_local5 = 0;
while (_local5 < 2) {
_local6 = m_bounds[_local5];
_local7 = (2 * m_proxyCount);
_local8 = 0;
_local9 = 0;
while (_local9 < _local7) {
_local10 = _local6[_local9];
if (_local10.IsLower() == true){
_local8++;
} else {
_local8--;
};
_local9++;
};
_local5++;
};
}
private function IncrementOverlapCount(_arg1:uint):void{
var _local2:b2Proxy;
_local2 = m_proxyPool[_arg1];
if (_local2.timeStamp < m_timeStamp){
_local2.timeStamp = m_timeStamp;
_local2.overlapCount = 1;
} else {
_local2.overlapCount = 2;
m_queryResults[m_queryResultCount] = _arg1;
m_queryResultCount++;
};
}
public function InRange(_arg1:b2AABB):Boolean{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = _arg1.lowerBound.x;
_local3 = _arg1.lowerBound.y;
_local2 = (_local2 - m_worldAABB.upperBound.x);
_local3 = (_local3 - m_worldAABB.upperBound.y);
_local4 = m_worldAABB.lowerBound.x;
_local5 = m_worldAABB.lowerBound.y;
_local4 = (_local4 - _arg1.upperBound.x);
_local5 = (_local5 - _arg1.upperBound.y);
_local2 = b2Math.b2Max(_local2, _local4);
_local3 = b2Math.b2Max(_local3, _local5);
return ((b2Math.b2Max(_local2, _local3) < 0));
}
public function MoveProxy(_arg1:uint, _arg2:b2AABB):void{
var _local3:Array;
var _local4:int;
var _local5:uint;
var _local6:uint;
var _local7:b2Bound;
var _local8:b2Bound;
var _local9:b2Bound;
var _local10:uint;
var _local11:b2Proxy;
var _local12:uint;
var _local13:b2Proxy;
var _local14:b2BoundValues;
var _local15:b2BoundValues;
var _local16:Array;
var _local17:uint;
var _local18:uint;
var _local19:uint;
var _local20:uint;
var _local21:int;
var _local22:int;
var _local23:uint;
var _local24:b2Proxy;
if ((((_arg1 == b2Pair.b2_nullProxy)) || ((b2Settings.b2_maxProxies <= _arg1)))){
return;
};
if (_arg2.IsValid() == false){
return;
};
_local12 = (2 * m_proxyCount);
_local13 = m_proxyPool[_arg1];
_local14 = new b2BoundValues();
ComputeBounds(_local14.lowerValues, _local14.upperValues, _arg2);
_local15 = new b2BoundValues();
_local5 = 0;
while (_local5 < 2) {
_local7 = m_bounds[_local5][_local13.lowerBounds[_local5]];
_local15.lowerValues[_local5] = _local7.value;
_local7 = m_bounds[_local5][_local13.upperBounds[_local5]];
_local15.upperValues[_local5] = _local7.value;
_local5++;
};
_local5 = 0;
while (_local5 < 2) {
_local16 = m_bounds[_local5];
_local17 = _local13.lowerBounds[_local5];
_local18 = _local13.upperBounds[_local5];
_local19 = _local14.lowerValues[_local5];
_local20 = _local14.upperValues[_local5];
_local7 = _local16[_local17];
_local21 = (_local19 - _local7.value);
_local7.value = _local19;
_local7 = _local16[_local18];
_local22 = (_local20 - _local7.value);
_local7.value = _local20;
if (_local21 < 0){
_local6 = _local17;
while ((((_local6 > 0)) && ((_local19 < (_local16[int((_local6 - 1))] as b2Bound).value)))) {
_local7 = _local16[_local6];
_local8 = _local16[int((_local6 - 1))];
_local23 = _local8.proxyId;
_local24 = m_proxyPool[_local8.proxyId];
_local8.stabbingCount++;
if (_local8.IsUpper() == true){
if (TestOverlap(_local14, _local24)){
m_pairManager.AddBufferedPair(_arg1, _local23);
};
_local3 = _local24.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount++;
} else {
_local3 = _local24.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount--;
};
_local3 = _local13.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.Swap(_local8);
_local6--;
};
};
if (_local22 > 0){
_local6 = _local18;
while ((((_local6 < (_local12 - 1))) && (((_local16[int((_local6 + 1))] as b2Bound).value <= _local20)))) {
_local7 = _local16[_local6];
_local9 = _local16[int((_local6 + 1))];
_local10 = _local9.proxyId;
_local11 = m_proxyPool[_local10];
_local9.stabbingCount++;
if (_local9.IsLower() == true){
if (TestOverlap(_local14, _local11)){
m_pairManager.AddBufferedPair(_arg1, _local10);
};
_local3 = _local11.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount++;
} else {
_local3 = _local11.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount--;
};
_local3 = _local13.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.Swap(_local9);
_local6++;
};
};
if (_local21 > 0){
_local6 = _local17;
while ((((_local6 < (_local12 - 1))) && (((_local16[int((_local6 + 1))] as b2Bound).value <= _local19)))) {
_local7 = _local16[_local6];
_local9 = _local16[int((_local6 + 1))];
_local10 = _local9.proxyId;
_local11 = m_proxyPool[_local10];
_local9.stabbingCount--;
if (_local9.IsUpper()){
if (TestOverlap(_local15, _local11)){
m_pairManager.RemoveBufferedPair(_arg1, _local10);
};
_local3 = _local11.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount--;
} else {
_local3 = _local11.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount++;
};
_local3 = _local13.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.Swap(_local9);
_local6++;
};
};
if (_local22 < 0){
_local6 = _local18;
while ((((_local6 > 0)) && ((_local20 < (_local16[int((_local6 - 1))] as b2Bound).value)))) {
_local7 = _local16[_local6];
_local8 = _local16[int((_local6 - 1))];
_local23 = _local8.proxyId;
_local24 = m_proxyPool[_local23];
_local8.stabbingCount--;
if (_local8.IsLower() == true){
if (TestOverlap(_local15, _local24)){
m_pairManager.RemoveBufferedPair(_arg1, _local23);
};
_local3 = _local24.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount--;
} else {
_local3 = _local24.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount++;
};
_local3 = _local13.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.Swap(_local8);
_local6--;
};
};
_local5++;
};
}
public static function BinarySearch(_arg1:Array, _arg2:int, _arg3:uint):uint{
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:b2Bound;
_local4 = 0;
_local5 = (_arg2 - 1);
while (_local4 <= _local5) {
_local6 = ((_local4 + _local5) / 2);
_local7 = _arg1[_local6];
if (_local7.value > _arg3){
_local5 = (_local6 - 1);
} else {
if (_local7.value < _arg3){
_local4 = (_local6 + 1);
} else {
return (uint(_local6));
};
};
};
return (uint(_local4));
}
}
}//package Box2D.Collision
Section 13
//b2BufferedPair (Box2D.Collision.b2BufferedPair)
package Box2D.Collision {
public class b2BufferedPair {
public var proxyId1:uint;
public var proxyId2:uint;
}
}//package Box2D.Collision
Section 14
//b2Collision (Box2D.Collision.b2Collision)
package Box2D.Collision {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Collision {
public static const b2_nullFeature:uint = 0xFF;
private static var b2CollidePolyTempVec:b2Vec2 = new b2Vec2();
public static function EdgeSeparation(_arg1:b2PolygonShape, _arg2:b2XForm, _arg3:int, _arg4:b2PolygonShape, _arg5:b2XForm):Number{
var _local6:int;
var _local7:Array;
var _local8:Array;
var _local9:int;
var _local10:Array;
var _local11:b2Mat22;
var _local12:b2Vec2;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:int;
var _local18:Number;
var _local19:int;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
_local6 = _arg1.m_vertexCount;
_local7 = _arg1.m_vertices;
_local8 = _arg1.m_normals;
_local9 = _arg4.m_vertexCount;
_local10 = _arg4.m_vertices;
_local11 = _arg2.R;
_local12 = _local8[_arg3];
_local13 = ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y));
_local14 = ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y));
_local11 = _arg5.R;
_local15 = ((_local11.col1.x * _local13) + (_local11.col1.y * _local14));
_local16 = ((_local11.col2.x * _local13) + (_local11.col2.y * _local14));
_local17 = 0;
_local18 = Number.MAX_VALUE;
_local19 = 0;
while (_local19 < _local9) {
_local12 = _local10[_local19];
_local25 = ((_local12.x * _local15) + (_local12.y * _local16));
if (_local25 < _local18){
_local18 = _local25;
_local17 = _local19;
};
_local19++;
};
_local12 = _local7[_arg3];
_local11 = _arg2.R;
_local20 = (_arg2.position.x + ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y)));
_local21 = (_arg2.position.y + ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y)));
_local12 = _local10[_local17];
_local11 = _arg5.R;
_local22 = (_arg5.position.x + ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y)));
_local23 = (_arg5.position.y + ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y)));
_local22 = (_local22 - _local20);
_local23 = (_local23 - _local21);
_local24 = ((_local22 * _local13) + (_local23 * _local14));
return (_local24);
}
public static function b2TestOverlap(_arg1:b2AABB, _arg2:b2AABB):Boolean{
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local3 = _arg2.lowerBound;
_local4 = _arg1.upperBound;
_local5 = (_local3.x - _local4.x);
_local6 = (_local3.y - _local4.y);
_local3 = _arg1.lowerBound;
_local4 = _arg2.upperBound;
_local7 = (_local3.x - _local4.x);
_local8 = (_local3.y - _local4.y);
if ((((_local5 > 0)) || ((_local6 > 0)))){
return (false);
};
if ((((_local7 > 0)) || ((_local8 > 0)))){
return (false);
};
return (true);
}
public static function FindIncidentEdge(_arg1:Array, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:int, _arg5:b2PolygonShape, _arg6:b2XForm):void{
var _local7:int;
var _local8:Array;
var _local9:int;
var _local10:Array;
var _local11:Array;
var _local12:b2Mat22;
var _local13:b2Vec2;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:int;
var _local18:Number;
var _local19:int;
var _local20:ClipVertex;
var _local21:int;
var _local22:int;
var _local23:Number;
_local7 = _arg2.m_vertexCount;
_local8 = _arg2.m_normals;
_local9 = _arg5.m_vertexCount;
_local10 = _arg5.m_vertices;
_local11 = _arg5.m_normals;
_local12 = _arg3.R;
_local13 = _local8[_arg4];
_local14 = ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y));
_local15 = ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y));
_local12 = _arg6.R;
_local16 = ((_local12.col1.x * _local14) + (_local12.col1.y * _local15));
_local15 = ((_local12.col2.x * _local14) + (_local12.col2.y * _local15));
_local14 = _local16;
_local17 = 0;
_local18 = Number.MAX_VALUE;
_local19 = 0;
while (_local19 < _local9) {
_local13 = _local11[_local19];
_local23 = ((_local14 * _local13.x) + (_local15 * _local13.y));
if (_local23 < _local18){
_local18 = _local23;
_local17 = _local19;
};
_local19++;
};
_local21 = _local17;
_local22 = (((_local21 + 1) < _local9)) ? (_local21 + 1) : 0;
_local20 = _arg1[0];
_local13 = _local10[_local21];
_local12 = _arg6.R;
_local20.v.x = (_arg6.position.x + ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y)));
_local20.v.y = (_arg6.position.y + ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y)));
_local20.id.features.referenceEdge = _arg4;
_local20.id.features.incidentEdge = _local21;
_local20.id.features.incidentVertex = 0;
_local20 = _arg1[1];
_local13 = _local10[_local22];
_local12 = _arg6.R;
_local20.v.x = (_arg6.position.x + ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y)));
_local20.v.y = (_arg6.position.y + ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y)));
_local20.id.features.referenceEdge = _arg4;
_local20.id.features.incidentEdge = _local22;
_local20.id.features.incidentVertex = 1;
}
public static function b2CollidePolygons(_arg1:b2Manifold, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2PolygonShape, _arg5:b2XForm):void{
var _local6:ClipVertex;
var _local7:int;
var _local8:Array;
var _local9:Number;
var _local10:int;
var _local11:Array;
var _local12:Number;
var _local13:b2PolygonShape;
var _local14:b2PolygonShape;
var _local15:b2XForm;
var _local16:b2XForm;
var _local17:int;
var _local18:uint;
var _local19:Number;
var _local20:Number;
var _local21:Array;
var _local22:int;
var _local23:Array;
var _local24:b2Vec2;
var _local25:b2Vec2;
var _local26:b2Vec2;
var _local27:b2Vec2;
var _local28:b2Vec2;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Array;
var _local33:Array;
var _local34:int;
var _local35:int;
var _local36:int;
var _local37:b2Vec2;
var _local38:Number;
var _local39:b2ManifoldPoint;
_arg1.pointCount = 0;
_local7 = 0;
_local8 = [_local7];
_local9 = FindMaxSeparation(_local8, _arg2, _arg3, _arg4, _arg5);
_local7 = _local8[0];
if (_local9 > 0){
return;
};
_local10 = 0;
_local11 = [_local10];
_local12 = FindMaxSeparation(_local11, _arg4, _arg5, _arg2, _arg3);
_local10 = _local11[0];
if (_local12 > 0){
return;
};
_local15 = new b2XForm();
_local16 = new b2XForm();
_local19 = 0.98;
_local20 = 0.001;
if (_local12 > ((_local19 * _local9) + _local20)){
_local13 = _arg4;
_local14 = _arg2;
_local15.Set(_arg5);
_local16.Set(_arg3);
_local17 = _local10;
_local18 = 1;
} else {
_local13 = _arg2;
_local14 = _arg4;
_local15.Set(_arg3);
_local16.Set(_arg5);
_local17 = _local7;
_local18 = 0;
};
_local21 = [new ClipVertex(), new ClipVertex()];
FindIncidentEdge(_local21, _local13, _local15, _local17, _local14, _local16);
_local22 = _local13.m_vertexCount;
_local23 = _local13.m_vertices;
_local24 = _local23[_local17];
_local25 = _local24.Copy();
if ((_local17 + 1) < _local22){
_local24 = _local23[int((_local17 + 1))];
_local37 = _local24.Copy();
} else {
_local24 = _local23[0];
_local37 = _local24.Copy();
};
_local26 = b2Math.SubtractVV(_local37, _local25);
_local27 = b2Math.b2MulMV(_local15.R, b2Math.SubtractVV(_local37, _local25));
_local27.Normalize();
_local28 = b2Math.b2CrossVF(_local27, 1);
_local25 = b2Math.b2MulX(_local15, _local25);
_local37 = b2Math.b2MulX(_local15, _local37);
_local29 = b2Math.b2Dot(_local28, _local25);
_local30 = -(b2Math.b2Dot(_local27, _local25));
_local31 = b2Math.b2Dot(_local27, _local37);
_local32 = [new ClipVertex(), new ClipVertex()];
_local33 = [new ClipVertex(), new ClipVertex()];
_local34 = ClipSegmentToLine(_local32, _local21, _local27.Negative(), _local30);
if (_local34 < 2){
return;
};
_local34 = ClipSegmentToLine(_local33, _local32, _local27, _local31);
if (_local34 < 2){
return;
};
_arg1.normal = (_local18) ? _local28.Negative() : _local28.Copy();
_local35 = 0;
_local36 = 0;
while (_local36 < b2Settings.b2_maxManifoldPoints) {
_local6 = _local33[_local36];
_local38 = (b2Math.b2Dot(_local28, _local6.v) - _local29);
if (_local38 <= 0){
_local39 = _arg1.points[_local35];
_local39.separation = _local38;
_local39.localPoint1 = b2Math.b2MulXT(_arg3, _local6.v);
_local39.localPoint2 = b2Math.b2MulXT(_arg5, _local6.v);
_local39.id.key = _local6.id._key;
_local39.id.features.flip = _local18;
_local35++;
};
_local36++;
};
_arg1.pointCount = _local35;
}
public static function FindMaxSeparation(_arg1:Array, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2PolygonShape, _arg5:b2XForm):Number{
var _local6:int;
var _local7:Array;
var _local8:b2Vec2;
var _local9:b2Mat22;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:int;
var _local15:Number;
var _local16:int;
var _local17:Number;
var _local18:int;
var _local19:Number;
var _local20:int;
var _local21:Number;
var _local22:int;
var _local23:Number;
var _local24:int;
var _local25:Number;
_local6 = _arg2.m_vertexCount;
_local7 = _arg2.m_normals;
_local9 = _arg5.R;
_local8 = _arg4.m_centroid;
_local10 = (_arg5.position.x + ((_local9.col1.x * _local8.x) + (_local9.col2.x * _local8.y)));
_local11 = (_arg5.position.y + ((_local9.col1.y * _local8.x) + (_local9.col2.y * _local8.y)));
_local9 = _arg3.R;
_local8 = _arg2.m_centroid;
_local10 = (_local10 - (_arg3.position.x + ((_local9.col1.x * _local8.x) + (_local9.col2.x * _local8.y))));
_local11 = (_local11 - (_arg3.position.y + ((_local9.col1.y * _local8.x) + (_local9.col2.y * _local8.y))));
_local12 = ((_local10 * _arg3.R.col1.x) + (_local11 * _arg3.R.col1.y));
_local13 = ((_local10 * _arg3.R.col2.x) + (_local11 * _arg3.R.col2.y));
_local14 = 0;
_local15 = -(Number.MAX_VALUE);
_local16 = 0;
while (_local16 < _local6) {
_local8 = _local7[_local16];
_local25 = ((_local8.x * _local12) + (_local8.y * _local13));
if (_local25 > _local15){
_local15 = _local25;
_local14 = _local16;
};
_local16++;
};
_local17 = EdgeSeparation(_arg2, _arg3, _local14, _arg4, _arg5);
if (_local17 > 0){
return (_local17);
};
_local18 = (((_local14 - 1) >= 0)) ? (_local14 - 1) : (_local6 - 1);
_local19 = EdgeSeparation(_arg2, _arg3, _local18, _arg4, _arg5);
if (_local19 > 0){
return (_local19);
};
_local20 = (((_local14 + 1) < _local6)) ? (_local14 + 1) : 0;
_local21 = EdgeSeparation(_arg2, _arg3, _local20, _arg4, _arg5);
if (_local21 > 0){
return (_local21);
};
if ((((_local19 > _local17)) && ((_local19 > _local21)))){
_local24 = -1;
_local22 = _local18;
_local23 = _local19;
} else {
if (_local21 > _local17){
_local24 = 1;
_local22 = _local20;
_local23 = _local21;
} else {
_arg1[0] = _local14;
return (_local17);
};
};
while (true) {
if (_local24 == -1){
_local14 = (((_local22 - 1) >= 0)) ? (_local22 - 1) : (_local6 - 1);
} else {
_local14 = (((_local22 + 1) < _local6)) ? (_local22 + 1) : 0;
};
_local17 = EdgeSeparation(_arg2, _arg3, _local14, _arg4, _arg5);
if (_local17 > 0){
return (_local17);
};
if (_local17 > _local23){
_local22 = _local14;
_local23 = _local17;
} else {
break;
};
};
_arg1[0] = _local22;
return (_local23);
}
public static function ClipSegmentToLine(_arg1:Array, _arg2:Array, _arg3:b2Vec2, _arg4:Number):int{
var _local5:ClipVertex;
var _local6:int;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:b2Vec2;
var _local13:ClipVertex;
_local6 = 0;
_local5 = _arg2[0];
_local7 = _local5.v;
_local5 = _arg2[1];
_local8 = _local5.v;
_local9 = (b2Math.b2Dot(_arg3, _local7) - _arg4);
_local10 = (b2Math.b2Dot(_arg3, _local8) - _arg4);
if (_local9 <= 0){
var _temp1 = _local6;
_local6 = (_local6 + 1);
var _local14 = _temp1;
_arg1[_local14] = _arg2[0];
};
if (_local10 <= 0){
var _temp2 = _local6;
_local6 = (_local6 + 1);
_local14 = _temp2;
_arg1[_local14] = _arg2[1];
};
if ((_local9 * _local10) < 0){
_local11 = (_local9 / (_local9 - _local10));
_local5 = _arg1[_local6];
_local12 = _local5.v;
_local12.x = (_local7.x + (_local11 * (_local8.x - _local7.x)));
_local12.y = (_local7.y + (_local11 * (_local8.y - _local7.y)));
_local5 = _arg1[_local6];
if (_local9 > 0){
_local13 = _arg2[0];
_local5.id = _local13.id;
} else {
_local13 = _arg2[1];
_local5.id = _local13.id;
};
_local6++;
};
return (_local6);
}
public static function b2CollideCircles(_arg1:b2Manifold, _arg2:b2CircleShape, _arg3:b2XForm, _arg4:b2CircleShape, _arg5:b2XForm):void{
var _local6:b2Mat22;
var _local7:b2Vec2;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:b2ManifoldPoint;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
_arg1.pointCount = 0;
_local6 = _arg3.R;
_local7 = _arg2.m_localPosition;
_local8 = (_arg3.position.x + ((_local6.col1.x * _local7.x) + (_local6.col2.x * _local7.y)));
_local9 = (_arg3.position.y + ((_local6.col1.y * _local7.x) + (_local6.col2.y * _local7.y)));
_local6 = _arg5.R;
_local7 = _arg4.m_localPosition;
_local10 = (_arg5.position.x + ((_local6.col1.x * _local7.x) + (_local6.col2.x * _local7.y)));
_local11 = (_arg5.position.y + ((_local6.col1.y * _local7.x) + (_local6.col2.y * _local7.y)));
_local12 = (_local10 - _local8);
_local13 = (_local11 - _local9);
_local14 = ((_local12 * _local12) + (_local13 * _local13));
_local15 = _arg2.m_radius;
_local16 = _arg4.m_radius;
_local17 = (_local15 + _local16);
if (_local14 > (_local17 * _local17)){
return;
};
if (_local14 < Number.MIN_VALUE){
_local18 = -(_local17);
_arg1.normal.Set(0, 1);
} else {
_local24 = Math.sqrt(_local14);
_local18 = (_local24 - _local17);
_local25 = (1 / _local24);
_arg1.normal.x = (_local25 * _local12);
_arg1.normal.y = (_local25 * _local13);
};
_arg1.pointCount = 1;
_local19 = _arg1.points[0];
_local19.id.key = 0;
_local19.separation = _local18;
_local8 = (_local8 + (_local15 * _arg1.normal.x));
_local9 = (_local9 + (_local15 * _arg1.normal.y));
_local10 = (_local10 - (_local16 * _arg1.normal.x));
_local11 = (_local11 - (_local16 * _arg1.normal.y));
_local20 = (0.5 * (_local8 + _local10));
_local21 = (0.5 * (_local9 + _local11));
_local22 = (_local20 - _arg3.position.x);
_local23 = (_local21 - _arg3.position.y);
_local19.localPoint1.x = ((_local22 * _arg3.R.col1.x) + (_local23 * _arg3.R.col1.y));
_local19.localPoint1.y = ((_local22 * _arg3.R.col2.x) + (_local23 * _arg3.R.col2.y));
_local22 = (_local20 - _arg5.position.x);
_local23 = (_local21 - _arg5.position.y);
_local19.localPoint2.x = ((_local22 * _arg5.R.col1.x) + (_local23 * _arg5.R.col1.y));
_local19.localPoint2.y = ((_local22 * _arg5.R.col2.x) + (_local23 * _arg5.R.col2.y));
}
public static function b2CollidePolygonAndCircle(_arg1:b2Manifold, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2CircleShape, _arg5:b2XForm):void{
var _local6:b2ManifoldPoint;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:b2Vec2;
var _local12:b2Mat22;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:int;
var _local19:Number;
var _local20:Number;
var _local21:int;
var _local22:Array;
var _local23:Array;
var _local24:int;
var _local25:int;
var _local26:int;
var _local27:b2Vec2;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
_arg1.pointCount = 0;
_local12 = _arg5.R;
_local11 = _arg4.m_localPosition;
_local13 = (_arg5.position.x + ((_local12.col1.x * _local11.x) + (_local12.col2.x * _local11.y)));
_local14 = (_arg5.position.y + ((_local12.col1.y * _local11.x) + (_local12.col2.y * _local11.y)));
_local7 = (_local13 - _arg3.position.x);
_local8 = (_local14 - _arg3.position.y);
_local12 = _arg3.R;
_local15 = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local16 = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local18 = 0;
_local19 = -(Number.MAX_VALUE);
_local20 = _arg4.m_radius;
_local21 = _arg2.m_vertexCount;
_local22 = _arg2.m_vertices;
_local23 = _arg2.m_normals;
_local24 = 0;
while (_local24 < _local21) {
_local11 = _local22[_local24];
_local7 = (_local15 - _local11.x);
_local8 = (_local16 - _local11.y);
_local11 = _local23[_local24];
_local34 = ((_local11.x * _local7) + (_local11.y * _local8));
if (_local34 > _local20){
return;
};
if (_local34 > _local19){
_local19 = _local34;
_local18 = _local24;
};
_local24++;
};
if (_local19 < Number.MIN_VALUE){
_arg1.pointCount = 1;
_local11 = _local23[_local18];
_local12 = _arg3.R;
_arg1.normal.x = ((_local12.col1.x * _local11.x) + (_local12.col2.x * _local11.y));
_arg1.normal.y = ((_local12.col1.y * _local11.x) + (_local12.col2.y * _local11.y));
_local6 = _arg1.points[0];
_local6.id.features.incidentEdge = _local18;
_local6.id.features.incidentVertex = b2_nullFeature;
_local6.id.features.referenceEdge = 0;
_local6.id.features.flip = 0;
_local9 = (_local13 - (_local20 * _arg1.normal.x));
_local10 = (_local14 - (_local20 * _arg1.normal.y));
_local7 = (_local9 - _arg3.position.x);
_local8 = (_local10 - _arg3.position.y);
_local12 = _arg3.R;
_local6.localPoint1.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint1.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local7 = (_local9 - _arg5.position.x);
_local8 = (_local10 - _arg5.position.y);
_local12 = _arg5.R;
_local6.localPoint2.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint2.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local6.separation = (_local19 - _local20);
return;
};
_local25 = _local18;
_local26 = (((_local25 + 1) < _local21)) ? (_local25 + 1) : 0;
_local11 = _local22[_local25];
_local27 = _local22[_local26];
_local28 = (_local27.x - _local11.x);
_local29 = (_local27.y - _local11.y);
_local30 = Math.sqrt(((_local28 * _local28) + (_local29 * _local29)));
_local28 = (_local28 / _local30);
_local29 = (_local29 / _local30);
_local7 = (_local15 - _local11.x);
_local8 = (_local16 - _local11.y);
_local31 = ((_local7 * _local28) + (_local8 * _local29));
_local6 = _arg1.points[0];
if (_local31 <= 0){
_local32 = _local11.x;
_local33 = _local11.y;
_local6.id.features.incidentEdge = b2_nullFeature;
_local6.id.features.incidentVertex = _local25;
} else {
if (_local31 >= _local30){
_local32 = _local27.x;
_local33 = _local27.y;
_local6.id.features.incidentEdge = b2_nullFeature;
_local6.id.features.incidentVertex = _local26;
} else {
_local32 = ((_local28 * _local31) + _local11.x);
_local33 = ((_local29 * _local31) + _local11.y);
_local6.id.features.incidentEdge = _local18;
_local6.id.features.incidentVertex = b2_nullFeature;
};
};
_local7 = (_local15 - _local32);
_local8 = (_local16 - _local33);
_local17 = Math.sqrt(((_local7 * _local7) + (_local8 * _local8)));
_local7 = (_local7 / _local17);
_local8 = (_local8 / _local17);
if (_local17 > _local20){
return;
};
_arg1.pointCount = 1;
_local12 = _arg3.R;
_arg1.normal.x = ((_local12.col1.x * _local7) + (_local12.col2.x * _local8));
_arg1.normal.y = ((_local12.col1.y * _local7) + (_local12.col2.y * _local8));
_local9 = (_local13 - (_local20 * _arg1.normal.x));
_local10 = (_local14 - (_local20 * _arg1.normal.y));
_local7 = (_local9 - _arg3.position.x);
_local8 = (_local10 - _arg3.position.y);
_local12 = _arg3.R;
_local6.localPoint1.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint1.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local7 = (_local9 - _arg5.position.x);
_local8 = (_local10 - _arg5.position.y);
_local12 = _arg5.R;
_local6.localPoint2.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint2.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local6.separation = (_local17 - _local20);
_local6.id.features.referenceEdge = 0;
_local6.id.features.flip = 0;
}
}
}//package Box2D.Collision
Section 15
//b2ContactID (Box2D.Collision.b2ContactID)
package Box2D.Collision {
public class b2ContactID {
public var _key:uint;
public var features:Features;
public function b2ContactID(){
features = new Features();
super();
features._m_id = this;
}
public function Set(_arg1:b2ContactID):void{
key = _arg1._key;
}
public function Copy():b2ContactID{
var _local1:b2ContactID;
_local1 = new b2ContactID();
_local1.key = key;
return (_local1);
}
public function get key():uint{
return (_key);
}
public function set key(_arg1:uint):void{
_key = _arg1;
features._referenceEdge = (_key & 0xFF);
features._incidentEdge = (((_key & 0xFF00) >> 8) & 0xFF);
features._incidentVertex = (((_key & 0xFF0000) >> 16) & 0xFF);
features._flip = (((_key & 4278190080) >> 24) & 0xFF);
}
}
}//package Box2D.Collision
Section 16
//b2ContactPoint (Box2D.Collision.b2ContactPoint)
package Box2D.Collision {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
public class b2ContactPoint {
public var separation:Number;
public var normal:b2Vec2;
public var position:b2Vec2;
public var restitution:Number;
public var shape1:b2Shape;
public var shape2:b2Shape;
public var id:b2ContactID;
public var friction:Number;
public var velocity:b2Vec2;
public function b2ContactPoint(){
position = new b2Vec2();
velocity = new b2Vec2();
normal = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Collision
Section 17
//b2Distance (Box2D.Collision.b2Distance)
package Box2D.Collision {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Distance {
private static var s_p2s:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
private static var s_p1s:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
private static var s_points:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
private static var gPoint:b2Point = new b2Point();
public static var g_GJK_Iterations:int = 0;
public static function InPoints(_arg1:b2Vec2, _arg2:Array, _arg3:int):Boolean{
var _local4:Number;
var _local5:int;
var _local6:b2Vec2;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local4 = (100 * Number.MIN_VALUE);
_local5 = 0;
while (_local5 < _arg3) {
_local6 = _arg2[_local5];
_local7 = Math.abs((_arg1.x - _local6.x));
_local8 = Math.abs((_arg1.y - _local6.y));
_local9 = Math.max(Math.abs(_arg1.x), Math.abs(_local6.x));
_local10 = Math.max(Math.abs(_arg1.y), Math.abs(_local6.y));
if ((((_local7 < (_local4 * (_local9 + 1)))) && ((_local8 < (_local4 * (_local10 + 1)))))){
return (true);
};
_local5++;
};
return (false);
}
public static function DistanceGeneric(_arg1:b2Vec2, _arg2:b2Vec2, _arg3, _arg4:b2XForm, _arg5, _arg6:b2XForm):Number{
var _local7:b2Vec2;
var _local8:Array;
var _local9:Array;
var _local10:Array;
var _local11:int;
var _local12:Number;
var _local13:int;
var _local14:int;
var _local15:Number;
var _local16:Number;
var _local17:b2Vec2;
var _local18:b2Vec2;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:int;
_local8 = s_p1s;
_local9 = s_p2s;
_local10 = s_points;
_local11 = 0;
_arg1.SetV(_arg3.GetFirstVertex(_arg4));
_arg2.SetV(_arg5.GetFirstVertex(_arg6));
_local12 = 0;
_local13 = 20;
_local14 = 0;
while (_local14 < _local13) {
_local15 = (_arg2.x - _arg1.x);
_local16 = (_arg2.y - _arg1.y);
_local17 = _arg3.Support(_arg4, _local15, _local16);
_local18 = _arg5.Support(_arg6, -(_local15), -(_local16));
_local12 = ((_local15 * _local15) + (_local16 * _local16));
_local19 = (_local18.x - _local17.x);
_local20 = (_local18.y - _local17.y);
_local21 = ((_local15 * _local19) + (_local16 * _local20));
if ((_local12 - _local21) <= (0.01 * _local12)){
if (_local11 == 0){
_arg1.SetV(_local17);
_arg2.SetV(_local18);
};
g_GJK_Iterations = _local14;
return (Math.sqrt(_local12));
};
switch (_local11){
case 0:
_local7 = _local8[0];
_local7.SetV(_local17);
_local7 = _local9[0];
_local7.SetV(_local18);
_local7 = _local10[0];
_local7.x = _local19;
_local7.y = _local20;
_arg1.SetV(_local8[0]);
_arg2.SetV(_local9[0]);
_local11++;
break;
case 1:
_local7 = _local8[1];
_local7.SetV(_local17);
_local7 = _local9[1];
_local7.SetV(_local18);
_local7 = _local10[1];
_local7.x = _local19;
_local7.y = _local20;
_local11 = ProcessTwo(_arg1, _arg2, _local8, _local9, _local10);
break;
case 2:
_local7 = _local8[2];
_local7.SetV(_local17);
_local7 = _local9[2];
_local7.SetV(_local18);
_local7 = _local10[2];
_local7.x = _local19;
_local7.y = _local20;
_local11 = ProcessThree(_arg1, _arg2, _local8, _local9, _local10);
break;
};
if (_local11 == 3){
g_GJK_Iterations = _local14;
return (0);
};
_local22 = -(Number.MAX_VALUE);
_local23 = 0;
while (_local23 < _local11) {
_local7 = _local10[_local23];
_local22 = b2Math.b2Max(_local22, ((_local7.x * _local7.x) + (_local7.y * _local7.y)));
_local23++;
};
if ((((_local11 == 3)) || ((_local12 <= ((100 * Number.MIN_VALUE) * _local22))))){
g_GJK_Iterations = _local14;
_local15 = (_arg2.x - _arg1.x);
_local16 = (_arg2.y - _arg1.y);
_local12 = ((_local15 * _local15) + (_local16 * _local16));
return (Math.sqrt(_local12));
};
_local14++;
};
g_GJK_Iterations = _local13;
return (Math.sqrt(_local12));
}
public static function DistanceCC(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2CircleShape, _arg4:b2XForm, _arg5:b2CircleShape, _arg6:b2XForm):Number{
var _local7:b2Mat22;
var _local8:b2Vec2;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
_local7 = _arg4.R;
_local8 = _arg3.m_localPosition;
_local9 = (_arg4.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y)));
_local10 = (_arg4.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y)));
_local7 = _arg6.R;
_local8 = _arg5.m_localPosition;
_local11 = (_arg6.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y)));
_local12 = (_arg6.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y)));
_local13 = (_local11 - _local9);
_local14 = (_local12 - _local10);
_local15 = ((_local13 * _local13) + (_local14 * _local14));
_local16 = (_arg3.m_radius - b2Settings.b2_toiSlop);
_local17 = (_arg5.m_radius - b2Settings.b2_toiSlop);
_local18 = (_local16 + _local17);
if (_local15 > (_local18 * _local18)){
_local19 = Math.sqrt(_local15);
_local13 = (_local13 / _local19);
_local14 = (_local14 / _local19);
_local20 = (_local19 - _local18);
_arg1.x = (_local9 + (_local16 * _local13));
_arg1.y = (_local10 + (_local16 * _local14));
_arg2.x = (_local11 - (_local17 * _local13));
_arg2.y = (_local12 - (_local17 * _local14));
return (_local20);
};
if (_local15 > (Number.MIN_VALUE * Number.MIN_VALUE)){
_local19 = Math.sqrt(_local15);
_local13 = (_local13 / _local19);
_local14 = (_local14 / _local19);
_arg1.x = (_local9 + (_local16 * _local13));
_arg1.y = (_local10 + (_local16 * _local14));
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
return (0);
};
_arg1.x = _local9;
_arg1.y = _local10;
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
return (0);
}
public static function ProcessThree(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:Array, _arg4:Array, _arg5:Array):int{
var _local6:b2Vec2;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local12:b2Vec2;
var _local13:b2Vec2;
var _local14:b2Vec2;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Number;
_local6 = _arg5[0];
_local7 = _arg5[1];
_local8 = _arg5[2];
_local9 = _arg3[0];
_local10 = _arg3[1];
_local11 = _arg3[2];
_local12 = _arg4[0];
_local13 = _arg4[1];
_local14 = _arg4[2];
_local15 = _local6.x;
_local16 = _local6.y;
_local17 = _local7.x;
_local18 = _local7.y;
_local19 = _local8.x;
_local20 = _local8.y;
_local21 = (_local17 - _local15);
_local22 = (_local18 - _local16);
_local23 = (_local19 - _local15);
_local24 = (_local20 - _local16);
_local25 = (_local19 - _local17);
_local26 = (_local20 - _local18);
_local27 = -(((_local15 * _local21) + (_local16 * _local22)));
_local28 = ((_local17 * _local21) + (_local18 * _local22));
_local29 = -(((_local15 * _local23) + (_local16 * _local24)));
_local30 = ((_local19 * _local23) + (_local20 * _local24));
_local31 = -(((_local17 * _local25) + (_local18 * _local26)));
_local32 = ((_local19 * _local25) + (_local20 * _local26));
if ((((_local30 <= 0)) && ((_local32 <= 0)))){
_arg1.SetV(_local11);
_arg2.SetV(_local14);
_local9.SetV(_local11);
_local12.SetV(_local14);
_local6.SetV(_local8);
return (1);
};
_local33 = ((_local21 * _local24) - (_local22 * _local23));
_local34 = (_local33 * ((_local15 * _local18) - (_local16 * _local17)));
_local36 = (_local33 * ((_local17 * _local20) - (_local18 * _local19)));
if ((((((((_local36 <= 0)) && ((_local31 >= 0)))) && ((_local32 >= 0)))) && (((_local31 + _local32) > 0)))){
_local35 = (_local31 / (_local31 + _local32));
_arg1.x = (_local10.x + (_local35 * (_local11.x - _local10.x)));
_arg1.y = (_local10.y + (_local35 * (_local11.y - _local10.y)));
_arg2.x = (_local13.x + (_local35 * (_local14.x - _local13.x)));
_arg2.y = (_local13.y + (_local35 * (_local14.y - _local13.y)));
_local9.SetV(_local11);
_local12.SetV(_local14);
_local6.SetV(_local8);
return (2);
};
_local37 = (_local33 * ((_local19 * _local16) - (_local20 * _local15)));
if ((((((((_local37 <= 0)) && ((_local29 >= 0)))) && ((_local30 >= 0)))) && (((_local29 + _local30) > 0)))){
_local35 = (_local29 / (_local29 + _local30));
_arg1.x = (_local9.x + (_local35 * (_local11.x - _local9.x)));
_arg1.y = (_local9.y + (_local35 * (_local11.y - _local9.y)));
_arg2.x = (_local12.x + (_local35 * (_local14.x - _local12.x)));
_arg2.y = (_local12.y + (_local35 * (_local14.y - _local12.y)));
_local10.SetV(_local11);
_local13.SetV(_local14);
_local7.SetV(_local8);
return (2);
};
_local38 = ((_local36 + _local37) + _local34);
_local38 = (1 / _local38);
_local39 = (_local36 * _local38);
_local40 = (_local37 * _local38);
_local41 = ((1 - _local39) - _local40);
_arg1.x = (((_local39 * _local9.x) + (_local40 * _local10.x)) + (_local41 * _local11.x));
_arg1.y = (((_local39 * _local9.y) + (_local40 * _local10.y)) + (_local41 * _local11.y));
_arg2.x = (((_local39 * _local12.x) + (_local40 * _local13.x)) + (_local41 * _local14.x));
_arg2.y = (((_local39 * _local12.y) + (_local40 * _local13.y)) + (_local41 * _local14.y));
return (3);
}
public static function DistancePC(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2PolygonShape, _arg4:b2XForm, _arg5:b2CircleShape, _arg6:b2XForm):Number{
var _local7:b2Mat22;
var _local8:b2Vec2;
var _local9:b2Point;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
_local9 = gPoint;
_local8 = _arg5.m_localPosition;
_local7 = _arg6.R;
_local9.p.x = (_arg6.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y)));
_local9.p.y = (_arg6.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y)));
_local10 = DistanceGeneric(_arg1, _arg2, _arg3, _arg4, _local9, b2Math.b2XForm_identity);
_local11 = (_arg5.m_radius - b2Settings.b2_toiSlop);
if (_local10 > _local11){
_local10 = (_local10 - _local11);
_local12 = (_arg2.x - _arg1.x);
_local13 = (_arg2.y - _arg1.y);
_local14 = Math.sqrt(((_local12 * _local12) + (_local13 * _local13)));
_local12 = (_local12 / _local14);
_local13 = (_local13 / _local14);
_arg2.x = (_arg2.x - (_local11 * _local12));
_arg2.y = (_arg2.y - (_local11 * _local13));
} else {
_local10 = 0;
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
};
return (_local10);
}
public static function Distance(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Shape, _arg4:b2XForm, _arg5:b2Shape, _arg6:b2XForm):Number{
var _local7:int;
var _local8:int;
_local7 = _arg3.m_type;
_local8 = _arg5.m_type;
if ((((_local7 == b2Shape.e_circleShape)) && ((_local8 == b2Shape.e_circleShape)))){
return (DistanceCC(_arg1, _arg2, (_arg3 as b2CircleShape), _arg4, (_arg5 as b2CircleShape), _arg6));
};
if ((((_local7 == b2Shape.e_polygonShape)) && ((_local8 == b2Shape.e_circleShape)))){
return (DistancePC(_arg1, _arg2, (_arg3 as b2PolygonShape), _arg4, (_arg5 as b2CircleShape), _arg6));
};
if ((((_local7 == b2Shape.e_circleShape)) && ((_local8 == b2Shape.e_polygonShape)))){
return (DistancePC(_arg2, _arg1, (_arg5 as b2PolygonShape), _arg6, (_arg3 as b2CircleShape), _arg4));
};
if ((((_local7 == b2Shape.e_polygonShape)) && ((_local8 == b2Shape.e_polygonShape)))){
return (DistanceGeneric(_arg1, _arg2, (_arg3 as b2PolygonShape), _arg4, (_arg5 as b2PolygonShape), _arg6));
};
return (0);
}
public static function ProcessTwo(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:Array, _arg4:Array, _arg5:Array):int{
var _local6:b2Vec2;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
_local6 = _arg5[0];
_local7 = _arg5[1];
_local8 = _arg3[0];
_local9 = _arg3[1];
_local10 = _arg4[0];
_local11 = _arg4[1];
_local12 = -(_local7.x);
_local13 = -(_local7.y);
_local14 = (_local6.x - _local7.x);
_local15 = (_local6.y - _local7.y);
_local16 = Math.sqrt(((_local14 * _local14) + (_local15 * _local15)));
_local14 = (_local14 / _local16);
_local15 = (_local15 / _local16);
_local17 = ((_local12 * _local14) + (_local13 * _local15));
if ((((_local17 <= 0)) || ((_local16 < Number.MIN_VALUE)))){
_arg1.SetV(_local9);
_arg2.SetV(_local11);
_local8.SetV(_local9);
_local10.SetV(_local11);
_local6.SetV(_local7);
return (1);
};
_local17 = (_local17 / _local16);
_arg1.x = (_local9.x + (_local17 * (_local8.x - _local9.x)));
_arg1.y = (_local9.y + (_local17 * (_local8.y - _local9.y)));
_arg2.x = (_local11.x + (_local17 * (_local10.x - _local11.x)));
_arg2.y = (_local11.y + (_local17 * (_local10.y - _local11.y)));
return (2);
}
}
}//package Box2D.Collision
Section 18
//b2Manifold (Box2D.Collision.b2Manifold)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Manifold {
public var points:Array;
public var pointCount:int;// = 0
public var normal:b2Vec2;
public function b2Manifold(){
var _local1:int;
pointCount = 0;
super();
points = new Array(b2Settings.b2_maxManifoldPoints);
_local1 = 0;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
points[_local1] = new b2ManifoldPoint();
_local1++;
};
normal = new b2Vec2();
}
public function Set(_arg1:b2Manifold):void{
var _local2:int;
pointCount = _arg1.pointCount;
_local2 = 0;
while (_local2 < b2Settings.b2_maxManifoldPoints) {
(points[_local2] as b2ManifoldPoint).Set(_arg1.points[_local2]);
_local2++;
};
normal.SetV(_arg1.normal);
}
public function Reset():void{
var _local1:int;
_local1 = 0;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
(points[_local1] as b2ManifoldPoint).Reset();
_local1++;
};
normal.SetZero();
pointCount = 0;
}
}
}//package Box2D.Collision
Section 19
//b2ManifoldPoint (Box2D.Collision.b2ManifoldPoint)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2ManifoldPoint {
public var separation:Number;
public var localPoint2:b2Vec2;
public var normalImpulse:Number;
public var tangentImpulse:Number;
public var localPoint1:b2Vec2;
public var id:b2ContactID;
public function b2ManifoldPoint(){
localPoint1 = new b2Vec2();
localPoint2 = new b2Vec2();
id = new b2ContactID();
super();
}
public function Set(_arg1:b2ManifoldPoint):void{
localPoint1.SetV(_arg1.localPoint1);
localPoint2.SetV(_arg1.localPoint2);
separation = _arg1.separation;
normalImpulse = _arg1.normalImpulse;
tangentImpulse = _arg1.tangentImpulse;
id.key = _arg1.id.key;
}
public function Reset():void{
localPoint1.SetZero();
localPoint2.SetZero();
separation = 0;
normalImpulse = 0;
tangentImpulse = 0;
id.key = 0;
}
}
}//package Box2D.Collision
Section 20
//b2OBB (Box2D.Collision.b2OBB)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2OBB {
public var R:b2Mat22;
public var center:b2Vec2;
public var extents:b2Vec2;
public function b2OBB(){
R = new b2Mat22();
center = new b2Vec2();
extents = new b2Vec2();
super();
}
}
}//package Box2D.Collision
Section 21
//b2Pair (Box2D.Collision.b2Pair)
package Box2D.Collision {
import Box2D.Common.*;
public class b2Pair {
public var userData;// = null
public var proxyId1:uint;
public var proxyId2:uint;
public var status:uint;
public var next:uint;
public static var e_pairFinal:uint = 4;
public static var b2_tableMask:int = (b2_tableCapacity - 1);
public static var e_pairRemoved:uint = 2;
public static var b2_nullPair:uint = b2Settings.USHRT_MAX;
public static var e_pairBuffered:uint = 1;
public static var b2_nullProxy:uint = b2Settings.USHRT_MAX;
public static var b2_tableCapacity:int = b2Settings.b2_maxPairs;
public function b2Pair(){
userData = null;
super();
}
public function SetBuffered():void{
status = (status | e_pairBuffered);
}
public function IsBuffered():Boolean{
return (((status & e_pairBuffered) == e_pairBuffered));
}
public function IsFinal():Boolean{
return (((status & e_pairFinal) == e_pairFinal));
}
public function ClearRemoved():void{
status = (status & ~(e_pairRemoved));
}
public function SetFinal():void{
status = (status | e_pairFinal);
}
public function IsRemoved():Boolean{
return (((status & e_pairRemoved) == e_pairRemoved));
}
public function ClearBuffered():void{
status = (status & ~(e_pairBuffered));
}
public function SetRemoved():void{
status = (status | e_pairRemoved);
}
}
}//package Box2D.Collision
Section 22
//b2PairCallback (Box2D.Collision.b2PairCallback)
package Box2D.Collision {
public class b2PairCallback {
public function PairRemoved(_arg1, _arg2, _arg3):void{
}
public function PairAdded(_arg1, _arg2){
return (null);
}
}
}//package Box2D.Collision
Section 23
//b2PairManager (Box2D.Collision.b2PairManager)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2PairManager {
public var m_pairCount:int;
public var m_pairBuffer:Array;
public var m_callback:b2PairCallback;
public var m_pairs:Array;
public var m_pairBufferCount:int;
public var m_hashTable:Array;
public var m_broadPhase:b2BroadPhase;
public var m_freePair:uint;
public function b2PairManager(){
var _local1:uint;
super();
m_hashTable = new Array(b2Pair.b2_tableCapacity);
_local1 = 0;
while (_local1 < b2Pair.b2_tableCapacity) {
m_hashTable[_local1] = b2Pair.b2_nullPair;
_local1++;
};
m_pairs = new Array(b2Settings.b2_maxPairs);
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairs[_local1] = new b2Pair();
_local1++;
};
m_pairBuffer = new Array(b2Settings.b2_maxPairs);
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairBuffer[_local1] = new b2BufferedPair();
_local1++;
};
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairs[_local1].proxyId1 = b2Pair.b2_nullProxy;
m_pairs[_local1].proxyId2 = b2Pair.b2_nullProxy;
m_pairs[_local1].userData = null;
m_pairs[_local1].status = 0;
m_pairs[_local1].next = (_local1 + 1);
_local1++;
};
m_pairs[int((b2Settings.b2_maxPairs - 1))].next = b2Pair.b2_nullPair;
m_pairCount = 0;
m_pairBufferCount = 0;
}
private function FindHash(_arg1:uint, _arg2:uint, _arg3:uint):b2Pair{
var _local4:b2Pair;
var _local5:uint;
_local5 = m_hashTable[_arg3];
_local4 = m_pairs[_local5];
while (((!((_local5 == b2Pair.b2_nullPair))) && ((Equals(_local4, _arg1, _arg2) == false)))) {
_local5 = _local4.next;
_local4 = m_pairs[_local5];
};
if (_local5 == b2Pair.b2_nullPair){
return (null);
};
return (_local4);
}
private function Find(_arg1:uint, _arg2:uint):b2Pair{
var _local3:uint;
var _local4:uint;
if (_arg1 > _arg2){
_local4 = _arg1;
_arg1 = _arg2;
_arg2 = _local4;
};
_local3 = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
return (FindHash(_arg1, _arg2, _local3));
}
private function ValidateBuffer():void{
}
public function Commit():void{
var _local1:b2BufferedPair;
var _local2:int;
var _local3:int;
var _local4:Array;
var _local5:b2Pair;
var _local6:b2Proxy;
var _local7:b2Proxy;
_local3 = 0;
_local4 = m_broadPhase.m_proxyPool;
_local2 = 0;
while (_local2 < m_pairBufferCount) {
_local1 = m_pairBuffer[_local2];
_local5 = Find(_local1.proxyId1, _local1.proxyId2);
_local5.ClearBuffered();
_local6 = _local4[_local5.proxyId1];
_local7 = _local4[_local5.proxyId2];
if (_local5.IsRemoved()){
if (_local5.IsFinal() == true){
m_callback.PairRemoved(_local6.userData, _local7.userData, _local5.userData);
};
_local1 = m_pairBuffer[_local3];
_local1.proxyId1 = _local5.proxyId1;
_local1.proxyId2 = _local5.proxyId2;
_local3++;
} else {
if (_local5.IsFinal() == false){
_local5.userData = m_callback.PairAdded(_local6.userData, _local7.userData);
_local5.SetFinal();
};
};
_local2++;
};
_local2 = 0;
while (_local2 < _local3) {
_local1 = m_pairBuffer[_local2];
RemovePair(_local1.proxyId1, _local1.proxyId2);
_local2++;
};
m_pairBufferCount = 0;
if (b2BroadPhase.s_validate){
ValidateTable();
};
}
public function RemoveBufferedPair(_arg1:int, _arg2:int):void{
var _local3:b2BufferedPair;
var _local4:b2Pair;
_local4 = Find(_arg1, _arg2);
if (_local4 == null){
return;
};
if (_local4.IsBuffered() == false){
_local4.SetBuffered();
_local3 = m_pairBuffer[m_pairBufferCount];
_local3.proxyId1 = _local4.proxyId1;
_local3.proxyId2 = _local4.proxyId2;
m_pairBufferCount++;
};
_local4.SetRemoved();
if (b2BroadPhase.s_validate){
ValidateBuffer();
};
}
private function RemovePair(_arg1:uint, _arg2:uint){
var _local3:b2Pair;
var _local4:uint;
var _local5:uint;
var _local6:b2Pair;
var _local7:uint;
var _local8:uint;
var _local9:*;
if (_arg1 > _arg2){
_local7 = _arg1;
_arg1 = _arg2;
_arg2 = _local7;
};
_local4 = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
_local5 = m_hashTable[_local4];
_local6 = null;
while (_local5 != b2Pair.b2_nullPair) {
if (Equals(m_pairs[_local5], _arg1, _arg2)){
_local8 = _local5;
_local3 = m_pairs[_local5];
if (_local6){
_local6.next = _local3.next;
} else {
m_hashTable[_local4] = _local3.next;
};
_local3 = m_pairs[_local8];
_local9 = _local3.userData;
_local3.next = m_freePair;
_local3.proxyId1 = b2Pair.b2_nullProxy;
_local3.proxyId2 = b2Pair.b2_nullProxy;
_local3.userData = null;
_local3.status = 0;
m_freePair = _local8;
m_pairCount--;
return (_local9);
} else {
_local6 = m_pairs[_local5];
_local5 = _local6.next;
};
};
return (null);
}
public function Initialize(_arg1:b2BroadPhase, _arg2:b2PairCallback):void{
m_broadPhase = _arg1;
m_callback = _arg2;
}
public function AddBufferedPair(_arg1:int, _arg2:int):void{
var _local3:b2BufferedPair;
var _local4:b2Pair;
_local4 = AddPair(_arg1, _arg2);
if (_local4.IsBuffered() == false){
_local4.SetBuffered();
_local3 = m_pairBuffer[m_pairBufferCount];
_local3.proxyId1 = _local4.proxyId1;
_local3.proxyId2 = _local4.proxyId2;
m_pairBufferCount++;
};
_local4.ClearRemoved();
if (b2BroadPhase.s_validate){
ValidateBuffer();
};
}
private function AddPair(_arg1:uint, _arg2:uint):b2Pair{
var _local3:uint;
var _local4:b2Pair;
var _local5:uint;
var _local6:uint;
if (_arg1 > _arg2){
_local6 = _arg1;
_arg1 = _arg2;
_arg2 = _local6;
};
_local3 = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
_local4 = FindHash(_arg1, _arg2, _local3);
if (_local4 != null){
return (_local4);
};
_local5 = m_freePair;
_local4 = m_pairs[_local5];
m_freePair = _local4.next;
_local4.proxyId1 = _arg1;
_local4.proxyId2 = _arg2;
_local4.status = 0;
_local4.userData = null;
_local4.next = m_hashTable[_local3];
m_hashTable[_local3] = _local5;
m_pairCount++;
return (_local4);
}
private function ValidateTable():void{
}
public static function EqualsPair(_arg1:b2BufferedPair, _arg2:b2BufferedPair):Boolean{
return ((((_arg1.proxyId1 == _arg2.proxyId1)) && ((_arg1.proxyId2 == _arg2.proxyId2))));
}
public static function Hash(_arg1:uint, _arg2:uint):uint{
var _local3:uint;
_local3 = (((_arg2 << 16) & 4294901760) | _arg1);
_local3 = (~(_local3) + ((_local3 << 15) & 4294934528));
_local3 = (_local3 ^ ((_local3 >> 12) & 1048575));
_local3 = (_local3 + ((_local3 << 2) & 4294967292));
_local3 = (_local3 ^ ((_local3 >> 4) & 268435455));
_local3 = (_local3 * 2057);
_local3 = (_local3 ^ ((_local3 >> 16) & 0xFFFF));
return (_local3);
}
public static function Equals(_arg1:b2Pair, _arg2:uint, _arg3:uint):Boolean{
return ((((_arg1.proxyId1 == _arg2)) && ((_arg1.proxyId2 == _arg3))));
}
}
}//package Box2D.Collision
Section 24
//b2Point (Box2D.Collision.b2Point)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2Point {
public var p:b2Vec2;
public function b2Point(){
p = new b2Vec2();
super();
}
public function GetFirstVertex(_arg1:b2XForm):b2Vec2{
return (p);
}
public function Support(_arg1:b2XForm, _arg2:Number, _arg3:Number):b2Vec2{
return (p);
}
}
}//package Box2D.Collision
Section 25
//b2Proxy (Box2D.Collision.b2Proxy)
package Box2D.Collision {
public class b2Proxy {
public var overlapCount:uint;
public var lowerBounds:Array;
public var upperBounds:Array;
public var userData;// = null
public var timeStamp:uint;
public function b2Proxy(){
lowerBounds = [uint(0), uint(0)];
upperBounds = [uint(0), uint(0)];
userData = null;
super();
}
public function GetNext():uint{
return (lowerBounds[0]);
}
public function IsValid():Boolean{
return (!((overlapCount == b2BroadPhase.b2_invalid)));
}
public function SetNext(_arg1:uint):void{
lowerBounds[0] = (_arg1 & 0xFFFF);
}
}
}//package Box2D.Collision
Section 26
//b2Segment (Box2D.Collision.b2Segment)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2Segment {
public var p1:b2Vec2;
public var p2:b2Vec2;
public function b2Segment(){
p1 = new b2Vec2();
p2 = new b2Vec2();
super();
}
public function TestSegment(_arg1:Array, _arg2:b2Vec2, _arg3:b2Segment, _arg4:Number):Boolean{
var _local5:b2Vec2;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
_local5 = _arg3.p1;
_local6 = (_arg3.p2.x - _local5.x);
_local7 = (_arg3.p2.y - _local5.y);
_local8 = (p2.x - p1.x);
_local9 = (p2.y - p1.y);
_local10 = _local9;
_local11 = -(_local8);
_local12 = (100 * Number.MIN_VALUE);
_local13 = -(((_local6 * _local10) + (_local7 * _local11)));
if (_local13 > _local12){
_local14 = (_local5.x - p1.x);
_local15 = (_local5.y - p1.y);
_local16 = ((_local14 * _local10) + (_local15 * _local11));
if ((((0 <= _local16)) && ((_local16 <= (_arg4 * _local13))))){
_local17 = ((-(_local6) * _local15) + (_local7 * _local14));
if (((((-(_local12) * _local13) <= _local17)) && ((_local17 <= (_local13 * (1 + _local12)))))){
_local16 = (_local16 / _local13);
_local18 = Math.sqrt(((_local10 * _local10) + (_local11 * _local11)));
_local10 = (_local10 / _local18);
_local11 = (_local11 / _local18);
_arg1[0] = _local16;
_arg2.Set(_local10, _local11);
return (true);
};
};
};
return (false);
}
}
}//package Box2D.Collision
Section 27
//b2TimeOfImpact (Box2D.Collision.b2TimeOfImpact)
package Box2D.Collision {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2TimeOfImpact {
public static var s_xf1:b2XForm = new b2XForm();
public static var s_xf2:b2XForm = new b2XForm();
public static var s_p1:b2Vec2 = new b2Vec2();
public static var s_p2:b2Vec2 = new b2Vec2();
public static function TimeOfImpact(_arg1:b2Shape, _arg2:b2Sweep, _arg3:b2Shape, _arg4:b2Sweep):Number{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:b2Vec2;
var _local18:b2Vec2;
var _local19:int;
var _local20:int;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:b2XForm;
var _local27:b2XForm;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
_local7 = _arg1.m_sweepRadius;
_local8 = _arg3.m_sweepRadius;
_local9 = _arg2.t0;
_local10 = (_arg2.c.x - _arg2.c0.x);
_local11 = (_arg2.c.y - _arg2.c0.y);
_local12 = (_arg4.c.x - _arg4.c0.x);
_local13 = (_arg4.c.y - _arg4.c0.y);
_local14 = (_arg2.a - _arg2.a0);
_local15 = (_arg4.a - _arg4.a0);
_local16 = 0;
_local17 = s_p1;
_local18 = s_p2;
_local19 = 20;
_local20 = 0;
_local21 = 0;
_local22 = 0;
_local23 = 0;
_local24 = 0;
while (true) {
_local25 = (((1 - _local16) * _local9) + _local16);
_local26 = s_xf1;
_local27 = s_xf2;
_arg2.GetXForm(_local26, _local25);
_arg4.GetXForm(_local27, _local25);
_local23 = b2Distance.Distance(_local17, _local18, _arg1, _local26, _arg3, _local27);
if (_local20 == 0){
if (_local23 > (2 * b2Settings.b2_toiSlop)){
_local24 = (1.5 * b2Settings.b2_toiSlop);
} else {
_local5 = (0.05 * b2Settings.b2_toiSlop);
_local6 = (_local23 - (0.5 * b2Settings.b2_toiSlop));
_local24 = ((_local5 > _local6)) ? _local5 : _local6;
};
};
if (((((_local23 - _local24) < (0.05 * b2Settings.b2_toiSlop))) || ((_local20 == _local19)))){
break;
};
_local21 = (_local18.x - _local17.x);
_local22 = (_local18.y - _local17.y);
_local28 = Math.sqrt(((_local21 * _local21) + (_local22 * _local22)));
_local21 = (_local21 / _local28);
_local22 = (_local22 / _local28);
_local29 = ((((_local21 * (_local10 - _local12)) + (_local22 * (_local11 - _local13))) + (((_local14 < 0)) ? -(_local14) : _local14 * _local7)) + (((_local15 < 0)) ? -(_local15) : _local15 * _local8));
if (_local29 == 0){
_local16 = 1;
break;
};
_local30 = ((_local23 - _local24) / _local29);
_local31 = (_local16 + _local30);
if ((((_local31 < 0)) || ((1 < _local31)))){
_local16 = 1;
break;
};
if (_local31 < ((1 + (100 * Number.MIN_VALUE)) * _local16)){
break;
};
_local16 = _local31;
_local20++;
};
return (_local16);
}
}
}//package Box2D.Collision
Section 28
//ClipVertex (Box2D.Collision.ClipVertex)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class ClipVertex {
public var v:b2Vec2;
public var id:b2ContactID;
public function ClipVertex(){
v = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Collision
Section 29
//Features (Box2D.Collision.Features)
package Box2D.Collision {
public class Features {
public var _referenceEdge:int;
public var _incidentEdge:int;
public var _flip:int;
public var _incidentVertex:int;
public var _m_id:b2ContactID;
public function get referenceEdge():int{
return (_referenceEdge);
}
public function set incidentVertex(_arg1:int):void{
_incidentVertex = _arg1;
_m_id._key = ((_m_id._key & 4278255615) | ((_incidentVertex << 16) & 0xFF0000));
}
public function get flip():int{
return (_flip);
}
public function get incidentEdge():int{
return (_incidentEdge);
}
public function set referenceEdge(_arg1:int):void{
_referenceEdge = _arg1;
_m_id._key = ((_m_id._key & 4294967040) | (_referenceEdge & 0xFF));
}
public function set flip(_arg1:int):void{
_flip = _arg1;
_m_id._key = ((_m_id._key & 0xFFFFFF) | ((_flip << 24) & 4278190080));
}
public function get incidentVertex():int{
return (_incidentVertex);
}
public function set incidentEdge(_arg1:int):void{
_incidentEdge = _arg1;
_m_id._key = ((_m_id._key & 4294902015) | ((_incidentEdge << 8) & 0xFF00));
}
}
}//package Box2D.Collision
Section 30
//b2Mat22 (Box2D.Common.Math.b2Mat22)
package Box2D.Common.Math {
public class b2Mat22 {
public var col1:b2Vec2;
public var col2:b2Vec2;
public function b2Mat22(_arg1:Number=0, _arg2:b2Vec2=null, _arg3:b2Vec2=null){
var _local4:Number;
var _local5:Number;
col1 = new b2Vec2();
col2 = new b2Vec2();
super();
if (((!((_arg2 == null))) && (!((_arg3 == null))))){
col1.SetV(_arg2);
col2.SetV(_arg3);
} else {
_local4 = Math.cos(_arg1);
_local5 = Math.sin(_arg1);
col1.x = _local4;
col2.x = -(_local5);
col1.y = _local5;
col2.y = _local4;
};
}
public function SetIdentity():void{
col1.x = 1;
col2.x = 0;
col1.y = 0;
col2.y = 1;
}
public function Set(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
col1.x = _local2;
col2.x = -(_local3);
col1.y = _local3;
col2.y = _local2;
}
public function SetVV(_arg1:b2Vec2, _arg2:b2Vec2):void{
col1.SetV(_arg1);
col2.SetV(_arg2);
}
public function SetZero():void{
col1.x = 0;
col2.x = 0;
col1.y = 0;
col2.y = 0;
}
public function SetM(_arg1:b2Mat22):void{
col1.SetV(_arg1.col1);
col2.SetV(_arg1.col2);
}
public function AddM(_arg1:b2Mat22):void{
col1.x = (col1.x + _arg1.col1.x);
col1.y = (col1.y + _arg1.col1.y);
col2.x = (col2.x + _arg1.col2.x);
col2.y = (col2.y + _arg1.col2.y);
}
public function Abs():void{
col1.Abs();
col2.Abs();
}
public function Copy():b2Mat22{
return (new b2Mat22(0, col1, col2));
}
public function Invert(_arg1:b2Mat22):b2Mat22{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local2 = col1.x;
_local3 = col2.x;
_local4 = col1.y;
_local5 = col2.y;
_local6 = ((_local2 * _local5) - (_local3 * _local4));
_local6 = (1 / _local6);
_arg1.col1.x = (_local6 * _local5);
_arg1.col2.x = (-(_local6) * _local3);
_arg1.col1.y = (-(_local6) * _local4);
_arg1.col2.y = (_local6 * _local2);
return (_arg1);
}
public function GetAngle():Number{
return (Math.atan2(col1.y, col1.x));
}
public function Solve(_arg1:b2Vec2, _arg2:Number, _arg3:Number):b2Vec2{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local4 = col1.x;
_local5 = col2.x;
_local6 = col1.y;
_local7 = col2.y;
_local8 = ((_local4 * _local7) - (_local5 * _local6));
_local8 = (1 / _local8);
_arg1.x = (_local8 * ((_local7 * _arg2) - (_local5 * _arg3)));
_arg1.y = (_local8 * ((_local4 * _arg3) - (_local6 * _arg2)));
return (_arg1);
}
}
}//package Box2D.Common.Math
Section 31
//b2Math (Box2D.Common.Math.b2Math)
package Box2D.Common.Math {
public class b2Math {
public static const b2Mat22_identity:b2Mat22 = new b2Mat22(0, new b2Vec2(1, 0), new b2Vec2(0, 1));
public static const b2XForm_identity:b2XForm = new b2XForm(b2Vec2_zero, b2Mat22_identity);
public static const b2Vec2_zero:b2Vec2 = new b2Vec2(0, 0);
public static function b2CrossVF(_arg1:b2Vec2, _arg2:Number):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg2 * _arg1.y), (-(_arg2) * _arg1.x));
return (_local3);
}
public static function AddVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg1.x + _arg2.x), (_arg1.y + _arg2.y));
return (_local3);
}
public static function b2IsValid(_arg1:Number):Boolean{
return (isFinite(_arg1));
}
public static function b2MinV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(b2Min(_arg1.x, _arg2.x), b2Min(_arg1.y, _arg2.y));
return (_local3);
}
public static function b2MulX(_arg1:b2XForm, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = b2MulMV(_arg1.R, _arg2);
_local3.x = (_local3.x + _arg1.position.x);
_local3.y = (_local3.y + _arg1.position.y);
return (_local3);
}
public static function b2DistanceSquared(_arg1:b2Vec2, _arg2:b2Vec2):Number{
var _local3:Number;
var _local4:Number;
_local3 = (_arg1.x - _arg2.x);
_local4 = (_arg1.y - _arg2.y);
return (((_local3 * _local3) + (_local4 * _local4)));
}
public static function b2Swap(_arg1:Array, _arg2:Array):void{
var _local3:*;
_local3 = _arg1[0];
_arg1[0] = _arg2[0];
_arg2[0] = _local3;
}
public static function b2AbsM(_arg1:b2Mat22):b2Mat22{
var _local2:b2Mat22;
_local2 = new b2Mat22(0, b2AbsV(_arg1.col1), b2AbsV(_arg1.col2));
return (_local2);
}
public static function SubtractVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg1.x - _arg2.x), (_arg1.y - _arg2.y));
return (_local3);
}
public static function b2MulXT(_arg1:b2XForm, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
var _local4:Number;
_local3 = SubtractVV(_arg2, _arg1.position);
_local4 = ((_local3.x * _arg1.R.col1.x) + (_local3.y * _arg1.R.col1.y));
_local3.y = ((_local3.x * _arg1.R.col2.x) + (_local3.y * _arg1.R.col2.y));
_local3.x = _local4;
return (_local3);
}
public static function b2Abs(_arg1:Number):Number{
return (((_arg1 > 0)) ? _arg1 : -(_arg1));
}
public static function b2Clamp(_arg1:Number, _arg2:Number, _arg3:Number):Number{
return (b2Max(_arg2, b2Min(_arg1, _arg3)));
}
public static function b2AbsV(_arg1:b2Vec2):b2Vec2{
var _local2:b2Vec2;
_local2 = new b2Vec2(b2Abs(_arg1.x), b2Abs(_arg1.y));
return (_local2);
}
public static function MulFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg1 * _arg2.x), (_arg1 * _arg2.y));
return (_local3);
}
public static function b2CrossVV(_arg1:b2Vec2, _arg2:b2Vec2):Number{
return (((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x)));
}
public static function b2Dot(_arg1:b2Vec2, _arg2:b2Vec2):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
public static function b2CrossFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((-(_arg1) * _arg2.y), (_arg1 * _arg2.x));
return (_local3);
}
public static function AddMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Mat22;
_local3 = new b2Mat22(0, AddVV(_arg1.col1, _arg2.col1), AddVV(_arg1.col2, _arg2.col2));
return (_local3);
}
public static function b2Distance(_arg1:b2Vec2, _arg2:b2Vec2):Number{
var _local3:Number;
var _local4:Number;
_local3 = (_arg1.x - _arg2.x);
_local4 = (_arg1.y - _arg2.y);
return (Math.sqrt(((_local3 * _local3) + (_local4 * _local4))));
}
public static function b2MulTMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:b2Mat22;
_local3 = new b2Vec2(b2Dot(_arg1.col1, _arg2.col1), b2Dot(_arg1.col2, _arg2.col1));
_local4 = new b2Vec2(b2Dot(_arg1.col1, _arg2.col2), b2Dot(_arg1.col2, _arg2.col2));
_local5 = new b2Mat22(0, _local3, _local4);
return (_local5);
}
public static function b2MaxV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(b2Max(_arg1.x, _arg2.x), b2Max(_arg1.y, _arg2.y));
return (_local3);
}
public static function b2IsPowerOfTwo(_arg1:uint):Boolean{
var _local2:Boolean;
_local2 = (((_arg1 > 0)) && (((_arg1 & (_arg1 - 1)) == 0)));
return (_local2);
}
public static function b2ClampV(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Vec2):b2Vec2{
return (b2MaxV(_arg2, b2MinV(_arg1, _arg3)));
}
public static function b2RandomRange(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
_local3 = Math.random();
_local3 = (((_arg2 - _arg1) * _local3) + _arg1);
return (_local3);
}
public static function b2MulTMV(_arg1:b2Mat22, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(b2Dot(_arg2, _arg1.col1), b2Dot(_arg2, _arg1.col2));
return (_local3);
}
public static function b2Min(_arg1:Number, _arg2:Number):Number{
return (((_arg1 < _arg2)) ? _arg1 : _arg2);
}
public static function b2Random():Number{
return (((Math.random() * 2) - 1));
}
public static function b2MulMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Mat22;
_local3 = new b2Mat22(0, b2MulMV(_arg1, _arg2.col1), b2MulMV(_arg1, _arg2.col2));
return (_local3);
}
public static function b2NextPowerOfTwo(_arg1:uint):uint{
_arg1 = (_arg1 | ((_arg1 >> 1) & 2147483647));
_arg1 = (_arg1 | ((_arg1 >> 2) & 1073741823));
_arg1 = (_arg1 | ((_arg1 >> 4) & 268435455));
_arg1 = (_arg1 | ((_arg1 >> 8) & 0xFFFFFF));
_arg1 = (_arg1 | ((_arg1 >> 16) & 0xFFFF));
return ((_arg1 + 1));
}
public static function b2Max(_arg1:Number, _arg2:Number):Number{
return (((_arg1 > _arg2)) ? _arg1 : _arg2);
}
public static function b2MulMV(_arg1:b2Mat22, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(((_arg1.col1.x * _arg2.x) + (_arg1.col2.x * _arg2.y)), ((_arg1.col1.y * _arg2.x) + (_arg1.col2.y * _arg2.y)));
return (_local3);
}
}
}//package Box2D.Common.Math
Section 32
//b2Sweep (Box2D.Common.Math.b2Sweep)
package Box2D.Common.Math {
public class b2Sweep {
public var localCenter:b2Vec2;
public var c:b2Vec2;
public var a:Number;
public var c0:b2Vec2;
public var a0:Number;
public var t0:Number;
public function b2Sweep(){
localCenter = new b2Vec2();
c0 = new b2Vec2();
c = new b2Vec2();
super();
}
public function Advance(_arg1:Number):void{
var _local2:Number;
if ((((t0 < _arg1)) && (((1 - t0) > Number.MIN_VALUE)))){
_local2 = ((_arg1 - t0) / (1 - t0));
c0.x = (((1 - _local2) * c0.x) + (_local2 * c.x));
c0.y = (((1 - _local2) * c0.y) + (_local2 * c.y));
a0 = (((1 - _local2) * a0) + (_local2 * a));
t0 = _arg1;
};
}
public function GetXForm(_arg1:b2XForm, _arg2:Number):void{
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
if ((1 - t0) > Number.MIN_VALUE){
_local4 = ((_arg2 - t0) / (1 - t0));
_arg1.position.x = (((1 - _local4) * c0.x) + (_local4 * c.x));
_arg1.position.y = (((1 - _local4) * c0.y) + (_local4 * c.y));
_local5 = (((1 - _local4) * a0) + (_local4 * a));
_arg1.R.Set(_local5);
} else {
_arg1.position.SetV(c);
_arg1.R.Set(a);
};
_local3 = _arg1.R;
_arg1.position.x = (_arg1.position.x - ((_local3.col1.x * localCenter.x) + (_local3.col2.x * localCenter.y)));
_arg1.position.y = (_arg1.position.y - ((_local3.col1.y * localCenter.x) + (_local3.col2.y * localCenter.y)));
}
}
}//package Box2D.Common.Math
Section 33
//b2Vec2 (Box2D.Common.Math.b2Vec2)
package Box2D.Common.Math {
public class b2Vec2 {
public var x:Number;
public var y:Number;
public function b2Vec2(_arg1:Number=0, _arg2:Number=0):void{
x = _arg1;
y = _arg2;
}
public function Set(_arg1:Number=0, _arg2:Number=0):void{
x = _arg1;
y = _arg2;
}
public function Multiply(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
}
public function Length():Number{
return (Math.sqrt(((x * x) + (y * y))));
}
public function LengthSquared():Number{
return (((x * x) + (y * y)));
}
public function SetZero():void{
x = 0;
y = 0;
}
public function Add(_arg1:b2Vec2):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
}
public function MaxV(_arg1:b2Vec2):void{
x = ((x > _arg1.x)) ? x : _arg1.x;
y = ((y > _arg1.y)) ? y : _arg1.y;
}
public function SetV(_arg1:b2Vec2):void{
x = _arg1.x;
y = _arg1.y;
}
public function Negative():b2Vec2{
return (new b2Vec2(-(x), -(y)));
}
public function CrossVF(_arg1:Number):void{
var _local2:Number;
_local2 = x;
x = (_arg1 * y);
y = (-(_arg1) * _local2);
}
public function Abs():void{
if (x < 0){
x = -(x);
};
if (y < 0){
y = -(y);
};
}
public function Copy():b2Vec2{
return (new b2Vec2(x, y));
}
public function MulTM(_arg1:b2Mat22):void{
var _local2:Number;
_local2 = b2Math.b2Dot(this, _arg1.col1);
y = b2Math.b2Dot(this, _arg1.col2);
x = _local2;
}
public function IsValid():Boolean{
return (((b2Math.b2IsValid(x)) && (b2Math.b2IsValid(y))));
}
public function MinV(_arg1:b2Vec2):void{
x = ((x < _arg1.x)) ? x : _arg1.x;
y = ((y < _arg1.y)) ? y : _arg1.y;
}
public function MulM(_arg1:b2Mat22):void{
var _local2:Number;
_local2 = x;
x = ((_arg1.col1.x * _local2) + (_arg1.col2.x * y));
y = ((_arg1.col1.y * _local2) + (_arg1.col2.y * y));
}
public function Normalize():Number{
var _local1:Number;
var _local2:Number;
_local1 = Math.sqrt(((x * x) + (y * y)));
if (_local1 < Number.MIN_VALUE){
return (0);
};
_local2 = (1 / _local1);
x = (x * _local2);
y = (y * _local2);
return (_local1);
}
public function Subtract(_arg1:b2Vec2):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
}
public function CrossFV(_arg1:Number):void{
var _local2:Number;
_local2 = x;
x = (-(_arg1) * y);
y = (_arg1 * _local2);
}
public static function Make(_arg1:Number, _arg2:Number):b2Vec2{
return (new b2Vec2(_arg1, _arg2));
}
}
}//package Box2D.Common.Math
Section 34
//b2XForm (Box2D.Common.Math.b2XForm)
package Box2D.Common.Math {
public class b2XForm {
public var R:b2Mat22;
public var position:b2Vec2;
public function b2XForm(_arg1:b2Vec2=null, _arg2:b2Mat22=null):void{
position = new b2Vec2();
R = new b2Mat22();
super();
if (_arg1){
position.SetV(_arg1);
R.SetM(_arg2);
};
}
public function Initialize(_arg1:b2Vec2, _arg2:b2Mat22):void{
position.SetV(_arg1);
R.SetM(_arg2);
}
public function Set(_arg1:b2XForm):void{
position.SetV(_arg1.position);
R.SetM(_arg1.R);
}
public function SetIdentity():void{
position.SetZero();
R.SetIdentity();
}
}
}//package Box2D.Common.Math
Section 35
//b2Color (Box2D.Common.b2Color)
package Box2D.Common {
import Box2D.Common.Math.*;
public class b2Color {
private var _g:uint;// = 0
private var _b:uint;// = 0
private var _r:uint;// = 0
public function b2Color(_arg1:Number, _arg2:Number, _arg3:Number){
_r = 0;
_g = 0;
_b = 0;
super();
_r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
_g = uint((0xFF * b2Math.b2Clamp(_arg2, 0, 1)));
_b = uint((0xFF * b2Math.b2Clamp(_arg3, 0, 1)));
}
public function Set(_arg1:Number, _arg2:Number, _arg3:Number):void{
_r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
_g = uint((0xFF * b2Math.b2Clamp(_arg2, 0, 1)));
_b = uint((0xFF * b2Math.b2Clamp(_arg3, 0, 1)));
}
public function get color():uint{
return (((_r | (_g << 8)) | (_b << 16)));
}
public function set r(_arg1:Number):void{
_r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
}
public function set b(_arg1:Number):void{
_b = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
}
public function set g(_arg1:Number):void{
_g = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
}
}
}//package Box2D.Common
Section 36
//b2Settings (Box2D.Common.b2Settings)
package Box2D.Common {
import Box2D.Common.Math.*;
public class b2Settings {
public static const b2_angularSleepTolerance:Number = 0.0111111111111111;
public static const b2_linearSleepTolerance:Number = 0.01;
public static const b2_angularSlop:Number = 0.0349065850398866;
public static const b2_linearSlop:Number = 0.005;
public static const b2_pi:Number = 3.14159265358979;
public static const b2_maxProxies:int = 0x0200;
public static const b2_maxAngularVelocitySquared:Number = 62500;
public static const b2_maxPolygonVertices:int = 8;
public static const b2_velocityThreshold:Number = 1;
public static const b2_contactBaumgarte:Number = 0.2;
public static const b2_maxPairs:int = 4096;
public static const b2_maxTOIContactsPerIsland:int = 32;
public static const b2_timeToSleep:Number = 0.5;
public static const b2_maxManifoldPoints:int = 2;
public static const b2_maxAngularVelocity:Number = 250;
public static const b2_maxAngularCorrection:Number = 0.139626340159546;
public static const USHRT_MAX:int = 0xFFFF;
public static const b2_maxLinearVelocity:Number = 200;
public static const b2_maxLinearCorrection:Number = 0.2;
public static const b2_toiSlop:Number = 0.04;
public static const b2_maxLinearVelocitySquared:Number = 40000;
public static function b2Assert(_arg1:Boolean):void{
var _local2:b2Vec2;
if (!_arg1){
_local2.x++;
};
}
}
}//package Box2D.Common
Section 37
//b2CircleContact (Box2D.Dynamics.Contacts.b2CircleContact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
public class b2CircleContact extends b2Contact {
private var m_manifolds:Array;
private var m0:b2Manifold;
public var m_manifold:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2CircleContact(_arg1:b2Shape, _arg2:b2Shape){
var _local3:b2ManifoldPoint;
m_manifolds = [new b2Manifold()];
m0 = new b2Manifold();
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
m_manifold.pointCount = 0;
_local3 = m_manifold.points[0];
_local3.normalImpulse = 0;
_local3.tangentImpulse = 0;
}
override public function GetManifolds():Array{
return (m_manifolds);
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2ManifoldPoint;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2ContactPoint;
var _local8:b2ManifoldPoint;
_local5 = m_shape1.m_body;
_local6 = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollideCircles(m_manifold, (m_shape1 as b2CircleShape), _local5.m_xf, (m_shape2 as b2CircleShape), _local6.m_xf);
_local7 = s_evalCP;
_local7.shape1 = m_shape1;
_local7.shape2 = m_shape2;
_local7.friction = m_friction;
_local7.restitution = m_restitution;
if (m_manifold.pointCount > 0){
m_manifoldCount = 1;
_local8 = m_manifold.points[0];
if (m0.pointCount == 0){
_local8.normalImpulse = 0;
_local8.tangentImpulse = 0;
if (_arg1){
_local7.position = _local5.GetWorldPoint(_local8.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local8.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local8.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local8.separation;
_local7.id.key = _local8.id._key;
_arg1.Add(_local7);
};
} else {
_local4 = m0.points[0];
_local8.normalImpulse = _local4.normalImpulse;
_local8.tangentImpulse = _local4.tangentImpulse;
if (_arg1){
_local7.position = _local5.GetWorldPoint(_local8.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local8.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local8.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local8.separation;
_local7.id.key = _local8.id._key;
_arg1.Persist(_local7);
};
};
} else {
m_manifoldCount = 0;
if ((((m0.pointCount > 0)) && (_arg1))){
_local4 = m0.points[0];
_local7.position = _local5.GetWorldPoint(_local4.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local4.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local4.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m0.normal);
_local7.separation = _local4.separation;
_local7.id.key = _local4.id._key;
_arg1.Remove(_local7);
};
};
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2CircleContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 38
//b2Contact (Box2D.Dynamics.Contacts.b2Contact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2Contact {
public var m_shape1:b2Shape;
public var m_shape2:b2Shape;
public var m_prev:b2Contact;
public var m_toi:Number;
public var m_next:b2Contact;
public var m_friction:Number;
public var m_manifoldCount:int;
public var m_node1:b2ContactEdge;
public var m_node2:b2ContactEdge;
public var m_restitution:Number;
public var m_flags:uint;
public static var e_toiFlag:uint = 8;
public static var e_nonSolidFlag:uint = 1;
public static var e_slowFlag:uint = 2;
public static var e_islandFlag:uint = 4;
public static var s_registers:Array;
public static var s_initialized:Boolean = false;
public function b2Contact(_arg1:b2Shape=null, _arg2:b2Shape=null){
m_node1 = new b2ContactEdge();
m_node2 = new b2ContactEdge();
super();
m_flags = 0;
if (((!(_arg1)) || (!(_arg2)))){
m_shape1 = null;
m_shape2 = null;
return;
};
if (((_arg1.IsSensor()) || (_arg2.IsSensor()))){
m_flags = (m_flags | e_nonSolidFlag);
};
m_shape1 = _arg1;
m_shape2 = _arg2;
m_manifoldCount = 0;
m_friction = Math.sqrt((m_shape1.m_friction * m_shape2.m_friction));
m_restitution = b2Math.b2Max(m_shape1.m_restitution, m_shape2.m_restitution);
m_prev = null;
m_next = null;
m_node1.contact = null;
m_node1.prev = null;
m_node1.next = null;
m_node1.other = null;
m_node2.contact = null;
m_node2.prev = null;
m_node2.next = null;
m_node2.other = null;
}
public function GetShape1():b2Shape{
return (m_shape1);
}
public function IsSolid():Boolean{
return (((m_flags & e_nonSolidFlag) == 0));
}
public function GetNext():b2Contact{
return (m_next);
}
public function GetManifolds():Array{
return (null);
}
public function GetShape2():b2Shape{
return (m_shape2);
}
public function GetManifoldCount():int{
return (m_manifoldCount);
}
public function Update(_arg1:b2ContactListener):void{
var _local2:int;
var _local3:int;
var _local4:b2Body;
var _local5:b2Body;
_local2 = m_manifoldCount;
Evaluate(_arg1);
_local3 = m_manifoldCount;
_local4 = m_shape1.m_body;
_local5 = m_shape2.m_body;
if ((((_local3 == 0)) && ((_local2 > 0)))){
_local4.WakeUp();
_local5.WakeUp();
};
if (((((((_local4.IsStatic()) || (_local4.IsBullet()))) || (_local5.IsStatic()))) || (_local5.IsBullet()))){
m_flags = (m_flags & ~(e_slowFlag));
} else {
m_flags = (m_flags | e_slowFlag);
};
}
public function Evaluate(_arg1:b2ContactListener):void{
}
public static function InitializeRegisters():void{
var _local1:int;
var _local2:int;
s_registers = new Array(b2Shape.e_shapeTypeCount);
_local1 = 0;
while (_local1 < b2Shape.e_shapeTypeCount) {
s_registers[_local1] = new Array(b2Shape.e_shapeTypeCount);
_local2 = 0;
while (_local2 < b2Shape.e_shapeTypeCount) {
s_registers[_local1][_local2] = new b2ContactRegister();
_local2++;
};
_local1++;
};
AddType(b2CircleContact.Create, b2CircleContact.Destroy, b2Shape.e_circleShape, b2Shape.e_circleShape);
AddType(b2PolyAndCircleContact.Create, b2PolyAndCircleContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_circleShape);
AddType(b2PolygonContact.Create, b2PolygonContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_polygonShape);
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
var _local3:int;
var _local4:int;
var _local5:b2ContactRegister;
var _local6:Function;
if (_arg1.m_manifoldCount > 0){
_arg1.m_shape1.m_body.WakeUp();
_arg1.m_shape2.m_body.WakeUp();
};
_local3 = _arg1.m_shape1.m_type;
_local4 = _arg1.m_shape2.m_type;
_local5 = s_registers[_local3][_local4];
_local6 = _local5.destroyFcn;
_local6(_arg1, _arg2);
}
public static function AddType(_arg1:Function, _arg2:Function, _arg3:int, _arg4:int):void{
s_registers[_arg3][_arg4].createFcn = _arg1;
s_registers[_arg3][_arg4].destroyFcn = _arg2;
s_registers[_arg3][_arg4].primary = true;
if (_arg3 != _arg4){
s_registers[_arg4][_arg3].createFcn = _arg1;
s_registers[_arg4][_arg3].destroyFcn = _arg2;
s_registers[_arg4][_arg3].primary = false;
};
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
var _local4:int;
var _local5:int;
var _local6:b2ContactRegister;
var _local7:Function;
var _local8:b2Contact;
var _local9:int;
var _local10:b2Manifold;
if (s_initialized == false){
InitializeRegisters();
s_initialized = true;
};
_local4 = _arg1.m_type;
_local5 = _arg2.m_type;
_local6 = s_registers[_local4][_local5];
_local7 = _local6.createFcn;
if (_local7 != null){
if (_local6.primary){
return (_local7(_arg1, _arg2, _arg3));
};
_local8 = _local7(_arg2, _arg1, _arg3);
_local9 = 0;
while (_local9 < _local8.m_manifoldCount) {
_local10 = _local8.GetManifolds()[_local9];
_local8.GetManifolds()[_local9].normal = _local10.normal.Negative();
_local9++;
};
return (_local8);
//unresolved jump
};
return (null);
}
}
}//package Box2D.Dynamics.Contacts
Section 39
//b2ContactConstraint (Box2D.Dynamics.Contacts.b2ContactConstraint)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2ContactConstraint {
public var points:Array;
public var restitution:Number;
public var body1:b2Body;
public var manifold:b2Manifold;
public var normal:b2Vec2;
public var body2:b2Body;
public var friction:Number;
public var pointCount:int;
public function b2ContactConstraint(){
var _local1:int;
normal = new b2Vec2();
super();
points = new Array(b2Settings.b2_maxManifoldPoints);
_local1 = 0;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
points[_local1] = new b2ContactConstraintPoint();
_local1++;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 40
//b2ContactConstraintPoint (Box2D.Dynamics.Contacts.b2ContactConstraintPoint)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
public class b2ContactConstraintPoint {
public var r2:b2Vec2;
public var separation:Number;
public var positionImpulse:Number;
public var normalImpulse:Number;
public var equalizedMass:Number;
public var tangentMass:Number;
public var tangentImpulse:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var normalMass:Number;
public var velocityBias:Number;
public var r1:b2Vec2;
public function b2ContactConstraintPoint(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
r1 = new b2Vec2();
r2 = new b2Vec2();
super();
}
}
}//package Box2D.Dynamics.Contacts
Section 41
//b2ContactEdge (Box2D.Dynamics.Contacts.b2ContactEdge)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
public class b2ContactEdge {
public var next:b2ContactEdge;
public var other:b2Body;
public var contact:b2Contact;
public var prev:b2ContactEdge;
}
}//package Box2D.Dynamics.Contacts
Section 42
//b2ContactRegister (Box2D.Dynamics.Contacts.b2ContactRegister)
package Box2D.Dynamics.Contacts {
public class b2ContactRegister {
public var primary:Boolean;
public var createFcn:Function;
public var destroyFcn:Function;
}
}//package Box2D.Dynamics.Contacts
Section 43
//b2ContactResult (Box2D.Dynamics.Contacts.b2ContactResult)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
public class b2ContactResult {
public var normal:b2Vec2;
public var position:b2Vec2;
public var shape1:b2Shape;
public var shape2:b2Shape;
public var normalImpulse:Number;
public var tangentImpulse:Number;
public var id:b2ContactID;
public function b2ContactResult(){
position = new b2Vec2();
normal = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Dynamics.Contacts
Section 44
//b2ContactSolver (Box2D.Dynamics.Contacts.b2ContactSolver)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2ContactSolver {
public var m_constraintCount:int;
public var m_constraints:Array;
public var m_allocator;
public var m_step:b2TimeStep;
public function b2ContactSolver(_arg1:b2TimeStep, _arg2:Array, _arg3:int, _arg4){
var _local5:b2Contact;
var _local6:int;
var _local7:b2Vec2;
var _local8:b2Mat22;
var _local9:int;
var _local10:b2Body;
var _local11:b2Body;
var _local12:int;
var _local13:Array;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:int;
var _local23:b2Manifold;
var _local24:Number;
var _local25:Number;
var _local26:b2ContactConstraint;
var _local27:uint;
var _local28:b2ManifoldPoint;
var _local29:b2ContactConstraintPoint;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Number;
var _local42:Number;
var _local43:Number;
var _local44:Number;
var _local45:Number;
var _local46:Number;
var _local47:Number;
m_step = new b2TimeStep();
m_constraints = new Array();
super();
m_step.dt = _arg1.dt;
m_step.inv_dt = _arg1.inv_dt;
m_step.maxIterations = _arg1.maxIterations;
m_allocator = _arg4;
m_constraintCount = 0;
_local6 = 0;
while (_local6 < _arg3) {
_local5 = _arg2[_local6];
m_constraintCount = (m_constraintCount + _local5.m_manifoldCount);
_local6++;
};
_local6 = 0;
while (_local6 < m_constraintCount) {
m_constraints[_local6] = new b2ContactConstraint();
_local6++;
};
_local9 = 0;
_local6 = 0;
while (_local6 < _arg3) {
_local5 = _arg2[_local6];
_local10 = _local5.m_shape1.m_body;
_local11 = _local5.m_shape2.m_body;
_local12 = _local5.m_manifoldCount;
_local13 = _local5.GetManifolds();
_local14 = _local5.m_friction;
_local15 = _local5.m_restitution;
_local16 = _local10.m_linearVelocity.x;
_local17 = _local10.m_linearVelocity.y;
_local18 = _local11.m_linearVelocity.x;
_local19 = _local11.m_linearVelocity.y;
_local20 = _local10.m_angularVelocity;
_local21 = _local11.m_angularVelocity;
_local22 = 0;
while (_local22 < _local12) {
_local23 = _local13[_local22];
_local24 = _local23.normal.x;
_local25 = _local23.normal.y;
_local26 = m_constraints[_local9];
_local26.body1 = _local10;
_local26.body2 = _local11;
_local26.manifold = _local23;
_local26.normal.x = _local24;
_local26.normal.y = _local25;
_local26.pointCount = _local23.pointCount;
_local26.friction = _local14;
_local26.restitution = _local15;
_local27 = 0;
while (_local27 < _local26.pointCount) {
_local28 = _local23.points[_local27];
_local29 = _local26.points[_local27];
_local29.normalImpulse = _local28.normalImpulse;
_local29.tangentImpulse = _local28.tangentImpulse;
_local29.separation = _local28.separation;
_local29.positionImpulse = 0;
_local29.localAnchor1.SetV(_local28.localPoint1);
_local29.localAnchor2.SetV(_local28.localPoint2);
_local8 = _local10.m_xf.R;
_local32 = (_local28.localPoint1.x - _local10.m_sweep.localCenter.x);
_local33 = (_local28.localPoint1.y - _local10.m_sweep.localCenter.y);
_local30 = ((_local8.col1.x * _local32) + (_local8.col2.x * _local33));
_local33 = ((_local8.col1.y * _local32) + (_local8.col2.y * _local33));
_local32 = _local30;
_local29.r1.Set(_local32, _local33);
_local8 = _local11.m_xf.R;
_local34 = (_local28.localPoint2.x - _local11.m_sweep.localCenter.x);
_local35 = (_local28.localPoint2.y - _local11.m_sweep.localCenter.y);
_local30 = ((_local8.col1.x * _local34) + (_local8.col2.x * _local35));
_local35 = ((_local8.col1.y * _local34) + (_local8.col2.y * _local35));
_local34 = _local30;
_local29.r2.Set(_local34, _local35);
_local36 = ((_local32 * _local32) + (_local33 * _local33));
_local37 = ((_local34 * _local34) + (_local35 * _local35));
_local38 = ((_local32 * _local24) + (_local33 * _local25));
_local39 = ((_local34 * _local24) + (_local35 * _local25));
_local40 = (_local10.m_invMass + _local11.m_invMass);
_local40 = (_local40 + ((_local10.m_invI * (_local36 - (_local38 * _local38))) + (_local11.m_invI * (_local37 - (_local39 * _local39)))));
_local29.normalMass = (1 / _local40);
_local41 = ((_local10.m_mass * _local10.m_invMass) + (_local11.m_mass * _local11.m_invMass));
_local41 = (_local41 + (((_local10.m_mass * _local10.m_invI) * (_local36 - (_local38 * _local38))) + ((_local11.m_mass * _local11.m_invI) * (_local37 - (_local39 * _local39)))));
_local29.equalizedMass = (1 / _local41);
_local42 = _local25;
_local43 = -(_local24);
_local44 = ((_local32 * _local42) + (_local33 * _local43));
_local45 = ((_local34 * _local42) + (_local35 * _local43));
_local46 = (_local10.m_invMass + _local11.m_invMass);
_local46 = (_local46 + ((_local10.m_invI * (_local36 - (_local44 * _local44))) + (_local11.m_invI * (_local37 - (_local45 * _local45)))));
_local29.tangentMass = (1 / _local46);
_local29.velocityBias = 0;
if (_local29.separation > 0){
_local29.velocityBias = (-60 * _local29.separation);
};
_local30 = (((_local18 + (-(_local21) * _local35)) - _local16) - (-(_local20) * _local33));
_local31 = (((_local19 + (_local21 * _local34)) - _local17) - (_local20 * _local32));
_local47 = ((_local26.normal.x * _local30) + (_local26.normal.y * _local31));
if (_local47 < -(b2Settings.b2_velocityThreshold)){
_local29.velocityBias = (_local29.velocityBias + (-(_local26.restitution) * _local47));
};
_local27++;
};
_local9++;
_local22++;
};
_local6++;
};
}
public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2Mat22;
var _local5:int;
var _local6:b2ContactConstraint;
var _local7:b2Body;
var _local8:b2Body;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:int;
var _local19:int;
var _local20:b2ContactConstraintPoint;
var _local21:Number;
var _local22:Number;
var _local23:b2ContactConstraintPoint;
_local5 = 0;
while (_local5 < m_constraintCount) {
_local6 = m_constraints[_local5];
_local7 = _local6.body1;
_local8 = _local6.body2;
_local9 = _local7.m_invMass;
_local10 = _local7.m_invI;
_local11 = _local8.m_invMass;
_local12 = _local8.m_invI;
_local13 = _local6.normal.x;
_local14 = _local6.normal.y;
_local15 = _local14;
_local16 = -(_local13);
if (_arg1.warmStarting){
_local19 = _local6.pointCount;
_local18 = 0;
while (_local18 < _local19) {
_local20 = _local6.points[_local18];
_local6.points[_local18].normalImpulse = (_local20.normalImpulse * _arg1.dtRatio);
_local20.tangentImpulse = (_local20.tangentImpulse * _arg1.dtRatio);
_local21 = ((_local20.normalImpulse * _local13) + (_local20.tangentImpulse * _local15));
_local22 = ((_local20.normalImpulse * _local14) + (_local20.tangentImpulse * _local16));
_local7.m_angularVelocity = (_local7.m_angularVelocity - (_local10 * ((_local20.r1.x * _local22) - (_local20.r1.y * _local21))));
_local7.m_linearVelocity.x = (_local7.m_linearVelocity.x - (_local9 * _local21));
_local7.m_linearVelocity.y = (_local7.m_linearVelocity.y - (_local9 * _local22));
_local8.m_angularVelocity = (_local8.m_angularVelocity + (_local12 * ((_local20.r2.x * _local22) - (_local20.r2.y * _local21))));
_local8.m_linearVelocity.x = (_local8.m_linearVelocity.x + (_local11 * _local21));
_local8.m_linearVelocity.y = (_local8.m_linearVelocity.y + (_local11 * _local22));
_local18++;
};
} else {
_local19 = _local6.pointCount;
_local18 = 0;
while (_local18 < _local19) {
_local23 = _local6.points[_local18];
_local23.normalImpulse = 0;
_local23.tangentImpulse = 0;
_local18++;
};
};
_local5++;
};
}
public function SolvePositionConstraints(_arg1:Number):Boolean{
var _local2:Number;
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:int;
var _local6:b2ContactConstraint;
var _local7:b2Body;
var _local8:b2Body;
var _local9:b2Vec2;
var _local10:Number;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:int;
var _local20:int;
var _local21:b2ContactConstraintPoint;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
_local2 = 0;
_local5 = 0;
while (_local5 < m_constraintCount) {
_local6 = m_constraints[_local5];
_local7 = _local6.body1;
_local8 = _local6.body2;
_local9 = _local7.m_sweep.c;
_local10 = _local7.m_sweep.a;
_local11 = _local8.m_sweep.c;
_local12 = _local8.m_sweep.a;
_local13 = (_local7.m_mass * _local7.m_invMass);
_local14 = (_local7.m_mass * _local7.m_invI);
_local15 = (_local8.m_mass * _local8.m_invMass);
_local16 = (_local8.m_mass * _local8.m_invI);
_local17 = _local6.normal.x;
_local18 = _local6.normal.y;
_local19 = _local6.pointCount;
_local20 = 0;
while (_local20 < _local19) {
_local21 = _local6.points[_local20];
_local3 = _local7.m_xf.R;
_local4 = _local7.m_sweep.localCenter;
_local22 = (_local21.localAnchor1.x - _local4.x);
_local23 = (_local21.localAnchor1.y - _local4.y);
_local26 = ((_local3.col1.x * _local22) + (_local3.col2.x * _local23));
_local23 = ((_local3.col1.y * _local22) + (_local3.col2.y * _local23));
_local22 = _local26;
_local3 = _local8.m_xf.R;
_local4 = _local8.m_sweep.localCenter;
_local24 = (_local21.localAnchor2.x - _local4.x);
_local25 = (_local21.localAnchor2.y - _local4.y);
_local26 = ((_local3.col1.x * _local24) + (_local3.col2.x * _local25));
_local25 = ((_local3.col1.y * _local24) + (_local3.col2.y * _local25));
_local24 = _local26;
_local27 = (_local9.x + _local22);
_local28 = (_local9.y + _local23);
_local29 = (_local11.x + _local24);
_local30 = (_local11.y + _local25);
_local31 = (_local29 - _local27);
_local32 = (_local30 - _local28);
_local33 = (((_local31 * _local17) + (_local32 * _local18)) + _local21.separation);
_local2 = b2Math.b2Min(_local2, _local33);
_local34 = (_arg1 * b2Math.b2Clamp((_local33 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0));
_local35 = (-(_local21.equalizedMass) * _local34);
_local36 = _local21.positionImpulse;
_local21.positionImpulse = b2Math.b2Max((_local36 + _local35), 0);
_local35 = (_local21.positionImpulse - _local36);
_local37 = (_local35 * _local17);
_local38 = (_local35 * _local18);
_local9.x = (_local9.x - (_local13 * _local37));
_local9.y = (_local9.y - (_local13 * _local38));
_local10 = (_local10 - (_local14 * ((_local22 * _local38) - (_local23 * _local37))));
_local7.m_sweep.a = _local10;
_local7.SynchronizeTransform();
_local11.x = (_local11.x + (_local15 * _local37));
_local11.y = (_local11.y + (_local15 * _local38));
_local12 = (_local12 + (_local16 * ((_local24 * _local38) - (_local25 * _local37))));
_local8.m_sweep.a = _local12;
_local8.SynchronizeTransform();
_local20++;
};
_local5++;
};
return ((_local2 >= (-1.5 * b2Settings.b2_linearSlop)));
}
public function SolveVelocityConstraints():void{
var _local1:int;
var _local2:b2ContactConstraintPoint;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:b2Mat22;
var _local18:b2Vec2;
var _local19:int;
var _local20:b2ContactConstraint;
var _local21:b2Body;
var _local22:b2Body;
var _local23:Number;
var _local24:Number;
var _local25:b2Vec2;
var _local26:b2Vec2;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:int;
var _local38:Number;
_local19 = 0;
while (_local19 < m_constraintCount) {
_local20 = m_constraints[_local19];
_local21 = _local20.body1;
_local22 = _local20.body2;
_local23 = _local21.m_angularVelocity;
_local24 = _local22.m_angularVelocity;
_local25 = _local21.m_linearVelocity;
_local26 = _local22.m_linearVelocity;
_local27 = _local21.m_invMass;
_local28 = _local21.m_invI;
_local29 = _local22.m_invMass;
_local30 = _local22.m_invI;
_local31 = _local20.normal.x;
_local32 = _local20.normal.y;
_local33 = _local32;
_local34 = -(_local31);
_local35 = _local20.friction;
_local37 = _local20.pointCount;
_local1 = 0;
while (_local1 < _local37) {
_local2 = _local20.points[_local1];
_local7 = (((_local26.x + (-(_local24) * _local2.r2.y)) - _local25.x) - (-(_local23) * _local2.r1.y));
_local8 = (((_local26.y + (_local24 * _local2.r2.x)) - _local25.y) - (_local23 * _local2.r1.x));
_local9 = ((_local7 * _local31) + (_local8 * _local32));
_local11 = (-(_local2.normalMass) * (_local9 - _local2.velocityBias));
_local10 = ((_local7 * _local33) + (_local8 * _local34));
_local12 = (_local2.tangentMass * -(_local10));
_local13 = b2Math.b2Max((_local2.normalImpulse + _local11), 0);
_local11 = (_local13 - _local2.normalImpulse);
_local38 = (_local35 * _local2.normalImpulse);
_local14 = b2Math.b2Clamp((_local2.tangentImpulse + _local12), -(_local38), _local38);
_local12 = (_local14 - _local2.tangentImpulse);
_local15 = ((_local11 * _local31) + (_local12 * _local33));
_local16 = ((_local11 * _local32) + (_local12 * _local34));
_local25.x = (_local25.x - (_local27 * _local15));
_local25.y = (_local25.y - (_local27 * _local16));
_local23 = (_local23 - (_local28 * ((_local2.r1.x * _local16) - (_local2.r1.y * _local15))));
_local26.x = (_local26.x + (_local29 * _local15));
_local26.y = (_local26.y + (_local29 * _local16));
_local24 = (_local24 + (_local30 * ((_local2.r2.x * _local16) - (_local2.r2.y * _local15))));
_local2.normalImpulse = _local13;
_local2.tangentImpulse = _local14;
_local1++;
};
_local21.m_angularVelocity = _local23;
_local22.m_angularVelocity = _local24;
_local19++;
};
}
public function FinalizeVelocityConstraints():void{
var _local1:int;
var _local2:b2ContactConstraint;
var _local3:b2Manifold;
var _local4:int;
var _local5:b2ManifoldPoint;
var _local6:b2ContactConstraintPoint;
_local1 = 0;
while (_local1 < m_constraintCount) {
_local2 = m_constraints[_local1];
_local3 = _local2.manifold;
_local4 = 0;
while (_local4 < _local2.pointCount) {
_local5 = _local3.points[_local4];
_local6 = _local2.points[_local4];
_local5.normalImpulse = _local6.normalImpulse;
_local5.tangentImpulse = _local6.tangentImpulse;
_local4++;
};
_local1++;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 45
//b2NullContact (Box2D.Dynamics.Contacts.b2NullContact)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
public class b2NullContact extends b2Contact {
override public function GetManifolds():Array{
return (null);
}
override public function Evaluate(_arg1:b2ContactListener):void{
}
}
}//package Box2D.Dynamics.Contacts
Section 46
//b2PolyAndCircleContact (Box2D.Dynamics.Contacts.b2PolyAndCircleContact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import Box2D.Common.*;
public class b2PolyAndCircleContact extends b2Contact {
private var m_manifolds:Array;
private var m0:b2Manifold;
public var m_manifold:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2PolyAndCircleContact(_arg1:b2Shape, _arg2:b2Shape){
var _local3:b2ManifoldPoint;
m_manifolds = [new b2Manifold()];
m0 = new b2Manifold();
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
b2Settings.b2Assert((m_shape1.m_type == b2Shape.e_polygonShape));
b2Settings.b2Assert((m_shape2.m_type == b2Shape.e_circleShape));
m_manifold.pointCount = 0;
_local3 = m_manifold.points[0];
_local3.normalImpulse = 0;
_local3.tangentImpulse = 0;
}
override public function GetManifolds():Array{
return (m_manifolds);
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:int;
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:b2ManifoldPoint;
var _local6:b2Body;
var _local7:b2Body;
var _local8:Array;
var _local9:b2ContactPoint;
var _local10:b2ManifoldPoint;
var _local11:Boolean;
var _local12:uint;
var _local13:int;
_local6 = m_shape1.m_body;
_local7 = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollidePolygonAndCircle(m_manifold, (m_shape1 as b2PolygonShape), _local6.m_xf, (m_shape2 as b2CircleShape), _local7.m_xf);
_local8 = [false, false];
_local9 = s_evalCP;
_local9.shape1 = m_shape1;
_local9.shape2 = m_shape2;
_local9.friction = m_friction;
_local9.restitution = m_restitution;
if (m_manifold.pointCount > 0){
_local2 = 0;
while (_local2 < m_manifold.pointCount) {
_local10 = m_manifold.points[_local2];
_local10.normalImpulse = 0;
_local10.tangentImpulse = 0;
_local11 = false;
_local12 = _local10.id._key;
_local13 = 0;
while (_local13 < m0.pointCount) {
if (_local8[_local13] == true){
} else {
_local5 = m0.points[_local13];
if (_local5.id._key == _local12){
_local8[_local13] = true;
_local10.normalImpulse = _local5.normalImpulse;
_local10.tangentImpulse = _local5.tangentImpulse;
_local11 = true;
if (_arg1 != null){
_local9.position = _local6.GetWorldPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m_manifold.normal);
_local9.separation = _local10.separation;
_local9.id.key = _local12;
_arg1.Persist(_local9);
};
break;
};
};
_local13++;
};
if ((((_local11 == false)) && (!((_arg1 == null))))){
_local9.position = _local6.GetWorldPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m_manifold.normal);
_local9.separation = _local10.separation;
_local9.id.key = _local12;
_arg1.Add(_local9);
};
_local2++;
};
m_manifoldCount = 1;
} else {
m_manifoldCount = 0;
};
if (_arg1 == null){
return;
};
_local2 = 0;
while (_local2 < m0.pointCount) {
if (_local8[_local2]){
} else {
_local5 = m0.points[_local2];
_local9.position = _local6.GetWorldPoint(_local5.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local5.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local5.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m0.normal);
_local9.separation = _local5.separation;
_local9.id.key = _local5.id._key;
_arg1.Remove(_local9);
};
_local2++;
};
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2PolyAndCircleContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 47
//b2PolygonContact (Box2D.Dynamics.Contacts.b2PolygonContact)
package Box2D.Dynamics.Contacts {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
public class b2PolygonContact extends b2Contact {
private var m_manifolds:Array;
private var m0:b2Manifold;
public var m_manifold:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2PolygonContact(_arg1:b2Shape, _arg2:b2Shape):void{
m0 = new b2Manifold();
m_manifolds = [new b2Manifold()];
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
m_manifold.pointCount = 0;
}
override public function GetManifolds():Array{
return (m_manifolds);
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2ManifoldPoint;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2ContactPoint;
var _local8:int;
var _local9:Array;
var _local10:b2ManifoldPoint;
var _local11:Boolean;
var _local12:uint;
var _local13:int;
_local5 = m_shape1.m_body;
_local6 = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollidePolygons(m_manifold, (m_shape1 as b2PolygonShape), _local5.m_xf, (m_shape2 as b2PolygonShape), _local6.m_xf);
_local9 = [false, false];
_local7 = s_evalCP;
_local7.shape1 = m_shape1;
_local7.shape2 = m_shape2;
_local7.friction = m_friction;
_local7.restitution = m_restitution;
if (m_manifold.pointCount > 0){
_local8 = 0;
while (_local8 < m_manifold.pointCount) {
_local10 = m_manifold.points[_local8];
_local10.normalImpulse = 0;
_local10.tangentImpulse = 0;
_local11 = false;
_local12 = _local10.id._key;
_local13 = 0;
while (_local13 < m0.pointCount) {
if (_local9[_local13] == true){
} else {
_local4 = m0.points[_local13];
if (_local4.id._key == _local12){
_local9[_local13] = true;
_local10.normalImpulse = _local4.normalImpulse;
_local10.tangentImpulse = _local4.tangentImpulse;
_local11 = true;
if (_arg1 != null){
_local7.position = _local5.GetWorldPoint(_local10.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local10.separation;
_local7.id.key = _local12;
_arg1.Persist(_local7);
};
break;
};
};
_local13++;
};
if ((((_local11 == false)) && (!((_arg1 == null))))){
_local7.position = _local5.GetWorldPoint(_local10.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local10.separation;
_local7.id.key = _local12;
_arg1.Add(_local7);
};
_local8++;
};
m_manifoldCount = 1;
} else {
m_manifoldCount = 0;
};
if (_arg1 == null){
return;
};
_local8 = 0;
while (_local8 < m0.pointCount) {
if (_local9[_local8]){
} else {
_local4 = m0.points[_local8];
_local7.position = _local5.GetWorldPoint(_local4.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local4.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local4.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m0.normal);
_local7.separation = _local4.separation;
_local7.id.key = _local4.id._key;
_arg1.Remove(_local7);
};
_local8++;
};
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2PolygonContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 48
//b2DistanceJoint (Box2D.Dynamics.Joints.b2DistanceJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2DistanceJoint extends b2Joint {
public var m_mass:Number;
public var m_u:b2Vec2;
public var m_impulse:Number;
public var m_dampingRatio:Number;
public var m_frequencyHz:Number;
public var m_localAnchor2:b2Vec2;
public var m_localAnchor1:b2Vec2;
public var m_bias:Number;
public var m_gamma:Number;
public var m_length:Number;
public function b2DistanceJoint(_arg1:b2DistanceJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_u = new b2Vec2();
super(_arg1);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_length = _arg1.length;
m_frequencyHz = _arg1.frequencyHz;
m_dampingRatio = _arg1.dampingRatio;
m_impulse = 0;
m_gamma = 0;
m_bias = 0;
m_inv_dt = 0;
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Vec2;
_local1 = new b2Vec2();
_local1.SetV(m_u);
_local1.Multiply((m_inv_dt * m_impulse));
return (_local1);
}
override public function SolvePositionConstraints():Boolean{
var _local1:b2Mat22;
var _local2:b2Body;
var _local3:b2Body;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
if (m_frequencyHz > 0){
return (true);
};
_local2 = m_body1;
_local3 = m_body2;
_local1 = _local2.m_xf.R;
_local4 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local5 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local6 = ((_local1.col1.x * _local4) + (_local1.col2.x * _local5));
_local5 = ((_local1.col1.y * _local4) + (_local1.col2.y * _local5));
_local4 = _local6;
_local1 = _local3.m_xf.R;
_local7 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local8 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local6 = ((_local1.col1.x * _local7) + (_local1.col2.x * _local8));
_local8 = ((_local1.col1.y * _local7) + (_local1.col2.y * _local8));
_local7 = _local6;
_local9 = (((_local3.m_sweep.c.x + _local7) - _local2.m_sweep.c.x) - _local4);
_local10 = (((_local3.m_sweep.c.y + _local8) - _local2.m_sweep.c.y) - _local5);
_local11 = Math.sqrt(((_local9 * _local9) + (_local10 * _local10)));
_local9 = (_local9 / _local11);
_local10 = (_local10 / _local11);
_local12 = (_local11 - m_length);
_local12 = b2Math.b2Clamp(_local12, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
_local13 = (-(m_mass) * _local12);
m_u.Set(_local9, _local10);
_local14 = (_local13 * m_u.x);
_local15 = (_local13 * m_u.y);
_local2.m_sweep.c.x = (_local2.m_sweep.c.x - (_local2.m_invMass * _local14));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y - (_local2.m_invMass * _local15));
_local2.m_sweep.a = (_local2.m_sweep.a - (_local2.m_invI * ((_local4 * _local15) - (_local5 * _local14))));
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + (_local3.m_invMass * _local14));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + (_local3.m_invMass * _local15));
_local3.m_sweep.a = (_local3.m_sweep.a + (_local3.m_invI * ((_local7 * _local15) - (_local8 * _local14))));
_local2.SynchronizeTransform();
_local3.SynchronizeTransform();
return ((b2Math.b2Abs(_local12) < b2Settings.b2_linearSlop));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Mat22;
var _local3:Number;
var _local4:b2Body;
var _local5:b2Body;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
m_inv_dt = _arg1.inv_dt;
_local4 = m_body1;
_local5 = m_body2;
_local2 = _local4.m_xf.R;
_local6 = (m_localAnchor1.x - _local4.m_sweep.localCenter.x);
_local7 = (m_localAnchor1.y - _local4.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local6) + (_local2.col2.x * _local7));
_local7 = ((_local2.col1.y * _local6) + (_local2.col2.y * _local7));
_local6 = _local3;
_local2 = _local5.m_xf.R;
_local8 = (m_localAnchor2.x - _local5.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local5.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local8) + (_local2.col2.x * _local9));
_local9 = ((_local2.col1.y * _local8) + (_local2.col2.y * _local9));
_local8 = _local3;
m_u.x = (((_local5.m_sweep.c.x + _local8) - _local4.m_sweep.c.x) - _local6);
m_u.y = (((_local5.m_sweep.c.y + _local9) - _local4.m_sweep.c.y) - _local7);
_local10 = Math.sqrt(((m_u.x * m_u.x) + (m_u.y * m_u.y)));
if (_local10 > b2Settings.b2_linearSlop){
m_u.Multiply((1 / _local10));
} else {
m_u.SetZero();
};
_local11 = ((_local6 * m_u.y) - (_local7 * m_u.x));
_local12 = ((_local8 * m_u.y) - (_local9 * m_u.x));
_local13 = (((_local4.m_invMass + ((_local4.m_invI * _local11) * _local11)) + _local5.m_invMass) + ((_local5.m_invI * _local12) * _local12));
m_mass = (1 / _local13);
if (m_frequencyHz > 0){
_local14 = (_local10 - m_length);
_local15 = ((2 * Math.PI) * m_frequencyHz);
_local16 = (((2 * m_mass) * m_dampingRatio) * _local15);
_local17 = ((m_mass * _local15) * _local15);
m_gamma = (1 / (_arg1.dt * (_local16 + (_arg1.dt * _local17))));
m_bias = (((_local14 * _arg1.dt) * _local17) * m_gamma);
m_mass = (1 / (_local13 + m_gamma));
};
if (_arg1.warmStarting){
m_impulse = (m_impulse * _arg1.dtRatio);
_local18 = (m_impulse * m_u.x);
_local19 = (m_impulse * m_u.y);
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x - (_local4.m_invMass * _local18));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y - (_local4.m_invMass * _local19));
_local4.m_angularVelocity = (_local4.m_angularVelocity - (_local4.m_invI * ((_local6 * _local19) - (_local7 * _local18))));
_local5.m_linearVelocity.x = (_local5.m_linearVelocity.x + (_local5.m_invMass * _local18));
_local5.m_linearVelocity.y = (_local5.m_linearVelocity.y + (_local5.m_invMass * _local19));
_local5.m_angularVelocity = (_local5.m_angularVelocity + (_local5.m_invI * ((_local8 * _local19) - (_local9 * _local18))));
} else {
m_impulse = 0;
};
}
override public function GetReactionTorque():Number{
return (0);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Mat22;
var _local3:b2Body;
var _local4:b2Body;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
_local3 = m_body1;
_local4 = m_body2;
_local2 = _local3.m_xf.R;
_local5 = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
_local6 = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
_local7 = ((_local2.col1.x * _local5) + (_local2.col2.x * _local6));
_local6 = ((_local2.col1.y * _local5) + (_local2.col2.y * _local6));
_local5 = _local7;
_local2 = _local4.m_xf.R;
_local8 = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local7 = ((_local2.col1.x * _local8) + (_local2.col2.x * _local9));
_local9 = ((_local2.col1.y * _local8) + (_local2.col2.y * _local9));
_local8 = _local7;
_local10 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local6));
_local11 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local5));
_local12 = (_local4.m_linearVelocity.x + (-(_local4.m_angularVelocity) * _local9));
_local13 = (_local4.m_linearVelocity.y + (_local4.m_angularVelocity * _local8));
_local14 = ((m_u.x * (_local12 - _local10)) + (m_u.y * (_local13 - _local11)));
_local15 = (-(m_mass) * ((_local14 + m_bias) + (m_gamma * m_impulse)));
m_impulse = (m_impulse + _local15);
_local16 = (_local15 * m_u.x);
_local17 = (_local15 * m_u.y);
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x - (_local3.m_invMass * _local16));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y - (_local3.m_invMass * _local17));
_local3.m_angularVelocity = (_local3.m_angularVelocity - (_local3.m_invI * ((_local5 * _local17) - (_local6 * _local16))));
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x + (_local4.m_invMass * _local16));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y + (_local4.m_invMass * _local17));
_local4.m_angularVelocity = (_local4.m_angularVelocity + (_local4.m_invI * ((_local8 * _local17) - (_local9 * _local16))));
}
}
}//package Box2D.Dynamics.Joints
Section 49
//b2DistanceJointDef (Box2D.Dynamics.Joints.b2DistanceJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2DistanceJointDef extends b2JointDef {
public var length:Number;
public var dampingRatio:Number;
public var frequencyHz:Number;
public var localAnchor2:b2Vec2;
public var localAnchor1:b2Vec2;
public function b2DistanceJointDef(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
super();
type = b2Joint.e_distanceJoint;
length = 1;
frequencyHz = 0;
dampingRatio = 0;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2):void{
var _local5:Number;
var _local6:Number;
body1 = _arg1;
body2 = _arg2;
localAnchor1.SetV(body1.GetLocalPoint(_arg3));
localAnchor2.SetV(body2.GetLocalPoint(_arg4));
_local5 = (_arg4.x - _arg3.x);
_local6 = (_arg4.y - _arg3.y);
length = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
frequencyHz = 0;
dampingRatio = 0;
}
}
}//package Box2D.Dynamics.Joints
Section 50
//b2GearJoint (Box2D.Dynamics.Joints.b2GearJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2GearJoint extends b2Joint {
public var m_force:Number;
public var m_mass:Number;
public var m_prismatic1:b2PrismaticJoint;
public var m_prismatic2:b2PrismaticJoint;
public var m_ground1:b2Body;
public var m_ground2:b2Body;
public var m_constant:Number;
public var m_revolute1:b2RevoluteJoint;
public var m_revolute2:b2RevoluteJoint;
public var m_groundAnchor1:b2Vec2;
public var m_groundAnchor2:b2Vec2;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_ratio:Number;
public var m_J:b2Jacobian;
public function b2GearJoint(_arg1:b2GearJointDef){
var _local2:int;
var _local3:int;
var _local4:Number;
var _local5:Number;
m_groundAnchor1 = new b2Vec2();
m_groundAnchor2 = new b2Vec2();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_J = new b2Jacobian();
super(_arg1);
_local2 = _arg1.joint1.m_type;
_local3 = _arg1.joint2.m_type;
m_revolute1 = null;
m_prismatic1 = null;
m_revolute2 = null;
m_prismatic2 = null;
m_ground1 = _arg1.joint1.m_body1;
m_body1 = _arg1.joint1.m_body2;
if (_local2 == b2Joint.e_revoluteJoint){
m_revolute1 = (_arg1.joint1 as b2RevoluteJoint);
m_groundAnchor1.SetV(m_revolute1.m_localAnchor1);
m_localAnchor1.SetV(m_revolute1.m_localAnchor2);
_local4 = m_revolute1.GetJointAngle();
} else {
m_prismatic1 = (_arg1.joint1 as b2PrismaticJoint);
m_groundAnchor1.SetV(m_prismatic1.m_localAnchor1);
m_localAnchor1.SetV(m_prismatic1.m_localAnchor2);
_local4 = m_prismatic1.GetJointTranslation();
};
m_ground2 = _arg1.joint2.m_body1;
m_body2 = _arg1.joint2.m_body2;
if (_local3 == b2Joint.e_revoluteJoint){
m_revolute2 = (_arg1.joint2 as b2RevoluteJoint);
m_groundAnchor2.SetV(m_revolute2.m_localAnchor1);
m_localAnchor2.SetV(m_revolute2.m_localAnchor2);
_local5 = m_revolute2.GetJointAngle();
} else {
m_prismatic2 = (_arg1.joint2 as b2PrismaticJoint);
m_groundAnchor2.SetV(m_prismatic2.m_localAnchor1);
m_localAnchor2.SetV(m_prismatic2.m_localAnchor2);
_local5 = m_prismatic2.GetJointTranslation();
};
m_ratio = _arg1.ratio;
m_constant = (_local4 + (m_ratio * _local5));
m_force = 0;
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Vec2;
_local1 = new b2Vec2((m_force * m_J.linear2.x), (m_force * m_J.linear2.y));
return (_local1);
}
override public function SolvePositionConstraints():Boolean{
var _local1:Number;
var _local2:b2Body;
var _local3:b2Body;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local1 = 0;
_local2 = m_body1;
_local3 = m_body2;
if (m_revolute1){
_local4 = m_revolute1.GetJointAngle();
} else {
_local4 = m_prismatic1.GetJointTranslation();
};
if (m_revolute2){
_local5 = m_revolute2.GetJointAngle();
} else {
_local5 = m_prismatic2.GetJointTranslation();
};
_local6 = (m_constant - (_local4 + (m_ratio * _local5)));
_local7 = (-(m_mass) * _local6);
_local2.m_sweep.c.x = (_local2.m_sweep.c.x + ((_local2.m_invMass * _local7) * m_J.linear1.x));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y + ((_local2.m_invMass * _local7) * m_J.linear1.y));
_local2.m_sweep.a = (_local2.m_sweep.a + ((_local2.m_invI * _local7) * m_J.angular1));
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local3.m_invMass * _local7) * m_J.linear2.x));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local3.m_invMass * _local7) * m_J.linear2.y));
_local3.m_sweep.a = (_local3.m_sweep.a + ((_local3.m_invI * _local7) * m_J.angular2));
_local2.SynchronizeTransform();
_local3.SynchronizeTransform();
return ((_local1 < b2Settings.b2_linearSlop));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Body;
var _local5:b2Body;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:b2Mat22;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
_local2 = m_ground1;
_local3 = m_ground2;
_local4 = m_body1;
_local5 = m_body2;
_local14 = 0;
m_J.SetZero();
if (m_revolute1){
m_J.angular1 = -1;
_local14 = (_local14 + _local4.m_invI);
} else {
_local10 = _local2.m_xf.R;
_local11 = m_prismatic1.m_localXAxis1;
_local6 = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y));
_local7 = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y));
_local10 = _local4.m_xf.R;
_local8 = (m_localAnchor1.x - _local4.m_sweep.localCenter.x);
_local9 = (m_localAnchor1.y - _local4.m_sweep.localCenter.y);
_local13 = ((_local10.col1.x * _local8) + (_local10.col2.x * _local9));
_local9 = ((_local10.col1.y * _local8) + (_local10.col2.y * _local9));
_local8 = _local13;
_local12 = ((_local8 * _local7) - (_local9 * _local6));
m_J.linear1.Set(-(_local6), -(_local7));
m_J.angular1 = -(_local12);
_local14 = (_local14 + (_local4.m_invMass + ((_local4.m_invI * _local12) * _local12)));
};
if (m_revolute2){
m_J.angular2 = -(m_ratio);
_local14 = (_local14 + ((m_ratio * m_ratio) * _local5.m_invI));
} else {
_local10 = _local3.m_xf.R;
_local11 = m_prismatic2.m_localXAxis1;
_local6 = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y));
_local7 = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y));
_local10 = _local5.m_xf.R;
_local8 = (m_localAnchor2.x - _local5.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local5.m_sweep.localCenter.y);
_local13 = ((_local10.col1.x * _local8) + (_local10.col2.x * _local9));
_local9 = ((_local10.col1.y * _local8) + (_local10.col2.y * _local9));
_local8 = _local13;
_local12 = ((_local8 * _local7) - (_local9 * _local6));
m_J.linear2.Set((-(m_ratio) * _local6), (-(m_ratio) * _local7));
m_J.angular2 = (-(m_ratio) * _local12);
_local14 = (_local14 + ((m_ratio * m_ratio) * (_local5.m_invMass + ((_local5.m_invI * _local12) * _local12))));
};
m_mass = (1 / _local14);
if (_arg1.warmStarting){
_local15 = (_arg1.dt * m_force);
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x + ((_local4.m_invMass * _local15) * m_J.linear1.x));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y + ((_local4.m_invMass * _local15) * m_J.linear1.y));
_local4.m_angularVelocity = (_local4.m_angularVelocity + ((_local4.m_invI * _local15) * m_J.angular1));
_local5.m_linearVelocity.x = (_local5.m_linearVelocity.x + ((_local5.m_invMass * _local15) * m_J.linear2.x));
_local5.m_linearVelocity.y = (_local5.m_linearVelocity.y + ((_local5.m_invMass * _local15) * m_J.linear2.y));
_local5.m_angularVelocity = (_local5.m_angularVelocity + ((_local5.m_invI * _local15) * m_J.angular2));
} else {
m_force = 0;
};
}
override public function GetReactionTorque():Number{
var _local1:b2Mat22;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = m_body2.m_xf.R;
_local2 = (m_localAnchor1.x - m_body2.m_sweep.localCenter.x);
_local3 = (m_localAnchor1.y - m_body2.m_sweep.localCenter.y);
_local4 = ((_local1.col1.x * _local2) + (_local1.col2.x * _local3));
_local3 = ((_local1.col1.y * _local2) + (_local1.col2.y * _local3));
_local2 = _local4;
_local4 = ((m_force * m_J.angular2) - ((_local2 * (m_force * m_J.linear2.y)) - (_local3 * (m_force * m_J.linear2.x))));
return (_local4);
}
public function GetRatio():Number{
return (m_ratio);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = m_J.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
_local5 = ((-(_arg1.inv_dt) * m_mass) * _local4);
m_force = (m_force + _local5);
_local6 = (_arg1.dt * _local5);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local2.m_invMass * _local6) * m_J.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local2.m_invMass * _local6) * m_J.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local2.m_invI * _local6) * m_J.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local3.m_invMass * _local6) * m_J.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local3.m_invMass * _local6) * m_J.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _local6) * m_J.angular2));
}
}
}//package Box2D.Dynamics.Joints
Section 51
//b2GearJointDef (Box2D.Dynamics.Joints.b2GearJointDef)
package Box2D.Dynamics.Joints {
public class b2GearJointDef extends b2JointDef {
public var joint2:b2Joint;
public var joint1:b2Joint;
public var ratio:Number;
public function b2GearJointDef(){
type = b2Joint.e_gearJoint;
joint1 = null;
joint2 = null;
ratio = 1;
}
}
}//package Box2D.Dynamics.Joints
Section 52
//b2Jacobian (Box2D.Dynamics.Joints.b2Jacobian)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
public class b2Jacobian {
public var linear1:b2Vec2;
public var linear2:b2Vec2;
public var angular2:Number;
public var angular1:Number;
public function b2Jacobian(){
linear1 = new b2Vec2();
linear2 = new b2Vec2();
super();
}
public function Set(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:Number):void{
linear1.SetV(_arg1);
angular1 = _arg2;
linear2.SetV(_arg3);
angular2 = _arg4;
}
public function SetZero():void{
linear1.SetZero();
angular1 = 0;
linear2.SetZero();
angular2 = 0;
}
public function Compute(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:Number):Number{
return ((((((linear1.x * _arg1.x) + (linear1.y * _arg1.y)) + (angular1 * _arg2)) + ((linear2.x * _arg3.x) + (linear2.y * _arg3.y))) + (angular2 * _arg4)));
}
}
}//package Box2D.Dynamics.Joints
Section 53
//b2Joint (Box2D.Dynamics.Joints.b2Joint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2Joint {
public var m_islandFlag:Boolean;
public var m_body1:b2Body;
public var m_prev:b2Joint;
public var m_next:b2Joint;
public var m_type:int;
public var m_collideConnected:Boolean;
public var m_node1:b2JointEdge;
public var m_node2:b2JointEdge;
public var m_inv_dt:Number;
public var m_userData;
public var m_body2:b2Body;
public static const e_unknownJoint:int = 0;
public static const e_inactiveLimit:int = 0;
public static const e_atUpperLimit:int = 2;
public static const e_atLowerLimit:int = 1;
public static const e_gearJoint:int = 6;
public static const e_revoluteJoint:int = 1;
public static const e_equalLimits:int = 3;
public static const e_distanceJoint:int = 3;
public static const e_pulleyJoint:int = 4;
public static const e_prismaticJoint:int = 2;
public static const e_mouseJoint:int = 5;
public function b2Joint(_arg1:b2JointDef){
m_node1 = new b2JointEdge();
m_node2 = new b2JointEdge();
super();
m_type = _arg1.type;
m_prev = null;
m_next = null;
m_body1 = _arg1.body1;
m_body2 = _arg1.body2;
m_collideConnected = _arg1.collideConnected;
m_islandFlag = false;
m_userData = _arg1.userData;
}
public function GetAnchor1():b2Vec2{
return (null);
}
public function GetAnchor2():b2Vec2{
return (null);
}
public function InitVelocityConstraints(_arg1:b2TimeStep):void{
}
public function GetType():int{
return (m_type);
}
public function GetBody2():b2Body{
return (m_body2);
}
public function GetNext():b2Joint{
return (m_next);
}
public function GetReactionTorque():Number{
return (0);
}
public function GetUserData(){
return (m_userData);
}
public function GetReactionForce():b2Vec2{
return (null);
}
public function SolvePositionConstraints():Boolean{
return (false);
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public function GetBody1():b2Body{
return (m_body1);
}
public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
}
public function InitPositionConstraints():void{
}
public static function Destroy(_arg1:b2Joint, _arg2):void{
}
public static function Create(_arg1:b2JointDef, _arg2):b2Joint{
var _local3:b2Joint;
_local3 = null;
switch (_arg1.type){
case e_distanceJoint:
_local3 = new b2DistanceJoint((_arg1 as b2DistanceJointDef));
break;
case e_mouseJoint:
_local3 = new b2MouseJoint((_arg1 as b2MouseJointDef));
break;
case e_prismaticJoint:
_local3 = new b2PrismaticJoint((_arg1 as b2PrismaticJointDef));
break;
case e_revoluteJoint:
_local3 = new b2RevoluteJoint((_arg1 as b2RevoluteJointDef));
break;
case e_pulleyJoint:
_local3 = new b2PulleyJoint((_arg1 as b2PulleyJointDef));
break;
case e_gearJoint:
_local3 = new b2GearJoint((_arg1 as b2GearJointDef));
break;
default:
break;
};
return (_local3);
}
}
}//package Box2D.Dynamics.Joints
Section 54
//b2JointDef (Box2D.Dynamics.Joints.b2JointDef)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
public class b2JointDef {
public var collideConnected:Boolean;
public var body1:b2Body;
public var body2:b2Body;
public var userData;
public var type:int;
public function b2JointDef(){
type = b2Joint.e_unknownJoint;
userData = null;
body1 = null;
body2 = null;
collideConnected = false;
}
}
}//package Box2D.Dynamics.Joints
Section 55
//b2JointEdge (Box2D.Dynamics.Joints.b2JointEdge)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
public class b2JointEdge {
public var joint:b2Joint;
public var other:b2Body;
public var next:b2JointEdge;
public var prev:b2JointEdge;
}
}//package Box2D.Dynamics.Joints
Section 56
//b2MouseJoint (Box2D.Dynamics.Joints.b2MouseJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2MouseJoint extends b2Joint {
public var m_beta:Number;
public var m_mass:b2Mat22;
public var m_target:b2Vec2;
public var m_impulse:b2Vec2;
public var m_localAnchor:b2Vec2;
private var K1:b2Mat22;
private var K2:b2Mat22;
private var K:b2Mat22;
public var m_gamma:Number;
public var m_C:b2Vec2;
public var m_maxForce:Number;
public function b2MouseJoint(_arg1:b2MouseJointDef){
var _local2:Number;
var _local3:Number;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
K = new b2Mat22();
K1 = new b2Mat22();
K2 = new b2Mat22();
m_localAnchor = new b2Vec2();
m_target = new b2Vec2();
m_impulse = new b2Vec2();
m_mass = new b2Mat22();
m_C = new b2Vec2();
super(_arg1);
m_target.SetV(_arg1.target);
_local2 = (m_target.x - m_body2.m_xf.position.x);
_local3 = (m_target.y - m_body2.m_xf.position.y);
_local4 = m_body2.m_xf.R;
m_localAnchor.x = ((_local2 * _local4.col1.x) + (_local3 * _local4.col1.y));
m_localAnchor.y = ((_local2 * _local4.col2.x) + (_local3 * _local4.col2.y));
m_maxForce = _arg1.maxForce;
m_impulse.SetZero();
_local5 = m_body2.m_mass;
_local6 = ((2 * b2Settings.b2_pi) * _arg1.frequencyHz);
_local7 = (((2 * _local5) * _arg1.dampingRatio) * _local6);
_local8 = ((_arg1.timeStep * _local5) * (_local6 * _local6));
m_gamma = (1 / (_local7 + _local8));
m_beta = (_local8 / (_local7 + _local8));
}
override public function GetAnchor1():b2Vec2{
return (m_target);
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor));
}
override public function GetReactionForce():b2Vec2{
return (m_impulse);
}
override public function SolvePositionConstraints():Boolean{
return (true);
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local2 = m_body2;
_local3 = _local2.m_xf.R;
_local4 = (m_localAnchor.x - _local2.m_sweep.localCenter.x);
_local5 = (m_localAnchor.y - _local2.m_sweep.localCenter.y);
_local6 = ((_local3.col1.x * _local4) + (_local3.col2.x * _local5));
_local5 = ((_local3.col1.y * _local4) + (_local3.col2.y * _local5));
_local4 = _local6;
_local7 = _local2.m_invMass;
_local8 = _local2.m_invI;
K1.col1.x = _local7;
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = _local7;
K2.col1.x = ((_local8 * _local5) * _local5);
K2.col2.x = ((-(_local8) * _local4) * _local5);
K2.col1.y = ((-(_local8) * _local4) * _local5);
K2.col2.y = ((_local8 * _local4) * _local4);
K.SetM(K1);
K.AddM(K2);
K.col1.x = (K.col1.x + m_gamma);
K.col2.y = (K.col2.y + m_gamma);
K.Invert(m_mass);
m_C.x = ((_local2.m_sweep.c.x + _local4) - m_target.x);
m_C.y = ((_local2.m_sweep.c.y + _local5) - m_target.y);
_local2.m_angularVelocity = (_local2.m_angularVelocity * 0.98);
_local9 = (_arg1.dt * m_impulse.x);
_local10 = (_arg1.dt * m_impulse.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local7 * _local9));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local7 * _local10));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local8 * ((_local4 * _local10) - (_local5 * _local9))));
}
override public function GetReactionTorque():Number{
return (0);
}
public function SetTarget(_arg1:b2Vec2):void{
if (m_body2.IsSleeping()){
m_body2.WakeUp();
};
m_target = _arg1;
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
_local2 = m_body2;
_local3 = _local2.m_xf.R;
_local6 = (m_localAnchor.x - _local2.m_sweep.localCenter.x);
_local7 = (m_localAnchor.y - _local2.m_sweep.localCenter.y);
_local4 = ((_local3.col1.x * _local6) + (_local3.col2.x * _local7));
_local7 = ((_local3.col1.y * _local6) + (_local3.col2.y * _local7));
_local6 = _local4;
_local8 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local7));
_local9 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local6));
_local3 = m_mass;
_local4 = ((_local8 + ((m_beta * _arg1.inv_dt) * m_C.x)) + ((m_gamma * _arg1.dt) * m_impulse.x));
_local5 = ((_local9 + ((m_beta * _arg1.inv_dt) * m_C.y)) + ((m_gamma * _arg1.dt) * m_impulse.y));
_local10 = (-(_arg1.inv_dt) * ((_local3.col1.x * _local4) + (_local3.col2.x * _local5)));
_local11 = (-(_arg1.inv_dt) * ((_local3.col1.y * _local4) + (_local3.col2.y * _local5)));
_local12 = m_impulse.x;
_local13 = m_impulse.y;
m_impulse.x = (m_impulse.x + _local10);
m_impulse.y = (m_impulse.y + _local11);
_local14 = m_impulse.Length();
if (_local14 > m_maxForce){
m_impulse.Multiply((m_maxForce / _local14));
};
_local10 = (m_impulse.x - _local12);
_local11 = (m_impulse.y - _local13);
_local15 = (_arg1.dt * _local10);
_local16 = (_arg1.dt * _local11);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local15));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local16));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local6 * _local16) - (_local7 * _local15))));
}
}
}//package Box2D.Dynamics.Joints
Section 57
//b2MouseJointDef (Box2D.Dynamics.Joints.b2MouseJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
public class b2MouseJointDef extends b2JointDef {
public var frequencyHz:Number;
public var dampingRatio:Number;
public var maxForce:Number;
public var target:b2Vec2;
public var timeStep:Number;
public function b2MouseJointDef(){
target = new b2Vec2();
super();
type = b2Joint.e_mouseJoint;
maxForce = 0;
frequencyHz = 5;
dampingRatio = 0.7;
timeStep = (1 / 60);
}
}
}//package Box2D.Dynamics.Joints
Section 58
//b2PrismaticJoint (Box2D.Dynamics.Joints.b2PrismaticJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2PrismaticJoint extends b2Joint {
public var m_limitForce:Number;
public var m_refAngle:Number;
public var m_lowerTranslation:Number;
public var m_localXAxis1:b2Vec2;
public var m_torque:Number;
public var m_enableLimit:Boolean;
public var m_motorForce:Number;
public var m_force:Number;
public var m_localYAxis1:b2Vec2;
public var m_motorMass:Number;
public var m_maxMotorForce:Number;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_angularMass:Number;
public var m_limitState:int;
public var m_linearMass:Number;
public var m_upperTranslation:Number;
public var m_motorJacobian:b2Jacobian;
public var m_limitPositionImpulse:Number;
public var m_motorSpeed:Number;
public var m_linearJacobian:b2Jacobian;
public var m_enableMotor:Boolean;
public function b2PrismaticJoint(_arg1:b2PrismaticJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_localXAxis1 = new b2Vec2();
m_localYAxis1 = new b2Vec2();
m_linearJacobian = new b2Jacobian();
m_motorJacobian = new b2Jacobian();
super(_arg1);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_localXAxis1.SetV(_arg1.localAxis1);
m_localYAxis1.x = -(m_localXAxis1.y);
m_localYAxis1.y = m_localXAxis1.x;
m_refAngle = _arg1.referenceAngle;
m_linearJacobian.SetZero();
m_linearMass = 0;
m_force = 0;
m_angularMass = 0;
m_torque = 0;
m_motorJacobian.SetZero();
m_motorMass = 0;
m_motorForce = 0;
m_limitForce = 0;
m_limitPositionImpulse = 0;
m_lowerTranslation = _arg1.lowerTranslation;
m_upperTranslation = _arg1.upperTranslation;
m_maxMotorForce = _arg1.maxMotorForce;
m_motorSpeed = _arg1.motorSpeed;
m_enableLimit = _arg1.enableLimit;
m_enableMotor = _arg1.enableMotor;
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
public function EnableMotor(_arg1:Boolean):void{
m_enableMotor = _arg1;
}
public function GetUpperLimit():Number{
return (m_upperTranslation);
}
public function GetLowerLimit():Number{
return (m_lowerTranslation);
}
public function GetJointTranslation():Number{
var _local1:b2Body;
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:b2Vec2;
var _local6:Number;
var _local7:Number;
var _local8:b2Vec2;
var _local9:Number;
_local1 = m_body1;
_local2 = m_body2;
_local4 = _local1.GetWorldPoint(m_localAnchor1);
_local5 = _local2.GetWorldPoint(m_localAnchor2);
_local6 = (_local5.x - _local4.x);
_local7 = (_local5.y - _local4.y);
_local8 = _local1.GetWorldVector(m_localXAxis1);
_local9 = ((_local8.x * _local6) + (_local8.y * _local7));
return (_local9);
}
public function SetLimits(_arg1:Number, _arg2:Number):void{
m_lowerTranslation = _arg1;
m_upperTranslation = _arg2;
}
public function GetMotorSpeed():Number{
return (m_motorSpeed);
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Mat22;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = m_body1.m_xf.R;
_local2 = (m_limitForce * ((_local1.col1.x * m_localXAxis1.x) + (_local1.col2.x * m_localXAxis1.y)));
_local3 = (m_limitForce * ((_local1.col1.y * m_localXAxis1.x) + (_local1.col2.y * m_localXAxis1.y)));
_local4 = (m_force * ((_local1.col1.x * m_localYAxis1.x) + (_local1.col2.x * m_localYAxis1.y)));
_local5 = (m_force * ((_local1.col1.y * m_localYAxis1.x) + (_local1.col2.y * m_localYAxis1.y)));
return (new b2Vec2(((m_limitForce * _local2) + (m_force * _local4)), ((m_limitForce * _local3) + (m_force * _local5))));
}
override public function SolvePositionConstraints():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:b2Body;
var _local4:b2Body;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:b2Mat22;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
_local3 = m_body1;
_local4 = m_body2;
_local5 = _local3.m_invMass;
_local6 = _local4.m_invMass;
_local7 = _local3.m_invI;
_local8 = _local4.m_invI;
_local9 = _local3.m_xf.R;
_local11 = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
_local12 = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local11) + (_local9.col2.x * _local12));
_local12 = ((_local9.col1.y * _local11) + (_local9.col2.y * _local12));
_local11 = _local10;
_local9 = _local4.m_xf.R;
_local13 = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
_local14 = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local13) + (_local9.col2.x * _local14));
_local14 = ((_local9.col1.y * _local13) + (_local9.col2.y * _local14));
_local13 = _local10;
_local15 = (_local3.m_sweep.c.x + _local11);
_local16 = (_local3.m_sweep.c.y + _local12);
_local17 = (_local4.m_sweep.c.x + _local13);
_local18 = (_local4.m_sweep.c.y + _local14);
_local19 = (_local17 - _local15);
_local20 = (_local18 - _local16);
_local9 = _local3.m_xf.R;
_local21 = ((_local9.col1.x * m_localYAxis1.x) + (_local9.col2.x * m_localYAxis1.y));
_local22 = ((_local9.col1.y * m_localYAxis1.x) + (_local9.col2.y * m_localYAxis1.y));
_local23 = ((_local21 * _local19) + (_local22 * _local20));
_local23 = b2Math.b2Clamp(_local23, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
_local24 = (-(m_linearMass) * _local23);
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local5 * _local24) * m_linearJacobian.linear1.x));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local5 * _local24) * m_linearJacobian.linear1.y));
_local3.m_sweep.a = (_local3.m_sweep.a + ((_local7 * _local24) * m_linearJacobian.angular1));
_local4.m_sweep.c.x = (_local4.m_sweep.c.x + ((_local6 * _local24) * m_linearJacobian.linear2.x));
_local4.m_sweep.c.y = (_local4.m_sweep.c.y + ((_local6 * _local24) * m_linearJacobian.linear2.y));
_local4.m_sweep.a = (_local4.m_sweep.a + ((_local8 * _local24) * m_linearJacobian.angular2));
_local25 = b2Math.b2Abs(_local23);
_local26 = ((_local4.m_sweep.a - _local3.m_sweep.a) - m_refAngle);
_local26 = b2Math.b2Clamp(_local26, -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection);
_local27 = (-(m_angularMass) * _local26);
_local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * _local27));
_local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * _local27));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
_local28 = b2Math.b2Abs(_local26);
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local9 = _local3.m_xf.R;
_local11 = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
_local12 = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local11) + (_local9.col2.x * _local12));
_local12 = ((_local9.col1.y * _local11) + (_local9.col2.y * _local12));
_local11 = _local10;
_local9 = _local4.m_xf.R;
_local13 = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
_local14 = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local13) + (_local9.col2.x * _local14));
_local14 = ((_local9.col1.y * _local13) + (_local9.col2.y * _local14));
_local13 = _local10;
_local15 = (_local3.m_sweep.c.x + _local11);
_local16 = (_local3.m_sweep.c.y + _local12);
_local17 = (_local4.m_sweep.c.x + _local13);
_local18 = (_local4.m_sweep.c.y + _local14);
_local19 = (_local17 - _local15);
_local20 = (_local18 - _local16);
_local9 = _local3.m_xf.R;
_local29 = ((_local9.col1.x * m_localXAxis1.x) + (_local9.col2.x * m_localXAxis1.y));
_local30 = ((_local9.col1.y * m_localXAxis1.x) + (_local9.col2.y * m_localXAxis1.y));
_local31 = ((_local29 * _local19) + (_local30 * _local20));
_local32 = 0;
if (m_limitState == e_equalLimits){
_local1 = b2Math.b2Clamp(_local31, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
_local32 = (-(m_motorMass) * _local1);
_local25 = b2Math.b2Max(_local25, b2Math.b2Abs(_local26));
} else {
if (m_limitState == e_atLowerLimit){
_local1 = (_local31 - m_lowerTranslation);
_local25 = b2Math.b2Max(_local25, -(_local1));
_local1 = b2Math.b2Clamp((_local1 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local32 = (-(m_motorMass) * _local1);
_local2 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Max((m_limitPositionImpulse + _local32), 0);
_local32 = (m_limitPositionImpulse - _local2);
} else {
if (m_limitState == e_atUpperLimit){
_local1 = (_local31 - m_upperTranslation);
_local25 = b2Math.b2Max(_local25, _local1);
_local1 = b2Math.b2Clamp((_local1 - b2Settings.b2_linearSlop), 0, b2Settings.b2_maxLinearCorrection);
_local32 = (-(m_motorMass) * _local1);
_local2 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Min((m_limitPositionImpulse + _local32), 0);
_local32 = (m_limitPositionImpulse - _local2);
};
};
};
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local5 * _local32) * m_motorJacobian.linear1.x));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local5 * _local32) * m_motorJacobian.linear1.y));
_local3.m_sweep.a = (_local3.m_sweep.a + ((_local7 * _local32) * m_motorJacobian.angular1));
_local4.m_sweep.c.x = (_local4.m_sweep.c.x + ((_local6 * _local32) * m_motorJacobian.linear2.x));
_local4.m_sweep.c.y = (_local4.m_sweep.c.y + ((_local6 * _local32) * m_motorJacobian.linear2.y));
_local4.m_sweep.a = (_local4.m_sweep.a + ((_local8 * _local32) * m_motorJacobian.angular2));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
};
return ((((_local25 <= b2Settings.b2_linearSlop)) && ((_local28 <= b2Settings.b2_angularSlop))));
}
public function GetJointSpeed():Number{
var _local1:b2Body;
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:b2Vec2;
var _local16:b2Vec2;
var _local17:b2Vec2;
var _local18:Number;
var _local19:Number;
var _local20:Number;
_local1 = m_body1;
_local2 = m_body2;
_local3 = _local1.m_xf.R;
_local4 = (m_localAnchor1.x - _local1.m_sweep.localCenter.x);
_local5 = (m_localAnchor1.y - _local1.m_sweep.localCenter.y);
_local6 = ((_local3.col1.x * _local4) + (_local3.col2.x * _local5));
_local5 = ((_local3.col1.y * _local4) + (_local3.col2.y * _local5));
_local4 = _local6;
_local3 = _local2.m_xf.R;
_local7 = (m_localAnchor2.x - _local2.m_sweep.localCenter.x);
_local8 = (m_localAnchor2.y - _local2.m_sweep.localCenter.y);
_local6 = ((_local3.col1.x * _local7) + (_local3.col2.x * _local8));
_local8 = ((_local3.col1.y * _local7) + (_local3.col2.y * _local8));
_local7 = _local6;
_local9 = (_local1.m_sweep.c.x + _local4);
_local10 = (_local1.m_sweep.c.y + _local5);
_local11 = (_local2.m_sweep.c.x + _local7);
_local12 = (_local2.m_sweep.c.y + _local8);
_local13 = (_local11 - _local9);
_local14 = (_local12 - _local10);
_local15 = _local1.GetWorldVector(m_localXAxis1);
_local16 = _local1.m_linearVelocity;
_local17 = _local2.m_linearVelocity;
_local18 = _local1.m_angularVelocity;
_local19 = _local2.m_angularVelocity;
_local20 = (((_local13 * (-(_local18) * _local15.y)) + (_local14 * (_local18 * _local15.x))) + ((_local15.x * (((_local17.x + (-(_local19) * _local8)) - _local16.x) - (-(_local18) * _local5))) + (_local15.y * (((_local17.y + (_local19 * _local7)) - _local16.y) - (_local18 * _local4)))));
return (_local20);
}
public function SetMotorSpeed(_arg1:Number):void{
m_motorSpeed = _arg1;
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
_local6 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local7 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7));
_local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7));
_local6 = _local5;
_local4 = _local3.m_xf.R;
_local8 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local5;
_local10 = _local2.m_invMass;
_local11 = _local3.m_invMass;
_local12 = _local2.m_invI;
_local13 = _local3.m_invI;
_local4 = _local2.m_xf.R;
_local14 = ((_local4.col1.x * m_localYAxis1.x) + (_local4.col2.x * m_localYAxis1.y));
_local15 = ((_local4.col1.y * m_localYAxis1.x) + (_local4.col2.y * m_localYAxis1.y));
_local16 = ((_local3.m_sweep.c.x + _local8) - _local2.m_sweep.c.x);
_local17 = ((_local3.m_sweep.c.y + _local9) - _local2.m_sweep.c.y);
m_linearJacobian.linear1.x = -(_local14);
m_linearJacobian.linear1.y = -(_local15);
m_linearJacobian.linear2.x = _local14;
m_linearJacobian.linear2.y = _local15;
m_linearJacobian.angular1 = -(((_local16 * _local15) - (_local17 * _local14)));
m_linearJacobian.angular2 = ((_local8 * _local15) - (_local9 * _local14));
m_linearMass = (((_local10 + ((_local12 * m_linearJacobian.angular1) * m_linearJacobian.angular1)) + _local11) + ((_local13 * m_linearJacobian.angular2) * m_linearJacobian.angular2));
m_linearMass = (1 / m_linearMass);
m_angularMass = (_local12 + _local13);
if (m_angularMass > Number.MIN_VALUE){
m_angularMass = (1 / m_angularMass);
};
if (((m_enableLimit) || (m_enableMotor))){
_local4 = _local2.m_xf.R;
_local18 = ((_local4.col1.x * m_localXAxis1.x) + (_local4.col2.x * m_localXAxis1.y));
_local19 = ((_local4.col1.y * m_localXAxis1.x) + (_local4.col2.y * m_localXAxis1.y));
m_motorJacobian.linear1.x = -(_local18);
m_motorJacobian.linear1.y = -(_local19);
m_motorJacobian.linear2.x = _local18;
m_motorJacobian.linear2.y = _local19;
m_motorJacobian.angular1 = -(((_local16 * _local19) - (_local17 * _local18)));
m_motorJacobian.angular2 = ((_local8 * _local19) - (_local9 * _local18));
m_motorMass = (((_local10 + ((_local12 * m_motorJacobian.angular1) * m_motorJacobian.angular1)) + _local11) + ((_local13 * m_motorJacobian.angular2) * m_motorJacobian.angular2));
m_motorMass = (1 / m_motorMass);
if (m_enableLimit){
_local20 = (_local16 - _local6);
_local21 = (_local17 - _local7);
_local22 = ((_local18 * _local20) + (_local19 * _local21));
if (b2Math.b2Abs((m_upperTranslation - m_lowerTranslation)) < (2 * b2Settings.b2_linearSlop)){
m_limitState = e_equalLimits;
} else {
if (_local22 <= m_lowerTranslation){
if (m_limitState != e_atLowerLimit){
m_limitForce = 0;
};
m_limitState = e_atLowerLimit;
} else {
if (_local22 >= m_upperTranslation){
if (m_limitState != e_atUpperLimit){
m_limitForce = 0;
};
m_limitState = e_atUpperLimit;
} else {
m_limitState = e_inactiveLimit;
m_limitForce = 0;
};
};
};
};
};
if (m_enableMotor == false){
m_motorForce = 0;
};
if (m_enableLimit == false){
m_limitForce = 0;
};
if (_arg1.warmStarting){
_local23 = (_arg1.dt * ((m_force * m_linearJacobian.linear1.x) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear1.x)));
_local24 = (_arg1.dt * ((m_force * m_linearJacobian.linear1.y) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear1.y)));
_local25 = (_arg1.dt * ((m_force * m_linearJacobian.linear2.x) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear2.x)));
_local26 = (_arg1.dt * ((m_force * m_linearJacobian.linear2.y) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear2.y)));
_local27 = (_arg1.dt * (((m_force * m_linearJacobian.angular1) - m_torque) + ((m_motorForce + m_limitForce) * m_motorJacobian.angular1)));
_local28 = (_arg1.dt * (((m_force * m_linearJacobian.angular2) + m_torque) + ((m_motorForce + m_limitForce) * m_motorJacobian.angular2)));
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local10 * _local23));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local10 * _local24));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local12 * _local27));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local11 * _local25));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local11 * _local26));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local13 * _local28));
} else {
m_force = 0;
m_torque = 0;
m_limitForce = 0;
m_motorForce = 0;
};
m_limitPositionImpulse = 0;
}
public function GetMotorForce():Number{
return (m_motorForce);
}
public function SetMaxMotorForce(_arg1:Number):void{
m_maxMotorForce = _arg1;
}
public function EnableLimit(_arg1:Boolean):void{
m_enableLimit = _arg1;
}
override public function GetReactionTorque():Number{
return (m_torque);
}
public function IsLimitEnabled():Boolean{
return (m_enableLimit);
}
public function IsMotorEnabled():Boolean{
return (m_enableMotor);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_invMass;
_local5 = _local3.m_invMass;
_local6 = _local2.m_invI;
_local7 = _local3.m_invI;
_local9 = m_linearJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
_local10 = ((-(_arg1.inv_dt) * m_linearMass) * _local9);
m_force = (m_force + _local10);
_local11 = (_arg1.dt * _local10);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_linearJacobian.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_linearJacobian.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_linearJacobian.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_linearJacobian.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_linearJacobian.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_linearJacobian.angular2));
_local12 = (_local3.m_angularVelocity - _local2.m_angularVelocity);
_local13 = ((-(_arg1.inv_dt) * m_angularMass) * _local12);
m_torque = (m_torque + _local13);
_local14 = (_arg1.dt * _local13);
_local2.m_angularVelocity = (_local2.m_angularVelocity - (_local6 * _local14));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local7 * _local14));
if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){
_local15 = (m_motorJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity) - m_motorSpeed);
_local16 = ((-(_arg1.inv_dt) * m_motorMass) * _local15);
_local17 = m_motorForce;
m_motorForce = b2Math.b2Clamp((m_motorForce + _local16), -(m_maxMotorForce), m_maxMotorForce);
_local16 = (m_motorForce - _local17);
_local11 = (_arg1.dt * _local16);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_motorJacobian.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_motorJacobian.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_motorJacobian.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_motorJacobian.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_motorJacobian.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_motorJacobian.angular2));
};
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local18 = m_motorJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
_local19 = ((-(_arg1.inv_dt) * m_motorMass) * _local18);
if (m_limitState == e_equalLimits){
m_limitForce = (m_limitForce + _local19);
} else {
if (m_limitState == e_atLowerLimit){
_local8 = m_limitForce;
m_limitForce = b2Math.b2Max((m_limitForce + _local19), 0);
_local19 = (m_limitForce - _local8);
} else {
if (m_limitState == e_atUpperLimit){
_local8 = m_limitForce;
m_limitForce = b2Math.b2Min((m_limitForce + _local19), 0);
_local19 = (m_limitForce - _local8);
};
};
};
_local11 = (_arg1.dt * _local19);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_motorJacobian.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_motorJacobian.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_motorJacobian.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_motorJacobian.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_motorJacobian.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_motorJacobian.angular2));
};
}
}
}//package Box2D.Dynamics.Joints
Section 59
//b2PrismaticJointDef (Box2D.Dynamics.Joints.b2PrismaticJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2PrismaticJointDef extends b2JointDef {
public var localAxis1:b2Vec2;
public var referenceAngle:Number;
public var maxMotorForce:Number;
public var motorSpeed:Number;
public var upperTranslation:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var enableLimit:Boolean;
public var enableMotor:Boolean;
public var lowerTranslation:Number;
public function b2PrismaticJointDef(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
localAxis1 = new b2Vec2();
super();
type = b2Joint.e_prismaticJoint;
localAxis1.Set(1, 0);
referenceAngle = 0;
enableLimit = false;
lowerTranslation = 0;
upperTranslation = 0;
enableMotor = false;
maxMotorForce = 0;
motorSpeed = 0;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2):void{
body1 = _arg1;
body2 = _arg2;
localAnchor1 = body1.GetLocalPoint(_arg3);
localAnchor2 = body2.GetLocalPoint(_arg3);
localAxis1 = body1.GetLocalVector(_arg4);
referenceAngle = (body2.GetAngle() - body1.GetAngle());
}
}
}//package Box2D.Dynamics.Joints
Section 60
//b2PulleyJoint (Box2D.Dynamics.Joints.b2PulleyJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2PulleyJoint extends b2Joint {
public var m_ground:b2Body;
public var m_maxLength2:Number;
public var m_limitForce1:Number;
public var m_maxLength1:Number;
public var m_limitState1:int;
public var m_limitState2:int;
public var m_limitPositionImpulse2:Number;
public var m_force:Number;
public var m_limitPositionImpulse1:Number;
public var m_constant:Number;
public var m_state:int;
public var m_ratio:Number;
public var m_groundAnchor1:b2Vec2;
public var m_groundAnchor2:b2Vec2;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_positionImpulse:Number;
public var m_limitMass2:Number;
public var m_limitMass1:Number;
public var m_pulleyMass:Number;
public var m_u1:b2Vec2;
public var m_u2:b2Vec2;
public var m_limitForce2:Number;
public static const b2_minPulleyLength:Number = 2;
public function b2PulleyJoint(_arg1:b2PulleyJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_groundAnchor1 = new b2Vec2();
m_groundAnchor2 = new b2Vec2();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_u1 = new b2Vec2();
m_u2 = new b2Vec2();
super(_arg1);
m_ground = m_body1.m_world.m_groundBody;
m_groundAnchor1.x = (_arg1.groundAnchor1.x - m_ground.m_xf.position.x);
m_groundAnchor1.y = (_arg1.groundAnchor1.y - m_ground.m_xf.position.y);
m_groundAnchor2.x = (_arg1.groundAnchor2.x - m_ground.m_xf.position.x);
m_groundAnchor2.y = (_arg1.groundAnchor2.y - m_ground.m_xf.position.y);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_ratio = _arg1.ratio;
m_constant = (_arg1.length1 + (m_ratio * _arg1.length2));
m_maxLength1 = b2Math.b2Min(_arg1.maxLength1, (m_constant - (m_ratio * b2_minPulleyLength)));
m_maxLength2 = b2Math.b2Min(_arg1.maxLength2, ((m_constant - b2_minPulleyLength) / m_ratio));
m_force = 0;
m_limitForce1 = 0;
m_limitForce2 = 0;
}
public function GetGroundAnchor2():b2Vec2{
var _local1:b2Vec2;
_local1 = m_ground.m_xf.position.Copy();
_local1.Add(m_groundAnchor2);
return (_local1);
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Vec2;
_local1 = m_u2.Copy();
_local1.Multiply(m_force);
return (_local1);
}
override public function SolvePositionConstraints():Boolean{
var _local1:b2Body;
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
_local1 = m_body1;
_local2 = m_body2;
_local4 = (m_ground.m_xf.position.x + m_groundAnchor1.x);
_local5 = (m_ground.m_xf.position.y + m_groundAnchor1.y);
_local6 = (m_ground.m_xf.position.x + m_groundAnchor2.x);
_local7 = (m_ground.m_xf.position.y + m_groundAnchor2.y);
_local23 = 0;
if (m_state == e_atUpperLimit){
_local3 = _local1.m_xf.R;
_local8 = (m_localAnchor1.x - _local1.m_sweep.localCenter.x);
_local9 = (m_localAnchor1.y - _local1.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local8) + (_local3.col2.x * _local9));
_local9 = ((_local3.col1.y * _local8) + (_local3.col2.y * _local9));
_local8 = _local22;
_local3 = _local2.m_xf.R;
_local10 = (m_localAnchor2.x - _local2.m_sweep.localCenter.x);
_local11 = (m_localAnchor2.y - _local2.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local10) + (_local3.col2.x * _local11));
_local11 = ((_local3.col1.y * _local10) + (_local3.col2.y * _local11));
_local10 = _local22;
_local12 = (_local1.m_sweep.c.x + _local8);
_local13 = (_local1.m_sweep.c.y + _local9);
_local14 = (_local2.m_sweep.c.x + _local10);
_local15 = (_local2.m_sweep.c.y + _local11);
m_u1.Set((_local12 - _local4), (_local13 - _local5));
m_u2.Set((_local14 - _local6), (_local15 - _local7));
_local16 = m_u1.Length();
_local17 = m_u2.Length();
if (_local16 > b2Settings.b2_linearSlop){
m_u1.Multiply((1 / _local16));
} else {
m_u1.SetZero();
};
if (_local17 > b2Settings.b2_linearSlop){
m_u2.Multiply((1 / _local17));
} else {
m_u2.SetZero();
};
_local18 = ((m_constant - _local16) - (m_ratio * _local17));
_local23 = b2Math.b2Max(_local23, -(_local18));
_local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local19 = (-(m_pulleyMass) * _local18);
_local20 = m_positionImpulse;
m_positionImpulse = b2Math.b2Max(0, (m_positionImpulse + _local19));
_local19 = (m_positionImpulse - _local20);
_local12 = (-(_local19) * m_u1.x);
_local13 = (-(_local19) * m_u1.y);
_local14 = ((-(m_ratio) * _local19) * m_u2.x);
_local15 = ((-(m_ratio) * _local19) * m_u2.y);
_local1.m_sweep.c.x = (_local1.m_sweep.c.x + (_local1.m_invMass * _local12));
_local1.m_sweep.c.y = (_local1.m_sweep.c.y + (_local1.m_invMass * _local13));
_local1.m_sweep.a = (_local1.m_sweep.a + (_local1.m_invI * ((_local8 * _local13) - (_local9 * _local12))));
_local2.m_sweep.c.x = (_local2.m_sweep.c.x + (_local2.m_invMass * _local14));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y + (_local2.m_invMass * _local15));
_local2.m_sweep.a = (_local2.m_sweep.a + (_local2.m_invI * ((_local10 * _local15) - (_local11 * _local14))));
_local1.SynchronizeTransform();
_local2.SynchronizeTransform();
};
if (m_limitState1 == e_atUpperLimit){
_local3 = _local1.m_xf.R;
_local8 = (m_localAnchor1.x - _local1.m_sweep.localCenter.x);
_local9 = (m_localAnchor1.y - _local1.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local8) + (_local3.col2.x * _local9));
_local9 = ((_local3.col1.y * _local8) + (_local3.col2.y * _local9));
_local8 = _local22;
_local12 = (_local1.m_sweep.c.x + _local8);
_local13 = (_local1.m_sweep.c.y + _local9);
m_u1.Set((_local12 - _local4), (_local13 - _local5));
_local16 = m_u1.Length();
if (_local16 > b2Settings.b2_linearSlop){
m_u1.x = (m_u1.x * (1 / _local16));
m_u1.y = (m_u1.y * (1 / _local16));
} else {
m_u1.SetZero();
};
_local18 = (m_maxLength1 - _local16);
_local23 = b2Math.b2Max(_local23, -(_local18));
_local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local19 = (-(m_limitMass1) * _local18);
_local21 = m_limitPositionImpulse1;
m_limitPositionImpulse1 = b2Math.b2Max(0, (m_limitPositionImpulse1 + _local19));
_local19 = (m_limitPositionImpulse1 - _local21);
_local12 = (-(_local19) * m_u1.x);
_local13 = (-(_local19) * m_u1.y);
_local1.m_sweep.c.x = (_local1.m_sweep.c.x + (_local1.m_invMass * _local12));
_local1.m_sweep.c.y = (_local1.m_sweep.c.y + (_local1.m_invMass * _local13));
_local1.m_sweep.a = (_local1.m_sweep.a + (_local1.m_invI * ((_local8 * _local13) - (_local9 * _local12))));
_local1.SynchronizeTransform();
};
if (m_limitState2 == e_atUpperLimit){
_local3 = _local2.m_xf.R;
_local10 = (m_localAnchor2.x - _local2.m_sweep.localCenter.x);
_local11 = (m_localAnchor2.y - _local2.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local10) + (_local3.col2.x * _local11));
_local11 = ((_local3.col1.y * _local10) + (_local3.col2.y * _local11));
_local10 = _local22;
_local14 = (_local2.m_sweep.c.x + _local10);
_local15 = (_local2.m_sweep.c.y + _local11);
m_u2.Set((_local14 - _local6), (_local15 - _local7));
_local17 = m_u2.Length();
if (_local17 > b2Settings.b2_linearSlop){
m_u2.x = (m_u2.x * (1 / _local17));
m_u2.y = (m_u2.y * (1 / _local17));
} else {
m_u2.SetZero();
};
_local18 = (m_maxLength2 - _local17);
_local23 = b2Math.b2Max(_local23, -(_local18));
_local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local19 = (-(m_limitMass2) * _local18);
_local21 = m_limitPositionImpulse2;
m_limitPositionImpulse2 = b2Math.b2Max(0, (m_limitPositionImpulse2 + _local19));
_local19 = (m_limitPositionImpulse2 - _local21);
_local14 = (-(_local19) * m_u2.x);
_local15 = (-(_local19) * m_u2.y);
_local2.m_sweep.c.x = (_local2.m_sweep.c.x + (_local2.m_invMass * _local14));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y + (_local2.m_invMass * _local15));
_local2.m_sweep.a = (_local2.m_sweep.a + (_local2.m_invI * ((_local10 * _local15) - (_local11 * _local14))));
_local2.SynchronizeTransform();
};
return ((_local23 < b2Settings.b2_linearSlop));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
_local5 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local6 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local5) + (_local4.col2.x * _local6));
_local6 = ((_local4.col1.y * _local5) + (_local4.col2.y * _local6));
_local5 = _local7;
_local4 = _local3.m_xf.R;
_local8 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local7;
_local10 = (_local2.m_sweep.c.x + _local5);
_local11 = (_local2.m_sweep.c.y + _local6);
_local12 = (_local3.m_sweep.c.x + _local8);
_local13 = (_local3.m_sweep.c.y + _local9);
_local14 = (m_ground.m_xf.position.x + m_groundAnchor1.x);
_local15 = (m_ground.m_xf.position.y + m_groundAnchor1.y);
_local16 = (m_ground.m_xf.position.x + m_groundAnchor2.x);
_local17 = (m_ground.m_xf.position.y + m_groundAnchor2.y);
m_u1.Set((_local10 - _local14), (_local11 - _local15));
m_u2.Set((_local12 - _local16), (_local13 - _local17));
_local18 = m_u1.Length();
_local19 = m_u2.Length();
if (_local18 > b2Settings.b2_linearSlop){
m_u1.Multiply((1 / _local18));
} else {
m_u1.SetZero();
};
if (_local19 > b2Settings.b2_linearSlop){
m_u2.Multiply((1 / _local19));
} else {
m_u2.SetZero();
};
_local20 = ((m_constant - _local18) - (m_ratio * _local19));
if (_local20 > 0){
m_state = e_inactiveLimit;
m_force = 0;
} else {
m_state = e_atUpperLimit;
m_positionImpulse = 0;
};
if (_local18 < m_maxLength1){
m_limitState1 = e_inactiveLimit;
m_limitForce1 = 0;
} else {
m_limitState1 = e_atUpperLimit;
m_limitPositionImpulse1 = 0;
};
if (_local19 < m_maxLength2){
m_limitState2 = e_inactiveLimit;
m_limitForce2 = 0;
} else {
m_limitState2 = e_atUpperLimit;
m_limitPositionImpulse2 = 0;
};
_local21 = ((_local5 * m_u1.y) - (_local6 * m_u1.x));
_local22 = ((_local8 * m_u2.y) - (_local9 * m_u2.x));
m_limitMass1 = (_local2.m_invMass + ((_local2.m_invI * _local21) * _local21));
m_limitMass2 = (_local3.m_invMass + ((_local3.m_invI * _local22) * _local22));
m_pulleyMass = (m_limitMass1 + ((m_ratio * m_ratio) * m_limitMass2));
m_limitMass1 = (1 / m_limitMass1);
m_limitMass2 = (1 / m_limitMass2);
m_pulleyMass = (1 / m_pulleyMass);
if (_arg1.warmStarting){
_local23 = ((_arg1.dt * (-(m_force) - m_limitForce1)) * m_u1.x);
_local24 = ((_arg1.dt * (-(m_force) - m_limitForce1)) * m_u1.y);
_local25 = ((_arg1.dt * ((-(m_ratio) * m_force) - m_limitForce2)) * m_u2.x);
_local26 = ((_arg1.dt * ((-(m_ratio) * m_force) - m_limitForce2)) * m_u2.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local23));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local24));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local24) - (_local6 * _local23))));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local25));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local26));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local26) - (_local9 * _local25))));
} else {
m_force = 0;
m_limitForce1 = 0;
m_limitForce2 = 0;
};
}
override public function GetReactionTorque():Number{
return (0);
}
public function GetRatio():Number{
return (m_ratio);
}
public function GetLength2():Number{
var _local1:b2Vec2;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = m_body2.GetWorldPoint(m_localAnchor2);
_local2 = (m_ground.m_xf.position.x + m_groundAnchor2.x);
_local3 = (m_ground.m_xf.position.y + m_groundAnchor2.y);
_local4 = (_local1.x - _local2);
_local5 = (_local1.y - _local3);
return (Math.sqrt(((_local4 * _local4) + (_local5 * _local5))));
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
_local5 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local6 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local5) + (_local4.col2.x * _local6));
_local6 = ((_local4.col1.y * _local5) + (_local4.col2.y * _local6));
_local5 = _local7;
_local4 = _local3.m_xf.R;
_local8 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local7;
if (m_state == e_atUpperLimit){
_local10 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local6));
_local11 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local5));
_local12 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9));
_local13 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8));
_local18 = (-(((m_u1.x * _local10) + (m_u1.y * _local11))) - (m_ratio * ((m_u2.x * _local12) + (m_u2.y * _local13))));
_local19 = ((-(_arg1.inv_dt) * m_pulleyMass) * _local18);
_local20 = m_force;
m_force = b2Math.b2Max(0, (m_force + _local19));
_local19 = (m_force - _local20);
_local14 = ((-(_arg1.dt) * _local19) * m_u1.x);
_local15 = ((-(_arg1.dt) * _local19) * m_u1.y);
_local16 = (((-(_arg1.dt) * m_ratio) * _local19) * m_u2.x);
_local17 = (((-(_arg1.dt) * m_ratio) * _local19) * m_u2.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local14));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local15));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local15) - (_local6 * _local14))));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local16));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local17));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local17) - (_local9 * _local16))));
};
if (m_limitState1 == e_atUpperLimit){
_local10 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local6));
_local11 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local5));
_local18 = -(((m_u1.x * _local10) + (m_u1.y * _local11)));
_local19 = ((-(_arg1.inv_dt) * m_limitMass1) * _local18);
_local20 = m_limitForce1;
m_limitForce1 = b2Math.b2Max(0, (m_limitForce1 + _local19));
_local19 = (m_limitForce1 - _local20);
_local14 = ((-(_arg1.dt) * _local19) * m_u1.x);
_local15 = ((-(_arg1.dt) * _local19) * m_u1.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local14));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local15));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local15) - (_local6 * _local14))));
};
if (m_limitState2 == e_atUpperLimit){
_local12 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9));
_local13 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8));
_local18 = -(((m_u2.x * _local12) + (m_u2.y * _local13)));
_local19 = ((-(_arg1.inv_dt) * m_limitMass2) * _local18);
_local20 = m_limitForce2;
m_limitForce2 = b2Math.b2Max(0, (m_limitForce2 + _local19));
_local19 = (m_limitForce2 - _local20);
_local16 = ((-(_arg1.dt) * _local19) * m_u2.x);
_local17 = ((-(_arg1.dt) * _local19) * m_u2.y);
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local16));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local17));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local17) - (_local9 * _local16))));
};
}
public function GetLength1():Number{
var _local1:b2Vec2;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = m_body1.GetWorldPoint(m_localAnchor1);
_local2 = (m_ground.m_xf.position.x + m_groundAnchor1.x);
_local3 = (m_ground.m_xf.position.y + m_groundAnchor1.y);
_local4 = (_local1.x - _local2);
_local5 = (_local1.y - _local3);
return (Math.sqrt(((_local4 * _local4) + (_local5 * _local5))));
}
public function GetGroundAnchor1():b2Vec2{
var _local1:b2Vec2;
_local1 = m_ground.m_xf.position.Copy();
_local1.Add(m_groundAnchor1);
return (_local1);
}
}
}//package Box2D.Dynamics.Joints
Section 61
//b2PulleyJointDef (Box2D.Dynamics.Joints.b2PulleyJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2PulleyJointDef extends b2JointDef {
public var maxLength2:Number;
public var length1:Number;
public var length2:Number;
public var maxLength1:Number;
public var ratio:Number;
public var groundAnchor1:b2Vec2;
public var groundAnchor2:b2Vec2;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public function b2PulleyJointDef(){
groundAnchor1 = new b2Vec2();
groundAnchor2 = new b2Vec2();
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
super();
type = b2Joint.e_pulleyJoint;
groundAnchor1.Set(-1, 1);
groundAnchor2.Set(1, 1);
localAnchor1.Set(-1, 0);
localAnchor2.Set(1, 0);
length1 = 0;
maxLength1 = 0;
length2 = 0;
maxLength2 = 0;
ratio = 1;
collideConnected = true;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2, _arg5:b2Vec2, _arg6:b2Vec2, _arg7:Number):void{
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
body1 = _arg1;
body2 = _arg2;
groundAnchor1.SetV(_arg3);
groundAnchor2.SetV(_arg4);
localAnchor1 = body1.GetLocalPoint(_arg5);
localAnchor2 = body2.GetLocalPoint(_arg6);
_local8 = (_arg5.x - _arg3.x);
_local9 = (_arg5.y - _arg3.y);
length1 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9)));
_local10 = (_arg6.x - _arg4.x);
_local11 = (_arg6.y - _arg4.y);
length2 = Math.sqrt(((_local10 * _local10) + (_local11 * _local11)));
ratio = _arg7;
_local12 = (length1 + (ratio * length2));
maxLength1 = (_local12 - (ratio * b2PulleyJoint.b2_minPulleyLength));
maxLength2 = ((_local12 - b2PulleyJoint.b2_minPulleyLength) / ratio);
}
}
}//package Box2D.Dynamics.Joints
Section 62
//b2RevoluteJoint (Box2D.Dynamics.Joints.b2RevoluteJoint)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Common.*;
public class b2RevoluteJoint extends b2Joint {
public var m_limitForce:Number;
public var m_motorForce:Number;
public var m_pivotMass:b2Mat22;
public var m_enableLimit:Boolean;
public var m_limitState:int;
public var m_motorMass:Number;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
private var K1:b2Mat22;
private var K2:b2Mat22;
private var K3:b2Mat22;
private var K:b2Mat22;
public var m_pivotForce:b2Vec2;
public var m_motorSpeed:Number;
public var m_enableMotor:Boolean;
public var m_limitPositionImpulse:Number;
public var m_maxMotorTorque:Number;
public var m_referenceAngle:Number;
public var m_lowerAngle:Number;
public var m_upperAngle:Number;
public static var tImpulse:b2Vec2 = new b2Vec2();
public function b2RevoluteJoint(_arg1:b2RevoluteJointDef){
K = new b2Mat22();
K1 = new b2Mat22();
K2 = new b2Mat22();
K3 = new b2Mat22();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_pivotForce = new b2Vec2();
m_pivotMass = new b2Mat22();
super(_arg1);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_referenceAngle = _arg1.referenceAngle;
m_pivotForce.Set(0, 0);
m_motorForce = 0;
m_limitForce = 0;
m_limitPositionImpulse = 0;
m_lowerAngle = _arg1.lowerAngle;
m_upperAngle = _arg1.upperAngle;
m_maxMotorTorque = _arg1.maxMotorTorque;
m_motorSpeed = _arg1.motorSpeed;
m_enableLimit = _arg1.enableLimit;
m_enableMotor = _arg1.enableMotor;
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
public function EnableMotor(_arg1:Boolean):void{
m_enableMotor = _arg1;
}
public function GetUpperLimit():Number{
return (m_upperAngle);
}
public function GetLowerLimit():Number{
return (m_lowerAngle);
}
public function SetLimits(_arg1:Number, _arg2:Number):void{
m_lowerAngle = _arg1;
m_upperAngle = _arg2;
}
public function GetMotorSpeed():Number{
return (m_motorSpeed);
}
override public function GetReactionForce():b2Vec2{
return (m_pivotForce);
}
override public function SolvePositionConstraints():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:b2Body;
var _local4:b2Body;
var _local5:Number;
var _local6:b2Mat22;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
_local3 = m_body1;
_local4 = m_body2;
_local5 = 0;
_local6 = _local3.m_xf.R;
_local7 = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
_local8 = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
_local9 = ((_local6.col1.x * _local7) + (_local6.col2.x * _local8));
_local8 = ((_local6.col1.y * _local7) + (_local6.col2.y * _local8));
_local7 = _local9;
_local6 = _local4.m_xf.R;
_local10 = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
_local11 = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local9 = ((_local6.col1.x * _local10) + (_local6.col2.x * _local11));
_local11 = ((_local6.col1.y * _local10) + (_local6.col2.y * _local11));
_local10 = _local9;
_local12 = (_local3.m_sweep.c.x + _local7);
_local13 = (_local3.m_sweep.c.y + _local8);
_local14 = (_local4.m_sweep.c.x + _local10);
_local15 = (_local4.m_sweep.c.y + _local11);
_local16 = (_local14 - _local12);
_local17 = (_local15 - _local13);
_local5 = Math.sqrt(((_local16 * _local16) + (_local17 * _local17)));
_local18 = _local3.m_invMass;
_local19 = _local4.m_invMass;
_local20 = _local3.m_invI;
_local21 = _local4.m_invI;
K1.col1.x = (_local18 + _local19);
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = (_local18 + _local19);
K2.col1.x = ((_local20 * _local8) * _local8);
K2.col2.x = ((-(_local20) * _local7) * _local8);
K2.col1.y = ((-(_local20) * _local7) * _local8);
K2.col2.y = ((_local20 * _local7) * _local7);
K3.col1.x = ((_local21 * _local11) * _local11);
K3.col2.x = ((-(_local21) * _local10) * _local11);
K3.col1.y = ((-(_local21) * _local10) * _local11);
K3.col2.y = ((_local21 * _local10) * _local10);
K.SetM(K1);
K.AddM(K2);
K.AddM(K3);
K.Solve(tImpulse, -(_local16), -(_local17));
_local22 = tImpulse.x;
_local23 = tImpulse.y;
_local3.m_sweep.c.x = (_local3.m_sweep.c.x - (_local3.m_invMass * _local22));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y - (_local3.m_invMass * _local23));
_local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * ((_local7 * _local23) - (_local8 * _local22))));
_local4.m_sweep.c.x = (_local4.m_sweep.c.x + (_local4.m_invMass * _local22));
_local4.m_sweep.c.y = (_local4.m_sweep.c.y + (_local4.m_invMass * _local23));
_local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * ((_local10 * _local23) - (_local11 * _local22))));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
_local24 = 0;
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local25 = ((_local4.m_sweep.a - _local3.m_sweep.a) - m_referenceAngle);
_local26 = 0;
if (m_limitState == e_equalLimits){
_local2 = b2Math.b2Clamp(_local25, -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection);
_local26 = (-(m_motorMass) * _local2);
_local24 = b2Math.b2Abs(_local2);
} else {
if (m_limitState == e_atLowerLimit){
_local2 = (_local25 - m_lowerAngle);
_local24 = b2Math.b2Max(0, -(_local2));
_local2 = b2Math.b2Clamp((_local2 + b2Settings.b2_angularSlop), -(b2Settings.b2_maxAngularCorrection), 0);
_local26 = (-(m_motorMass) * _local2);
_local1 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Max((m_limitPositionImpulse + _local26), 0);
_local26 = (m_limitPositionImpulse - _local1);
} else {
if (m_limitState == e_atUpperLimit){
_local2 = (_local25 - m_upperAngle);
_local24 = b2Math.b2Max(0, _local2);
_local2 = b2Math.b2Clamp((_local2 - b2Settings.b2_angularSlop), 0, b2Settings.b2_maxAngularCorrection);
_local26 = (-(m_motorMass) * _local2);
_local1 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Min((m_limitPositionImpulse + _local26), 0);
_local26 = (m_limitPositionImpulse - _local1);
};
};
};
_local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * _local26));
_local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * _local26));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
};
return ((((_local5 <= b2Settings.b2_linearSlop)) && ((_local24 <= b2Settings.b2_angularSlop))));
}
public function GetJointSpeed():Number{
return ((m_body2.m_angularVelocity - m_body1.m_angularVelocity));
}
public function SetMotorSpeed(_arg1:Number):void{
m_motorSpeed = _arg1;
}
public function SetMaxMotorTorque(_arg1:Number):void{
m_maxMotorTorque = _arg1;
}
public function GetJointAngle():Number{
return (((m_body2.m_sweep.a - m_body1.m_sweep.a) - m_referenceAngle));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
_local6 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local7 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7));
_local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7));
_local6 = _local5;
_local4 = _local3.m_xf.R;
_local8 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local5;
_local10 = _local2.m_invMass;
_local11 = _local3.m_invMass;
_local12 = _local2.m_invI;
_local13 = _local3.m_invI;
K1.col1.x = (_local10 + _local11);
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = (_local10 + _local11);
K2.col1.x = ((_local12 * _local7) * _local7);
K2.col2.x = ((-(_local12) * _local6) * _local7);
K2.col1.y = ((-(_local12) * _local6) * _local7);
K2.col2.y = ((_local12 * _local6) * _local6);
K3.col1.x = ((_local13 * _local9) * _local9);
K3.col2.x = ((-(_local13) * _local8) * _local9);
K3.col1.y = ((-(_local13) * _local8) * _local9);
K3.col2.y = ((_local13 * _local8) * _local8);
K.SetM(K1);
K.AddM(K2);
K.AddM(K3);
K.Invert(m_pivotMass);
m_motorMass = (1 / (_local12 + _local13));
if (m_enableMotor == false){
m_motorForce = 0;
};
if (m_enableLimit){
_local14 = ((_local3.m_sweep.a - _local2.m_sweep.a) - m_referenceAngle);
if (b2Math.b2Abs((m_upperAngle - m_lowerAngle)) < (2 * b2Settings.b2_angularSlop)){
m_limitState = e_equalLimits;
} else {
if (_local14 <= m_lowerAngle){
if (m_limitState != e_atLowerLimit){
m_limitForce = 0;
};
m_limitState = e_atLowerLimit;
} else {
if (_local14 >= m_upperAngle){
if (m_limitState != e_atUpperLimit){
m_limitForce = 0;
};
m_limitState = e_atUpperLimit;
} else {
m_limitState = e_inactiveLimit;
m_limitForce = 0;
};
};
};
} else {
m_limitForce = 0;
};
if (_arg1.warmStarting){
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x - ((_arg1.dt * _local10) * m_pivotForce.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y - ((_arg1.dt * _local10) * m_pivotForce.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity - ((_arg1.dt * _local12) * ((((_local6 * m_pivotForce.y) - (_local7 * m_pivotForce.x)) + m_motorForce) + m_limitForce)));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_arg1.dt * _local11) * m_pivotForce.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_arg1.dt * _local11) * m_pivotForce.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_arg1.dt * _local13) * ((((_local8 * m_pivotForce.y) - (_local9 * m_pivotForce.x)) + m_motorForce) + m_limitForce)));
} else {
m_pivotForce.SetZero();
m_motorForce = 0;
m_limitForce = 0;
};
m_limitPositionImpulse = 0;
}
public function EnableLimit(_arg1:Boolean):void{
m_enableLimit = _arg1;
}
public function GetMotorTorque():Number{
return (m_motorForce);
}
override public function GetReactionTorque():Number{
return (m_limitForce);
}
public function IsLimitEnabled():Boolean{
return (m_enableLimit);
}
public function IsMotorEnabled():Boolean{
return (m_enableMotor);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
_local6 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local7 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7));
_local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7));
_local6 = _local5;
_local4 = _local3.m_xf.R;
_local8 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local5;
_local11 = (((_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9)) - _local2.m_linearVelocity.x) - (-(_local2.m_angularVelocity) * _local7));
_local12 = (((_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8)) - _local2.m_linearVelocity.y) - (_local2.m_angularVelocity * _local6));
_local13 = (-(_arg1.inv_dt) * ((m_pivotMass.col1.x * _local11) + (m_pivotMass.col2.x * _local12)));
_local14 = (-(_arg1.inv_dt) * ((m_pivotMass.col1.y * _local11) + (m_pivotMass.col2.y * _local12)));
m_pivotForce.x = (m_pivotForce.x + _local13);
m_pivotForce.y = (m_pivotForce.y + _local14);
_local15 = (_arg1.dt * _local13);
_local16 = (_arg1.dt * _local14);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x - (_local2.m_invMass * _local15));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y - (_local2.m_invMass * _local16));
_local2.m_angularVelocity = (_local2.m_angularVelocity - (_local2.m_invI * ((_local6 * _local16) - (_local7 * _local15))));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local15));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local16));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local16) - (_local9 * _local15))));
if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){
_local17 = ((_local3.m_angularVelocity - _local2.m_angularVelocity) - m_motorSpeed);
_local18 = ((-(_arg1.inv_dt) * m_motorMass) * _local17);
_local19 = m_motorForce;
m_motorForce = b2Math.b2Clamp((m_motorForce + _local18), -(m_maxMotorTorque), m_maxMotorTorque);
_local18 = (m_motorForce - _local19);
_local2.m_angularVelocity = (_local2.m_angularVelocity - ((_local2.m_invI * _arg1.dt) * _local18));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _arg1.dt) * _local18));
};
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local20 = (_local3.m_angularVelocity - _local2.m_angularVelocity);
_local21 = ((-(_arg1.inv_dt) * m_motorMass) * _local20);
if (m_limitState == e_equalLimits){
m_limitForce = (m_limitForce + _local21);
} else {
if (m_limitState == e_atLowerLimit){
_local10 = m_limitForce;
m_limitForce = b2Math.b2Max((m_limitForce + _local21), 0);
_local21 = (m_limitForce - _local10);
} else {
if (m_limitState == e_atUpperLimit){
_local10 = m_limitForce;
m_limitForce = b2Math.b2Min((m_limitForce + _local21), 0);
_local21 = (m_limitForce - _local10);
};
};
};
_local2.m_angularVelocity = (_local2.m_angularVelocity - ((_local2.m_invI * _arg1.dt) * _local21));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _arg1.dt) * _local21));
};
}
}
}//package Box2D.Dynamics.Joints
Section 63
//b2RevoluteJointDef (Box2D.Dynamics.Joints.b2RevoluteJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
public class b2RevoluteJointDef extends b2JointDef {
public var referenceAngle:Number;
public var upperAngle:Number;
public var lowerAngle:Number;
public var motorSpeed:Number;
public var maxMotorTorque:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var enableLimit:Boolean;
public var enableMotor:Boolean;
public function b2RevoluteJointDef(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
super();
type = b2Joint.e_revoluteJoint;
localAnchor1.Set(0, 0);
localAnchor2.Set(0, 0);
referenceAngle = 0;
lowerAngle = 0;
upperAngle = 0;
maxMotorTorque = 0;
motorSpeed = 0;
enableLimit = false;
enableMotor = false;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2):void{
body1 = _arg1;
body2 = _arg2;
localAnchor1 = body1.GetLocalPoint(_arg3);
localAnchor2 = body2.GetLocalPoint(_arg3);
referenceAngle = (body2.GetAngle() - body1.GetAngle());
}
}
}//package Box2D.Dynamics.Joints
Section 64
//b2Body (Box2D.Dynamics.b2Body)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.Contacts.*;
public class b2Body {
public var m_next:b2Body;
public var m_contactList:b2ContactEdge;
public var m_angularVelocity:Number;
public var m_shapeList:b2Shape;
public var m_force:b2Vec2;
public var m_mass:Number;
public var m_sweep:b2Sweep;
public var m_xf:b2XForm;
public var m_torque:Number;
public var m_userData;
public var m_flags:uint;
public var m_world:b2World;
public var m_prev:b2Body;
public var m_invMass:Number;
public var m_type:int;
public var m_linearDamping:Number;
public var m_angularDamping:Number;
public var m_invI:Number;
public var m_linearVelocity:b2Vec2;
public var m_sleepTime:Number;
public var m_shapeCount:int;
public var m_jointList:b2JointEdge;
public var m_I:Number;
public static var e_fixedRotationFlag:uint = 64;
public static var e_frozenFlag:uint = 2;
public static var e_maxTypes:uint = 3;
public static var e_sleepFlag:uint = 8;
private static var s_massData:b2MassData = new b2MassData();
public static var e_bulletFlag:uint = 32;
public static var e_staticType:uint = 1;
public static var e_islandFlag:uint = 4;
public static var e_allowSleepFlag:uint = 16;
private static var s_xf1:b2XForm = new b2XForm();
public static var e_dynamicType:uint = 2;
public function b2Body(_arg1:b2BodyDef, _arg2:b2World){
var _local3:b2Mat22;
var _local4:b2Vec2;
m_xf = new b2XForm();
m_sweep = new b2Sweep();
m_linearVelocity = new b2Vec2();
m_force = new b2Vec2();
super();
m_flags = 0;
if (_arg1.isBullet){
m_flags = (m_flags | e_bulletFlag);
};
if (_arg1.fixedRotation){
m_flags = (m_flags | e_fixedRotationFlag);
};
if (_arg1.allowSleep){
m_flags = (m_flags | e_allowSleepFlag);
};
if (_arg1.isSleeping){
m_flags = (m_flags | e_sleepFlag);
};
m_world = _arg2;
m_xf.position.SetV(_arg1.position);
m_xf.R.Set(_arg1.angle);
m_sweep.localCenter.SetV(_arg1.massData.center);
m_sweep.t0 = 1;
m_sweep.a0 = (m_sweep.a = _arg1.angle);
_local3 = m_xf.R;
_local4 = m_sweep.localCenter;
m_sweep.c.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
m_sweep.c.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
m_jointList = null;
m_contactList = null;
m_prev = null;
m_next = null;
m_linearDamping = _arg1.linearDamping;
m_angularDamping = _arg1.angularDamping;
m_force.Set(0, 0);
m_torque = 0;
m_linearVelocity.SetZero();
m_angularVelocity = 0;
m_sleepTime = 0;
m_invMass = 0;
m_I = 0;
m_invI = 0;
m_mass = _arg1.massData.mass;
if (m_mass > 0){
m_invMass = (1 / m_mass);
};
if ((m_flags & b2Body.e_fixedRotationFlag) == 0){
m_I = _arg1.massData.I;
};
if (m_I > 0){
m_invI = (1 / m_I);
};
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
m_userData = _arg1.userData;
m_shapeList = null;
m_shapeCount = 0;
}
public function GetLinearVelocityFromWorldPoint(_arg1:b2Vec2):b2Vec2{
return (new b2Vec2((m_linearVelocity.x - (m_angularVelocity * (_arg1.y - m_sweep.c.y))), (m_linearVelocity.y + (m_angularVelocity * (_arg1.x - m_sweep.c.x)))));
}
public function SetLinearVelocity(_arg1:b2Vec2):void{
m_linearVelocity.SetV(_arg1);
}
public function WakeUp():void{
m_flags = (m_flags & ~(e_sleepFlag));
m_sleepTime = 0;
}
public function GetLocalCenter():b2Vec2{
return (m_sweep.localCenter);
}
public function ApplyTorque(_arg1:Number):void{
if (IsSleeping()){
WakeUp();
};
m_torque = (m_torque + _arg1);
}
public function IsFrozen():Boolean{
return (((m_flags & e_frozenFlag) == e_frozenFlag));
}
public function IsDynamic():Boolean{
return ((m_type == e_dynamicType));
}
public function GetLinearVelocity():b2Vec2{
return (m_linearVelocity);
}
public function SynchronizeTransform():void{
var _local1:b2Mat22;
var _local2:b2Vec2;
m_xf.R.Set(m_sweep.a);
_local1 = m_xf.R;
_local2 = m_sweep.localCenter;
m_xf.position.x = (m_sweep.c.x - ((_local1.col1.x * _local2.x) + (_local1.col2.x * _local2.y)));
m_xf.position.y = (m_sweep.c.y - ((_local1.col1.y * _local2.x) + (_local1.col2.y * _local2.y)));
}
public function GetInertia():Number{
return (m_I);
}
public function IsSleeping():Boolean{
return (((m_flags & e_sleepFlag) == e_sleepFlag));
}
public function SetMassFromShapes():void{
var _local1:b2Shape;
var _local2:Number;
var _local3:Number;
var _local4:b2MassData;
var _local5:b2Mat22;
var _local6:b2Vec2;
var _local7:int;
if (m_world.m_lock == true){
return;
};
m_mass = 0;
m_invMass = 0;
m_I = 0;
m_invI = 0;
_local2 = 0;
_local3 = 0;
_local4 = s_massData;
_local1 = m_shapeList;
while (_local1) {
_local1.ComputeMass(_local4);
m_mass = (m_mass + _local4.mass);
_local2 = (_local2 + (_local4.mass * _local4.center.x));
_local3 = (_local3 + (_local4.mass * _local4.center.y));
m_I = (m_I + _local4.I);
_local1 = _local1.m_next;
};
if (m_mass > 0){
m_invMass = (1 / m_mass);
_local2 = (_local2 * m_invMass);
_local3 = (_local3 * m_invMass);
};
if ((((m_I > 0)) && (((m_flags & e_fixedRotationFlag) == 0)))){
m_I = (m_I - (m_mass * ((_local2 * _local2) + (_local3 * _local3))));
m_invI = (1 / m_I);
} else {
m_I = 0;
m_invI = 0;
};
m_sweep.localCenter.Set(_local2, _local3);
_local5 = m_xf.R;
_local6 = m_sweep.localCenter;
m_sweep.c.x = ((_local5.col1.x * _local6.x) + (_local5.col2.x * _local6.y));
m_sweep.c.y = ((_local5.col1.y * _local6.x) + (_local5.col2.y * _local6.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
_local1 = m_shapeList;
while (_local1) {
_local1.UpdateSweepRadius(m_sweep.localCenter);
_local1 = _local1.m_next;
};
_local7 = m_type;
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
if (_local7 != m_type){
_local1 = m_shapeList;
while (_local1) {
_local1.RefilterProxy(m_world.m_broadPhase, m_xf);
_local1 = _local1.m_next;
};
};
}
public function PutToSleep():void{
m_flags = (m_flags | e_sleepFlag);
m_sleepTime = 0;
m_linearVelocity.SetZero();
m_angularVelocity = 0;
m_force.SetZero();
m_torque = 0;
}
public function GetJointList():b2JointEdge{
return (m_jointList);
}
public function SetXForm(_arg1:b2Vec2, _arg2:Number):Boolean{
var _local3:b2Shape;
var _local4:b2Mat22;
var _local5:b2Vec2;
var _local6:Boolean;
var _local7:Boolean;
if (m_world.m_lock == true){
return (true);
};
if (IsFrozen()){
return (false);
};
m_xf.R.Set(_arg2);
m_xf.position.SetV(_arg1);
_local4 = m_xf.R;
_local5 = m_sweep.localCenter;
m_sweep.c.x = ((_local4.col1.x * _local5.x) + (_local4.col2.x * _local5.y));
m_sweep.c.y = ((_local4.col1.y * _local5.x) + (_local4.col2.y * _local5.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
m_sweep.a0 = (m_sweep.a = _arg2);
_local6 = false;
_local3 = m_shapeList;
while (_local3) {
_local7 = _local3.Synchronize(m_world.m_broadPhase, m_xf, m_xf);
if (_local7 == false){
_local6 = true;
break;
};
_local3 = _local3.m_next;
};
if (_local6 == true){
m_flags = (m_flags | e_frozenFlag);
m_linearVelocity.SetZero();
m_angularVelocity = 0;
_local3 = m_shapeList;
while (_local3) {
_local3.DestroyProxy(m_world.m_broadPhase);
_local3 = _local3.m_next;
};
return (false);
};
m_world.m_broadPhase.Commit();
return (true);
}
public function GetLocalPoint(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulXT(m_xf, _arg1));
}
public function ApplyForce(_arg1:b2Vec2, _arg2:b2Vec2):void{
if (IsSleeping()){
WakeUp();
};
m_force.x = (m_force.x + _arg1.x);
m_force.y = (m_force.y + _arg1.y);
m_torque = (m_torque + (((_arg2.x - m_sweep.c.x) * _arg1.y) - ((_arg2.y - m_sweep.c.y) * _arg1.x)));
}
public function SynchronizeShapes():Boolean{
var _local1:b2XForm;
var _local2:b2Mat22;
var _local3:b2Vec2;
var _local4:b2Shape;
var _local5:Boolean;
_local1 = s_xf1;
_local1.R.Set(m_sweep.a0);
_local2 = _local1.R;
_local3 = m_sweep.localCenter;
_local1.position.x = (m_sweep.c0.x - ((_local2.col1.x * _local3.x) + (_local2.col2.x * _local3.y)));
_local1.position.y = (m_sweep.c0.y - ((_local2.col1.y * _local3.x) + (_local2.col2.y * _local3.y)));
_local5 = true;
_local4 = m_shapeList;
while (_local4) {
_local5 = _local4.Synchronize(m_world.m_broadPhase, _local1, m_xf);
if (_local5 == false){
break;
};
_local4 = _local4.m_next;
};
if (_local5 == false){
m_flags = (m_flags | e_frozenFlag);
m_linearVelocity.SetZero();
m_angularVelocity = 0;
_local4 = m_shapeList;
while (_local4) {
_local4.DestroyProxy(m_world.m_broadPhase);
_local4 = _local4.m_next;
};
return (false);
};
return (true);
}
public function GetAngle():Number{
return (m_sweep.a);
}
public function GetXForm():b2XForm{
return (m_xf);
}
public function ApplyImpulse(_arg1:b2Vec2, _arg2:b2Vec2):void{
if (IsSleeping()){
WakeUp();
};
m_linearVelocity.x = (m_linearVelocity.x + (m_invMass * _arg1.x));
m_linearVelocity.y = (m_linearVelocity.y + (m_invMass * _arg1.y));
m_angularVelocity = (m_angularVelocity + (m_invI * (((_arg2.x - m_sweep.c.x) * _arg1.y) - ((_arg2.y - m_sweep.c.y) * _arg1.x))));
}
public function GetNext():b2Body{
return (m_next);
}
public function GetMass():Number{
return (m_mass);
}
public function GetLinearVelocityFromLocalPoint(_arg1:b2Vec2):b2Vec2{
var _local2:b2Mat22;
var _local3:b2Vec2;
_local2 = m_xf.R;
_local3 = new b2Vec2(((_local2.col1.x * _arg1.x) + (_local2.col2.x * _arg1.y)), ((_local2.col1.y * _arg1.x) + (_local2.col2.y * _arg1.y)));
_local3.x = (_local3.x + m_xf.position.x);
_local3.y = (_local3.y + m_xf.position.y);
return (new b2Vec2((m_linearVelocity.x + (m_angularVelocity * (_local3.y - m_sweep.c.y))), (m_linearVelocity.x - (m_angularVelocity * (_local3.x - m_sweep.c.x)))));
}
public function GetAngularVelocity():Number{
return (m_angularVelocity);
}
public function SetAngularVelocity(_arg1:Number):void{
m_angularVelocity = _arg1;
}
public function SetMass(_arg1:b2MassData):void{
var _local2:b2Shape;
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:int;
if (m_world.m_lock == true){
return;
};
m_invMass = 0;
m_I = 0;
m_invI = 0;
m_mass = _arg1.mass;
if (m_mass > 0){
m_invMass = (1 / m_mass);
};
if ((m_flags & b2Body.e_fixedRotationFlag) == 0){
m_I = _arg1.I;
};
if (m_I > 0){
m_invI = (1 / m_I);
};
m_sweep.localCenter.SetV(_arg1.center);
_local3 = m_xf.R;
_local4 = m_sweep.localCenter;
m_sweep.c.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
m_sweep.c.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
_local2 = m_shapeList;
while (_local2) {
_local2.UpdateSweepRadius(m_sweep.localCenter);
_local2 = _local2.m_next;
};
_local5 = m_type;
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
if (_local5 != m_type){
_local2 = m_shapeList;
while (_local2) {
_local2.RefilterProxy(m_world.m_broadPhase, m_xf);
_local2 = _local2.m_next;
};
};
}
public function IsStatic():Boolean{
return ((m_type == e_staticType));
}
public function GetWorldVector(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulMV(m_xf.R, _arg1));
}
public function GetShapeList():b2Shape{
return (m_shapeList);
}
public function Advance(_arg1:Number):void{
m_sweep.Advance(_arg1);
m_sweep.c.SetV(m_sweep.c0);
m_sweep.a = m_sweep.a0;
SynchronizeTransform();
}
public function SetBullet(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_bulletFlag);
} else {
m_flags = (m_flags & ~(e_bulletFlag));
};
}
public function CreateShape(_arg1:b2ShapeDef):b2Shape{
var _local2:b2Shape;
if (m_world.m_lock == true){
return (null);
};
_local2 = b2Shape.Create(_arg1, m_world.m_blockAllocator);
_local2.m_next = m_shapeList;
m_shapeList = _local2;
m_shapeCount++;
_local2.m_body = this;
_local2.CreateProxy(m_world.m_broadPhase, m_xf);
_local2.UpdateSweepRadius(m_sweep.localCenter);
return (_local2);
}
public function IsConnected(_arg1:b2Body):Boolean{
var _local2:b2JointEdge;
_local2 = m_jointList;
while (_local2) {
if (_local2.other == _arg1){
return ((_local2.joint.m_collideConnected == false));
};
_local2 = _local2.next;
};
return (false);
}
public function DestroyShape(_arg1:b2Shape):void{
var _local2:b2Shape;
var _local3:b2Shape;
var _local4:Boolean;
if (m_world.m_lock == true){
return;
};
_arg1.DestroyProxy(m_world.m_broadPhase);
_local2 = m_shapeList;
_local3 = null;
_local4 = false;
while (_local2 != null) {
if (_local2 == _arg1){
if (_local3){
_local3.m_next = _arg1.m_next;
} else {
m_shapeList = _arg1.m_next;
};
_local4 = true;
break;
};
_local3 = _local2;
_local2 = _local2.m_next;
};
_arg1.m_body = null;
_arg1.m_next = null;
m_shapeCount--;
b2Shape.Destroy(_arg1, m_world.m_blockAllocator);
}
public function GetUserData(){
return (m_userData);
}
public function IsBullet():Boolean{
return (((m_flags & e_bulletFlag) == e_bulletFlag));
}
public function GetWorldCenter():b2Vec2{
return (m_sweep.c);
}
public function AllowSleeping(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_allowSleepFlag);
} else {
m_flags = (m_flags & ~(e_allowSleepFlag));
WakeUp();
};
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public function GetLocalVector(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulTMV(m_xf.R, _arg1));
}
public function GetWorldPoint(_arg1:b2Vec2):b2Vec2{
var _local2:b2Mat22;
var _local3:b2Vec2;
_local2 = m_xf.R;
_local3 = new b2Vec2(((_local2.col1.x * _arg1.x) + (_local2.col2.x * _arg1.y)), ((_local2.col1.y * _arg1.x) + (_local2.col2.y * _arg1.y)));
_local3.x = (_local3.x + m_xf.position.x);
_local3.y = (_local3.y + m_xf.position.y);
return (_local3);
}
public function GetWorld():b2World{
return (m_world);
}
public function GetPosition():b2Vec2{
return (m_xf.position);
}
}
}//package Box2D.Dynamics
Section 65
//b2BodyDef (Box2D.Dynamics.b2BodyDef)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
public class b2BodyDef {
public var isSleeping:Boolean;
public var position:b2Vec2;
public var isBullet:Boolean;
public var allowSleep:Boolean;
public var userData;
public var angularDamping:Number;
public var fixedRotation:Boolean;
public var angle:Number;
public var linearDamping:Number;
public var massData:b2MassData;
public function b2BodyDef(){
massData = new b2MassData();
position = new b2Vec2();
super();
massData.center.SetZero();
massData.mass = 0;
massData.I = 0;
userData = null;
position.Set(0, 0);
angle = 0;
linearDamping = 0;
angularDamping = 0;
allowSleep = true;
isSleeping = false;
fixedRotation = false;
isBullet = false;
}
}
}//package Box2D.Dynamics
Section 66
//b2BoundaryListener (Box2D.Dynamics.b2BoundaryListener)
package Box2D.Dynamics {
public class b2BoundaryListener {
public function Violation(_arg1:b2Body):void{
}
}
}//package Box2D.Dynamics
Section 67
//b2ContactFilter (Box2D.Dynamics.b2ContactFilter)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
public class b2ContactFilter {
public static var b2_defaultFilter:b2ContactFilter = new (b2ContactFilter);
;
public function ShouldCollide(_arg1:b2Shape, _arg2:b2Shape):Boolean{
var _local3:b2FilterData;
var _local4:b2FilterData;
var _local5:Boolean;
_local3 = _arg1.GetFilterData();
_local4 = _arg2.GetFilterData();
if ((((_local3.groupIndex == _local4.groupIndex)) && (!((_local3.groupIndex == 0))))){
return ((_local3.groupIndex > 0));
};
_local5 = ((!(((_local3.maskBits & _local4.categoryBits) == 0))) && (!(((_local3.categoryBits & _local4.maskBits) == 0))));
return (_local5);
}
}
}//package Box2D.Dynamics
Section 68
//b2ContactListener (Box2D.Dynamics.b2ContactListener)
package Box2D.Dynamics {
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
public class b2ContactListener {
public function Add(_arg1:b2ContactPoint):void{
}
public function Remove(_arg1:b2ContactPoint):void{
}
public function Persist(_arg1:b2ContactPoint):void{
}
public function Result(_arg1:b2ContactResult):void{
}
}
}//package Box2D.Dynamics
Section 69
//b2ContactManager (Box2D.Dynamics.b2ContactManager)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
public class b2ContactManager extends b2PairCallback {
public var m_world:b2World;
public var m_destroyImmediate:Boolean;
public var m_nullContact:b2NullContact;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2ContactManager(){
m_nullContact = new b2NullContact();
super();
m_world = null;
m_destroyImmediate = false;
}
override public function PairAdded(_arg1, _arg2){
var _local3:b2Shape;
var _local4:b2Shape;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2Contact;
_local3 = (_arg1 as b2Shape);
_local4 = (_arg2 as b2Shape);
_local5 = _local3.m_body;
_local6 = _local4.m_body;
if (((_local5.IsStatic()) && (_local6.IsStatic()))){
return (m_nullContact);
};
if (_local3.m_body == _local4.m_body){
return (m_nullContact);
};
if (_local6.IsConnected(_local5)){
return (m_nullContact);
};
if (((!((m_world.m_contactFilter == null))) && ((m_world.m_contactFilter.ShouldCollide(_local3, _local4) == false)))){
return (m_nullContact);
};
_local7 = b2Contact.Create(_local3, _local4, m_world.m_blockAllocator);
if (_local7 == null){
return (m_nullContact);
};
_local3 = _local7.m_shape1;
_local4 = _local7.m_shape2;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
_local7.m_prev = null;
_local7.m_next = m_world.m_contactList;
if (m_world.m_contactList != null){
m_world.m_contactList.m_prev = _local7;
};
m_world.m_contactList = _local7;
_local7.m_node1.contact = _local7;
_local7.m_node1.other = _local6;
_local7.m_node1.prev = null;
_local7.m_node1.next = _local5.m_contactList;
if (_local5.m_contactList != null){
_local5.m_contactList.prev = _local7.m_node1;
};
_local5.m_contactList = _local7.m_node1;
_local7.m_node2.contact = _local7;
_local7.m_node2.other = _local5;
_local7.m_node2.prev = null;
_local7.m_node2.next = _local6.m_contactList;
if (_local6.m_contactList != null){
_local6.m_contactList.prev = _local7.m_node2;
};
_local6.m_contactList = _local7.m_node2;
m_world.m_contactCount++;
return (_local7);
}
override public function PairRemoved(_arg1, _arg2, _arg3):void{
var _local4:b2Contact;
if (_arg3 == null){
return;
};
_local4 = (_arg3 as b2Contact);
if (_local4 == m_nullContact){
return;
};
Destroy(_local4);
}
public function Destroy(_arg1:b2Contact):void{
var _local2:b2Shape;
var _local3:b2Shape;
var _local4:int;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2Body;
var _local8:b2Body;
var _local9:Array;
var _local10:b2ContactPoint;
var _local11:int;
var _local12:b2Manifold;
var _local13:int;
var _local14:b2ManifoldPoint;
var _local15:b2Vec2;
var _local16:b2Vec2;
_local2 = _arg1.m_shape1;
_local3 = _arg1.m_shape2;
_local4 = _arg1.m_manifoldCount;
if ((((_local4 > 0)) && (m_world.m_contactListener))){
_local7 = _local2.m_body;
_local8 = _local3.m_body;
_local9 = _arg1.GetManifolds();
_local10 = s_evalCP;
_local10.shape1 = _arg1.m_shape1;
_local10.shape2 = _arg1.m_shape2;
_local10.friction = _arg1.m_friction;
_local10.restitution = _arg1.m_restitution;
_local11 = 0;
while (_local11 < _local4) {
_local12 = _local9[_local11];
_local10.normal.SetV(_local12.normal);
_local13 = 0;
while (_local13 < _local12.pointCount) {
_local14 = _local12.points[_local13];
_local10.position = _local7.GetWorldPoint(_local14.localPoint1);
_local15 = _local7.GetLinearVelocityFromLocalPoint(_local14.localPoint1);
_local16 = _local8.GetLinearVelocityFromLocalPoint(_local14.localPoint2);
_local10.velocity.Set((_local16.x - _local15.x), (_local16.y - _local15.y));
_local10.separation = _local14.separation;
_local10.id.key = _local14.id._key;
m_world.m_contactListener.Remove(_local10);
_local13++;
};
_local11++;
};
};
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_world.m_contactList){
m_world.m_contactList = _arg1.m_next;
};
_local5 = _local2.m_body;
_local6 = _local3.m_body;
if (_arg1.m_node1.prev){
_arg1.m_node1.prev.next = _arg1.m_node1.next;
};
if (_arg1.m_node1.next){
_arg1.m_node1.next.prev = _arg1.m_node1.prev;
};
if (_arg1.m_node1 == _local5.m_contactList){
_local5.m_contactList = _arg1.m_node1.next;
};
if (_arg1.m_node2.prev){
_arg1.m_node2.prev.next = _arg1.m_node2.next;
};
if (_arg1.m_node2.next){
_arg1.m_node2.next.prev = _arg1.m_node2.prev;
};
if (_arg1.m_node2 == _local6.m_contactList){
_local6.m_contactList = _arg1.m_node2.next;
};
b2Contact.Destroy(_arg1, m_world.m_blockAllocator);
m_world.m_contactCount--;
}
public function Collide():void{
var _local1:b2Contact;
var _local2:b2Body;
var _local3:b2Body;
_local1 = m_world.m_contactList;
while (_local1) {
_local2 = _local1.m_shape1.m_body;
_local3 = _local1.m_shape2.m_body;
if (((_local2.IsSleeping()) && (_local3.IsSleeping()))){
} else {
_local1.Update(m_world.m_contactListener);
};
_local1 = _local1.m_next;
};
}
}
}//package Box2D.Dynamics
Section 70
//b2DebugDraw (Box2D.Dynamics.b2DebugDraw)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Common.*;
import flash.display.*;
import Box2D.Dynamics.Contacts.*;
public class b2DebugDraw {
public var m_xformScale:Number;// = 1
public var m_fillAlpha:Number;// = 1
public var m_alpha:Number;// = 1
public var m_lineThickness:Number;// = 1
public var m_drawFlags:uint;
public var m_sprite:Sprite;
public var m_drawScale:Number;// = 1
public static var e_coreShapeBit:uint = 4;
public static var e_shapeBit:uint = 1;
public static var e_centerOfMassBit:uint = 64;
public static var e_aabbBit:uint = 8;
public static var e_obbBit:uint = 16;
public static var e_pairBit:uint = 32;
public static var e_jointBit:uint = 2;
public function b2DebugDraw(){
m_drawScale = 1;
m_lineThickness = 1;
m_alpha = 1;
m_fillAlpha = 1;
m_xformScale = 1;
super();
m_drawFlags = 0;
}
public function DrawSolidPolygon(_arg1:Array, _arg2:int, _arg3:b2Color):void{
var _local4:int;
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
m_sprite.graphics.beginFill(_arg3.color, m_fillAlpha);
_local4 = 1;
while (_local4 < _arg2) {
m_sprite.graphics.lineTo((_arg1[_local4].x * m_drawScale), (_arg1[_local4].y * m_drawScale));
_local4++;
};
m_sprite.graphics.lineTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
m_sprite.graphics.endFill();
}
public function DrawCircle(_arg1:b2Vec2, _arg2:Number, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.drawCircle((_arg1.x * m_drawScale), (_arg1.y * m_drawScale), (_arg2 * m_drawScale));
}
public function DrawXForm(_arg1:b2XForm):void{
m_sprite.graphics.lineStyle(m_lineThickness, 0xFF0000, m_alpha);
m_sprite.graphics.moveTo((_arg1.position.x * m_drawScale), (_arg1.position.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.position.x + (m_xformScale * _arg1.R.col1.x)) * m_drawScale), ((_arg1.position.y + (m_xformScale * _arg1.R.col1.y)) * m_drawScale));
m_sprite.graphics.lineStyle(m_lineThickness, 0xFF00, m_alpha);
m_sprite.graphics.moveTo((_arg1.position.x * m_drawScale), (_arg1.position.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.position.x + (m_xformScale * _arg1.R.col2.x)) * m_drawScale), ((_arg1.position.y + (m_xformScale * _arg1.R.col2.y)) * m_drawScale));
}
public function ClearFlags(_arg1:uint):void{
m_drawFlags = (m_drawFlags & ~(_arg1));
}
public function DrawSolidCircle(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg4.color, m_alpha);
m_sprite.graphics.moveTo(0, 0);
m_sprite.graphics.beginFill(_arg4.color, m_fillAlpha);
m_sprite.graphics.drawCircle((_arg1.x * m_drawScale), (_arg1.y * m_drawScale), (_arg2 * m_drawScale));
m_sprite.graphics.endFill();
m_sprite.graphics.moveTo((_arg1.x * m_drawScale), (_arg1.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.x + (_arg3.x * _arg2)) * m_drawScale), ((_arg1.y + (_arg3.y * _arg2)) * m_drawScale));
}
public function SetFlags(_arg1:uint):void{
m_drawFlags = _arg1;
}
public function AppendFlags(_arg1:uint):void{
m_drawFlags = (m_drawFlags | _arg1);
}
public function DrawSegment(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1.x * m_drawScale), (_arg1.y * m_drawScale));
m_sprite.graphics.lineTo((_arg2.x * m_drawScale), (_arg2.y * m_drawScale));
}
public function GetFlags():uint{
return (m_drawFlags);
}
public function DrawPolygon(_arg1:Array, _arg2:int, _arg3:b2Color):void{
var _local4:int;
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
_local4 = 1;
while (_local4 < _arg2) {
m_sprite.graphics.lineTo((_arg1[_local4].x * m_drawScale), (_arg1[_local4].y * m_drawScale));
_local4++;
};
m_sprite.graphics.lineTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
}
}
}//package Box2D.Dynamics
Section 71
//b2DestructionListener (Box2D.Dynamics.b2DestructionListener)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Joints.*;
public class b2DestructionListener {
public function SayGoodbyeJoint(_arg1:b2Joint):void{
}
public function SayGoodbyeShape(_arg1:b2Shape):void{
}
}
}//package Box2D.Dynamics
Section 72
//b2Island (Box2D.Dynamics.b2Island)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class b2Island {
public var m_joints:Array;
public var m_listener:b2ContactListener;
public var m_positionIterationCount:int;
public var m_bodyCapacity:int;
public var m_bodies:Array;
public var m_jointCapacity:int;
public var m_contactCount:int;
public var m_contacts:Array;
public var m_contactCapacity:int;
public var m_jointCount:int;
public var m_allocator;
public var m_bodyCount:int;
private static var s_reportCR:b2ContactResult = new b2ContactResult();
public function b2Island(_arg1:int, _arg2:int, _arg3:int, _arg4, _arg5:b2ContactListener){
var _local6:int;
super();
m_bodyCapacity = _arg1;
m_contactCapacity = _arg2;
m_jointCapacity = _arg3;
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
m_allocator = _arg4;
m_listener = _arg5;
m_bodies = new Array(_arg1);
_local6 = 0;
while (_local6 < _arg1) {
m_bodies[_local6] = null;
_local6++;
};
m_contacts = new Array(_arg2);
_local6 = 0;
while (_local6 < _arg2) {
m_contacts[_local6] = null;
_local6++;
};
m_joints = new Array(_arg3);
_local6 = 0;
while (_local6 < _arg3) {
m_joints[_local6] = null;
_local6++;
};
m_positionIterationCount = 0;
}
public function AddBody(_arg1:b2Body):void{
var _local2 = m_bodyCount++;
m_bodies[_local2] = _arg1;
}
public function AddJoint(_arg1:b2Joint):void{
var _local2 = m_jointCount++;
m_joints[_local2] = _arg1;
}
public function Report(_arg1:Array):void{
var _local2:b2Mat22;
var _local3:b2Vec2;
var _local4:int;
var _local5:b2Contact;
var _local6:b2ContactConstraint;
var _local7:b2ContactResult;
var _local8:b2Body;
var _local9:int;
var _local10:Array;
var _local11:int;
var _local12:b2Manifold;
var _local13:int;
var _local14:b2ManifoldPoint;
var _local15:b2ContactConstraintPoint;
if (m_listener == null){
return;
};
_local4 = 0;
while (_local4 < m_contactCount) {
_local5 = m_contacts[_local4];
_local6 = _arg1[_local4];
_local7 = s_reportCR;
_local7.shape1 = _local5.m_shape1;
_local7.shape2 = _local5.m_shape2;
_local8 = _local7.shape1.m_body;
_local9 = _local5.m_manifoldCount;
_local10 = _local5.GetManifolds();
_local11 = 0;
while (_local11 < _local9) {
_local12 = _local10[_local11];
_local7.normal.SetV(_local12.normal);
_local13 = 0;
while (_local13 < _local12.pointCount) {
_local14 = _local12.points[_local13];
_local15 = _local6.points[_local13];
_local7.position = _local8.GetWorldPoint(_local14.localPoint1);
_local7.normalImpulse = _local15.normalImpulse;
_local7.tangentImpulse = _local15.tangentImpulse;
_local7.id.key = _local14.id.key;
m_listener.Result(_local7);
_local13++;
};
_local11++;
};
_local4++;
};
}
public function Solve(_arg1:b2TimeStep, _arg2:b2Vec2, _arg3:Boolean, _arg4:Boolean):void{
var _local5:int;
var _local6:b2Body;
var _local7:b2Joint;
var _local8:b2ContactSolver;
var _local9:int;
var _local10:Boolean;
var _local11:Boolean;
var _local12:Boolean;
var _local13:Number;
var _local14:Number;
var _local15:Number;
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.IsStatic()){
} else {
_local6.m_linearVelocity.x = (_local6.m_linearVelocity.x + (_arg1.dt * (_arg2.x + (_local6.m_invMass * _local6.m_force.x))));
_local6.m_linearVelocity.y = (_local6.m_linearVelocity.y + (_arg1.dt * (_arg2.y + (_local6.m_invMass * _local6.m_force.y))));
_local6.m_angularVelocity = (_local6.m_angularVelocity + ((_arg1.dt * _local6.m_invI) * _local6.m_torque));
_local6.m_force.SetZero();
_local6.m_torque = 0;
_local6.m_linearVelocity.Multiply(b2Math.b2Clamp((1 - (_arg1.dt * _local6.m_linearDamping)), 0, 1));
_local6.m_angularVelocity = (_local6.m_angularVelocity * b2Math.b2Clamp((1 - (_arg1.dt * _local6.m_angularDamping)), 0, 1));
if (_local6.m_linearVelocity.LengthSquared() > b2Settings.b2_maxLinearVelocitySquared){
_local6.m_linearVelocity.Normalize();
_local6.m_linearVelocity.x = (_local6.m_linearVelocity.x * b2Settings.b2_maxLinearVelocity);
_local6.m_linearVelocity.y = (_local6.m_linearVelocity.y * b2Settings.b2_maxLinearVelocity);
};
if ((_local6.m_angularVelocity * _local6.m_angularVelocity) > b2Settings.b2_maxAngularVelocitySquared){
if (_local6.m_angularVelocity < 0){
_local6.m_angularVelocity = -(b2Settings.b2_maxAngularVelocity);
} else {
_local6.m_angularVelocity = b2Settings.b2_maxAngularVelocity;
};
};
};
_local5++;
};
_local8 = new b2ContactSolver(_arg1, m_contacts, m_contactCount, m_allocator);
_local8.InitVelocityConstraints(_arg1);
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local7.InitVelocityConstraints(_arg1);
_local5++;
};
_local5 = 0;
while (_local5 < _arg1.maxIterations) {
_local8.SolveVelocityConstraints();
_local9 = 0;
while (_local9 < m_jointCount) {
_local7 = m_joints[_local9];
_local7.SolveVelocityConstraints(_arg1);
_local9++;
};
_local5++;
};
_local8.FinalizeVelocityConstraints();
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.IsStatic()){
} else {
_local6.m_sweep.c0.SetV(_local6.m_sweep.c);
_local6.m_sweep.a0 = _local6.m_sweep.a;
_local6.m_sweep.c.x = (_local6.m_sweep.c.x + (_arg1.dt * _local6.m_linearVelocity.x));
_local6.m_sweep.c.y = (_local6.m_sweep.c.y + (_arg1.dt * _local6.m_linearVelocity.y));
_local6.m_sweep.a = (_local6.m_sweep.a + (_arg1.dt * _local6.m_angularVelocity));
_local6.SynchronizeTransform();
};
_local5++;
};
if (_arg3){
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local7.InitPositionConstraints();
_local5++;
};
m_positionIterationCount = 0;
while (m_positionIterationCount < _arg1.maxIterations) {
_local10 = _local8.SolvePositionConstraints(b2Settings.b2_contactBaumgarte);
_local11 = true;
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local12 = _local7.SolvePositionConstraints();
_local11 = ((_local11) && (_local12));
_local5++;
};
if (((_local10) && (_local11))){
break;
};
m_positionIterationCount++;
};
};
Report(_local8.m_constraints);
if (_arg4){
_local13 = Number.MAX_VALUE;
_local14 = (b2Settings.b2_linearSleepTolerance * b2Settings.b2_linearSleepTolerance);
_local15 = (b2Settings.b2_angularSleepTolerance * b2Settings.b2_angularSleepTolerance);
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.m_invMass == 0){
} else {
if ((_local6.m_flags & b2Body.e_allowSleepFlag) == 0){
_local6.m_sleepTime = 0;
_local13 = 0;
};
if (((((((_local6.m_flags & b2Body.e_allowSleepFlag) == 0)) || (((_local6.m_angularVelocity * _local6.m_angularVelocity) > _local15)))) || ((b2Math.b2Dot(_local6.m_linearVelocity, _local6.m_linearVelocity) > _local14)))){
_local6.m_sleepTime = 0;
_local13 = 0;
} else {
_local6.m_sleepTime = (_local6.m_sleepTime + _arg1.dt);
_local13 = b2Math.b2Min(_local13, _local6.m_sleepTime);
};
};
_local5++;
};
if (_local13 >= b2Settings.b2_timeToSleep){
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
m_bodies[_local5].m_flags = (_local6.m_flags | b2Body.e_sleepFlag);
_local6.m_linearVelocity.SetZero();
_local6.m_angularVelocity = 0;
_local5++;
};
};
};
}
public function AddContact(_arg1:b2Contact):void{
var _local2 = m_contactCount++;
m_contacts[_local2] = _arg1;
}
public function Clear():void{
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
}
public function SolveTOI(_arg1:b2TimeStep):void{
var _local2:int;
var _local3:b2ContactSolver;
var _local4:Number;
var _local5:b2Body;
var _local6:Boolean;
_local3 = new b2ContactSolver(_arg1, m_contacts, m_contactCount, m_allocator);
_local2 = 0;
while (_local2 < _arg1.maxIterations) {
_local3.SolveVelocityConstraints();
_local2++;
};
_local2 = 0;
while (_local2 < m_bodyCount) {
_local5 = m_bodies[_local2];
if (_local5.IsStatic()){
} else {
_local5.m_sweep.c0.SetV(_local5.m_sweep.c);
_local5.m_sweep.a0 = _local5.m_sweep.a;
_local5.m_sweep.c.x = (_local5.m_sweep.c.x + (_arg1.dt * _local5.m_linearVelocity.x));
_local5.m_sweep.c.y = (_local5.m_sweep.c.y + (_arg1.dt * _local5.m_linearVelocity.y));
_local5.m_sweep.a = (_local5.m_sweep.a + (_arg1.dt * _local5.m_angularVelocity));
_local5.SynchronizeTransform();
};
_local2++;
};
_local4 = 0.75;
_local2 = 0;
while (_local2 < _arg1.maxIterations) {
_local6 = _local3.SolvePositionConstraints(_local4);
if (_local6){
break;
};
_local2++;
};
Report(_local3.m_constraints);
}
}
}//package Box2D.Dynamics
Section 73
//b2TimeStep (Box2D.Dynamics.b2TimeStep)
package Box2D.Dynamics {
public class b2TimeStep {
public var warmStarting:Boolean;
public var positionCorrection:Boolean;
public var dt:Number;
public var maxIterations:int;
public var dtRatio:Number;
public var inv_dt:Number;
}
}//package Box2D.Dynamics
Section 74
//b2World (Box2D.Dynamics.b2World)
package Box2D.Dynamics {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.*;
import Box2D.Common.*;
import Box2D.Dynamics.Contacts.*;
public class b2World {
public var m_inv_dt0:Number;
public var m_boundaryListener:b2BoundaryListener;
public var m_contactList:b2Contact;
public var m_blockAllocator;
public var m_contactListener:b2ContactListener;
public var m_allowSleep:Boolean;
public var m_broadPhase:b2BroadPhase;
public var m_destructionListener:b2DestructionListener;
public var m_jointCount:int;
public var m_bodyCount:int;
public var m_lock:Boolean;
public var m_positionIterationCount:int;
public var m_groundBody:b2Body;
public var m_contactCount:int;
public var m_debugDraw:b2DebugDraw;
public var m_contactFilter:b2ContactFilter;
public var m_bodyList:b2Body;
public var m_stackAllocator;
public var m_jointList:b2Joint;
public var m_gravity:b2Vec2;
public var m_contactManager:b2ContactManager;
private static var s_jointColor:b2Color = new b2Color(0.5, 0.8, 0.8);
public static var m_continuousPhysics:Boolean;
public static var m_warmStarting:Boolean;
private static var s_coreColor:b2Color = new b2Color(0.9, 0.6, 0.6);
public static var m_positionCorrection:Boolean;
private static var s_xf:b2XForm = new b2XForm();
public function b2World(_arg1:b2AABB, _arg2:b2Vec2, _arg3:Boolean){
var _local4:b2BodyDef;
m_contactManager = new b2ContactManager();
super();
m_destructionListener = null;
m_boundaryListener = null;
m_contactFilter = b2ContactFilter.b2_defaultFilter;
m_contactListener = null;
m_debugDraw = null;
m_bodyList = null;
m_contactList = null;
m_jointList = null;
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
m_positionCorrection = true;
m_warmStarting = true;
m_continuousPhysics = true;
m_allowSleep = _arg3;
m_gravity = _arg2;
m_lock = false;
m_inv_dt0 = 0;
m_contactManager.m_world = this;
m_broadPhase = new b2BroadPhase(_arg1, m_contactManager);
_local4 = new b2BodyDef();
m_groundBody = CreateBody(_local4);
}
public function DrawJoint(_arg1:b2Joint):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2XForm;
var _local5:b2XForm;
var _local6:b2Vec2;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Color;
var _local11:b2PulleyJoint;
var _local12:b2Vec2;
var _local13:b2Vec2;
_local2 = _arg1.m_body1;
_local3 = _arg1.m_body2;
_local4 = _local2.m_xf;
_local5 = _local3.m_xf;
_local6 = _local4.position;
_local7 = _local5.position;
_local8 = _arg1.GetAnchor1();
_local9 = _arg1.GetAnchor2();
_local10 = s_jointColor;
switch (_arg1.m_type){
case b2Joint.e_distanceJoint:
m_debugDraw.DrawSegment(_local8, _local9, _local10);
break;
case b2Joint.e_pulleyJoint:
_local11 = (_arg1 as b2PulleyJoint);
_local12 = _local11.GetGroundAnchor1();
_local13 = _local11.GetGroundAnchor2();
m_debugDraw.DrawSegment(_local12, _local8, _local10);
m_debugDraw.DrawSegment(_local13, _local9, _local10);
m_debugDraw.DrawSegment(_local12, _local13, _local10);
break;
case b2Joint.e_mouseJoint:
m_debugDraw.DrawSegment(_local8, _local9, _local10);
break;
default:
if (_local2 != m_groundBody){
m_debugDraw.DrawSegment(_local6, _local8, _local10);
};
m_debugDraw.DrawSegment(_local8, _local9, _local10);
if (_local3 != m_groundBody){
m_debugDraw.DrawSegment(_local7, _local9, _local10);
};
};
}
public function Refilter(_arg1:b2Shape):void{
_arg1.RefilterProxy(m_broadPhase, _arg1.m_body.m_xf);
}
public function SetDebugDraw(_arg1:b2DebugDraw):void{
m_debugDraw = _arg1;
}
public function SetContinuousPhysics(_arg1:Boolean):void{
m_continuousPhysics = _arg1;
}
public function GetProxyCount():int{
return (m_broadPhase.m_proxyCount);
}
public function DrawDebugData():void{
var _local1:uint;
var _local2:int;
var _local3:b2Body;
var _local4:b2Shape;
var _local5:b2Joint;
var _local6:b2BroadPhase;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Color;
var _local11:b2XForm;
var _local12:b2AABB;
var _local13:b2AABB;
var _local14:Array;
var _local15:Boolean;
var _local16:uint;
var _local17:b2Pair;
var _local18:b2Proxy;
var _local19:b2Proxy;
var _local20:b2Vec2;
var _local21:b2Vec2;
var _local22:b2Proxy;
var _local23:b2PolygonShape;
var _local24:b2OBB;
var _local25:b2Vec2;
var _local26:b2Mat22;
var _local27:b2Vec2;
var _local28:Number;
if (m_debugDraw == null){
return;
};
m_debugDraw.m_sprite.graphics.clear();
_local1 = m_debugDraw.GetFlags();
_local7 = new b2Vec2();
_local8 = new b2Vec2();
_local9 = new b2Vec2();
_local10 = new b2Color(0, 0, 0);
_local12 = new b2AABB();
_local13 = new b2AABB();
_local14 = [new b2Vec2(), new b2Vec2(), new b2Vec2(), new b2Vec2()];
if ((_local1 & b2DebugDraw.e_shapeBit)){
_local15 = ((_local1 & b2DebugDraw.e_coreShapeBit) == b2DebugDraw.e_coreShapeBit);
_local3 = m_bodyList;
while (_local3) {
_local11 = _local3.m_xf;
_local4 = _local3.GetShapeList();
while (_local4) {
if (_local3.IsStatic()){
DrawShape(_local4, _local11, new b2Color(0.5, 0.9, 0.5), _local15);
} else {
if (_local3.IsSleeping()){
DrawShape(_local4, _local11, new b2Color(0.5, 0.5, 0.9), _local15);
} else {
DrawShape(_local4, _local11, new b2Color(0.9, 0.9, 0.9), _local15);
};
};
_local4 = _local4.m_next;
};
_local3 = _local3.m_next;
};
};
if ((_local1 & b2DebugDraw.e_jointBit)){
_local5 = m_jointList;
while (_local5) {
DrawJoint(_local5);
_local5 = _local5.m_next;
};
};
if ((_local1 & b2DebugDraw.e_pairBit)){
_local6 = m_broadPhase;
_local7.Set((1 / _local6.m_quantizationFactor.x), (1 / _local6.m_quantizationFactor.y));
_local10.Set(0.9, 0.9, 0.3);
_local2 = 0;
while (_local2 < b2Pair.b2_tableCapacity) {
_local16 = _local6.m_pairManager.m_hashTable[_local2];
while (_local16 != b2Pair.b2_nullPair) {
_local17 = _local6.m_pairManager.m_pairs[_local16];
_local18 = _local6.m_proxyPool[_local17.proxyId1];
_local19 = _local6.m_proxyPool[_local17.proxyId2];
_local12.lowerBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local18.lowerBounds[0]].value));
_local12.lowerBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local18.lowerBounds[1]].value));
_local12.upperBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local18.upperBounds[0]].value));
_local12.upperBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local18.upperBounds[1]].value));
_local13.lowerBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local19.lowerBounds[0]].value));
_local13.lowerBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local19.lowerBounds[1]].value));
_local13.upperBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local19.upperBounds[0]].value));
_local13.upperBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local19.upperBounds[1]].value));
_local8.x = (0.5 * (_local12.lowerBound.x + _local12.upperBound.x));
_local8.y = (0.5 * (_local12.lowerBound.y + _local12.upperBound.y));
_local9.x = (0.5 * (_local13.lowerBound.x + _local13.upperBound.x));
_local9.y = (0.5 * (_local13.lowerBound.y + _local13.upperBound.y));
m_debugDraw.DrawSegment(_local8, _local9, _local10);
_local16 = _local17.next;
};
_local2++;
};
};
if ((_local1 & b2DebugDraw.e_aabbBit)){
_local6 = m_broadPhase;
_local20 = _local6.m_worldAABB.lowerBound;
_local21 = _local6.m_worldAABB.upperBound;
_local7.Set((1 / _local6.m_quantizationFactor.x), (1 / _local6.m_quantizationFactor.y));
_local10.Set(0.9, 0.3, 0.9);
_local2 = 0;
while (_local2 < b2Settings.b2_maxProxies) {
_local22 = _local6.m_proxyPool[_local2];
if (_local22.IsValid() == false){
} else {
_local12.lowerBound.x = (_local20.x + (_local7.x * _local6.m_bounds[0][_local22.lowerBounds[0]].value));
_local12.lowerBound.y = (_local20.y + (_local7.y * _local6.m_bounds[1][_local22.lowerBounds[1]].value));
_local12.upperBound.x = (_local20.x + (_local7.x * _local6.m_bounds[0][_local22.upperBounds[0]].value));
_local12.upperBound.y = (_local20.y + (_local7.y * _local6.m_bounds[1][_local22.upperBounds[1]].value));
_local14[0].Set(_local12.lowerBound.x, _local12.lowerBound.y);
_local14[1].Set(_local12.upperBound.x, _local12.lowerBound.y);
_local14[2].Set(_local12.upperBound.x, _local12.upperBound.y);
_local14[3].Set(_local12.lowerBound.x, _local12.upperBound.y);
m_debugDraw.DrawPolygon(_local14, 4, _local10);
};
_local2++;
};
_local14[0].Set(_local20.x, _local20.y);
_local14[1].Set(_local21.x, _local20.y);
_local14[2].Set(_local21.x, _local21.y);
_local14[3].Set(_local20.x, _local21.y);
m_debugDraw.DrawPolygon(_local14, 4, new b2Color(0.3, 0.9, 0.9));
};
if ((_local1 & b2DebugDraw.e_obbBit)){
_local10.Set(0.5, 0.3, 0.5);
_local3 = m_bodyList;
while (_local3) {
_local11 = _local3.m_xf;
_local4 = _local3.GetShapeList();
while (_local4) {
if (_local4.m_type != b2Shape.e_polygonShape){
} else {
_local23 = (_local4 as b2PolygonShape);
_local24 = _local23.GetOBB();
_local25 = _local24.extents;
_local14[0].Set(-(_local25.x), -(_local25.y));
_local14[1].Set(_local25.x, -(_local25.y));
_local14[2].Set(_local25.x, _local25.y);
_local14[3].Set(-(_local25.x), _local25.y);
_local2 = 0;
while (_local2 < 4) {
_local26 = _local24.R;
_local27 = _local14[_local2];
_local28 = (_local24.center.x + ((_local26.col1.x * _local27.x) + (_local26.col2.x * _local27.y)));
_local14[_local2].y = (_local24.center.y + ((_local26.col1.y * _local27.x) + (_local26.col2.y * _local27.y)));
_local14[_local2].x = _local28;
_local26 = _local11.R;
_local28 = (_local11.position.x + ((_local26.col1.x * _local27.x) + (_local26.col2.x * _local27.y)));
_local14[_local2].y = (_local11.position.y + ((_local26.col1.y * _local27.x) + (_local26.col2.y * _local27.y)));
_local14[_local2].x = _local28;
_local2++;
};
m_debugDraw.DrawPolygon(_local14, 4, _local10);
};
_local4 = _local4.m_next;
};
_local3 = _local3.m_next;
};
};
if ((_local1 & b2DebugDraw.e_centerOfMassBit)){
_local3 = m_bodyList;
while (_local3) {
_local11 = s_xf;
_local11.R = _local3.m_xf.R;
_local11.position = _local3.GetWorldCenter();
m_debugDraw.DrawXForm(_local11);
_local3 = _local3.m_next;
};
};
}
public function DestroyBody(_arg1:b2Body):void{
var _local2:b2JointEdge;
var _local3:b2Shape;
var _local4:b2JointEdge;
var _local5:b2Shape;
if (m_lock == true){
return;
};
_local2 = _arg1.m_jointList;
while (_local2) {
_local4 = _local2;
_local2 = _local2.next;
if (m_destructionListener){
m_destructionListener.SayGoodbyeJoint(_local4.joint);
};
DestroyJoint(_local4.joint);
};
_local3 = _arg1.m_shapeList;
while (_local3) {
_local5 = _local3;
_local3 = _local3.m_next;
if (m_destructionListener){
m_destructionListener.SayGoodbyeShape(_local5);
};
_local5.DestroyProxy(m_broadPhase);
b2Shape.Destroy(_local5, m_blockAllocator);
};
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_bodyList){
m_bodyList = _arg1.m_next;
};
m_bodyCount--;
}
public function SetContactFilter(_arg1:b2ContactFilter):void{
m_contactFilter = _arg1;
}
public function GetGroundBody():b2Body{
return (m_groundBody);
}
public function DrawShape(_arg1:b2Shape, _arg2:b2XForm, _arg3:b2Color, _arg4:Boolean):void{
var _local5:b2Color;
var _local6:b2CircleShape;
var _local7:b2Vec2;
var _local8:Number;
var _local9:b2Vec2;
var _local10:int;
var _local11:b2PolygonShape;
var _local12:int;
var _local13:Array;
var _local14:Array;
var _local15:Array;
_local5 = s_coreColor;
switch (_arg1.m_type){
case b2Shape.e_circleShape:
_local6 = (_arg1 as b2CircleShape);
_local7 = b2Math.b2MulX(_arg2, _local6.m_localPosition);
_local8 = _local6.m_radius;
_local9 = _arg2.R.col1;
m_debugDraw.DrawSolidCircle(_local7, _local8, _local9, _arg3);
if (_arg4){
m_debugDraw.DrawCircle(_local7, (_local8 - b2Settings.b2_toiSlop), _local5);
};
break;
case b2Shape.e_polygonShape:
_local11 = (_arg1 as b2PolygonShape);
_local12 = _local11.GetVertexCount();
_local13 = _local11.GetVertices();
_local14 = new Array(b2Settings.b2_maxPolygonVertices);
_local10 = 0;
while (_local10 < _local12) {
_local14[_local10] = b2Math.b2MulX(_arg2, _local13[_local10]);
_local10++;
};
m_debugDraw.DrawSolidPolygon(_local14, _local12, _arg3);
if (_arg4){
_local15 = _local11.GetCoreVertices();
_local10 = 0;
while (_local10 < _local12) {
_local14[_local10] = b2Math.b2MulX(_arg2, _local15[_local10]);
_local10++;
};
m_debugDraw.DrawPolygon(_local14, _local12, _local5);
};
break;
};
}
public function GetContactCount():int{
return (m_contactCount);
}
public function Solve(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Island;
var _local4:b2Contact;
var _local5:b2Joint;
var _local6:int;
var _local7:Array;
var _local8:b2Body;
var _local9:int;
var _local10:int;
var _local11:b2Body;
var _local12:b2ContactEdge;
var _local13:b2JointEdge;
var _local14:Boolean;
m_positionIterationCount = 0;
_local3 = new b2Island(m_bodyCount, m_contactCount, m_jointCount, m_stackAllocator, m_contactListener);
_local2 = m_bodyList;
while (_local2) {
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
_local2 = _local2.m_next;
};
_local4 = m_contactList;
while (_local4) {
_local4.m_flags = (_local4.m_flags & ~(b2Contact.e_islandFlag));
_local4 = _local4.m_next;
};
_local5 = m_jointList;
while (_local5) {
_local5.m_islandFlag = false;
_local5 = _local5.m_next;
};
_local6 = m_bodyCount;
_local7 = new Array(_local6);
_local8 = m_bodyList;
while (_local8) {
if ((_local8.m_flags & ((b2Body.e_islandFlag | b2Body.e_sleepFlag) | b2Body.e_frozenFlag))){
} else {
if (_local8.IsStatic()){
} else {
_local3.Clear();
_local9 = 0;
var _temp1 = _local9;
_local9 = (_local9 + 1);
var _local15 = _temp1;
_local7[_local15] = _local8;
_local8.m_flags = (_local8.m_flags | b2Body.e_islandFlag);
while (_local9 > 0) {
--_local9;
_local2 = _local7[_local9];
_local3.AddBody(_local2);
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_sleepFlag));
if (_local2.IsStatic()){
} else {
_local12 = _local2.m_contactList;
while (_local12) {
if ((_local12.contact.m_flags & (b2Contact.e_islandFlag | b2Contact.e_nonSolidFlag))){
} else {
if (_local12.contact.m_manifoldCount == 0){
} else {
_local3.AddContact(_local12.contact);
_local12.contact.m_flags = (_local12.contact.m_flags | b2Contact.e_islandFlag);
_local11 = _local12.other;
if ((_local11.m_flags & b2Body.e_islandFlag)){
} else {
var _temp2 = _local9;
_local9 = (_local9 + 1);
var _local16 = _temp2;
_local7[_local16] = _local11;
_local11.m_flags = (_local11.m_flags | b2Body.e_islandFlag);
};
};
};
_local12 = _local12.next;
};
_local13 = _local2.m_jointList;
while (_local13) {
if (_local13.joint.m_islandFlag == true){
} else {
_local3.AddJoint(_local13.joint);
_local13.joint.m_islandFlag = true;
_local11 = _local13.other;
if ((_local11.m_flags & b2Body.e_islandFlag)){
} else {
var _temp3 = _local9;
_local9 = (_local9 + 1);
_local16 = _temp3;
_local7[_local16] = _local11;
_local11.m_flags = (_local11.m_flags | b2Body.e_islandFlag);
};
};
_local13 = _local13.next;
};
};
};
_local3.Solve(_arg1, m_gravity, m_positionCorrection, m_allowSleep);
if (_local3.m_positionIterationCount > m_positionIterationCount){
m_positionIterationCount = _local3.m_positionIterationCount;
};
_local10 = 0;
while (_local10 < _local3.m_bodyCount) {
_local2 = _local3.m_bodies[_local10];
if (_local2.IsStatic()){
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
};
_local10++;
};
};
};
_local8 = _local8.m_next;
};
_local2 = m_bodyList;
while (_local2) {
if ((_local2.m_flags & (b2Body.e_sleepFlag | b2Body.e_frozenFlag))){
} else {
if (_local2.IsStatic()){
} else {
_local14 = _local2.SynchronizeShapes();
if ((((_local14 == false)) && (!((m_boundaryListener == null))))){
m_boundaryListener.Violation(_local2);
};
};
};
_local2 = _local2.m_next;
};
m_broadPhase.Commit();
}
public function Query(_arg1:b2AABB, _arg2:Array, _arg3:int):int{
var _local4:Array;
var _local5:int;
var _local6:int;
_local4 = new Array(_arg3);
_local5 = m_broadPhase.QueryAABB(_arg1, _local4, _arg3);
_local6 = 0;
while (_local6 < _local5) {
_arg2[_local6] = _local4[_local6];
_local6++;
};
return (_local5);
}
public function SetGravity(_arg1:b2Vec2):void{
m_gravity = _arg1;
}
public function SolveTOI(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Shape;
var _local4:b2Shape;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2ContactEdge;
var _local8:b2Island;
var _local9:int;
var _local10:Array;
var _local11:b2Contact;
var _local12:b2Contact;
var _local13:Number;
var _local14:b2Body;
var _local15:int;
var _local16:b2TimeStep;
var _local17:int;
var _local18:Number;
var _local19:Number;
var _local20:b2Body;
var _local21:Boolean;
_local8 = new b2Island(m_bodyCount, b2Settings.b2_maxTOIContactsPerIsland, 0, m_stackAllocator, m_contactListener);
_local9 = m_bodyCount;
_local10 = new Array(_local9);
_local2 = m_bodyList;
while (_local2) {
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
_local2.m_sweep.t0 = 0;
_local2 = _local2.m_next;
};
_local11 = m_contactList;
while (_local11) {
_local11.m_flags = (_local11.m_flags & ~((b2Contact.e_toiFlag | b2Contact.e_islandFlag)));
_local11 = _local11.m_next;
};
while (true) {
_local12 = null;
_local13 = 1;
_local11 = m_contactList;
for (;_local11;(_local11 = _local11.m_next)) {
if ((_local11.m_flags & (b2Contact.e_slowFlag | b2Contact.e_nonSolidFlag))){
} else {
_local18 = 1;
if ((_local11.m_flags & b2Contact.e_toiFlag)){
_local18 = _local11.m_toi;
} else {
_local3 = _local11.m_shape1;
_local4 = _local11.m_shape2;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
if (((((_local5.IsStatic()) || (_local5.IsSleeping()))) && (((_local6.IsStatic()) || (_local6.IsSleeping()))))){
continue;
};
_local19 = _local5.m_sweep.t0;
if (_local5.m_sweep.t0 < _local6.m_sweep.t0){
_local19 = _local6.m_sweep.t0;
_local5.m_sweep.Advance(_local19);
} else {
if (_local6.m_sweep.t0 < _local5.m_sweep.t0){
_local19 = _local5.m_sweep.t0;
_local6.m_sweep.Advance(_local19);
};
};
_local18 = b2TimeOfImpact.TimeOfImpact(_local11.m_shape1, _local5.m_sweep, _local11.m_shape2, _local6.m_sweep);
if ((((_local18 > 0)) && ((_local18 < 1)))){
_local18 = (((1 - _local18) * _local19) + _local18);
if (_local18 > 1){
_local18 = 1;
};
};
_local11.m_toi = _local18;
_local11.m_flags = (_local11.m_flags | b2Contact.e_toiFlag);
};
if ((((Number.MIN_VALUE < _local18)) && ((_local18 < _local13)))){
_local12 = _local11;
_local13 = _local18;
};
};
};
if ((((_local12 == null)) || (((1 - (100 * Number.MIN_VALUE)) < _local13)))){
break;
};
_local3 = _local12.m_shape1;
_local4 = _local12.m_shape2;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
_local5.Advance(_local13);
_local6.Advance(_local13);
_local12.Update(m_contactListener);
_local12.m_flags = (_local12.m_flags & ~(b2Contact.e_toiFlag));
if (_local12.m_manifoldCount == 0){
} else {
_local14 = _local5;
if (_local14.IsStatic()){
_local14 = _local6;
};
_local8.Clear();
_local15 = 0;
var _temp1 = _local15;
_local15 = (_local15 + 1);
var _local22 = _temp1;
_local10[_local22] = _local14;
_local14.m_flags = (_local14.m_flags | b2Body.e_islandFlag);
while (_local15 > 0) {
--_local15;
_local2 = _local10[_local15];
_local8.AddBody(_local2);
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_sleepFlag));
if (_local2.IsStatic()){
} else {
_local7 = _local2.m_contactList;
while (_local7) {
if (_local8.m_contactCount == _local8.m_contactCapacity){
} else {
if ((_local7.contact.m_flags & ((b2Contact.e_islandFlag | b2Contact.e_slowFlag) | b2Contact.e_nonSolidFlag))){
} else {
if (_local7.contact.m_manifoldCount == 0){
} else {
_local8.AddContact(_local7.contact);
_local7.contact.m_flags = (_local7.contact.m_flags | b2Contact.e_islandFlag);
_local20 = _local7.other;
if ((_local20.m_flags & b2Body.e_islandFlag)){
} else {
if (_local20.IsStatic() == false){
_local20.Advance(_local13);
_local20.WakeUp();
};
var _temp2 = _local15;
_local15 = (_local15 + 1);
var _local23 = _temp2;
_local10[_local23] = _local20;
_local20.m_flags = (_local20.m_flags | b2Body.e_islandFlag);
};
};
};
};
_local7 = _local7.next;
};
};
};
_local16 = new b2TimeStep();
_local16.dt = ((1 - _local13) * _arg1.dt);
_local16.inv_dt = (1 / _local16.dt);
_local16.maxIterations = _arg1.maxIterations;
_local8.SolveTOI(_local16);
_local17 = 0;
while (_local17 < _local8.m_bodyCount) {
_local2 = _local8.m_bodies[_local17];
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
if ((_local2.m_flags & (b2Body.e_sleepFlag | b2Body.e_frozenFlag))){
} else {
if (_local2.IsStatic()){
} else {
_local21 = _local2.SynchronizeShapes();
if ((((_local21 == false)) && (!((m_boundaryListener == null))))){
m_boundaryListener.Violation(_local2);
};
_local7 = _local2.m_contactList;
while (_local7) {
_local7.contact.m_flags = (_local7.contact.m_flags & ~(b2Contact.e_toiFlag));
_local7 = _local7.next;
};
};
};
_local17++;
};
_local17 = 0;
while (_local17 < _local8.m_contactCount) {
_local11 = _local8.m_contacts[_local17];
_local8.m_contacts[_local17].m_flags = (_local11.m_flags & ~((b2Contact.e_toiFlag | b2Contact.e_islandFlag)));
_local17++;
};
m_broadPhase.Commit();
};
};
}
public function GetJointList():b2Joint{
return (m_jointList);
}
public function Validate():void{
m_broadPhase.Validate();
}
public function GetPairCount():int{
return (m_broadPhase.m_pairManager.m_pairCount);
}
public function GetBodyList():b2Body{
return (m_bodyList);
}
public function SetWarmStarting(_arg1:Boolean):void{
m_warmStarting = _arg1;
}
public function SetPositionCorrection(_arg1:Boolean):void{
m_positionCorrection = _arg1;
}
public function CreateJoint(_arg1:b2JointDef):b2Joint{
var _local2:b2Joint;
var _local3:b2Body;
var _local4:b2Shape;
_local2 = b2Joint.Create(_arg1, m_blockAllocator);
_local2.m_prev = null;
_local2.m_next = m_jointList;
if (m_jointList){
m_jointList.m_prev = _local2;
};
m_jointList = _local2;
m_jointCount++;
_local2.m_node1.joint = _local2;
_local2.m_node1.other = _local2.m_body2;
_local2.m_node1.prev = null;
_local2.m_node1.next = _local2.m_body1.m_jointList;
if (_local2.m_body1.m_jointList){
_local2.m_body1.m_jointList.prev = _local2.m_node1;
};
_local2.m_body1.m_jointList = _local2.m_node1;
_local2.m_node2.joint = _local2;
_local2.m_node2.other = _local2.m_body1;
_local2.m_node2.prev = null;
_local2.m_node2.next = _local2.m_body2.m_jointList;
if (_local2.m_body2.m_jointList){
_local2.m_body2.m_jointList.prev = _local2.m_node2;
};
_local2.m_body2.m_jointList = _local2.m_node2;
if (_arg1.collideConnected == false){
_local3 = ((_arg1.body1.m_shapeCount < _arg1.body2.m_shapeCount)) ? _arg1.body1 : _arg1.body2;
_local4 = _local3.m_shapeList;
while (_local4) {
_local4.RefilterProxy(m_broadPhase, _local3.m_xf);
_local4 = _local4.m_next;
};
};
return (_local2);
}
public function DestroyJoint(_arg1:b2Joint):void{
var _local2:Boolean;
var _local3:b2Body;
var _local4:b2Body;
var _local5:b2Body;
var _local6:b2Shape;
_local2 = _arg1.m_collideConnected;
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_jointList){
m_jointList = _arg1.m_next;
};
_local3 = _arg1.m_body1;
_local4 = _arg1.m_body2;
_local3.WakeUp();
_local4.WakeUp();
if (_arg1.m_node1.prev){
_arg1.m_node1.prev.next = _arg1.m_node1.next;
};
if (_arg1.m_node1.next){
_arg1.m_node1.next.prev = _arg1.m_node1.prev;
};
if (_arg1.m_node1 == _local3.m_jointList){
_local3.m_jointList = _arg1.m_node1.next;
};
_arg1.m_node1.prev = null;
_arg1.m_node1.next = null;
if (_arg1.m_node2.prev){
_arg1.m_node2.prev.next = _arg1.m_node2.next;
};
if (_arg1.m_node2.next){
_arg1.m_node2.next.prev = _arg1.m_node2.prev;
};
if (_arg1.m_node2 == _local4.m_jointList){
_local4.m_jointList = _arg1.m_node2.next;
};
_arg1.m_node2.prev = null;
_arg1.m_node2.next = null;
b2Joint.Destroy(_arg1, m_blockAllocator);
m_jointCount--;
if (_local2 == false){
_local5 = ((_local3.m_shapeCount < _local4.m_shapeCount)) ? _local3 : _local4;
_local6 = _local5.m_shapeList;
while (_local6) {
_local6.RefilterProxy(m_broadPhase, _local5.m_xf);
_local6 = _local6.m_next;
};
};
}
public function SetContactListener(_arg1:b2ContactListener):void{
m_contactListener = _arg1;
}
public function CreateBody(_arg1:b2BodyDef):b2Body{
var _local2:b2Body;
if (m_lock == true){
return (null);
};
_local2 = new b2Body(_arg1, this);
_local2.m_prev = null;
_local2.m_next = m_bodyList;
if (m_bodyList){
m_bodyList.m_prev = _local2;
};
m_bodyList = _local2;
m_bodyCount++;
return (_local2);
}
public function SetBoundaryListener(_arg1:b2BoundaryListener):void{
m_boundaryListener = _arg1;
}
public function SetDestructionListener(_arg1:b2DestructionListener):void{
m_destructionListener = _arg1;
}
public function Step(_arg1:Number, _arg2:int):void{
var _local3:b2TimeStep;
m_lock = true;
_local3 = new b2TimeStep();
_local3.dt = _arg1;
_local3.maxIterations = _arg2;
if (_arg1 > 0){
_local3.inv_dt = (1 / _arg1);
} else {
_local3.inv_dt = 0;
};
_local3.dtRatio = (m_inv_dt0 * _arg1);
_local3.positionCorrection = m_positionCorrection;
_local3.warmStarting = m_warmStarting;
m_contactManager.Collide();
if (_local3.dt > 0){
Solve(_local3);
};
if (((m_continuousPhysics) && ((_local3.dt > 0)))){
SolveTOI(_local3);
};
DrawDebugData();
m_inv_dt0 = _local3.inv_dt;
m_lock = false;
}
public function GetBodyCount():int{
return (m_bodyCount);
}
public function GetJointCount():int{
return (m_jointCount);
}
}
}//package Box2D.Dynamics
Section 75
//Vector2D (com.cheezeworld.math.Vector2D)
package com.cheezeworld.math {
import flash.geom.*;
public class Vector2D {
public var y:Number;
private var v2:Vector2D;
private var _length:Number;
private var _oldX:Number;
private var v1:Vector2D;
private var _oldY:Number;
public var x:Number;
private static const DEG_TO_RAD:Number = 0.0174532925199433;
private static const RAD_TO_DEG:Number = 57.2957795130823;
public function Vector2D(_arg1:Number=0, _arg2:Number=0){
x = _arg1;
y = _arg2;
_length = 0;
}
public function Set(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
public function sign(_arg1:Vector2D):int{
if ((y * _arg1.x) > (x * _arg1.y)){
return (-1);
};
return (1);
}
public function dividedBy(_arg1:Number):Vector2D{
if (_arg1 == 0){
trace("Vector::dividedBy() - Illegal Divide by Zero!");
return (new Vector2D());
};
return (new Vector2D((x / _arg1), (y / _arg1)));
}
public function isZero():Boolean{
return ((((x == 0)) || ((y == 0))));
}
public function normalize():void{
if (length != 0){
x = (x / _length);
y = (y / _length);
};
}
public function isParallelTo(_arg1:Vector2D):Boolean{
v1 = copy();
v1.normalize();
v2 = _arg1.copy();
v2.normalize();
return ((((((v1.x == v2.x)) && ((v1.y == v2.y)))) || ((((v1.x == -(v2.x))) && ((v1.y == -(v2.y)))))));
}
public function distanceTo(_arg1:Vector2D):Number{
var _local2:Number;
var _local3:Number;
_local2 = (_arg1.x - x);
_local3 = (_arg1.y - y);
return (Math.sqrt(((_local3 * _local3) + (_local2 * _local2))));
}
public function subtract(_arg1:Vector2D):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
}
public function toPoint():Point{
return (new Point(x, y));
}
public function dotOf(_arg1:Vector2D):Number{
return (((x * _arg1.x) + (y * _arg1.y)));
}
public function toRotation():Number{
var _local1:Number;
_local1 = Math.atan((y / x));
if ((((y < 0)) && ((x > 0)))){
return (_local1);
};
if ((((((y < 0)) && ((x < 0)))) || ((((y > 0)) && ((x < 0)))))){
return ((_local1 + 3.14159265358979));
};
return ((_local1 + 6.28318530717959));
}
public function isInsideRegion(_arg1:Vector2D, _arg2:Vector2D):Boolean{
return (!((((((((x < _arg1.x)) || ((x > (_arg1.x + _arg2.x))))) || ((y < _arg1.y)))) || ((y > (_arg1.y + _arg2.y))))));
}
public function addedTo(_arg1:Vector2D):Vector2D{
return (new Vector2D((x + _arg1.x), (y + _arg1.y)));
}
public function perpDotOf(_arg1:Vector2D):Number{
return (getPerp().dotOf(_arg1));
}
public function projectionOn(_arg1:Vector2D):Vector2D{
v1 = _arg1.copy();
v1.multiply((this.dotOf(_arg1) / _arg1.dotOf(_arg1)));
return (v1);
}
public function distanceSqTo(_arg1:Vector2D):Number{
var _local2:Number;
var _local3:Number;
_local2 = (_arg1.y - y);
_local3 = (_arg1.x - x);
return (((_local3 * _local3) + (_local2 * _local2)));
}
public function get lengthSq():Number{
return (((x * x) + (y * y)));
}
public function get length():Number{
if (((!((_oldX == x))) || (!((_oldY == y))))){
_oldX = x;
_oldY = y;
_length = Math.sqrt(((x * x) + (y * y)));
};
return (_length);
}
public function getPerp():Vector2D{
return (new Vector2D(-(y), x));
}
public function subtractedBy(_arg1:Vector2D):Vector2D{
return (new Vector2D((x - _arg1.x), (y - _arg1.y)));
}
public function multiply(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
}
public function toString():String{
return ((((("( " + x) + ", ") + y) + " )"));
}
public function truncate(_arg1:Number):void{
if (lengthSq > (_arg1 * _arg1)){
normalize();
multiply(_arg1);
};
}
public function angleTo(_arg1:Vector2D):Number{
return (Math.acos((dotOf(_arg1) / (length * _arg1.length))));
}
public function multipliedBy(_arg1:Number):Vector2D{
return (new Vector2D((x * _arg1), (y * _arg1)));
}
public function getNormalized():Vector2D{
if (length == 0){
return (new Vector2D());
};
return (new Vector2D((x / _length), (y / _length)));
}
public function copy():Vector2D{
var _local1:Vector2D;
_local1 = new Vector2D(x, y);
_local1._length = _length;
_local1._oldX = x;
_local1._oldY = y;
return (_local1);
}
public function wrapAround(_arg1:Vector2D, _arg2:Vector2D):void{
if (x > _arg2.x){
x = (_arg1.x + (x - _arg2.x));
} else {
if (x < _arg1.x){
x = (_arg2.x + x);
};
};
if (y < _arg1.y){
y = (_arg2.y + y);
} else {
if (y > _arg2.y){
y = (_arg1.y + (y - _arg2.y));
};
};
}
public function divide(_arg1:Number):void{
if (_arg1 == 0){
trace("Vector::dividedBy() - Illegal Divide by Zero!");
} else {
x = (x / _arg1);
y = (y / _arg1);
};
}
public function getReverse():Vector2D{
return (new Vector2D(-(x), -(y)));
}
public function addTo(_arg1:Vector2D):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
}
public function reflect(_arg1:Vector2D):void{
v1 = _arg1.getReverse();
v1.multiply((2 * dotOf(_arg1)));
addTo(v1);
}
public function crossOf(_arg1:Vector2D):Number{
return (((x * _arg1.y) - (y * _arg1.x)));
}
public static function rotToHeading(_arg1:Number):Vector2D{
var _local2:Number;
var _local3:Number;
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
return (new Vector2D(_local2, _local3));
}
public static function is2ndInFOVof1st(_arg1:Vector2D, _arg2:Vector2D, _arg3:Number, _arg4:Vector2D):Boolean{
var _local5:Vector2D;
_local5 = _arg4.copy();
_local5.subtract(_arg1);
_local5.normalize();
return ((_arg2.dotOf(_local5) >= Math.cos((_arg3 / 2))));
}
public static function pointToVector(_arg1:Point):Vector2D{
return (new Vector2D(_arg1.x, _arg1.y));
}
}
}//package com.cheezeworld.math
Section 76
//Input (com.cheezeworld.utils.Input)
package com.cheezeworld.utils {
import flash.events.*;
import flash.display.*;
import com.cheezeworld.math.*;
import flash.utils.*;
public class Input {
private var _bufferSize:int;
private var _ot:int;
private var _timeKeyReleased:int;
private var _timeMousePressed:int;
public var mouseDelta:int;// = 0
public var lastKeyName:String;// = ""
public var _keyBuffer:Array;
private var _keyArr:Array;
private var _timeKeyPressed:int;
private var _timeMouseReleased:int;
private var _dt:int;
private var _keyState:Array;
public var mouseX:Number;// = 0
public var mouseY:Number;// = 0
private var _hasMouseScrolled:Boolean;
private var _ascii:Array;
public var isMouseDown:Boolean;// = false
private var _nt:int;
public var mousePos:Vector2D;
public var lastKeyCode:int;// = 0
public var isMouseReleased:Boolean;// = false
private var _stage:Stage;
private static const BUFFER_SIZE:int = 5;
private static var _instance:Input;
public function Input(_arg1:SingletonEnforcer){
var _local2:int;
var _local3:int;
lastKeyName = "";
lastKeyCode = 0;
isMouseDown = false;
isMouseReleased = false;
mouseX = 0;
mouseY = 0;
mouseDelta = 0;
super();
_timeKeyPressed = (_nt = (_ot = getTimer()));
_dt = 0;
mousePos = new Vector2D();
_ascii = new Array(222);
fillAscii();
_keyState = new Array(222);
_keyArr = new Array();
_local2 = 0;
while (_local2 < 222) {
_keyState[_local2] = new int(0);
if (_ascii[_local2] != undefined){
_keyArr.push(_local2);
};
_local2++;
};
_bufferSize = Input.BUFFER_SIZE;
_keyBuffer = new Array(_bufferSize);
_local3 = 0;
while (_local3 < _bufferSize) {
_keyBuffer[_local3] = new Array(0, 0);
_local3++;
};
}
public function isKeyPressed(_arg1:int):Boolean{
return ((_keyState[_arg1] == 1));
}
private function fillAscii():void{
_ascii[65] = "A";
_ascii[66] = "B";
_ascii[67] = "C";
_ascii[68] = "D";
_ascii[69] = "E";
_ascii[70] = "F";
_ascii[71] = "G";
_ascii[72] = "H";
_ascii[73] = "I";
_ascii[74] = "J";
_ascii[75] = "K";
_ascii[76] = "L";
_ascii[77] = "M";
_ascii[78] = "N";
_ascii[79] = "O";
_ascii[80] = "P";
_ascii[81] = "Q";
_ascii[82] = "R";
_ascii[83] = "S";
_ascii[84] = "T";
_ascii[85] = "U";
_ascii[86] = "V";
_ascii[87] = "W";
_ascii[88] = "X";
_ascii[89] = "Y";
_ascii[90] = "Z";
_ascii[48] = "0";
_ascii[49] = "1";
_ascii[50] = "2";
_ascii[51] = "3";
_ascii[52] = "4";
_ascii[53] = "5";
_ascii[54] = "6";
_ascii[55] = "7";
_ascii[56] = "8";
_ascii[57] = "9";
_ascii[32] = "Space";
_ascii[13] = "Enter";
_ascii[17] = "Ctrl";
_ascii[16] = "Shift";
_ascii[192] = "~";
_ascii[38] = "Up";
_ascii[40] = "Down";
_ascii[37] = "Left";
_ascii[39] = "Right";
_ascii[96] = "Numpad 0";
_ascii[97] = "Numpad 1";
_ascii[98] = "Numpad 2";
_ascii[99] = "Numpad 3";
_ascii[100] = "Numpad 4";
_ascii[101] = "Numpad 5";
_ascii[102] = "Numpad 6";
_ascii[103] = "Numpad 7";
_ascii[104] = "Numpad 8";
_ascii[105] = "Numpad 9";
_ascii[111] = "Numpad /";
_ascii[106] = "Numpad *";
_ascii[109] = "Numpad -";
_ascii[107] = "Numpad +";
_ascii[110] = "Numpad .";
_ascii[45] = "Insert";
_ascii[46] = "Delete";
_ascii[33] = "Page Up";
_ascii[34] = "Page Down";
_ascii[35] = "End";
_ascii[36] = "Home";
_ascii[112] = "F1";
_ascii[113] = "F2";
_ascii[114] = "F3";
_ascii[115] = "F4";
_ascii[116] = "F5";
_ascii[117] = "F6";
_ascii[118] = "F7";
_ascii[119] = "F8";
_ascii[188] = ",";
_ascii[190] = ".";
_ascii[186] = ";";
_ascii[222] = "'";
_ascii[219] = "[";
_ascii[221] = "]";
_ascii[189] = "-";
_ascii[187] = "+";
_ascii[220] = "\\";
_ascii[191] = "/";
_ascii[9] = "TAB";
_ascii[8] = "Backspace";
_ascii[27] = "ESC";
}
public function get timeSinceMouseReleased():int{
return ((getTimer() - _timeMouseReleased));
}
private function mouseMove(_arg1:MouseEvent):void{
mouseX = (_arg1.stageX - _stage.x);
mouseY = (_arg1.stageY - _stage.y);
mousePos.x = mouseX;
mousePos.y = mouseY;
}
public function isKeyDown(_arg1:int):Boolean{
return ((_keyState[_arg1] > 0));
}
public function getKeyString(_arg1:int):String{
return (_ascii[_arg1]);
}
private function mousePress(_arg1:MouseEvent):void{
isMouseDown = true;
_timeMousePressed = getTimer();
}
private function mouseRelease(_arg1:MouseEvent):void{
isMouseDown = false;
isMouseReleased = true;
_timeMouseReleased = getTimer();
}
private function keyPress(_arg1:KeyboardEvent):void{
_keyState[_arg1.keyCode] = Math.max(_keyState[_arg1.keyCode], 1);
lastKeyName = _ascii[_arg1.keyCode];
lastKeyCode = _arg1.keyCode;
if (_keyState[_arg1.keyCode] == 1){
_timeKeyPressed = getTimer();
};
}
private function keyRelease(_arg1:KeyboardEvent):void{
var _local2:int;
_keyState[_arg1.keyCode] = -1;
_local2 = (_bufferSize - 1);
while (_local2 > 0) {
_keyBuffer[_local2] = _keyBuffer[(_local2 - 1)];
_local2--;
};
_keyBuffer[0] = [_arg1.keyCode, 0];
_timeKeyReleased = getTimer();
}
public function get timeSinceLastKeyRelease():int{
return ((getTimer() - _timeKeyReleased));
}
public function isKeyReleased(_arg1:int):Boolean{
return ((_keyState[_arg1] == -1));
}
public function isKeyInBuffer(_arg1:int, _arg2:int, _arg3:int):Boolean{
return ((((_keyBuffer[_arg2][0] == _arg1)) && ((_keyBuffer[_arg2][1] <= _arg3))));
}
public function update():void{
var _local1:int;
var _local2:int;
_nt = getTimer();
_dt = (_nt - _ot);
_ot = _nt;
_local1 = 0;
while (_local1 < _keyArr.length) {
if (_keyState[_keyArr[_local1]] != 0){
var _local3 = _keyState;
var _local4 = _keyArr[_local1];
var _local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
};
_local1++;
};
_local2 = 0;
while (_local2 < _bufferSize) {
_keyBuffer[_local2][1] = (_keyBuffer[_local2][1] + _dt);
_local2++;
};
isMouseReleased = false;
}
public function get timeSinceMousePressed():int{
return ((getTimer() - _timeMousePressed));
}
private function mouseScroll(_arg1:MouseEvent):void{
_hasMouseScrolled = true;
mouseDelta = _arg1.delta;
}
public function get timeSinceLastKeyPress():int{
return ((getTimer() - _timeKeyPressed));
}
public function activate(_arg1:Stage):void{
_stage = _arg1;
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyPress, false, 0, true);
_arg1.addEventListener(KeyboardEvent.KEY_UP, keyRelease, false, 0, true);
_arg1.addEventListener(MouseEvent.MOUSE_DOWN, mousePress, false, 0, true);
_arg1.addEventListener(MouseEvent.MOUSE_UP, mouseRelease, false, 0, true);
_arg1.addEventListener(MouseEvent.MOUSE_MOVE, mouseMove, false, 0, true);
_arg1.addEventListener(MouseEvent.MOUSE_WHEEL, mouseScroll, false, 0, true);
}
public function get hasMouseScrolled():Boolean{
if (_hasMouseScrolled){
_hasMouseScrolled = false;
return (true);
};
return (false);
}
public static function get instance():Input{
if (Input._instance == null){
Input._instance = new Input(new SingletonEnforcer());
};
return (Input._instance);
}
}
}//package com.cheezeworld.utils
class SingletonEnforcer {
private function SingletonEnforcer(){
}
}
Section 77
//KeyCode (com.cheezeworld.utils.KeyCode)
package com.cheezeworld.utils {
public class KeyCode {
public static const BACKWARD_SLASH:int = 220;
public static const RIGHT:int = 39;
public static const LEFT:int = 37;
public static const SPACEBAR:int = 32;
public static const FOUR:int = 52;
public static const TWO:int = 50;
public static const CLEAR:int = 12;
public static const TILDE:int = 192;
public static const CONTROL:int = 17;
public static const NUMPAD_DECIMAL:int = 110;
public static const A:int = 65;
public static const B:int = 66;
public static const C:int = 67;
public static const D:int = 68;
public static const E:int = 69;
public static const F:int = 70;
public static const G:int = 71;
public static const H:int = 72;
public static const I:int = 73;
public static const J:int = 74;
public static const K:int = 75;
public static const L:int = 76;
public static const M:int = 77;
public static const N:int = 78;
public static const O:int = 79;
public static const P:int = 80;
public static const Q:int = 81;
public static const R:int = 82;
public static const S:int = 83;
public static const T:int = 84;
public static const U:int = 85;
public static const V:int = 86;
public static const W:int = 87;
public static const X:int = 88;
public static const Y:int = 89;
public static const Z:int = 90;
public static const ONE:int = 49;
public static const PAGE_UP:int = 33;
public static const NUMPAD_ENTER:int = 108;
public static const COLON:int = 186;
public static const BACKSPACE:int = 8;
public static const EIGHT:int = 56;
public static const SHIFT:int = 16;
public static const TAB:int = 9;
public static const THREE:int = 51;
public static const HELP:int = 47;
public static const QUOTES:int = 222;
public static const ALT:int = 18;
public static const NUMPAD_ADD:int = 107;
public static const ESC:int = 27;
public static const F3:int = 114;
public static const ZERO:int = 48;
public static const F4:int = 115;
public static const F5:int = 116;
public static const F6:int = 117;
public static const F7:int = 118;
public static const NUMPAD_DIVIDE:int = 111;
public static const F2:int = 113;
public static const CLOSED_BRACKET:int = 221;
public static const UP:int = 38;
public static const NUMPAD_0:int = 96;
public static const NUMPAD_1:int = 97;
public static const NUMPAD_2:int = 98;
public static const FIVE:int = 53;
public static const SIX:int = 54;
public static const NUMPAD_5:int = 101;
public static const NUMPAD_6:int = 102;
public static const NUMPAD_7:int = 103;
public static const NUMPAD_SUBTRACT:int = 109;
public static const NUMPAD_9:int = 105;
public static const NUMPAD_3:int = 99;
public static const NUMPAD_4:int = 100;
public static const NINE:int = 57;
public static const F9:int = 120;
public static const NUMPAD_8:int = 104;
public static const DOWN:int = 40;
public static const F8:int = 119;
public static const NUMPAD_MULTIPLY:int = 106;
public static const EQUALS:int = 187;
public static const F1:int = 112;
public static const UNDERSCORE:int = 189;
public static const HOME:int = 36;
public static const DELETE:int = 46;
public static const F10:int = 121;
public static const F11:int = 122;
public static const F12:int = 123;
public static const F13:int = 124;
public static const F14:int = 125;
public static const F15:int = 126;
public static const CAPS_LOCK:int = 20;
public static const SEVEN:int = 55;
public static const INSERT:int = 45;
public static const END:int = 35;
public static const OPEN_BRACKET:int = 219;
public static const QUESTION_MARK:int = 191;
public static const NUM_LOCK:int = 144;
public static const PAGE_DOWN:int = 34;
public static const ENTER:int = 13;
}
}//package com.cheezeworld.utils
Section 78
//AchievementManager (com.tanoku.MoreZombies.AchievementManager)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import gs.easing.*;
public class AchievementManager {
public var active:Boolean;// = false
public var recalc:Boolean;// = false
public var soundManager:SoundManager;
public var finAchievement:Number;// = 0
public var timePausa:Number;// = 0
private var weaponShop:WeaponShop;
public var pantallaInterfaz:MovieClip;
public var ach_ComboPlayer1:Boolean;// = false
public var ach_ComboPlayer3:Boolean;// = false
public var ach_ComboPlayer4:Boolean;// = false
public var ach_ComboPlayer2:Boolean;// = false
public var layer_mc:MovieClip;
public var tipo_partida:String;
public var listaAchievements:Array;
public var playerObj;
public var tipoAchievement:String;
public var descAchievement:String;
var timeEndCombo:Number;// = 0
private var weaponManager:WeaponManager;
public var tiempoAchievement:Number;// = 4000
public var myTimer:Timer;
public static var ach_Massacre:Boolean = false;
public static var ach_MoreBullets:Boolean = false;
public static var ach_Jedi:Boolean = false;
public static var ach_Samurai:Boolean = false;
public static var ach_BloodyCircus:Boolean = false;
public static var ach_Pyromania:Boolean = false;
public static var instance:AchievementManager;
public static var ach_HomeRun:Boolean = false;
public static var ach_Disintegrate:Boolean = false;
public static var ach_Glacier:Boolean = false;
public static var ach_Hitman:Boolean = false;
public static var ach_Terminator:Boolean = false;
public static var ach_AllWeapons:Boolean = false;
public static var ach_Megaslash:Boolean = false;
public static var ach_Hunter:Boolean = false;
public static var ach_Jurasic:Boolean = false;
public static var ach_InfiniteAmmo:Boolean = false;
public static var ach_Demolition:Boolean = false;
public static var ach_Headache:Boolean = false;
public function AchievementManager(_arg1:SingletonEnforcer){
weaponManager = WeaponManager.getInstance();
soundManager = SoundManager.getInstance();
weaponShop = WeaponShop.getInstance();
active = false;
myTimer = new Timer(1000);
recalc = false;
timePausa = 0;
timeEndCombo = 0;
tiempoAchievement = 4000;
finAchievement = 0;
ach_ComboPlayer1 = false;
ach_ComboPlayer2 = false;
ach_ComboPlayer3 = false;
ach_ComboPlayer4 = false;
super();
}
public function stop(){
active = false;
myTimer.removeEventListener("timer", timerHandler);
myTimer.stop();
}
public function mostrarAchievements(){
var _local1:String;
var _local2:RegExp;
var _local3:Array;
if (finAchievement == 0){
Globals.saveManager.save();
finAchievement = (getTimer() + tiempoAchievement);
_local1 = listaAchievements[0];
_local2 = /;/;
_local3 = _local1.split(_local2);
pantallaInterfaz.trofeos.info.text = ((_local3[0] + " ") + _local3[1]);
TweenLite.to(pantallaInterfaz.trofeos, 0.5, {y:210});
soundManager.playSound("trofeo", 0.5, 1);
pantallaInterfaz.trofeos.visible = true;
} else {
if (getTimer() > finAchievement){
TweenLite.to(pantallaInterfaz.trofeos, 0.5, {y:300, onComplete:onFinishTweenMostrar});
};
};
}
public function controlMuertesTotal(){
var _local1:Boolean;
var _local2:*;
_local1 = true;
if (ach_AllWeapons == false){
_local2 = 0;
while (_local2 < weaponShop.weaponList.length) {
if (weaponShop.weaponList[_local2].killsToUnlock > 0){
if (weaponShop.weaponList[_local2].locked == true){
_local1 = false;
if (Globals.muertesTotal >= weaponShop.weaponList[_local2].killsToUnlock){
weaponShop.weaponList[_local2].locked = false;
encolaAchievement("Weapon Unlocked:", weaponShop.weaponList[_local2].name);
trace(("Weapon Unlocked: " + weaponShop.weaponList[_local2].name));
};
};
};
_local2++;
};
if (((_local1) && ((ach_AllWeapons == false)))){
ach_AllWeapons = true;
encolaAchievement("Achievement Unlocked:", "Full Armed");
};
};
}
public function checkAchievement(_arg1:String="", _arg2:int=0, _arg3:int=0):Boolean{
var _local4:Boolean;
_local4 = false;
switch (_arg1){
case "consecutivas":
switch (_arg3){
case 30:
if (_arg2 >= 50){
if (ach_HomeRun == false){
ach_HomeRun = true;
descAchievement = "Home Run!";
encolaAchievement("Achievement Unlocked:", descAchievement);
};
_local4 = true;
};
break;
case 33:
if (_arg2 >= 300){
if (ach_Jedi == false){
ach_Jedi = true;
descAchievement = "Jedi";
encolaAchievement("Achievement Unlocked:", descAchievement);
};
_local4 = true;
};
break;
case 35:
if (_arg2 >= 100){
if (ach_Jurasic == false){
ach_Jurasic = true;
descAchievement = "Jurassic";
encolaAchievement("Achievement Unlocked:", descAchievement);
};
_local4 = true;
};
break;
case 27:
if (_arg2 >= 200){
if (ach_Samurai == false){
ach_Samurai = true;
descAchievement = "Samurai";
encolaAchievement("Achievement Unlocked:", descAchievement);
};
_local4 = true;
};
break;
case 17:
if (_arg2 >= 100){
if (ach_Massacre == false){
ach_Massacre = true;
descAchievement = "Massacre";
encolaAchievement("Achievement Unlocked:", descAchievement);
};
_local4 = true;
};
break;
case 18:
if (_arg2 >= 150){
if (ach_Pyromania == false){
ach_Pyromania = true;
descAchievement = "Pyromania";
encolaAchievement("Achievement Unlocked:", descAchievement);
};
_local4 = true;
};
break;
case 12:
if (_arg2 >= 200){
if (ach_Terminator == false){
ach_Terminator = true;
descAchievement = "Terminator";
encolaAchievement("Achievement Unlocked:", descAchievement);
};
_local4 = true;
};
break;
case 7:
if (_arg2 >= 50){
if (ach_Hunter == false){
ach_Hunter = true;
descAchievement = "Hunter";
encolaAchievement("Achievement Unlocked:", descAchievement);
};
_local4 = true;
};
break;
case 4:
if (_arg2 >= 50){
if (ach_Hitman == false){
ach_Hitman = true;
descAchievement = "Hitman";
encolaAchievement("Achievement Unlocked:", descAchievement);
};
_local4 = true;
};
break;
};
break;
case "MegaSlash":
if (_arg2 >= 5){
if (ach_Megaslash == false){
ach_Megaslash = true;
encolaAchievement("Achievement Unlocked:", "Megaslash!");
};
_local4 = true;
};
break;
case "Disintegrate":
if (_arg2 >= 10){
if (ach_Disintegrate == false){
ach_Disintegrate = true;
encolaAchievement("Achievement Unlocked:", "Disintegrate");
};
_local4 = true;
};
break;
case "Demolition":
if (_arg2 >= 10){
if (ach_Demolition == false){
ach_Demolition = true;
encolaAchievement("Achievement Unlocked:", "Demolition");
};
_local4 = true;
};
break;
case "Headache":
if (_arg2 >= 10){
if (ach_Headache == false){
ach_Headache = true;
encolaAchievement("Achievement Unlocked:", "Headache");
};
_local4 = true;
};
break;
case "BloodyCircus":
if (_arg2 >= 1000){
if (ach_BloodyCircus == false){
ach_BloodyCircus = true;
encolaAchievement("Achievement Unlocked:", "Bloody Circus");
descAchievement = "Bloody Circus";
};
_local4 = true;
};
break;
case "Glacier":
if (_arg2 >= 5000){
if (ach_Glacier == false){
ach_Glacier = true;
encolaAchievement("Achievement Unlocked:", "Glacier");
descAchievement = "Glacier";
};
_local4 = true;
};
break;
case "More Bullets":
if (_arg2 >= 100000){
if (ach_MoreBullets == false){
ach_MoreBullets = true;
encolaAchievement("Achievement Unlocked:", "More Bullets");
descAchievement = "More Bullets";
_local4 = true;
} else {
_local4 = false;
};
};
break;
};
return (_local4);
}
public function check(_arg1:String){
switch (_arg1){
case "zatoichi":
playerObj.cartelFlotante("MegaSlash!");
break;
};
}
public function finalize(){
instance = null;
}
public function play(){
}
public function timerHandler(_arg1:TimerEvent):void{
controlMuertesMelee();
controlMuertesArmas();
controlMuertesTotal();
if (listaAchievements.length > 0){
trace("hay achievements por mostrar");
mostrarAchievements();
};
}
function onFinishTweenMostrar():void{
finAchievement = 0;
listaAchievements.splice(0, 1);
}
public function update(){
}
public function encolaAchievement(_arg1, _arg2){
listaAchievements.push(((_arg1 + ";") + _arg2));
}
public function controlMuertesMelee(){
if (Globals.comboPlayer < 4){
if ((((Globals.comboPlayer == 1)) && ((Globals.muertesMelee >= 5)))){
Globals.comboPlayer = 2;
encolaAchievement("Combo Unlocked:", ("Combo level " + Globals.comboPlayer));
};
if ((((Globals.comboPlayer == 2)) && ((Globals.muertesMelee >= 25)))){
Globals.comboPlayer = 3;
encolaAchievement("Combo Unlocked:", ("Combo level " + Globals.comboPlayer));
};
if ((((Globals.comboPlayer == 3)) && ((Globals.muertesMelee >= 100)))){
Globals.comboPlayer = 4;
encolaAchievement("Combo Unlocked:", ("Combo level " + Globals.comboPlayer));
};
};
}
public function controlMuertesArmas(){
if (Globals.muertesTotal >= 1000000){
if (ach_InfiniteAmmo == false){
ach_InfiniteAmmo = true;
encolaAchievement("Achievement Unlocked:", "Infinite Ammo");
Globals.MunicionInfinita = true;
};
};
}
public function start(){
listaAchievements = new Array();
myTimer.addEventListener("timer", timerHandler);
myTimer.start();
}
public function pause(){
}
public static function getInstance():AchievementManager{
if (instance == null){
instance = new AchievementManager(new SingletonEnforcer());
};
return (instance);
}
}
}//package com.tanoku.MoreZombies
class SingletonEnforcer {
private function SingletonEnforcer(){
}
}
Section 79
//arcade (com.tanoku.MoreZombies.arcade)
package com.tanoku.MoreZombies {
import flash.events.*;
import flash.display.*;
import mochi.as3.*;
import flash.text.*;
public class arcade extends MovieClip {
public var b_metro:MovieClip;
public var b_more:SimpleButton;
public var bestscore:TextField;
public var t_score_labell:TextField;
public var b_start:SimpleButton;
public var b_normal:MovieClip;
public var b_ranking:SimpleButton;
public var b_terraza:MovieClip;
public var b_armory:SimpleButton;
public var main_class:MovieClip;
public var b_hard:MovieClip;
public var descripcion:MovieClip;
public var b_calle:MovieClip;
public var b_back:SimpleButton;
public var b_options:SimpleButton;
public var b_easy:MovieClip;
public var maxgames:SimpleButton;
public var b_parque:MovieClip;
public function arcade(){
Globals.ZONA_PARTIDA = 1;
control_estado();
b_easy.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_normal.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_hard.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_parque.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_metro.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_calle.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_terraza.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_back.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_options.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_armory.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_start.addEventListener(MouseEvent.CLICK, on_button_clicked);
t_score_labell.visible = true;
bestscore.visible = true;
b_ranking.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_ranking.visible = true;
b_more.addEventListener(MouseEvent.CLICK, on_button_clicked);
maxgames.addEventListener(MouseEvent.CLICK, on_button_clicked);
}
public function on_button_out(_arg1:MouseEvent){
}
public function lanzar_juego(){
var _local1:Juego;
_local1 = new Juego(main_class);
_local1.main_class = main_class;
_local1.initialize();
main_class.abre_pantalla(new loading());
}
public function on_button_over(_arg1:MouseEvent){
switch (_arg1.target.name){
};
}
private function mostrarPuntuacion(_arg1:Array){
var o:Object;
var boardID:String;
var val = _arg1;
o = {n:val, f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
boardID = o.f(0, "");
MochiScores.showLeaderboard({boardID:boardID, onClose:function ():void{
}});
}
public function abrir_web_puntuaciones(){
switch (Globals.TIPO_PARTIDA){
case "survival":
mostrarPuntuacion([13, 12, 2, 6, 5, 10, 10, 15, 11, 7, 1, 0, 7, 14, 11, 5]);
break;
case "time_attack":
mostrarPuntuacion([5, 15, 10, 8, 14, 6, 11, 12, 5, 10, 11, 12, 5, 8, 6, 2]);
break;
case "defender":
mostrarPuntuacion([3, 1, 2, 9, 12, 14, 7, 11, 3, 14, 3, 1, 4, 12, 2, 10]);
break;
};
}
public function on_button_clicked(_arg1:MouseEvent){
switch (_arg1.currentTarget.name){
case "b_more":
Globals.webSponsor();
break;
case "maxgames":
Globals.webSponsor();
break;
case "b_back":
main_class.cierra_pantalla(this);
main_class.abre_pantalla(new principal(), "pelicula");
break;
case "b_armory":
main_class.abre_pantalla(new armeria(), "cortina");
break;
case "b_options":
main_class.abre_pantalla(new opciones(), "cortina");
break;
case "b_start":
lanzar_juego();
main_class.cierra_pantalla(this);
break;
case "b_easy":
Globals.DIFICULTAD_PARTIDA = Globals.EASY;
control_estado();
break;
case "b_normal":
Globals.DIFICULTAD_PARTIDA = Globals.NORMAL;
control_estado();
break;
case "b_hard":
Globals.DIFICULTAD_PARTIDA = Globals.HARD;
control_estado();
break;
case "b_parque":
Globals.ZONA_PARTIDA = 1;
control_estado();
break;
case "b_metro":
Globals.ZONA_PARTIDA = 2;
control_estado();
break;
case "b_calle":
Globals.ZONA_PARTIDA = 3;
control_estado();
break;
case "b_terraza":
Globals.ZONA_PARTIDA = 4;
control_estado();
break;
case "b_ranking":
abrir_web_puntuaciones();
break;
default:
trace((_arg1.target.name + " UNDEFINED"));
break;
};
}
public function control_estado(){
switch (Globals.TIPO_PARTIDA){
case "survival":
descripcion.gotoAndStop(1);
bestscore.text = ("" + Globals.SCORE_SURVIVAL);
break;
case "time_attack":
descripcion.gotoAndStop(2);
bestscore.text = ("" + Globals.SCORE_TIMEATTACK);
break;
case "defender":
descripcion.gotoAndStop(3);
bestscore.text = ("" + Globals.SCORE_DEFENDER);
break;
};
switch (Globals.DIFICULTAD_PARTIDA){
case Globals.EASY:
b_easy.gotoAndStop(2);
b_normal.gotoAndStop(1);
b_hard.gotoAndStop(1);
break;
case Globals.NORMAL:
b_easy.gotoAndStop(1);
b_normal.gotoAndStop(2);
b_hard.gotoAndStop(1);
break;
case Globals.HARD:
b_easy.gotoAndStop(1);
b_normal.gotoAndStop(1);
b_hard.gotoAndStop(2);
break;
};
switch (Globals.ZONA_PARTIDA){
case 1:
b_parque.gotoAndStop(2);
b_metro.gotoAndStop(1);
b_calle.gotoAndStop(1);
b_terraza.gotoAndStop(1);
break;
case 2:
b_parque.gotoAndStop(1);
b_metro.gotoAndStop(2);
b_calle.gotoAndStop(1);
b_terraza.gotoAndStop(1);
break;
case 3:
b_parque.gotoAndStop(1);
b_metro.gotoAndStop(1);
b_calle.gotoAndStop(2);
b_terraza.gotoAndStop(1);
break;
case 4:
b_parque.gotoAndStop(1);
b_metro.gotoAndStop(1);
b_calle.gotoAndStop(1);
b_terraza.gotoAndStop(2);
break;
};
}
}
}//package com.tanoku.MoreZombies
Section 80
//armeria (com.tanoku.MoreZombies.armeria)
package com.tanoku.MoreZombies {
import flash.events.*;
import flash.display.*;
import fl.motion.*;
import fl.transitions.*;
import flash.text.*;
import fl.transitions.easing.*;
public class armeria extends MovieClip {
public var b_craniumv2:MovieClip;
public var c_m60:MovieClip;
public var b_winchester:MovieClip;
public var c_extinguisher:MovieClip;
public var b_desert_eagle:MovieClip;
public var b_freezer_mine:MovieClip;
public var drop_melee:MovieClip;
public var b_spas12:MovieClip;
public var b_p90:MovieClip;
public var b_lightsaber:MovieClip;
public var b_ice_cream:MovieClip;
public var b_c_slot2:SimpleButton;
public var b_c_slot3:SimpleButton;
public var b_c_slot4:SimpleButton;
public var b_flamethrower:MovieClip;
public var b_c_slot1:SimpleButton;
public var b_colt_python:MovieClip;
public var mc_drag;
public var b_hot_dog_fork:MovieClip;
public var c_bat:MovieClip;
public var b_m249:MovieClip;
public var mc_drag_index:int;
public var b_m9:MovieClip;
public var b_claymore:MovieClip;
public var b_extinguisher:MovieClip;
public var b_tm46:MovieClip;
public var b_riding_crop:MovieClip;
public var b_m60:MovieClip;
public var alerta:TextField;
public var c_uzi:MovieClip;
public var c_ak47:MovieClip;
public var c_katana:MovieClip;
public var b_fim92a:MovieClip;
public var b_bone:MovieClip;
public var drop_slot2:MovieClip;
public var drop_slot3:MovieClip;
public var btn_no:MovieClip;
public var b_back:SimpleButton;
public var b_minigun:MovieClip;
public var drop_slot4:MovieClip;
public var b_m16a4:MovieClip;
public var c_usp45:MovieClip;
public var b_bat:MovieClip;
public var c_colt_python:MovieClip;
public var drop_slot1:MovieClip;
public var btn_yes:MovieClip;
public var b_fire_axe:MovieClip;
public var c_craniumv2:MovieClip;
public var b_chainsaw:MovieClip;
public var c_m9:MovieClip;
public var b_sponsword:MovieClip;
public var c_german_grenade:MovieClip;
public var mc_drag_x:Number;
public var c_ice_cream:MovieClip;
public var c_riding_crop:MovieClip;
public var c_m249:MovieClip;
public var colorTint:uint;// = 0
public var b_uzi:MovieClip;
public var c_spas12:MovieClip;
public var c_tm46:MovieClip;
public var c_bone:MovieClip;
public var c_mp5:MovieClip;
public var c_pineapple_grenade:MovieClip;
public var b_c4:MovieClip;
public var mc_drag_y:Number;
private var weaponShop:WeaponShop;
public var b_german_grenade:MovieClip;
public var b_censored_weapon:MovieClip;
public var c_censored_weapon:MovieClip;
public var b_pineapple_grenade:MovieClip;
public var c_winchester:MovieClip;
public var dragging:Boolean;// = false
public var main_class:MovieClip;
public var b_usp45:MovieClip;
public var alphaTint:Number;// = 0.7
public var c_fim92a:MovieClip;
public var c_aitso_canon:MovieClip;
public var b_aitso_canon:MovieClip;
public var c_lightsaber:MovieClip;
public var t_infinite_ammo:TextField;
public var c_claymore:MovieClip;
public var panel_armas:MovieClip;
public var b_mp5:MovieClip;
public var c_c4:MovieClip;
public var c_sponsword:MovieClip;
public var c_minigun:MovieClip;
public var c_p90:MovieClip;
public var c_freezer_mine:MovieClip;
public var descripcion:MovieClip;
public var c_desert_eagle:MovieClip;
public var b_katana:MovieClip;
public var b_options:SimpleButton;
public var c_fire_axe:MovieClip;
public var descripcion_locked:MovieClip;
public var c_chainsaw:MovieClip;
public var c_m16a4:MovieClip;
public var b_ak47:MovieClip;
public var c_hot_dog_fork:MovieClip;
public var c_flamethrower:MovieClip;
private var weaponManager:WeaponManager;
static var fade:Tween;
public function armeria(){
weaponManager = WeaponManager.getInstance();
weaponShop = WeaponShop.getInstance();
dragging = false;
colorTint = 0;
alphaTint = 0.7;
super();
iniciarArmeria();
}
function unloadListeners(){
removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
removeEventListener(MouseEvent.MOUSE_UP, onMouse_Up);
c_m9.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_m9.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_m9.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_m9.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_m9.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_usp45.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_usp45.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_usp45.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_usp45.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_usp45.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_colt_python.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_colt_python.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_colt_python.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_colt_python.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_colt_python.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_desert_eagle.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_desert_eagle.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_desert_eagle.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_desert_eagle.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_desert_eagle.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_uzi.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_uzi.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_uzi.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_uzi.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_uzi.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_spas12.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_spas12.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_spas12.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_spas12.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_spas12.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_winchester.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_winchester.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_winchester.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_winchester.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_winchester.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_ak47.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_ak47.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_ak47.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_ak47.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_ak47.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_mp5.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_mp5.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_mp5.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_mp5.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_mp5.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_p90.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_p90.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_p90.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_p90.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_p90.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_m16a4.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_m16a4.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_m16a4.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_m16a4.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_m16a4.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_minigun.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_minigun.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_minigun.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_minigun.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_minigun.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_m60.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_m60.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_m60.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_m60.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_m60.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_m249.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_m249.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_m249.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_m249.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_m249.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_fim92a.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_fim92a.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_fim92a.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_fim92a.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_fim92a.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_aitso_canon.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_aitso_canon.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_aitso_canon.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_aitso_canon.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_aitso_canon.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_chainsaw.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_chainsaw.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_chainsaw.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_chainsaw.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_chainsaw.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_flamethrower.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_flamethrower.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_flamethrower.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_flamethrower.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_flamethrower.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_extinguisher.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_extinguisher.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_extinguisher.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_extinguisher.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_extinguisher.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_german_grenade.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_german_grenade.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_german_grenade.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_german_grenade.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_german_grenade.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_pineapple_grenade.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_pineapple_grenade.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_pineapple_grenade.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_pineapple_grenade.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_pineapple_grenade.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_claymore.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_claymore.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_claymore.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_claymore.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_claymore.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_tm46.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_tm46.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_tm46.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_tm46.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_tm46.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_c4.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_c4.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_c4.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_c4.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_c4.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_craniumv2.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_craniumv2.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_craniumv2.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_craniumv2.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_craniumv2.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_freezer_mine.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_freezer_mine.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_freezer_mine.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_freezer_mine.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_freezer_mine.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_katana.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_katana.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_katana.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_katana.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_katana.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_fire_axe.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_fire_axe.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_fire_axe.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_fire_axe.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_fire_axe.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_censored_weapon.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_censored_weapon.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_censored_weapon.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_censored_weapon.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_censored_weapon.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_bat.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_bat.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_bat.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_bat.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_bat.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_hot_dog_fork.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_hot_dog_fork.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_hot_dog_fork.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_hot_dog_fork.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_hot_dog_fork.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_ice_cream.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_ice_cream.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_ice_cream.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_ice_cream.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_ice_cream.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_lightsaber.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_lightsaber.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_lightsaber.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_lightsaber.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_lightsaber.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_riding_crop.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_riding_crop.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_riding_crop.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_riding_crop.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_riding_crop.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_bone.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_bone.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_bone.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_bone.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_bone.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
c_sponsword.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_sponsword.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_sponsword.removeEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_sponsword.removeEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_sponsword.removeEventListener(MouseEvent.MOUSE_OUT, on_button_out);
b_c_slot1.removeEventListener(MouseEvent.CLICK, on_button_clicked);
b_c_slot2.removeEventListener(MouseEvent.CLICK, on_button_clicked);
b_c_slot3.removeEventListener(MouseEvent.CLICK, on_button_clicked);
b_c_slot4.removeEventListener(MouseEvent.CLICK, on_button_clicked);
b_options.removeEventListener(MouseEvent.CLICK, on_button_clicked);
b_back.removeEventListener(MouseEvent.CLICK, on_button_clicked);
btn_yes.removeEventListener(MouseEvent.CLICK, on_button_clicked);
btn_no.removeEventListener(MouseEvent.CLICK, on_button_clicked);
}
function controlMunicionInfinita(){
if (Globals.MunicionInfinita == true){
btn_yes.gotoAndStop(2);
btn_no.gotoAndStop(1);
} else {
btn_yes.gotoAndStop(1);
btn_no.gotoAndStop(2);
};
estado_panel_armas();
}
private function manejarCompraObjeto(_arg1:Event):void{
Globals.saveManager.update();
actualizaArmeria();
}
function estado_panel_armas(){
panel_armas.arma_melee.gotoAndStop(1);
panel_armas.arma_slot1.gotoAndStop(1);
panel_armas.arma_slot2.gotoAndStop(1);
panel_armas.arma_slot3.gotoAndStop(1);
panel_armas.arma_slot4.gotoAndStop(1);
panel_armas.municion_slot1.text = "x0";
panel_armas.municion_slot2.text = "x0";
panel_armas.municion_slot3.text = "x0";
panel_armas.municion_slot4.text = "x0";
panel_armas.estado_melee.visible = false;
panel_armas.estado_slot1.visible = false;
panel_armas.estado_slot2.visible = false;
panel_armas.estado_slot3.visible = false;
panel_armas.estado_slot4.visible = false;
if (weaponManager.weaponList[0] != null){
panel_armas.arma_melee.gotoAndStop(weaponManager.weaponList[0].index);
};
if (weaponManager.weaponList[1] != null){
panel_armas.arma_slot1.gotoAndStop(weaponManager.weaponList[1].index);
if (Globals.MunicionInfinita == true){
panel_armas.municion_slot1.text = "x inf.";
} else {
panel_armas.municion_slot1.text = ("x" + weaponManager.weaponList[1].current_ammo);
};
};
if (weaponManager.weaponList[2] != null){
panel_armas.arma_slot2.gotoAndStop(weaponManager.weaponList[2].index);
if (Globals.MunicionInfinita == true){
panel_armas.municion_slot2.text = "x inf.";
} else {
panel_armas.municion_slot2.text = ("x" + weaponManager.weaponList[2].current_ammo);
};
};
if (weaponManager.weaponList[3] != null){
panel_armas.arma_slot3.gotoAndStop(weaponManager.weaponList[3].index);
if (Globals.MunicionInfinita == true){
panel_armas.municion_slot3.text = "x inf.";
} else {
panel_armas.municion_slot3.text = ("x" + weaponManager.weaponList[3].current_ammo);
};
};
if (weaponManager.weaponList[4] != null){
panel_armas.arma_slot4.gotoAndStop(weaponManager.weaponList[4].index);
if (Globals.MunicionInfinita == true){
panel_armas.municion_slot4.text = "x inf.";
} else {
panel_armas.municion_slot4.text = ("x" + weaponManager.weaponList[4].current_ammo);
};
};
}
public function comprobarArmas(_arg1:String){
if (Globals.arma_slot1 == _arg1){
Globals.arma_slot1 = "";
};
if (Globals.arma_slot2 == _arg1){
Globals.arma_slot2 = "";
};
if (Globals.arma_slot3 == _arg1){
Globals.arma_slot3 = "";
};
if (Globals.arma_slot4 == _arg1){
Globals.arma_slot4 = "";
};
}
private function manejarIngresoGamerSafe(_arg1:Event):void{
Globals.saveManager.update();
actualizaArmeria();
}
public function on_button_clicked(_arg1:MouseEvent){
switch (_arg1.currentTarget.name){
case "b_c_slot1":
Globals.arma_slot1 = "";
weaponManager.loadWeapons();
estado_panel_armas();
break;
case "b_c_slot2":
Globals.arma_slot2 = "";
weaponManager.loadWeapons();
estado_panel_armas();
break;
case "b_c_slot3":
Globals.arma_slot3 = "";
weaponManager.loadWeapons();
estado_panel_armas();
break;
case "b_c_slot4":
Globals.arma_slot4 = "";
weaponManager.loadWeapons();
estado_panel_armas();
break;
case "b_back":
unloadListeners();
main_class.cierra_pantalla(this, "cortina");
break;
case "b_options":
main_class.abre_pantalla(new opciones(), "cortina");
break;
case "btn_yes":
Globals.MunicionInfinita = true;
controlMunicionInfinita();
break;
case "btn_no":
Globals.MunicionInfinita = false;
controlMunicionInfinita();
break;
default:
trace((_arg1.target.name + " UNDEFINED"));
break;
};
}
public function on_button_out(_arg1:MouseEvent){
descripcion.gotoAndStop(1);
descripcion_locked.gotoAndStop(1);
}
public function addTint(_arg1:MovieClip, _arg2:uint, _arg3:Number):void{
var _local4:Color;
_local4 = new Color();
_local4.setTint(_arg2, _arg3);
_arg1.transform.colorTransform = _local4;
}
function onMouse_Down(_arg1:Event):void{
alerta.text = "";
mc_drag = new weapons_buttons_array();
mc_drag.x = _arg1.currentTarget.x;
mc_drag.y = _arg1.currentTarget.y;
mc_drag_index = descripcion.currentFrame;
mc_drag.gotoAndStop(mc_drag_index);
addChildAt(mc_drag, (numChildren - 1));
mc_drag.alpha = 0.5;
mc_drag.startDrag();
dragging = true;
}
public function on_button_over(_arg1:MouseEvent){
switch (_arg1.currentTarget.name){
case "b_m9":
descripcion.gotoAndStop(2);
break;
case "c_m9":
descripcion_locked.gotoAndStop(2);
break;
case "b_usp45":
descripcion.gotoAndStop(3);
break;
case "c_usp45":
descripcion_locked.gotoAndStop(3);
break;
case "b_colt_python":
descripcion.gotoAndStop(4);
break;
case "c_colt_python":
descripcion_locked.gotoAndStop(4);
break;
case "b_desert_eagle":
descripcion.gotoAndStop(5);
break;
case "c_desert_eagle":
descripcion_locked.gotoAndStop(5);
break;
case "b_uzi":
descripcion.gotoAndStop(6);
break;
case "c_uzi":
descripcion_locked.gotoAndStop(6);
break;
case "b_spas12":
descripcion.gotoAndStop(7);
break;
case "c_spas12":
descripcion_locked.gotoAndStop(7);
break;
case "b_winchester":
descripcion.gotoAndStop(8);
break;
case "c_winchester":
descripcion_locked.gotoAndStop(8);
break;
case "b_ak47":
descripcion.gotoAndStop(9);
break;
case "c_ak47":
descripcion_locked.gotoAndStop(9);
break;
case "b_mp5":
descripcion.gotoAndStop(10);
break;
case "c_mp5":
descripcion_locked.gotoAndStop(10);
break;
case "b_p90":
descripcion.gotoAndStop(11);
break;
case "c_p90":
descripcion_locked.gotoAndStop(11);
break;
case "b_m16a4":
descripcion.gotoAndStop(12);
break;
case "c_m16a4":
descripcion_locked.gotoAndStop(12);
break;
case "b_minigun":
descripcion.gotoAndStop(13);
break;
case "c_minigun":
descripcion_locked.gotoAndStop(13);
break;
case "b_m60":
descripcion.gotoAndStop(14);
break;
case "c_m60":
descripcion_locked.gotoAndStop(14);
break;
case "b_m249":
descripcion.gotoAndStop(15);
break;
case "c_m249":
descripcion_locked.gotoAndStop(15);
break;
case "b_fim92a":
descripcion.gotoAndStop(16);
break;
case "c_fim92a":
descripcion_locked.gotoAndStop(16);
break;
case "b_aitso_canon":
descripcion.gotoAndStop(17);
break;
case "c_aitso_canon":
descripcion_locked.gotoAndStop(17);
break;
case "b_chainsaw":
descripcion.gotoAndStop(18);
break;
case "c_chainsaw":
descripcion_locked.gotoAndStop(18);
break;
case "b_flamethrower":
descripcion.gotoAndStop(19);
break;
case "c_flamethrower":
descripcion_locked.gotoAndStop(19);
break;
case "b_extinguisher":
descripcion.gotoAndStop(20);
break;
case "c_extinguisher":
descripcion_locked.gotoAndStop(20);
break;
case "b_german_grenade":
descripcion.gotoAndStop(21);
break;
case "c_german_grenade":
descripcion_locked.gotoAndStop(21);
break;
case "b_pineapple_grenade":
descripcion.gotoAndStop(22);
break;
case "c_pineapple_grenade":
descripcion_locked.gotoAndStop(22);
break;
case "b_claymore":
descripcion.gotoAndStop(23);
break;
case "c_claymore":
descripcion_locked.gotoAndStop(23);
break;
case "b_tm46":
descripcion.gotoAndStop(24);
break;
case "c_tm46":
descripcion_locked.gotoAndStop(24);
break;
case "b_c4":
descripcion.gotoAndStop(25);
break;
case "c_c4":
descripcion_locked.gotoAndStop(25);
break;
case "b_craniumv2":
descripcion.gotoAndStop(26);
break;
case "c_craniumv2":
descripcion_locked.gotoAndStop(26);
break;
case "b_freezer_mine":
descripcion.gotoAndStop(27);
break;
case "c_freezer_mine":
descripcion_locked.gotoAndStop(27);
break;
case "b_katana":
descripcion.gotoAndStop(28);
break;
case "c_katana":
descripcion_locked.gotoAndStop(28);
break;
case "b_fire_axe":
descripcion.gotoAndStop(29);
break;
case "c_fire_axe":
descripcion_locked.gotoAndStop(29);
break;
case "b_censored_weapon":
descripcion.gotoAndStop(30);
break;
case "c_censored_weapon":
descripcion_locked.gotoAndStop(30);
break;
case "b_bat":
descripcion.gotoAndStop(31);
break;
case "c_bat":
descripcion_locked.gotoAndStop(31);
break;
case "b_hot_dog_fork":
descripcion.gotoAndStop(32);
break;
case "c_bat":
descripcion_locked.gotoAndStop(31);
break;
case "b_ice_cream":
descripcion.gotoAndStop(33);
break;
case "c_ice_cream":
descripcion_locked.gotoAndStop(33);
break;
case "b_lightsaber":
descripcion.gotoAndStop(34);
break;
case "c_lightsaber":
descripcion_locked.gotoAndStop(34);
break;
case "b_riding_crop":
descripcion.gotoAndStop(35);
break;
case "c_riding_crop":
descripcion_locked.gotoAndStop(35);
break;
case "b_bone":
descripcion.gotoAndStop(36);
break;
case "c_bone":
descripcion_locked.gotoAndStop(36);
break;
case "b_sponsword":
descripcion.gotoAndStop(37);
break;
case "c_sponsword":
descripcion_locked.gotoAndStop(37);
break;
};
}
private function actualizaArmeria(){
weaponManager.resetWeapons();
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(2)))){
c_m9.visible = true;
addTint(b_m9, colorTint, alphaTint);
} else {
addTint(b_m9, colorTint, 0);
c_m9.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(3)))){
c_usp45.visible = true;
addTint(b_usp45, colorTint, alphaTint);
} else {
addTint(b_usp45, colorTint, 0);
c_usp45.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(4)))){
c_colt_python.visible = true;
addTint(b_colt_python, colorTint, alphaTint);
} else {
addTint(b_colt_python, colorTint, 0);
c_colt_python.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(5)))){
c_desert_eagle.visible = true;
addTint(b_desert_eagle, colorTint, alphaTint);
} else {
addTint(b_desert_eagle, colorTint, 0);
c_desert_eagle.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(6)))){
c_uzi.visible = true;
addTint(b_uzi, colorTint, alphaTint);
} else {
addTint(b_uzi, colorTint, 0);
c_uzi.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(7)))){
c_spas12.visible = true;
addTint(b_spas12, colorTint, alphaTint);
} else {
addTint(b_spas12, colorTint, 0);
c_spas12.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(8)))){
c_winchester.visible = true;
addTint(b_winchester, colorTint, alphaTint);
} else {
addTint(b_winchester, colorTint, 0);
c_winchester.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(9)))){
c_ak47.visible = true;
addTint(b_ak47, colorTint, alphaTint);
} else {
addTint(b_ak47, colorTint, 0);
c_ak47.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(10)))){
c_mp5.visible = true;
addTint(b_mp5, colorTint, alphaTint);
} else {
addTint(b_mp5, colorTint, 0);
c_mp5.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(11)))){
c_p90.visible = true;
addTint(b_p90, colorTint, alphaTint);
} else {
addTint(b_p90, colorTint, 0);
c_p90.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(12)))){
c_m16a4.visible = true;
addTint(b_m16a4, colorTint, alphaTint);
} else {
addTint(b_m16a4, colorTint, 0);
c_m16a4.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(13)))){
c_minigun.visible = true;
addTint(b_minigun, colorTint, alphaTint);
} else {
addTint(b_minigun, colorTint, 0);
c_minigun.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(14)))){
c_m60.visible = true;
addTint(b_m60, colorTint, alphaTint);
} else {
addTint(b_m60, colorTint, 0);
c_m60.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(15)))){
c_m249.visible = true;
addTint(b_m249, colorTint, alphaTint);
} else {
addTint(b_m249, colorTint, 0);
c_m249.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(16)))){
c_fim92a.visible = true;
addTint(b_fim92a, colorTint, alphaTint);
} else {
addTint(b_fim92a, colorTint, 0);
c_fim92a.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(17)))){
c_aitso_canon.visible = true;
addTint(b_aitso_canon, colorTint, alphaTint);
} else {
addTint(b_aitso_canon, colorTint, 0);
c_aitso_canon.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(18)))){
c_chainsaw.visible = true;
addTint(b_chainsaw, colorTint, alphaTint);
} else {
addTint(b_chainsaw, colorTint, 0);
c_chainsaw.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(19)))){
c_flamethrower.visible = true;
addTint(b_flamethrower, colorTint, alphaTint);
} else {
addTint(b_flamethrower, colorTint, 0);
c_flamethrower.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(20)))){
c_extinguisher.visible = true;
addTint(b_extinguisher, colorTint, alphaTint);
} else {
addTint(b_extinguisher, colorTint, 0);
c_extinguisher.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(21)))){
c_german_grenade.visible = true;
addTint(b_german_grenade, colorTint, alphaTint);
} else {
addTint(b_german_grenade, colorTint, 0);
c_german_grenade.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(22)))){
c_pineapple_grenade.visible = true;
addTint(b_pineapple_grenade, colorTint, alphaTint);
} else {
addTint(b_pineapple_grenade, colorTint, 0);
c_pineapple_grenade.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(23)))){
c_claymore.visible = true;
addTint(b_claymore, colorTint, alphaTint);
} else {
addTint(b_claymore, colorTint, 0);
c_claymore.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(24)))){
c_tm46.visible = true;
addTint(b_tm46, colorTint, alphaTint);
} else {
addTint(b_tm46, colorTint, 0);
c_tm46.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(25)))){
c_c4.visible = true;
addTint(b_c4, colorTint, alphaTint);
} else {
addTint(b_c4, colorTint, 0);
c_c4.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(26)))){
c_craniumv2.visible = true;
addTint(b_craniumv2, colorTint, alphaTint);
} else {
addTint(b_craniumv2, colorTint, 0);
c_craniumv2.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(27)))){
c_freezer_mine.visible = true;
addTint(b_freezer_mine, colorTint, alphaTint);
} else {
addTint(b_freezer_mine, colorTint, 0);
c_freezer_mine.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(28)))){
c_katana.visible = true;
addTint(b_katana, colorTint, alphaTint);
} else {
addTint(b_katana, colorTint, 0);
c_katana.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(29)))){
c_fire_axe.visible = true;
addTint(b_fire_axe, colorTint, alphaTint);
} else {
addTint(b_fire_axe, colorTint, 0);
c_fire_axe.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(30)))){
c_censored_weapon.visible = true;
addTint(b_censored_weapon, colorTint, alphaTint);
} else {
addTint(b_censored_weapon, colorTint, 0);
c_censored_weapon.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(31)))){
c_bat.visible = true;
addTint(b_bat, colorTint, alphaTint);
} else {
addTint(b_bat, colorTint, 0);
c_bat.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(32)))){
c_hot_dog_fork.visible = true;
addTint(b_hot_dog_fork, colorTint, alphaTint);
} else {
addTint(b_hot_dog_fork, colorTint, 0);
c_hot_dog_fork.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(33)))){
c_ice_cream.visible = true;
addTint(b_ice_cream, colorTint, alphaTint);
} else {
addTint(b_ice_cream, colorTint, 0);
c_ice_cream.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(34)))){
c_lightsaber.visible = true;
addTint(b_lightsaber, colorTint, alphaTint);
} else {
addTint(b_lightsaber, colorTint, 0);
c_lightsaber.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(35)))){
c_riding_crop.visible = true;
addTint(b_riding_crop, colorTint, alphaTint);
} else {
addTint(b_riding_crop, colorTint, 0);
c_riding_crop.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(36)))){
c_bone.visible = true;
addTint(b_bone, colorTint, alphaTint);
} else {
addTint(b_bone, colorTint, 0);
c_bone.visible = false;
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(37)))){
c_sponsword.visible = true;
addTint(b_sponsword, colorTint, alphaTint);
} else {
addTint(b_sponsword, colorTint, 0);
c_sponsword.visible = false;
};
descripcion.gotoAndStop(1);
descripcion_locked.gotoAndStop(1);
estado_panel_armas();
alerta.text = "";
if (AchievementManager.ach_InfiniteAmmo == true){
t_infinite_ammo.visible = true;
btn_yes.visible = true;
btn_no.visible = true;
} else {
t_infinite_ammo.visible = false;
btn_yes.visible = false;
btn_no.visible = false;
};
controlMunicionInfinita();
}
private function iniciarArmeria(){
weaponManager.resetWeapons();
addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
addEventListener(MouseEvent.MOUSE_UP, onMouse_Up);
mc_drag = null;
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(2)))){
c_m9.visible = true;
c_m9.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_m9.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_m9, colorTint, alphaTint);
} else {
c_m9.visible = false;
b_m9.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_m9.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_m9.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(3)))){
c_usp45.visible = true;
c_usp45.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_usp45.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_usp45, colorTint, alphaTint);
} else {
c_usp45.visible = false;
b_usp45.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_usp45.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_usp45.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(4)))){
c_colt_python.visible = true;
c_colt_python.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_colt_python.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_colt_python, colorTint, alphaTint);
} else {
c_colt_python.visible = false;
b_colt_python.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_colt_python.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_colt_python.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(5)))){
c_desert_eagle.visible = true;
c_desert_eagle.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_desert_eagle.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_desert_eagle, colorTint, alphaTint);
} else {
c_desert_eagle.visible = false;
b_desert_eagle.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_desert_eagle.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_desert_eagle.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(6)))){
c_uzi.visible = true;
c_uzi.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_uzi.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_uzi, colorTint, alphaTint);
} else {
c_uzi.visible = false;
b_uzi.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_uzi.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_uzi.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(7)))){
c_spas12.visible = true;
c_spas12.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_spas12.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_spas12, colorTint, alphaTint);
} else {
c_spas12.visible = false;
b_spas12.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_spas12.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_spas12.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(8)))){
c_winchester.visible = true;
c_winchester.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_winchester.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_winchester, colorTint, alphaTint);
} else {
c_winchester.visible = false;
b_winchester.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_winchester.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_winchester.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(9)))){
c_ak47.visible = true;
c_ak47.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_ak47.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_ak47, colorTint, alphaTint);
} else {
c_ak47.visible = false;
b_ak47.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_ak47.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_ak47.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(10)))){
c_mp5.visible = true;
c_mp5.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_mp5.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_mp5, colorTint, alphaTint);
} else {
c_mp5.visible = false;
b_mp5.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_mp5.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_mp5.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(11)))){
c_p90.visible = true;
c_p90.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_p90.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_p90, colorTint, alphaTint);
} else {
c_p90.visible = false;
b_p90.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_p90.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_p90.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(12)))){
c_m16a4.visible = true;
c_m16a4.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_m16a4.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_m16a4, colorTint, alphaTint);
} else {
c_m16a4.visible = false;
b_m16a4.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_m16a4.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_m16a4.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(13)))){
c_minigun.visible = true;
c_minigun.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_minigun.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_minigun, colorTint, alphaTint);
} else {
c_minigun.visible = false;
b_minigun.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_minigun.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_minigun.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(14)))){
c_m60.visible = true;
c_m60.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_m60.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_m60, colorTint, alphaTint);
} else {
c_m60.visible = false;
b_m60.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_m60.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_m60.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(15)))){
c_m249.visible = true;
c_m249.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_m249.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_m249, colorTint, alphaTint);
} else {
c_m249.visible = false;
b_m249.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_m249.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_m249.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(16)))){
c_fim92a.visible = true;
c_fim92a.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_fim92a.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_fim92a, colorTint, alphaTint);
} else {
c_fim92a.visible = false;
b_fim92a.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_fim92a.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_fim92a.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(17)))){
c_aitso_canon.visible = true;
c_aitso_canon.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_aitso_canon.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_aitso_canon, colorTint, alphaTint);
} else {
c_aitso_canon.visible = false;
b_aitso_canon.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_aitso_canon.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_aitso_canon.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(18)))){
c_chainsaw.visible = true;
c_chainsaw.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_chainsaw.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_chainsaw, colorTint, alphaTint);
} else {
c_chainsaw.visible = false;
b_chainsaw.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_chainsaw.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_chainsaw.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(19)))){
c_flamethrower.visible = true;
c_flamethrower.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_flamethrower.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_flamethrower, colorTint, alphaTint);
} else {
c_flamethrower.visible = false;
b_flamethrower.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_flamethrower.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_flamethrower.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(20)))){
c_extinguisher.visible = true;
c_extinguisher.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_extinguisher.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_extinguisher, colorTint, alphaTint);
} else {
c_extinguisher.visible = false;
b_extinguisher.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_extinguisher.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_extinguisher.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(21)))){
c_german_grenade.visible = true;
c_german_grenade.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_german_grenade.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_german_grenade, colorTint, alphaTint);
} else {
c_german_grenade.visible = false;
b_german_grenade.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_german_grenade.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_german_grenade.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(22)))){
c_pineapple_grenade.visible = true;
c_pineapple_grenade.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_pineapple_grenade.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_pineapple_grenade, colorTint, alphaTint);
} else {
c_pineapple_grenade.visible = false;
b_pineapple_grenade.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_pineapple_grenade.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_pineapple_grenade.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(23)))){
c_claymore.visible = true;
c_claymore.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_claymore.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_claymore, colorTint, alphaTint);
} else {
c_claymore.visible = false;
b_claymore.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_claymore.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_claymore.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(24)))){
c_tm46.visible = true;
c_tm46.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_tm46.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_tm46, colorTint, alphaTint);
} else {
c_tm46.visible = false;
b_tm46.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_tm46.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_tm46.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(25)))){
c_c4.visible = true;
c_c4.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_c4.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_c4, colorTint, alphaTint);
} else {
c_c4.visible = false;
b_c4.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_c4.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_c4.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(26)))){
c_craniumv2.visible = true;
c_craniumv2.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_craniumv2.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_craniumv2, colorTint, alphaTint);
} else {
c_craniumv2.visible = false;
b_craniumv2.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_craniumv2.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_craniumv2.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(27)))){
c_freezer_mine.visible = true;
c_freezer_mine.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_freezer_mine.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_freezer_mine, colorTint, alphaTint);
} else {
c_freezer_mine.visible = false;
b_freezer_mine.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_freezer_mine.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_freezer_mine.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(28)))){
c_katana.visible = true;
c_katana.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_katana.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_katana, colorTint, alphaTint);
} else {
c_katana.visible = false;
b_katana.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_katana.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_katana.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(29)))){
c_fire_axe.visible = true;
c_fire_axe.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_fire_axe.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_fire_axe, colorTint, alphaTint);
} else {
c_fire_axe.visible = false;
b_fire_axe.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_fire_axe.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_fire_axe.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(30)))){
c_censored_weapon.visible = true;
c_censored_weapon.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_censored_weapon.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_censored_weapon, colorTint, alphaTint);
} else {
c_censored_weapon.visible = false;
b_censored_weapon.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_censored_weapon.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_censored_weapon.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(31)))){
c_bat.visible = true;
c_bat.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_bat.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_bat, colorTint, alphaTint);
} else {
c_bat.visible = false;
b_bat.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_bat.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_bat.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(32)))){
c_hot_dog_fork.visible = true;
c_hot_dog_fork.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_hot_dog_fork.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_hot_dog_fork, colorTint, alphaTint);
} else {
c_hot_dog_fork.visible = false;
b_hot_dog_fork.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_hot_dog_fork.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_hot_dog_fork.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(33)))){
c_ice_cream.visible = true;
c_ice_cream.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_ice_cream.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_ice_cream, colorTint, alphaTint);
} else {
c_ice_cream.visible = false;
b_ice_cream.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_ice_cream.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_ice_cream.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(34)))){
c_lightsaber.visible = true;
c_lightsaber.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_lightsaber.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_lightsaber, colorTint, alphaTint);
} else {
c_lightsaber.visible = false;
b_lightsaber.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_lightsaber.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_lightsaber.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(35)))){
c_riding_crop.visible = true;
c_riding_crop.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_riding_crop.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_riding_crop, colorTint, alphaTint);
} else {
c_riding_crop.visible = false;
b_riding_crop.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_riding_crop.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_riding_crop.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(36)))){
c_bone.visible = true;
c_bone.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_bone.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_bone, colorTint, alphaTint);
} else {
c_bone.visible = false;
b_bone.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_bone.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_bone.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
if ((((AchievementManager.ach_AllWeapons == false)) && (weaponShop.weaponLocked(37)))){
c_sponsword.visible = true;
c_sponsword.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
c_sponsword.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
addTint(b_sponsword, colorTint, alphaTint);
} else {
c_sponsword.visible = false;
b_sponsword.addEventListener(MouseEvent.MOUSE_DOWN, onMouse_Down);
b_sponsword.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_sponsword.addEventListener(MouseEvent.MOUSE_OUT, on_button_out);
};
b_c_slot1.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_c_slot2.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_c_slot3.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_c_slot4.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_options.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_back.addEventListener(MouseEvent.CLICK, on_button_clicked);
descripcion.gotoAndStop(1);
descripcion_locked.gotoAndStop(1);
estado_panel_armas();
alerta.text = "";
if (AchievementManager.ach_InfiniteAmmo == true){
t_infinite_ammo.visible = true;
btn_yes.addEventListener(MouseEvent.CLICK, on_button_clicked);
btn_yes.visible = true;
btn_no.addEventListener(MouseEvent.CLICK, on_button_clicked);
btn_no.visible = true;
} else {
t_infinite_ammo.visible = false;
btn_yes.visible = false;
btn_no.visible = false;
};
controlMunicionInfinita();
}
function onMouse_Up(_arg1:Event):void{
var _local2:int;
if (dragging){
_local2 = (mc_drag_index - 1);
alerta.text = "";
if (drop_melee.hitTestObject(mc_drag)){
if (_local2 <= 26){
alerta.text = "ONLY MELEE WEAPONS ALLOWED";
} else {
Globals.arma_melee = weaponShop.weaponList[_local2].name;
weaponManager.loadWeapons();
estado_panel_armas();
};
};
if (drop_slot1.hitTestObject(mc_drag)){
if (_local2 > 26){
alerta.text = "MELEE WEAPON NOT ALLOWED";
} else {
comprobarArmas(weaponShop.weaponList[_local2].name);
Globals.arma_slot1 = weaponShop.weaponList[_local2].name;
weaponManager.loadWeapons();
estado_panel_armas();
};
};
if (drop_slot2.hitTestObject(mc_drag)){
if (_local2 > 26){
alerta.text = "MELEE WEAPON NOT ALLOWED";
} else {
comprobarArmas(weaponShop.weaponList[_local2].name);
Globals.arma_slot2 = weaponShop.weaponList[_local2].name;
weaponManager.loadWeapons();
estado_panel_armas();
};
};
if (drop_slot3.hitTestObject(mc_drag)){
if (_local2 > 26){
alerta.text = "MELEE WEAPON NOT ALLOWED";
} else {
comprobarArmas(weaponShop.weaponList[_local2].name);
Globals.arma_slot3 = weaponShop.weaponList[_local2].name;
weaponManager.loadWeapons();
estado_panel_armas();
};
};
if (drop_slot4.hitTestObject(mc_drag)){
if (_local2 > 26){
alerta.text = "MELEE WEAPON NOT ALLOWED";
} else {
comprobarArmas(weaponShop.weaponList[_local2].name);
Globals.arma_slot4 = weaponShop.weaponList[_local2].name;
weaponManager.loadWeapons();
estado_panel_armas();
};
};
mc_drag_index = 0;
mc_drag.stopDrag();
removeChild(mc_drag);
dragging = false;
dispatchEvent(new Event(WeaponManager.UPDATE));
};
}
}
}//package com.tanoku.MoreZombies
Section 81
//Bidon (com.tanoku.MoreZombies.Bidon)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import flash.events.*;
import flash.display.*;
import gs.*;
import flash.geom.*;
import flash.utils.*;
public class Bidon extends MovieClip {
public var max_life:Number;// = 0
public var life:Number;// = 0
public var time_lifebar:Number;// = 2000
public var mostrar_lifebar:Boolean;// = false
public var m_iterations:Number;// = 10
public var next_lifebar:Number;// = 0
public var b:b2Body;
private var depthManager:DepthManager;
public var m_world:b2World;
public var diferencia_altura:Number;// = 50
public var playerObj;
public var remove:Boolean;// = false
public var lifebar:MovieClip;
private var contenedor:MovieClip;
public var body:MovieClip;
private var soundManager:SoundManager;
public var dir;// = 0
public var indice_estado:int;// = 1
public var m_timestep:Number;// = 0.0333333333333333
public var freezed:Boolean;// = true
public var alive:Boolean;// = true
public var layer_ground_mc:MovieClip;
public var m_phys_scale:Number;// = 30
public function Bidon(_arg1:MovieClip=null):void{
m_phys_scale = 30;
m_timestep = (1 / 30);
m_iterations = 10;
depthManager = DepthManager.getInstance();
soundManager = SoundManager.getInstance();
alive = true;
remove = false;
life = 0;
max_life = 0;
diferencia_altura = 50;
freezed = true;
indice_estado = 1;
mostrar_lifebar = false;
time_lifebar = 2000;
next_lifebar = 0;
dir = 0;
super();
addFrameScript(0, frame1);
stop();
if (_arg1 != null){
contenedor = _arg1;
};
}
public function calcular_estado(){
var _local1:Number;
_local1 = 0;
if (life > 0){
_local1 = (max_life * 0.75);
if (life >= _local1){
indice_estado = 1;
};
_local1 = (max_life * 0.5);
if (life >= _local1){
indice_estado = 2;
};
if (life < _local1){
indice_estado = 3;
};
} else {
body.gotoAndStop("destruir");
soundManager.playSound("bidon_destruir", 1, 1);
alive = false;
Globals.BARRILES_RESTANTES = (Globals.BARRILES_RESTANTES - 1);
lifebar.visible = false;
TweenMax.to(this, 1, {colorMatrixFilter:{colorize:0, amount:0.2, contrast:0.8, brightness:0.8, saturation:0.4, hue:10}});
};
}
public function finalize(){
ocultar_vida();
remove = true;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
removeEventListener(Juego.FINALIZE, finalize);
delete ??getglobalscope
[this];
Globals.deleteNow(this);
}
public function AddStaticBox(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
var _local5:b2BodyDef;
var _local6:b2PolygonDef;
_local5 = new b2BodyDef();
_local5.position.Set(_arg1, _arg2);
_local5.angle = 0.75;
_local6 = new b2PolygonDef();
_local6.SetAsBox(_arg3, _arg4);
_local6.density = 0;
b = m_world.CreateBody(_local5);
b.CreateShape(_local6);
b.SetMassFromShapes();
}
public function ocultar_vida(){
TweenLite.to(lifebar, 0.5, {alpha:0, onComplete:onFinishTween_Ocultar});
}
public function destruido(){
if (Globals.Colisiones){
m_world.DestroyBody(b);
b = null;
};
copiar(this);
}
private function onFinishTween_Ocultar():void{
trace("fin ocultarla");
next_lifebar = 0;
lifebar.visible = false;
}
function frame1(){
stop();
}
private function handleAnim(){
}
public function brain_explode(_arg1):void{
}
public function initialize():void{
life = 100;
max_life = life;
Globals.BARRILES_RESTANTES = (Globals.BARRILES_RESTANTES + 1);
body.gotoAndStop("normal");
depthManager.addObject(this);
if (Globals.Colisiones){
AddStaticBox((x / m_phys_scale), ((y - 15) / m_phys_scale), (15 / m_phys_scale), (15 / m_phys_scale));
};
lifebar.visible = false;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
addEventListener(Juego.FINALIZE, finalize);
}
private function onFinishTween_Mostrar():void{
}
public function freeze(_arg1):void{
}
public function mostrar_vida(){
if (lifebar.visible == false){
lifebar.alpha = 0;
};
lifebar.visible = true;
TweenLite.to(lifebar, 0.5, {alpha:1, onComplete:onFinishTween_Mostrar});
}
public function recieveDamage(_arg1, _arg2:Boolean=true){
var _local3:Number;
var _local4:int;
if (alive){
if (((!((_arg1.tipo == Globals.EXTINGUISHER))) && (!((_arg1.tipo == Globals.FREEZE_MINE))))){
_local3 = _arg1.damage;
_local4 = ((Math.random() * 2) + 1);
if (_local4 == 1){
soundManager.playSound("impacto_bidon_01", 1, 1);
};
if (_local4 == 2){
soundManager.playSound("impacto_bidon_02", 1, 1);
};
body.gotoAndStop("golpeado");
if (_arg1.tipo == 0){
_local3 = (_local3 * 3);
};
life = (life - _local3);
lifebar.gotoAndStop(life.toFixed(0));
calcular_estado();
mostrar_lifebar = true;
next_lifebar = (getTimer() + time_lifebar);
mostrar_vida();
};
};
}
private function handleIA():void{
if (alive){
};
}
private function onEnterFrame(_arg1:Event):void{
if (alive){
handleIA();
handleAnim();
update();
};
}
public function mover(_arg1:String="", _arg2:int=0){
}
private function update(){
if (alive){
if ((((getTimer() > next_lifebar)) && ((lifebar.visible == true)))){
ocultar_vida();
};
};
}
public function addCircle(_arg1:Number, _arg2:Number, _arg3:Number){
var _local4:b2BodyDef;
var _local5:b2CircleDef;
_local4 = new b2BodyDef();
_local5 = new b2CircleDef();
_local5.filter.categoryBits = Globals.Colision_Player;
_local5.filter.maskBits = Globals.Colision_Estatica;
_local5.radius = (Math.abs(_arg3) / m_phys_scale);
_local5.density = 1;
_local5.restitution = 0.2;
_local5.friction = 0.3;
_local4.position.Set((_arg1 / m_phys_scale), (_arg2 / m_phys_scale));
b = m_world.CreateBody(_local4);
b.CreateShape(_local5);
b.SetMassFromShapes();
}
public function copiar(_arg1:MovieClip){
var _local2:Rectangle;
var _local3:punto_rojo;
var _local4:BitmapData;
var _local5:Point;
layer_ground_mc = depthManager.layer_mc;
_local2 = getBounds(this);
_local3 = new punto_rojo();
_local3.visible = false;
_local3.x = (x + _local2.left);
_local3.y = (y + _local2.top);
layer_ground_mc.addChild(_local3);
_local4 = ConvertToBitmapData(_arg1, 1);
_local5 = localToLocal(_local3, layer_ground_mc);
depthManager.layer_ground_bmd.copyPixels(_local4, _local4.rect, _local5, null, null, true);
layer_ground_mc.removeChild(_local3);
finalize();
}
function ConvertToBitmapData(_arg1:DisplayObject, _arg2:Number=1):BitmapData{
var _local3:BitmapData;
var _local4:Rectangle;
var _local5:Matrix;
_local3 = new BitmapData(_arg1.width, _arg1.height, true, 0);
_local4 = _arg1.getBounds(_arg1);
_local5 = new Matrix();
_local5.translate(-(_local4.x), -(_local4.y));
_local5.scale(_arg2, _arg2);
_local3.draw(_arg1, _local5);
return (_local3);
}
public static function localToLocal(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Point=null):Point{
var _local4:Point;
_local4 = (_arg3) ? _arg3 : new Point();
_local4 = _arg1.localToGlobal(_local4);
_local4 = _arg2.globalToLocal(_local4);
return (_local4);
}
}
}//package com.tanoku.MoreZombies
Section 82
//Bomb (com.tanoku.MoreZombies.Bomb)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import flash.events.*;
import flash.display.*;
public class Bomb extends MovieClip {
public var xvel:int;// = 0
public var bulletOffset:Number;// = 0
public var weaponDef:Weapon;
public var yorig:Number;
public var speed:Number;// = 1
var distanceTotal:Number;// = 0
public var remove:Boolean;// = false
public var damageOnImpact:Boolean;// = true
public var ydest:Number;
public var damage2:Number;// = 1
public var damage3:Number;// = 1
public var yvel:int;// = 0
public var damage1:Number;
public var dir:int;// = 0
public var xorig:Number;
var explosion_temp:Explosion;
public var alive:Boolean;
public var vida_pixeles:int;
var distanceX:Number;// = 0
var distanceY:Number;// = 0
public var pushFactor:Number;// = 0
public var xdest:Number;
public var tipo;
public var range:Number;// = 1
public var pushOnImpact:Boolean;// = true
public var time_effect:Number;// = 0
public var damage_range1:Number;// = 1
public var damage_range2:Number;// = 1
public var damage_range3:Number;// = 1
private var depthManager:DepthManager;
public var damage:Number;// = 1
public var achievementManager:AchievementManager;
public var playerObject:Object;
private var soundManager:SoundManager;
public var body;
public var ready:Boolean;// = false
public var targetList:Array;
public function Bomb():void{
depthManager = DepthManager.getInstance();
soundManager = SoundManager.getInstance();
achievementManager = AchievementManager.getInstance();
remove = false;
speed = 1;
xvel = 0;
yvel = 0;
bulletOffset = 0;
dir = 0;
tipo = Globals.C4_BOMB;
range = 1;
damage = 1;
damage_range1 = 1;
damage2 = 1;
damage_range2 = 1;
damage3 = 1;
damage_range3 = 1;
time_effect = 0;
ready = false;
pushOnImpact = true;
pushFactor = 0;
damageOnImpact = true;
distanceX = 0;
distanceY = 0;
distanceTotal = 0;
super();
stop();
}
public function finalize(){
remove = true;
removeEventListener(Juego.FINALIZE, finalize);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
delete ??getglobalscope
[this];
Globals.deleteNow(this);
}
public function detonate(){
alive = false;
Explode(this);
finalize();
}
public function recieveDamage(_arg1, _arg2:Boolean=true):Boolean{
return (false);
}
private function onEnterFrame(_arg1:Event):void{
if (!Globals.GamePaused){
update();
};
if ((((Globals.ExitGame == true)) || ((Globals.GameFinished == true)))){
finalize();
};
}
public function Explode(_arg1){
var _local2:int;
var _local3:int;
var _local4:*;
_local2 = 0;
if (tipo == Globals.C4_BOMB){
explosion_temp = new Explosion("grande", x, y);
soundManager.playSound("ExplosionGrande", 1, 1);
} else {
if (tipo == Globals.BRAIN_BOMB){
explosion_temp = new Explosion("cranium", x, y);
gotoAndStop("BRAIN");
};
};
_local3 = 0;
while (_local3 < targetList.length) {
_local4 = targetList[_local3];
if (_local4.alive){
distanceX = (_arg1.x - _local4.x);
distanceY = (_arg1.y - _local4.y);
distanceTotal = Math.sqrt(((distanceX * distanceX) + (distanceY * distanceY)));
if (distanceTotal <= damage_range3){
if (distanceTotal <= damage_range1){
range = 1;
damage = damage1;
} else {
if (distanceTotal <= damage_range2){
range = 2;
damage = damage2;
} else {
range = 3;
damage = damage3;
};
};
if (tipo == Globals.C4_BOMB){
if (_local4.recieveDamage(this)){
_local2 = (_local2 + 1);
};
} else {
if (tipo == Globals.BRAIN_BOMB){
_local4.brain_explode(this);
_local2 = (_local2 + 1);
};
};
};
};
_local3++;
};
distanceX = (_arg1.x - playerObject.x);
distanceY = (_arg1.y - playerObject.y);
distanceTotal = Math.sqrt(((distanceX * distanceX) + (distanceY * distanceY)));
if (distanceTotal <= damage_range3){
if (distanceTotal <= damage_range1){
range = 1;
damage = damage1;
} else {
if (distanceTotal <= damage_range2){
range = 2;
damage = damage2;
} else {
range = 3;
damage = damage3;
};
};
if (tipo == Globals.C4_BOMB){
playerObject.recieveDamage(this);
};
};
if (_local2 > 0){
if (tipo == Globals.C4_BOMB){
if (achievementManager.checkAchievement("Demolition", _local2)){
playerObject.interfaz.mostrar_panel_combo("Demolition");
};
};
if (tipo == Globals.BRAIN_BOMB){
if (achievementManager.checkAchievement("Headache", _local2)){
playerObject.interfaz.mostrar_panel_combo("Headache");
};
};
};
}
private function update(){
if (alive){
};
}
public function initialize():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
remove = false;
alive = true;
if (tipo == Globals.C4_BOMB){
gotoAndStop("C4");
} else {
if (tipo == Globals.BRAIN_BOMB){
gotoAndStop("BRAIN");
};
};
_local1 = Math.round((180 - ((Math.atan2((xdest - xorig), (ydest - yorig)) * 180) / Math.PI)));
_local2 = Math.floor(((Math.random() * bulletOffset) - (bulletOffset / 2)));
_local3 = ((((_local1 + _local2) - 90) * Math.PI) / 180);
xvel = (Math.cos(_local3) * speed);
if (dir == Globals.DER){
this.scaleX = 1;
};
if (dir == Globals.IZQ){
this.scaleX = -1;
xvel = (xvel * -1);
};
yvel = (Math.sin(_local3) * speed);
depthManager.addObject(this);
addEventListener(Juego.FINALIZE, finalize);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
}
}//package com.tanoku.MoreZombies
Section 83
//Bullet (com.tanoku.MoreZombies.Bullet)
package com.tanoku.MoreZombies {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class Bullet extends MovieClip {
public var xvel:Number;// = 0
public var bulletOffset:Number;// = 0
public var weaponDef:Weapon;
public var yorig:Number;
public var speed:Number;// = 1
public var remove:Boolean;// = false
var estela_visible:Boolean;// = false
public var damageOnImpact:Boolean;// = true
public var ydest:Number;
public var damage2:Number;// = 1
public var damage3:Number;// = 1
public var dir:int;// = 0
public var yvel:Number;// = 0
public var damage1:Number;
public var p_orig:Point;
public var xorig:Number;
public var alive:Boolean;
public var body2:MovieClip;
public var xpos:Number;// = 0
public var vida_pixeles:Number;
var media_distancia:Number;// = 0
var numKills:int;// = 0
public var pushFactor:Number;// = 0
public var xdest:Number;
public var ypos:Number;// = 0
public var range:Number;// = 0
public var pushOnImpact:Boolean;// = true
public var tipo;
public var time_effect:Number;// = 0
var punto_salida:punto_rojo;
public var damage_range1:Number;// = 1
public var damage_range2:Number;// = 1
public var damage_range3:Number;// = 1
private var depthManager:DepthManager;
public var damage:Number;// = 1
public var achievementManager:AchievementManager;
public var playerObject:Object;
public var body:MovieClip;
public var targetList:Array;
public function Bullet():void{
depthManager = DepthManager.getInstance();
achievementManager = AchievementManager.getInstance();
remove = false;
speed = 1;
xvel = 0;
yvel = 0;
xpos = 0;
ypos = 0;
bulletOffset = 0;
dir = 0;
tipo = Globals.BASIC_BULLET;
damage = 1;
range = 0;
damage_range1 = 1;
damage2 = 1;
damage_range2 = 1;
damage3 = 1;
damage_range3 = 1;
time_effect = 0;
pushOnImpact = true;
pushFactor = 0;
damageOnImpact = true;
media_distancia = 0;
estela_visible = false;
numKills = 0;
super();
stop();
}
public function finalize(){
if (numKills > 0){
if (tipo == Globals.AITSO){
if (achievementManager.checkAchievement("Disintegrate", numKills)){
playerObject.interfaz.mostrar_panel_combo("Disintegrate");
};
};
};
if (((!((punto_salida == null))) && (!((parent == null))))){
parent.removeChild(punto_salida);
};
remove = true;
removeEventListener(Juego.FINALIZE, finalize);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
delete ??getglobalscope
[this];
Globals.deleteNow(this);
}
public function recieveDamage(_arg1, _arg2:Boolean=true){
}
private function onEnterFrame(_arg1:Event):void{
if (!Globals.GamePaused){
update();
};
if ((((Globals.ExitGame == true)) || ((Globals.GameFinished == true)))){
finalize();
};
}
private function update(){
var _local1:int;
var _local2:Point;
var _local3:*;
var _local4:DisplayObject;
var _local5:int;
var _local6:Number;
if (alive){
if (tipo == Globals.AITSO){
x = (xorig + (width / 1.4));
if (dir == Globals.DER){
x = (xorig + (width / 1.4));
} else {
x = (xorig - (width / 4.2));
};
if (xvel < 0){
width = (width - xvel);
} else {
width = (width + xvel);
};
} else {
x = (x + xvel);
y = (y + yvel);
};
if (((((!((parent == null))) && ((punto_salida == null)))) && ((estela_visible == true)))){
punto_salida = new punto_rojo();
punto_salida.x = xorig;
punto_salida.y = yorig;
parent.addChild(punto_salida);
_local2 = localToLocal(punto_salida, this);
parent.removeChild(punto_salida);
punto_salida = null;
graphics.clear();
graphics.moveTo(body.x, body.y);
graphics.lineStyle(0.5, 16777164, 0.4);
graphics.lineTo(_local2.x, _local2.y);
};
vida_pixeles = (vida_pixeles - speed);
if (vida_pixeles <= 0){
alive = false;
finalize();
};
_local1 = 0;
while (_local1 < targetList.length) {
_local3 = targetList[_local1];
if (_local3.alive){
_local4 = _local3.body;
if (_local3.body.hitarea != null){
_local4 = _local3.body.hitarea;
};
if (this.body.hitTestObject(_local4)){
_local5 = (_local3.y - y);
if (_local5 < 0){
_local5 = (_local5 * -1);
};
_local6 = _local3.diferencia_altura;
if ((((tipo == Globals.FLAMETHROWER)) || ((tipo == Globals.EXTINGUISHER)))){
_local6 = (_local6 / 2);
};
if (_local5 <= _local6){
_local1 = targetList.length;
if (_local3.recieveDamage(this) == true){
numKills = (numKills + 1);
};
if (weaponDef.dieOnImpact){
alive = false;
finalize();
};
};
};
};
_local1++;
};
};
}
public function initialize():void{
var _local1:int;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local1 = ((Math.random() * 5) + 1);
remove = false;
alive = true;
xpos = 0;
ypos = 0;
p_orig = new Point(xorig, yorig);
punto_salida = null;
media_distancia = (vida_pixeles / 1);
estela_visible = false;
switch (tipo){
case Globals.CHAINSAW:
gotoAndStop("chainsaw");
break;
case Globals.FLAMETHROWER:
gotoAndStop(("flamethrower_" + _local1));
break;
case Globals.EXTINGUISHER:
gotoAndStop(("extinguisher_" + _local1));
break;
case Globals.AITSO:
gotoAndStop("aitso");
break;
default:
gotoAndStop("bullet");
estela_visible = true;
};
_local2 = y;
_local3 = (y - playerObject.y);
if (body == null){
body = new MovieClip();
};
body.y = _local3;
body.x = 0;
y = (playerObject.y - 1);
_local4 = Math.round((180 - ((Math.atan2((xdest - xorig), (ydest - yorig)) * 180) / Math.PI)));
_local5 = Math.floor(((Math.random() * bulletOffset) - (bulletOffset / 2)));
_local6 = ((((_local4 + _local5) - 90) * Math.PI) / 180);
xvel = (Math.cos(_local6) * speed);
if (dir == Globals.DER){
this.rotation = Math.round(((_local6 * 180) / Math.PI));
this.scaleX = 1;
};
if (dir == Globals.IZQ){
this.rotation = -(Math.round(((_local6 * 180) / Math.PI)));
this.scaleX = -1;
xvel = (xvel * -1);
};
yvel = (Math.sin(_local6) * speed);
depthManager.addObject(this);
addEventListener(Juego.FINALIZE, finalize);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function localToLocal(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Point=null):Point{
var _local4:Point;
_local4 = (_arg3) ? _arg3 : new Point();
_local4 = _arg1.localToGlobal(_local4);
_local4 = _arg2.globalToLocal(_local4);
return (_local4);
}
}
}//package com.tanoku.MoreZombies
Section 84
//Camara (com.tanoku.MoreZombies.Camara)
package com.tanoku.MoreZombies {
import flash.events.*;
import flash.display.*;
public class Camara extends MovieClip {
private var xdest:int;// = 0
private var velocidad:Number;// = 3.375
private var objetivo:MovieClip;
private var xnext:int;// = 0
public var cam_:MovieClip;
public var porcentaje_x:Number;
public var max_ancho:int;
private var max_alto:int;
public function Camara(_arg1:MovieClip, _arg2:int, _arg3:int, _arg4:MovieClip):void{
velocidad = 3.375;
xdest = 0;
xnext = 0;
super();
cam_ = _arg1;
max_ancho = _arg2;
max_alto = _arg3;
objetivo = _arg4;
cam_.x = objetivo.x;
cam_.y = objetivo.y;
initialize();
}
public function finalize():void{
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function handleCam(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
if (objetivo.suavizar_movimiento_camara == true){
xdest = objetivo.x;
if (cam_.x > xdest){
cam_.x = (cam_.x - velocidad);
} else {
cam_.x = (cam_.x + velocidad);
};
_local3 = (cam_.x - xdest);
if ((((_local3 <= velocidad)) && ((_local3 >= -(velocidad))))){
cam_.x = xdest;
};
} else {
cam_.x = objetivo.x;
};
cam_.y = objetivo.y;
if ((cam_.x - (cam_.width / 2)) < 0){
Globals.leftLimit = true;
cam_.x = (cam_.width / 2);
} else {
Globals.leftLimit = false;
};
if ((cam_.x + (cam_.width / 2)) > max_ancho){
Globals.rightLimit = true;
cam_.x = (max_ancho - (cam_.width / 2));
} else {
Globals.rightLimit = false;
};
if ((cam_.y + (cam_.height / 2)) > max_alto){
cam_.y = (max_alto - (cam_.height / 2));
};
_local1 = (max_ancho - cam_.width);
_local2 = (cam_.x - (cam_.width / 2));
porcentaje_x = ((_local2 * 100) / _local1);
}
public function initialize():void{
Globals.leftLimit = false;
Globals.rightLimit = false;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function onEnterFrame(_arg1:Event):void{
handleCam();
if (Globals.ExitGame){
finalize();
};
}
}
}//package com.tanoku.MoreZombies
Section 85
//Carrito (com.tanoku.MoreZombies.Carrito)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class Carrito extends MovieClip {
public var max_life:Number;// = 0
public var life:Number;// = 0
public var m_iterations:Number;// = 10
public var b:b2Body;
private var depthManager:DepthManager;
public var m_world:b2World;
public var diferencia_altura:Number;// = 50
public var remove:Boolean;// = false
private var contenedor:MovieClip;
public var body:MovieClip;
private var soundManager:SoundManager;
public var dir;// = 0
public var indice_estado:int;// = 1
public var m_timestep:Number;// = 0.0333333333333333
public var freezed:Boolean;// = true
public var alive:Boolean;// = true
public var layer_ground_mc:MovieClip;
public var m_phys_scale:Number;// = 30
public function Carrito(_arg1:MovieClip=null):void{
m_phys_scale = 30;
m_timestep = (1 / 30);
m_iterations = 10;
depthManager = DepthManager.getInstance();
soundManager = SoundManager.getInstance();
alive = true;
remove = false;
life = 0;
max_life = 0;
diferencia_altura = 50;
freezed = true;
indice_estado = 1;
dir = 0;
super();
stop();
contenedor = _arg1;
}
public function calcular_estado(){
var _local1:Number;
_local1 = 0;
if (life > 0){
_local1 = (max_life * 0.75);
if (life >= _local1){
indice_estado = 1;
};
_local1 = (max_life * 0.5);
if (life >= _local1){
indice_estado = 2;
};
if (life < _local1){
indice_estado = 3;
};
} else {
body.gotoAndStop("destruir");
alive = false;
};
}
public function finalize(){
remove = true;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
removeEventListener(Juego.FINALIZE, finalize);
delete ??getglobalscope
[this];
Globals.deleteNow(this);
}
public function AddStaticBox(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
var _local5:b2BodyDef;
var _local6:b2PolygonDef;
_local5 = new b2BodyDef();
_local5.position.Set(_arg1, _arg2);
_local6 = new b2PolygonDef();
_local6.SetAsBox(_arg3, _arg4);
_local6.density = 0;
b = m_world.CreateBody(_local5);
b.CreateShape(_local6);
b.SetMassFromShapes();
}
public function destruido(){
if (Globals.Colisiones){
m_world.DestroyBody(b);
b = null;
};
}
private function handleAnim(){
}
public function copiar(_arg1:MovieClip){
var _local2:Rectangle;
var _local3:punto_rojo;
var _local4:BitmapData;
var _local5:Point;
layer_ground_mc = depthManager.layer_mc;
_local2 = getBounds(this);
_local3 = new punto_rojo();
_local3.visible = false;
_local3.x = (x + _local2.left);
_local3.y = (y + _local2.top);
layer_ground_mc.addChild(_local3);
_local4 = ConvertToBitmapData(_arg1, 1);
_local5 = localToLocal(_local3, layer_ground_mc);
depthManager.layer_ground_bmd.copyPixels(_local4, _local4.rect, _local5, null, null, true);
layer_ground_mc.removeChild(_local3);
finalize();
}
public function freeze(_arg1):void{
}
public function brain_explode(_arg1):void{
}
public function initialize():void{
life = 100;
max_life = life;
Globals.VIDA_CARRITO = Number(life.toFixed(0));
body.gotoAndStop("normal");
depthManager.addObject(this);
if (Globals.Colisiones){
AddStaticBox((x / m_phys_scale), ((y - 8) / m_phys_scale), (30 / m_phys_scale), (16 / m_phys_scale));
};
addEventListener(Event.ENTER_FRAME, onEnterFrame);
addEventListener(Juego.FINALIZE, finalize);
}
public function recieveDamage(_arg1, _arg2:Boolean=true){
var _local3:int;
if (((alive) && (!(Globals.GamePaused)))){
if (((((!((_arg1.tipo == 0))) && (!((_arg1.tipo == Globals.EXTINGUISHER))))) && (!((_arg1.tipo == Globals.FREEZE_MINE))))){
_local3 = ((Math.random() * 2) + 1);
if (_local3 == 1){
soundManager.playSound("impacto_carrito_01", 0.5, 1);
};
if (_local3 == 2){
soundManager.playSound("impacto_carrito_02", 0.5, 1);
};
body.gotoAndStop("golpeado");
life = (life - _arg1.damage);
Globals.VIDA_CARRITO = Number(life.toFixed(0));
calcular_estado();
};
};
}
private function handleIA():void{
if (alive){
};
}
private function onEnterFrame(_arg1:Event):void{
if (alive){
handleIA();
handleAnim();
update();
};
}
public function mover(_arg1:String="", _arg2:int=0){
}
private function update(){
if (alive){
};
}
public function addCircle(_arg1:Number, _arg2:Number, _arg3:Number){
var _local4:b2BodyDef;
var _local5:b2CircleDef;
_local4 = new b2BodyDef();
_local5 = new b2CircleDef();
_local5.filter.categoryBits = Globals.Colision_Player;
_local5.filter.maskBits = Globals.Colision_Estatica;
_local5.radius = (Math.abs(_arg3) / m_phys_scale);
_local5.density = 1;
_local5.restitution = 0.2;
_local5.friction = 0.3;
_local4.position.Set((_arg1 / m_phys_scale), (_arg2 / m_phys_scale));
b = m_world.CreateBody(_local4);
b.CreateShape(_local5);
b.SetMassFromShapes();
}
function ConvertToBitmapData(_arg1:DisplayObject, _arg2:Number=1):BitmapData{
var _local3:BitmapData;
var _local4:Rectangle;
var _local5:Matrix;
_local3 = new BitmapData(_arg1.width, _arg1.height, true, 0);
_local4 = _arg1.getBounds(_arg1);
_local5 = new Matrix();
_local5.translate(-(_local4.x), -(_local4.y));
_local5.scale(_arg2, _arg2);
_local3.draw(_arg1, _local5);
return (_local3);
}
public static function localToLocal(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Point=null):Point{
var _local4:Point;
_local4 = (_arg3) ? _arg3 : new Point();
_local4 = _arg1.localToGlobal(_local4);
_local4 = _arg2.globalToLocal(_local4);
return (_local4);
}
}
}//package com.tanoku.MoreZombies
Section 86
//Casquillo (com.tanoku.MoreZombies.Casquillo)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class Casquillo extends MovieClip {
public var indice_casquillo:int;// = 1
var tipo:String;
private var depthManager:DepthManager;
var cadena_sonido:String;// = ""
public var remove:Boolean;// = false
public var contenedor:MovieClip;
private var soundManager:SoundManager;
public var dir;
public function Casquillo(_arg1:String="", _arg2:int=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Number=0, _arg7=0):void{
var _local8:int;
var _local9:int;
var _local10:String;
var _local11:int;
var _local12:int;
var _local13:int;
depthManager = DepthManager.getInstance();
soundManager = SoundManager.getInstance();
remove = false;
indice_casquillo = 1;
cadena_sonido = "";
super();
if (_arg1 != ""){
indice_casquillo = _arg2;
_local8 = 1;
switch (_arg1){
case "tipo_1":
_local8 = 0;
break;
case "tipo_2":
_local8 = 3;
break;
default:
_local8 = 0;
};
if (indice_casquillo == 4){
cadena_sonido = "casquillo_plastico_0";
} else {
cadena_sonido = "casquillo_metal_0";
};
_local9 = ((Math.random() * 3) + 1);
_local10 = (cadena_sonido + _local9);
trace(_local10);
soundManager.playSound(_local10, 1, 1);
_local11 = ((Math.random() * 3) + 1);
_local11 = (_local11 + _local8);
x = (_arg3 + _arg5);
y = _arg4;
gotoAndStop(_local11);
gotoAndStop(7);
dir = _arg7;
if (dir == Globals.DER){
x = _arg3;
scaleX = 1;
} else {
x = _arg3;
scaleX = -1;
};
y = _arg4;
_local12 = (Math.random() * 15);
_local13 = (Math.random() * 15);
x = (x + _local12);
y = (y + _local13);
contenedor = depthManager.layer_mc;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
};
}
public function finalize(_arg1:MovieClip=null){
var _local2:Rectangle;
var _local3:punto_rojo;
var _local4:BitmapData;
var _local5:Point;
_local2 = getBounds(this);
_local3 = new punto_rojo();
_local3.visible = false;
if (dir == Globals.DER){
_local3.x = (x + _local2.left);
} else {
_local3.x = (x - _local2.left);
};
_local3.y = (y + _local2.top);
_local3.visible = true;
contenedor.addChild(_local3);
_local4 = ConvertToBitmapData(_arg1, 1);
_local5 = localToLocal(_local3, contenedor);
depthManager.layer_ground_bmd.copyPixels(_local4, _local4.rect, _local5, null, null, true);
contenedor.removeChild(_local3);
remove = true;
delete ??getglobalscope
[this];
Globals.deleteNow(this);
}
function ConvertToBitmapData(_arg1:DisplayObject, _arg2:Number=1):BitmapData{
var _local3:BitmapData;
var _local4:Rectangle;
var _local5:Matrix;
_local3 = new BitmapData(_arg1.width, _arg1.height, true, 0);
_local4 = _arg1.getBounds(_arg1);
_local5 = new Matrix();
_local5.translate(-(_local4.x), -(_local4.y));
_local5.scale(_arg2, _arg2);
_local3.draw(_arg1, _local5);
return (_local3);
}
public function initialize():void{
contenedor.addChild(this);
depthManager.addObject(this);
}
function CopyPixels(_arg1:BitmapData, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:Boolean=false, _arg7:Boolean=false):BitmapData{
var _local8:BitmapData;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
_local8 = new BitmapData(_arg4, _arg5, false, 0xFFFFFF);
_arg1.lock();
_local8.lock();
_local9 = 0;
_local10 = 0;
_local11 = 0;
_local12 = _arg2;
while (_local12 < (_arg2 + _arg4)) {
_local13 = 0;
_local14 = _arg3;
while (_local14 < (_arg3 + _arg5)) {
if (_arg6){
_local9 = ((_arg5 - _local13) - 1);
} else {
_local9 = _local13;
};
if (_arg7){
_local10 = ((_arg4 - _local11) - 1);
} else {
_local10 = _local11;
};
_local8.setPixel32(_local10, _local9, _arg1.getPixel32(_local12, _local14));
_local13++;
_local14++;
};
_local11++;
_local12++;
};
_arg1.unlock();
_local8.unlock();
return (_local8);
}
private function onEnterFrame(_arg1:Event):void{
finalize(this);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public static function localToLocal(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Point=null):Point{
var _local4:Point;
_local4 = (_arg3) ? _arg3 : new Point();
_local4 = _arg1.localToGlobal(_local4);
_local4 = _arg2.globalToLocal(_local4);
return (_local4);
}
}
}//package com.tanoku.MoreZombies
Section 87
//Casquillo2 (com.tanoku.MoreZombies.Casquillo2)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class Casquillo2 extends MovieClip {
public var indice_casquillo:int;// = 1
public var tipo:String;
var mc_Casquillo2:casquillo_disparo;
private var depthManager:DepthManager;
var contador:int;// = 0
public var remove:Boolean;// = false
private var contenedor:MovieClip;
private var soundManager:SoundManager;
public var dir;
var initialized:Boolean;// = false
public function Casquillo2(_arg1:String="", _arg2:int=0, _arg3:Number=0, _arg4:Number=0, _arg5=0):void{
var _local6:int;
var _local7:int;
depthManager = DepthManager.getInstance();
soundManager = SoundManager.getInstance();
remove = false;
indice_casquillo = 1;
contador = 0;
initialized = false;
super();
if (_arg1 != ""){
stop();
dir = _arg5;
tipo = _arg1;
indice_casquillo = _arg2;
mc_Casquillo2 = new casquillo_disparo();
if (_arg5 == Globals.DER){
scaleX = 1;
} else {
scaleX = -1;
};
x = _arg3;
y = _arg4;
mc_Casquillo2.x = 0;
mc_Casquillo2.y = 0;
_local6 = (Math.random() * 15);
_local7 = (Math.random() * 15);
x = (x + _local6);
y = (y + _local7);
addChild(mc_Casquillo2);
contenedor = depthManager.layer_mc;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
};
}
public function finalize(_arg1:MovieClip=null){
var _local2:Rectangle;
var _local3:punto_rojo;
var _local4:BitmapData;
var _local5:Point;
_local2 = getBounds(this);
_local3 = new punto_rojo();
_local3.visible = false;
if (dir == Globals.DER){
_local3.x = (x + _local2.left);
} else {
_local3.x = (x - _local2.left);
};
_local3.y = (y + _local2.top);
_local3.visible = true;
contenedor.addChild(_local3);
_local4 = ConvertToBitmapData(_arg1, 1);
_local5 = localToLocal(_local3, contenedor);
depthManager.layer_ground_bmd.copyPixels(_local4, _local4.rect, _local5, null, null, true);
contenedor.removeChild(_local3);
remove = true;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
delete ??getglobalscope
[this];
Globals.deleteNow(this);
}
public function lanzarSonido(){
var _local1:String;
var _local2:int;
var _local3:String;
_local1 = "";
if (indice_casquillo == 4){
_local1 = "casquillo_plastico_0";
} else {
_local1 = "casquillo_metal_0";
};
_local2 = ((Math.random() * 3) + 1);
_local3 = (_local1 + _local2);
soundManager.playSound(_local3, 0.1, 1);
}
function ConvertToBitmapData(_arg1:DisplayObject, _arg2:Number=1):BitmapData{
var _local3:BitmapData;
var _local4:Rectangle;
var _local5:Matrix;
_local3 = new BitmapData(_arg1.width, _arg1.height, true, 0);
_local4 = _arg1.getBounds(_arg1);
_local5 = new Matrix();
_local5.translate(-(_local4.x), -(_local4.y));
_local5.scale(_arg2, _arg2);
_local3.draw(_arg1, _local5);
return (_local3);
}
public function initialize():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
_local1 = ((Math.random() * 7) + 1);
_local2 = 0;
contenedor.addChild(this);
switch (tipo){
case "":
_local2 = 1;
break;
default:
_local2 = 1;
};
_local3 = 0;
switch (tipo){
case "tipo_1":
_local3 = 0;
break;
case "tipo_2":
_local3 = 3;
break;
default:
_local3 = 0;
};
_local4 = ((Math.random() * 3) + 1);
_local4 = (_local4 + _local3);
mc_Casquillo2.gotoAndStop(_local4);
depthManager.addObject(this);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
contador = 0;
visible = true;
initialized = true;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function onEnterFrame(_arg1:Event):void{
if (!initialized){
initialize();
};
}
public function localToLocal(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Point=null):Point{
var _local4:Point;
_local4 = (_arg3) ? _arg3 : new Point();
_local4 = _arg1.localToGlobal(_local4);
_local4 = _arg2.globalToLocal(_local4);
return (_local4);
}
}
}//package com.tanoku.MoreZombies
Section 88
//ComboManager (com.tanoku.MoreZombies.ComboManager)
package com.tanoku.MoreZombies {
import flash.display.*;
import flash.utils.*;
public class ComboManager {
public var layer_mc:MovieClip;
public var active:Boolean;// = false
public var tipo_partida:String;
public var playerObj;
public var recalc:Boolean;// = false
var timeEndCombo:Number;// = 0
public var timePausa:Number;// = 0
private var weaponManager:WeaponManager;
public var margenCombo:Number;// = 2000
public static var instance:ComboManager;
public function ComboManager(_arg1:SingletonEnforcer){
weaponManager = WeaponManager.getInstance();
active = false;
margenCombo = 2000;
recalc = false;
timePausa = 0;
timeEndCombo = 0;
super();
}
public function stop(){
active = false;
}
public function update(){
var _local1:Number;
if (active){
if (!Globals.GamePaused){
if (recalc == true){
recalc = false;
_local1 = (getTimer() + timePausa);
Globals.LAST_HIT = (Globals.LAST_HIT + _local1);
};
updateLogic();
} else {
if (recalc == false){
timePausa = getTimer();
recalc = true;
};
};
};
}
public function updateLogic(){
if (Globals.LAST_HIT != 0){
timeEndCombo = (Globals.LAST_HIT + margenCombo);
if (getTimer() > timeEndCombo){
Globals.LAST_HIT = 0;
Globals.HITS = 0;
Globals.RANK = 0;
} else {
if (Globals.HITS >= 10){
Globals.RANK = 2;
};
if (Globals.HITS >= 20){
Globals.RANK = 3;
};
if (Globals.HITS >= 40){
Globals.RANK = 4;
};
if (Globals.HITS >= 80){
Globals.RANK = 5;
};
if (Globals.HITS >= 160){
Globals.RANK = 6;
};
if (Globals.HITS >= 320){
Globals.RANK = 7;
};
if (Globals.HITS >= 640){
Globals.RANK = 8;
};
if (Globals.HITS >= 0x0500){
Globals.RANK = 9;
};
if (Globals.HITS >= 0x0A00){
Globals.RANK = 10;
};
};
};
}
public function finalize(){
instance = null;
}
public function start(){
Globals.HITS = 0;
Globals.LAST_HIT = 0;
active = true;
recalc = false;
}
public static function getInstance():ComboManager{
if (instance == null){
instance = new ComboManager(new SingletonEnforcer());
};
return (instance);
}
}
}//package com.tanoku.MoreZombies
class SingletonEnforcer {
private function SingletonEnforcer(){
}
}
Section 89
//creditos (com.tanoku.MoreZombies.creditos)
package com.tanoku.MoreZombies {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class creditos extends MovieClip {
public var tanoku:SimpleButton;
public var main_class:MovieClip;
public var b_back:SimpleButton;
public var logo:MovieClip;
public function creditos(){
b_back.addEventListener(MouseEvent.CLICK, on_button_clicked);
tanoku.addEventListener(MouseEvent.CLICK, manejarClickTanoku);
}
public function on_button_out(_arg1:MouseEvent){
}
private function manejarClickTanoku(_arg1:MouseEvent):void{
Globals.webTanoku();
}
public function on_button_over(_arg1:MouseEvent){
switch (_arg1.target.name){
};
}
public function on_button_clicked(_arg1:MouseEvent){
switch (_arg1.target.name){
case "b_back":
main_class.cierra_pantalla(this, "pelicula");
main_class.abre_pantalla(new principal(), "pelicula");
break;
default:
trace((_arg1.target.name + " UNDEFINED"));
break;
};
}
}
}//package com.tanoku.MoreZombies
Section 90
//DepthManager (com.tanoku.MoreZombies.DepthManager)
package com.tanoku.MoreZombies {
import flash.display.*;
import flash.geom.*;
public class DepthManager {
public var layer_mc:MovieClip;
public var ancho_bitmap:Number;
public var layer_data:BitmapData;
public var depthList:Array;
public var layer_bitmap:Bitmap;
public var alto_bitmap:Number;
public var layer_mc2:MovieClip;
public var layer_ground_bmd:BitmapData;
public static var instance:DepthManager;
public function DepthManager(_arg1:SingletonEnforcer){
}
public function addObject(_arg1){
layer_mc.addChild(_arg1);
depthList.push(_arg1);
}
public function update(){
handleDepht();
}
public function initialize(_arg1, _arg2){
ancho_bitmap = _arg1;
alto_bitmap = _arg2;
layer_data = new BitmapData(ancho_bitmap, alto_bitmap, true, 0);
layer_bitmap = new Bitmap(layer_data);
layer_mc.addChild(layer_bitmap);
}
private function handleDepht(){
var _local1:int;
depthList.sortOn("y", Array.NUMERIC);
_local1 = depthList.length;
while (_local1--) {
if ((depthList[_local1] is Bitmap)){
if (layer_mc.getChildIndex(depthList[_local1]) != _local1){
layer_mc.setChildIndex(depthList[_local1], _local1);
};
} else {
if (depthList[_local1].remove){
layer_mc.removeChild(depthList[_local1]);
delete ??getglobalscope
[depthList.splice(_local1, 1)];
} else {
if (layer_mc.getChildIndex(depthList[_local1]) != _local1){
layer_mc.setChildIndex(depthList[_local1], _local1);
};
};
};
};
Globals.depthObjects = depthList.length;
}
public function finalize(){
depthList = null;
instance = null;
}
public function removeObject(_arg1){
}
public static function getInstance():DepthManager{
if (instance == null){
instance = new DepthManager(new SingletonEnforcer());
};
return (instance);
}
}
}//package com.tanoku.MoreZombies
class SingletonEnforcer {
private function SingletonEnforcer(){
}
}
Section 91
//Destello (com.tanoku.MoreZombies.Destello)
package com.tanoku.MoreZombies {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
public class Destello extends MovieClip {
public var tipo:String;
private var depthManager:DepthManager;
var contador:int;// = 0
public var remove:Boolean;// = false
var mc_destello:destello_arma;
private var contenedor:MovieClip;
var initialized:Boolean;// = false
public function Destello(_arg1:String, _arg2, _arg3, _arg4:Number=0, _arg5:Number=0, _arg6=0):void{
depthManager = DepthManager.getInstance();
remove = false;
contador = 0;
initialized = false;
super();
stop();
mc_destello = new destello_arma();
stop();
if (_arg6 == Globals.DER){
scaleX = 1;
} else {
scaleX = -1;
};
x = _arg2;
y = _arg3;
mc_destello.x = _arg4;
mc_destello.y = -(_arg5);
addChild(mc_destello);
contenedor = depthManager.layer_mc;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function finalize(){
remove = true;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
delete ??getglobalscope
[this];
Globals.deleteNow(this);
}
public function initialize():void{
var _local1:int;
var _local2:int;
var _local3:GlowFilter;
var _local4:Array;
_local1 = ((Math.random() * 8) + 1);
_local2 = 0;
_local3 = new GlowFilter();
_local3.color = 0xFFCC00;
_local3.alpha = 1;
_local3.blurX = 24;
_local3.blurY = 24;
_local4 = new Array(_local3);
filters = _local4;
contenedor.addChild(this);
switch (tipo){
case "pistola":
_local2 = 1;
break;
case "escopeta":
_local2 = 2;
break;
case "metralleta":
_local2 = 3;
break;
default:
_local2 = 1;
};
mc_destello.gotoAndStop((_local1 * _local2));
depthManager.addObject(this);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
visible = false;
contador = 0;
initialized = true;
}
private function onEnterFrame(_arg1:Event):void{
if (!initialized){
initialize();
} else {
contador = (contador + 1);
if (contador >= 1){
visible = true;
};
if (contador >= 2){
finalize();
};
};
}
public function localToLocal(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Point=null):Point{
var _local4:Point;
_local4 = (_arg3) ? _arg3 : new Point();
_local4 = _arg1.localToGlobal(_local4);
_local4 = _arg2.globalToLocal(_local4);
return (_local4);
}
}
}//package com.tanoku.MoreZombies
Section 92
//Earthquake (com.tanoku.MoreZombies.Earthquake)
package com.tanoku.MoreZombies {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Earthquake {
private static const FRAME_RATE:int = 25;
private static var timer:Timer;
private static var originalX:int;
private static var originalY:int;
private static var intensityOffset:int;
private static var intensity:int;
public static var Activo:Boolean = false;
private static var image:DisplayObject;
private static function cleanup():void{
Activo = false;
timer = null;
image = null;
}
public static function go(_arg1:DisplayObject, _arg2:Number=10, _arg3:Number=1):Boolean{
var _local4:int;
var _local5:int;
if (Activo){
return (false);
};
if (timer){
timer.stop();
};
image = _arg1;
originalX = image.x;
originalY = image.y;
intensity = _arg2;
intensityOffset = (intensity / 2);
_local4 = int((1000 / FRAME_RATE));
_local5 = int(((_arg3 * 1000) / _local4));
timer = new Timer(_local4, _local5);
timer.addEventListener(TimerEvent.TIMER, quake);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, resetImage);
timer.start();
Activo = true;
return (true);
}
public static function temp():void{
}
private static function resetImage(_arg1:TimerEvent=null):void{
image.x = originalX;
image.y = originalY;
cleanup();
}
private static function quake(_arg1:TimerEvent):void{
var _local2:int;
var _local3:int;
_local2 = ((originalX + (Math.random() * intensity)) - intensityOffset);
_local3 = ((originalY + (Math.random() * intensity)) - intensityOffset);
image.x = _local2;
image.y = _local3;
}
}
}//package com.tanoku.MoreZombies
Section 93
//estadisticas (com.tanoku.MoreZombies.estadisticas)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class estadisticas extends MovieClip {
public var t_Flames:TextField;
public var t_Chainsaw:TextField;
public var btn_pagina_anterior:SimpleButton;
public var t_Firearm:TextField;
public var main_class:MovieClip;
public var btn_pagina_siguiente:SimpleButton;
public var InstanceName_0:MovieClip;
public var pagina:int;// = 1
public var paginas:MovieClip;
public var b_back:SimpleButton;
public var t_TotalKills:TextField;
public var t_Melee:TextField;
public var t_Special:TextField;
public var t_Explosion:TextField;
public function estadisticas(){
pagina = 1;
super();
b_back.addEventListener(MouseEvent.CLICK, on_button_clicked);
btn_pagina_anterior.addEventListener(MouseEvent.CLICK, on_button_clicked);
btn_pagina_siguiente.addEventListener(MouseEvent.CLICK, on_button_clicked);
btn_pagina_anterior.visible = false;
estado_achievements();
}
public function on_button_out(_arg1:MouseEvent){
}
function estado_achievements(){
t_TotalKills.text = ("" + Globals.muertesTotal);
t_Melee.text = ("" + Globals.muertesMelee);
t_Firearm.text = ("" + Globals.muertesArma);
t_Explosion.text = ("" + Globals.muertesExplosion);
t_Chainsaw.text = ("" + Globals.muertesMotosierra);
t_Flames.text = ("" + Globals.muertesLanzallamas);
t_Special.text = ("" + Globals.muertesEspecial);
paginas.chk_FullyArmed.visible = AchievementManager.ach_AllWeapons;
paginas.chk_MegaSlash.visible = AchievementManager.ach_Megaslash;
paginas.chk_HomeRun.visible = AchievementManager.ach_HomeRun;
paginas.chk_Jedi.visible = AchievementManager.ach_Jedi;
paginas.chk_Jurassic.visible = AchievementManager.ach_Jurasic;
paginas.chk_Samurai.visible = AchievementManager.ach_Samurai;
paginas.chk_Massacre.visible = AchievementManager.ach_Massacre;
paginas.chk_Pyromania.visible = AchievementManager.ach_Pyromania;
paginas.chk_Terminator.visible = AchievementManager.ach_Terminator;
paginas.chk_Hunter.visible = AchievementManager.ach_Hunter;
paginas.chk_Hitman.visible = AchievementManager.ach_Hitman;
paginas.chk_Disintegrate.visible = AchievementManager.ach_Disintegrate;
paginas.chk_Demolition.visible = AchievementManager.ach_Demolition;
paginas.chk_Headache.visible = AchievementManager.ach_Headache;
paginas.chk_BloodyCircus.visible = AchievementManager.ach_BloodyCircus;
paginas.chk_Glacier.visible = AchievementManager.ach_Glacier;
paginas.chk_MoreBullets.visible = AchievementManager.ach_MoreBullets;
paginas.chk_InfiniteAmmo.visible = AchievementManager.ach_InfiniteAmmo;
}
public function on_button_over(_arg1:MouseEvent){
switch (_arg1.target.name){
};
}
public function on_button_clicked(_arg1:MouseEvent){
switch (_arg1.target.name){
case "b_back":
main_class.cierra_pantalla(this, "cortina");
break;
case "btn_pagina_siguiente":
pagina = (pagina + 1);
paginar();
btn_pagina_anterior.visible = true;
if (pagina == 3){
btn_pagina_siguiente.visible = false;
};
break;
case "btn_pagina_anterior":
pagina = (pagina - 1);
paginar();
btn_pagina_siguiente.visible = true;
if (pagina == 1){
btn_pagina_anterior.visible = false;
};
break;
default:
trace((_arg1.target.name + " UNDEFINED"));
break;
};
}
function paginar(){
switch (pagina){
case 1:
TweenLite.to(paginas, 1, {x:346.6});
break;
case 2:
TweenLite.to(paginas, 1, {x:-418.6});
break;
case 3:
TweenLite.to(paginas, 1, {x:-1169.6});
break;
};
}
}
}//package com.tanoku.MoreZombies
Section 94
//Explosion (com.tanoku.MoreZombies.Explosion)
package com.tanoku.MoreZombies {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class Explosion extends MovieClip {
public var tipo:String;
private var depthManager:DepthManager;
public var granada:MovieClip;
public var remove:Boolean;// = false
public var objTarget;
private var contenedor:MovieClip;
public var body:MovieClip;
public var tar;
public function Explosion(_arg1:String="", _arg2:Number=0, _arg3:Number=0, _arg4=null):void{
depthManager = DepthManager.getInstance();
remove = false;
super();
addFrameScript(6, frame7);
stop();
if (_arg1 != ""){
x = _arg2;
y = _arg3;
objTarget = _arg4;
tipo = _arg1;
contenedor = depthManager.layer_mc;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
};
}
public function finalize(){
remove = true;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
delete ??getglobalscope
[this];
Globals.deleteNow(this);
}
public function copiar(_arg1:MovieClip=null){
var _local2:Rectangle;
var _local3:punto_rojo;
var _local4:BitmapData;
var _local5:Point;
_local2 = getBounds(this);
_local3 = new punto_rojo();
_local3.visible = false;
_local3.x = (x + _local2.left);
_local3.y = (y + _local2.top);
_local3.visible = true;
contenedor.addChild(_local3);
_local4 = ConvertToBitmapData(_arg1, 1);
_local5 = localToLocal(_local3, contenedor);
depthManager.layer_ground_bmd.copyPixels(_local4, _local4.rect, _local5, null, null, true);
contenedor.removeChild(_local3);
}
function frame7(){
tar = this;
this.finalize();
}
function ConvertToBitmapData(_arg1:DisplayObject, _arg2:Number=1):BitmapData{
var _local3:BitmapData;
var _local4:Rectangle;
var _local5:Matrix;
_local3 = new BitmapData(_arg1.width, _arg1.height, true, 0);
_local4 = _arg1.getBounds(_arg1);
_local5 = new Matrix();
_local5.translate(-(_local4.x), -(_local4.y));
_local5.scale(_arg2, _arg2);
_local3.draw(_arg1, _local5);
return (_local3);
}
public function initialize():void{
gotoAndStop(tipo);
if ((((tipo == "aerea")) && (!((objTarget == null))))){
body.x = x;
body.y = y;
x = objTarget.x;
y = (objTarget.y + 1);
};
contenedor.addChild(this);
depthManager.addObject(this);
switch (tipo){
case "grande":
Earthquake.go(contenedor.parent.parent, 8, 0.6);
break;
default:
Earthquake.go(contenedor.parent.parent, 4, 0.4);
};
crearHollin();
}
function crearHollin(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:hollin_01;
var _local7:Rectangle;
var _local8:Point;
var _local9:BitmapData;
_local1 = 350;
_local2 = 50;
_local3 = 0;
switch (tipo){
case "grande":
_local3 = 0;
break;
case "claymore":
_local3 = 1;
break;
case "granada":
_local3 = 2;
break;
case "freeze":
_local3 = -1;
break;
case "aerea":
_local3 = -1;
break;
case "cranium":
_local3 = -1;
break;
default:
trace((("explosion " + tipo) + " sin hollin asignado (explosion.as)"));
};
if (_local3 >= 0){
_local4 = false;
_local5 = 0;
if (objTarget != null){
if (objTarget.dir == Globals.DER){
_local4 = true;
} else {
_local4 = false;
};
if (_local3 == 1){
if (objTarget.objectiveObject.x >= x){
_local4 = false;
} else {
_local4 = true;
};
};
};
_local6 = new hollin_01(_local1, _local2);
_local7 = new Rectangle(0, (_local3 * _local2), _local1, _local2);
_local8 = new Point((x - (_local1 / 2)), (y - (_local2 / 2)));
new Point((x - (_local1 / 2)), (y - (_local2 / 2))).x = (_local8.x + _local5);
_local9 = CopyPixels(_local6, _local6.rect.left, _local6.rect.top, _local6.rect.width, _local6.rect.height, false, _local4);
depthManager.layer_ground_bmd.copyPixels(_local9, _local7, _local8, null, null, true);
};
}
function CopyPixels(_arg1:BitmapData, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:Boolean=false, _arg7:Boolean=false):BitmapData{
var _local8:BitmapData;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
_local8 = new BitmapData(_arg4, _arg5, true, 0xFFFFFF);
_arg1.lock();
_local8.lock();
_local9 = 0;
_local10 = 0;
_local11 = 0;
_local12 = _arg2;
while (_local12 < (_arg2 + _arg4)) {
_local13 = 0;
_local14 = _arg3;
while (_local14 < (_arg3 + _arg5)) {
if (_arg6){
_local9 = ((_arg5 - _local13) - 1);
} else {
_local9 = _local13;
};
if (_arg7){
_local10 = ((_arg4 - _local11) - 1);
} else {
_local10 = _local11;
};
_local8.setPixel32(_local10, _local9, _arg1.getPixel32(_local12, _local14));
_local13++;
_local14++;
};
_local11++;
_local12++;
};
_arg1.unlock();
_local8.unlock();
return (_local8);
}
private function onEnterFrame(_arg1:Event):void{
initialize();
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function localToLocal(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Point=null):Point{
var _local4:Point;
_local4 = (_arg3) ? _arg3 : new Point();
_local4 = _arg1.localToGlobal(_local4);
_local4 = _arg2.globalToLocal(_local4);
return (_local4);
}
}
}//package com.tanoku.MoreZombies
Section 95
//Globals (com.tanoku.MoreZombies.Globals)
package com.tanoku.MoreZombies {
import com.cheezeworld.utils.*;
import flash.net.*;
public class Globals {
public static var CONTACT:int = 0;
public static var CONGELAR:String = "freeze";
public static var FIRE_GROUP_STINGER:int = 11;
public static var GameOver:Boolean = false;
public static var FIRE_GROUP_FIREARM1:int = 2;
public static var EASY:int = 1;
public static var SONIDO_ACTIVO:Boolean = true;
public static var comboPlayer:int = 1;
public static var WINCHESTER:int = 20;
public static var KEY_MOVE_RIGHT:int = KeyCode.D;
public static var ZONA_PARTIDA:int = 1;
public static var DAMAGED2:String = "damaged2";
public static var DAMAGED4:String = "damaged4";
public static var FIRE_GROUP_FLAMETHROWER:int = 6;
public static var ATACK_EXTINGUISHER:String = "extinguisher";
public static var RADIAL_DISTANCE:int = 450;
public static var DAMAGED3:String = "damaged3";
public static var FIRE_GROUP_AITSO:int = 12;
public static var URL_SCORES_STORY:String = "http://rankz.armorbot.com/MoreZombies_Story_Test/";
public static var RANK:Number = 0;
public static var STINGER:String = "stinger";
public static var ARDER:String = "burn";
public static var BARRILES_RESTANTES:Number = 0;
public static var currentMusic:String = "";
public static var DAMAGED1:String = "damaged1";
public static var arma_melee:String = "Hot Dog Fork";
public static var CAEDELANTE:String = "caedelante";
public static var HEAD:int = 0;
public static var MAX_RANK:Number = 0;
public static var CAKE_BOMB:int = 12;
public static var FIRE_GROUP_EXTINGUISHER:int = 7;
public static var ExitGame:Boolean = false;
public static var LAST_HIT:Number = 0;
public static var BASIC_BULLET:int = 1;
public static var MAX_RANK_H:Number = 0;
public static var WALK_INV:String = "walk_inv";
public static var muertesMotosierra:Number = 0;
public static var AMPUTAMITADBACK:String = "amputamitadback";
public static var KEY_MOVE_DOWN:int = KeyCode.S;
public static var Colision_Zombie:Number = 4;
public static var KEY_SELECT_MELEE:int = KeyCode.ONE;
public static var SCORE_SURVIVAL:Number = 0;
public static var Colisiones:Boolean = true;
public static var LATERAL_RESPAWN:int = 1;
public static var SCORE:Number = 0;
public static var ATACK_CHAINSAW:String = "chainsaw";
public static var FIRE_GROUP_THROW:int = 8;
public static var OLEADA_ACTUAL:Number = 0;
public static var leftLimit:Boolean = false;
public static var BRAIN_BOMB:int = 9;
public static var TANK_MINE:int = 6;
public static var RUN:String = "run";
public static var ZOMBIES_RESTANTES:Number = 0;
public static var FIRE_GROUP_CHAINSAW:int = 5;
public static var COLT_PYTHON:int = 17;
public static var AITSO:int = 16;
public static var DIFICULTAD_PARTIDA:int = 1;
public static var FREEZED:String = "freezed";
public static var ATACK_THROW:String = "throw";
public static var GameFinished:Boolean = false;
public static var ATACK1_1:String = "atack1_1";
public static var FIREARM1:String = "atack_firearm1";
public static var URL_SCORES_SURVIVAL:String = "http://rankz.armorbot.com/MoreZombies_Survival_Test/";
public static var FIREARM3:String = "atack_firearm3";
public static var FIREARM2:String = "atack_firearm2";
public static var KILLS:Number = 0;
public static var GameLoaded:Boolean = false;
public static var VERSION:Number = 0.74;
public static var arma_slot1:String = "M9";
public static var arma_slot2:String = "";
public static var arma_slot3:String = "";
public static var puntosZombie:Number = 1000;
public static var zombiesCongelados:Number = 0;
public static var AITSOC:String = "aitso";
public static var arma_slot4:String = "";
public static var FIRE_GROUP_MINE_DETONATOR:int = 10;
public static var THROW:int = 3;
public static var SCORE_STORY:Number = 0;
public static var GameLoading:Boolean = false;
public static var GameEnEspera:Boolean;
public static var P_BASICO:Number = 0;
public static var depthObjects:int = 0;
public static var muertesArma:Number = 0;
public static var TIME:Number = 0;
public static var CHOFTOP:String = "choftop";
public static var CHOFHEAD:String = "chofhead";
public static var Z_VELOCIDAD_MIN:Number = 0;
public static var AMPUTACABEZA:String = "amputacabeza";
public static var NORMAL:int = 2;
public static var RADIAL_RESPAWN:int = 2;
public static var HARD:int = 3;
public static var KEY_SELECT_SLOT1:int = KeyCode.TWO;
public static var KEY_SELECT_SLOT2:int = KeyCode.THREE;
public static var GamePreloading:Boolean = true;
public static var KEY_SELECT_SLOT4:int = KeyCode.FIVE;
public static var Z_DAMAGE:Number = 0;
public static var RANK_H:Number = 0;
public static var BACK:int = 1;
public static var MunicionInfinita:Boolean = false;
public static var KEY_SELECT_SLOT3:int = KeyCode.FOUR;
public static var FIRE_GROUP_MELEE:int = 1;
public static var FREEZE_MINE:int = 7;
public static var BITE:String = "bite";
public static var CAPITULO_HISTORIA:int = 1;
public static var CHOFALL:String = "chofall";
public static var rightLimit:Boolean = false;
public static var VOLUMEN_MUSICA:Number = 0.5;
public static var MACHINE_GUN:int = 21;
public static var PERSONAL_MINE:int = 5;
public static var MEDIUM_BULLET:int = 2;
public static var SCORE_DEFENDER:Number = 0;
public static var WIDTH_MAP:int = 0;
public static var P_MORDEDOR:Number = 0;
public static var Colision_Player:Number = 2;
public static var CALIDAD:String = "HIGH";
public static var P_BOMBA:Number = 0;
public static var KEY_SWITCH:int = KeyCode.SPACEBAR;
public static var Z_VIDA:Number = 0;
public static var ULTIMO_ZOMBIE_MUERTO:Number = 0;
public static var STORY_MODE_COMPLETED:Boolean = false;
public static var DESERT_EAGLE:int = 18;
public static var KILLS_H:Number = 0;
public static var AGUN:int = 2;
public static var HITS:Number = 0;
public static var PLAYER_NAME:String = "";
public static var SCORE_TIMEATTACK:Number = 0;
public static var URL_SCORES_TIMEATTACK:String = "http://rankz.armorbot.com/MoreZombies_TimeAttack_Test/";
public static var KEY_ATTACK_RIGHT:int = KeyCode.L;
public static var HEIGHT_DIF:int = 30;
public static var MULTIPLIER_H:Number = 0;
public static var OLEADA_FINAL:Number = 0;
public static var IZQ:int = -1;
public static var URL_SCORES_DEFENDER:String = "http://rankz.armorbot.com/MoreZombies_Defender_Test/";
public static var MELEE3:String = "atack_melee3";
public static var ATACK_CONTACT_01:String = "atack_contact_01";
public static var MELEE1:String = "atack_melee1";
public static var MELEE4:String = "atack_melee4";
public static var MELEE2:String = "atack_melee2";
public static var muertesLanzallamas:Number = 0;
public static var TIEMPO_RESTANTE:Number = 0;
public static var saveManager:SaveManager = SaveManager.getInstance();
public static var ATACK_FIREARM1:String = "firearm1";
public static var GERMAN_GRENADE:int = 11;
public static var muertesZombiesPayasos:Number = 0;
public static var muertesEspecial:Number = 0;
public static var ATACK_FIREARM2:String = "firearm2";
public static var ATACK_FIREARM3:String = "firearm3";
public static var FLAMETHROWER:int = 14;
public static var CHAINSAW:int = 13;
public static var enemyListGlobal:Array;
public static var RANDOM_RESPAWN:int = 0;
public static var muertesTotal:Number = 0;
public static var CAEDETRAS:String = "caedetras";
public static var ATACK2:String = "atack2";
public static var ATACK3:String = "atack3";
public static var KEY_ATTACK_LEFT:int = KeyCode.K;
public static var lastWeaponKills:Number = 0;
public static var ATACK4:String = "atack4";
public static var lastWeaponIndex:Number = 0;
public static var TIPO_PARTIDA:String;
public static var BODY:int = 1;
public static var STRONG_BULLET:int = 3;
public static var ATACK_MINE:String = "mine";
public static var ARRAY_P_IA:Array;
public static var Colision_Estatica:Number = 1;
public static var SPAS12:int = 19;
public static var MGUN:int = 1;
public static var KEY_MOVE_LEFT:int = KeyCode.A;
public static var EXTINGUISHER:int = 15;
public static var PINEAPPLE_GRENADE:int = 10;
public static var SCORE_H:Number = 0;
public static var ATACK1:String = "atack1";
public static var ATACK_DETONATOR:String = "detonator";
public static var MULTIPLIER:Number = 0;
public static var WIN:String = "WIN";
public static var AMPUTAMITAD:String = "amputamitad";
public static var MUSICA_ACTIVA:Boolean = true;
public static var muertesMelee:Number = 0;
public static var KEY_MOVE_UP:int = KeyCode.W;
public static var GamePaused_Screen:Boolean = false;
public static var FIRE_GROUP_FIREARM2:int = 3;
public static var DESINTEGRAR:String = "desintegrate";
public static var IDLE:String = "idle";
public static var KEY_PAUSE:int = KeyCode.P;
public static var VIDA_CARRITO:Number = 0;
public static var WALK:String = "walk";
public static var AMPUTAZATOICHI:String = "amputazatoichi";
public static var BASIC_MISSILE:int = 4;
public static var ATACK_FLAMETHROWER:String = "flamethrower";
public static var FIRE_GROUP_FIREARM3:int = 4;
public static var GamePaused:Boolean;
public static var SANGRE_ACTIVA:Boolean = true;
public static var Z_VELOCIDAD_MAX:Number = 0;
public static var DER:int = 1;
public static var C4_BOMB:int = 8;
public static var DIED:String = "die";
public static var DIE_FREEZED:String = "die_freezed";
public static var muertesExplosion:Number = 0;
public static var FRONTAL:int = 0;
public static var RUN_INV:String = "run_inv";
public static var FIRE_GROUP_MINE:int = 9;
public static function webSponsor(){
navigateToURL(new URLRequest("http://www.maxgames.com"), "_black");
}
public static function deleteNow(_arg1){
_arg1 = null;
}
public static function webTanoku(){
navigateToURL(new URLRequest("http://www.tanoku.com"), "_black");
}
}
}//package com.tanoku.MoreZombies
Section 96
//Grenade (com.tanoku.MoreZombies.Grenade)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class Grenade extends MovieClip {
public var throwAnim:Boolean;// = true
public var xvel:int;// = 0
public var bulletOffset:Number;// = 0
public var yorig:Number;
public var weaponDef:Weapon;
public var gravity:Number;// = 5
public var speed:Number;// = 1
var distanceTotal:Number;// = 0
var diferencia_altura:Number;// = 0
public var timeLeft:Number;// = 0
public var remove:Boolean;// = false
public var firepower:Number;// = 0
public var damageOnImpact:Boolean;// = true
public var ydest:Number;
public var damage2:Number;// = 1
public var damage3:Number;// = 1
public var dir:int;// = 0
public var yvel:int;// = 0
public var damage1:Number;
var botes:int;// = 0
public var xorig:Number;
public var alive:Boolean;
public var angle:Number;// = 0
var diferencia_anchura:Number;// = 0
public var vida_pixeles:int;
var ubicada:Boolean;// = false
var distanceX:Number;// = 0
var distanceY:Number;// = 0
public var pushFactor:Number;// = 0
public var recalc:Boolean;// = false
public var xdest:Number;
public var tipo;
public var range:Number;// = 1
public var rotacion:Number;// = 10
public var pushOnImpact:Boolean;// = true
public var time_effect:Number;// = 0
public var damage_range1:Number;// = 1
public var damage_range2:Number;// = 1
public var damage_range3:Number;// = 1
private var depthManager:DepthManager;
public var damage:Number;// = 1
public var playerObject:Object;
public var dirx:Number;// = 0
var punto_rebote:Number;// = 0
private var soundManager:SoundManager;
public var body:MovieClip;
public var diry:Number;// = 0
public var ready:Boolean;// = false
public var explosion_time:Number;// = 0
public var targetList:Array;
public function Grenade():void{
depthManager = DepthManager.getInstance();
soundManager = SoundManager.getInstance();
remove = false;
speed = 1;
xvel = 0;
yvel = 0;
bulletOffset = 0;
dir = 0;
tipo = Globals.C4_BOMB;
range = 1;
damage = 1;
damage_range1 = 1;
damage2 = 1;
damage_range2 = 1;
damage3 = 1;
damage_range3 = 1;
time_effect = 0;
explosion_time = 0;
ready = false;
throwAnim = true;
recalc = false;
timeLeft = 0;
pushOnImpact = true;
pushFactor = 0;
damageOnImpact = true;
distanceX = 0;
distanceY = 0;
distanceTotal = 0;
punto_rebote = 0;
dirx = 0;
diry = 0;
angle = 0;
firepower = 0;
gravity = 5;
rotacion = 10;
diferencia_altura = 0;
diferencia_anchura = 0;
ubicada = false;
botes = 0;
super();
stop();
}
public function finalize(){
remove = true;
removeEventListener(Juego.FINALIZE, finalize);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
delete ??getglobalscope
[this];
Globals.deleteNow(this);
}
public function detonate(){
alive = false;
Explode(this);
finalize();
}
public function updateGrenade(){
if ((((ubicada == false)) && (!((body == null))))){
ubicada = true;
body.x = diferencia_anchura;
body.y = diferencia_altura;
body.rotation = (Math.random() * 360);
};
diry = (diry + gravity);
body.rotation = (body.rotation + rotacion);
body.x = (body.x + (dirx / 50));
body.y = (body.y + (diry / 50));
visible = true;
if (body.y >= 0){
body.y = 0;
botes = (botes + 1);
rotacion = (rotacion / 2);
diry = (diry * -1);
gravity = (gravity * 3);
};
if (botes >= 6){
rotacion = 0;
gravity = 0;
dirx = 0;
diry = 0;
body.y = 0;
};
}
public function recieveDamage(_arg1, _arg2:Boolean=true){
}
private function onEnterFrame(_arg1:Event):void{
if (!Globals.GamePaused){
if (recalc == true){
recalc = false;
explosion_time = (getTimer() + timeLeft);
};
update();
} else {
if (recalc == false){
timeLeft = (explosion_time - getTimer());
recalc = true;
};
};
if ((((Globals.ExitGame == true)) || ((Globals.GameFinished == true)))){
finalize();
};
}
public function Explode(_arg1){
var _local2:Point;
var _local3:Explosion;
var _local4:int;
var _local5:*;
soundManager.playSound("GranadaExplosion", 1, 1);
_local2 = localToLocal(this.body, parent);
_local3 = new Explosion("granada", _local2.x, _local2.y);
_local4 = 0;
while (_local4 < targetList.length) {
_local5 = targetList[_local4];
if (_local5.alive){
distanceX = (_local2.x - _local5.x);
distanceY = (_local2.y - _local5.y);
distanceTotal = Math.sqrt(((distanceX * distanceX) + (distanceY * distanceY)));
if (distanceTotal <= damage_range3){
if (distanceTotal <= damage_range1){
range = 1;
damage = damage1;
} else {
if (distanceTotal <= damage_range2){
range = 2;
damage = damage2;
} else {
range = 3;
damage = damage3;
};
};
_local5.recieveDamage(this);
};
};
_local4++;
};
distanceX = (_local2.x - playerObject.x);
distanceY = (_local2.y - playerObject.y);
distanceTotal = Math.sqrt(((distanceX * distanceX) + (distanceY * distanceY)));
if (distanceTotal <= damage_range3){
if (distanceTotal <= damage_range1){
range = 1;
damage = damage1;
} else {
if (distanceTotal <= damage_range2){
range = 2;
damage = damage2;
} else {
range = 3;
damage = damage3;
};
};
playerObject.recieveDamage(this);
};
}
private function update(){
if (alive){
updateGrenade();
if (getTimer() > explosion_time){
detonate();
};
};
}
public function initialize():void{
var _local1:*;
var _local2:*;
remove = false;
alive = true;
visible = false;
explosion_time = (getTimer() + time_effect);
firepower = 600;
if (tipo == Globals.PINEAPPLE_GRENADE){
gotoAndStop("PINEAPPLE");
firepower = 300;
} else {
if (tipo == Globals.GERMAN_GRENADE){
gotoAndStop("GERMAN");
} else {
if (tipo == Globals.CAKE_BOMB){
gotoAndStop("CAKE");
};
};
};
diferencia_altura = (yorig - playerObject.y);
diferencia_anchura = (xorig - playerObject.x);
gravity = 60;
angle = 0;
rotacion = ((Math.random() * 7) + 3);
angle = 720;
_local1 = (x + (48 * Math.cos(((angle * Math.PI) / 180))));
_local2 = (y + (48 * Math.sin(((angle * Math.PI) / 180))));
x = playerObject.x;
y = playerObject.y;
dirx = (Math.cos(((angle * Math.PI) / 180)) * firepower);
diry = (Math.sin(((angle * Math.PI) / 180)) * firepower);
if (dir == Globals.DER){
};
if (dir == Globals.IZQ){
rotacion = (rotacion * -1);
dirx = (dirx * -1);
};
depthManager.addObject(this);
addEventListener(Juego.FINALIZE, finalize);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function localToLocal(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Point=null):Point{
var _local4:Point;
_local4 = (_arg3) ? _arg3 : new Point();
_local4 = _arg1.localToGlobal(_local4);
_local4 = _arg2.globalToLocal(_local4);
return (_local4);
}
}
}//package com.tanoku.MoreZombies
Section 97
//historia (com.tanoku.MoreZombies.historia)
package com.tanoku.MoreZombies {
import flash.events.*;
import flash.display.*;
import mochi.as3.*;
import flash.text.*;
public class historia extends MovieClip {
public var b_metro:MovieClip;
public var b_more:SimpleButton;
public var bestscore:TextField;
public var t_score_labell:TextField;
public var b_start:SimpleButton;
public var b_terraza:MovieClip;
public var b_ranking:SimpleButton;
public var b_armory:SimpleButton;
public var mapa:MovieClip;
public var main_class:MovieClip;
public var b_calle:MovieClip;
public var b_back:SimpleButton;
public var b_options:SimpleButton;
public var maxgames:SimpleButton;
public var b_parque:MovieClip;
public function historia(){
b_back.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_options.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_armory.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_start.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_ranking.visible = false;
t_score_labell.visible = false;
bestscore.visible = false;
b_more.addEventListener(MouseEvent.CLICK, on_button_clicked);
maxgames.addEventListener(MouseEvent.CLICK, on_button_clicked);
estadoModoHistoria();
bestscore.text = ("" + Globals.SCORE_STORY);
}
private function seleccionarZona():void{
trace("cambio mapa");
mapa.gotoAndStop(Globals.ZONA_PARTIDA);
if (Globals.ZONA_PARTIDA > 4){
Globals.ZONA_PARTIDA = 1;
};
switch (Globals.ZONA_PARTIDA){
case 1:
b_parque.gotoAndStop(2);
b_metro.gotoAndStop(1);
b_calle.gotoAndStop(1);
b_terraza.gotoAndStop(1);
break;
case 2:
b_parque.gotoAndStop(1);
b_metro.gotoAndStop(2);
b_calle.gotoAndStop(1);
b_terraza.gotoAndStop(1);
break;
case 3:
b_parque.gotoAndStop(1);
b_metro.gotoAndStop(1);
b_calle.gotoAndStop(2);
b_terraza.gotoAndStop(1);
break;
case 4:
b_parque.gotoAndStop(1);
b_metro.gotoAndStop(1);
b_calle.gotoAndStop(1);
b_terraza.gotoAndStop(2);
break;
};
}
public function on_button_out(_arg1:MouseEvent){
}
public function lanzar_juego(){
main_class.abre_pelicula(Globals.ZONA_PARTIDA);
}
public function on_button_over(_arg1:MouseEvent){
switch (_arg1.target.name){
};
}
public function abrir_web_puntuaciones(){
var o:Object;
var boardID:String;
o = {n:[9, 10, 10, 5, 15, 4, 6, 8, 14, 0, 6, 12, 10, 15, 6, 11], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
boardID = o.f(0, "");
MochiScores.showLeaderboard({boardID:boardID, onClose:function ():void{
}});
}
public function on_button_clicked(_arg1:MouseEvent){
switch (_arg1.currentTarget.name){
case "b_more":
Globals.webSponsor();
break;
case "maxgames":
Globals.webSponsor();
break;
case "b_parque":
Globals.ZONA_PARTIDA = 1;
seleccionarZona();
break;
case "b_metro":
Globals.ZONA_PARTIDA = 2;
seleccionarZona();
break;
case "b_calle":
Globals.ZONA_PARTIDA = 3;
seleccionarZona();
break;
case "b_terraza":
Globals.ZONA_PARTIDA = 4;
seleccionarZona();
break;
case "b_back":
main_class.cierra_pantalla(this);
main_class.abre_pantalla(new principal(), "pelicula");
break;
case "b_armory":
main_class.abre_pantalla(new armeria(), "cortina");
break;
case "b_options":
main_class.abre_pantalla(new opciones(), "cortina");
break;
case "b_start":
main_class.cierra_pantalla(this);
lanzar_juego();
break;
case "b_ranking":
abrir_web_puntuaciones();
break;
default:
trace((_arg1.target.name + " UNDEFINED"));
break;
};
}
private function estadoModoHistoria():void{
Globals.ZONA_PARTIDA = Globals.CAPITULO_HISTORIA;
if (Globals.ZONA_PARTIDA >= 1){
b_parque.addEventListener(MouseEvent.CLICK, on_button_clicked);
} else {
b_parque.alpha = 0.5;
};
if (Globals.ZONA_PARTIDA >= 2){
b_metro.addEventListener(MouseEvent.CLICK, on_button_clicked);
} else {
b_metro.alpha = 0.5;
};
if (Globals.ZONA_PARTIDA >= 3){
b_calle.addEventListener(MouseEvent.CLICK, on_button_clicked);
} else {
b_calle.alpha = 0.5;
};
if (Globals.ZONA_PARTIDA >= 4){
b_terraza.addEventListener(MouseEvent.CLICK, on_button_clicked);
} else {
b_terraza.alpha = 0.5;
};
seleccionarZona();
}
}
}//package com.tanoku.MoreZombies
Section 98
//Humo (com.tanoku.MoreZombies.Humo)
package com.tanoku.MoreZombies {
import flash.events.*;
import flash.display.*;
public class Humo extends MovieClip {
private var depthManager:DepthManager;
var mc_humo:stingermissile_smoke;
public var remove:Boolean;// = false
private var contenedor:MovieClip;
public function Humo(_arg1, _arg2, _arg3:Number=0, _arg4:Number=0, _arg5=0):void{
depthManager = DepthManager.getInstance();
remove = false;
super();
mc_humo = new stingermissile_smoke();
stop();
if (_arg5 == Globals.DER){
x = _arg1;
scaleX = 1;
} else {
x = _arg1;
scaleX = -1;
};
y = _arg2;
mc_humo.x = _arg3;
mc_humo.y = _arg4;
mc_humo.rotation = (Math.random() * 360);
addChild(mc_humo);
contenedor = depthManager.layer_mc;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function finalize(){
remove = true;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
delete ??getglobalscope
[this];
Globals.deleteNow(this);
}
public function initialize():void{
gotoAndPlay(1);
contenedor.addChild(this);
depthManager.addObject(this);
}
private function onEnterFrame(_arg1:Event):void{
initialize();
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
}
}//package com.tanoku.MoreZombies
Section 99
//Interfaz (com.tanoku.MoreZombies.Interfaz)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import gs.easing.*;
import flash.text.*;
public class Interfaz extends MovieClip {
public var slot_2_weapon_ammo:TextField;
public var cartelCombo:MovieClip;
public var vida_temporal:Number;// = 0
public var trofeos:MovieClip;
public var rank:MovieClip;
public var slot_0_weapon:TextField;
public var vida_actual:Number;// = 0
public var barriles_restantes:MovieClip;
public var puntuacion_temporal:Number;// = 0
public var slot_3_weapon_ammo:TextField;
public var tiempo_actual:Number;// = 0
public var multiplicador:TextField;
public var tiempo:MovieClip;
public var t_lastArma:TextField;
public var matados:TextField;
private var zombieManager:ZombieManager;
public var slot_3_weapon:TextField;
public var zombies_restantes:MovieClip;
public var hits_anterior:Number;// = 0
public var slot_0_weapon_ammo:TextField;
public var slot_4_weapon_ammo:TextField;
public var slot_1_weapon:TextField;
public var rank_actual:Number;// = 0
private var weaponShop:WeaponShop;
public var hits:MovieClip;
public var num_zombies:TextField;
public var rank_anterior:Number;// = 0
public var hits_actual:Number;// = 0
public var t_numObjects:TextField;
public var oleada:TextField;
public var slot_1_weapon_ammo:TextField;
public var vida_player:MovieClip;
public var puntuacion_actual:Number;// = 0
public var panel_armas:MovieClip;
var tiempo_temp:Timer;
public var puntuacion:TextField;
public var current_weapon:TextField;
public var slot_4_weapon:TextField;
public var player_:Player;
public var maxgames:SimpleButton;
private var weaponManager:WeaponManager;
public var vida_carrito:MovieClip;
public var slot_2_weapon:TextField;
public function Interfaz():void{
weaponManager = WeaponManager.getInstance();
weaponShop = WeaponShop.getInstance();
zombieManager = ZombieManager.getInstance();
puntuacion_actual = 0;
puntuacion_temporal = 0;
vida_actual = 0;
vida_temporal = 0;
tiempo_actual = 0;
hits_actual = 0;
rank_actual = 0;
hits_anterior = 0;
rank_anterior = 0;
tiempo_temp = new Timer(2000);
super();
maxgames.addEventListener(MouseEvent.CLICK, manejarClickSponsor);
}
public function timerHandlerPanelCombo(_arg1:TimerEvent):void{
tiempo_temp.removeEventListener("timer", timerHandlerPanelCombo);
tiempo_temp.stop();
TweenLite.to(cartelCombo, 0.5, {x:450});
}
public function finalize(){
weaponManager.removeEventListener(WeaponManager.UPDATE, UpdateWeapons);
player_.eDispatcher.removeEventListener(Player.UPDATE, UpdatePlayer);
delete ??getglobalscope
[this];
Globals.deleteNow(this);
}
public function ocultar_panel_rank(){
TweenLite.to(rank, 0.1, {x:-600});
}
private function manejarClickSponsor(_arg1:MouseEvent):void{
Globals.webSponsor();
}
private function UpdateWeapons(_arg1:Event):void{
if (weaponManager.weaponList[0] != null){
slot_0_weapon.text = weaponManager.weaponList[0].name;
panel_armas.estado_melee.gotoAndStop(1);
if (weaponManager.currentWeapon == 0){
panel_armas.estado_melee.gotoAndStop(2);
} else {
panel_armas.estado_melee.gotoAndStop(3);
};
panel_armas.arma_melee.gotoAndStop(weaponManager.weaponList[0].index);
if (weaponManager.weaponList[0].ammo){
slot_0_weapon_ammo.text = ((weaponManager.weaponList[0].current_ammo + "/") + weaponManager.weaponList[0].max_ammo);
} else {
slot_0_weapon_ammo.text = "";
};
} else {
panel_armas.arma_melee.gotoAndStop(1);
panel_armas.estado_melee.gotoAndStop(1);
slot_0_weapon.text = "EMPTY";
slot_0_weapon_ammo.text = "";
};
if (weaponManager.weaponList[1] != null){
slot_1_weapon.text = weaponManager.weaponList[1].name;
panel_armas.estado_slot1.gotoAndStop(1);
if (weaponManager.currentWeapon == 1){
panel_armas.estado_slot1.gotoAndStop(2);
} else {
if (weaponManager.currentWeaponSlot == 1){
panel_armas.estado_slot1.gotoAndStop(3);
};
};
panel_armas.arma_slot1.gotoAndStop(weaponManager.weaponList[1].index);
if (((weaponManager.weaponList[1].ammo) && ((Globals.MunicionInfinita == false)))){
if (Globals.MunicionInfinita == true){
slot_1_weapon_ammo.text = "infinite";
panel_armas.municion_slot1.text = "x inf.";
} else {
slot_1_weapon_ammo.text = ("x" + weaponManager.weaponList[1].current_ammo);
panel_armas.municion_slot1.text = ("x" + weaponManager.weaponList[1].current_ammo);
};
} else {
slot_1_weapon_ammo.text = "infinite";
panel_armas.municion_slot1.text = "x inf.";
};
} else {
panel_armas.arma_slot1.gotoAndStop(1);
panel_armas.estado_slot1.gotoAndStop(1);
panel_armas.municion_slot1.text = "";
slot_1_weapon.text = "EMPTY";
slot_1_weapon_ammo.text = "";
};
if (weaponManager.weaponList[2] != null){
slot_2_weapon.text = weaponManager.weaponList[2].name;
panel_armas.estado_slot2.gotoAndStop(1);
if (weaponManager.currentWeapon == 2){
panel_armas.estado_slot2.gotoAndStop(2);
} else {
if (weaponManager.currentWeaponSlot == 2){
panel_armas.estado_slot2.gotoAndStop(3);
};
};
panel_armas.arma_slot2.gotoAndStop(weaponManager.weaponList[2].index);
if (((weaponManager.weaponList[2].ammo) && ((Globals.MunicionInfinita == false)))){
if (Globals.MunicionInfinita == true){
slot_2_weapon_ammo.text = "infinite";
panel_armas.municion_slot2.text = "x inf.";
} else {
slot_2_weapon_ammo.text = ("x" + weaponManager.weaponList[2].current_ammo);
panel_armas.municion_slot2.text = ("x" + weaponManager.weaponList[2].current_ammo);
};
} else {
slot_2_weapon_ammo.text = "infinite";
panel_armas.municion_slot2.text = "x inf.";
};
} else {
panel_armas.arma_slot2.gotoAndStop(1);
panel_armas.estado_slot2.gotoAndStop(1);
panel_armas.municion_slot2.text = "";
slot_2_weapon.text = "EMPTY";
slot_2_weapon_ammo.text = "";
};
if (weaponManager.weaponList[3] != null){
slot_3_weapon.text = weaponManager.weaponList[3].name;
panel_armas.estado_slot3.gotoAndStop(1);
if (weaponManager.currentWeapon == 3){
panel_armas.estado_slot3.gotoAndStop(2);
} else {
if (weaponManager.currentWeaponSlot == 3){
panel_armas.estado_slot3.gotoAndStop(3);
};
};
panel_armas.arma_slot3.gotoAndStop(weaponManager.weaponList[3].index);
if (weaponManager.weaponList[3].ammo){
if (Globals.MunicionInfinita == true){
slot_3_weapon_ammo.text = "infinite";
panel_armas.municion_slot3.text = "x inf.";
} else {
slot_3_weapon_ammo.text = ("x" + weaponManager.weaponList[3].current_ammo);
panel_armas.municion_slot3.text = ("x" + weaponManager.weaponList[3].current_ammo);
};
} else {
slot_3_weapon_ammo.text = "infinite";
panel_armas.municion_slot3.text = "x inf.";
};
} else {
panel_armas.arma_slot3.gotoAndStop(1);
panel_armas.estado_slot3.gotoAndStop(1);
panel_armas.municion_slot3.text = "";
slot_3_weapon.text = "EMPTY";
slot_3_weapon_ammo.text = "";
};
if (weaponManager.weaponList[4] != null){
slot_4_weapon.text = weaponManager.weaponList[4].name;
panel_armas.estado_slot4.gotoAndStop(1);
if (weaponManager.currentWeapon == 4){
panel_armas.estado_slot4.gotoAndStop(2);
} else {
if (weaponManager.currentWeaponSlot == 4){
panel_armas.estado_slot4.gotoAndStop(3);
};
};
panel_armas.arma_slot4.gotoAndStop(weaponManager.weaponList[4].index);
if (weaponManager.weaponList[4].ammo){
if (Globals.MunicionInfinita == true){
slot_4_weapon_ammo.text = "infinite";
panel_armas.municion_slot4.text = "x inf.";
} else {
slot_4_weapon_ammo.text = ("x" + weaponManager.weaponList[4].current_ammo);
panel_armas.municion_slot4.text = ("x" + weaponManager.weaponList[4].current_ammo);
};
} else {
slot_4_weapon_ammo.text = "infinite";
panel_armas.municion_slot4.text = "x inf.";
};
} else {
panel_armas.arma_slot4.gotoAndStop(1);
panel_armas.estado_slot4.gotoAndStop(1);
panel_armas.municion_slot4.text = "";
slot_4_weapon.text = "EMPTY";
slot_4_weapon_ammo.text = "";
};
}
public function mostrar_panel_hits(){
hits.visible = true;
TweenLite.to(hits, 0.3, {x:-287.9, ease:Back.easeOut});
}
public function update(){
var _local1:Number;
var _local2:Number;
var _local3:String;
var _local4:String;
var _local5:String;
var _local6:Number;
_local1 = Math.floor((Globals.TIEMPO_RESTANTE / 1000));
_local2 = Math.floor((_local1 / 60));
_local1 = (_local1 % 60);
_local2 = (_local2 % 60);
_local3 = _local1.toString();
_local4 = _local2.toString();
if (_local3.length < 2){
_local3 = ("0" + _local3);
};
if (_local4.length < 2){
_local4 = ("" + _local4);
};
_local5 = ((_local4 + ":") + _local3);
tiempo.mc_reloj.reloj.text = _local5;
tiempo.mc_reloj2.reloj.text = _local5;
tiempo.mc_reloj.setMask = tiempo.mc_mascara;
if (vida_actual != vida_temporal){
if (vida_actual > vida_temporal){
vida_temporal = (vida_temporal + 1);
};
if (vida_actual < vida_temporal){
vida_temporal = (vida_temporal - 1);
};
vida_player.gotoAndStop(int(vida_temporal));
};
if (puntuacion_actual != puntuacion_temporal){
_local6 = ((puntuacion_actual - puntuacion_temporal) / 10);
if (puntuacion_actual > puntuacion_temporal){
puntuacion_temporal = (puntuacion_temporal + _local6);
};
if (puntuacion_temporal > puntuacion_actual){
puntuacion_temporal = puntuacion_actual;
};
puntuacion.text = ("" + puntuacion_temporal.toFixed(0));
};
multiplicador.text = ("" + player_.multiplicador);
t_numObjects.text = ("" + Globals.depthObjects);
hits_actual = Globals.HITS;
rank_actual = Globals.RANK;
if (hits_actual == 0){
ocultar_panel_hits();
ocultar_panel_rank();
} else {
if (hits_actual > 0){
mostrar_panel_hits();
};
hits.t_hits.text = (("" + Globals.HITS) + " HITS!");
if (hits_anterior != hits_actual){
};
if ((((rank_actual > 1)) && ((rank_anterior == rank_actual)))){
if (Globals.MAX_RANK < Globals.RANK){
Globals.MAX_RANK = Globals.RANK;
};
rank.gotoAndStop(Globals.RANK);
mostrar_panel_rank();
};
};
hits_anterior = hits_actual;
rank_anterior = rank_actual;
matados.text = ("" + Globals.KILLS);
oleada.text = "";
if (Globals.OLEADA_FINAL == 0){
oleada.text = ("" + Globals.OLEADA_ACTUAL);
} else {
if (Globals.OLEADA_ACTUAL <= Globals.OLEADA_FINAL){
oleada.text = ((Globals.OLEADA_ACTUAL + " of ") + Globals.OLEADA_FINAL);
} else {
oleada.text = ((Globals.OLEADA_FINAL + " of ") + Globals.OLEADA_FINAL);
};
};
if ((((Globals.TIPO_PARTIDA == "defender")) || ((((Globals.TIPO_PARTIDA == "story")) && ((Globals.ZONA_PARTIDA == 1)))))){
vida_carrito.vida.gotoAndStop(Globals.VIDA_CARRITO);
};
if ((((Globals.TIPO_PARTIDA == "story")) && ((Globals.ZONA_PARTIDA == 2)))){
zombies_restantes.restantes.text = Globals.ZOMBIES_RESTANTES;
};
if ((((Globals.TIPO_PARTIDA == "story")) && ((Globals.ZONA_PARTIDA == 3)))){
barriles_restantes.bidones.text = Globals.BARRILES_RESTANTES;
};
num_zombies.text = ("z: " + zombieManager.num_zombies_act);
t_lastArma.text = ((Globals.lastWeaponKills + " kills with ") + weaponShop.weaponList[Globals.lastWeaponIndex].name);
}
private function onFinishTweenPanelCombo():void{
tiempo_temp.addEventListener("timer", timerHandlerPanelCombo);
tiempo_temp.start();
}
private function UpdatePlayer(_arg1:Event):void{
vida_actual = player_.life;
puntuacion_actual = player_.puntuacion;
}
public function mostrar_panel_rank(){
rank.visible = true;
TweenLite.to(rank, 0.3, {x:-307.9, ease:Back.easeOut});
}
public function initialize(){
vida_actual = player_.life;
vida_temporal = player_.life;
vida_player.gotoAndStop(100);
puntuacion_actual = 0;
puntuacion_temporal = 0;
puntuacion.text = ("" + puntuacion_actual);
tiempo.visible = false;
if ((((Globals.TIPO_PARTIDA == "time_attack")) || ((((Globals.TIPO_PARTIDA == "story")) && ((Globals.ZONA_PARTIDA == 2)))))){
tiempo.visible = true;
};
vida_carrito.visible = false;
if ((((Globals.TIPO_PARTIDA == "defender")) || ((((Globals.TIPO_PARTIDA == "story")) && ((Globals.ZONA_PARTIDA == 1)))))){
vida_carrito.visible = true;
vida_carrito.vida.gotoAndStop(100);
};
zombies_restantes.visible = false;
if ((((Globals.TIPO_PARTIDA == "story")) && ((Globals.ZONA_PARTIDA == 2)))){
zombies_restantes.visible = true;
};
barriles_restantes.visible = false;
if ((((Globals.TIPO_PARTIDA == "story")) && ((Globals.ZONA_PARTIDA == 3)))){
barriles_restantes.bidones.text = "0";
barriles_restantes.visible = true;
};
trofeos.visible = false;
hits.visible = false;
rank.visible = false;
ocultar_panel_hits();
ocultar_panel_rank();
weaponManager.addEventListener(WeaponManager.UPDATE, UpdateWeapons);
weaponManager.dispatchEvent(new Event(WeaponManager.UPDATE));
player_.eDispatcher.addEventListener(Player.UPDATE, UpdatePlayer);
player_.eDispatcher.dispatchEvent(new Event(Player.UPDATE));
}
public function ocultar_panel_hits(){
TweenLite.to(hits, 0.1, {x:-500});
}
public function mostrar_panel_combo(_arg1:String=""){
cartelCombo.visible = true;
cartelCombo.cartel.info.text = ("" + _arg1);
cartelCombo.cartel2.info.text = ("" + _arg1);
cartelCombo.x = 450;
TweenLite.to(cartelCombo, 1, {x:0, onComplete:onFinishTweenPanelCombo});
}
}
}//package com.tanoku.MoreZombies
Section 100
//Item (com.tanoku.MoreZombies.Item)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class Item extends MovieClip {
public var cad_item:String;
public var life:Number;// = 10000
public var recalc:Boolean;// = false
public var mc_item:MovieClip;
public var die_time:Number;// = 0
public var tipo:String;
private var depthManager:DepthManager;
public var timeLeft:Number;// = 0
public var remove:Boolean;// = false
private var contenedor:MovieClip;
public var alive:Boolean;// = true
public var player_;
public var diferencia_altura_y:Number;// = 20
public function Item(_arg1:String="", _arg2:MovieClip=null):void{
depthManager = DepthManager.getInstance();
diferencia_altura_y = 20;
alive = true;
remove = false;
life = 10000;
die_time = 0;
recalc = false;
timeLeft = 0;
super();
if (_arg1 != ""){
stop();
tipo = _arg1;
contenedor = _arg2;
initialize();
};
}
public function finalize(){
alive = false;
remove = true;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
removeEventListener(Juego.FINALIZE, finalize);
delete ??getglobalscope
[this];
Globals.deleteNow(this);
}
private function onFinishTween():void{
finalize();
}
private function handleIA():void{
var _local1:Number;
if (alive){
if (this.hitTestObject(player_.body.hitarea)){
_local1 = (player_.y - y);
if (_local1 < 0){
_local1 = -(_local1);
};
if (_local1 <= diferencia_altura_y){
cad_item = player_.getItem(tipo);
alive = false;
pickUp();
};
};
};
}
private function handleAnim(){
}
public function initialize():void{
die_time = (getTimer() + life);
gotoAndStop(tipo);
depthManager.addObject(this);
addEventListener(Juego.FINALIZE, finalize);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function recieveDamage(_arg1, _arg2:Boolean=true){
}
private function onEnterFrame(_arg1:Event):void{
if (!Globals.GamePaused){
if (recalc == true){
recalc = false;
die_time = (getTimer() + timeLeft);
};
handleIA();
handleAnim();
update();
} else {
if (recalc == false){
timeLeft = (die_time - getTimer());
recalc = true;
};
};
if ((((Globals.ExitGame == true)) || ((Globals.GameFinished == true)))){
finalize();
};
}
public function pickUp(){
var _local1:Number;
var _local2:carteles_flotantes;
_local1 = 0.5;
TweenLite.to(mc_item, _local1, {y:-25, width:0, height:0, alpha:0});
_local2 = new carteles_flotantes();
_local2.cartel.info.text = ("" + cad_item);
_local2.cartel2.info.text = ("" + cad_item);
_local2.visible = true;
_local2.x = 0;
_local2.y = -(player_.height);
addChild(_local2);
TweenLite.to(_local2, (_local1 * 3.5), {y:(_local2.y - 10), alpha:0, onComplete:onFinishTween});
}
private function update(){
var _local1:Number;
if (alive){
if (getTimer() > die_time){
visible = true;
finalize();
} else {
_local1 = (die_time - getTimer());
if (_local1 < 3000){
visible = !(visible);
};
};
};
}
public static function localToLocal(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Point=null):Point{
var _local4:Point;
_local4 = (_arg3) ? _arg3 : new Point();
_local4 = _arg1.localToGlobal(_local4);
_local4 = _arg2.globalToLocal(_local4);
return (_local4);
}
}
}//package com.tanoku.MoreZombies
Section 101
//ItemManager (com.tanoku.MoreZombies.ItemManager)
package com.tanoku.MoreZombies {
import flash.display.*;
import flash.utils.*;
public class ItemManager {
public var layer_mc:MovieClip;
public var tiempo_respawn:int;// = 0
public var active:Boolean;// = false
private var margen_tiempo_muerte_zombie:Number;// = 10000
public var alto_mapa:Number;
public var next_tiempo_respawn:int;// = 0
public var playerObj;
public var tipo_partida:String;
public var tipo_respawn:int;// = 0
private var handleRespawnOn:Boolean;// = true
public var ancho_mapa:Number;
private var depthManager:DepthManager;
private var weaponManager:WeaponManager;
public static var instance:ItemManager;
public function ItemManager(_arg1:SingletonEnforcer){
depthManager = DepthManager.getInstance();
weaponManager = WeaponManager.getInstance();
tiempo_respawn = 0;
next_tiempo_respawn = 0;
tipo_respawn = 0;
handleRespawnOn = true;
active = false;
margen_tiempo_muerte_zombie = 10000;
super();
}
public function stop(){
handleRespawnOn = false;
}
public function update(){
if (((active) && (!(Globals.GameEnEspera)))){
if (handleRespawnOn){
handleRespawn();
};
};
}
public function start(){
next_tiempo_respawn = (getTimer() + tiempo_respawn);
handleRespawnOn = true;
active = true;
}
public function finalize(){
instance = null;
}
public function handleRespawn():void{
var _local1:int;
var _local2:Array;
var _local3:Boolean;
var _local4:int;
var _local5:Item;
var _local6:Number;
var _local7:int;
var _local8:int;
if ((((getTimer() > next_tiempo_respawn)) && (puedoCrearItem()))){
_local1 = ((Math.random() * 6) + 1);
_local2 = new Array();
if (playerObj.life < 50){
_local2.push("vida_100");
};
if (playerObj.life < 100){
_local2.push("vida_25");
};
_local3 = false;
if (Globals.MunicionInfinita == false){
_local7 = 0;
while (_local7 < weaponManager.weaponList.length) {
if (weaponManager.weaponList[_local7] != null){
if ((((weaponManager.weaponList[_local7].ammo == true)) && ((weaponManager.weaponList[_local7].clip > 0)))){
if (weaponManager.weaponList[_local7].current_ammo < weaponManager.weaponList[_local7].max_ammo){
_local2.push("municion");
};
};
};
_local7++;
};
};
_local2.push("puntos");
if (playerObj.multiplicador < 99){
_local2.push("multiplicador");
};
if ((((tipo_partida == "time_attack")) && ((Globals.TIEMPO_RESTANTE < 15000)))){
_local8 = (Math.random() * 100);
if (_local8 > 50){
_local2.push("tiempo");
};
};
_local4 = (Math.random() * _local2.length);
_local5 = new Item(_local2[_local4], layer_mc);
_local5.player_ = playerObj;
_local6 = (Math.random() * 450);
if (playerObj.x <= 225){
_local5.x = _local6;
} else {
if (playerObj.x >= (ancho_mapa - 225)){
_local5.x = ((ancho_mapa - 450) + _local6);
} else {
_local5.x = ((playerObj.x - 225) + _local6);
};
};
_local5.y = ((Math.random() * alto_mapa) - (Globals.HEIGHT_DIF * 3));
_local5.y = (_local5.y + (Globals.HEIGHT_DIF * 3));
if (_local5.y < 15){
_local5.y = 15;
};
layer_mc.addChild(_local5);
next_tiempo_respawn = (getTimer() + tiempo_respawn);
};
}
private function puedoCrearItem():Boolean{
var _local1:Boolean;
_local1 = false;
if (getTimer() > (Globals.ULTIMO_ZOMBIE_MUERTO + margen_tiempo_muerte_zombie)){
_local1 = false;
} else {
_local1 = true;
};
return (_local1);
}
public static function getInstance():ItemManager{
if (instance == null){
instance = new ItemManager(new SingletonEnforcer());
};
return (instance);
}
}
}//package com.tanoku.MoreZombies
class SingletonEnforcer {
private function SingletonEnforcer(){
}
}
Section 102
//Juego (com.tanoku.MoreZombies.Juego)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Juego extends MovieClip {
private var depthList:Array;
public var fondo:MovieClip;
public var ancho_mapa:int;
private var comboManager:ComboManager;
private var enemyList:Array;
public var m_iterations:Number;// = 10
var timerGameOver:Timer;
public var b:b2Body;
private var camara_:Camara;
private var paralaxManager:ParalaxManager;
public var m_dbgSprite;
var tiempo_respawn_item:Number;// = 0
private var contenedor:MovieClip;
public var mc_cartel:carteles_juego;
private var zombieManager:ZombieManager;
public var m_timestep:Number;// = 0.0333333333333333
public var area_juego:MovieClip;
private var logica;
public var ground_bitmap:Bitmap;
public var m_phys_scale:Number;// = 30
private var itemManager:ItemManager;
var timerStageOver:Timer;
private var weaponShop:WeaponShop;
public var alto_mapa:int;
public var m_world:b2World;
private var dificultad_juego:int;
public var ground_data:BitmapData;
private var depthManager:DepthManager;
public var main_class:MovieClip;
private var achievementManager:AchievementManager;
public var ground:MovieClip;
private var zona_juego:String;
private var soundManager:SoundManager;
public var playground:MovieClip;
public var jugador:Player;
private var musicManager:MusicManager;
private var modo_juego:String;
private var weaponManager:WeaponManager;
public var interfaz_:Interfaz;
public static const FINALIZE:String = "finalize";
public static var eDispatcher:EventDispatcher;
public function Juego(_arg1:MovieClip=null):void{
m_phys_scale = 30;
m_timestep = (1 / 30);
m_iterations = 10;
zombieManager = ZombieManager.getInstance();
itemManager = ItemManager.getInstance();
depthManager = DepthManager.getInstance();
weaponShop = WeaponShop.getInstance();
paralaxManager = ParalaxManager.getInstance();
weaponManager = WeaponManager.getInstance();
musicManager = MusicManager.getInstance();
soundManager = SoundManager.getInstance();
comboManager = ComboManager.getInstance();
achievementManager = AchievementManager.getInstance();
tiempo_respawn_item = 0;
super();
if (_arg1 != null){
contenedor = _arg1;
modo_juego = Globals.TIPO_PARTIDA;
dificultad_juego = Globals.DIFICULTAD_PARTIDA;
zona_juego = ("mapa" + Globals.ZONA_PARTIDA);
};
}
public function SetDebugDraw(){
var _local1:b2DebugDraw;
_local1 = new b2DebugDraw();
_local1.m_sprite = m_dbgSprite;
_local1.m_drawScale = m_phys_scale;
_local1.m_fillAlpha = 0.8;
_local1.m_lineThickness = 2;
_local1.m_drawFlags = (1 | 2);
m_world.SetDebugDraw(_local1);
}
public function timerHandlerStageOver(_arg1:TimerEvent):void{
timerStageOver.stop();
timerStageOver.removeEventListener("timer", timerHandlerStageOver);
Globals.GamePaused = true;
Globals.GamePaused_Screen = true;
Globals.ExitGame = true;
if (Globals.TIPO_PARTIDA == "story"){
Globals.ZONA_PARTIDA = (Globals.ZONA_PARTIDA + 1);
if (Globals.CAPITULO_HISTORIA < Globals.ZONA_PARTIDA){
Globals.CAPITULO_HISTORIA = Globals.ZONA_PARTIDA;
};
if (Globals.ZONA_PARTIDA <= 4){
main_class.abre_pantalla(new historia());
} else {
Globals.STORY_MODE_COMPLETED = true;
main_class.abre_pelicula(5);
};
} else {
main_class.abre_pantalla(new puntuacion(), "cortina");
};
}
public function onEnterFrame(_arg1:Event):void{
if (!Globals.GamePaused){
if (stage.quality != StageQuality.LOW){
visible = true;
stage.quality = StageQuality.LOW;
};
control_fin_musica();
if (Globals.Colisiones){
m_world.Step(m_timestep, m_iterations);
};
if (!achievementManager.myTimer.running){
achievementManager.play();
};
depthManager.update();
zombieManager.update();
itemManager.update();
paralaxManager.update();
comboManager.update();
interfaz_.update();
logica.update();
} else {
if (stage.quality != StageQuality.BEST){
visible = false;
stage.quality = StageQuality.BEST;
};
soundManager.stopAllSounds(false);
stage.focus = main_class;
if (!Globals.GamePaused_Screen){
comboManager.update();
main_class.abre_pantalla(new pausa());
};
if (Globals.ExitGame){
Salir_Juego();
};
};
}
public function addCircle(_arg1:Number, _arg2:Number, _arg3:Number){
var _local4:b2BodyDef;
var _local5:b2CircleDef;
_local4 = new b2BodyDef();
_local5 = new b2CircleDef();
_local5.radius = (Math.abs(_arg3) / m_phys_scale);
_local5.density = 2;
_local5.restitution = 0.2;
_local5.friction = 2;
_local4.position.Set((_arg1 / m_phys_scale), (_arg2 / m_phys_scale));
b = m_world.CreateBody(_local4);
b.CreateShape(_local5);
b.SetMassFromShapes();
}
public function LogicaEnd(_arg1:Event):void{
trace("logica end acabar partida");
logica.eDispatcher.removeEventListener("end", LogicaEnd);
timerStageOver = new Timer(3000, 2);
timerStageOver.addEventListener("timer", timerHandlerStageOver);
timerStageOver.start();
musicManager.fadeSound(Globals.currentMusic, 0, 2);
soundManager.playSound("victoria", 1, 1);
mc_cartel = new carteles_juego();
mc_cartel.cartel.info.text = "STAGE CLEAR";
mc_cartel.cartel2.info.text = "STAGE CLEAR";
interfaz_.addChild(mc_cartel);
Globals.GameOver = true;
}
public function AddStaticBox(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
var _local5:b2BodyDef;
var _local6:b2PolygonDef;
_local5 = new b2BodyDef();
_local5.position.Set(_arg1, _arg2);
_local6 = new b2PolygonDef();
_local6.filter.categoryBits = Globals.Colision_Estatica;
_local6.SetAsBox(_arg3, _arg4);
_local6.density = 0;
b = m_world.CreateBody(_local5);
b.CreateShape(_local6);
b.SetMassFromShapes();
}
public function timerHandlerGameOver(_arg1:TimerEvent):void{
timerGameOver.stop();
timerGameOver.removeEventListener("timer", timerHandlerGameOver);
Globals.GamePaused = true;
Globals.GamePaused_Screen = true;
Globals.ExitGame = true;
Globals.STORY_MODE_COMPLETED = false;
main_class.abre_pantalla(new puntuacion(), "cortina");
}
public function LogicaLoose(_arg1:Event):void{
logica.eDispatcher.removeEventListener("loose", LogicaEnd);
timerGameOver = new Timer(3000, 2);
timerGameOver.addEventListener("timer", timerHandlerGameOver);
timerGameOver.start();
musicManager.fadeSound(Globals.currentMusic, 0, 2);
soundManager.playSound("gameover", 1, 1);
mc_cartel = new carteles_juego();
mc_cartel.cartel.info.text = "GAME OVER";
mc_cartel.cartel2.info.text = "GAME OVER";
interfaz_.addChild(mc_cartel);
Globals.GameOver = true;
}
public function initialize(){
var _local1:b2Vec2;
var _local2:b2AABB;
eDispatcher = new EventDispatcher();
if (Globals.Colisiones){
_local1 = new b2Vec2(0, 0);
_local2 = new b2AABB();
_local2.lowerBound.Set(-1000, -1000);
_local2.upperBound.Set(1000, 1000);
m_world = new b2World(_local2, _local1, true);
};
contenedor.addChild(this);
switch (dificultad_juego){
case 1:
tiempo_respawn_item = 2000;
break;
case 2:
tiempo_respawn_item = 4000;
break;
case 3:
tiempo_respawn_item = 9000;
break;
default:
tiempo_respawn_item = 5000;
};
switch (modo_juego){
case "story":
Globals.SCORE_H = 0;
Globals.MULTIPLIER_H = 1;
Globals.KILLS_H = 0;
Globals.RANK_H = 0;
Globals.MAX_RANK_H = 0;
switch (Globals.ZONA_PARTIDA){
case 1:
logica = new Modo_Historia_Defender(this, dificultad_juego);
break;
case 2:
logica = new Modo_Historia_TimeAttack(this, dificultad_juego);
break;
case 3:
Globals.BARRILES_RESTANTES = 0;
logica = new Modo_Historia_Destroyer(this, dificultad_juego);
break;
case 4:
logica = new Modo_Historia_Survival(this, dificultad_juego);
break;
};
tiempo_respawn_item = 5000;
break;
case "survival":
logica = new Modo_Survival(this, dificultad_juego);
break;
case "time_attack":
logica = new Modo_TimeAttack(this, dificultad_juego);
break;
case "defender":
logica = new Modo_Defender(this, dificultad_juego);
break;
default:
logica = new Modo_Arcade(this, dificultad_juego);
};
logica.main_class = main_class;
logica.mc_intefaz = interfaz_;
logica.juego = this;
if (Globals.Colisiones){
logica.m_world = m_world;
logica.m_phys_scale = m_phys_scale;
logica.m_timestep = m_timestep;
logica.m_iterations = m_iterations;
};
switch (zona_juego){
case "mapa1":
alto_mapa = 200;
ancho_mapa = 1799.8;
break;
case "mapa2":
alto_mapa = 200;
ancho_mapa = 2032.7;
break;
case "mapa3":
alto_mapa = 200;
ancho_mapa = 2384.7;
break;
case "mapa4":
alto_mapa = 200;
ancho_mapa = 1201.8;
break;
default:
trace("error zona juego!");
};
Globals.WIDTH_MAP = ancho_mapa;
fondo = new MovieClip();
fondo.x = 0;
fondo.y = -250;
area_juego.addChild(fondo);
ground = new MovieClip();
ground_data = new BitmapData(ancho_mapa, alto_mapa, true, 0);
ground_bitmap = new Bitmap(ground_data);
ground.addChild(ground_bitmap);
area_juego.addChild(ground);
playground = new MovieClip();
area_juego.addChild(playground);
depthList = new Array();
depthManager.depthList = depthList;
depthManager.layer_mc = playground;
depthManager.layer_ground_bmd = ground_data;
depthManager.initialize(ancho_mapa, 450);
jugador = new Player(this.stage, ancho_mapa, alto_mapa, playground);
jugador.logica = logica;
jugador.initialize();
if (Globals.Colisiones){
jugador.m_world = m_world;
jugador.m_phys_scale = m_phys_scale;
jugador.m_timestep = m_timestep;
jugador.m_iterations = m_iterations;
jugador.crearColision(15);
};
enemyList = new Array();
Globals.enemyListGlobal = enemyList;
logica.enemyList = enemyList;
zombieManager.logica = logica;
zombieManager.layer_mc = playground;
zombieManager.layer_ground_mc = ground;
zombieManager.layer_ground_bm = ground_bitmap;
zombieManager.layer_ground_bmd = ground_data;
zombieManager.enemyList = enemyList;
zombieManager.playerObj = jugador;
zombieManager.camaraObj = area_juego.cam;
zombieManager.objectiveObj = jugador;
zombieManager.ancho_mapa = ancho_mapa;
zombieManager.alto_mapa = alto_mapa;
if (Globals.Colisiones){
zombieManager.m_world = m_world;
zombieManager.m_phys_scale = m_phys_scale;
zombieManager.m_timestep = m_timestep;
zombieManager.m_iterations = m_iterations;
};
jugador.enemyList = enemyList;
jugador.layer_ground_mc = ground;
jugador.layer_ground_bm = ground_bitmap;
jugador.layer_ground_bmd = ground_data;
comboManager.start();
itemManager.tiempo_respawn = tiempo_respawn_item;
itemManager.layer_mc = playground;
itemManager.playerObj = jugador;
itemManager.ancho_mapa = ancho_mapa;
itemManager.alto_mapa = alto_mapa;
itemManager.tipo_partida = modo_juego;
itemManager.active = true;
camara_ = new Camara(area_juego.cam, ancho_mapa, alto_mapa, jugador);
paralaxManager.clear();
paralaxManager.layer_mc = fondo;
switch (zona_juego){
case "mapa1":
paralaxManager.layer_1 = new park1();
paralaxManager.layer_2 = new park2();
paralaxManager.layer_3 = new park3();
break;
case "mapa2":
paralaxManager.layer_1 = new metro1();
paralaxManager.layer_2 = new metro2();
paralaxManager.layer_3 = new metro3();
paralaxManager.ancho_layer_3 = 1533.8;
break;
case "mapa3":
paralaxManager.layer_1 = new street1();
paralaxManager.layer_2 = new street2();
paralaxManager.layer_3 = new street3();
break;
case "mapa4":
paralaxManager.layer_1 = new terraza1();
paralaxManager.layer_2 = new terraza2();
paralaxManager.ancho_layer_2 = 1066;
break;
};
paralaxManager.camara_ = camara_;
paralaxManager.start();
interfaz_.player_ = jugador;
jugador.interfaz = interfaz_;
interfaz_.initialize();
interfaz_.visible = true;
achievementManager.pantallaInterfaz = interfaz_;
achievementManager.start();
if (Globals.Colisiones){
AddStaticBox(((ancho_mapa / 2) / m_phys_scale), (1 / m_phys_scale), (ancho_mapa / m_phys_scale), (10 / m_phys_scale));
AddStaticBox(((ancho_mapa / 2) / m_phys_scale), ((alto_mapa + 10) / m_phys_scale), (ancho_mapa / m_phys_scale), (10 / m_phys_scale));
m_dbgSprite = new Sprite();
playground.addChild(m_dbgSprite);
};
logica.eDispatcher.addEventListener("end", LogicaEnd);
logica.eDispatcher.addEventListener("loose", LogicaLoose);
jugador.eDispatcher.addEventListener(Player.DIES, PlayerDie);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
Globals.GameEnEspera = false;
Globals.GameOver = false;
Globals.ExitGame = false;
Globals.GamePaused_Screen = false;
Globals.GamePaused = false;
Globals.GameFinished = false;
Globals.STORY_MODE_COMPLETED = false;
Globals.lastWeaponIndex = 0;
Globals.lastWeaponKills = 0;
Globals.MAX_RANK = 0;
stage.focus = main_class;
musicManager.stopAllSounds();
}
public function control_fin_musica(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
_local1 = musicManager.getSoundPosition(Globals.currentMusic);
_local2 = musicManager.getSoundDuration(Globals.currentMusic);
_local3 = ((_local1 * 100) / _local2);
if (_local3 >= 99){
trace("lanzar nueva musica");
musicManager.fadeSound(Globals.currentMusic);
control_musica("");
};
}
public function PlayerDie(_arg1:Event):void{
trace("player muere acabar partida");
jugador.eDispatcher.removeEventListener(Player.DIES, PlayerDie);
timerGameOver = new Timer(3000, 2);
timerGameOver.addEventListener("timer", timerHandlerGameOver);
timerGameOver.start();
musicManager.fadeSound(Globals.currentMusic, 0, 2);
soundManager.playSound("gameover", 1, 1);
mc_cartel = new carteles_juego();
mc_cartel.cartel.info.text = "GAME OVER";
mc_cartel.cartel2.info.text = "GAME OVER";
interfaz_.addChild(mc_cartel);
Globals.GameOver = true;
jugador.alive = false;
}
public function Salir_Juego(){
trace("game finished");
Globals.GameFinished = true;
depthManager.finalize();
zombieManager.finalize();
itemManager.finalize();
paralaxManager.finalize();
comboManager.finalize();
interfaz_.finalize();
weaponManager.finalize();
logica.finalize();
achievementManager.stop();
area_juego.removeChild(area_juego.cam);
logica.update();
contenedor.removeChild(this);
Globals.ExitGame = false;
Globals.GamePaused = false;
Globals.GamePaused_Screen = false;
soundManager.stopAllSounds();
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
jugador.eDispatcher.removeEventListener(Player.DIES, PlayerDie);
Globals.saveManager.save();
enemyList = null;
depthList = null;
logica = null;
delete ??getglobalscope
[this];
Globals.deleteNow(this);
}
public function control_musica(_arg1:String=""){
var _local2:Array;
var _local3:int;
if (_arg1 == ""){
_local2 = new Array("Blender", "Gridiron", "FasterHarder", "BrokenDeck");
_local3 = (Math.random() * _local2.length);
while (_local2[_local3] == Globals.currentMusic) {
_local3 = (Math.random() * _local2.length);
};
Globals.currentMusic = _local2[_local3];
} else {
Globals.currentMusic = _arg1;
};
trace(("stoping... " + Globals.currentMusic));
musicManager.stopAllSounds(true);
trace(("musica actual : " + Globals.currentMusic));
musicManager.playSound(Globals.currentMusic, Globals.VOLUMEN_MUSICA, 0);
}
}
}//package com.tanoku.MoreZombies
Section 103
//jugar (com.tanoku.MoreZombies.jugar)
package com.tanoku.MoreZombies {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class jugar extends MovieClip {
public var b_story:SimpleButton;
public var b_defender:SimpleButton;
public var b_survival:SimpleButton;
public var main_class:MovieClip;
public var b_time_attack:SimpleButton;
public var b_back:SimpleButton;
public var logo:MovieClip;
public var b_tutorial:SimpleButton;
public function jugar(){
b_tutorial.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_story.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_survival.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_time_attack.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_defender.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_back.addEventListener(MouseEvent.CLICK, on_button_clicked);
}
public function on_button_out(_arg1:MouseEvent){
}
public function on_button_over(_arg1:MouseEvent){
switch (_arg1.target.name){
};
}
public function on_button_clicked(_arg1:MouseEvent){
switch (_arg1.target.name){
case "b_tutorial":
main_class.abre_pantalla(new tutorial(), "cortina");
break;
case "b_story":
Globals.TIPO_PARTIDA = "story";
Globals.ZONA_PARTIDA = 1;
main_class.cierra_pantalla(this, "pelicula");
main_class.abre_pantalla(new historia());
break;
case "b_survival":
Globals.TIPO_PARTIDA = "survival";
main_class.cierra_pantalla(this, "pelicula");
main_class.abre_pantalla(new arcade());
break;
case "b_time_attack":
Globals.TIPO_PARTIDA = "time_attack";
main_class.cierra_pantalla(this, "pelicula");
main_class.abre_pantalla(new arcade());
break;
case "b_defender":
Globals.TIPO_PARTIDA = "defender";
main_class.cierra_pantalla(this, "pelicula");
main_class.abre_pantalla(new arcade());
break;
case "b_back":
main_class.cierra_pantalla(this, "pelicula");
main_class.abre_pantalla(new principal());
break;
default:
trace((_arg1.target.name + " UNDEFINED"));
break;
};
}
}
}//package com.tanoku.MoreZombies
Section 104
//loading (com.tanoku.MoreZombies.loading)
package com.tanoku.MoreZombies {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public class loading extends MovieClip {
public var tips:MovieClip;
public var cargando_txt:MovieClip;
public var main_class:MovieClip;
public var cargando_salchicha:MovieClip;
public var logo:MovieClip;
public var timeEnd:Number;
public var cargando_tecla:MovieClip;
public var timeWait:Number;// = 4000
public function loading(){
var _local1:int;
timeWait = 4000;
super();
Globals.GameLoading = true;
Globals.GameLoaded = false;
timeEnd = 0;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
cargando_tecla.visible = false;
tips.stop();
_local1 = ((Math.random() * 5) + 2);
trace(("tip " + _local1));
tips.gotoAndStop(_local1);
}
public function on_button_out(_arg1:MouseEvent){
}
public function on_button_over(_arg1:MouseEvent){
switch (_arg1.target.name){
};
}
private function manejarClick(_arg1:MouseEvent):void{
cerrar();
}
public function on_button_clicked(_arg1:MouseEvent){
switch (_arg1.target.name){
default:
trace((_arg1.target.name + " UNDEFINED"));
break;
};
}
private function onEnterFrame(_arg1:Event):void{
if ((((Globals.GameLoading == false)) && ((timeEnd == 0)))){
timeEnd = (getTimer() + timeWait);
};
if (timeEnd != 0){
if (getTimer() > timeEnd){
addEventListener(MouseEvent.CLICK, manejarClick);
cargando_txt.visible = false;
cargando_salchicha.visible = false;
cargando_tecla.visible = true;
};
};
}
private function cerrar(){
Globals.GameLoaded = true;
main_class.cierra_pantalla(this);
removeEventListener(MouseEvent.CLICK, manejarClick);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
MoreZombies.fondo.visible = false;
}
}
}//package com.tanoku.MoreZombies
Section 105
//Mine (com.tanoku.MoreZombies.Mine)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import flash.events.*;
import flash.display.*;
public class Mine extends MovieClip {
public var xvel:int;// = 0
public var bulletOffset:Number;// = 0
public var weaponDef:Weapon;
public var yorig:Number;
public var speed:Number;// = 1
var distanceTotal:Number;// = 0
public var diferencia_altura:Number;// = 50
public var remove:Boolean;// = false
public var damageOnImpact:Boolean;// = true
public var ydest:Number;
public var damage2:Number;// = 1
public var damage3:Number;// = 1
public var yvel:int;// = 0
public var damage1:Number;
public var freezed:Boolean;// = true
public var dir:int;// = 0
public var xorig:Number;
var explosion_temp:Explosion;
public var alive:Boolean;// = true
public var vida_pixeles:int;
var distanceX:Number;// = 0
var distanceY:Number;// = 0
public var pushFactor:Number;// = 0
public var xdest:Number;
public var tipo;
public var range:Number;// = 1
public var pushOnImpact:Boolean;// = true
public var time_effect:Number;// = 0
public var damage_range1:Number;// = 1
public var damage_range2:Number;// = 1
public var damage_range3:Number;// = 1
private var depthManager:DepthManager;
public var damage:Number;// = 1
public var playerObject:Object;
private var soundManager:SoundManager;
public var body:area_roja;
public var targetList:Array;
public var objectiveObject:Object;
public function Mine():void{
depthManager = DepthManager.getInstance();
soundManager = SoundManager.getInstance();
remove = false;
speed = 1;
xvel = 0;
yvel = 0;
bulletOffset = 0;
dir = 0;
alive = true;
tipo = Globals.PERSONAL_MINE;
range = 1;
damage = 1;
damage_range1 = 1;
damage2 = 1;
damage_range2 = 1;
damage3 = 1;
damage_range3 = 1;
time_effect = 0;
pushOnImpact = true;
pushFactor = 0;
damageOnImpact = true;
distanceX = 0;
distanceY = 0;
distanceTotal = 0;
freezed = true;
diferencia_altura = 50;
super();
stop();
}
public function finalize(){
alive = false;
remove = true;
removeEventListener(Juego.FINALIZE, finalize);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
delete ??getglobalscope
[this];
Globals.deleteNow(this);
}
public function freeze(_arg1):void{
}
public function brain_explode(_arg1):void{
}
public function recieveDamage(_arg1, _arg2:Boolean=true){
var _local3:int;
if (_arg1 == this){
return (true);
};
_local3 = _arg1.tipo;
if (_arg1.damageOnImpact){
if ((((((((((((((((_local3 == Globals.BASIC_MISSILE)) || ((_local3 == Globals.BASIC_MISSILE)))) || ((_local3 == Globals.PERSONAL_MINE)))) || ((_local3 == Globals.TANK_MINE)))) || ((_local3 == Globals.C4_BOMB)))) || ((_local3 == Globals.PINEAPPLE_GRENADE)))) || ((_local3 == Globals.GERMAN_GRENADE)))) || ((_local3 == Globals.CAKE_BOMB)))){
trace("explotar en cadena");
finalize();
if (tipo == Globals.PERSONAL_MINE){
objectiveObject = _arg1;
explosion_temp = new Explosion("claymore", x, y, this);
if (_arg1.x < x){
explosion_temp.scaleX = -1;
};
soundManager.playSound("GranadaExplosion", 1, 1);
_arg1.recieveDamage(this);
} else {
if ((((tipo == Globals.TANK_MINE)) || ((tipo == Globals.FREEZE_MINE)))){
Explode(_arg1);
};
};
};
};
}
private function onEnterFrame(_arg1:Event):void{
if (!Globals.GamePaused){
update();
};
if ((((Globals.ExitGame == true)) || ((Globals.GameFinished == true)))){
finalize();
};
}
public function Explode(_arg1){
var _local2:int;
var _local3:*;
if (tipo == Globals.TANK_MINE){
explosion_temp = new Explosion("grande", x, y);
soundManager.playSound("ExplosionGrande", 1, 1);
};
if (tipo == Globals.FREEZE_MINE){
explosion_temp = new Explosion("freeze", x, y);
soundManager.playSound("freezer_mine", 1, 1);
};
_local2 = 0;
while (_local2 < targetList.length) {
_local3 = targetList[_local2];
if (_local3.alive){
distanceX = (_arg1.x - _local3.x);
distanceY = (_arg1.y - _local3.y);
distanceTotal = Math.sqrt(((distanceX * distanceX) + (distanceY * distanceY)));
if (distanceTotal <= damage_range3){
if (distanceTotal <= damage_range1){
range = 1;
damage = damage1;
} else {
if (distanceTotal <= damage_range2){
range = 2;
damage = damage2;
} else {
range = 3;
damage = damage3;
};
};
if (tipo == Globals.TANK_MINE){
_local3.recieveDamage(this);
} else {
if (tipo == Globals.FREEZE_MINE){
_local3.freeze(this);
};
};
};
};
_local2++;
};
distanceX = (_arg1.x - playerObject.x);
distanceY = (_arg1.y - playerObject.y);
distanceTotal = Math.sqrt(((distanceX * distanceX) + (distanceY * distanceY)));
if (distanceTotal <= damage_range3){
if (distanceTotal <= damage_range1){
range = 1;
damage = damage1;
} else {
if (distanceTotal <= damage_range2){
range = 2;
damage = damage2;
} else {
range = 3;
damage = damage3;
};
};
if (tipo == Globals.TANK_MINE){
playerObject.recieveDamage(this);
} else {
if (tipo == Globals.FREEZE_MINE){
playerObject.freeze(this);
};
};
};
}
private function update(){
var _local1:Number;
var _local2:int;
var _local3:int;
var _local4:*;
var _local5:DisplayObject;
_local1 = 0;
if (alive){
x = (x + xvel);
y = (y + yvel);
distanceX = 0;
distanceY = 0;
distanceTotal = 0;
_local3 = 0;
while (_local3 < targetList.length) {
_local4 = targetList[_local3];
_local5 = _local4.body;
if (_local4.body.hitarea != null){
_local5 = _local4.body.hitarea;
};
if (this.body.hitTestObject(_local5)){
if (((_local4.alive) && (!(_local4.freezed)))){
_local2 = (_local4.y - this.y);
if (_local2 < 0){
_local2 = (_local2 * -1);
};
_local1 = this.body.height;
distanceX = (this.x - _local4.x);
distanceY = (this.y - _local4.y);
distanceTotal = Math.sqrt(((distanceX * distanceX) + (distanceY * distanceY)));
if (_local2 <= _local1){
_local3 = targetList.length;
alive = false;
if (tipo == Globals.PERSONAL_MINE){
objectiveObject = _local4;
explosion_temp = new Explosion("claymore", x, y, this);
if (_local4.x < x){
explosion_temp.scaleX = -1;
};
soundManager.playSound("GranadaExplosion", 1, 1);
_local4.recieveDamage(this);
} else {
if ((((tipo == Globals.TANK_MINE)) || ((tipo == Globals.FREEZE_MINE)))){
Explode(_local4);
};
};
finalize();
};
};
};
_local3++;
};
if (alive){
if (this.body.hitTestObject(playerObject.body.hitarea)){
_local2 = (playerObject.y - this.y);
if (_local2 < 0){
_local2 = (_local2 * -1);
};
_local1 = this.body.height;
distanceX = (this.x - playerObject.x);
distanceY = (this.y - playerObject.y);
distanceTotal = Math.sqrt(((distanceX * distanceX) + (distanceY * distanceY)));
if (_local2 <= _local1){
alive = false;
if (tipo == Globals.PERSONAL_MINE){
objectiveObject = playerObject;
explosion_temp = new Explosion("claymore", x, y, this);
if (playerObject.x < x){
explosion_temp.scaleX = -1;
};
soundManager.playSound("GranadaExplosion", 1, 1);
playerObject.recieveDamage(this);
} else {
if ((((tipo == Globals.TANK_MINE)) || ((tipo == Globals.FREEZE_MINE)))){
Explode(playerObject);
};
};
finalize();
};
};
};
};
}
public function mover(_arg1:String="", _arg2:int=0){
}
public function initialize():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
remove = false;
alive = true;
if (tipo == Globals.PERSONAL_MINE){
gotoAndStop("PERSONAL");
};
if (tipo == Globals.TANK_MINE){
gotoAndStop("TANK");
};
if (tipo == Globals.FREEZE_MINE){
gotoAndStop("FREEZE");
};
_local1 = Math.round((180 - ((Math.atan2((xdest - xorig), (ydest - yorig)) * 180) / Math.PI)));
_local2 = Math.floor(((Math.random() * bulletOffset) - (bulletOffset / 2)));
_local3 = ((((_local1 + _local2) - 90) * Math.PI) / 180);
xvel = (Math.cos(_local3) * speed);
if (dir == Globals.DER){
this.scaleX = 1;
};
if (dir == Globals.IZQ){
this.scaleX = -1;
xvel = (xvel * -1);
};
yvel = (Math.sin(_local3) * speed);
depthManager.addObject(this);
Globals.enemyListGlobal.push(this);
addEventListener(Juego.FINALIZE, finalize);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
}
}//package com.tanoku.MoreZombies
Section 106
//Missile (com.tanoku.MoreZombies.Missile)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class Missile extends MovieClip {
public var xvel:int;// = 0
public var bulletOffset:Number;// = 0
public var weaponDef:Weapon;
public var yorig:Number;
public var speed:Number;// = 1
var distanceTotal:Number;// = 0
public var remove:Boolean;// = false
public var damageOnImpact:Boolean;// = true
public var ydest:Number;
public var damage2:Number;// = 1
public var damage3:Number;// = 1
public var yvel:int;// = 0
public var damage1:Number;
public var dir:int;// = 0
public var xorig:Number;
public var alive:Boolean;
public var vida_pixeles:int;
var distanceX:Number;// = 0
var distanceY:Number;// = 0
public var pushFactor:Number;// = 0
public var xdest:Number;
public var tipo;
public var range:Number;// = 1
public var pushOnImpact:Boolean;// = true
public var time_effect:Number;// = 0
public var damage_range1:Number;// = 1
public var damage_range2:Number;// = 1
public var damage_range3:Number;// = 1
private var depthManager:DepthManager;
public var damage:Number;// = 1
public var playerObject:Object;
private var soundManager:SoundManager;
var y_altura:Number;// = 0
public var body:MovieClip;
public var targetList:Array;
public function Missile():void{
depthManager = DepthManager.getInstance();
soundManager = SoundManager.getInstance();
remove = false;
speed = 1;
xvel = 0;
yvel = 0;
bulletOffset = 0;
dir = 0;
tipo = Globals.BASIC_MISSILE;
range = 1;
damage = 1;
damage_range1 = 1;
damage2 = 1;
damage_range2 = 1;
damage3 = 1;
damage_range3 = 1;
time_effect = 0;
pushOnImpact = true;
pushFactor = 0;
damageOnImpact = true;
distanceX = 0;
distanceY = 0;
distanceTotal = 0;
y_altura = 0;
super();
stop();
}
public function finalize(){
remove = true;
removeEventListener(Juego.FINALIZE, finalize);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
delete ??getglobalscope
[this];
Globals.deleteNow(this);
}
public function recieveDamage(_arg1, _arg2:Boolean=true){
}
private function onEnterFrame(_arg1:Event):void{
if (!Globals.GamePaused){
update();
};
if ((((Globals.ExitGame == true)) || ((Globals.GameFinished == true)))){
finalize();
};
}
public function Explode(_arg1){
var _local2:Point;
var _local3:Point;
var _local4:Number;
var _local5:Number;
var _local6:Explosion;
var _local7:int;
var _local8:*;
_local2 = localToLocal(_arg1, parent);
_local3 = localToLocal(this.body, parent);
_local4 = (_local3.x - _local2.x);
_local5 = (_local3.y - _local2.y);
_local6 = new Explosion("aerea", _local4, _local5, _arg1);
soundManager.playSound("ExplosionGrande", 1, 1);
soundManager.stopSound("Stingermisile");
_local7 = 0;
while (_local7 < targetList.length) {
_local8 = targetList[_local7];
if (_local8.alive){
distanceX = (_arg1.x - _local8.x);
distanceY = (_arg1.y - _local8.y);
distanceTotal = Math.sqrt(((distanceX * distanceX) + (distanceY * distanceY)));
if (distanceTotal <= damage_range3){
if (distanceTotal <= damage_range1){
range = 1;
damage = damage1;
} else {
if (distanceTotal <= damage_range2){
range = 2;
damage = damage2;
} else {
range = 3;
damage = damage3;
};
};
_local8.recieveDamage(this);
};
};
_local7++;
};
distanceX = (_arg1.x - playerObject.x);
distanceY = (_arg1.y - playerObject.y);
distanceTotal = Math.sqrt(((distanceX * distanceX) + (distanceY * distanceY)));
if (distanceTotal <= damage_range3){
if (distanceTotal <= damage_range1){
range = 1;
damage = damage1;
} else {
if (distanceTotal <= damage_range2){
range = 2;
damage = damage2;
} else {
range = 3;
damage = damage3;
};
};
playerObject.recieveDamage(this);
};
}
private function update(){
var _local1:Point;
var _local2:Point;
var _local3:Humo;
var _local4:int;
var _local5:*;
var _local6:DisplayObject;
var _local7:int;
if (alive){
_local1 = localToLocal(this, parent);
_local2 = localToLocal(this.body, parent);
_local3 = new Humo(_local1.x, _local1.y, 0, y_altura, dir);
x = (x + xvel);
y = (y + yvel);
vida_pixeles = (vida_pixeles - speed);
if (vida_pixeles <= 0){
alive = false;
finalize();
};
_local4 = 0;
while (_local4 < targetList.length) {
_local5 = targetList[_local4];
if (_local5.alive){
_local5 = targetList[_local4];
_local6 = _local5.body;
if (_local5.body.hitarea != null){
_local6 = _local5.body.hitarea;
};
if (this.hitTestObject(_local6)){
_local7 = (_local5.y - _local2.y);
if (_local7 < 0){
_local7 = (_local7 * -1);
};
if (_local7 >= _local5.diferencia_altura){
_local4 = targetList.length;
alive = false;
Explode(_local5);
finalize();
};
};
};
_local4++;
};
};
}
public function initialize():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
remove = false;
alive = true;
_local1 = y;
y_altura = (y - playerObject.y);
if (body == null){
body = new MovieClip();
};
body.y = y_altura;
body.x = 0;
y = (playerObject.y - 1);
_local2 = Math.round((180 - ((Math.atan2((xdest - xorig), (ydest - yorig)) * 180) / Math.PI)));
_local3 = Math.floor(((Math.random() * bulletOffset) - (bulletOffset / 2)));
_local4 = ((((_local2 + _local3) - 90) * Math.PI) / 180);
xvel = (Math.cos(_local4) * speed);
if (dir == Globals.DER){
this.rotation = Math.round(((_local4 * 180) / Math.PI));
this.scaleX = 1;
};
if (dir == Globals.IZQ){
this.rotation = -(Math.round(((_local4 * 180) / Math.PI)));
this.scaleX = -1;
xvel = (xvel * -1);
};
yvel = (Math.sin(_local4) * speed);
depthManager.addObject(this);
soundManager.playSound("Stingermisile", 1, 1);
addEventListener(Juego.FINALIZE, finalize);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function localToLocal(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Point=null):Point{
var _local4:Point;
_local4 = (_arg3) ? _arg3 : new Point();
_local4 = _arg1.localToGlobal(_local4);
_local4 = _arg2.globalToLocal(_local4);
return (_local4);
}
}
}//package com.tanoku.MoreZombies
Section 107
//Modo_Arcade (com.tanoku.MoreZombies.Modo_Arcade)
package com.tanoku.MoreZombies {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Modo_Arcade {
public var bidon_01:Bidon;
public var bidon_02:Bidon;
public var carrito_hotdogs:Carrito;
private var itemManager:ItemManager;
private var contenedor:MovieClip;
public var mc_cartel:carteles_juego;
public var logicaActiva:Boolean;// = false
private var zombieManager:ZombieManager;
public var m_timestep:Number;// = 0.0333333333333333
private var dificultad:int;
public var m_world:b2World;
public var enemyList:Array;
public var m_iterations:Number;// = 10
private var initialized:Boolean;// = false
public var timeEnd:Number;// = 0
public var mc_intefaz:MovieClip;
public var timeWait:Number;// = 5000
public var eDispatcher:EventDispatcher;
public var m_phys_scale:Number;// = 30
public var main_class:MovieClip;
private var oleada_actual:int;
public static const END:String = "end";
public static const LOOSE:String = "loose";
public function Modo_Arcade(_arg1:MovieClip, _arg2:int){
zombieManager = ZombieManager.getInstance();
itemManager = ItemManager.getInstance();
m_phys_scale = 30;
m_timestep = (1 / 30);
m_iterations = 10;
initialized = false;
timeWait = 5000;
timeEnd = 0;
logicaActiva = false;
super();
contenedor = _arg1;
dificultad = _arg2;
eDispatcher = new EventDispatcher();
}
public function initialize(){
oleada_actual = 1;
itemManager.tiempo_respawn = 5000;
initialized = true;
Globals.GameEnEspera = true;
Globals.GameLoading = false;
timeEnd = 0;
}
public function finalize(){
}
public function finLogica():Boolean{
var _local1:Boolean;
_local1 = false;
if (logicaActiva){
if (oleada_actual == 4){
trace("fin de logica");
_local1 = true;
eDispatcher.dispatchEvent(new Event(END));
zombieManager.active = false;
logicaActiva = false;
itemManager.stop();
};
};
return (_local1);
}
private function Configura_Oleada(){
var _local1:Number;
_local1 = 0;
switch (oleada_actual){
case 1:
_local1 = 1000;
zombieManager.datosZombies = new Array(_local1);
zombieManager.oleada_inicial = 3;
zombieManager.tiempo_respawn = 3000;
zombieManager.max_en_pantalla = 3;
zombieManager.tipo_respawn = Globals.RADIAL_RESPAWN;
break;
default:
_local1 = (_local1 + 5);
zombieManager.datosZombies = new Array(_local1);
zombieManager.max_en_pantalla = (zombieManager.max_en_pantalla + 1);
};
contenedor.interfaz_.oleada.text = ("WAVE " + oleada_actual);
zombieManager.startWave();
itemManager.start();
}
public function update(){
if (Globals.ExitGame == true){
return (false);
};
if (initialized == false){
initialize();
};
finLogica();
if ((((((Globals.GameLoaded == true)) && (Globals.GameEnEspera))) && ((Globals.GameOver == false)))){
if (timeEnd == 0){
timeEnd = (getTimer() + timeWait);
mc_cartel = new carteles_juego();
mc_cartel.cartel.info.text = ("WAVE " + oleada_actual);
mc_cartel.cartel2.info.text = ("WAVE " + oleada_actual);
mc_cartel.visible = true;
mc_cartel.x = 0;
mc_cartel.y = 0;
mc_intefaz.addChild(mc_cartel);
logicaActiva = false;
itemManager.stop();
};
if (getTimer() > timeEnd){
mc_intefaz.removeChild(mc_cartel);
Globals.GameEnEspera = false;
timeEnd = 0;
Configura_Oleada();
logicaActiva = true;
itemManager.start();
};
};
zombieManager.active = true;
if (logicaActiva == true){
if (((zombieManager.wave_finished) && ((logicaActiva == true)))){
Globals.GameEnEspera = true;
Siguiente_Oleada();
};
};
}
private function Siguiente_Oleada(){
oleada_actual++;
Configura_Oleada();
}
}
}//package com.tanoku.MoreZombies
Section 108
//Modo_Defender (com.tanoku.MoreZombies.Modo_Defender)
package com.tanoku.MoreZombies {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Modo_Defender {
public var bidon_01:Bidon;
public var bidon_02:Bidon;
public var carrito_hotdogs:Carrito;
var total_zombies:Number;// = 0
public var mc_cartel:carteles_juego;
private var itemManager:ItemManager;
private var contenedor:MovieClip;
public var logicaActiva:Boolean;// = false
private var zombieManager:ZombieManager;
public var m_timestep:Number;// = 0.0333333333333333
private var dificultad:int;
public var m_world:b2World;
public var enemyList:Array;
public var m_iterations:Number;// = 10
private var initialized:Boolean;// = false
public var timeEnd:Number;// = 0
public var mc_intefaz:MovieClip;
public var timeWait:Number;// = 5000
var juego;
public var eDispatcher:EventDispatcher;
public var m_phys_scale:Number;// = 30
public var main_class:MovieClip;
private var oleada_actual:int;
public static const END:String = "end";
public static const LOOSE:String = "loose";
public function Modo_Defender(_arg1:MovieClip, _arg2:int){
zombieManager = ZombieManager.getInstance();
itemManager = ItemManager.getInstance();
m_phys_scale = 30;
m_timestep = (1 / 30);
m_iterations = 10;
initialized = false;
timeWait = 5000;
timeEnd = 0;
logicaActiva = false;
total_zombies = 0;
super();
contenedor = _arg1;
dificultad = _arg2;
eDispatcher = new EventDispatcher();
}
public function finalize(){
}
public function initialize(){
oleada_actual = 1;
carrito_hotdogs = new Carrito(contenedor.playground);
carrito_hotdogs.x = contenedor.jugador.x;
carrito_hotdogs.y = (contenedor.jugador.y - 50);
if (Globals.Colisiones){
carrito_hotdogs.m_world = m_world;
carrito_hotdogs.m_phys_scale = m_phys_scale;
carrito_hotdogs.m_timestep = m_timestep;
carrito_hotdogs.m_iterations = m_iterations;
};
contenedor.playground.addChild(carrito_hotdogs);
carrito_hotdogs.initialize();
zombieManager.objectiveObj = carrito_hotdogs;
enemyList.push(carrito_hotdogs);
initialized = true;
Globals.GameEnEspera = true;
Globals.GameLoading = false;
timeEnd = 0;
Globals.OLEADA_FINAL = 0;
Globals.OLEADA_ACTUAL = 1;
}
public function finLogica():Boolean{
var _local1:Boolean;
_local1 = false;
if (logicaActiva){
if (carrito_hotdogs.alive == false){
trace("fin de logica DERROTA");
_local1 = true;
eDispatcher.dispatchEvent(new Event(LOOSE));
zombieManager.active = false;
logicaActiva = false;
itemManager.stop();
};
};
return (_local1);
}
private function Configura_Oleada(){
switch (oleada_actual){
case 1:
Globals.Z_DAMAGE = (5 * Globals.DIFICULTAD_PARTIDA);
Globals.P_BASICO = 7;
Globals.P_MORDEDOR = 3;
Globals.P_BOMBA = 1;
Globals.Z_VELOCIDAD_MAX = 1;
Globals.Z_VELOCIDAD_MIN = 1;
Globals.Z_VIDA = (3 * Globals.DIFICULTAD_PARTIDA);
total_zombies = 10;
zombieManager.datosZombies = new Array(total_zombies);
zombieManager.oleada_inicial = 1;
zombieManager.tiempo_respawn = 500;
zombieManager.max_en_pantalla = 10;
zombieManager.tipo_respawn = Globals.RADIAL_RESPAWN;
break;
default:
timeWait = 0;
Globals.Z_VELOCIDAD_MAX = (Globals.Z_VELOCIDAD_MAX + 0.2);
Globals.Z_VELOCIDAD_MIN = (Globals.Z_VELOCIDAD_MIN + 0.2);
if (Globals.Z_VELOCIDAD_MAX > 4){
Globals.Z_VELOCIDAD_MAX = 4;
};
if (Globals.Z_VELOCIDAD_MIN > 4){
Globals.Z_VELOCIDAD_MIN = 4;
};
Globals.Z_VIDA = (Globals.Z_VIDA + (1 * Globals.DIFICULTAD_PARTIDA));
total_zombies = (total_zombies + 1);
zombieManager.datosZombies = new Array(total_zombies);
zombieManager.max_en_pantalla = (zombieManager.max_en_pantalla + 1);
if (zombieManager.max_en_pantalla > 10){
zombieManager.max_en_pantalla = 10;
};
};
zombieManager.startWave();
itemManager.start();
}
public function update(){
if (Globals.ExitGame == true){
return (false);
};
if (initialized == false){
initialize();
};
finLogica();
if ((((((Globals.GameLoaded == true)) && (Globals.GameEnEspera))) && ((Globals.GameOver == false)))){
if (timeEnd == 0){
timeEnd = (getTimer() + timeWait);
mc_cartel = new carteles_juego();
if (oleada_actual == 1){
mc_cartel.cartel.info.text = "DEFEND THE CART!";
mc_cartel.cartel2.info.text = "DEFEND THE CART!";
juego.control_musica();
} else {
mc_cartel.cartel.info.text = "";
mc_cartel.cartel2.info.text = "";
};
zombieManager.playerObj.cartelFlotante((("Wave " + oleada_actual) + " incoming"));
mc_cartel.visible = true;
mc_cartel.x = 0;
mc_cartel.y = 0;
mc_intefaz.addChild(mc_cartel);
logicaActiva = false;
itemManager.stop();
};
if (getTimer() > timeEnd){
mc_intefaz.removeChild(mc_cartel);
Globals.GameEnEspera = false;
timeEnd = 0;
if (oleada_actual == 1){
Configura_Oleada();
};
logicaActiva = true;
itemManager.start();
};
};
zombieManager.active = true;
if (logicaActiva == true){
if (((zombieManager.wave_finished) && ((logicaActiva == true)))){
Globals.GameEnEspera = true;
Siguiente_Oleada();
};
};
}
private function Siguiente_Oleada(){
oleada_actual++;
Globals.OLEADA_ACTUAL = oleada_actual;
Configura_Oleada();
}
}
}//package com.tanoku.MoreZombies
Section 109
//Modo_Historia_Defender (com.tanoku.MoreZombies.Modo_Historia_Defender)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Modo_Historia_Defender {
public var bidon_01:Bidon;
public var bidon_02:Bidon;
public var carrito_hotdogs:Carrito;
var total_zombies:Number;// = 0
public var numeroOleadas:int;// = 10
private var itemManager:ItemManager;
private var contenedor:MovieClip;
public var mc_cartel:carteles_juego;
public var logicaActiva:Boolean;// = false
private var zombieManager:ZombieManager;
public var m_timestep:Number;// = 0.0333333333333333
private var dificultad:int;
public var m_world:b2World;
public var enemyList:Array;
private var musicManager:MusicManager;
public var m_iterations:Number;// = 10
private var initialized:Boolean;// = false
public var timeEnd:Number;// = 0
public var mc_intefaz:MovieClip;
public var timeWait:Number;// = 5000
var juego;
public var eDispatcher:EventDispatcher;
public var m_phys_scale:Number;// = 30
public var main_class:MovieClip;
private var oleada_actual:int;
public static const END:String = "end";
public static const LOOSE:String = "loose";
public function Modo_Historia_Defender(_arg1:MovieClip, _arg2:int){
zombieManager = ZombieManager.getInstance();
itemManager = ItemManager.getInstance();
musicManager = MusicManager.getInstance();
m_phys_scale = 30;
m_timestep = (1 / 30);
m_iterations = 10;
initialized = false;
timeWait = 5000;
timeEnd = 0;
logicaActiva = false;
numeroOleadas = 10;
total_zombies = 0;
super();
contenedor = _arg1;
dificultad = _arg2;
eDispatcher = new EventDispatcher();
}
public function finalize(){
}
public function finLogica():Boolean{
var _local1:Boolean;
_local1 = false;
if (logicaActiva){
if ((((carrito_hotdogs.alive == true)) && ((oleada_actual > numeroOleadas)))){
trace("fin de logica VICTORIA");
_local1 = true;
eDispatcher.dispatchEvent(new Event(END));
zombieManager.active = false;
logicaActiva = false;
itemManager.stop();
} else {
if (carrito_hotdogs.alive == false){
trace("fin de logica DERROTA");
_local1 = true;
eDispatcher.dispatchEvent(new Event(LOOSE));
zombieManager.active = false;
logicaActiva = false;
itemManager.stop();
};
};
};
return (_local1);
}
public function initialize(){
oleada_actual = 1;
itemManager.tiempo_respawn = 5000;
carrito_hotdogs = new Carrito(contenedor.playground);
carrito_hotdogs.x = contenedor.jugador.x;
carrito_hotdogs.y = (contenedor.jugador.y - 50);
if (Globals.Colisiones){
carrito_hotdogs.m_world = m_world;
carrito_hotdogs.m_phys_scale = m_phys_scale;
carrito_hotdogs.m_timestep = m_timestep;
carrito_hotdogs.m_iterations = m_iterations;
};
contenedor.playground.addChild(carrito_hotdogs);
carrito_hotdogs.initialize();
enemyList.push(carrito_hotdogs);
zombieManager.objectiveObj = carrito_hotdogs;
initialized = true;
Globals.GameEnEspera = true;
Globals.GameLoading = false;
timeEnd = 0;
Globals.OLEADA_FINAL = numeroOleadas;
Globals.OLEADA_ACTUAL = 1;
}
public function update(){
if (Globals.ExitGame == true){
return (false);
};
if (initialized == false){
initialize();
};
finLogica();
if ((((((Globals.GameLoaded == true)) && (Globals.GameEnEspera))) && ((Globals.GameOver == false)))){
if (timeEnd == 0){
timeEnd = (getTimer() + timeWait);
mc_cartel = new carteles_juego();
if (oleada_actual == 1){
mc_cartel.cartel.info.text = "DEFEND THE CART!";
mc_cartel.cartel2.info.text = "DEFEND THE CART!";
juego.control_musica("Blender");
} else {
mc_cartel.cartel.info.text = "";
mc_cartel.cartel2.info.text = "";
};
zombieManager.playerObj.cartelFlotante((("Wave " + oleada_actual) + " incoming"));
mc_cartel.visible = true;
mc_cartel.x = 0;
mc_cartel.y = 0;
mc_intefaz.addChild(mc_cartel);
logicaActiva = false;
itemManager.stop();
};
if (getTimer() > timeEnd){
mc_intefaz.removeChild(mc_cartel);
Globals.GameEnEspera = false;
timeEnd = 0;
if (oleada_actual == 1){
Configura_Oleada();
};
logicaActiva = true;
itemManager.start();
};
};
zombieManager.active = true;
if (logicaActiva == true){
if (((zombieManager.wave_finished) && ((logicaActiva == true)))){
Globals.GameEnEspera = true;
Siguiente_Oleada();
};
};
}
private function Siguiente_Oleada(){
oleada_actual++;
Globals.OLEADA_ACTUAL = oleada_actual;
Configura_Oleada();
}
private function Configura_Oleada(){
switch (oleada_actual){
case 1:
Globals.Z_DAMAGE = 1;
Globals.P_BASICO = 10;
Globals.P_MORDEDOR = 0;
Globals.P_BOMBA = 0;
Globals.Z_VELOCIDAD_MAX = 1;
Globals.Z_VELOCIDAD_MIN = 1;
Globals.Z_VIDA = 1;
total_zombies = 5;
zombieManager.datosZombies = new Array(total_zombies);
zombieManager.oleada_inicial = 1;
zombieManager.tiempo_respawn = 250;
zombieManager.max_en_pantalla = 3;
zombieManager.tipo_respawn = Globals.RADIAL_RESPAWN;
break;
default:
timeWait = 0;
Globals.P_BASICO = (Globals.P_BASICO + 1);
Globals.P_MORDEDOR = (Globals.P_MORDEDOR + 0.3);
Globals.P_BOMBA = (Globals.P_BOMBA + 0.2);
Globals.Z_VELOCIDAD_MAX = (Globals.Z_VELOCIDAD_MAX + 0.1);
if (Globals.Z_VELOCIDAD_MAX > 1.5){
Globals.Z_VELOCIDAD_MAX = 1.5;
};
Globals.Z_VIDA = (Globals.Z_VIDA + 0.5);
total_zombies = (total_zombies + 2);
zombieManager.datosZombies = new Array(total_zombies);
zombieManager.max_en_pantalla = (zombieManager.max_en_pantalla + 1);
if (zombieManager.max_en_pantalla > 10){
zombieManager.max_en_pantalla = 10;
};
};
zombieManager.startWave();
itemManager.start();
}
}
}//package com.tanoku.MoreZombies
Section 110
//Modo_Historia_Destroyer (com.tanoku.MoreZombies.Modo_Historia_Destroyer)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Modo_Historia_Destroyer {
public var bidon_01:Bidon;
public var bidon_02:Bidon;
public var carrito_hotdogs:Carrito;
var total_zombies:Number;// = 0
private var itemManager:ItemManager;
private var contenedor:MovieClip;
public var mc_cartel:carteles_juego;
public var logicaActiva:Boolean;// = false
private var zombieManager:ZombieManager;
public var m_timestep:Number;// = 0.0333333333333333
private var dificultad:int;
public var m_world:b2World;
public var enemyList:Array;
private var musicManager:MusicManager;
public var m_iterations:Number;// = 10
public var bidones:Array;
private var initialized:Boolean;// = false
public var timeEnd:Number;// = 0
public var mc_intefaz:MovieClip;
public var timeWait:Number;// = 5000
var juego;
public var eDispatcher:EventDispatcher;
public var m_phys_scale:Number;// = 30
public var main_class:MovieClip;
private var oleada_actual:int;
public static const END:String = "end";
public static const LOOSE:String = "loose";
public function Modo_Historia_Destroyer(_arg1:MovieClip, _arg2:int){
zombieManager = ZombieManager.getInstance();
itemManager = ItemManager.getInstance();
musicManager = MusicManager.getInstance();
m_phys_scale = 30;
m_timestep = (1 / 30);
m_iterations = 10;
initialized = false;
timeWait = 5000;
timeEnd = 0;
logicaActiva = false;
total_zombies = 0;
super();
contenedor = _arg1;
dificultad = _arg2;
eDispatcher = new EventDispatcher();
}
public function finalize(){
}
public function finLogica():Boolean{
var _local1:Boolean;
_local1 = false;
if (logicaActiva){
if (Globals.BARRILES_RESTANTES == 0){
trace("fin de logica");
_local1 = true;
eDispatcher.dispatchEvent(new Event(END));
zombieManager.active = false;
logicaActiva = false;
itemManager.stop();
};
};
return (_local1);
}
public function initialize(){
var _local1:*;
var _local2:Bidon;
oleada_actual = 1;
itemManager.tiempo_respawn = 5000;
bidones = new Array();
Globals.BARRILES_RESTANTES = 0;
_local1 = 0;
while (_local1 < 6) {
_local2 = new Bidon(contenedor.playground);
switch (_local1){
case 0:
_local2.x = 300;
_local2.y = 100;
break;
case 1:
_local2.x = 650;
_local2.y = 130;
break;
case 2:
_local2.x = 1000;
_local2.y = 80;
break;
case 3:
_local2.x = 1400;
_local2.y = 140;
break;
case 4:
_local2.x = 1800;
_local2.y = 80;
break;
case 5:
_local2.x = 2100;
_local2.y = 120;
break;
};
if (Globals.Colisiones){
_local2.m_world = m_world;
_local2.m_phys_scale = m_phys_scale;
_local2.m_timestep = m_timestep;
_local2.m_iterations = m_iterations;
};
_local2.playerObj = zombieManager.playerObj;
contenedor.playground.addChild(_local2);
_local2.initialize();
enemyList.push(_local2);
bidones.push(_local2);
_local1++;
};
initialized = true;
Globals.GameEnEspera = true;
Globals.GameLoading = false;
timeEnd = 0;
Globals.OLEADA_FINAL = 0;
Globals.OLEADA_ACTUAL = 1;
}
public function update(){
if (Globals.ExitGame == true){
return (false);
};
if (initialized == false){
initialize();
};
finLogica();
if ((((((Globals.GameLoaded == true)) && (Globals.GameEnEspera))) && ((Globals.GameOver == false)))){
if (timeEnd == 0){
timeEnd = (getTimer() + timeWait);
mc_cartel = new carteles_juego();
if (oleada_actual == 1){
mc_cartel.cartel.info.text = "DESTROY ALL BARRELS!";
mc_cartel.cartel2.info.text = "DESTROY ALL BARRELS!";
juego.control_musica("Gridiron");
} else {
mc_cartel.cartel.info.text = "";
mc_cartel.cartel2.info.text = "";
};
zombieManager.playerObj.cartelFlotante((("Wave " + oleada_actual) + " incoming"));
mc_cartel.visible = true;
mc_cartel.x = 0;
mc_cartel.y = 0;
mc_intefaz.addChild(mc_cartel);
logicaActiva = false;
itemManager.stop();
};
if (getTimer() > timeEnd){
mc_intefaz.removeChild(mc_cartel);
Globals.GameEnEspera = false;
timeEnd = 0;
if (oleada_actual == 1){
Configura_Oleada();
};
logicaActiva = true;
itemManager.start();
};
};
zombieManager.active = true;
if (logicaActiva == true){
if (((zombieManager.wave_finished) && ((logicaActiva == true)))){
Globals.GameEnEspera = true;
Siguiente_Oleada();
};
};
}
private function Siguiente_Oleada(){
oleada_actual++;
Globals.OLEADA_ACTUAL = oleada_actual;
Configura_Oleada();
}
private function Configura_Oleada(){
switch (oleada_actual){
case 1:
Globals.Z_DAMAGE = 3;
Globals.P_BASICO = 10;
Globals.P_MORDEDOR = 0;
Globals.P_BOMBA = 0;
Globals.Z_VELOCIDAD_MAX = 3.5;
Globals.Z_VELOCIDAD_MIN = 2.5;
Globals.Z_VIDA = 5;
total_zombies = 20;
zombieManager.datosZombies = new Array(total_zombies);
zombieManager.oleada_inicial = 1;
zombieManager.tiempo_respawn = 250;
zombieManager.max_en_pantalla = 8;
zombieManager.tipo_respawn = Globals.RADIAL_RESPAWN;
break;
default:
timeWait = 0;
Globals.Z_DAMAGE = (Globals.Z_DAMAGE + 0.5);
if (Globals.Z_DAMAGE > 5){
Globals.Z_DAMAGE = 7;
};
Globals.P_BASICO = (Globals.P_BASICO + 1);
Globals.P_MORDEDOR = (Globals.P_MORDEDOR + 1);
Globals.P_BOMBA = (Globals.P_BOMBA + 0.3);
Globals.Z_VIDA = (Globals.Z_VIDA + 0.5);
total_zombies = (total_zombies + 2);
zombieManager.datosZombies = new Array(total_zombies);
zombieManager.max_en_pantalla = (zombieManager.max_en_pantalla + 1);
if (zombieManager.max_en_pantalla > 10){
zombieManager.max_en_pantalla = 10;
};
};
zombieManager.startWave();
itemManager.start();
}
}
}//package com.tanoku.MoreZombies
Section 111
//Modo_Historia_Survival (com.tanoku.MoreZombies.Modo_Historia_Survival)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Modo_Historia_Survival {
public var bidon_01:Bidon;
public var bidon_02:Bidon;
public var carrito_hotdogs:Carrito;
var total_zombies:Number;// = 0
public var numeroOleadas:int;// = 10
private var itemManager:ItemManager;
private var contenedor:MovieClip;
public var mc_cartel:carteles_juego;
public var logicaActiva:Boolean;// = false
private var zombieManager:ZombieManager;
public var m_timestep:Number;// = 0.0333333333333333
private var dificultad:int;
public var m_world:b2World;
public var enemyList:Array;
private var musicManager:MusicManager;
public var m_iterations:Number;// = 10
private var initialized:Boolean;// = false
public var timeEnd:Number;// = 0
public var mc_intefaz:MovieClip;
public var timeWait:Number;// = 5000
var juego;
public var eDispatcher:EventDispatcher;
public var m_phys_scale:Number;// = 30
public var main_class:MovieClip;
private var oleada_actual:int;
public static const END:String = "end";
public static const LOOSE:String = "loose";
public function Modo_Historia_Survival(_arg1:MovieClip, _arg2:int){
zombieManager = ZombieManager.getInstance();
itemManager = ItemManager.getInstance();
musicManager = MusicManager.getInstance();
m_phys_scale = 30;
m_timestep = (1 / 30);
m_iterations = 10;
initialized = false;
timeWait = 5000;
timeEnd = 0;
logicaActiva = false;
numeroOleadas = 10;
total_zombies = 0;
super();
contenedor = _arg1;
dificultad = _arg2;
eDispatcher = new EventDispatcher();
}
public function finalize(){
}
public function finLogica():Boolean{
var _local1:Boolean;
_local1 = false;
if (logicaActiva){
if (oleada_actual > numeroOleadas){
trace("fin de logica");
_local1 = true;
eDispatcher.dispatchEvent(new Event(END));
zombieManager.active = false;
logicaActiva = false;
itemManager.stop();
};
};
return (_local1);
}
public function initialize(){
oleada_actual = 1;
itemManager.tiempo_respawn = 5000;
initialized = true;
Globals.GameEnEspera = true;
Globals.GameLoading = false;
timeEnd = 0;
Globals.OLEADA_FINAL = numeroOleadas;
Globals.OLEADA_ACTUAL = 1;
}
public function update(){
if (Globals.ExitGame == true){
return (false);
};
if (initialized == false){
initialize();
};
finLogica();
if ((((((Globals.GameLoaded == true)) && (Globals.GameEnEspera))) && ((Globals.GameOver == false)))){
if (timeEnd == 0){
timeEnd = (getTimer() + timeWait);
mc_cartel = new carteles_juego();
if (oleada_actual == 1){
mc_cartel.cartel.info.text = "KILL ALL ZOMBIES!";
mc_cartel.cartel2.info.text = "KILL ALL ZOMBIES!";
juego.control_musica("FasterHarder");
} else {
mc_cartel.cartel.info.text = "";
mc_cartel.cartel2.info.text = "";
};
zombieManager.playerObj.cartelFlotante((("Wave " + oleada_actual) + " incoming"));
mc_cartel.visible = true;
mc_cartel.x = 0;
mc_cartel.y = 0;
mc_intefaz.addChild(mc_cartel);
logicaActiva = false;
itemManager.stop();
};
if (getTimer() > timeEnd){
mc_intefaz.removeChild(mc_cartel);
Globals.GameEnEspera = false;
timeEnd = 0;
if (oleada_actual == 1){
Configura_Oleada();
};
logicaActiva = true;
itemManager.start();
};
};
zombieManager.active = true;
if (logicaActiva == true){
if (((zombieManager.wave_finished) && ((logicaActiva == true)))){
Globals.GameEnEspera = true;
Siguiente_Oleada();
};
};
}
private function Siguiente_Oleada(){
oleada_actual++;
Globals.OLEADA_ACTUAL = oleada_actual;
Configura_Oleada();
}
private function Configura_Oleada(){
switch (oleada_actual){
case 1:
Globals.Z_DAMAGE = 5;
Globals.P_BASICO = 10;
Globals.P_MORDEDOR = 2;
Globals.P_BOMBA = 0;
Globals.Z_VELOCIDAD_MAX = 3.8;
Globals.Z_VELOCIDAD_MIN = 3;
Globals.Z_VIDA = 8;
total_zombies = 25;
zombieManager.datosZombies = new Array(total_zombies);
zombieManager.oleada_inicial = 1;
zombieManager.tiempo_respawn = 250;
zombieManager.max_en_pantalla = 10;
zombieManager.tipo_respawn = Globals.RADIAL_RESPAWN;
break;
default:
timeWait = 0;
Globals.Z_DAMAGE = (Globals.Z_DAMAGE + 0.5);
if (Globals.Z_DAMAGE > 12){
Globals.Z_DAMAGE = 12;
};
Globals.P_BASICO = (Globals.P_BASICO + 3);
Globals.P_MORDEDOR = (Globals.P_MORDEDOR + 2);
Globals.P_BOMBA = (Globals.P_BOMBA + 1);
Globals.Z_VIDA = (Globals.Z_VIDA + 0.5);
total_zombies = (total_zombies + 2);
zombieManager.datosZombies = new Array(total_zombies);
zombieManager.max_en_pantalla = (zombieManager.max_en_pantalla + 1);
if (zombieManager.max_en_pantalla > 10){
zombieManager.max_en_pantalla = 10;
};
};
zombieManager.startWave();
itemManager.start();
}
}
}//package com.tanoku.MoreZombies
Section 112
//Modo_Historia_TimeAttack (com.tanoku.MoreZombies.Modo_Historia_TimeAttack)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Modo_Historia_TimeAttack {
public var bidon_01:Bidon;
public var bidon_02:Bidon;
public var carrito_hotdogs:Carrito;
var total_zombies:Number;// = 0
var countdownTimer:Timer;
private var itemManager:ItemManager;
private var contenedor:MovieClip;
public var numero_zombies_ini:Number;// = 0
public var mc_cartel:carteles_juego;
public var logicaActiva:Boolean;// = false
private var zombieManager:ZombieManager;
public var m_timestep:Number;// = 0.0333333333333333
private var dificultad:int;
public var m_world:b2World;
public var enemyList:Array;
private var musicManager:MusicManager;
public var m_iterations:Number;// = 10
private var initialized:Boolean;// = false
public var timeEnd:Number;// = 0
public var cuenta_atras:Number;// = 180
public var mc_intefaz:MovieClip;
public var timeWait:Number;// = 5000
var juego;
public var numero_zombies:Number;// = 120
public var eDispatcher:EventDispatcher;
public var m_phys_scale:Number;// = 30
public var main_class:MovieClip;
private var oleada_actual:int;
public static const END:String = "end";
public static const LOOSE:String = "loose";
public function Modo_Historia_TimeAttack(_arg1:MovieClip, _arg2:int){
zombieManager = ZombieManager.getInstance();
itemManager = ItemManager.getInstance();
musicManager = MusicManager.getInstance();
m_phys_scale = 30;
m_timestep = (1 / 30);
m_iterations = 10;
initialized = false;
timeWait = 5000;
timeEnd = 0;
logicaActiva = false;
cuenta_atras = 180;
numero_zombies_ini = 0;
numero_zombies = 120;
countdownTimer = new Timer(1000);
total_zombies = 0;
super();
contenedor = _arg1;
dificultad = _arg2;
eDispatcher = new EventDispatcher();
}
public function finLogica():Boolean{
var _local1:Boolean;
var _local2:Number;
_local1 = false;
if (logicaActiva){
_local2 = (Globals.KILLS - numero_zombies_ini);
Globals.ZOMBIES_RESTANTES = _local2;
if (cuenta_atras <= 0){
if (_local2 >= numero_zombies){
trace("fin de logica VICTORIA");
_local1 = true;
eDispatcher.dispatchEvent(new Event(END));
zombieManager.active = false;
logicaActiva = false;
itemManager.stop();
} else {
trace("fin de logica DERROTA");
_local1 = true;
eDispatcher.dispatchEvent(new Event(LOOSE));
zombieManager.active = false;
logicaActiva = false;
itemManager.stop();
};
};
};
return (_local1);
}
public function initialize(){
oleada_actual = 1;
numero_zombies_ini = Globals.KILLS;
Globals.ZOMBIES_RESTANTES = 0;
itemManager.tiempo_respawn = 5000;
initialized = true;
Globals.GameEnEspera = true;
Globals.GameLoading = false;
timeEnd = 0;
Globals.TIEMPO_RESTANTE = (cuenta_atras * 1000);
countdownTimer.addEventListener(TimerEvent.TIMER, updateTime);
Globals.OLEADA_FINAL = 0;
Globals.OLEADA_ACTUAL = 1;
numero_zombies_ini = Globals.KILLS;
}
function updateTime(_arg1:TimerEvent):void{
if (((!(Globals.GamePaused)) && ((logicaActiva == true)))){
cuenta_atras = (cuenta_atras - 1);
Globals.TIEMPO_RESTANTE = (cuenta_atras * 1000);
};
}
public function update(){
if (Globals.ExitGame == true){
return (false);
};
if (initialized == false){
initialize();
};
finLogica();
if ((((((Globals.GameLoaded == true)) && (Globals.GameEnEspera))) && ((Globals.GameOver == false)))){
if (timeEnd == 0){
timeEnd = (getTimer() + timeWait);
mc_cartel = new carteles_juego();
if (oleada_actual == 1){
mc_cartel.cartel.info.text = "SURVIVE 3 MINUTES!";
mc_cartel.cartel2.info.text = "SURVIVE 3 MINUTES!";
juego.control_musica("BrokenDeck");
} else {
mc_cartel.cartel.info.text = "";
mc_cartel.cartel2.info.text = "";
};
zombieManager.playerObj.cartelFlotante((("Wave " + oleada_actual) + " incoming"));
mc_cartel.visible = true;
mc_cartel.x = 0;
mc_cartel.y = 0;
mc_intefaz.addChild(mc_cartel);
logicaActiva = false;
itemManager.stop();
countdownTimer.stop();
};
if (getTimer() > timeEnd){
mc_intefaz.removeChild(mc_cartel);
Globals.GameEnEspera = false;
timeEnd = 0;
if (oleada_actual == 1){
Configura_Oleada();
};
logicaActiva = true;
itemManager.start();
countdownTimer.start();
};
};
zombieManager.active = true;
if (logicaActiva == true){
if (((zombieManager.wave_finished) && ((logicaActiva == true)))){
Globals.GameEnEspera = true;
Siguiente_Oleada();
};
};
}
public function finalize(){
countdownTimer.removeEventListener(TimerEvent.TIMER, updateTime);
}
private function Siguiente_Oleada(){
oleada_actual++;
Globals.OLEADA_ACTUAL = oleada_actual;
Configura_Oleada();
}
private function Configura_Oleada(){
switch (oleada_actual){
case 1:
Globals.Z_DAMAGE = 1;
Globals.P_BASICO = 10;
Globals.P_MORDEDOR = 0;
Globals.P_BOMBA = 0;
Globals.Z_VELOCIDAD_MAX = 3;
Globals.Z_VELOCIDAD_MIN = 2;
Globals.Z_VIDA = 3;
total_zombies = 15;
zombieManager.datosZombies = new Array(total_zombies);
zombieManager.oleada_inicial = 1;
zombieManager.tiempo_respawn = 250;
zombieManager.max_en_pantalla = 6;
zombieManager.tipo_respawn = Globals.RADIAL_RESPAWN;
break;
default:
timeWait = 0;
Globals.Z_DAMAGE = (Globals.Z_DAMAGE + 0.5);
if (Globals.Z_DAMAGE > 5){
Globals.Z_DAMAGE = 5;
};
Globals.P_BASICO = (Globals.P_BASICO + 1);
Globals.P_MORDEDOR = (Globals.P_MORDEDOR + 1);
Globals.P_BOMBA = (Globals.P_BOMBA + 0.3);
Globals.Z_VIDA = (Globals.Z_VIDA + 0.3);
total_zombies = (total_zombies + 2);
zombieManager.datosZombies = new Array(total_zombies);
zombieManager.max_en_pantalla = (zombieManager.max_en_pantalla + 1);
if (zombieManager.max_en_pantalla > 10){
zombieManager.max_en_pantalla = 10;
};
};
zombieManager.startWave();
itemManager.start();
}
}
}//package com.tanoku.MoreZombies
Section 113
//Modo_Survival (com.tanoku.MoreZombies.Modo_Survival)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Modo_Survival {
public var bidon_01:Bidon;
public var bidon_02:Bidon;
public var carrito_hotdogs:Carrito;
var total_zombies:Number;// = 0
private var itemManager:ItemManager;
private var contenedor:MovieClip;
public var mc_cartel:carteles_juego;
public var logicaActiva:Boolean;// = false
private var zombieManager:ZombieManager;
public var m_timestep:Number;// = 0.0333333333333333
private var dificultad:int;
public var m_world:b2World;
public var enemyList:Array;
private var musicManager:MusicManager;
public var m_iterations:Number;// = 10
private var initialized:Boolean;// = false
public var timeEnd:Number;// = 0
public var mc_intefaz:MovieClip;
public var timeWait:Number;// = 5000
var juego;
public var eDispatcher:EventDispatcher;
public var m_phys_scale:Number;// = 30
public var main_class:MovieClip;
private var oleada_actual:int;
public static const END:String = "end";
public static const LOOSE:String = "loose";
public function Modo_Survival(_arg1:MovieClip, _arg2:int){
zombieManager = ZombieManager.getInstance();
itemManager = ItemManager.getInstance();
musicManager = MusicManager.getInstance();
m_phys_scale = 30;
m_timestep = (1 / 30);
m_iterations = 10;
initialized = false;
timeWait = 5000;
timeEnd = 0;
logicaActiva = false;
total_zombies = 0;
super();
contenedor = _arg1;
dificultad = _arg2;
eDispatcher = new EventDispatcher();
}
public function finalize(){
}
public function finLogica():Boolean{
var _local1:Boolean;
_local1 = false;
if (logicaActiva){
};
return (_local1);
}
public function initialize(){
oleada_actual = 1;
initialized = true;
Globals.GameEnEspera = true;
Globals.GameLoading = false;
timeEnd = 0;
Globals.OLEADA_FINAL = 0;
Globals.OLEADA_ACTUAL = 1;
}
public function update(){
if (Globals.ExitGame == true){
return (false);
};
if (initialized == false){
initialize();
};
finLogica();
if ((((((Globals.GameLoaded == true)) && (Globals.GameEnEspera))) && ((Globals.GameOver == false)))){
if (timeEnd == 0){
timeEnd = (getTimer() + timeWait);
mc_cartel = new carteles_juego();
if (oleada_actual == 1){
mc_cartel.cartel.info.text = "SURVIVE!";
mc_cartel.cartel2.info.text = "SURVIVE!";
juego.control_musica();
} else {
mc_cartel.cartel.info.text = "";
mc_cartel.cartel2.info.text = "";
};
zombieManager.playerObj.cartelFlotante((("Wave " + oleada_actual) + " incoming"));
mc_cartel.visible = true;
mc_cartel.x = 0;
mc_cartel.y = 0;
mc_intefaz.addChild(mc_cartel);
logicaActiva = false;
itemManager.stop();
};
if (getTimer() > timeEnd){
mc_intefaz.removeChild(mc_cartel);
Globals.GameEnEspera = false;
timeEnd = 0;
if (oleada_actual == 1){
Configura_Oleada();
};
logicaActiva = true;
itemManager.start();
};
};
zombieManager.active = true;
if (logicaActiva == true){
if (((zombieManager.wave_finished) && ((logicaActiva == true)))){
Globals.GameEnEspera = true;
Siguiente_Oleada();
};
};
}
private function Siguiente_Oleada(){
oleada_actual++;
Globals.OLEADA_ACTUAL = oleada_actual;
Configura_Oleada();
}
private function Configura_Oleada(){
switch (oleada_actual){
case 1:
Globals.Z_DAMAGE = (5 * Globals.DIFICULTAD_PARTIDA);
Globals.P_BASICO = 7;
Globals.P_MORDEDOR = 3;
Globals.P_BOMBA = 1;
Globals.Z_VELOCIDAD_MAX = 1;
Globals.Z_VELOCIDAD_MIN = 1;
Globals.Z_VIDA = (3 * Globals.DIFICULTAD_PARTIDA);
total_zombies = 10;
zombieManager.datosZombies = new Array(total_zombies);
zombieManager.oleada_inicial = 1;
zombieManager.tiempo_respawn = 250;
zombieManager.max_en_pantalla = 10;
zombieManager.tipo_respawn = Globals.RADIAL_RESPAWN;
break;
default:
timeWait = 0;
Globals.Z_VELOCIDAD_MAX = (Globals.Z_VELOCIDAD_MAX + 0.2);
Globals.Z_VELOCIDAD_MIN = (Globals.Z_VELOCIDAD_MIN + 0.2);
if (Globals.Z_VELOCIDAD_MAX > 4){
Globals.Z_VELOCIDAD_MAX = 4;
};
if (Globals.Z_VELOCIDAD_MIN > 4){
Globals.Z_VELOCIDAD_MIN = 4;
};
Globals.Z_VIDA = (Globals.Z_VIDA + (1 * Globals.DIFICULTAD_PARTIDA));
total_zombies = (total_zombies + 1);
zombieManager.datosZombies = new Array(total_zombies);
zombieManager.max_en_pantalla = (zombieManager.max_en_pantalla + 1);
if (zombieManager.max_en_pantalla > 10){
zombieManager.max_en_pantalla = 10;
};
};
zombieManager.startWave();
itemManager.start();
}
}
}//package com.tanoku.MoreZombies
Section 114
//Modo_TimeAttack (com.tanoku.MoreZombies.Modo_TimeAttack)
package com.tanoku.MoreZombies {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Modo_TimeAttack {
public var bidon_01:Bidon;
public var bidon_02:Bidon;
public var carrito_hotdogs:Carrito;
var total_zombies:Number;// = 0
var countdownTimer:Timer;
public var mc_cartel:carteles_juego;
private var itemManager:ItemManager;
private var contenedor:MovieClip;
public var logicaActiva:Boolean;// = false
private var zombieManager:ZombieManager;
public var m_timestep:Number;// = 0.0333333333333333
private var dificultad:int;
public var m_world:b2World;
public var enemyList:Array;
public var m_iterations:Number;// = 10
private var initialized:Boolean;// = false
public var timeEnd:Number;// = 0
public var cuenta_atras:Number;// = 30
public var mc_intefaz:MovieClip;
public var timeWait:Number;// = 5000
var juego;
public var eDispatcher:EventDispatcher;
public var m_phys_scale:Number;// = 30
public var main_class:MovieClip;
private var oleada_actual:int;
public static const END:String = "end";
public static const LOOSE:String = "loose";
public function Modo_TimeAttack(_arg1:MovieClip, _arg2:int){
zombieManager = ZombieManager.getInstance();
itemManager = ItemManager.getInstance();
m_phys_scale = 30;
m_timestep = (1 / 30);
m_iterations = 10;
initialized = false;
timeWait = 5000;
timeEnd = 0;
logicaActiva = false;
cuenta_atras = 30;
countdownTimer = new Timer(1000);
total_zombies = 0;
super();
contenedor = _arg1;
dificultad = _arg2;
eDispatcher = new EventDispatcher();
}
public function finalize(){
countdownTimer.removeEventListener(TimerEvent.TIMER, updateTime);
}
public function initialize(){
oleada_actual = 1;
initialized = true;
Globals.GameEnEspera = true;
Globals.GameLoading = false;
timeEnd = 0;
Globals.TIEMPO_RESTANTE = (cuenta_atras * 1000);
countdownTimer.addEventListener(TimerEvent.TIMER, updateTime);
Globals.OLEADA_FINAL = 0;
Globals.OLEADA_ACTUAL = 1;
}
public function finLogica():Boolean{
var _local1:Boolean;
_local1 = false;
if (logicaActiva){
if (cuenta_atras <= 0){
trace("fin de logica");
_local1 = true;
eDispatcher.dispatchEvent(new Event(LOOSE));
zombieManager.active = false;
logicaActiva = false;
itemManager.stop();
countdownTimer.stop();
};
};
return (_local1);
}
function updateTime(_arg1:TimerEvent):void{
if (((!(Globals.GamePaused)) && ((logicaActiva == true)))){
cuenta_atras = (cuenta_atras - 1);
Globals.TIME = (Globals.TIME + 1);
Globals.TIEMPO_RESTANTE = (cuenta_atras * 1000);
};
}
public function update(){
if (Globals.ExitGame == true){
return (false);
};
if (initialized == false){
initialize();
};
finLogica();
if ((((((Globals.GameLoaded == true)) && (Globals.GameEnEspera))) && ((Globals.GameOver == false)))){
if (timeEnd == 0){
timeEnd = (getTimer() + timeWait);
mc_cartel = new carteles_juego();
if (oleada_actual == 1){
mc_cartel.cartel.info.text = "TIME ATTACK!";
mc_cartel.cartel2.info.text = "TIME ATTACK!";
juego.control_musica("");
} else {
mc_cartel.cartel.info.text = "";
mc_cartel.cartel2.info.text = "";
cuenta_atras = (cuenta_atras + 15);
Globals.TIME = (Globals.TIME + 15);
Globals.TIEMPO_RESTANTE = (cuenta_atras * 1000);
zombieManager.playerObj.cartelFlotante((("Wave " + oleada_actual) + " incoming"));
};
mc_cartel.visible = true;
mc_cartel.x = 0;
mc_cartel.y = 0;
mc_intefaz.addChild(mc_cartel);
logicaActiva = false;
itemManager.stop();
countdownTimer.stop();
};
if (getTimer() > timeEnd){
mc_intefaz.removeChild(mc_cartel);
Globals.GameEnEspera = false;
timeEnd = 0;
if (oleada_actual == 1){
Configura_Oleada();
};
logicaActiva = true;
itemManager.start();
countdownTimer.start();
};
};
zombieManager.active = true;
if (logicaActiva == true){
if (((zombieManager.wave_finished) && ((logicaActiva == true)))){
Globals.GameEnEspera = true;
Siguiente_Oleada();
};
};
}
private function Siguiente_Oleada(){
oleada_actual++;
Globals.OLEADA_ACTUAL = oleada_actual;
Configura_Oleada();
}
private function Configura_Oleada(){
switch (oleada_actual){
case 1:
Globals.Z_DAMAGE = (5 * Globals.DIFICULTAD_PARTIDA);
Globals.P_BASICO = 7;
Globals.P_MORDEDOR = 3;
Globals.P_BOMBA = 1;
Globals.Z_VELOCIDAD_MAX = 1;
Globals.Z_VELOCIDAD_MIN = 1;
Globals.Z_VIDA = (3 * Globals.DIFICULTAD_PARTIDA);
total_zombies = 10;
zombieManager.datosZombies = new Array(total_zombies);
zombieManager.oleada_inicial = 1;
zombieManager.tiempo_respawn = 500;
zombieManager.max_en_pantalla = 10;
zombieManager.tipo_respawn = Globals.RADIAL_RESPAWN;
break;
default:
timeWait = 1000;
Globals.Z_VELOCIDAD_MAX = (Globals.Z_VELOCIDAD_MAX + 0.2);
Globals.Z_VELOCIDAD_MIN = (Globals.Z_VELOCIDAD_MIN + 0.2);
if (Globals.Z_VELOCIDAD_MAX > 4){
Globals.Z_VELOCIDAD_MAX = 4;
};
if (Globals.Z_VELOCIDAD_MIN > 4){
Globals.Z_VELOCIDAD_MIN = 4;
};
Globals.Z_VIDA = (Globals.Z_VIDA + (1 * Globals.DIFICULTAD_PARTIDA));
total_zombies = (total_zombies + 1);
zombieManager.datosZombies = new Array(total_zombies);
zombieManager.max_en_pantalla = (zombieManager.max_en_pantalla + 1);
if (zombieManager.max_en_pantalla > 10){
zombieManager.max_en_pantalla = 10;
};
};
zombieManager.startWave();
itemManager.start();
}
}
}//package com.tanoku.MoreZombies
Section 115
//MoreZombies (com.tanoku.MoreZombies.MoreZombies)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import flash.events.*;
import flash.display.*;
import gs.easing.*;
import mochi.as3.*;
import fl.transitions.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import fl.transitions.easing.*;
public dynamic class MoreZombies extends MovieClip {
private var pantalla_pelicula:pelicula;
public var remove_event:Boolean;// = false
private var myContextMenu:ContextMenu;
public var fondo_:MovieClip;
private var preloader:ThePreloader;
private var mcGamerSafe:MovieClip;
public var allowed:Boolean;// = false
public var txt_denegado:TextField;
private var pantalla_old;
public var musicManager:MusicManager;
public var domain:String;// = ""
public var soundManager:SoundManager;
private static var MENU_ITEM_1:String = "Tanoku";
private static var MENU_ITEM_2:String = "www.tanoku.com";
private static var fade_in:Tween;
private static var fade_out:Tween;
public static var fondo:MovieClip;
public static var cursor:Cursor;
public function MoreZombies(){
allowed = false;
remove_event = false;
domain = "";
super();
addFrameScript(0, frame1, 1, frame2, 3, frame4, 4, frame5);
myContextMenu = new ContextMenu();
myContextMenu.hideBuiltInItems();
this.contextMenu = myContextMenu;
}
public function Validar(){
var _local1:Array;
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:int;
trace("validar");
_local1 = new Array("");
_local2 = stage.loaderInfo.url;
_local3 = (_local2.indexOf("://") + 3);
_local4 = _local2.indexOf("/", _local3);
domain = _local2.substring(_local3, _local4);
_local5 = (domain.lastIndexOf(".") - 1);
_local6 = (domain.lastIndexOf(".", _local5) + 1);
domain = domain.substring(_local6, domain.length);
allowed = false;
_local7 = 0;
while (_local7 < _local1.length) {
trace((((("actual domain |" + domain) + "| (") + _local1[_local7]) + ")"));
if (domain == _local1[_local7]){
allowed = true;
_local7 = _local1.length;
};
_local7++;
};
allowed = true;
if (allowed){
trace("allowed");
IniciarGamerSafe();
this.play();
} else {
trace("denied");
txt_denegado.text = "access denied";
};
}
private function loadAssets(_arg1:Event):void{
}
private function manejarInicioSesion(_arg1:Event):void{
trace("gamersafe api cargada");
GamerSafe.api.hideStatusBar();
}
public function Cargar_Sonidos():void{
soundManager = SoundManager.getInstance();
musicManager = MusicManager.getInstance();
musicManager.addLibrarySound(Groove, "Groove");
musicManager.addLibrarySound(Mashem, "Mashem");
musicManager.addLibrarySound(Blender, "Blender");
musicManager.addLibrarySound(BrokenDeck, "BrokenDeck");
musicManager.addLibrarySound(Gridiron, "Gridiron");
musicManager.addLibrarySound(FasterHarder, "FasterHarder");
soundManager.addLibrarySound(M9, "M9");
soundManager.addLibrarySound(USP, "USP");
soundManager.addLibrarySound(DesertEagle, "DesertEagle");
soundManager.addLibrarySound(ColtPython, "ColtPython");
soundManager.addLibrarySound(SPAS12, "SPAS12");
soundManager.addLibrarySound(Winchester, "Winchester");
soundManager.addLibrarySound(Stinger, "Stinger");
soundManager.addLibrarySound(AITSO, "AITSO");
soundManager.addLibrarySound(Stingermisile, "Stingermisile");
soundManager.addLibrarySound(Uzi, "Uzi");
soundManager.addLibrarySound(P90, "P90");
soundManager.addLibrarySound(MP5, "MP5");
soundManager.addLibrarySound(AK47, "AK47");
soundManager.addLibrarySound(M16, "M16");
soundManager.addLibrarySound(M249, "M249");
soundManager.addLibrarySound(M60, "M60");
soundManager.addLibrarySound(Minigun, "Minigun");
soundManager.addLibrarySound(Cranium, "Cranium");
soundManager.addLibrarySound(casquillo_metal_01, "casquillo_metal_01");
soundManager.addLibrarySound(casquillo_metal_02, "casquillo_metal_02");
soundManager.addLibrarySound(casquillo_metal_03, "casquillo_metal_03");
soundManager.addLibrarySound(casquillo_plastico_01, "casquillo_plastico_01");
soundManager.addLibrarySound(casquillo_plastico_02, "casquillo_plastico_02");
soundManager.addLibrarySound(casquillo_plastico_03, "casquillo_plastico_03");
soundManager.addLibrarySound(woosh_corto_01, "woosh_corto_01");
soundManager.addLibrarySound(woosh_corto_02, "woosh_corto_02");
soundManager.addLibrarySound(woosh_medio_01, "woosh_medio_01");
soundManager.addLibrarySound(woosh_medio_02, "woosh_medio_02");
soundManager.addLibrarySound(woosh_largo_01, "woosh_largo_01");
soundManager.addLibrarySound(woosh_largo_02, "woosh_largo_02");
soundManager.addLibrarySound(GranadaExplosion, "GranadaExplosion");
soundManager.addLibrarySound(ExplosionGrande, "ExplosionGrande");
soundManager.addLibrarySound(Extintor, "Extintor");
soundManager.addLibrarySound(Motosierra, "Motosierra");
soundManager.addLibrarySound(Lanzallamas, "Lanzallamas");
soundManager.addLibrarySound(ice_break, "ice_break");
soundManager.addLibrarySound(freeze, "freeze");
soundManager.addLibrarySound(freezer_mine, "freezer_mine");
soundManager.addLibrarySound(impacto_bidon_01, "impacto_bidon_01");
soundManager.addLibrarySound(impacto_bidon_02, "impacto_bidon_02");
soundManager.addLibrarySound(bidon_destruir, "bidon_destruir");
soundManager.addLibrarySound(impacto_carrito_01, "impacto_carrito_01");
soundManager.addLibrarySound(impacto_carrito_02, "impacto_carrito_02");
soundManager.addLibrarySound(caida_01, "caida_01");
soundManager.addLibrarySound(caida_02, "caida_02");
soundManager.addLibrarySound(amputa_cabeza, "amputa_cabeza");
soundManager.addLibrarySound(head_shot, "head_shot");
soundManager.addLibrarySound(amputa_mitad_01, "amputa_mitad_01");
soundManager.addLibrarySound(amputa_mitad_02, "amputa_mitad_02");
soundManager.addLibrarySound(zatoichi, "zatoichi");
soundManager.addLibrarySound(player_damage, "player_damage");
soundManager.addLibrarySound(mordisco_zombie, "mordisco_zombie");
soundManager.addLibrarySound(zombie_arde, "zombie_arde");
soundManager.addLibrarySound(chorro_sangre, "chorro_sangre");
soundManager.addLibrarySound(zombie_damage_01, "zombie_damage_01");
soundManager.addLibrarySound(zombie_damage_02, "zombie_damage_02");
soundManager.addLibrarySound(zombie_pain1, "zombie_pain1");
soundManager.addLibrarySound(zombie_pain2, "zombie_pain2");
soundManager.addLibrarySound(zombie_pain3, "zombie_pain3");
soundManager.addLibrarySound(zombie_pain4, "zombie_pain4");
soundManager.addLibrarySound(zombie_pain5, "zombie_pain5");
soundManager.addLibrarySound(player_zafarse, "player_zafarse");
soundManager.addLibrarySound(trofeo, "trofeo");
soundManager.addLibrarySound(victoria, "victoria");
soundManager.addLibrarySound(gameover, "gameover");
soundManager.addLibrarySound(item, "item");
trace(("musica activa" + Globals.MUSICA_ACTIVA));
musicManager.Activo = Globals.MUSICA_ACTIVA;
trace(("sonido activo" + Globals.SONIDO_ACTIVO));
soundManager.Activo = Globals.SONIDO_ACTIVO;
}
public function cierra_pelicula(){
removeChild(pantalla_pelicula);
pantalla_pelicula = null;
}
private function onFinishTween():void{
removeChild(pantalla_old);
pantalla_old = null;
}
public function Preloader(){
trace("preloading");
Globals.GamePreloading = true;
preloader = new ThePreloader(474, this.loaderInfo);
stage.addChild(preloader);
preloader.addEventListener("loadComplete", loadAssets);
preloader.addEventListener("preloaderFinished", showSponsors);
}
public function abre_pelicula(_arg1:int){
pantalla_pelicula = new pelicula(_arg1);
pantalla_pelicula.main_class = this;
addChild(pantalla_pelicula);
}
private function manejarErrorGamerSafe(_arg1:Event):void{
trace("gamersafe error de red");
}
private function manejarErrorGAmerSafe(_arg1:Event):void{
trace("error red gamersafe");
}
public function Start(){
trace("start game");
stop();
MochiServices.connect("2af61460368dde70", this);
Globals.saveManager.load();
if (Globals.PLAYER_NAME == ""){
trace("pedir nombre de jugador");
};
stage.quality = StageQuality.BEST;
Cargar_Sonidos();
cursor = new Cursor(stage);
fondo = fondo_;
abre_pantalla(new principal(), "pelicula");
}
private function addCustomMenuItems():void{
var _local1:ContextMenuBuiltInItems;
var _local2:ContextMenuItem;
var _local3:ContextMenuItem;
myContextMenu.hideBuiltInItems();
_local1 = myContextMenu.builtInItems;
_local1.print = false;
_local2 = new ContextMenuItem(MENU_ITEM_1);
myContextMenu.customItems.push(_local2);
_local3 = new ContextMenuItem(MENU_ITEM_2);
myContextMenu.customItems.push(_local3);
_local2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuItemSelectHandler);
_local3.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, menuItemSelectHandler);
}
function frame4(){
stop();
Intros();
}
public function cierra_pantalla(_arg1, _arg2:String=""){
if (_arg1){
if (_arg2 == ""){
removeChild(_arg1);
_arg1 = null;
};
if (_arg2 == "pelicula"){
removeChild(_arg1);
_arg1 = null;
};
if (_arg2 == "cortina"){
TweenLite.to(_arg1, 1, {y:-450, onComplete:onFinishTween});
pantalla_old = _arg1;
};
};
}
function frame2(){
stop();
Preloader();
}
function frame5(){
stop();
Start();
}
function frame1(){
MochiBot.track(this, "2bc45df0");
stop();
Validar();
}
private function manejarCompraObjeto(_arg1:Event):void{
Globals.saveManager.update();
}
private function ActualizarEstadoPartidaGuardada():void{
}
public function Intros(){
stop();
trace("Intro");
}
public function abre_pantalla(_arg1, _arg2:String=""){
if (_arg2 == "pelicula"){
};
if (_arg2 == "cortina"){
_arg1.y = -450;
};
addChild(_arg1);
_arg1.main_class = this;
if (_arg2 == "pelicula"){
};
if (_arg2 == "cortina"){
TweenLite.to(_arg1, 1, {y:0});
};
}
private function menuSelectHandler(_arg1:ContextMenuEvent):void{
}
private function removeDefaultItems():void{
}
private function showSponsors(_arg1:Event):void{
Globals.GamePreloading = false;
stage.removeChild(preloader);
trace("end preloading");
trace("show sponsors");
gotoAndStop(4);
}
private function menuItemSelectHandler(_arg1:ContextMenuEvent):void{
var _local2:URLRequest;
switch (_arg1.target.caption){
case MENU_ITEM_1:
trace("item 1 triggered");
break;
case MENU_ITEM_2:
trace("item 2 triggered");
_local2 = new URLRequest("http://tanoku.com/eng/flash/index.html");
navigateToURL(_local2, "_blank");
break;
};
}
public function IniciarGamerSafe(){
trace("crear gaersafe");
}
private function manejarIngresoGamerSafe(_arg1:Event):void{
trace(("usuario validado " + GamerSafe.api.username));
trace(("usuario savegame " + GamerSafe.api.savedGame));
Globals.saveManager.load();
ActualizarEstadoPartidaGuardada();
}
public static function abrirWeb(_arg1:String){
var _local2:URLRequest;
_local2 = new URLRequest(_arg1);
navigateToURL(_local2);
}
}
}//package com.tanoku.MoreZombies
Section 116
//opciones (com.tanoku.MoreZombies.opciones)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import flash.events.*;
import flash.display.*;
import com.cheezeworld.utils.*;
import flash.text.*;
public class opciones extends MovieClip {
private var panel;
public var b_blood_off:MovieClip;
public var b_quality_med:MovieClip;
public var t_up:TextField;
public var b_s_slot1:SimpleButton;
public var b_s_slot3:SimpleButton;
public var b_s_slot2:SimpleButton;
public var b_sound_on:MovieClip;
public var t_slot1:TextField;
public var t_slot2:TextField;
public var t_slot3:TextField;
public var b_s_pause:SimpleButton;
public var b_s_right:SimpleButton;
public var t_slot4:TextField;
public var b_s_slot4:SimpleButton;
public var t_right:TextField;
public var t_pause:TextField;
public var b_sound_off:MovieClip;
public var b_back:SimpleButton;
public var b_music_off:MovieClip;
private var next_tecla;
public var b_s_left:SimpleButton;
public var t_left:TextField;
private var musica:Boolean;
public var b_reset:SimpleButton;
public var calidad:MovieClip;
public var t_a_left:TextField;
public var b_s_a_right:SimpleButton;
public var t_switch:TextField;
public var b_s_down:SimpleButton;
public var main_class:MovieClip;
public var b_music_on:MovieClip;
public var b_blood_on:MovieClip;
public var t_down:TextField;
public var soundManager:SoundManager;
public var b_quality_high:MovieClip;
public var b_s_up:SimpleButton;
public var b_s_a_left:SimpleButton;
public var b_quality_low:MovieClip;
public var b_s_switch:SimpleButton;
public var musicManager:MusicManager;
public var b_s_melee:SimpleButton;
private var sonido:Boolean;
public var t_melee:TextField;
public var t_a_right:TextField;
public function opciones(){
soundManager = SoundManager.getInstance();
musicManager = MusicManager.getInstance();
musica = Globals.MUSICA_ACTIVA;
sonido = Globals.SONIDO_ACTIVO;
super();
b_music_on.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_music_off.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_sound_on.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_sound_off.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_blood_on.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_blood_off.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_quality_low.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_quality_med.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_quality_high.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_quality_low.addEventListener(MouseEvent.MOUSE_MOVE, on_button_over);
b_quality_med.addEventListener(MouseEvent.MOUSE_MOVE, on_button_over);
b_quality_high.addEventListener(MouseEvent.MOUSE_MOVE, on_button_over);
b_quality_low.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
b_quality_med.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
b_quality_high.addEventListener(MouseEvent.MOUSE_OUT, on_mouse_out);
calidad.alpha = 1;
calidad.visible = false;
b_reset.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_s_left.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_s_right.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_s_up.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_s_down.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_s_a_left.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_s_a_right.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_s_melee.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_s_slot1.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_s_slot2.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_s_slot3.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_s_slot4.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_s_switch.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_s_pause.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_back.addEventListener(MouseEvent.CLICK, on_button_clicked);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function on_mouse_out(_arg1:MouseEvent){
calidad.visible = false;
}
public function control_estado(){
switch (musica){
case true:
b_music_on.gotoAndStop(2);
b_music_off.gotoAndStop(1);
break;
case false:
b_music_on.gotoAndStop(1);
b_music_off.gotoAndStop(2);
break;
};
switch (sonido){
case true:
b_sound_on.gotoAndStop(2);
b_sound_off.gotoAndStop(1);
break;
case false:
b_sound_on.gotoAndStop(1);
b_sound_off.gotoAndStop(2);
break;
};
switch (Globals.SANGRE_ACTIVA){
case true:
b_blood_on.gotoAndStop(2);
b_blood_off.gotoAndStop(1);
break;
case false:
b_blood_on.gotoAndStop(1);
b_blood_off.gotoAndStop(2);
break;
};
switch (Globals.CALIDAD){
case "LOW":
b_quality_low.gotoAndStop(2);
b_quality_med.gotoAndStop(1);
b_quality_high.gotoAndStop(1);
break;
case "MEDIUM":
b_quality_low.gotoAndStop(1);
b_quality_med.gotoAndStop(2);
b_quality_high.gotoAndStop(1);
break;
case "HIGH":
b_quality_low.gotoAndStop(1);
b_quality_med.gotoAndStop(1);
b_quality_high.gotoAndStop(2);
break;
case "BEST":
b_quality_low.gotoAndStop(1);
b_quality_med.gotoAndStop(1);
b_quality_high.gotoAndStop(2);
break;
};
t_left.text = Input.instance.getKeyString(Globals.KEY_MOVE_LEFT);
t_right.text = Input.instance.getKeyString(Globals.KEY_MOVE_RIGHT);
t_up.text = Input.instance.getKeyString(Globals.KEY_MOVE_UP);
t_down.text = Input.instance.getKeyString(Globals.KEY_MOVE_DOWN);
t_a_left.text = Input.instance.getKeyString(Globals.KEY_ATTACK_LEFT);
t_a_right.text = Input.instance.getKeyString(Globals.KEY_ATTACK_RIGHT);
t_melee.text = Input.instance.getKeyString(Globals.KEY_SELECT_MELEE);
t_slot1.text = Input.instance.getKeyString(Globals.KEY_SELECT_SLOT1);
t_slot2.text = Input.instance.getKeyString(Globals.KEY_SELECT_SLOT2);
t_slot3.text = Input.instance.getKeyString(Globals.KEY_SELECT_SLOT3);
t_slot4.text = Input.instance.getKeyString(Globals.KEY_SELECT_SLOT4);
t_switch.text = Input.instance.getKeyString(Globals.KEY_SWITCH);
t_pause.text = Input.instance.getKeyString(Globals.KEY_PAUSE);
}
private function keyRelease(_arg1:KeyboardEvent):void{
switch (next_tecla){
case "left":
Globals.KEY_MOVE_LEFT = _arg1.keyCode;
break;
case "right":
Globals.KEY_MOVE_RIGHT = _arg1.keyCode;
break;
case "up":
Globals.KEY_MOVE_UP = _arg1.keyCode;
break;
case "down":
Globals.KEY_MOVE_DOWN = _arg1.keyCode;
break;
case "a_left":
Globals.KEY_ATTACK_LEFT = _arg1.keyCode;
break;
case "a_right":
Globals.KEY_ATTACK_RIGHT = _arg1.keyCode;
break;
case "s_melee":
Globals.KEY_SELECT_MELEE = _arg1.keyCode;
break;
case "s_slot1":
Globals.KEY_SELECT_SLOT1 = _arg1.keyCode;
break;
case "s_slot2":
Globals.KEY_SELECT_SLOT2 = _arg1.keyCode;
break;
case "s_slot3":
Globals.KEY_SELECT_SLOT3 = _arg1.keyCode;
break;
case "s_slot4":
Globals.KEY_SELECT_SLOT4 = _arg1.keyCode;
break;
case "switch":
Globals.KEY_SWITCH = _arg1.keyCode;
break;
case "pause":
Globals.KEY_PAUSE = _arg1.keyCode;
break;
};
stage.removeEventListener(KeyboardEvent.KEY_UP, keyRelease, false);
removeChild(panel);
control_estado();
}
public function on_button_clicked(_arg1:MouseEvent){
switch (_arg1.currentTarget.name){
case "b_music_on":
musica = true;
Globals.MUSICA_ACTIVA = true;
musicManager.unmuteAllSounds();
musicManager.Activo = Globals.MUSICA_ACTIVA;
if (Globals.currentMusic == "Mashem"){
musicManager.playSound(Globals.currentMusic, Globals.VOLUMEN_MUSICA, 0, 99);
} else {
musicManager.playSound(Globals.currentMusic, Globals.VOLUMEN_MUSICA, 0);
};
control_estado();
break;
case "b_music_off":
musica = false;
Globals.MUSICA_ACTIVA = false;
musicManager.muteAllSounds();
musicManager.Activo = Globals.MUSICA_ACTIVA;
musicManager.stopSound(Globals.currentMusic);
control_estado();
break;
case "b_sound_on":
sonido = true;
Globals.SONIDO_ACTIVO = true;
soundManager.unmuteAllSounds();
soundManager.Activo = Globals.SONIDO_ACTIVO;
control_estado();
break;
case "b_sound_off":
sonido = false;
Globals.SONIDO_ACTIVO = false;
soundManager.muteAllSounds();
soundManager.Activo = Globals.SONIDO_ACTIVO;
control_estado();
break;
case "b_blood_on":
Globals.SANGRE_ACTIVA = true;
control_estado();
break;
case "b_blood_off":
Globals.SANGRE_ACTIVA = false;
control_estado();
break;
case "b_quality_low":
Globals.CALIDAD = "LOW";
control_estado();
break;
case "b_quality_med":
Globals.CALIDAD = "MEDIUM";
control_estado();
break;
case "b_quality_high":
Globals.CALIDAD = "HIGH";
control_estado();
break;
case "b_reset":
reset_keyboard();
control_estado();
break;
case "b_s_left":
setup_tecla("left", " MOVE LEFT");
break;
case "b_s_right":
setup_tecla("right", " MOVE RIGHT");
break;
case "b_s_up":
setup_tecla("up", " MOVE UP");
break;
case "b_s_down":
setup_tecla("down", " MOVE DOWN");
break;
case "b_s_a_left":
setup_tecla("a_left", " ATTACK LEFT");
break;
case "b_s_a_right":
setup_tecla("a_right", " ATTACK RIGHT");
break;
case "b_s_melee":
setup_tecla("s_melee", " SELECT MELEE");
break;
case "b_s_slot1":
setup_tecla("s_slot1", " SELECT SLOT 1");
break;
case "b_s_slot2":
setup_tecla("s_slot2", " SELECT SLOT 2");
break;
case "b_s_slot3":
setup_tecla("s_slot3", " SELECT SLOT 3");
break;
case "b_s_slot4":
setup_tecla("s_slot4", " SELECT SLOT 4");
break;
case "b_s_switch":
setup_tecla("switch", " SWITCH WEAPON");
break;
case "b_s_pause":
setup_tecla("pause", " PAUSE GAME");
break;
case "b_back":
main_class.cierra_pantalla(this, "cortina");
Globals.saveManager.save();
break;
default:
trace((_arg1.target.name + " UNDEFINED"));
break;
};
}
private function onEnterFrame(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
Input.instance.activate(main_class.stage);
control_estado();
}
function setup_tecla(_arg1, _arg2:String){
panel = new panel_detectar_tecla();
addChild(panel);
panel.texto.text = _arg2;
next_tecla = _arg1;
stage.addEventListener(KeyboardEvent.KEY_UP, keyRelease, false, 0, true);
}
function reset_keyboard(){
Globals.KEY_MOVE_LEFT = KeyCode.A;
Globals.KEY_MOVE_RIGHT = KeyCode.D;
Globals.KEY_MOVE_UP = KeyCode.W;
Globals.KEY_MOVE_DOWN = KeyCode.S;
Globals.KEY_ATTACK_LEFT = KeyCode.K;
Globals.KEY_ATTACK_RIGHT = KeyCode.L;
Globals.KEY_SELECT_MELEE = KeyCode.ONE;
Globals.KEY_SELECT_SLOT1 = KeyCode.TWO;
Globals.KEY_SELECT_SLOT2 = KeyCode.THREE;
Globals.KEY_SELECT_SLOT3 = KeyCode.FOUR;
Globals.KEY_SELECT_SLOT4 = KeyCode.FIVE;
Globals.KEY_SWITCH = KeyCode.SPACEBAR;
Globals.KEY_PAUSE = KeyCode.P;
}
public function on_button_over(_arg1:MouseEvent){
calidad.visible = true;
switch (_arg1.target.name){
case "b_quality_low":
calidad.gotoAndStop(3);
break;
case "b_quality_med":
calidad.gotoAndStop(2);
break;
case "b_quality_high":
calidad.gotoAndStop(1);
break;
};
}
}
}//package com.tanoku.MoreZombies
Section 117
//ParalaxManager (com.tanoku.MoreZombies.ParalaxManager)
package com.tanoku.MoreZombies {
import flash.events.*;
import flash.display.*;
public class ParalaxManager {
public var layer_1:MovieClip;
public var layer_mc:MovieClip;
public var layer_3:MovieClip;
public var layer_2:MovieClip;
public var dif_layer_2:Number;
public var dif_layer_3:Number;
public var camara_:Camara;
public var ancho_layer_2:Number;
public var ancho_layer_3:Number;
public var ancho_mapa:Number;
public var active:Boolean;// = false
public var alto_mapa:Number;
public static var instance:ParalaxManager;
public function ParalaxManager(_arg1:SingletonEnforcer){
active = false;
super();
}
public function stop(){
}
public function update(){
if (active){
if (layer_2 != null){
sincroniza(layer_2, dif_layer_2, ancho_layer_2);
};
if (layer_3 != null){
sincroniza(layer_3, dif_layer_3, ancho_layer_3);
};
};
}
public function clear(){
layer_mc = null;
layer_1 = null;
layer_2 = null;
dif_layer_2 = 0;
ancho_layer_2 = 0;
layer_3 = null;
dif_layer_3 = 0;
ancho_layer_3 = 0;
}
public function finalize(){
instance = null;
}
public function start(){
layer_mc.visible = true;
if (layer_3 != null){
layer_mc.addChild(layer_3);
};
if (layer_2 != null){
layer_mc.addChild(layer_2);
};
if (layer_1 != null){
layer_mc.addChild(layer_1);
if (ancho_layer_2 == 0){
ancho_layer_2 = layer_2.width;
};
if (dif_layer_2 == 0){
dif_layer_2 = (layer_1.width - ancho_layer_2);
};
if (layer_3 != null){
if (ancho_layer_3 == 0){
ancho_layer_3 = layer_3.width;
};
if (dif_layer_3 == 0){
dif_layer_3 = (layer_1.width - ancho_layer_3);
};
};
};
active = true;
}
public function sincroniza(_arg1, _arg2, _arg3){
if (Globals.leftLimit){
_arg1.x = 0;
} else {
if (Globals.rightLimit){
_arg1.x = (layer_1.width - _arg3);
} else {
_arg1.x = (_arg2 * (camara_.porcentaje_x / 100));
};
};
}
public static function getInstance():ParalaxManager{
if (instance == null){
instance = new ParalaxManager(new SingletonEnforcer());
};
return (instance);
}
}
}//package com.tanoku.MoreZombies
class SingletonEnforcer {
private function SingletonEnforcer(){
}
}
Section 118
//pausa (com.tanoku.MoreZombies.pausa)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class pausa extends MovieClip {
public var b_main:MovieClip;
public var currentMenu:int;// = 1
public var main_class:MovieClip;
public var b_armory:MovieClip;
public var b_return:MovieClip;
public var b_options:MovieClip;
public var musicManager:MusicManager;
public function pausa(){
currentMenu = 1;
musicManager = MusicManager.getInstance();
super();
b_return.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_armory.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_options.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_main.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_return.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_armory.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_options.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
b_main.addEventListener(MouseEvent.MOUSE_OVER, on_button_over);
Globals.GamePaused_Screen = true;
Globals.ExitGame = false;
MoreZombies.cursor.Activo = true;
MoreZombies.cursor.visible = true;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
estado_menu();
}
public function selecciona_opcion(_arg1:int){
switch (_arg1){
case 1:
MoreZombies.cursor.Activo = false;
MoreZombies.cursor.visible = false;
finalize();
main_class.cierra_pantalla(this);
Globals.GamePaused = false;
Globals.GamePaused_Screen = false;
break;
case 2:
main_class.abre_pantalla(new armeria(), "cortina");
break;
case 3:
main_class.abre_pantalla(new opciones(), "cortina");
break;
case 4:
finalize();
main_class.cierra_pantalla(this);
main_class.abre_pantalla(new principal(), "pelicula");
Globals.ExitGame = true;
break;
};
}
public function finalize(){
stage.removeEventListener(KeyboardEvent.KEY_UP, keyReleasePause);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function keyReleasePause(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case 38:
currentMenu = (currentMenu - 1);
if (currentMenu <= 0){
currentMenu = 4;
};
break;
case 40:
currentMenu = (currentMenu + 1);
if (currentMenu >= 5){
currentMenu = 1;
};
break;
case 13:
switch (currentMenu){
case 1:
selecciona_opcion(1);
break;
case 2:
selecciona_opcion(2);
break;
case 3:
selecciona_opcion(3);
break;
case 4:
selecciona_opcion(4);
break;
};
break;
default:
trace(_arg1.keyCode);
};
}
public function on_button_over(_arg1:MouseEvent){
switch (_arg1.target.name){
case "b_return":
currentMenu = 1;
break;
case "b_armory":
currentMenu = 2;
break;
case "b_options":
currentMenu = 3;
break;
case "b_main":
currentMenu = 4;
break;
};
}
public function estado_menu(){
b_return.gotoAndStop(1);
b_armory.gotoAndStop(1);
b_options.gotoAndStop(1);
b_main.gotoAndStop(1);
if (currentMenu == 1){
b_return.gotoAndStop(2);
};
if (currentMenu == 2){
b_armory.gotoAndStop(2);
};
if (currentMenu == 3){
b_options.gotoAndStop(2);
};
if (currentMenu == 4){
b_main.gotoAndStop(2);
};
}
public function on_button_clicked(_arg1:MouseEvent){
switch (_arg1.target.name){
case "b_return":
selecciona_opcion(1);
break;
case "b_armory":
selecciona_opcion(2);
break;
case "b_options":
selecciona_opcion(3);
break;
case "b_main":
selecciona_opcion(4);
break;
default:
trace((_arg1.target.name + " UNDEFINED"));
break;
};
}
private function onEnterFrame(_arg1:Event):void{
estado_menu();
stage.addEventListener(KeyboardEvent.KEY_UP, keyReleasePause, false, 0, true);
}
}
}//package com.tanoku.MoreZombies
Section 119
//pelicula (com.tanoku.MoreZombies.pelicula)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class pelicula extends MovieClip {
private var peliculaMc:MovieClip;
public var indice_pelicula:int;
private var boton_skip:SimpleButton;
public var main_class:MovieClip;
private var musicManager:MusicManager;
public function pelicula(_arg1:int){
musicManager = MusicManager.getInstance();
super();
indice_pelicula = _arg1;
musicManager.stopAllSounds(true);
Globals.currentMusic = "Groove";
musicManager.playSound(Globals.currentMusic, 1, 0, 99);
switch (indice_pelicula){
case 1:
peliculaMc = new escena1();
break;
case 2:
peliculaMc = new escena2();
break;
case 3:
peliculaMc = new escena3();
break;
case 4:
peliculaMc = new escena4();
break;
case 5:
peliculaMc = new escena5();
break;
default:
trace("error pelicula");
};
addChild(peliculaMc);
boton_skip = new btn_skip();
boton_skip.x = 738;
boton_skip.y = 414;
boton_skip.name = "boton_skip";
addChild(boton_skip);
boton_skip.addEventListener(MouseEvent.CLICK, manejarClickSkip);
addEventListener(Event.ENTER_FRAME, manejarEnterFrame);
}
private function manejarClickSkip(_arg1:MouseEvent):void{
trace("saltar intro");
fin_pelicula();
}
private function manejarEnterFrame(_arg1:Event):void{
if (peliculaMc.currentFrame >= peliculaMc.totalFrames){
fin_pelicula();
};
}
public function fin_pelicula(){
var _local1:Juego;
trace(("fin pelicula " + indice_pelicula));
removeEventListener(Event.ENTER_FRAME, manejarEnterFrame);
boton_skip.removeEventListener(MouseEvent.CLICK, manejarClickSkip);
if (indice_pelicula <= 4){
_local1 = new Juego(main_class);
_local1.main_class = main_class;
_local1.initialize();
main_class.abre_pantalla(new loading());
} else {
musicManager.stopAllSounds(true);
main_class.abre_pantalla(new puntuacion(), "cortina");
};
main_class.cierra_pelicula();
}
}
}//package com.tanoku.MoreZombies
Section 120
//Player (com.tanoku.MoreZombies.Player)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import flash.events.*;
import flash.display.*;
import com.cheezeworld.utils.*;
import flash.geom.*;
import flash.utils.*;
import flash.text.*;
public class Player extends MovieClip {
public const ANDAR:int = 15;
const STINGER:int = 17;
const DISPARA_HOMBRO:int = 8;
const LANZA_GRANADA:int = 9;
const DIE:int = 14;
const AITSO:int = 18;
const FREEZED:int = 19;
const VICTORIA:int = 21;
public const QUIETO:int = 0;
const MELEE_01:int = 21;
const MELEE_02:int = 22;
const MELEE_03:int = 23;
const MELEE_04:int = 24;
const LANZA_MINA:int = 10;
const MORDIDO:int = 16;
const DAM_1:int = 13;
const DISPARA_AUTOMATICA:int = 7;
const ANDAR_INV:int = 22;
const ATACA:int = 2;
const DETONA:int = 11;
public const CORRER:int = 1;
const DIE_FREEZED:int = 20;
const DISPARA_MANUAL:int = 6;
const CORRER_INV:int = 12;
public var suavizar_movimiento_camara:Boolean;// = false
public var limite_vertical:Boolean;// = false
private var xvel:Number;// = 0
private var current_animation:String;
public var enemyList:Array;
public var m_iterations:Number;// = 10
public var b:b2Body;
public var fdir;// = 0
public var moviendose:Boolean;// = false
public var layer_ground_bmd:BitmapData;
public var bited:Boolean;// = false
public var zombieBitting:Object;// = null
public var sonidoEnBucle:String;// = ""
private var yvel:Number;// = 0
public var estado_actual:int;// = -1
private var adir;// = 0
private var contenedor:MovieClip;
public var layer_ground_bm:Bitmap;
public var dir;// = 0
public var remove:Boolean;// = false
public var zafandose:Boolean;// = false
public var m_timestep:Number;// = 0.0333333333333333
public var Atacar:Boolean;// = false
public var info:TextField;
public var contadorMordiscos:Number;// = 0
public var multiplicador:Number;// = 1
private var max_ancho:int;
public var freezed:Boolean;// = false
public var logica;
private var _input:Input;
public var interfaz;
public var Atacando:Boolean;// = false
public var eDispatcher:EventDispatcher;
public var m_phys_scale:Number;// = 30
public var alive:Boolean;// = true
public var retrocesoCombo:Number;// = 0
public var life:int;// = 100
private var next_animation:String;
public var tipo:Number;// = -1
public var unfreeze_time:Number;// = 0
public var m_world:b2World;
public var rango:int;// = 0
public var torso_actual:int;// = 0
private var depthManager:DepthManager;
private var _wait_animation:Boolean;// = false
public var achievementManager:AchievementManager;
public var arma_actual:int;// = 0
public var combo_delay:int;// = 500
public var currentCombo:int;// = 0
public var body:MovieClip;
private var vel:Number;// = 8
public var lastTimeBited:Number;// = 0
public var soundManager:SoundManager;
public var muertes:int;// = 0
public var puntuacion:Number;// = 0
public var canMove:Boolean;// = true
public var layer_ground_mc:MovieClip;
private var max_alto:int;
public var encadenar_combo:Boolean;// = false
private var state_;// = 0
public var weaponManager:WeaponManager;
private var _stage;
public static const UPDATE:String = "update";
public static const DIES:String = "die";
public function Player(_arg1, _arg2:int, _arg3:int, _arg4:MovieClip):void{
m_phys_scale = 30;
m_timestep = (1 / 30);
m_iterations = 10;
dir = 0;
fdir = 0;
adir = 0;
xvel = 0;
yvel = 0;
state_ = 0;
_input = Input.instance;
vel = 8;
remove = false;
depthManager = DepthManager.getInstance();
weaponManager = WeaponManager.getInstance();
soundManager = SoundManager.getInstance();
achievementManager = AchievementManager.getInstance();
_wait_animation = false;
bited = false;
canMove = true;
contadorMordiscos = 0;
zafandose = false;
zombieBitting = null;
currentCombo = 0;
moviendose = false;
suavizar_movimiento_camara = false;
torso_actual = 0;
arma_actual = 0;
estado_actual = -1;
life = 100;
alive = true;
Atacar = false;
puntuacion = 0;
multiplicador = 1;
muertes = 0;
rango = 0;
tipo = -1;
lastTimeBited = 0;
encadenar_combo = false;
combo_delay = 500;
limite_vertical = false;
unfreeze_time = 0;
freezed = false;
Atacando = false;
sonidoEnBucle = "";
retrocesoCombo = 0;
super();
stop();
max_ancho = _arg2;
max_alto = _arg3;
contenedor = _arg4;
state_ = QUIETO;
dir = Globals.DER;
_stage = _arg1;
Input.instance.activate(_arg1);
}
public function cargar_municion():String{
var _local1:Array;
var _local2:String;
var _local3:int;
var _local4:int;
_local1 = new Array();
_local2 = "";
_local3 = 0;
while (_local3 < weaponManager.weaponList.length) {
if (weaponManager.weaponList[_local3] != null){
if (weaponManager.weaponList[_local3].ammo == true){
if (((!((weaponManager.weaponList[_local3].clip == 0))) && ((weaponManager.weaponList[_local3].current_ammo < weaponManager.weaponList[_local3].max_ammo)))){
_local1.push(weaponManager.weaponList[_local3]);
};
};
};
_local3++;
};
if (_local1.length > 0){
_local4 = (Math.random() * _local1.length);
_local1[_local4].current_ammo = (_local1[_local4].current_ammo + _local1[_local4].clip);
if (_local1[_local4].current_ammo > _local1[_local4].max_ammo){
_local1[_local4].current_ammo = _local1[_local4].max_ammo;
};
_local2 = (_local1[_local4].name + " AMMO");
};
return (_local2);
}
public function finalize(){
trace("finalize player");
if (sonidoEnBucle != ""){
soundManager.stopSound(sonidoEnBucle);
sonidoEnBucle = "";
};
logica.eDispatcher.removeEventListener("end", LogicaEnd);
logica.eDispatcher.removeEventListener("loose", LogicaLoose);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
delete ??getglobalscope
[this];
Globals.deleteNow(this);
}
public function detonate(_arg1:Weapon=null){
var _local2:int;
var _local3:Object;
_local2 = weaponManager.currentWeapon;
_local3 = weaponManager.weaponList[_local2].carga_explosiva;
if (_local3 != null){
weaponManager.weaponList[_local2].index = weaponManager.weaponList[_local2].old_frame;
weaponManager.weaponList[_local2].carga_explosiva.detonate();
weaponManager.weaponList[_local2].carga_explosiva = null;
} else {
trace("no hay carga plantada");
};
}
public function siguiente_estado(_arg1:int=0):void{
if (weaponManager.currentWeapon == 0){
encadenar_combo = false;
Atacar = false;
combo_delay = 200;
if (_input.isKeyInBuffer(Globals.KEY_ATTACK_RIGHT, 0, combo_delay)){
encadenar_combo = true;
dir = Globals.DER;
adir = Globals.DER;
Atacar = true;
};
if (_input.isKeyInBuffer(Globals.KEY_ATTACK_LEFT, 0, combo_delay)){
encadenar_combo = true;
dir = Globals.IZQ;
adir = Globals.IZQ;
Atacar = true;
};
if (encadenar_combo == true){
Lanzar_Ataque();
} else {
currentCombo = 0;
state_ = _arg1;
current_animation = Globals.IDLE;
body.gotoAndStop(current_animation);
};
} else {
state_ = _arg1;
current_animation = Globals.IDLE;
body.gotoAndStop(current_animation);
};
suavizar_movimiento_camara = false;
handleAnim();
}
private function handleAnim(){
switch (state_){
case QUIETO:
xvel = 0;
yvel = 0;
if (((!((current_animation == Globals.IDLE))) && (!(_wait_animation)))){
current_animation = Globals.IDLE;
body.gotoAndStop(current_animation);
};
break;
case CORRER:
if (((!((current_animation == Globals.RUN))) && (!(_wait_animation)))){
current_animation = Globals.RUN;
body.gotoAndStop(current_animation);
};
break;
case CORRER_INV:
if (((!((current_animation == Globals.RUN_INV))) && (!(_wait_animation)))){
current_animation = Globals.RUN_INV;
body.gotoAndStop(current_animation);
};
break;
case ANDAR:
if (((!((current_animation == Globals.WALK))) && (!(_wait_animation)))){
current_animation = Globals.WALK;
body.gotoAndStop(current_animation);
};
break;
case ANDAR_INV:
if (((!((current_animation == Globals.WALK_INV))) && (!(_wait_animation)))){
current_animation = Globals.WALK_INV;
body.gotoAndStop(current_animation);
};
break;
case DAM_1:
if (((!((current_animation == Globals.DAMAGED1))) && (!(_wait_animation)))){
current_animation = Globals.DAMAGED1;
body.gotoAndStop(current_animation);
};
break;
case DIE:
if (current_animation != Globals.DIED){
current_animation = Globals.DIED;
body.gotoAndStop(current_animation);
};
break;
case MELEE_01:
if (current_animation != Globals.MELEE1){
current_animation = Globals.MELEE1;
body.gotoAndStop(current_animation);
};
case MORDIDO:
if (current_animation != Globals.BITE){
current_animation = Globals.BITE;
body.gotoAndStop(current_animation);
};
break;
case FREEZED:
if (current_animation != Globals.FREEZED){
current_animation = Globals.FREEZED;
body.gotoAndStop(current_animation);
};
break;
};
}
private function onFinishTween(_arg1):void{
removeChild(_arg1);
}
public function unfreeze(){
unfreeze_time = 0;
lastTimeBited = getTimer();
canMove = true;
freezed = false;
state_ = QUIETO;
_wait_animation = false;
handleAnim();
}
public function handleInput():void{
var _local1:Boolean;
var _local2:Boolean;
if (((_input.isKeyReleased(Globals.KEY_PAUSE)) && (!(Globals.GameOver)))){
trace("pause");
Globals.GamePaused = true;
achievementManager.pause();
if (sonidoEnBucle != ""){
soundManager.stopSound(sonidoEnBucle);
sonidoEnBucle = "";
};
};
if (((!(Globals.GamePaused)) && (!(_wait_animation)))){
xvel = 0;
yvel = 0;
_local1 = false;
if (_input.isKeyDown(Globals.KEY_MOVE_RIGHT)){
xvel = vel;
dir = Globals.DER;
};
if (_input.isKeyReleased(Globals.KEY_MOVE_RIGHT)){
_local1 = true;
};
if (_input.isKeyDown(Globals.KEY_MOVE_LEFT)){
xvel = -(vel);
dir = Globals.IZQ;
};
if (_input.isKeyReleased(Globals.KEY_MOVE_LEFT)){
_local1 = true;
};
if (_input.isKeyDown(Globals.KEY_MOVE_UP)){
yvel = (-(vel) / 2);
};
if (_input.isKeyDown(Globals.KEY_MOVE_DOWN)){
yvel = (vel / 2);
};
control_ataques();
if (bited == true){
canMove = false;
state_ = MORDIDO;
if (((!((zombieBitting == null))) && ((zombieBitting.alive == false)))){
contadorMordiscos = 0;
};
if (zombieBitting.freezed == true){
contadorMordiscos = 0;
};
if (contadorMordiscos > 0){
if (_local1 == true){
contadorMordiscos = (contadorMordiscos - 1);
};
} else {
zafarse();
contadorMordiscos = 0;
bited = false;
zombieBitting.bites = false;
if (zombieBitting.alive == true){
body.gotoAndStop("push_front");
};
};
return;
};
_local2 = false;
if (_input.isKeyReleased(Globals.KEY_SWITCH)){
weaponManager.switchSlot();
_local2 = true;
};
if (_input.isKeyReleased(Globals.KEY_SELECT_MELEE)){
weaponManager.selectSlot(0);
_local2 = true;
};
if (_input.isKeyReleased(Globals.KEY_SELECT_SLOT1)){
weaponManager.selectSlot(1);
_local2 = true;
};
if (_input.isKeyReleased(Globals.KEY_SELECT_SLOT2)){
weaponManager.selectSlot(2);
_local2 = true;
};
if (_input.isKeyReleased(Globals.KEY_SELECT_SLOT3)){
weaponManager.selectSlot(3);
_local2 = true;
};
if (_input.isKeyReleased(Globals.KEY_SELECT_SLOT4)){
weaponManager.selectSlot(4);
_local2 = true;
};
if ((((_local2 == true)) && ((_wait_animation == false)))){
body.body2.chest.gotoAndStop(1);
if (sonidoEnBucle != ""){
soundManager.stopSound(sonidoEnBucle);
sonidoEnBucle = "";
};
};
} else {
if (((_input.isKeyReleased(Globals.KEY_ATTACK_LEFT)) || (_input.isKeyReleased(Globals.KEY_ATTACK_RIGHT)))){
weaponManager.stopWeapon();
Atacar = false;
};
};
}
public function control_ataques(){
var _local1:Boolean;
Atacar = false;
if (_input.isKeyDown(Globals.KEY_ATTACK_RIGHT)){
Atacando = true;
Atacar = true;
fdir = Globals.DER;
adir = Globals.DER;
};
if (_input.isKeyDown(Globals.KEY_ATTACK_LEFT)){
Atacando = true;
Atacar = true;
fdir = Globals.IZQ;
adir = Globals.IZQ;
};
if (((_input.isKeyReleased(Globals.KEY_ATTACK_LEFT)) || (_input.isKeyReleased(Globals.KEY_ATTACK_RIGHT)))){
Atacando = false;
weaponManager.stopWeapon();
Atacar = false;
if (sonidoEnBucle != ""){
soundManager.stopSound(sonidoEnBucle);
sonidoEnBucle = "";
};
};
if ((((bited == false)) && ((Atacar == true)))){
_local1 = weaponManager.fireWeapon();
if (((_local1) && ((_wait_animation == false)))){
if (body.body2 != null){
Lanzar_Ataque(true);
};
} else {
if ((((weaponManager.weaponList[weaponManager.currentWeapon].current_ammo == 0)) && ((Globals.MunicionInfinita == false)))){
if (sonidoEnBucle != ""){
soundManager.stopSound(sonidoEnBucle);
sonidoEnBucle = "";
};
};
};
};
if (achievementManager.checkAchievement("More Bullets", Globals.muertesArma)){
interfaz.mostrar_panel_combo(achievementManager.descAchievement);
};
}
public function validar_limites(){
var _local1:Boolean;
var _local2:Number;
var _local3:Number;
var _local4:b2Vec2;
var _local5:Number;
_local1 = false;
_local2 = 0;
_local3 = 0;
if (x < 50){
xvel = 1;
_local2 = 50;
_local1 = true;
};
if (x > (max_ancho - 50)){
xvel = -1;
_local2 = (max_ancho - 50);
_local1 = true;
};
if (y < 0){
yvel = 1;
};
if (y > max_alto){
yvel = -1;
};
if (_local1){
b.WakeUp();
_local4 = b.GetPosition();
_local5 = b.GetAngle();
_local4.x = (_local2 / m_phys_scale);
b.SetXForm(_local4, _local5);
};
}
public function Lanzar_Ataque(_arg1:Boolean=false):void{
var _local2:Number;
if (Atacar == true){
switch (weaponManager.weaponList[weaponManager.currentWeapon].fire_group){
case Globals.FIRE_GROUP_MELEE:
if (!_wait_animation){
_local2 = weaponManager.weaponList[weaponManager.currentWeapon].maxCombo;
if (_arg1 == true){
currentCombo = 0;
} else {
currentCombo++;
};
if (currentCombo > Globals.comboPlayer){
currentCombo = 0;
};
if (currentCombo > _local2){
currentCombo = 0;
};
wait_animation(true);
canMove = false;
if (adir == Globals.DER){
body.scaleX = 1;
};
if (adir == Globals.IZQ){
body.scaleX = -1;
};
dir = adir;
switch (currentCombo){
case 1:
body.gotoAndStop("atack_melee1");
current_animation = Globals.ATACK1;
retrocesoCombo = 39.9;
break;
case 2:
body.gotoAndStop("atack_melee2");
current_animation = Globals.ATACK2;
retrocesoCombo = 70;
break;
case 3:
body.gotoAndStop("atack_melee3");
current_animation = Globals.ATACK3;
retrocesoCombo = 54.1;
break;
case 4:
body.gotoAndStop("atack_melee4");
current_animation = Globals.ATACK4;
retrocesoCombo = 86.5;
break;
default:
body.gotoAndStop("atack_melee1");
current_animation = Globals.ATACK1;
currentCombo = 1;
retrocesoCombo = 39.9;
};
};
break;
case Globals.FIRE_GROUP_FIREARM1:
body.body2.chest.gotoAndStop(4);
createBullet();
state_ = -1;
break;
case Globals.FIRE_GROUP_FIREARM2:
body.body2.chest.gotoAndStop(5);
createBullet();
state_ = -1;
break;
case Globals.FIRE_GROUP_FIREARM3:
body.body2.chest.gotoAndStop(6);
createBullet();
state_ = -1;
break;
case Globals.FIRE_GROUP_EXTINGUISHER:
body.body2.chest.gotoAndStop(7);
createBullet();
current_animation = Globals.ATACK_EXTINGUISHER;
break;
case Globals.FIRE_GROUP_CHAINSAW:
body.body2.chest.gotoAndStop(8);
createBullet();
current_animation = Globals.ATACK_CHAINSAW;
break;
case Globals.FIRE_GROUP_FLAMETHROWER:
body.body2.chest.gotoAndStop(9);
createBullet();
current_animation = Globals.ATACK_FLAMETHROWER;
break;
case Globals.FIRE_GROUP_THROW:
body.gotoAndStop("atack_throw");
state_ = -1;
break;
case Globals.FIRE_GROUP_MINE:
body.gotoAndStop("atack_mine");
state_ = -1;
break;
case Globals.FIRE_GROUP_MINE_DETONATOR:
if (weaponManager.weaponList[weaponManager.currentWeapon].carga_explosiva != null){
body.body2.chest.gotoAndStop(10);
} else {
body.gotoAndStop("atack_mine");
state_ = -1;
};
break;
case Globals.FIRE_GROUP_STINGER:
body.gotoAndStop("stinger");
state_ = -1;
break;
case Globals.FIRE_GROUP_AITSO:
body.gotoAndStop("aitso");
state_ = -1;
break;
default:
trace("fire group undefined");
};
};
}
public function freeze(_arg1):void{
if (freezed == false){
soundManager.playSound("freeze", 1, 1);
};
if (bited){
stop_bite(this);
};
unfreeze_time = (getTimer() + (_arg1.damage / 3));
freezed = true;
canMove = false;
state_ = FREEZED;
}
private function update(){
var _local1:Boolean;
var _local2:b2Vec2;
if (canMove){
_local1 = false;
if (Atacar == true){
if (dir != adir){
dir = adir;
_local1 = true;
};
};
if (dir == Globals.DER){
body.scaleX = 1;
};
if (dir == Globals.IZQ){
body.scaleX = -1;
};
if (Globals.Colisiones){
validar_limites();
} else {
x = (x + (xvel * weaponManager.weaponList[weaponManager.currentWeapon].movement_factor));
y = (y + (yvel * weaponManager.weaponList[weaponManager.currentWeapon].movement_factor));
if (x < 0){
x = 0;
};
if (x > max_ancho){
x = max_ancho;
};
limite_vertical = false;
if (y < (0 + Globals.HEIGHT_DIF)){
limite_vertical = true;
y = (0 + Globals.HEIGHT_DIF);
};
if (y > max_alto){
limite_vertical = true;
y = max_alto;
};
};
if ((((xvel == 0)) && ((yvel == 0)))){
state_ = QUIETO;
} else {
switch (weaponManager.weaponList[weaponManager.currentWeapon].movement_anim){
case Globals.RUN:
if (_local1){
state_ = CORRER_INV;
} else {
state_ = CORRER;
};
break;
case Globals.WALK:
if (_local1){
state_ = ANDAR_INV;
} else {
state_ = ANDAR;
};
break;
case Globals.IDLE:
state_ = QUIETO;
break;
};
};
} else {
if (freezed == true){
if (getTimer() > unfreeze_time){
unfreeze();
};
};
xvel = 0;
yvel = 0;
};
if (Globals.Colisiones){
if (b != null){
b.WakeUp();
b.m_linearVelocity.x = (xvel * weaponManager.weaponList[weaponManager.currentWeapon].movement_factor);
b.m_linearVelocity.y = (yvel * weaponManager.weaponList[weaponManager.currentWeapon].movement_factor);
b.m_sweep.a = 0;
_local2 = b.GetPosition();
if (freezed == false){
x = (_local2.x * m_phys_scale);
y = (_local2.y * m_phys_scale);
};
};
};
}
public function mover(_arg1:String="", _arg2:int=0){
var _local3:b2Vec2;
var _local4:Number;
if (alive){
if (dir == Globals.DER){
} else {
_arg2 = (_arg2 * -1);
};
if (Globals.Colisiones){
b.WakeUp();
_local3 = b.GetPosition();
_local4 = b.GetAngle();
switch (_arg1){
case "adelante":
_local3.x = (_local3.x + (_arg2 / m_phys_scale));
break;
case "atras":
_local3.x = (_local3.x - (_arg2 / m_phys_scale));
break;
};
b.SetXForm(_local3, _local4);
validar_limites();
} else {
switch (_arg1){
case "adelante":
x = (x + _arg2);
break;
case "atras":
x = (x - _arg2);
break;
};
};
};
}
public function addCircle(_arg1:Number, _arg2:Number, _arg3:Number){
var _local4:b2BodyDef;
var _local5:b2CircleDef;
_local4 = new b2BodyDef();
_local5 = new b2CircleDef();
_local5.filter.categoryBits = Globals.Colision_Player;
_local5.filter.maskBits = Globals.Colision_Estatica;
_local5.radius = (Math.abs(_arg3) / m_phys_scale);
_local5.density = 1;
_local5.restitution = 0.2;
_local5.friction = 0.3;
_local4.position.Set((_arg1 / m_phys_scale), (_arg2 / m_phys_scale));
b = m_world.CreateBody(_local4);
b.CreateShape(_local5);
b.SetMassFromShapes();
}
private function onEnterFrame(_arg1:Event):void{
handleInput();
if (!Globals.GamePaused){
if (alive){
update();
handleAnim();
} else {
if (sonidoEnBucle != ""){
soundManager.stopSound(sonidoEnBucle);
sonidoEnBucle = "";
};
gameover();
};
} else {
if (sonidoEnBucle != ""){
soundManager.stopSound(sonidoEnBucle);
sonidoEnBucle = "";
};
if (weaponManager.weaponList[weaponManager.currentWeapon] == null){
weaponManager.currentWeapon = 0;
};
if (body.body2 != null){
body.body2.chest.gotoAndStop(1);
};
};
if (Globals.ExitGame){
if (sonidoEnBucle != ""){
soundManager.stopSound(sonidoEnBucle);
sonidoEnBucle = "";
};
finalize();
};
_input.update();
}
public function recieveDamage(_arg1){
if (((((alive) && (!(Globals.GamePaused)))) && (!(Globals.GameOver)))){
if (sonidoEnBucle != ""){
soundManager.stopSound(sonidoEnBucle);
sonidoEnBucle = "";
};
if (_arg1.damageOnImpact){
life = (life - (_arg1.damage * Globals.DIFICULTAD_PARTIDA));
soundManager.playSound("player_damage", 1, 1);
multiplicador = (multiplicador - 1);
if (multiplicador < 1){
multiplicador = 1;
};
Globals.MULTIPLIER = multiplicador;
Globals.LAST_HIT = 0;
Globals.HITS = 0;
Globals.RANK = 0;
if (!freezed){
if (bited){
} else {
state_ = DAM_1;
};
};
} else {
switch (_arg1.tipo){
case Globals.FREEZE_MINE:
freeze(_arg1);
break;
};
};
if (life <= 0){
if (freezed){
body.gotoAndStop("die_freezed");
soundManager.playSound("ice_break", 1, 1);
} else {
state_ = DIE;
body.gotoAndStop("die");
};
alive = false;
} else {
handleAnim();
};
eDispatcher.dispatchEvent(new Event(UPDATE));
};
}
public function zafarse(){
lastTimeBited = getTimer();
zombieBitting.stop_bite(this);
}
private function LogicaEnd(_arg1:Event):void{
if (sonidoEnBucle != ""){
soundManager.stopSound(sonidoEnBucle);
sonidoEnBucle = "";
};
Globals.SCORE_H = Globals.SCORE;
Globals.MULTIPLIER_H = Globals.MULTIPLIER;
Globals.KILLS_H = Globals.KILLS;
Globals.RANK_H = Globals.RANK;
Globals.MAX_RANK_H = Globals.MAX_RANK;
body.gotoAndStop("win");
finalize();
}
public function stop_bite(_arg1):void{
if (bited == true){
trace("parar morder (player)");
canMove = true;
contadorMordiscos = 0;
bited = false;
zombieBitting.stop_bite(this);
zombieBitting.bites = false;
};
}
public function crearColision(_arg1:int){
addCircle(x, y, _arg1);
}
public function estela_polvo(){
var _local1:Polvo;
if (xvel != 0){
_local1 = new Polvo(this);
};
}
public function createBullet(_arg1:Weapon=null, _arg2:MovieClip=null):void{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:Object;
var _local8:Boolean;
var _local9:int;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Destello;
var _local14:Casquillo2;
var _local15:String;
var _local16:Number;
var _local17:int;
var _local18:Boolean;
_local8 = false;
_local4 = weaponManager.currentWeapon;
_local5 = weaponManager.weaponList[_local4].bullets_round;
_local6 = weaponManager.weaponList[_local4].ammo_type;
_local9 = 0;
while (_local9 < _local5) {
if ((((((((((((((((((((((((_local6 == Globals.BASIC_BULLET)) || ((_local6 == Globals.MEDIUM_BULLET)))) || ((_local6 == Globals.STRONG_BULLET)))) || ((_local6 == Globals.CHAINSAW)))) || ((_local6 == Globals.FLAMETHROWER)))) || ((_local6 == Globals.EXTINGUISHER)))) || ((_local6 == Globals.AITSO)))) || ((_local6 == Globals.COLT_PYTHON)))) || ((_local6 == Globals.DESERT_EAGLE)))) || ((_local6 == Globals.SPAS12)))) || ((_local6 == Globals.WINCHESTER)))) || ((_local6 == Globals.MACHINE_GUN)))){
_local7 = new Bullet();
};
if (_local6 == Globals.BASIC_MISSILE){
_local7 = new Missile();
};
if ((((((_local6 == Globals.PERSONAL_MINE)) || ((_local6 == Globals.TANK_MINE)))) || ((_local6 == Globals.FREEZE_MINE)))){
_local7 = new Mine();
};
if ((((_local6 == Globals.C4_BOMB)) || ((_local6 == Globals.BRAIN_BOMB)))){
_local7 = new Bomb();
weaponManager.weaponList[_local4].carga_explosiva = _local7;
weaponManager.weaponList[_local4].old_frame = weaponManager.weaponList[_local4].index;
weaponManager.weaponList[_local4].index = weaponManager.weaponList[_local4].detonator_frame;
weaponManager.dispatchEvent(new Event(WeaponManager.UPDATE));
};
if ((((_local6 == Globals.PINEAPPLE_GRENADE)) || ((_local6 == Globals.GERMAN_GRENADE)))){
_local7 = new Grenade();
};
_local7.damage1 = weaponManager.weaponList[_local4].damage1;
_local7.damage_range1 = weaponManager.weaponList[_local4].damage_range1;
_local7.damage2 = weaponManager.weaponList[_local4].damage2;
_local7.damage_range2 = weaponManager.weaponList[_local4].damage_range2;
_local7.damage3 = weaponManager.weaponList[_local4].damage3;
_local7.damage_range3 = weaponManager.weaponList[_local4].damage_range3;
_local7.time_effect = weaponManager.weaponList[_local4].time_effect;
_local7.playerObject = this;
_local10 = 0;
_local11 = 0;
_local12 = weaponManager.weaponList[_local4].movement_factor;
if (weaponManager.weaponList[_local4].salida_variable){
if (((!((xvel == 0))) && (!((yvel == 0))))){
_local10 = (32 * _local12);
if (yvel > 0){
_local11 = -12;
} else {
_local11 = 7;
};
};
if ((((xvel == 0)) && (!((yvel == 0))))){
_local10 = 16;
if (yvel > 0){
_local11 = -12;
} else {
_local11 = 7;
};
};
if (((!((xvel == 0))) && ((yvel == 0)))){
_local10 = 28;
_local11 = -3;
};
if (limite_vertical == true){
_local11 = -3;
};
if ((((xvel > 0)) && ((adir == Globals.IZQ)))){
_local10 = -28;
};
if ((((xvel < 0)) && ((adir == Globals.DER)))){
_local10 = -28;
};
_local10 = (_local10 * _local12);
_local11 = (_local11 * _local12);
};
if (adir == Globals.DER){
_local7.x = (x + width);
_local7.dir = Globals.DER;
_local7.x = (x + (weaponManager.weaponList[_local4].offset_salida_x + _local10));
} else {
_local7.x = (x - width);
_local7.dir = Globals.IZQ;
_local7.x = (x - (weaponManager.weaponList[_local4].offset_salida_x + _local10));
};
_local7.y = (y - (weaponManager.weaponList[_local4].offset_salida_y + _local11));
_local7.xorig = _local7.x;
_local7.yorig = _local7.y;
_local7.xdest = (_local7.x + weaponManager.weaponList[_local4].vida_pixeles);
_local7.ydest = _local7.y;
_local7.tipo = weaponManager.weaponList[_local4].ammo_type;
_local7.speed = weaponManager.weaponList[_local4].speed;
_local7.damage = weaponManager.weaponList[_local4].damage;
_local7.bulletOffset = weaponManager.weaponList[_local4].ammo_offset;
_local7.vida_pixeles = weaponManager.weaponList[_local4].vida_pixeles;
_local7.targetList = enemyList;
_local7.pushOnImpact = weaponManager.weaponList[_local4].pushOnImpact;
_local7.pushFactor = weaponManager.weaponList[_local4].pushFactor;
_local7.damageOnImpact = weaponManager.weaponList[_local4].damageOnImpact;
_local7.weaponDef = weaponManager.weaponList[_local4];
_local7.initialize();
if (weaponManager.weaponList[_local4].destello != ""){
if ((((Globals.CALIDAD == "HIGH")) || ((Globals.CALIDAD == "MEDIUM")))){
_local13 = new Destello(weaponManager.weaponList[_local4].destello, x, (y + 1), (weaponManager.weaponList[_local4].offset_salida_x + _local10), (weaponManager.weaponList[_local4].offset_salida_y + _local11), adir);
};
};
if (((!((weaponManager.weaponList[_local4].animacion_casquillo == ""))) && ((_local8 == false)))){
_local8 = true;
if (Globals.CALIDAD == "HIGH"){
_local14 = new Casquillo2(weaponManager.weaponList[_local4].animacion_casquillo, weaponManager.weaponList[_local4].indice_casquillo, x, (y + 1), adir);
};
};
if (weaponManager.weaponList[_local4].sound != ""){
_local15 = weaponManager.weaponList[_local4].sound;
_local16 = weaponManager.weaponList[_local4].sound_volume;
_local17 = 0;
_local18 = false;
if (weaponManager.weaponList[_local4].soundWait == true){
if (sonidoEnBucle == ""){
sonidoEnBucle = _local15;
_local18 = true;
_local17 = 99;
};
} else {
_local18 = true;
_local17 = 0;
};
if (_local18){
soundManager.playSound(_local15, _local16, 0, _local17);
};
};
_local9++;
};
}
public function bite(_arg1):void{
if ((((bited == false)) && (canBeBitted()))){
if (sonidoEnBucle != ""){
soundManager.stopSound(sonidoEnBucle);
sonidoEnBucle = "";
};
_wait_animation = false;
state_ = DAM_1;
canMove = false;
bited = true;
contadorMordiscos = 10;
zombieBitting = _arg1;
if (zombieBitting.x >= x){
dir = Globals.DER;
} else {
dir = Globals.IZQ;
};
if (dir == Globals.DER){
body.scaleX = 1;
};
if (dir == Globals.IZQ){
body.scaleX = -1;
};
};
}
public function wait_animation(_arg1:Boolean):void{
_wait_animation = _arg1;
if (!_wait_animation){
canMove = true;
};
}
public function checkHit(_arg1:MovieClip, _arg2:Boolean=true, _arg3:Number=0):Boolean{
var _local4:Number;
var _local5:Boolean;
var _local6:int;
var _local7:int;
var _local8:String;
_local4 = 0;
_local5 = false;
_local6 = 0;
_local7 = 0;
while (_local7 < enemyList.length) {
if (((enemyList[_local7].alive) && (!((enemyList[_local7].body.hitarea == null))))){
if (_arg1.hitTestObject(enemyList[_local7].body.hitarea)){
weaponManager.weaponList[weaponManager.currentWeapon].x = x;
if (_arg2){
weaponManager.weaponList[weaponManager.currentWeapon].body = _arg1;
if (enemyList[_local7].recieveDamage(weaponManager.weaponList[weaponManager.currentWeapon], false)){
_local6++;
};
_local5 = true;
};
if (enemyList[_local7].alive){
_local8 = "";
if (enemyList[_local7].dir == dir){
_local8 = "adelante";
} else {
_local8 = "atras";
};
if (_arg3 != 0){
enemyList[_local7].mover(_local8, (_arg3 * 1.2));
} else {
if (weaponManager.weaponList[weaponManager.currentWeapon].pushOnImpact == true){
enemyList[_local7].mover(_local8, weaponManager.weaponList[weaponManager.currentWeapon].pushFactor);
};
};
_local4 = (_local4 + 1);
};
};
};
_local7++;
};
if (_local6 > 0){
if (currentCombo == 4){
if (achievementManager.checkAchievement("MegaSlash", _local6)){
interfaz.mostrar_panel_combo("MegaSlash");
};
};
trace(weaponManager.currentWeapon);
if (weaponManager.currentWeapon == 30){
trace(("extra points " + (Globals.puntosZombie * _local6)));
getPoints((Globals.puntosZombie * _local6));
};
};
if (_local4 > 0){
};
return (_local5);
}
function takeSnapshot(_arg1:MovieClip):BitmapData{
var _local2:BitmapData;
_local2 = new BitmapData(_arg1.width, _arg1.height, true, 0);
_local2.draw(_arg1, new Matrix(), new ColorTransform(), "normal");
return (_local2);
}
public function getItem(_arg1:String):String{
var _local2:String;
_local2 = "";
soundManager.playSound("item", 0.5, 1);
switch (_arg1){
case "vida_100":
life = 100;
_local2 = "FULL LIFE";
break;
case "vida_25":
life = (life + 25);
if (life > 100){
life = 100;
};
_local2 = "+25% LIFE";
break;
case "municion":
_local2 = cargar_municion();
break;
case "puntos":
getPoints(Globals.puntosZombie);
_local2 = "EXTRA POINTS";
break;
case "multiplicador":
multiplicador = (multiplicador + 1);
if (multiplicador > 99){
multiplicador = 99;
};
Globals.MULTIPLIER = multiplicador;
_local2 = "MULTIPLIER BONUS";
break;
case "tiempo":
if (Globals.TIPO_PARTIDA == "time_attack"){
logica.cuenta_atras = (logica.cuenta_atras + 15);
Globals.TIME = (Globals.TIME + 15);
Globals.TIEMPO_RESTANTE = (logica.cuenta_atras * 1000);
};
_local2 = "EXTRA TIME";
break;
};
weaponManager.dispatchEvent(new Event(WeaponManager.UPDATE));
eDispatcher.dispatchEvent(new Event(UPDATE));
return (_local2);
}
private function LogicaLoose(_arg1:Event):void{
if (sonidoEnBucle != ""){
soundManager.stopSound(sonidoEnBucle);
sonidoEnBucle = "";
};
body.gotoAndStop("idle");
canMove = false;
finalize();
}
public function checkHitMovement(_arg1:MovieClip, _arg2:Boolean=true, _arg3:Number=0):Boolean{
var _local4:Boolean;
_local4 = true;
_local4 = true;
return (_local4);
}
public function initialize():void{
x = (max_ancho / 2);
y = ((max_alto / 4) * 3);
state_ = QUIETO;
weaponManager.loadWeapons();
depthManager.addObject(this);
if (Globals.TIPO_PARTIDA == "story"){
puntuacion = Globals.SCORE_H;
multiplicador = Globals.MULTIPLIER_H;
muertes = Globals.KILLS_H;
rango = Globals.RANK_H;
} else {
puntuacion = 0;
multiplicador = 1;
muertes = 0;
rango = 0;
};
Globals.SCORE = puntuacion;
Globals.MULTIPLIER = multiplicador;
Globals.KILLS = muertes;
Globals.RANK = rango;
Globals.TIME = 0;
life = 100;
eDispatcher = new EventDispatcher();
eDispatcher = new EventDispatcher();
logica.eDispatcher.addEventListener("end", LogicaEnd);
logica.eDispatcher.addEventListener("loose", LogicaLoose);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
function ConvertToBitmapData(_arg1:DisplayObject, _arg2:Number=1):BitmapData{
var _local3:BitmapData;
var _local4:Rectangle;
var _local5:Matrix;
_local3 = new BitmapData(_arg1.width, _arg1.height, true, 0);
_local4 = _arg1.getBounds(_arg1);
_local5 = new Matrix();
_local5.translate(-(_local4.x), -(_local4.y));
_local5.scale(_arg2, _arg2);
_local3.draw(_arg1, _local5);
return (_local3);
}
public function render(){
}
public function gameover(){
eDispatcher.dispatchEvent(new Event(DIES));
}
public function getPoints(_arg1:Number){
puntuacion = (puntuacion + (multiplicador * _arg1));
Globals.SCORE = (Globals.SCORE + (multiplicador * _arg1));
eDispatcher.dispatchEvent(new Event(UPDATE));
}
public function cartelFlotante(_arg1:String=""){
var _local2:Number;
var _local3:carteles_flotantes;
_local2 = 0.5;
_local3 = new carteles_flotantes();
_local3.cartel.info.text = ("" + _arg1);
_local3.cartel2.info.text = ("" + _arg1);
_local3.visible = true;
_local3.x = 0;
_local3.y = -(height);
resizeMe(_local3, 1500);
addChild(_local3);
TweenLite.to(_local3, (_local2 * 3.5), {y:(_local3.y - 15), alpha:0, onComplete:onFinishTween, onCompleteParams:[_local3]});
}
public function canBeBitted():Boolean{
var _local1:Boolean;
var _local2:Number;
var _local3:Number;
_local1 = false;
_local2 = (getTimer() - lastTimeBited);
_local3 = 2000;
if (_local2 > _local3){
_local1 = true;
};
if (_wait_animation == true){
_local1 = false;
};
if (freezed == true){
_local1 = false;
};
return (_local1);
}
public static function resizeMe(_arg1:MovieClip, _arg2:Number, _arg3:Number=0, _arg4:Boolean=true):void{
_arg3 = ((_arg3 == 0)) ? _arg2 : _arg3;
_arg1.width = _arg2;
_arg1.height = _arg3;
if (_arg4){
if ((_arg1.scaleX < _arg1.scaleY)){
_arg1.scaleY = _arg1.scaleX;
} else {
_arg1.scaleX = _arg1.scaleY;
};
};
}
}
}//package com.tanoku.MoreZombies
Section 121
//Polvo (com.tanoku.MoreZombies.Polvo)
package com.tanoku.MoreZombies {
import flash.events.*;
import flash.display.*;
public class Polvo extends MovieClip {
private var depthManager:DepthManager;
public var remove:Boolean;// = false
private var contenedor:MovieClip;
public function Polvo(_arg1):void{
depthManager = DepthManager.getInstance();
remove = false;
super();
stop();
if (_arg1.dir == Globals.DER){
x = _arg1.x;
scaleX = 1;
} else {
x = _arg1.x;
scaleX = -1;
};
y = _arg1.y;
contenedor = depthManager.layer_mc;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function finalize(){
remove = true;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
delete ??getglobalscope
[this];
Globals.deleteNow(this);
}
public function initialize():void{
gotoAndPlay(1);
contenedor.addChild(this);
depthManager.addObject(this);
}
private function onEnterFrame(_arg1:Event):void{
initialize();
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
}
}//package com.tanoku.MoreZombies
Section 122
//principal (com.tanoku.MoreZombies.principal)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class principal extends MovieClip {
public var b_more:SimpleButton;
public var main_class:MovieClip;
public var b_stats:SimpleButton;
public var logo:MovieClip;
public var b_credits:SimpleButton;
private var musicManager:MusicManager;
public var b_options:SimpleButton;
public var maxgames:SimpleButton;
public var b_play:SimpleButton;
public function principal(){
musicManager = MusicManager.getInstance();
super();
b_play.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_more.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_options.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_stats.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_credits.addEventListener(MouseEvent.CLICK, on_button_clicked);
maxgames.addEventListener(MouseEvent.CLICK, manejarClickSponsor);
if (Globals.currentMusic != "Mashem"){
musicManager.stopAllSounds(true);
Globals.currentMusic = "Mashem";
musicManager.playSound(Globals.currentMusic, Globals.VOLUMEN_MUSICA, 0, 99);
};
if (MoreZombies.fondo.visible == false){
MoreZombies.fondo.visible = true;
};
}
public function on_button_out(_arg1:MouseEvent){
}
public function on_button_over(_arg1:MouseEvent){
switch (_arg1.target.name){
};
}
private function manejarClickSponsor(_arg1:MouseEvent):void{
Globals.webSponsor();
}
public function on_button_clicked(_arg1:MouseEvent){
switch (_arg1.target.name){
case "b_play":
main_class.abre_pantalla(new jugar(), "pelicula");
main_class.cierra_pantalla(this, "pelicula");
break;
case "b_more":
Globals.webSponsor();
break;
case "b_options":
main_class.abre_pantalla(new opciones(), "cortina");
break;
case "b_stats":
main_class.abre_pantalla(new estadisticas(), "cortina");
break;
case "b_credits":
main_class.abre_pantalla(new creditos(), "pelicula");
main_class.cierra_pantalla(this, "pelicula");
break;
default:
trace((_arg1.target.name + " UNDEFINED"));
break;
};
}
}
}//package com.tanoku.MoreZombies
Section 123
//puntuacion (com.tanoku.MoreZombies.puntuacion)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import flash.events.*;
import flash.display.*;
import mochi.as3.*;
import flash.net.*;
import flash.text.*;
public class puntuacion extends MovieClip {
public var max_combo:TextField;
public var t_score:TextField;
public var t_rank:TextField;
var loader:URLLoader;
public var t_time_caption:TextField;
public var max_combo_mc:MovieClip;
public var b_ranking:SimpleButton;
public var t_kills:TextField;
public var t_multiplier:TextField;
public var main_class:MovieClip;
public var b_submit:SimpleButton;
public var t_modo:TextField;
public var b_retry:SimpleButton;
public var b_back:SimpleButton;
public var panel_submit:MovieClip;
public var t_time:TextField;
public var maxgames:SimpleButton;
public function puntuacion(){
var _local1:String;
var _local2:Number;
var _local3:Number;
var _local4:String;
var _local5:String;
var _local6:String;
super();
maxgames.addEventListener(MouseEvent.CLICK, manejarClickSponsor);
panel_submit.visible = false;
panel_submit.nombre_player.text = Globals.PLAYER_NAME;
panel_submit.submited.visible = false;
panel_submit.btn_ok.addEventListener(MouseEvent.CLICK, on_button_clicked);
panel_submit.btn_cancel.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_retry.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_back.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_submit.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_ranking.addEventListener(MouseEvent.CLICK, on_button_clicked);
b_submit.visible = true;
b_ranking.visible = true;
if ((((Globals.TIPO_PARTIDA == "story")) && ((Globals.STORY_MODE_COMPLETED == false)))){
b_retry.visible = true;
b_submit.visible = false;
} else {
if ((((Globals.TIPO_PARTIDA == "story")) && ((Globals.STORY_MODE_COMPLETED == true)))){
b_retry.visible = false;
b_submit.visible = true;
};
};
if (Globals.TIPO_PARTIDA == "story"){
b_ranking.visible = false;
b_submit.visible = false;
};
trace("grabar puntuacion");
_local1 = "";
switch (Globals.TIPO_PARTIDA){
case "story":
if (Globals.SCORE_STORY < Globals.SCORE){
Globals.SCORE_STORY = Globals.SCORE;
};
_local1 = "STORY MODE";
break;
case "survival":
if (Globals.SCORE_SURVIVAL < Globals.SCORE){
Globals.SCORE_SURVIVAL = Globals.SCORE;
};
_local1 = "SURVIVAL MODE";
break;
case "time_attack":
if (Globals.SCORE_TIMEATTACK < Globals.SCORE){
Globals.SCORE_TIMEATTACK = Globals.SCORE;
};
_local1 = "TIME ATTACK MODE";
break;
case "defender":
if (Globals.SCORE_DEFENDER < Globals.SCORE){
Globals.SCORE_DEFENDER = Globals.SCORE;
};
_local1 = "DEFENDER MODE";
break;
};
t_modo.text = _local1;
t_score.text = ("" + Globals.SCORE);
t_multiplier.text = ("" + Globals.MULTIPLIER);
t_kills.text = ("" + Globals.KILLS);
Globals.TIME = (Globals.TIME * 1000);
_local2 = Math.floor((Globals.TIME / 1000));
_local3 = Math.floor((_local2 / 60));
_local2 = (_local2 % 60);
_local3 = (_local3 % 60);
_local4 = _local2.toString();
_local5 = _local3.toString();
if (_local4.length < 2){
_local4 = ("0" + _local4);
};
if (_local5.length < 2){
_local5 = ("" + _local5);
};
_local6 = ((_local5 + ":") + _local4);
t_time.text = _local6;
t_time.visible = false;
t_time_caption.visible = false;
if (Globals.TIPO_PARTIDA == "time_attack"){
t_time.visible = true;
t_time_caption.visible = true;
};
t_rank.text = ("" + Globals.MAX_RANK);
max_combo.visible = false;
max_combo_mc.visible = false;
if (Globals.MAX_RANK > 1){
max_combo.visible = true;
max_combo_mc.visible = true;
max_combo_mc.gotoAndStop(Globals.MAX_RANK);
};
}
public function submit_timeattack(){
var _local1:URLRequest;
var _local2:URLVariables;
var _local3:Number;
var _local4:String;
var _local5:URLLoader;
_local1 = new URLRequest("http://rankz.armorbot.com/submit/as3_v0.php");
_local1.method = URLRequestMethod.POST;
_local2 = new URLVariables();
_local2.flashkey = "SkFVelNHWlU=";
_local2.SU0249 = "MzYzMmolZSVhJW4lcw==";
_local2.bmFtZTE = Globals.PLAYER_NAME;
_local2.bmFtZTI = t_time.text;
_local3 = Globals.SCORE;
_local4 = (_local3 + "Z");
_local2.c2NvcmUx = _local4.split("0").join("U");
_local2.c2NvcmUx = _local2.c2NvcmUx.split("").join("A");
_local2.c2NvcmUx = _local2.c2NvcmUx.split("AU").join("Y");
_local2.c2NvcmUx = _local2.c2NvcmUx.split("A1").join("B");
_local2.c2NvcmUx = _local2.c2NvcmUx.split(".").join("N");
_local1.data = _local2;
_local5 = new URLLoader();
_local5.dataFormat = URLLoaderDataFormat.TEXT;
_local5.addEventListener(Event.COMPLETE, dataOnLoad);
_local5.load(_local1);
}
function validar_player_name():Boolean{
var _local1:Boolean;
_local1 = false;
if (panel_submit.nombre_player.text == ""){
panel_submit.alerta.visible = true;
_local1 = false;
} else {
panel_submit.alerta.visible = false;
Globals.PLAYER_NAME = panel_submit.nombre_player.text;
_local1 = true;
};
stage.focus = panel_submit.nombre_player;
return (_local1);
}
public function on_button_out(_arg1:MouseEvent){
}
private function onFinishTween():void{
ocultar_panel_submit();
}
private function mostrarPuntuacion(_arg1:Array){
var o:Object;
var boardID:String;
var val = _arg1;
o = {n:val, f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
boardID = o.f(0, "");
MochiScores.showLeaderboard({boardID:boardID, onClose:function ():void{
}});
}
public function ocultar_panel_submit(){
panel_submit.visible = false;
}
public function on_button_over(_arg1:MouseEvent){
switch (_arg1.target.name){
};
}
private function manejarClickSponsor(_arg1:MouseEvent):void{
Globals.webSponsor();
}
public function submit_survival(){
var _local1:URLRequest;
var _local2:URLVariables;
var _local3:Number;
var _local4:String;
var _local5:URLLoader;
_local1 = new URLRequest("http://rankz.armorbot.com/submit/as3_v0.php");
_local1.method = URLRequestMethod.POST;
_local2 = new URLVariables();
_local2.flashkey = "S0h4c2ZRY3g=";
_local2.SU0249 = "MzYzMGolZSVhJW4lcw==";
_local2.bmFtZTE = Globals.PLAYER_NAME;
_local3 = Globals.SCORE;
_local4 = (_local3 + "Z");
_local2.c2NvcmUx = _local4.split("0").join("U");
_local2.c2NvcmUx = _local2.c2NvcmUx.split("").join("A");
_local2.c2NvcmUx = _local2.c2NvcmUx.split("AU").join("Y");
_local2.c2NvcmUx = _local2.c2NvcmUx.split("A1").join("B");
_local2.c2NvcmUx = _local2.c2NvcmUx.split(".").join("N");
_local1.data = _local2;
_local5 = new URLLoader();
_local5.dataFormat = URLLoaderDataFormat.TEXT;
_local5.addEventListener(Event.COMPLETE, dataOnLoad);
_local5.load(_local1);
}
public function submitScoreToMochi(_arg1:Array, _arg2:Number){
var o:Object;
var boardID:String;
var val = _arg1;
var score = _arg2;
o = {n:val, f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
boardID = o.f(0, "");
MochiScores.showLeaderboard({boardID:boardID, score:score, onClose:function ():void{
}});
}
public function on_button_clicked(_arg1:MouseEvent){
switch (_arg1.target.name){
case "b_back":
main_class.cierra_pantalla(this);
main_class.abre_pantalla(new principal());
break;
case "b_retry":
retry();
main_class.cierra_pantalla(this);
main_class.abre_pantalla(new loading());
break;
case "b_submit":
submit_score();
break;
case "btn_ok":
if (validar_player_name()){
submit_score();
};
break;
case "btn_cancel":
ocultar_panel_submit();
break;
case "b_ranking":
abrir_web_puntuaciones();
break;
default:
trace((_arg1.target.name + " UNDEFINED"));
break;
};
}
public function retry(){
var _local1:Juego;
Globals.GameEnEspera = false;
Globals.GameOver = false;
Globals.ExitGame = false;
Globals.GamePaused_Screen = false;
Globals.GamePaused = false;
Globals.GameFinished = false;
_local1 = new Juego(main_class);
_local1.main_class = main_class;
_local1.initialize();
}
public function abrir_web_puntuaciones(){
switch (Globals.TIPO_PARTIDA){
case "story":
mostrarPuntuacion([9, 10, 10, 5, 15, 4, 6, 8, 14, 0, 6, 12, 10, 15, 6, 11]);
break;
case "survival":
mostrarPuntuacion([13, 12, 2, 6, 5, 10, 10, 15, 11, 7, 1, 0, 7, 14, 11, 5]);
break;
case "time_attack":
mostrarPuntuacion([5, 15, 10, 8, 14, 6, 11, 12, 5, 10, 11, 12, 5, 8, 6, 2]);
break;
case "defender":
mostrarPuntuacion([3, 1, 2, 9, 12, 14, 7, 11, 3, 14, 3, 1, 4, 12, 2, 10]);
break;
};
}
function dataOnLoad(_arg1:Event){
Globals.saveManager.save();
panel_submit.submited.visible = true;
b_submit.visible = false;
desvanecer_panel_submit();
}
public function submit_story(){
var _local1:URLRequest;
var _local2:URLVariables;
var _local3:Number;
var _local4:String;
var _local5:URLLoader;
_local1 = new URLRequest("http://rankz.armorbot.com/submit/as3_v0.php");
_local1.method = URLRequestMethod.POST;
_local2 = new URLVariables();
_local2.flashkey = "WVNEcHBFVE8=";
_local2.SU0249 = "MzYzM2olZSVhJW4lcw==";
_local2.bmFtZTE = Globals.PLAYER_NAME;
_local3 = Globals.SCORE;
_local4 = (_local3 + "Z");
_local2.c2NvcmUx = _local4.split("0").join("U");
_local2.c2NvcmUx = _local2.c2NvcmUx.split("").join("A");
_local2.c2NvcmUx = _local2.c2NvcmUx.split("AU").join("Y");
_local2.c2NvcmUx = _local2.c2NvcmUx.split("A1").join("B");
_local2.c2NvcmUx = _local2.c2NvcmUx.split(".").join("N");
_local1.data = _local2;
_local5 = new URLLoader();
_local5.dataFormat = URLLoaderDataFormat.TEXT;
_local5.addEventListener(Event.COMPLETE, dataOnLoad);
_local5.load(_local1);
}
public function submit_score(){
switch (Globals.TIPO_PARTIDA){
case "story":
submitScoreToMochi([9, 10, 10, 5, 15, 4, 6, 8, 14, 0, 6, 12, 10, 15, 6, 11], Globals.SCORE);
break;
case "survival":
submitScoreToMochi([13, 12, 2, 6, 5, 10, 10, 15, 11, 7, 1, 0, 7, 14, 11, 5], Globals.SCORE);
break;
case "time_attack":
submitScoreToMochi([5, 15, 10, 8, 14, 6, 11, 12, 5, 10, 11, 12, 5, 8, 6, 2], Globals.SCORE);
break;
case "defender":
submitScoreToMochi([3, 1, 2, 9, 12, 14, 7, 11, 3, 14, 3, 1, 4, 12, 2, 10], Globals.SCORE);
break;
};
}
public function mostrar_panel_submit(){
panel_submit.alpha = 0;
panel_submit.visible = true;
TweenLite.to(panel_submit, 1, {alpha:1});
validar_player_name();
}
public function desvanecer_panel_submit(){
TweenLite.to(panel_submit, 1, {alpha:0, onComplete:onFinishTween});
}
}
}//package com.tanoku.MoreZombies
Section 124
//Salpicadura (com.tanoku.MoreZombies.Salpicadura)
package com.tanoku.MoreZombies {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class Salpicadura extends MovieClip {
public var tipo:String;
private var depthManager:DepthManager;
var contador:int;// = 0
public var remove:Boolean;// = false
private var contenedor:MovieClip;
var mc_Salpicadura:salpicadura_sangre;
var initialized:Boolean;// = false
public function Salpicadura(_arg1:String, _arg2, _arg3, _arg4:Number=0, _arg5:Number=0, _arg6=0):void{
depthManager = DepthManager.getInstance();
remove = false;
contador = 0;
initialized = false;
super();
stop();
mc_Salpicadura = new salpicadura_sangre();
stop();
if (_arg6 == Globals.DER){
scaleX = 1;
} else {
scaleX = -1;
};
x = _arg2;
y = _arg3;
mc_Salpicadura.x = _arg4;
mc_Salpicadura.y = _arg5;
addChild(mc_Salpicadura);
contenedor = depthManager.layer_mc;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function finalize(){
remove = true;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
delete ??getglobalscope
[this];
Globals.deleteNow(this);
}
public function initialize():void{
var _local1:int;
_local1 = ((Math.random() * 7) + 1);
contenedor.addChild(this);
mc_Salpicadura.gotoAndStop(_local1);
depthManager.addObject(this);
contador = 0;
visible = true;
initialized = true;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function onEnterFrame(_arg1:Event):void{
if (!initialized){
initialize();
};
}
public function localToLocal(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Point=null):Point{
var _local4:Point;
_local4 = (_arg3) ? _arg3 : new Point();
_local4 = _arg1.localToGlobal(_local4);
_local4 = _arg2.globalToLocal(_local4);
return (_local4);
}
}
}//package com.tanoku.MoreZombies
Section 125
//SaveManager (com.tanoku.MoreZombies.SaveManager)
package com.tanoku.MoreZombies {
import flash.net.*;
public class SaveManager {
public static var shared:SharedObject;
public static var savedGame:String = "";
public static var instance:SaveManager;
public function SaveManager(_arg1:SingletonEnforcer){
}
public function erase(){
trace("borrando savegame");
}
public function load(){
var _local1:Array;
var _local2:WeaponShop;
shared = SharedObject.getLocal("MoreZombies_savedData_83.5", "/");
if (shared.data.savegame == undefined){
savedGame = "";
} else {
savedGame = shared.data.savegame;
};
if (savedGame == ""){
create();
save();
};
trace("cargando savegame");
_local1 = savedGame.split("|");
Globals.MUSICA_ACTIVA = stringToBoolean(_local1[0]);
Globals.SONIDO_ACTIVO = stringToBoolean(_local1[1]);
Globals.SANGRE_ACTIVA = stringToBoolean(_local1[2]);
Globals.CALIDAD = _local1[3];
Globals.KEY_MOVE_LEFT = _local1[4];
Globals.KEY_MOVE_RIGHT = _local1[5];
Globals.KEY_MOVE_UP = _local1[6];
Globals.KEY_MOVE_DOWN = _local1[7];
Globals.KEY_ATTACK_LEFT = _local1[8];
Globals.KEY_ATTACK_RIGHT = _local1[9];
Globals.KEY_SELECT_MELEE = _local1[10];
Globals.KEY_SELECT_SLOT1 = _local1[11];
Globals.KEY_SELECT_SLOT2 = _local1[12];
Globals.KEY_SELECT_SLOT3 = _local1[13];
Globals.KEY_SELECT_SLOT4 = _local1[14];
Globals.KEY_SWITCH = _local1[15];
Globals.KEY_PAUSE = _local1[16];
_local2 = WeaponShop.getInstance();
_local2.weaponList[0].locked = stringToBoolean(_local1[17]);
_local2.weaponList[1].locked = stringToBoolean(_local1[18]);
_local2.weaponList[2].locked = stringToBoolean(_local1[19]);
_local2.weaponList[3].locked = stringToBoolean(_local1[20]);
_local2.weaponList[4].locked = stringToBoolean(_local1[21]);
_local2.weaponList[5].locked = stringToBoolean(_local1[22]);
_local2.weaponList[6].locked = stringToBoolean(_local1[23]);
_local2.weaponList[7].locked = stringToBoolean(_local1[24]);
_local2.weaponList[8].locked = stringToBoolean(_local1[25]);
_local2.weaponList[9].locked = stringToBoolean(_local1[26]);
_local2.weaponList[10].locked = stringToBoolean(_local1[27]);
_local2.weaponList[11].locked = stringToBoolean(_local1[28]);
_local2.weaponList[11].locked = stringToBoolean(_local1[29]);
_local2.weaponList[13].locked = stringToBoolean(_local1[30]);
_local2.weaponList[14].locked = stringToBoolean(_local1[31]);
_local2.weaponList[15].locked = stringToBoolean(_local1[32]);
_local2.weaponList[16].locked = stringToBoolean(_local1[33]);
_local2.weaponList[17].locked = stringToBoolean(_local1[34]);
_local2.weaponList[18].locked = stringToBoolean(_local1[35]);
_local2.weaponList[19].locked = stringToBoolean(_local1[36]);
_local2.weaponList[20].locked = stringToBoolean(_local1[37]);
_local2.weaponList[21].locked = stringToBoolean(_local1[38]);
_local2.weaponList[22].locked = stringToBoolean(_local1[39]);
_local2.weaponList[23].locked = stringToBoolean(_local1[40]);
_local2.weaponList[24].locked = stringToBoolean(_local1[41]);
_local2.weaponList[25].locked = stringToBoolean(_local1[42]);
_local2.weaponList[26].locked = stringToBoolean(_local1[43]);
_local2.weaponList[27].locked = stringToBoolean(_local1[44]);
_local2.weaponList[28].locked = stringToBoolean(_local1[45]);
_local2.weaponList[29].locked = stringToBoolean(_local1[46]);
_local2.weaponList[30].locked = stringToBoolean(_local1[47]);
_local2.weaponList[31].locked = stringToBoolean(_local1[48]);
_local2.weaponList[32].locked = stringToBoolean(_local1[49]);
_local2.weaponList[33].locked = stringToBoolean(_local1[50]);
_local2.weaponList[34].locked = stringToBoolean(_local1[51]);
_local2.weaponList[35].locked = stringToBoolean(_local1[52]);
_local2.weaponList[36].locked = stringToBoolean(_local1[53]);
Globals.muertesTotal = _local1[54];
Globals.muertesMelee = _local1[55];
Globals.muertesArma = _local1[56];
Globals.muertesExplosion = _local1[57];
Globals.muertesMotosierra = _local1[58];
Globals.muertesLanzallamas = _local1[59];
Globals.muertesEspecial = _local1[60];
Globals.muertesZombiesPayasos = _local1[61];
Globals.zombiesCongelados = _local1[62];
Globals.comboPlayer = _local1[63];
AchievementManager.ach_AllWeapons = stringToBoolean(_local1[64]);
AchievementManager.ach_Megaslash = stringToBoolean(_local1[65]);
AchievementManager.ach_HomeRun = stringToBoolean(_local1[66]);
AchievementManager.ach_Jedi = stringToBoolean(_local1[67]);
AchievementManager.ach_Jurasic = stringToBoolean(_local1[68]);
AchievementManager.ach_Samurai = stringToBoolean(_local1[69]);
AchievementManager.ach_Massacre = stringToBoolean(_local1[70]);
AchievementManager.ach_Pyromania = stringToBoolean(_local1[71]);
AchievementManager.ach_Terminator = stringToBoolean(_local1[72]);
AchievementManager.ach_Hunter = stringToBoolean(_local1[73]);
AchievementManager.ach_Hitman = stringToBoolean(_local1[74]);
AchievementManager.ach_Disintegrate = stringToBoolean(_local1[75]);
AchievementManager.ach_Demolition = stringToBoolean(_local1[76]);
AchievementManager.ach_Headache = stringToBoolean(_local1[77]);
AchievementManager.ach_BloodyCircus = stringToBoolean(_local1[78]);
AchievementManager.ach_Glacier = stringToBoolean(_local1[79]);
AchievementManager.ach_MoreBullets = stringToBoolean(_local1[80]);
AchievementManager.ach_InfiniteAmmo = stringToBoolean(_local1[81]);
Globals.PLAYER_NAME = _local1[82];
Globals.SCORE_STORY = _local1[83];
Globals.SCORE_DEFENDER = _local1[84];
Globals.SCORE_TIMEATTACK = _local1[85];
Globals.SCORE_SURVIVAL = _local1[86];
Globals.CAPITULO_HISTORIA = _local1[87];
}
public function update(){
var _local1:Array;
var _local2:WeaponShop;
var _local3:int;
trace("sincronizando savedgame");
_local1 = [];
_local1.push(Globals.MUSICA_ACTIVA);
_local1.push(Globals.SONIDO_ACTIVO);
_local1.push(Globals.SANGRE_ACTIVA);
_local1.push(Globals.CALIDAD);
_local1.push(Globals.KEY_MOVE_LEFT);
_local1.push(Globals.KEY_MOVE_RIGHT);
_local1.push(Globals.KEY_MOVE_UP);
_local1.push(Globals.KEY_MOVE_DOWN);
_local1.push(Globals.KEY_ATTACK_LEFT);
_local1.push(Globals.KEY_ATTACK_RIGHT);
_local1.push(Globals.KEY_SELECT_MELEE);
_local1.push(Globals.KEY_SELECT_SLOT1);
_local1.push(Globals.KEY_SELECT_SLOT2);
_local1.push(Globals.KEY_SELECT_SLOT3);
_local1.push(Globals.KEY_SELECT_SLOT4);
_local1.push(Globals.KEY_SWITCH);
_local1.push(Globals.KEY_PAUSE);
_local2 = WeaponShop.getInstance();
_local1.push(_local2.weaponList[0].locked);
_local1.push(_local2.weaponList[1].locked);
_local1.push(_local2.weaponList[2].locked);
_local1.push(_local2.weaponList[3].locked);
_local1.push(_local2.weaponList[4].locked);
_local1.push(_local2.weaponList[5].locked);
_local1.push(_local2.weaponList[6].locked);
_local1.push(_local2.weaponList[7].locked);
_local1.push(_local2.weaponList[8].locked);
_local1.push(_local2.weaponList[9].locked);
_local1.push(_local2.weaponList[10].locked);
_local1.push(_local2.weaponList[11].locked);
_local1.push(_local2.weaponList[11].locked);
_local1.push(_local2.weaponList[13].locked);
_local1.push(_local2.weaponList[14].locked);
_local1.push(_local2.weaponList[15].locked);
_local1.push(_local2.weaponList[16].locked);
_local1.push(_local2.weaponList[17].locked);
_local1.push(_local2.weaponList[18].locked);
_local1.push(_local2.weaponList[19].locked);
_local1.push(_local2.weaponList[20].locked);
_local1.push(_local2.weaponList[21].locked);
_local1.push(_local2.weaponList[22].locked);
_local1.push(_local2.weaponList[23].locked);
_local1.push(_local2.weaponList[24].locked);
_local1.push(_local2.weaponList[25].locked);
_local1.push(_local2.weaponList[26].locked);
_local1.push(_local2.weaponList[27].locked);
_local1.push(_local2.weaponList[28].locked);
_local1.push(_local2.weaponList[29].locked);
_local1.push(_local2.weaponList[30].locked);
_local1.push(_local2.weaponList[31].locked);
_local1.push(_local2.weaponList[32].locked);
_local1.push(_local2.weaponList[33].locked);
_local1.push(_local2.weaponList[34].locked);
_local1.push(_local2.weaponList[35].locked);
_local1.push(_local2.weaponList[36].locked);
_local1.push(Globals.muertesTotal);
_local1.push(Globals.muertesMelee);
_local1.push(Globals.muertesArma);
_local1.push(Globals.muertesExplosion);
_local1.push(Globals.muertesMotosierra);
_local1.push(Globals.muertesLanzallamas);
_local1.push(Globals.muertesEspecial);
_local1.push(Globals.muertesZombiesPayasos);
_local1.push(Globals.zombiesCongelados);
_local1.push(Globals.comboPlayer);
_local1.push(AchievementManager.ach_AllWeapons);
_local1.push(AchievementManager.ach_Megaslash);
_local1.push(AchievementManager.ach_HomeRun);
_local1.push(AchievementManager.ach_Jedi);
_local1.push(AchievementManager.ach_Jurasic);
_local1.push(AchievementManager.ach_Samurai);
_local1.push(AchievementManager.ach_Massacre);
_local1.push(AchievementManager.ach_Pyromania);
_local1.push(AchievementManager.ach_Terminator);
_local1.push(AchievementManager.ach_Hunter);
_local1.push(AchievementManager.ach_Hitman);
_local1.push(AchievementManager.ach_Disintegrate);
_local1.push(AchievementManager.ach_Demolition);
_local1.push(AchievementManager.ach_Headache);
_local1.push(AchievementManager.ach_BloodyCircus);
_local1.push(AchievementManager.ach_Glacier);
_local1.push(AchievementManager.ach_MoreBullets);
_local1.push(AchievementManager.ach_InfiniteAmmo);
_local1.push(Globals.PLAYER_NAME);
_local1.push(Globals.SCORE_STORY);
_local1.push(Globals.SCORE_DEFENDER);
_local1.push(Globals.SCORE_TIMEATTACK);
_local1.push(Globals.SCORE_SURVIVAL);
_local1.push(Globals.CAPITULO_HISTORIA);
savedGame = "";
_local3 = 0;
while (_local3 < _local1.length) {
savedGame = ((savedGame + _local1[_local3]) + "|");
_local3++;
};
trace(savedGame);
}
public function stringToBoolean(_arg1:String):Boolean{
var _local2:Boolean;
_local2 = false;
if (_arg1 == "true"){
_local2 = true;
} else {
_local2 = false;
};
return (_local2);
}
public function create(){
shared.data.savegame = "";
}
public function save(){
var _local1:Object;
update();
trace((("salvando savegame #" + savedGame) + "#"));
shared.data.savegame = savedGame;
_local1 = shared.flush();
trace(("flushResult: " + _local1));
trace(("saved: " + shared.data.savegame));
}
public static function getInstance():SaveManager{
if (instance == null){
instance = new SaveManager(new SingletonEnforcer());
};
return (instance);
}
}
}//package com.tanoku.MoreZombies
class SingletonEnforcer {
private function SingletonEnforcer(){
}
}
Section 126
//ThePreloader (com.tanoku.MoreZombies.ThePreloader)
package com.tanoku.MoreZombies {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class ThePreloader extends MovieClip {
public var tanoku:SimpleButton;
public var btn_play:SimpleButton;
public var t_loading:MovieClip;
private var fullWidth:Number;
public var graficoProgreso:MovieClip;
public var t_porcentaje:TextField;
public var ldrInfo:LoaderInfo;
public var maxgames:SimpleButton;
public function ThePreloader(_arg1:Number=0, _arg2:LoaderInfo=null, _arg3=null){
this.fullWidth = _arg1;
this.ldrInfo = _arg2;
btn_play.visible = false;
btn_play.addEventListener(MouseEvent.CLICK, on_button_clicked);
addEventListener(Event.ENTER_FRAME, checkLoad);
maxgames.addEventListener(MouseEvent.CLICK, manejarClickSponsor);
tanoku.addEventListener(MouseEvent.CLICK, manejarClickTanoku);
}
private function checkLoad(_arg1:Event):void{
if ((((ldrInfo.bytesLoaded == ldrInfo.bytesTotal)) && (!((ldrInfo.bytesTotal == 0))))){
dispatchEvent(new Event("loadComplete"));
phaseOut();
};
updateLoader((ldrInfo.bytesLoaded / ldrInfo.bytesTotal));
}
private function updateLoader(_arg1:Number):void{
var _local2:int;
_local2 = (_arg1 * 100);
t_porcentaje.text = (("" + _local2) + "%");
graficoProgreso.gotoAndStop(_local2);
}
private function manejarClickTanoku(_arg1:MouseEvent):void{
Globals.webTanoku();
}
private function manejarClickSponsor(_arg1:MouseEvent):void{
Globals.webSponsor();
}
function on_button_clicked(_arg1:MouseEvent){
switch (_arg1.currentTarget.name){
case "btn_play":
btn_play.visible = false;
btn_play.removeEventListener(MouseEvent.CLICK, on_button_clicked);
maxgames.removeEventListener(MouseEvent.CLICK, manejarClickSponsor);
tanoku.removeEventListener(MouseEvent.CLICK, manejarClickTanoku);
phaseComplete();
break;
default:
trace((_arg1.target.name + " UNDEFINED"));
break;
};
}
private function phaseOut():void{
removeEventListener(Event.ENTER_FRAME, checkLoad);
btn_play.visible = true;
t_loading.visible = false;
t_porcentaje.visible = false;
}
private function phaseComplete():void{
dispatchEvent(new Event("preloaderFinished"));
}
}
}//package com.tanoku.MoreZombies
Section 127
//tutorial (com.tanoku.MoreZombies.tutorial)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class tutorial extends MovieClip {
public var btn_pagina_anterior:SimpleButton;
public var main_class:MovieClip;
public var btn_pagina_siguiente:SimpleButton;
public var pagina:int;// = 1
public var paginas:MovieClip;
public var b_back:SimpleButton;
public function tutorial(){
pagina = 1;
super();
b_back.addEventListener(MouseEvent.CLICK, on_button_clicked);
btn_pagina_anterior.addEventListener(MouseEvent.CLICK, on_button_clicked);
btn_pagina_siguiente.addEventListener(MouseEvent.CLICK, on_button_clicked);
btn_pagina_anterior.visible = false;
}
public function on_button_out(_arg1:MouseEvent){
}
public function on_button_over(_arg1:MouseEvent){
switch (_arg1.target.name){
};
}
public function on_button_clicked(_arg1:MouseEvent){
switch (_arg1.currentTarget.name){
case "b_back":
main_class.cierra_pantalla(this, "cortina");
break;
case "btn_pagina_siguiente":
pagina = (pagina + 1);
paginar();
btn_pagina_anterior.visible = true;
if (pagina == 4){
btn_pagina_siguiente.visible = false;
};
break;
case "btn_pagina_anterior":
pagina = (pagina - 1);
paginar();
btn_pagina_siguiente.visible = true;
if (pagina == 1){
btn_pagina_anterior.visible = false;
};
break;
default:
trace((_arg1.target.name + " UNDEFINED"));
break;
};
}
function paginar(){
switch (pagina){
case 1:
TweenLite.to(paginas, 1, {x:0});
break;
case 2:
TweenLite.to(paginas, 1, {x:-800});
break;
case 3:
TweenLite.to(paginas, 1, {x:-1600});
break;
case 4:
TweenLite.to(paginas, 1, {x:-2400});
break;
};
}
}
}//package com.tanoku.MoreZombies
Section 128
//Weapon (com.tanoku.MoreZombies.Weapon)
package com.tanoku.MoreZombies {
import flash.display.*;
public class Weapon {
public var pushFactor:Number;// = 0
public var locked:Boolean;// = true
public var ammo_type:int;// = 0
public var destello:String;// = ""
public var fav:Boolean;// = false
public var sound:String;// = ""
public var detonate:Boolean;// = false
public var ammo_offset:Number;// = 0
public var automatic:Boolean;// = false
public var offset_salida_x:Number;// = 0
public var offset_salida_y:Number;// = 0
public var torso_group:int;// = 1
public var tipo:int;// = 0
public var fire_group:int;// = 0
public var soundWait:Boolean;// = false
public var range:Number;// = 0
public var pushOnImpact:Boolean;// = true
public var next_round:Number;// = 0
public var time_effect:Number;// = 0
public var speed:Number;// = 0
public var clip:Number;// = 0
public var countDown:Number;// = 0
public var old_frame:int;// = 0
public var weaponDef;
public var sound_volume:Number;// = 1
public var playerWeapon:Boolean;// = true
public var salida_x_casquillo:int;// = 0
public var damage_range1:Number;// = 0
public var damage_range2:Number;// = 0
public var damage_range:Number;// = 0
public var damage:Number;// = 1
public var damage_range3:Number;// = 0
public var x:int;// = 1
public var group:int;
public var bullets_round:int;// = 1
public var delay:Number;// = 1000
public var maxCombo:Number;// = 1
public var name:String;
public var carga_explosiva:Object;// = null
public var desc:String;// = ""
public var damageOnImpact:Boolean;// = true
public var animacion_casquillo:String;// = ""
public var toUnlock:int;// = 0
public var movement_anim:String;
public var damage2:Number;// = 0
public var dieOnImpact:Boolean;// = true
public var damage1:Number;// = 0
public var damage3:Number;// = 0
public var killsToUnlock:int;// = 0
public var body:MovieClip;
public var special:String;// = ""
public var max_ammo:Number;// = 0
public var ammo:Boolean;// = false
public var index:int;
public var salida_variable:Boolean;// = true
public var current_ammo:Number;// = 0
public var movement_factor:Number;// = 1
public var animFrame:String;// = ""
public var vida_pixeles:int;// = 1
public var fired:Boolean;// = false
public var indice_casquillo:int;// = 0
public var detonator_frame:int;// = 38
public function Weapon(){
locked = true;
toUnlock = 0;
fav = false;
torso_group = 1;
fire_group = 0;
automatic = false;
fired = false;
delay = 1000;
next_round = 0;
damage = 1;
ammo = false;
ammo_type = 0;
max_ammo = 0;
current_ammo = 0;
range = 0;
countDown = 0;
animFrame = "";
speed = 0;
ammo_offset = 0;
bullets_round = 1;
damage_range = 0;
damage1 = 0;
damage_range1 = 0;
damage2 = 0;
damage_range2 = 0;
damage3 = 0;
damage_range3 = 0;
detonate = false;
carga_explosiva = null;
time_effect = 0;
offset_salida_y = 0;
offset_salida_x = 0;
playerWeapon = true;
dieOnImpact = true;
pushOnImpact = true;
pushFactor = 0;
damageOnImpact = true;
tipo = 0;
x = 1;
vida_pixeles = 1;
detonator_frame = 38;
old_frame = 0;
destello = "";
clip = 0;
sound = "";
sound_volume = 1;
soundWait = false;
movement_anim = Globals.RUN;
movement_factor = 1;
salida_variable = true;
animacion_casquillo = "";
indice_casquillo = 0;
salida_x_casquillo = 0;
killsToUnlock = 0;
maxCombo = 1;
desc = "";
special = "";
super();
}
}
}//package com.tanoku.MoreZombies
Section 129
//WeaponManager (com.tanoku.MoreZombies.WeaponManager)
package com.tanoku.MoreZombies {
import flash.events.*;
import flash.utils.*;
public class WeaponManager extends EventDispatcher {
public var currentAGunWeapon:int;
public var currentWeaponSlot:int;
public var currentWeaponType:int;
public var weaponList:Array;
public var currentContactWeapon:int;
public var currentThrowWeapon:int;
public var currentMGunWeapon:int;
private var weaponShop:WeaponShop;
public var currentWeapon:int;
public var firingWeapon:Array;
public static const UPDATE:String = "update_weapon";
public static var instance:WeaponManager;
public function WeaponManager(_arg1:SingletonEnforcer){
weaponShop = WeaponShop.getInstance();
super();
loadWeapons();
}
public function resetWeapons(){
var _local1:int;
_local1 = 0;
while (_local1 < weaponList.length) {
if (weaponList[_local1] != null){
if (weaponList[_local1].carga_explosiva != null){
weaponList[_local1].carga_explosiva.finalize();
weaponList[_local1].current_ammo = (weaponList[_local1].current_ammo + 1);
weaponList[_local1].index = weaponList[_local1].old_frame;
weaponList[_local1].carga_explosiva = null;
};
};
_local1++;
};
dispatchEvent(new Event(WeaponManager.UPDATE));
}
public function update(){
handleWeapons();
}
public function loadWeapons(){
weaponList = new Array(null, null, null, null, null);
resetWeapons();
firingWeapon = new Array(false, false, false, false, false);
currentWeaponType = Globals.CONTACT;
currentContactWeapon = 0;
currentMGunWeapon = 0;
currentAGunWeapon = 0;
currentThrowWeapon = 0;
weaponShop.getWeapons(weaponList);
if (Globals.GamePaused == true){
} else {
currentWeapon = 0;
currentWeaponSlot = 1;
};
dispatchEvent(new Event(WeaponManager.UPDATE));
}
public function switchSlot():void{
if (currentWeapon == 0){
if (weaponList[currentWeaponSlot] != null){
currentWeapon = currentWeaponSlot;
};
} else {
currentWeapon = 0;
};
dispatchEvent(new Event(WeaponManager.UPDATE));
}
public function selectSlot(_arg1:int):void{
if (weaponList[_arg1] != null){
if (_arg1 == 0){
currentWeapon = 0;
} else {
currentWeaponSlot = _arg1;
currentWeapon = currentWeaponSlot;
};
dispatchEvent(new Event(WeaponManager.UPDATE));
};
}
public function clear_weapon_slot(_arg1:int){
}
public function set_weapon_slot(_arg1:int){
}
public function finalize(){
resetWeapons();
instance = null;
}
private function handleWeapons(){
}
public function fireWeapon():Boolean{
var _local1:Boolean;
_local1 = false;
if (getTimer() > weaponList[currentWeapon].next_round){
if (weaponList[currentWeapon].automatic){
weaponList[currentWeapon].next_round = (getTimer() + weaponList[currentWeapon].delay);
_local1 = true;
firingWeapon[currentWeapon] = true;
} else {
if (!weaponList[currentWeapon].fired){
weaponList[currentWeapon].next_round = (getTimer() + weaponList[currentWeapon].delay);
_local1 = true;
firingWeapon[currentWeapon] = true;
weaponList[currentWeapon].fired = true;
};
};
} else {
_local1 = false;
firingWeapon[currentWeapon] = false;
};
if ((((_local1 == true)) && ((weaponList[currentWeapon].ammo == true)))){
if (weaponList[currentWeapon].current_ammo > 0){
if (weaponList[currentWeapon].carga_explosiva != null){
_local1 = true;
firingWeapon[currentWeapon] = true;
weaponList[currentWeapon].fired = true;
} else {
if (Globals.MunicionInfinita == false){
weaponList[currentWeapon].current_ammo = (weaponList[currentWeapon].current_ammo - 1);
};
};
} else {
if (weaponList[currentWeapon].carga_explosiva != null){
_local1 = true;
firingWeapon[currentWeapon] = true;
weaponList[currentWeapon].fired = true;
} else {
if (Globals.MunicionInfinita == false){
_local1 = false;
firingWeapon[currentWeapon] = false;
};
};
};
};
dispatchEvent(new Event(WeaponManager.UPDATE));
return (_local1);
}
public function stopWeapon(){
if (weaponList[currentWeapon].fired == true){
firingWeapon[currentWeapon] = false;
weaponList[currentWeapon].fired = false;
dispatchEvent(new Event(WeaponManager.UPDATE));
};
}
public static function getInstance():WeaponManager{
if (instance == null){
instance = new WeaponManager(new SingletonEnforcer());
};
return (instance);
}
}
}//package com.tanoku.MoreZombies
class SingletonEnforcer {
private function SingletonEnforcer(){
}
}
Section 130
//WeaponShop (com.tanoku.MoreZombies.WeaponShop)
package com.tanoku.MoreZombies {
import com.cheezeworld.utils.*;
public class WeaponShop {
public var armas_seleccionadas:Array;
public var weaponList:Array;
public var arma_melee:String;
public static var instance:WeaponShop;
public function WeaponShop(_arg1:SingletonEnforcer){
loadWeaponData();
}
public function weaponLocked(_arg1:int):Boolean{
var _local2:Boolean;
var _local3:int;
_local2 = true;
_local3 = 0;
while (_local3 < weaponList.length) {
if (weaponList[_local3].index == _arg1){
_local2 = weaponList[_local3].locked;
};
_local3++;
};
return (_local2);
}
public function loadWeaponData():void{
var _local1:Weapon;
weaponList = new Array();
_local1 = new Weapon();
_local1.name = "<empty>";
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "M9";
_local1.desc = "Basic semiautomatic pistol";
_local1.special = "";
_local1.killsToUnlock = 0;
_local1.locked = false;
_local1.fav = false;
_local1.group = Globals.MGUN;
_local1.index = 2;
_local1.torso_group = 3;
_local1.fire_group = Globals.FIRE_GROUP_FIREARM1;
_local1.automatic = false;
_local1.delay = 10;
_local1.damage = 2;
_local1.speed = 75;
_local1.ammo = true;
_local1.ammo_type = Globals.BASIC_BULLET;
_local1.max_ammo = 90;
_local1.current_ammo = 15;
_local1.range = 300;
_local1.vida_pixeles = 300;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = 112;
_local1.offset_salida_x = 75;
_local1.destello = "pistola";
_local1.pushFactor = 15;
_local1.clip = 15;
_local1.sound = "M9";
_local1.animacion_casquillo = "tipo_1";
_local1.indice_casquillo = 1;
_local1.salida_x_casquillo = 0;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "USP45";
_local1.desc = "9mm USP Tactical .45";
_local1.special = "";
_local1.killsToUnlock = 30;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.MGUN;
_local1.index = 3;
_local1.torso_group = 3;
_local1.fire_group = Globals.FIRE_GROUP_FIREARM1;
_local1.automatic = false;
_local1.delay = 10;
_local1.damage = 2.5;
_local1.speed = 75;
_local1.ammo = true;
_local1.ammo_type = Globals.BASIC_BULLET;
_local1.clip = 12;
_local1.max_ammo = 75;
_local1.current_ammo = 12;
_local1.range = 300;
_local1.vida_pixeles = 300;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = 113;
_local1.offset_salida_x = 75;
_local1.destello = "pistola";
_local1.animacion_casquillo = "tipo_1";
_local1.indice_casquillo = 1;
_local1.salida_x_casquillo = 0;
_local1.sound = "USP";
_local1.sound_volume = 0.5;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "Colt Python";
_local1.desc = ".357 Magnum caliber revolver";
_local1.special = "";
_local1.killsToUnlock = 750;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.MGUN;
_local1.index = 4;
_local1.torso_group = 3;
_local1.fire_group = Globals.FIRE_GROUP_FIREARM3;
_local1.automatic = false;
_local1.delay = 1000;
_local1.damage = 10;
_local1.speed = 100;
_local1.ammo = true;
_local1.ammo_type = Globals.COLT_PYTHON;
_local1.clip = 6;
_local1.max_ammo = 24;
_local1.current_ammo = 6;
_local1.range = 300;
_local1.vida_pixeles = 300;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = 118;
_local1.offset_salida_x = 88;
_local1.destello = "pistola";
_local1.animacion_casquillo = "tipo_1";
_local1.indice_casquillo = 1;
_local1.salida_x_casquillo = 0;
_local1.sound = "ColtPython";
_local1.sound_volume = 0.5;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "Desert Eagle";
_local1.desc = "Gas-operated semi-automatic pistol";
_local1.special = "";
_local1.killsToUnlock = 150;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.MGUN;
_local1.index = 5;
_local1.torso_group = 3;
_local1.fire_group = Globals.FIRE_GROUP_FIREARM2;
_local1.automatic = false;
_local1.delay = 500;
_local1.damage = 5;
_local1.speed = 100;
_local1.ammo = true;
_local1.ammo_type = Globals.DESERT_EAGLE;
_local1.clip = 7;
_local1.max_ammo = 42;
_local1.current_ammo = 7;
_local1.range = 300;
_local1.vida_pixeles = 300;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = 113;
_local1.offset_salida_x = 75;
_local1.destello = "pistola";
_local1.animacion_casquillo = "tipo_1";
_local1.indice_casquillo = 1;
_local1.salida_x_casquillo = 0;
_local1.sound = "DesertEagle";
_local1.sound_volume = 0.5;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "Uzi";
_local1.desc = "9mm UZI pistol";
_local1.special = "";
_local1.killsToUnlock = 90;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.AGUN;
_local1.index = 6;
_local1.torso_group = 3;
_local1.fire_group = Globals.FIRE_GROUP_FIREARM1;
_local1.automatic = true;
_local1.delay = 120;
_local1.damage = 1;
_local1.speed = 100;
_local1.ammo_offset = 7;
_local1.ammo = true;
_local1.ammo_type = Globals.BASIC_BULLET;
_local1.clip = 32;
_local1.max_ammo = 192;
_local1.current_ammo = 32;
_local1.range = 300;
_local1.vida_pixeles = 300;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = 112;
_local1.offset_salida_x = 80;
_local1.destello = "pistola";
_local1.sound = "Uzi";
_local1.animacion_casquillo = "tipo_1";
_local1.indice_casquillo = 1;
_local1.salida_x_casquillo = 0;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "SPAS12";
_local1.desc = "Short range combat shotgun";
_local1.special = "3 bullets per shot";
_local1.killsToUnlock = 400;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.MGUN;
_local1.index = 7;
_local1.torso_group = 3;
_local1.fire_group = Globals.FIRE_GROUP_FIREARM3;
_local1.automatic = false;
_local1.delay = 250;
_local1.damage = 6;
_local1.speed = 50;
_local1.ammo_offset = 8;
_local1.bullets_round = 3;
_local1.ammo = true;
_local1.ammo_type = Globals.SPAS12;
_local1.clip = 8;
_local1.dieOnImpact = true;
_local1.max_ammo = 70;
_local1.current_ammo = 8;
_local1.range = 250;
_local1.vida_pixeles = 250;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = 120;
_local1.offset_salida_x = 90;
_local1.destello = "escopeta";
_local1.animacion_casquillo = "tipo_1";
_local1.indice_casquillo = 4;
_local1.salida_x_casquillo = 0;
_local1.sound = "SPAS12";
_local1.sound_volume = 0.7;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "Winchester";
_local1.desc = "Grandfather's Winchester Model 1897";
_local1.special = "3 bullets per shot";
_local1.killsToUnlock = 1100;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.MGUN;
_local1.index = 8;
_local1.torso_group = 3;
_local1.fire_group = Globals.FIRE_GROUP_FIREARM3;
_local1.automatic = false;
_local1.delay = 750;
_local1.damage = 5;
_local1.speed = 50;
_local1.ammo_offset = 8;
_local1.bullets_round = 3;
_local1.ammo = true;
_local1.ammo_type = Globals.WINCHESTER;
_local1.clip = 5;
_local1.dieOnImpact = true;
_local1.max_ammo = 35;
_local1.current_ammo = 5;
_local1.range = 400;
_local1.vida_pixeles = 400;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = 102;
_local1.offset_salida_x = 118;
_local1.destello = "escopeta";
_local1.animacion_casquillo = "tipo_1";
_local1.indice_casquillo = 4;
_local1.salida_x_casquillo = 0;
_local1.sound = "Winchester";
_local1.sound_volume = 0.5;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "AK-47";
_local1.desc = "Russian assault rifle";
_local1.special = "";
_local1.killsToUnlock = 800;
_local1.torso_group = 3;
_local1.fire_group = Globals.FIRE_GROUP_FIREARM1;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.AGUN;
_local1.index = 9;
_local1.automatic = true;
_local1.delay = 100;
_local1.damage = 4;
_local1.speed = 100;
_local1.ammo_offset = 10;
_local1.ammo = true;
_local1.ammo_type = Globals.BASIC_BULLET;
_local1.clip = 30;
_local1.max_ammo = 300;
_local1.current_ammo = 30;
_local1.range = 400;
_local1.vida_pixeles = 400;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = 100;
_local1.offset_salida_x = 90;
_local1.destello = "metralleta";
_local1.sound = "M9";
_local1.animacion_casquillo = "tipo_1";
_local1.indice_casquillo = 2;
_local1.salida_x_casquillo = 0;
_local1.sound = "AK47";
_local1.sound_volume = 0.5;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "MP5";
_local1.desc = "Light submachine gun";
_local1.special = "";
_local1.killsToUnlock = 600;
_local1.torso_group = 3;
_local1.fire_group = Globals.FIRE_GROUP_FIREARM1;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.AGUN;
_local1.index = 10;
_local1.automatic = true;
_local1.delay = 110;
_local1.damage = 3;
_local1.speed = 100;
_local1.ammo_offset = 12;
_local1.ammo = true;
_local1.ammo_type = Globals.BASIC_BULLET;
_local1.clip = 30;
_local1.max_ammo = 210;
_local1.current_ammo = 30;
_local1.range = 300;
_local1.vida_pixeles = 300;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = 105;
_local1.offset_salida_x = 60;
_local1.destello = "pistola";
_local1.animacion_casquillo = "tipo_1";
_local1.indice_casquillo = 2;
_local1.salida_x_casquillo = 0;
_local1.sound = "MP5";
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "P90";
_local1.desc = "Personal defense weapon";
_local1.special = "";
_local1.killsToUnlock = 300;
_local1.torso_group = 3;
_local1.fire_group = Globals.FIRE_GROUP_FIREARM1;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.AGUN;
_local1.index = 11;
_local1.automatic = true;
_local1.delay = 115;
_local1.damage = 2;
_local1.speed = 100;
_local1.ammo_offset = 5;
_local1.ammo = true;
_local1.ammo_type = Globals.BASIC_BULLET;
_local1.clip = 50;
_local1.max_ammo = 300;
_local1.current_ammo = 50;
_local1.range = 300;
_local1.vida_pixeles = 300;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = 98;
_local1.offset_salida_x = 50;
_local1.destello = "pistola";
_local1.animacion_casquillo = "tipo_1";
_local1.indice_casquillo = 2;
_local1.salida_x_casquillo = 0;
_local1.sound = "P90";
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "M16A4";
_local1.desc = "The black assault rifle";
_local1.special = "<>";
_local1.killsToUnlock = 1300;
_local1.torso_group = 3;
_local1.fire_group = Globals.FIRE_GROUP_FIREARM1;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.AGUN;
_local1.index = 12;
_local1.automatic = true;
_local1.delay = 100;
_local1.damage = 5;
_local1.speed = 100;
_local1.ammo_offset = 7;
_local1.ammo = true;
_local1.ammo_type = Globals.BASIC_BULLET;
_local1.clip = 30;
_local1.max_ammo = 300;
_local1.current_ammo = 30;
_local1.range = 400;
_local1.vida_pixeles = 400;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = 105;
_local1.offset_salida_x = 90;
_local1.destello = "metralleta";
_local1.animacion_casquillo = "tipo_1";
_local1.indice_casquillo = 2;
_local1.salida_x_casquillo = 0;
_local1.sound = "M16";
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "Minigun";
_local1.desc = "Gatling-type heavy machine gun";
_local1.special = "Run speed -50%";
_local1.killsToUnlock = 2500;
_local1.torso_group = 3;
_local1.fire_group = Globals.FIRE_GROUP_FIREARM1;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.AGUN;
_local1.index = 13;
_local1.automatic = true;
_local1.delay = 50;
_local1.damage = 30;
_local1.dieOnImpact = true;
_local1.speed = 100;
_local1.ammo_offset = 6;
_local1.ammo = true;
_local1.ammo_type = Globals.MACHINE_GUN;
_local1.clip = 100;
_local1.max_ammo = 1000;
_local1.current_ammo = 100;
_local1.range = 500;
_local1.vida_pixeles = 500;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = 50;
_local1.offset_salida_x = 103;
_local1.destello = "metralleta";
_local1.movement_anim = Globals.WALK;
_local1.movement_factor = 0.5;
_local1.salida_variable = false;
_local1.pushFactor = 10;
_local1.animacion_casquillo = "tipo_2";
_local1.indice_casquillo = 3;
_local1.salida_x_casquillo = 0;
_local1.sound = "Minigun";
_local1.soundWait = true;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "M60";
_local1.desc = "Heavy machine gun";
_local1.special = "Run speed -30%";
_local1.killsToUnlock = 1900;
_local1.torso_group = 3;
_local1.fire_group = Globals.FIRE_GROUP_FIREARM1;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.AGUN;
_local1.index = 14;
_local1.automatic = true;
_local1.delay = 70;
_local1.damage = 20;
_local1.speed = 100;
_local1.ammo_offset = 12;
_local1.ammo = true;
_local1.ammo_type = Globals.MACHINE_GUN;
_local1.clip = 100;
_local1.max_ammo = 400;
_local1.current_ammo = 100;
_local1.range = 400;
_local1.vida_pixeles = 400;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = 81;
_local1.offset_salida_x = 80;
_local1.destello = "metralleta";
_local1.movement_anim = Globals.WALK;
_local1.movement_factor = 0.7;
_local1.salida_variable = true;
_local1.animacion_casquillo = "tipo_1";
_local1.indice_casquillo = 3;
_local1.salida_x_casquillo = 0;
_local1.sound = "M60";
_local1.sound_volume = 0.7;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "M249";
_local1.desc = "Light machine gun";
_local1.special = "Run speed -15%";
_local1.killsToUnlock = 1700;
_local1.torso_group = 3;
_local1.fire_group = Globals.FIRE_GROUP_FIREARM1;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.AGUN;
_local1.index = 15;
_local1.automatic = true;
_local1.delay = 85;
_local1.damage = 10;
_local1.speed = 100;
_local1.ammo_offset = 15;
_local1.ammo = true;
_local1.ammo_type = Globals.MACHINE_GUN;
_local1.clip = 100;
_local1.max_ammo = 300;
_local1.current_ammo = 100;
_local1.range = 400;
_local1.vida_pixeles = 400;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = 95;
_local1.offset_salida_x = 85;
_local1.destello = "metralleta";
_local1.movement_anim = Globals.WALK;
_local1.movement_factor = 0.85;
_local1.salida_variable = true;
_local1.animacion_casquillo = "tipo_1";
_local1.indice_casquillo = 3;
_local1.salida_x_casquillo = 0;
_local1.sound = "M249";
_local1.sound_volume = 0.8;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "Fim92A Stinger";
_local1.desc = "Manportable surface-to-air missile";
_local1.special = "Splash damage";
_local1.killsToUnlock = 1600;
_local1.torso_group = 3;
_local1.fire_group = Globals.FIRE_GROUP_STINGER;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.MGUN;
_local1.index = 16;
_local1.automatic = false;
_local1.delay = 2000;
_local1.damage = 45;
_local1.damage_range = 1;
_local1.damage1 = 45;
_local1.damage_range1 = 25;
_local1.damage2 = 15;
_local1.damage_range2 = 125;
_local1.damage3 = 5;
_local1.damage_range3 = 200;
_local1.speed = 15;
_local1.ammo_offset = 2;
_local1.bullets_round = 1;
_local1.ammo = true;
_local1.ammo_type = Globals.BASIC_MISSILE;
_local1.clip = 1;
_local1.max_ammo = 5;
_local1.current_ammo = 1;
_local1.range = 800;
_local1.vida_pixeles = 800;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = 100;
_local1.offset_salida_x = 75;
_local1.sound = "Stinger";
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "AITSO Canon";
_local1.desc = "Secret prototype gun";
_local1.special = "Run speed -50%";
_local1.killsToUnlock = 2250;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.MGUN;
_local1.index = 17;
_local1.torso_group = 3;
_local1.fire_group = Globals.FIRE_GROUP_AITSO;
_local1.automatic = false;
_local1.delay = 5000;
_local1.damage = 100;
_local1.speed = 125;
_local1.ammo = true;
_local1.ammo_type = Globals.AITSO;
_local1.clip = 1;
_local1.max_ammo = 10;
_local1.current_ammo = 10;
_local1.range = 800;
_local1.vida_pixeles = 800;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = 100;
_local1.offset_salida_x = 75;
_local1.dieOnImpact = false;
_local1.movement_factor = 0.5;
_local1.movement_anim = Globals.WALK;
_local1.sound = "";
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "Chainsaw";
_local1.desc = "Portable mechanical, motorized saw";
_local1.special = "";
_local1.killsToUnlock = 500;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.CONTACT;
_local1.index = 18;
_local1.torso_group = 3;
_local1.fire_group = Globals.FIRE_GROUP_CHAINSAW;
_local1.automatic = true;
_local1.delay = 50;
_local1.damage = 5;
_local1.speed = 15;
_local1.ammo = true;
_local1.ammo_type = Globals.CHAINSAW;
_local1.clip = 100;
_local1.max_ammo = 1000;
_local1.current_ammo = 1000;
_local1.range = 70;
_local1.vida_pixeles = 70;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = 60;
_local1.offset_salida_x = 75;
_local1.sound = "Motosierra";
_local1.soundWait = true;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "Flamethrower";
_local1.desc = "Project a long controllable stream of fire";
_local1.special = "Run speed -50%";
_local1.killsToUnlock = 1200;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.CONTACT;
_local1.index = 19;
_local1.torso_group = 3;
_local1.fire_group = Globals.FIRE_GROUP_FLAMETHROWER;
_local1.automatic = true;
_local1.delay = 50;
_local1.damage = 10;
_local1.speed = 8;
_local1.ammo = true;
_local1.ammo_type = Globals.FLAMETHROWER;
_local1.clip = 100;
_local1.max_ammo = 500;
_local1.current_ammo = 100;
_local1.range = 100;
_local1.vida_pixeles = 230;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = 80;
_local1.offset_salida_x = 110;
_local1.pushOnImpact = false;
_local1.movement_anim = Globals.WALK;
_local1.movement_factor = 0.5;
_local1.dieOnImpact = true;
_local1.salida_variable = false;
_local1.sound = "Lanzallamas";
_local1.soundWait = true;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "Extinguisher";
_local1.desc = "A stored-pressure fire extinguisher";
_local1.special = "No damage. Freeze target.";
_local1.killsToUnlock = 700;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.CONTACT;
_local1.index = 20;
_local1.torso_group = 3;
_local1.fire_group = Globals.FIRE_GROUP_EXTINGUISHER;
_local1.automatic = true;
_local1.delay = 50;
_local1.damage = 6000;
_local1.speed = 10;
_local1.ammo = true;
_local1.ammo_type = Globals.EXTINGUISHER;
_local1.clip = 100;
_local1.max_ammo = 100;
_local1.current_ammo = 100;
_local1.range = 100;
_local1.vida_pixeles = 240;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = 85;
_local1.offset_salida_x = 75;
_local1.pushOnImpact = false;
_local1.damageOnImpact = false;
_local1.salida_variable = false;
_local1.sound = "Extintor";
_local1.soundWait = true;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "Stielhandgranate";
_local1.desc = "German stick grenade model 24";
_local1.special = "Splash damage";
_local1.killsToUnlock = 250;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.THROW;
_local1.index = 21;
_local1.torso_group = 11;
_local1.fire_group = Globals.FIRE_GROUP_THROW;
_local1.automatic = false;
_local1.delay = 1000;
_local1.damage = 8;
_local1.time_effect = 3000;
_local1.damage1 = 8;
_local1.damage_range1 = 25;
_local1.damage2 = 4;
_local1.damage_range2 = 125;
_local1.damage3 = 2;
_local1.damage_range3 = 200;
_local1.speed = 6;
_local1.ammo_offset = 0;
_local1.ammo = true;
_local1.ammo_type = Globals.GERMAN_GRENADE;
_local1.clip = 6;
_local1.max_ammo = 12;
_local1.current_ammo = 6;
_local1.range = 0;
_local1.vida_pixeles = 0;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = 140;
_local1.offset_salida_x = 20;
_local1.salida_variable = false;
_local1.sound_volume = 1;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "Mk 2 Grenade";
_local1.desc = "Fragmentation hand grenade";
_local1.special = "Splash damage";
_local1.killsToUnlock = 650;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.THROW;
_local1.index = 22;
_local1.torso_group = 11;
_local1.fire_group = Globals.FIRE_GROUP_THROW;
_local1.automatic = false;
_local1.delay = 1000;
_local1.damage = 16;
_local1.time_effect = 3000;
_local1.damage1 = 16;
_local1.damage_range1 = 25;
_local1.damage2 = 8;
_local1.damage_range2 = 125;
_local1.damage3 = 4;
_local1.damage_range3 = 200;
_local1.speed = 6;
_local1.ammo_offset = 0;
_local1.ammo = true;
_local1.ammo_type = Globals.PINEAPPLE_GRENADE;
_local1.clip = 5;
_local1.max_ammo = 10;
_local1.current_ammo = 5;
_local1.range = 0;
_local1.vida_pixeles = 0;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = 140;
_local1.offset_salida_x = 20;
_local1.sound_volume = 1;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "Claymore";
_local1.desc = "Direction fragmentation anti-personnel mine";
_local1.special = "Splash damage";
_local1.killsToUnlock = 450;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.THROW;
_local1.index = 23;
_local1.torso_group = 11;
_local1.fire_group = Globals.FIRE_GROUP_MINE;
_local1.automatic = false;
_local1.delay = 1000;
_local1.damage = 10;
_local1.damage1 = 10;
_local1.damage_range1 = 25;
_local1.damage2 = 5;
_local1.damage_range2 = 125;
_local1.damage3 = 2;
_local1.damage_range3 = 200;
_local1.speed = 0;
_local1.ammo_offset = 0;
_local1.ammo = true;
_local1.ammo_type = Globals.PERSONAL_MINE;
_local1.clip = 3;
_local1.max_ammo = 6;
_local1.current_ammo = 3;
_local1.range = 0;
_local1.vida_pixeles = 0;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = -1;
_local1.offset_salida_x = 74;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "TM-46";
_local1.desc = "Large circular anti-tank mine";
_local1.special = "Splash damage";
_local1.killsToUnlock = 1400;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.THROW;
_local1.index = 24;
_local1.torso_group = 11;
_local1.fire_group = Globals.FIRE_GROUP_MINE;
_local1.automatic = false;
_local1.delay = 1000;
_local1.damage = 30;
_local1.damage1 = 30;
_local1.damage_range1 = 25;
_local1.damage2 = 20;
_local1.damage_range2 = 125;
_local1.damage3 = 10;
_local1.damage_range3 = 200;
_local1.speed = 0;
_local1.ammo_offset = 0;
_local1.ammo = true;
_local1.ammo_type = Globals.TANK_MINE;
_local1.clip = 1;
_local1.max_ammo = 5;
_local1.current_ammo = 1;
_local1.range = 0;
_local1.vida_pixeles = 0;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = -1;
_local1.offset_salida_x = 74;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "C4";
_local1.desc = "Packet of plastic explosive";
_local1.special = "Remote Detonator. Splash damage";
_local1.killsToUnlock = 1000;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.THROW;
_local1.index = 25;
_local1.torso_group = 11;
_local1.fire_group = Globals.FIRE_GROUP_MINE_DETONATOR;
_local1.automatic = false;
_local1.delay = 500;
_local1.damage = 30;
_local1.damage1 = 30;
_local1.damage_range1 = 25;
_local1.damage2 = 15;
_local1.damage_range2 = 125;
_local1.damage3 = 7;
_local1.damage_range3 = 200;
_local1.speed = 0;
_local1.ammo_offset = 0;
_local1.ammo = true;
_local1.ammo_type = Globals.C4_BOMB;
_local1.clip = 1;
_local1.max_ammo = 3;
_local1.current_ammo = 1;
_local1.range = 0;
_local1.vida_pixeles = 0;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = -1;
_local1.offset_salida_x = 74;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "Cranium v2";
_local1.desc = "Zombie-head exploding device";
_local1.special = "Remote Detonator";
_local1.killsToUnlock = 3000;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.THROW;
_local1.index = 26;
_local1.torso_group = 11;
_local1.fire_group = Globals.FIRE_GROUP_MINE_DETONATOR;
_local1.automatic = false;
_local1.delay = 1000;
_local1.damage = 100;
_local1.damage1 = 100;
_local1.damage_range1 = 25;
_local1.damage2 = 100;
_local1.damage_range2 = 125;
_local1.damage3 = 100;
_local1.damage_range3 = 450;
_local1.speed = 0;
_local1.ammo_offset = 0;
_local1.ammo = true;
_local1.ammo_type = Globals.BRAIN_BOMB;
_local1.clip = 1;
_local1.max_ammo = 1;
_local1.current_ammo = 1;
_local1.range = 0;
_local1.vida_pixeles = 0;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = -1;
_local1.offset_salida_x = 74;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "Freezer mine";
_local1.desc = "A curious snow globe";
_local1.special = "No damage. Splash freeze";
_local1.killsToUnlock = 1800;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.THROW;
_local1.index = 27;
_local1.torso_group = 11;
_local1.fire_group = Globals.FIRE_GROUP_MINE;
_local1.automatic = false;
_local1.delay = 1000;
_local1.damage = 10000;
_local1.damage1 = 10000;
_local1.damage_range1 = 25;
_local1.damage2 = 5000;
_local1.damage_range2 = 125;
_local1.damage3 = 2500;
_local1.damage_range3 = 200;
_local1.speed = 0;
_local1.ammo_offset = 0;
_local1.ammo = true;
_local1.ammo_type = Globals.FREEZE_MINE;
_local1.clip = 3;
_local1.max_ammo = 5;
_local1.current_ammo = 3;
_local1.range = 0;
_local1.vida_pixeles = 0;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.offset_salida_y = -1;
_local1.offset_salida_x = 74;
_local1.damageOnImpact = false;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "Katana";
_local1.desc = "The authentic Shinsengumi sword!";
_local1.killsToUnlock = 900;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.CONTACT;
_local1.torso_group = 2;
_local1.fire_group = Globals.FIRE_GROUP_MELEE;
_local1.index = 28;
_local1.automatic = false;
_local1.delay = 100;
_local1.damage = 4;
_local1.ammo = false;
_local1.ammo_type = 0;
_local1.max_ammo = 0;
_local1.current_ammo = 0;
_local1.range = 0;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.pushFactor = 16;
_local1.maxCombo = 4;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "Fire Axe";
_local1.desc = "It has a pick-shaped pointed poll";
_local1.killsToUnlock = 550;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.CONTACT;
_local1.torso_group = 2;
_local1.fire_group = Globals.FIRE_GROUP_MELEE;
_local1.index = 29;
_local1.automatic = false;
_local1.delay = 100;
_local1.damage = 3;
_local1.ammo = false;
_local1.ammo_type = 0;
_local1.max_ammo = 0;
_local1.current_ammo = 0;
_local1.range = 0;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.pushFactor = 50;
_local1.maxCombo = 4;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "Censored weapon";
_local1.desc = "***CENSORED*** ***CENSORED*** ***CENSORED*** ***CENSORED***";
_local1.special = "Extra points per kill";
_local1.killsToUnlock = 2750;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.CONTACT;
_local1.torso_group = 2;
_local1.fire_group = Globals.FIRE_GROUP_MELEE;
_local1.index = 30;
_local1.automatic = false;
_local1.delay = 100;
_local1.damage = 8;
_local1.ammo = false;
_local1.ammo_type = 0;
_local1.max_ammo = 0;
_local1.current_ammo = 0;
_local1.range = 0;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.pushFactor = 50;
_local1.maxCombo = 3;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "Bat";
_local1.desc = "A nice soft wooden bat";
_local1.killsToUnlock = 10;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.CONTACT;
_local1.torso_group = 2;
_local1.fire_group = Globals.FIRE_GROUP_MELEE;
_local1.index = 31;
_local1.automatic = false;
_local1.delay = 100;
_local1.damage = 1;
_local1.ammo = false;
_local1.ammo_type = 0;
_local1.max_ammo = 0;
_local1.current_ammo = 0;
_local1.range = 0;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.pushFactor = 50;
_local1.maxCombo = 2;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "Hot Dog Fork";
_local1.desc = "A delicious but not very lethal hot dog sausage";
_local1.killsToUnlock = 0;
_local1.locked = false;
_local1.fav = false;
_local1.group = Globals.CONTACT;
_local1.torso_group = 2;
_local1.fire_group = Globals.FIRE_GROUP_MELEE;
_local1.index = 32;
_local1.automatic = false;
_local1.delay = 100;
_local1.damage = 0.5;
_local1.ammo = false;
_local1.ammo_type = 0;
_local1.max_ammo = 0;
_local1.current_ammo = 0;
_local1.range = 0;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.pushFactor = 50;
_local1.maxCombo = 2;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "Ice Cream";
_local1.desc = "The best 8 flavor corn ice cream";
_local1.special = "No Damage. Freeze the enemy";
_local1.killsToUnlock = 2000;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.CONTACT;
_local1.torso_group = 2;
_local1.fire_group = Globals.FIRE_GROUP_MELEE;
_local1.tipo = Globals.EXTINGUISHER;
_local1.index = 33;
_local1.automatic = false;
_local1.delay = 100;
_local1.damage = 3000;
_local1.damageOnImpact = false;
_local1.ammo = false;
_local1.ammo_type = 0;
_local1.max_ammo = 0;
_local1.current_ammo = 0;
_local1.range = 0;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.pushFactor = 50;
_local1.maxCombo = 2;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "Lightsaber";
_local1.desc = "I can feel the force...";
_local1.killsToUnlock = 1500;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.CONTACT;
_local1.torso_group = 2;
_local1.fire_group = Globals.FIRE_GROUP_MELEE;
_local1.index = 34;
_local1.automatic = false;
_local1.delay = 100;
_local1.damage = 5;
_local1.ammo = false;
_local1.ammo_type = 0;
_local1.max_ammo = 0;
_local1.current_ammo = 0;
_local1.range = 0;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.pushFactor = 50;
_local1.maxCombo = 4;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "Riding Crop";
_local1.desc = "Bad bad zombies must be spanked very hard";
_local1.killsToUnlock = 60;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.CONTACT;
_local1.torso_group = 2;
_local1.fire_group = Globals.FIRE_GROUP_MELEE;
_local1.index = 35;
_local1.automatic = false;
_local1.delay = 100;
_local1.damage = 1.5;
_local1.ammo = false;
_local1.ammo_type = 0;
_local1.max_ammo = 0;
_local1.current_ammo = 0;
_local1.range = 0;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.pushFactor = 50;
_local1.maxCombo = 3;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "Bone";
_local1.desc = "A carved inscription says: 100% dinosaur femur";
_local1.killsToUnlock = 200;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.CONTACT;
_local1.torso_group = 2;
_local1.fire_group = Globals.FIRE_GROUP_MELEE;
_local1.index = 36;
_local1.automatic = false;
_local1.delay = 100;
_local1.damage = 2;
_local1.ammo = false;
_local1.ammo_type = 0;
_local1.max_ammo = 0;
_local1.current_ammo = 0;
_local1.range = 0;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.pushFactor = 50;
_local1.maxCombo = 3;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "Sponsword";
_local1.desc = "A shiny sword courtesy of our sponsor!";
_local1.killsToUnlock = 350;
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.CONTACT;
_local1.torso_group = 2;
_local1.fire_group = Globals.FIRE_GROUP_MELEE;
_local1.index = 37;
_local1.automatic = false;
_local1.delay = 100;
_local1.damage = 2.5;
_local1.ammo = false;
_local1.ammo_type = 0;
_local1.max_ammo = 0;
_local1.current_ammo = 0;
_local1.range = 0;
_local1.countDown = 0;
_local1.animFrame = "";
_local1.pushFactor = 50;
_local1.maxCombo = 4;
weaponList.push(_local1);
_local1 = new Weapon();
_local1.name = "Pastel";
_local1.locked = true;
_local1.fav = false;
_local1.group = Globals.THROW;
_local1.index = 0;
_local1.automatic = false;
_local1.delay = 1;
_local1.damage = 0;
_local1.playerWeapon = false;
_local1.time_effect = 1;
_local1.damage1 = 15;
_local1.damage_range1 = 25;
_local1.damage2 = 10;
_local1.damage_range2 = 125;
_local1.damage3 = 5;
_local1.damage_range3 = 200;
_local1.speed = 0;
_local1.ammo_offset = 0;
_local1.ammo = false;
_local1.ammo_type = Globals.CAKE_BOMB;
_local1.max_ammo = 0;
_local1.current_ammo = 0;
_local1.range = 0;
_local1.countDown = 0;
_local1.animFrame = "";
weaponList.push(_local1);
}
public function getWeapons(_arg1:Array){
var _local2:int;
var _local3:int;
armas_seleccionadas = new Array(String(Globals.arma_melee), String(Globals.arma_slot1), String(Globals.arma_slot2), String(Globals.arma_slot3), String(Globals.arma_slot4));
_local2 = 0;
while (_local2 < armas_seleccionadas.length) {
_local3 = 0;
while (_local3 < weaponList.length) {
if (weaponList[_local3].name == armas_seleccionadas[_local2]){
_arg1[_local2] = weaponList[_local3];
_local3 = weaponList.length;
};
_local3++;
};
_local2++;
};
}
public static function getInstance():WeaponShop{
if (instance == null){
instance = new WeaponShop(new SingletonEnforcer());
};
return (instance);
}
}
}//package com.tanoku.MoreZombies
class SingletonEnforcer {
private function SingletonEnforcer(){
}
}
Section 131
//Zombie (com.tanoku.MoreZombies.Zombie)
package com.tanoku.MoreZombies {
import com.tanoku.utils.*;
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import flash.events.*;
import flash.display.*;
import gs.*;
import flash.geom.*;
import fl.motion.*;
import flash.utils.*;
import gs.easing.*;
public class Zombie extends MovieClip {
const ARDER:int = 17;
const AMPUTAMITADBACK:int = 22;
const FALLB:int = 10;
const ANDAR:int = 1;
const FALLF:int = 9;
const CHOFTOP:int = 16;
const QUIETO:int = 0;
const CHOFHEAD:int = 11;
const DAN1:int = 5;
const DAN2:int = 6;
const DAN4:int = 8;
const AMPUTACABEZA:int = 12;
const DAN3:int = 7;
const MORDER:int = 4;
const CHOFALL:int = 15;
const PERSEGUIR:int = 2;
const GOLPEAR:int = 3;
const CORRER:int = 19;
const DESINTEGRAR:int = 20;
const DIE_FREEZED:int = 21;
const AMPUTAMITAD:int = 13;
const CONGELAR:int = 18;
const AMPUTAZATOICHI:int = 14;
public var tipo_IA:String;// = ""
public var indice_piernas:int;// = 1
public var rango_tonto:Number;// = 75
private var xvel;// = 0
private var current_animation:String;
public var seguirObjetivoAux:Boolean;// = false
public var enemyList:Array;
public var m_iterations:Number;// = 10
public var indice_pelo:int;// = 1
public var next_atack1:Number;// = 0
public var b:b2Body;
public var indice_torso:int;// = 1
public var layer_ground_bmd:BitmapData;
public var diferencia_altura:Number;// = 50
public var bites:Boolean;// = false
private var yvel;// = 0
public var layer_ground_bm:Bitmap;
public var indice_dinamita:int;// = 1
private var contenedor:MovieClip;
private var objetivo_:MovieClip;
public var dir;// = 0
public var remove:Boolean;// = false
private var zombieManager:ZombieManager;
public var bomb:Boolean;// = false
public var m_timestep:Number;// = 0.0333333333333333
public var damageOnImpact:Boolean;// = true
public var freezed:Boolean;// = false
public var indice_pies:int;// = 1
public var max_ancho:int;
public var logica;
public var can_atack1:Boolean;// = true
public var can_atack2:Boolean;// = true
public var alive:Boolean;// = true
public var rango_player:Number;// = 300
public var initialized:Boolean;// = false
public var can_move:Boolean;// = true
public var m_phys_scale:Number;// = 30
public var myTimer:Timer;
private var turnRate:Number;// = 0.7
public var indice_manos:int;// = 1
public var life:Number;// = 0
private var objetivo_act:MovieClip;
public var agressivity:Number;// = 100
private var weaponShop:WeaponShop;
public var forzar_cambio_skin:Boolean;// = false
private var next_animation:String;
public var rango_objetivo:Number;// = 1000
public var range:int;// = 1
var colorTrans:Number;// = 0
public var m_world:b2World;
public var tipo:Number;// = -1
public var delay_IA:Number;// = 1500
public var posicion_mordiendo:Point;
public var indice_cabeza:int;// = 1
public var unfreeze_time:Number;// = 0
private var depthManager:DepthManager;
public var damage:Number;// = 3
public var deathTime:Number;// = 0
private var _wait_animation:Boolean;// = false
public var bitting:Boolean;// = false
public var achievementManager:AchievementManager;
public var deathDelay:Number;// = 100
public var lastHitTime:Number;// = 0
public var rango_actual:Number;// = 0
private var vel:Number;// = 2
public var soundManager:SoundManager;
public var body:MovieClip;
public var holder:Sprite;
public var player_:MovieClip;
public var delay_atack1:Number;// = 5000
public var altura_cabeza:Number;// = 20
public var layer_ground_mc:MovieClip;
public var max_alto:int;
public var next_IA:Number;// = 0
private var state_:int;// = 0
public function Zombie(_arg1:String="", _arg2:MovieClip=null, _arg3:MovieClip=null, _arg4:MovieClip=null):void{
m_phys_scale = 30;
m_timestep = (1 / 30);
m_iterations = 10;
depthManager = DepthManager.getInstance();
zombieManager = ZombieManager.getInstance();
weaponShop = WeaponShop.getInstance();
soundManager = SoundManager.getInstance();
achievementManager = AchievementManager.getInstance();
dir = 0;
xvel = 0;
yvel = 0;
state_ = 0;
alive = true;
diferencia_altura = 50;
vel = 2;
turnRate = 0.7;
indice_pelo = 1;
indice_cabeza = 1;
indice_torso = 1;
indice_manos = 1;
indice_piernas = 1;
indice_pies = 1;
indice_dinamita = 1;
remove = false;
rango_tonto = 75;
rango_player = 300;
rango_objetivo = 1000;
rango_actual = 0;
can_move = true;
can_atack1 = true;
can_atack2 = true;
agressivity = 100;
delay_atack1 = 5000;
next_atack1 = 0;
delay_IA = 1500;
next_IA = 0;
life = 0;
damage = 3;
deathDelay = 100;
deathTime = 0;
_wait_animation = false;
unfreeze_time = 0;
freezed = false;
bomb = false;
bitting = false;
bites = false;
range = 1;
damageOnImpact = true;
tipo = -1;
tipo_IA = "";
lastHitTime = 0;
seguirObjetivoAux = false;
initialized = false;
holder = new Sprite();
forzar_cambio_skin = false;
altura_cabeza = 20;
colorTrans = 0;
myTimer = new Timer(30);
super();
stop();
objetivo_ = _arg2;
objetivo_act = objetivo_;
player_ = _arg3;
contenedor = _arg4;
initialized = false;
}
private function handleIA_Basico():void{
golpear();
}
public function setupFinished():void{
Juego.eDispatcher.addEventListener(Juego.FINALIZE, finalize);
myTimer.addEventListener("timer", onEnterFrame);
myTimer.start();
body.stop();
depthManager.addObject(this);
}
private function doFollow(_arg1, _arg2){
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
if (((can_move) && ((getTimer() > next_IA)))){
next_IA = (getTimer() + delay_IA);
_local3 = (_arg2.x - _arg1.x);
_local4 = (_arg2.y - _arg1.y);
_local5 = Math.sqrt(((_local3 * _local3) + (_local4 * _local4)));
if (_local5 > 50){
_local6 = ((turnRate * _local3) / _local5);
_local7 = ((turnRate * _local4) / _local5);
_local8 = _local6;
_local9 = _local7;
_local10 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9)));
_local8 = ((vel * _local8) / _local10);
_local9 = ((vel * _local9) / _local10);
xvel = _local8;
yvel = _local9;
};
};
}
public function controlLimitesAreaJuego(){
if ((((x <= width)) || ((x > (max_ancho - width))))){
trace("fuera de limites");
tipo_IA = "basico";
rango_tonto = max_ancho;
rango_player = max_ancho;
rango_objetivo = max_ancho;
};
}
public function finalize(){
remove = true;
if (b != null){
m_world.DestroyBody(b);
b = null;
};
zombieManager.removeZombie(this);
Juego.eDispatcher.removeEventListener(Juego.FINALIZE, finalize);
myTimer.removeEventListener("timer", onEnterFrame);
myTimer.stop();
delete ??getglobalscope
[this];
Globals.deleteNow(this);
}
public function detonate(_arg1:Weapon=null){
var _local2:int;
var _local3:Object;
_local2 = 37;
_local3 = new Grenade();
_local3.damage1 = weaponShop.weaponList[_local2].damage1;
_local3.damage_range1 = weaponShop.weaponList[_local2].damage_range1;
_local3.damage2 = weaponShop.weaponList[_local2].damage2;
_local3.damage_range2 = weaponShop.weaponList[_local2].damage_range2;
_local3.damage3 = weaponShop.weaponList[_local2].damage3;
_local3.damage_range3 = weaponShop.weaponList[_local2].damage_range3;
_local3.time_effect = weaponShop.weaponList[_local2].time_effect;
_local3.playerObject = player_;
_local3.x = x;
_local3.y = y;
_local3.xorig = _local3.x;
_local3.yorig = _local3.y;
_local3.xdest = (_local3.x + weaponShop.weaponList[_local2].vida_pixeles);
_local3.ydest = _local3.y;
_local3.tipo = weaponShop.weaponList[_local2].ammo_type;
_local3.speed = weaponShop.weaponList[_local2].speed;
_local3.damage = weaponShop.weaponList[_local2].damage;
_local3.bulletOffset = weaponShop.weaponList[_local2].ammo_offset;
_local3.vida_pixeles = weaponShop.weaponList[_local2].vida_pixeles;
_local3.targetList = enemyList;
_local3.pushOnImpact = weaponShop.weaponList[_local2].pushOnImpact;
_local3.pushFactor = weaponShop.weaponList[_local2].pushFactor;
_local3.damageOnImpact = weaponShop.weaponList[_local2].damageOnImpact;
_local3.initialize();
_local3.weaponDef = weaponShop.weaponList[_local2];
bomb = false;
}
public function cabeza_zombie(_arg1:String=""):int{
var _local2:int;
_local2 = 0;
switch (_arg1){
case "hombre":
_local2 = ((Math.random() * 7) + 1);
break;
case "mujer":
_local2 = ((Math.random() * 4) + 1);
break;
};
return (_local2);
}
private function handleIA_BasicoFueraRango():void{
state_ = QUIETO;
can_move = false;
}
private function handleIA_Bomba():void{
enemyList = player_.enemyList;
detonate();
alive = false;
deathTime = (getTimer() + deathDelay);
state_ = CHOFALL;
}
public function parte_zombie(_arg1:String=""):int{
var _local2:int;
_local2 = 0;
switch (_arg1){
case "hombre":
_local2 = ((Math.random() * 15) + 1);
break;
case "mujer":
_local2 = ((Math.random() * 5) + 1);
break;
};
return (_local2);
}
private function handleIA_MordedorFueraRango(){
}
public function calcularObjetivoDistancia():Number{
var _local1:Number;
var _local2:Number;
var _local3:Number;
_local1 = (player_.x - x);
_local2 = (player_.y - y);
_local3 = Math.sqrt(((_local1 * _local1) + (_local2 * _local2)));
if ((((_local3 <= rango_player)) && ((seguirObjetivoAux == true)))){
objetivo_act = player_;
rango_actual = rango_player;
} else {
objetivo_act = objetivo_;
rango_actual = rango_objetivo;
};
_local1 = (objetivo_act.x - x);
_local2 = (objetivo_act.y - y);
_local3 = Math.sqrt(((_local1 * _local1) + (_local2 * _local2)));
return (_local3);
}
private function handleIA_BombaFueraRango():void{
}
private function handleAnim(){
var _local1:String;
_local1 = "";
switch (state_){
case QUIETO:
xvel = 0;
yvel = 0;
if (((!((current_animation == Globals.IDLE))) && (!(_wait_animation)))){
current_animation = Globals.IDLE;
body.gotoAndStop(current_animation);
};
break;
case ANDAR:
if (((!((current_animation == Globals.WALK))) && (!(_wait_animation)))){
current_animation = Globals.WALK;
body.gotoAndStop(current_animation);
};
break;
case PERSEGUIR:
doFollow(this, objetivo_act);
if (vel > 2){
state_ = CORRER;
if (((!((current_animation == Globals.RUN))) && (!(_wait_animation)))){
current_animation = Globals.RUN;
body.gotoAndStop(current_animation);
};
} else {
if (((!((current_animation == Globals.WALK))) && (!(_wait_animation)))){
current_animation = Globals.WALK;
body.gotoAndStop(current_animation);
};
};
break;
case GOLPEAR:
if (current_animation != Globals.ATACK1){
current_animation = Globals.ATACK1;
body.gotoAndStop(current_animation);
};
break;
case MORDER:
if (current_animation != Globals.ATACK2){
current_animation = Globals.ATACK2;
body.gotoAndStop(current_animation);
};
break;
case DAN1:
if (current_animation != Globals.DAMAGED1){
current_animation = Globals.DAMAGED1;
body.gotoAndStop(current_animation);
};
break;
case DAN2:
if (current_animation != Globals.DAMAGED2){
current_animation = Globals.DAMAGED2;
body.gotoAndStop(current_animation);
};
break;
case DAN3:
if (current_animation != Globals.DAMAGED3){
current_animation = Globals.DAMAGED3;
body.gotoAndStop(current_animation);
};
break;
case DAN4:
if (current_animation != Globals.DAMAGED4){
current_animation = Globals.DAMAGED4;
body.gotoAndStop(current_animation);
};
break;
case FALLF:
if (current_animation != Globals.CAEDELANTE){
_local1 = ("caida_0" + int(((Math.random() * 2) + 1)));
soundManager.playSound(_local1, 0.1, 1);
current_animation = Globals.CAEDELANTE;
body.gotoAndStop(current_animation);
};
break;
case FALLB:
if (current_animation != Globals.CAEDETRAS){
_local1 = ("caida_0" + int(((Math.random() * 2) + 1)));
soundManager.playSound(_local1, 0.1, 1);
current_animation = Globals.CAEDETRAS;
body.gotoAndStop(current_animation);
};
break;
case CHOFHEAD:
if (current_animation != Globals.CHOFHEAD){
_local1 = "head_shot";
soundManager.playSound(_local1, 1, 1);
current_animation = Globals.CHOFHEAD;
body.gotoAndStop(current_animation);
};
break;
case AMPUTACABEZA:
if (current_animation != Globals.AMPUTACABEZA){
_local1 = "amputa_cabeza";
soundManager.playSound(_local1, 1, 1);
current_animation = Globals.AMPUTACABEZA;
body.gotoAndStop(current_animation);
};
break;
case AMPUTAMITAD:
if (current_animation != Globals.AMPUTAMITAD){
_local1 = ("amputa_mitad_0" + int(((Math.random() * 2) + 1)));
soundManager.playSound(_local1, 0.2, 1);
current_animation = Globals.AMPUTAMITAD;
body.gotoAndStop(current_animation);
};
break;
case AMPUTAMITADBACK:
if (current_animation != Globals.AMPUTAMITADBACK){
_local1 = ("amputa_mitad_0" + int(((Math.random() * 2) + 1)));
soundManager.playSound(_local1, 0.2, 1);
current_animation = Globals.AMPUTAMITADBACK;
body.gotoAndStop(current_animation);
};
break;
case AMPUTAZATOICHI:
if (current_animation != Globals.AMPUTAZATOICHI){
_local1 = "zatoichi";
soundManager.playSound(_local1, 1, 1);
_local1 = "head_shot";
soundManager.playSound(_local1, 1, 1);
_local1 = "amputa_cabeza";
soundManager.playSound(_local1, 1, 1);
_local1 = "chorro_sangre";
soundManager.playSound(_local1, 1, 1);
current_animation = Globals.AMPUTAZATOICHI;
body.gotoAndStop(current_animation);
};
break;
case CHOFALL:
if (current_animation != Globals.CHOFALL){
_local1 = "head_shot";
soundManager.playSound(_local1, 1, 1);
current_animation = Globals.CHOFALL;
body.gotoAndStop(current_animation);
};
break;
case CHOFTOP:
if (current_animation != Globals.CHOFTOP){
_local1 = "head_shot";
soundManager.playSound(_local1, 1, 1);
current_animation = Globals.CHOFTOP;
body.gotoAndStop(current_animation);
};
break;
case ARDER:
if (current_animation != Globals.ARDER){
_local1 = "zombie_arde";
soundManager.playSound(_local1, 1, 1);
current_animation = Globals.ARDER;
body.gotoAndStop(current_animation);
};
break;
case CONGELAR:
if (current_animation != Globals.CONGELAR){
current_animation = Globals.CONGELAR;
body.gotoAndStop(current_animation);
};
break;
case DESINTEGRAR:
if (current_animation != Globals.DESINTEGRAR){
current_animation = Globals.DESINTEGRAR;
body.gotoAndStop(current_animation);
};
break;
case DIE_FREEZED:
if (current_animation != Globals.DIE_FREEZED){
current_animation = Globals.DIE_FREEZED;
body.gotoAndStop(current_animation);
soundManager.playSound("ice_break", 1, 1);
};
break;
};
}
public function paint(){
var _local1:Object;
var _local2:Matrix;
var _local3:BitmapData;
var _local4:Bitmap;
body.visible = true;
removeChild(holder);
holder = new Sprite();
addChild(holder);
_local1 = this.getBounds(this);
_local2 = new Matrix();
_local2.translate(-(_local1.x), -(_local1.y));
_local3 = new BitmapData((this.width + 1), (this.height + 1), true, 0);
_local3.draw(this, _local2);
_local4 = new Bitmap(_local3);
_local4.smoothing = true;
holder.addChild(_local4);
body.visible = false;
}
public function brain_explode(_arg1):void{
var _local2:int;
alive = false;
Globals.HITS = (Globals.HITS + 1);
Globals.LAST_HIT = getTimer();
Globals.muertesEspecial = (Globals.muertesEspecial + 1);
Globals.muertesTotal = (Globals.muertesTotal + 1);
_local2 = 25;
if (_local2 != Globals.lastWeaponIndex){
Globals.lastWeaponIndex = _local2;
Globals.lastWeaponKills = 1;
} else {
Globals.lastWeaponKills = (Globals.lastWeaponKills + 1);
};
if (achievementManager.checkAchievement("consecutivas", Globals.lastWeaponKills, Globals.lastWeaponIndex)){
Globals.lastWeaponKills = 0;
player_.interfaz.mostrar_panel_combo(achievementManager.descAchievement);
};
deathTime = (getTimer() + deathDelay);
state_ = CHOFHEAD;
handleAnim();
}
public function freeze(_arg1):void{
if (freezed == false){
Globals.zombiesCongelados = (Globals.zombiesCongelados + 1);
if (achievementManager.checkAchievement("Glacier", Globals.zombiesCongelados)){
Globals.zombiesCongelados = 0;
player_.interfaz.mostrar_panel_combo(achievementManager.descAchievement);
};
soundManager.playSound("freeze", 1, 1);
};
if (bitting){
player_.stop_bite(this);
stop_bite(this);
};
unfreeze_time = (getTimer() + _arg1.damage);
freezed = true;
can_move = false;
state_ = CONGELAR;
_wait_animation = true;
handleAnim();
}
public function recieveDamage(_arg1, _arg2:Boolean=true):Boolean{
var _local3:Boolean;
var _local4:Number;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:Point;
var _local12:String;
var _local13:Number;
var _local14:int;
_local3 = false;
_local10 = 0;
lastHitTime = getTimer();
_local5 = _arg1.tipo;
_local4 = _arg1.damage;
_local8 = _arg1.range;
if (_arg1.damageOnImpact){
Globals.HITS = (Globals.HITS + 1);
Globals.LAST_HIT = getTimer();
if (_local5 == Globals.CONTACT){
life = (life - (_local4 * player_.currentCombo));
} else {
life = (life - _local4);
};
};
if (dir == Globals.DER){
if (_arg1.x < x){
_local6 = Globals.BACK;
} else {
_local6 = Globals.FRONTAL;
};
_local10 = Globals.DER;
} else {
if (_arg1.x < x){
_local6 = Globals.FRONTAL;
} else {
_local6 = Globals.BACK;
};
_local10 = Globals.IZQ;
};
if (_arg2){
if (_arg1.body != undefined){
_local11 = localToLocal(_arg1.body, this.body.hitarea);
} else {
_local11 = localToLocal(_arg1, this.body.hitarea);
};
if (_local11.y <= altura_cabeza){
_local7 = Globals.HEAD;
} else {
_local7 = Globals.BODY;
};
} else {
_local7 = Globals.BODY;
};
if (((((((_arg1.damageOnImpact) && (Globals.SANGRE_ACTIVA))) && ((freezed == false)))) && ((((Globals.CALIDAD == "HIGH")) || ((Globals.CALIDAD == "MEDIUM")))))){
if ((((((((((((((((((_local5 == Globals.BASIC_BULLET)) || ((_local5 == Globals.MEDIUM_BULLET)))) || ((_local5 == Globals.STRONG_BULLET)))) || ((_local5 == Globals.CHAINSAW)))) || ((_local5 == Globals.COLT_PYTHON)))) || ((_local5 == Globals.DESERT_EAGLE)))) || ((_local5 == Globals.SPAS12)))) || ((_local5 == Globals.WINCHESTER)))) || ((_local5 == Globals.MACHINE_GUN)))){
control_salpicadura(_arg1, _local10);
};
};
if (life > 0){
_local3 = false;
can_move = false;
_local9 = (Math.random() * 2);
if (_local5 == Globals.CONTACT){
if (_local6 == Globals.FRONTAL){
if (_local9 == 1){
state_ = DAN1;
} else {
state_ = DAN3;
};
} else {
if (_local9 == 1){
state_ = DAN2;
} else {
state_ = DAN4;
};
};
};
if (bitting == true){
state_ = MORDER;
};
if (freezed){
state_ = CONGELAR;
};
switch (_local5){
case Globals.EXTINGUISHER:
state_ = CONGELAR;
freeze(_arg1);
break;
case Globals.FREEZE_MINE:
state_ = CONGELAR;
freeze(_arg1);
break;
default:
_local12 = "";
_local12 = ("zombie_pain" + int(((Math.random() * 5) + 1)));
soundManager.playSound(_local12, 0.3, 1);
};
} else {
_local3 = true;
alive = false;
Globals.KILLS = (Globals.KILLS + 1);
Globals.ULTIMO_ZOMBIE_MUERTO = getTimer();
_local13 = -1;
if (_arg1.weaponDef != null){
_local13 = (_arg1.weaponDef.index - 1);
} else {
if (_arg1.index != null){
_local13 = (_arg1.index - 1);
};
};
if (_local13 > 0){
if (_local13 != Globals.lastWeaponIndex){
Globals.lastWeaponIndex = _local13;
Globals.lastWeaponKills = 1;
} else {
Globals.lastWeaponKills = (Globals.lastWeaponKills + 1);
};
};
if (achievementManager.checkAchievement("consecutivas", Globals.lastWeaponKills, Globals.lastWeaponIndex)){
Globals.lastWeaponKills = 0;
player_.interfaz.mostrar_panel_combo(achievementManager.descAchievement);
};
if (Globals.Colisiones){
if (b != null){
m_world.DestroyBody(b);
b = null;
};
};
if (bitting == true){
player_.stop_bite(this);
};
deathTime = (getTimer() + deathDelay);
_wait_animation = true;
if (((bomb) && ((freezed == false)))){
enemyList = player_.enemyList;
detonate();
_local5 = Globals.CAKE_BOMB;
state_ = CHOFALL;
};
player_.getPoints(Globals.puntosZombie);
_local14 = 0;
switch (_local5){
case Globals.CONTACT:
Globals.muertesMelee = (Globals.muertesMelee + 1);
Globals.muertesTotal = (Globals.muertesTotal + 1);
switch (player_.currentCombo){
case 1:
if (_local6 == Globals.FRONTAL){
state_ = FALLB;
} else {
state_ = FALLF;
};
break;
case 2:
if (_local6 == Globals.FRONTAL){
state_ = AMPUTAMITAD;
} else {
state_ = AMPUTAMITADBACK;
};
break;
case 3:
state_ = AMPUTACABEZA;
break;
case 4:
state_ = AMPUTAZATOICHI;
break;
default:
if (_local6 == Globals.FRONTAL){
state_ = FALLB;
} else {
state_ = FALLF;
};
};
break;
case Globals.BASIC_BULLET:
Globals.muertesArma = (Globals.muertesArma + 1);
Globals.muertesTotal = (Globals.muertesTotal + 1);
if (_local6 == Globals.FRONTAL){
state_ = FALLB;
} else {
state_ = FALLF;
};
break;
case Globals.COLT_PYTHON:
Globals.muertesArma = (Globals.muertesArma + 1);
Globals.muertesTotal = (Globals.muertesTotal + 1);
if (_local7 == Globals.HEAD){
state_ = CHOFHEAD;
} else {
if (_local6 == Globals.FRONTAL){
state_ = FALLB;
} else {
state_ = FALLF;
};
};
break;
case Globals.DESERT_EAGLE:
Globals.muertesArma = (Globals.muertesArma + 1);
Globals.muertesTotal = (Globals.muertesTotal + 1);
if (_local7 == Globals.HEAD){
state_ = AMPUTACABEZA;
} else {
if (_local6 == Globals.FRONTAL){
state_ = FALLB;
} else {
state_ = FALLF;
};
};
break;
case Globals.SPAS12:
Globals.muertesArma = (Globals.muertesArma + 1);
Globals.muertesTotal = (Globals.muertesTotal + 1);
_local14 = ((Math.random() * 2) + 1);
if (_local14 == 1){
state_ = CHOFTOP;
} else {
if (_local6 == Globals.FRONTAL){
state_ = AMPUTAMITAD;
} else {
state_ = AMPUTAMITADBACK;
};
};
break;
case Globals.WINCHESTER:
Globals.muertesArma = (Globals.muertesArma + 1);
Globals.muertesTotal = (Globals.muertesTotal + 1);
if (_local7 == Globals.HEAD){
state_ = CHOFHEAD;
} else {
if (_local6 == Globals.FRONTAL){
state_ = FALLB;
} else {
state_ = FALLF;
};
};
break;
case Globals.MACHINE_GUN:
Globals.muertesArma = (Globals.muertesArma + 1);
Globals.muertesTotal = (Globals.muertesTotal + 1);
if (_local7 == Globals.HEAD){
state_ = AMPUTACABEZA;
} else {
_local14 = ((Math.random() * 2) + 1);
if (_local14 == 1){
if (_local6 == Globals.FRONTAL){
state_ = FALLB;
} else {
state_ = FALLF;
};
} else {
if (_local6 == Globals.FRONTAL){
state_ = AMPUTAMITAD;
} else {
state_ = AMPUTAMITADBACK;
};
};
};
break;
case Globals.MEDIUM_BULLET:
Globals.muertesArma = (Globals.muertesArma + 1);
Globals.muertesTotal = (Globals.muertesTotal + 1);
if (_local7 == Globals.HEAD){
state_ = AMPUTACABEZA;
} else {
state_ = AMPUTAMITAD;
};
break;
case Globals.STRONG_BULLET:
Globals.muertesArma = (Globals.muertesArma + 1);
Globals.muertesTotal = (Globals.muertesTotal + 1);
if (_local7 == Globals.HEAD){
state_ = CHOFHEAD;
} else {
if (_local6 == Globals.FRONTAL){
state_ = FALLB;
} else {
state_ = FALLF;
};
};
break;
case Globals.BASIC_MISSILE:
Globals.muertesExplosion = (Globals.muertesExplosion + 1);
Globals.muertesTotal = (Globals.muertesTotal + 1);
switch (_local8){
case 1:
state_ = CHOFALL;
break;
case 2:
state_ = CHOFTOP;
break;
case 3:
if (_local6 == Globals.FRONTAL){
state_ = FALLB;
} else {
state_ = FALLF;
};
break;
};
break;
case Globals.PERSONAL_MINE:
Globals.muertesExplosion = (Globals.muertesExplosion + 1);
Globals.muertesTotal = (Globals.muertesTotal + 1);
switch (_local8){
case 1:
state_ = CHOFALL;
break;
default:
if (_local6 == Globals.FRONTAL){
state_ = FALLB;
} else {
state_ = FALLF;
};
};
break;
case Globals.TANK_MINE:
Globals.muertesExplosion = (Globals.muertesExplosion + 1);
Globals.muertesTotal = (Globals.muertesTotal + 1);
switch (_local8){
case 1:
state_ = CHOFALL;
break;
case 2:
state_ = CHOFTOP;
break;
case 3:
if (_local6 == Globals.FRONTAL){
state_ = FALLB;
} else {
state_ = FALLF;
};
break;
};
break;
case Globals.C4_BOMB:
Globals.muertesExplosion = (Globals.muertesExplosion + 1);
Globals.muertesTotal = (Globals.muertesTotal + 1);
switch (_local8){
case 1:
state_ = CHOFALL;
break;
case 2:
state_ = CHOFTOP;
break;
case 3:
if (_local6 == Globals.FRONTAL){
state_ = FALLB;
} else {
state_ = FALLF;
};
break;
};
break;
case Globals.PINEAPPLE_GRENADE:
Globals.muertesExplosion = (Globals.muertesExplosion + 1);
Globals.muertesTotal = (Globals.muertesTotal + 1);
switch (_local8){
case 1:
state_ = CHOFTOP;
break;
default:
if (_local6 == Globals.FRONTAL){
state_ = FALLB;
} else {
state_ = FALLF;
};
};
break;
case Globals.GERMAN_GRENADE:
Globals.muertesExplosion = (Globals.muertesExplosion + 1);
Globals.muertesTotal = (Globals.muertesTotal + 1);
switch (_local8){
case 1:
state_ = CHOFTOP;
break;
default:
if (_local6 == Globals.FRONTAL){
state_ = FALLB;
} else {
state_ = FALLF;
};
};
break;
case Globals.CAKE_BOMB:
Globals.muertesExplosion = (Globals.muertesExplosion + 1);
Globals.muertesTotal = (Globals.muertesTotal + 1);
switch (_local8){
case 1:
state_ = CHOFALL;
break;
case 2:
state_ = CHOFTOP;
break;
case 3:
if (_local6 == Globals.FRONTAL){
state_ = FALLB;
} else {
state_ = FALLF;
};
break;
};
break;
case Globals.CHAINSAW:
Globals.muertesMotosierra = (Globals.muertesMotosierra + 1);
Globals.muertesTotal = (Globals.muertesTotal + 1);
if (_local7 == Globals.HEAD){
state_ = AMPUTACABEZA;
} else {
if (_local6 == Globals.FRONTAL){
state_ = AMPUTAMITAD;
} else {
state_ = AMPUTAMITADBACK;
};
};
break;
case Globals.FLAMETHROWER:
Globals.muertesLanzallamas = (Globals.muertesLanzallamas + 1);
Globals.muertesTotal = (Globals.muertesTotal + 1);
state_ = ARDER;
break;
case Globals.AITSO:
Globals.muertesEspecial = (Globals.muertesEspecial + 1);
Globals.muertesTotal = (Globals.muertesTotal + 1);
state_ = DESINTEGRAR;
break;
case Globals.EXTINGUISHER:
state_ = QUIETO;
break;
};
if (state_ != ARDER){
TweenMax.to(this, 1, {colorMatrixFilter:{colorize:0, amount:0.2, contrast:0.8, brightness:0.8, saturation:0.4, hue:10}});
};
if ((((Globals.CALIDAD == "LOW")) || ((Globals.CALIDAD == "MEDIUM")))){
if (_local6 == Globals.FRONTAL){
state_ = FALLB;
} else {
state_ = FALLF;
};
};
if (freezed){
Globals.muertesEspecial = (Globals.muertesEspecial + 1);
Globals.muertesTotal = (Globals.muertesTotal + 1);
state_ = DIE_FREEZED;
};
};
handleAnim();
return (_local3);
}
function objetivoFueraRango(){
if (getTimer() > next_IA){
xvel = 0;
next_IA = (getTimer() + delay_IA);
};
if (xvel == 0){
if (x < objetivo_.x){
dir = Globals.DER;
xvel = 1;
} else {
dir = Globals.IZQ;
xvel = -1;
};
} else {
if ((((x <= 0)) && ((dir == Globals.IZQ)))){
dir = Globals.DER;
xvel = 1;
};
if ((((x >= max_ancho)) && ((dir == Globals.DER)))){
dir = Globals.IZQ;
xvel = -1;
};
};
state_ = ANDAR;
can_move = true;
switch (tipo_IA){
case "tonto":
handleIA_TontoFueraRango();
break;
case "basico":
handleIA_BasicoFueraRango();
break;
case "mordedor":
handleIA_MordedorFueraRango();
break;
case "bomba":
handleIA_BombaFueraRango();
break;
default:
trace("IA desconocida");
handleIA_TontoFueraRango();
};
}
private function handleIA_TontoFueraRango():void{
var _local1:int;
state_ = QUIETO;
can_move = false;
controlLimitesAreaJuego();
next_IA = (getTimer() + delay_IA);
_local1 = ((Math.random() * 100) + 1);
if (_local1 <= 1){
tipo_IA = "basico";
rango_tonto = max_ancho;
rango_player = max_ancho;
rango_objetivo = max_ancho;
};
}
public function crearColision(_arg1:int){
addCircle(x, y, _arg1);
}
public function onEnterFrame(_arg1:TimerEvent):void{
if (initialized == false){
initialize();
};
if (!Globals.GamePaused){
handleIA();
handleAnim();
update();
};
if ((((Globals.ExitGame == true)) || ((Globals.GameFinished == true)))){
finalize();
};
}
private function update(){
var _local1:b2Vec2;
if (alive){
if (Globals.Colisiones){
};
if (can_move){
if (Globals.Colisiones){
} else {
x = (x + xvel);
if (y < 0){
y = 0;
yvel = 0;
};
if (y > max_alto){
y = max_alto;
yvel = 0;
};
y = (y + yvel);
};
if ((((xvel == 0)) && ((yvel == 0)))){
} else {
if (xvel > 0){
dir = Globals.DER;
} else {
dir = Globals.IZQ;
};
};
if (dir == Globals.DER){
body.scaleX = 1;
};
if (dir == Globals.IZQ){
body.scaleX = -1;
};
} else {
xvel = 0;
yvel = 0;
};
if (Globals.Colisiones){
if (b != null){
if (((!((xvel == 0))) || (!((yvel == 0))))){
b.WakeUp();
};
b.m_linearVelocity.x = xvel;
b.m_linearVelocity.y = yvel;
b.m_sweep.a = 0;
_local1 = b.GetPosition();
if (freezed == false){
x = (_local1.x * m_phys_scale);
y = (_local1.y * m_phys_scale);
};
if (bitting == true){
forzar_posicion(posicion_mordiendo.x, posicion_mordiendo.y);
};
};
};
} else {
if (b != null){
m_world.DestroyBody(b);
b = null;
};
};
}
public function addCircle(_arg1:Number, _arg2:Number, _arg3:Number){
var _local4:b2BodyDef;
var _local5:b2CircleDef;
_local4 = new b2BodyDef();
_local5 = new b2CircleDef();
_local5.filter.categoryBits = Globals.Colision_Zombie;
_local5.filter.maskBits = Globals.Colision_Estatica;
_local5.filter.groupIndex = 2;
_local5.radius = (Math.abs(_arg3) / m_phys_scale);
_local5.density = 2;
_local5.restitution = 0.2;
_local5.friction = 2;
_local4.position.Set((_arg1 / m_phys_scale), (_arg2 / m_phys_scale));
b = m_world.CreateBody(_local4);
b.CreateShape(_local5);
b.SetMassFromShapes();
}
public function unfreeze(){
trace("descogelar zombie");
unfreeze_time = 0;
can_move = true;
freezed = false;
state_ = QUIETO;
_wait_animation = false;
handleAnim();
}
public function mover(_arg1:String="", _arg2:int=0){
var _local3:b2Vec2;
var _local4:Number;
if ((((alive == true)) && ((freezed == false)))){
if (dir == Globals.DER){
} else {
_arg2 = (_arg2 * -1);
};
if (Globals.Colisiones){
if (b != null){
b.WakeUp();
_local3 = b.GetPosition();
_local4 = b.GetAngle();
switch (_arg1){
case "adelante":
_local3.x = (_local3.x + (_arg2 / m_phys_scale));
break;
case "atras":
_local3.x = (_local3.x - (_arg2 / m_phys_scale));
break;
};
b.SetXForm(_local3, _local4);
};
} else {
switch (_arg1){
case "adelante":
x = (x + _arg2);
break;
case "atras":
x = (x - _arg2);
break;
};
};
};
}
public function stop_bite(_arg1):void{
if (bitting == true){
can_move = true;
bitting = false;
state_ = QUIETO;
_wait_animation = false;
handleAnim();
};
}
public function control_salpicadura(_arg1, _arg2){
var _local3:Point;
var _local4:Number;
var _local5:Number;
var _local6:Salpicadura;
_local3 = localToLocal(_arg1.body, parent);
_local4 = 0;
_local5 = (_local3.y - y);
_local6 = new Salpicadura("", x, (y + 1), _local4, _local5, _arg2);
}
private function handleIA_Tonto():void{
state_ = QUIETO;
can_move = false;
golpear();
controlLimitesAreaJuego();
}
public function objetivoEnRango(_arg1){
state_ = PERSEGUIR;
can_move = true;
if (_arg1 < diferencia_altura){
can_move = false;
state_ = QUIETO;
switch (tipo_IA){
case "tonto":
handleIA_Tonto();
break;
case "basico":
handleIA_Basico();
break;
case "mordedor":
handleIA_Mordedor();
break;
case "bomba":
handleIA_Bomba();
break;
default:
trace("IA desconocida");
handleIA_Tonto();
};
};
}
private function handleIA():void{
var _local1:Number;
if (alive){
if ((((((player_.alive == false)) || ((Globals.GameOver == true)))) || ((Globals.ExitGame == true)))){
state_ = QUIETO;
can_move = false;
return;
};
if (_wait_animation == false){
_local1 = 0;
_local1 = calcularObjetivoDistancia();
state_ = QUIETO;
can_move = false;
if (_local1 <= rango_actual){
objetivoEnRango(_local1);
} else {
objetivoFueraRango();
};
};
if (freezed){
if (getTimer() > unfreeze_time){
unfreeze();
};
};
if (forzar_cambio_skin == false){
state_ = DAN4;
forzar_cambio_skin = true;
};
};
}
public function wait_animation(_arg1:Boolean):void{
_wait_animation = _arg1;
if (!_arg1){
current_animation = "";
state_ = -1;
};
}
public function zombieMuerto(){
var _local1:Rectangle;
var _local2:punto_rojo;
var _local3:BitmapData;
var _local4:Bitmap;
var _local5:Point;
if (indice_torso == 20){
Globals.muertesZombiesPayasos = (Globals.muertesZombiesPayasos + 1);
if (achievementManager.checkAchievement("BloodyCircus", Globals.muertesZombiesPayasos)){
Globals.muertesZombiesPayasos = 0;
player_.interfaz.mostrar_panel_combo(achievementManager.descAchievement);
};
};
if ((((Globals.CALIDAD == "HIGH")) || ((Globals.CALIDAD == "MEDIUM")))){
_local1 = getBounds(this);
_local2 = new punto_rojo();
_local2.visible = false;
_local2.x = (x + _local1.left);
_local2.y = (y + _local1.top);
layer_ground_mc.addChild(_local2);
_local3 = ConvertToBitmapData(this, 1);
_local4 = new Bitmap(_local3);
_local5 = localToLocal(_local2, layer_ground_mc);
layer_ground_bmd.copyPixels(_local3, _local3.rect, _local5, null, null, true);
layer_ground_mc.removeChild(_local2);
};
updateAlive(false);
finalize();
}
public function checkHit(_arg1:MovieClip):void{
if (((alive) && (!(Globals.GamePaused)))){
if (_arg1.hitTestObject(player_.body.hitarea)){
player_.recieveDamage(this);
};
if (objetivo_ != player_){
if (_arg1.hitTestObject(objetivo_.body.hitarea)){
objetivo_.recieveDamage(this);
};
};
};
}
public function golpear(){
var _local1:Boolean;
var _local2:Boolean;
var _local3:Number;
_local1 = true;
_local2 = false;
if (tipo_IA == "tonto"){
_local1 = false;
};
if (_local1 == true){
_local2 = true;
} else {
if ((((dir == Globals.DER)) && ((objetivo_act.x >= x)))){
_local2 = true;
};
if ((((dir == Globals.IZQ)) && ((objetivo_act.y <= y)))){
_local2 = true;
};
};
if ((((getTimer() > next_atack1)) && (_local2))){
next_atack1 = (getTimer() + delay_atack1);
_local3 = (Math.random() * 100);
if (_local3 <= agressivity){
state_ = GOLPEAR;
if (objetivo_act.x >= x){
dir = Globals.DER;
body.scaleX = 1;
} else {
dir = Globals.IZQ;
body.scaleX = -1;
};
};
};
}
function takeSnapshot(_arg1:MovieClip):BitmapData{
var _local2:BitmapData;
_local2 = new BitmapData(_arg1.width, _arg1.height, true, 0);
_local2.draw(_arg1, new Matrix(), new ColorTransform(), "normal");
return (_local2);
}
public function updateAlive(_arg1:Boolean){
alive = _arg1;
zombieManager.actualizaListaZombies();
}
function ConvertToBitmapData(_arg1:DisplayObject, _arg2:Number=1):BitmapData{
var _local3:BitmapData;
var _local4:Rectangle;
var _local5:Matrix;
_local3 = new BitmapData(_arg1.width, _arg1.height, true, 0);
_local4 = _arg1.getBounds(_arg1);
_local5 = new Matrix();
_local5.translate(-(_local4.x), -(_local4.y));
_local5.scale(_arg2, _arg2);
_local3.draw(_arg1, _local5);
return (_local3);
}
public function initialize():void{
var _local1:int;
var _local2:Number;
var _local3:int;
var _local4:int;
var _local5:Number;
life = Globals.Z_VIDA;
if (life > 100){
life = 100;
};
state_ = QUIETO;
dir = Globals.DER;
if (Globals.Z_VELOCIDAD_MAX == Globals.Z_VELOCIDAD_MIN){
vel = Globals.Z_VELOCIDAD_MAX;
} else {
vel = (Math.random() * (Globals.Z_VELOCIDAD_MAX - Globals.Z_VELOCIDAD_MIN));
vel = (vel + Globals.Z_VELOCIDAD_MIN);
};
damage = Globals.Z_DAMAGE;
if ((Math.random() * 10) > 5){
};
alive = true;
remove = false;
bomb = false;
bites = false;
indice_dinamita = 1;
_local1 = 1;
if (Globals.ARRAY_P_IA.length > 0){
_local3 = (Math.random() * Globals.ARRAY_P_IA.length);
_local1 = Globals.ARRAY_P_IA[_local3];
};
switch (_local1){
case 1:
tipo_IA = "tonto";
break;
case 2:
tipo_IA = "basico";
break;
case 3:
tipo_IA = "basico";
break;
case 4:
tipo_IA = "bomba";
break;
default:
tipo_IA = "basico";
};
rango_player = 100;
rango_objetivo = max_ancho;
switch (tipo_IA){
case "tonto":
rango_tonto = diferencia_altura;
rango_player = rango_tonto;
rango_objetivo = rango_tonto;
_local4 = ((Math.random() * 100) + 1);
if (_local4 >= 50){
dir = Globals.DER;
} else {
dir = Globals.IZQ;
};
controlLimitesAreaJuego();
break;
case "basico":
break;
case "mordedor":
vel = (vel * 1.5);
bites = true;
break;
case "bomba":
vel = (vel / 1.5);
bomb = true;
indice_dinamita = 2;
break;
};
if ((Math.random() * 100) > 50){
seguirObjetivoAux = true;
} else {
seguirObjetivoAux = false;
};
if (dir == Globals.DER){
body.scaleX = 1;
};
if (dir == Globals.IZQ){
body.scaleX = -1;
};
_local2 = ((Math.random() * 100) + 1);
if (_local2 <= 30){
_local2 = (((Math.random() * 10) + 1) + 15);
if (_local2 == 16){
indice_cabeza = cabeza_zombie("mujer");
} else {
indice_cabeza = cabeza_zombie("hombre");
};
indice_pelo = _local2;
indice_torso = _local2;
indice_piernas = _local2;
} else {
_local5 = ((Math.random() * 100) + 1);
if (_local5 <= 30){
_local2 = parte_zombie("mujer");
indice_cabeza = cabeza_zombie("mujer");
} else {
_local2 = parte_zombie("hombre");
indice_cabeza = cabeza_zombie("hombre");
};
indice_pelo = _local2;
indice_torso = _local2;
indice_piernas = _local2;
};
indice_manos = ((Math.random() * 2) + 1);
indice_pies = 1;
initialized = true;
addChild(holder);
logica.eDispatcher.addEventListener("loose", LogicaLoose);
if (b == null){
crearColision(zombieManager.radio_colision);
};
}
private function handleIA_Mordedor():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local1 = (player_.x - x);
_local2 = (player_.y - y);
_local3 = Math.sqrt(((_local1 * _local1) + (_local2 * _local2)));
if (_local3 > diferencia_altura){
objetivo_act = objetivo_;
golpear();
return (false);
};
objetivo_act = player_;
_local4 = (y - player_.y);
_local5 = (diferencia_altura / 3);
if (_local4 < 0){
_local4 = (_local4 * -1);
};
if (((((bites) && ((alive == true)))) && ((freezed == false)))){
_local6 = (getTimer() - lastHitTime);
_local7 = 2000;
if (_local6 > _local7){
if (_local4 <= _local5){
if ((((player_.bited == false)) && (player_.canBeBitted()))){
_local8 = 0;
_local9 = 0;
bitting = true;
state_ = MORDER;
_local9 = (player_.y - 1);
if (player_.x > x){
_local8 = (player_.x - 60);
body.scaleX = 1;
dir = Globals.DER;
} else {
_local8 = (player_.x + 60);
body.scaleX = -1;
dir = Globals.IZQ;
};
posicion_mordiendo = new Point(_local8, _local9);
forzar_posicion(posicion_mordiendo.x, posicion_mordiendo.y);
player_.bite(this);
} else {
golpear();
};
} else {
golpear();
};
};
} else {
tipo_IA = "basico";
};
return (true);
}
private function LogicaLoose(_arg1:Event):void{
logica.eDispatcher.removeEventListener("loose", LogicaLoose);
body.gotoAndStop("idle");
can_move = false;
state_ = QUIETO;
myTimer.removeEventListener("timer", onEnterFrame);
myTimer.stop();
}
public function forzar_posicion(_arg1, _arg2){
var _local3:b2Vec2;
var _local4:Number;
if ((((alive == true)) && ((freezed == false)))){
if (Globals.Colisiones){
if (b != null){
b.WakeUp();
_local3 = b.GetPosition();
_local4 = b.GetAngle();
_local3.x = (_arg1 / m_phys_scale);
_local3.y = (_arg2 / m_phys_scale);
b.SetXForm(_local3, _local4);
};
} else {
x = _arg1;
y = _arg2;
};
};
}
public function render(){
}
public static function localToLocal(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Point=null):Point{
var _local4:Point;
_local4 = (_arg3) ? _arg3 : new Point();
_local4 = _arg1.localToGlobal(_local4);
_local4 = _arg2.globalToLocal(_local4);
return (_local4);
}
}
}//package com.tanoku.MoreZombies
Section 132
//ZombieManager (com.tanoku.MoreZombies.ZombieManager)
package com.tanoku.MoreZombies {
import Box2D.Collision.Shapes.*;
import Box2D.Common.Math.*;
import Box2D.Dynamics.*;
import Box2D.Collision.*;
import flash.display.*;
import flash.utils.*;
public class ZombieManager {
public var tiempo_respawn:int;// = 0
public var active:Boolean;// = false
public var margen_colision:Number;
public var layer_ground_bm:Bitmap;
public var camaraObj;
public var tipo_respawn:int;// = 0
public var num_zombies_act:int;// = 0
public var m_timestep:Number;// = 0.0333333333333333
public var ancho_mapa:Number;
public var lado_derecho:Boolean;// = false
public var oleada_inicial:int;// = 0
public var alto_mapa:Number;
public var m_world:b2World;
public var logica;
public var layer_mc:MovieClip;
public var m_iterations:Number;// = 10
public var next_tiempo_respawn:int;// = 0
public var datosZombies:Array;
public var max_en_pantalla:int;// = 0
public var playerObj;
private var handleRespawnOn:Boolean;// = true
public var layer_ground_mc:MovieClip;
public var radio_colision:Number;// = 15
private var zombieList:Array;
private var depthManager:DepthManager;
public var layer_ground_bmd:BitmapData;
public var m_phys_scale:Number;// = 30
public var wave_finished:Boolean;// = false
public var objectiveObj;
public static var instance:ZombieManager;
public function ZombieManager(_arg1:SingletonEnforcer){
m_phys_scale = 30;
m_timestep = (1 / 30);
m_iterations = 10;
depthManager = DepthManager.getInstance();
lado_derecho = false;
oleada_inicial = 0;
tiempo_respawn = 0;
next_tiempo_respawn = 0;
max_en_pantalla = 0;
tipo_respawn = 0;
num_zombies_act = 0;
handleRespawnOn = true;
wave_finished = false;
active = false;
radio_colision = 15;
margen_colision = ((Globals.HEIGHT_DIF * 2) + radio_colision);
super();
}
public function recuentoZombies():Number{
var _local1:Number;
var _local2:*;
_local1 = 0;
_local2 = 0;
while (_local2 < zombieList.length) {
if ((zombieList[_local2] instanceof Zombie)){
if (zombieList[_local2].alive == true){
_local1 = (_local1 + 1);
};
};
_local2++;
};
return (_local1);
}
public function set enemyList(_arg1:Array):void{
zombieList = _arg1;
}
public function calculoP_Zombies(){
var _local1:int;
Globals.ARRAY_P_IA = new Array();
_local1 = 0;
while (_local1 < Globals.P_BASICO) {
Globals.ARRAY_P_IA.push(2);
_local1++;
};
_local1 = 0;
while (_local1 < Globals.P_MORDEDOR) {
Globals.ARRAY_P_IA.push(3);
_local1++;
};
_local1 = 0;
while (_local1 < Globals.P_BOMBA) {
Globals.ARRAY_P_IA.push(4);
_local1++;
};
}
public function finalize(){
instance = null;
}
public function finishWave(){
wave_finished = true;
active = false;
}
public function actualizaListaZombies(){
num_zombies_act = recuentoZombies();
}
public function update(){
if (((active) && (!(Globals.GameEnEspera)))){
if (handleRespawnOn){
handleRespawn();
};
if (((!(handleRespawnOn)) && ((num_zombies_act == 0)))){
finishWave();
};
};
}
public function removeZombie(_arg1:MovieClip):void{
var _local2:*;
_local2 = 0;
while (_local2 < zombieList.length) {
if (zombieList[_local2] == _arg1){
zombieList[_local2].remove = true;
zombieList.splice(_local2, 1);
num_zombies_act = recuentoZombies();
};
_local2++;
};
}
public function handleRespawn():void{
var _local1:Zombie;
var _local2:String;
var _local3:Number;
var _local4:Number;
if (getTimer() > next_tiempo_respawn){
if (datosZombies.length > 0){
if (num_zombies_act < max_en_pantalla){
_local2 = datosZombies.splice((Math.random() * datosZombies.length), 1);
_local1 = new Zombie(_local2, objectiveObj, playerObj, layer_mc);
_local1.logica = logica;
_local1.layer_ground_mc = layer_ground_mc;
_local1.layer_ground_bm = layer_ground_bm;
_local1.layer_ground_bmd = layer_ground_bmd;
_local1.max_ancho = ancho_mapa;
_local1.max_alto = alto_mapa;
switch (tipo_respawn){
case Globals.RANDOM_RESPAWN:
_local1.x = (Math.random() * ancho_mapa);
_local1.y = ((Math.random() * alto_mapa) - margen_colision);
_local1.y = (_local1.y + margen_colision);
break;
case Globals.LATERAL_RESPAWN:
_local1.x = 0;
_local1.y = ((Math.random() * alto_mapa) - margen_colision);
_local1.y = (_local1.y + margen_colision);
break;
case Globals.RADIAL_RESPAWN:
lado_derecho = !(lado_derecho);
if (lado_derecho){
if (Globals.rightLimit == true){
_local3 = (Globals.WIDTH_MAP - playerObj.x);
_local1.x = ((playerObj.x + _local3) + (Math.random() * Globals.RADIAL_DISTANCE));
} else {
_local1.x = ((playerObj.x + 500) + (Math.random() * Globals.RADIAL_DISTANCE));
};
_local1.x = ((camaraObj.x + (camaraObj.width / 2)) + _local1.width);
} else {
if (Globals.leftLimit == true){
_local4 = playerObj.x;
_local1.x = (playerObj.x - (_local3 + (Math.random() * Globals.RADIAL_DISTANCE)));
} else {
_local1.x = (playerObj.x - (500 + (Math.random() * Globals.RADIAL_DISTANCE)));
};
_local1.x = ((camaraObj.x - (camaraObj.width / 2)) - _local1.width);
};
_local1.y = ((Math.random() * alto_mapa) - margen_colision);
_local1.y = (_local1.y + margen_colision);
break;
default:
_local1.x = (Math.random() * ancho_mapa);
_local1.y = ((Math.random() * alto_mapa) - margen_colision);
_local1.y = (_local1.y + margen_colision);
};
if (_local1.y < 15){
_local1.y = 15;
};
if (Globals.Colisiones){
_local1.m_world = m_world;
_local1.m_phys_scale = m_phys_scale;
_local1.m_timestep = m_timestep;
_local1.m_iterations = m_iterations;
_local1.crearColision(radio_colision);
};
_local1.setupFinished();
zombieList.push(_local1);
num_zombies_act = recuentoZombies();
next_tiempo_respawn = (getTimer() + tiempo_respawn);
};
} else {
handleRespawnOn = false;
};
};
}
public function startWave(){
calculoP_Zombies();
num_zombies_act = 0;
next_tiempo_respawn = (getTimer() + tiempo_respawn);
handleRespawnOn = true;
wave_finished = false;
active = true;
}
public static function getInstance():ZombieManager{
if (instance == null){
instance = new ZombieManager(new SingletonEnforcer());
};
return (instance);
}
}
}//package com.tanoku.MoreZombies
class SingletonEnforcer {
private function SingletonEnforcer(){
}
}
Section 133
//Cursor (com.tanoku.utils.Cursor)
package com.tanoku.utils {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.ui.*;
public class Cursor extends MovieClip {
public var Activo:Boolean;// = true
private var p:Point;
private var stageRef:Stage;
public function Cursor(_arg1:Stage=null){
p = new Point();
Activo = true;
super();
}
private function mouseLeaveHandler(_arg1:Event):void{
visible = false;
Mouse.show();
stageRef.addEventListener(MouseEvent.MOUSE_MOVE, mouseReturnHandler, false, 0, true);
}
private function updateStack(_arg1:Event):void{
stageRef.addChild(this);
}
public function desactivarStandar():void{
}
private function updateMouse(_arg1:MouseEvent):void{
if (Activo == true){
visible = true;
} else {
visible = false;
};
x = stageRef.mouseX;
y = stageRef.mouseY;
p.x = x;
p.y = y;
_arg1.updateAfterEvent();
}
private function mouseReturnHandler(_arg1:Event):void{
if (Activo){
visible = true;
};
Mouse.hide();
removeEventListener(MouseEvent.MOUSE_MOVE, mouseReturnHandler);
}
public function activarStandar():void{
}
}
}//package com.tanoku.utils
Section 134
//MusicManager (com.tanoku.utils.MusicManager)
package com.tanoku.utils {
import flash.media.*;
import flash.utils.*;
import flash.net.*;
public class MusicManager {
private var _soundsDict:Dictionary;
private var _sounds:Array;
public var Activo:Boolean;// = true
private static var _instance:MusicManager;
private static var _allowInstance:Boolean;
public function MusicManager(){
Activo = true;
super();
this._soundsDict = new Dictionary(true);
this._sounds = new Array();
if (!MusicManager._allowInstance){
throw (new Error("Error: Use MusicManager.getInstance() instead of the new keyword."));
};
}
public function fadeSound(_arg1:String, _arg2:Number=0, _arg3:Number=1):void{
var _local4:SoundChannel;
_local4 = this._soundsDict[_arg1].channel;
TweenLite.to(_local4, _arg3, {volume:_arg2});
}
public function get sounds():Array{
return (this._sounds);
}
public function Mute():void{
Activo = !(Activo);
if (Activo){
} else {
stopAllSounds();
};
}
public function getSoundDuration(_arg1:String):Number{
return (this._soundsDict[_arg1].sound.length);
}
public function setSoundVolume(_arg1:String, _arg2:Number):void{
var _local3:Object;
var _local4:SoundTransform;
_local3 = this._soundsDict[_arg1];
_local4 = _local3.channel.soundTransform;
_local4.volume = _arg2;
_local3.channel.soundTransform = _local4;
}
public function getSoundVolume(_arg1:String):Number{
return (this._soundsDict[_arg1].channel.soundTransform.volume);
}
public function addLibrarySound(_arg1, _arg2:String):Boolean{
var _local3:int;
var _local4:Object;
var _local5:Sound;
_local3 = 0;
while (_local3 < this._sounds.length) {
if (this._sounds[_local3].name == _arg2){
return (false);
};
_local3++;
};
_local4 = new Object();
_local5 = new (_arg1);
_local4.name = _arg2;
_local4.sound = _local5;
_local4.channel = new SoundChannel();
_local4.position = 0;
_local4.paused = true;
_local4.volume = 1;
_local4.startTime = 0;
_local4.loops = 0;
_local4.pausedByAll = false;
this._soundsDict[_arg2] = _local4;
this._sounds.push(_local4);
return (true);
}
public function toString():String{
return (getQualifiedClassName(this));
}
public function isSoundPaused(_arg1:String):Boolean{
return (this._soundsDict[_arg1].paused);
}
public function removeAllSounds():void{
var _local1:int;
_local1 = 0;
while (_local1 < this._sounds.length) {
this._sounds[_local1] = null;
_local1++;
};
this._sounds = new Array();
this._soundsDict = new Dictionary(true);
}
public function getSoundPosition(_arg1:String):Number{
return (this._soundsDict[_arg1].channel.position);
}
public function stopAllSounds(_arg1:Boolean=true):void{
var _local2:int;
var _local3:String;
_local2 = 0;
while (_local2 < this._sounds.length) {
_local3 = this._sounds[_local2].name;
if (_arg1){
if (!this._soundsDict[_local3].paused){
this._soundsDict[_local3].pausedByAll = true;
this.stopSound(_local3);
};
} else {
this.stopSound(_local3);
};
_local2++;
};
}
public function removeSound(_arg1:String):void{
var _local2:int;
_local2 = 0;
while (_local2 < this._sounds.length) {
if (this._sounds[_local2].name == _arg1){
this._sounds[_local2] = null;
this._sounds.splice(_local2, 1);
};
_local2++;
};
delete this._soundsDict[_arg1];
}
public function muteAllSounds():void{
var _local1:int;
var _local2:String;
_local1 = 0;
while (_local1 < this._sounds.length) {
_local2 = this._sounds[_local1].name;
this.setSoundVolume(_local2, 0);
_local1++;
};
}
public function stopSound(_arg1:String):void{
var _local2:Object;
_local2 = this._soundsDict[_arg1];
_local2.paused = true;
_local2.channel.stop();
_local2.position = _local2.channel.position;
}
public function pauseAllSounds(_arg1:Boolean=true):void{
var _local2:int;
var _local3:String;
_local2 = 0;
while (_local2 < this._sounds.length) {
_local3 = this._sounds[_local2].name;
if (_arg1){
if (!this._soundsDict[_local3].paused){
this._soundsDict[_local3].pausedByAll = true;
this.pauseSound(_local3);
};
} else {
this.pauseSound(_local3);
};
_local2++;
};
}
public function playAllSounds(_arg1:Boolean=false):void{
var _local2:int;
var _local3:String;
_local2 = 0;
while (_local2 < this._sounds.length) {
_local3 = this._sounds[_local2].name;
if (_arg1){
if (this._soundsDict[_local3].pausedByAll){
this._soundsDict[_local3].pausedByAll = false;
this.playSound(_local3);
};
} else {
this.playSound(_local3);
};
_local2++;
};
}
public function addExternalSound(_arg1:String, _arg2:String, _arg3:Number=1000, _arg4:Boolean=false):Boolean{
var _local5:int;
var _local6:Object;
var _local7:Sound;
_local5 = 0;
while (_local5 < this._sounds.length) {
if (this._sounds[_local5].name == _arg2){
return (false);
};
_local5++;
};
_local6 = new Object();
_local7 = new Sound(new URLRequest(_arg1), new SoundLoaderContext(_arg3, _arg4));
_local6.name = _arg2;
_local6.sound = _local7;
_local6.channel = new SoundChannel();
_local6.position = 0;
_local6.paused = true;
_local6.volume = 1;
_local6.startTime = 0;
_local6.loops = 0;
_local6.pausedByAll = false;
this._soundsDict[_arg2] = _local6;
this._sounds.push(_local6);
return (true);
}
public function unmuteAllSounds():void{
var _local1:int;
var _local2:String;
var _local3:Object;
var _local4:SoundTransform;
_local1 = 0;
while (_local1 < this._sounds.length) {
_local2 = this._sounds[_local1].name;
_local3 = this._soundsDict[_local2];
_local4 = _local3.channel.soundTransform;
_local4.volume = _local3.volume;
_local3.channel.soundTransform = _local4;
_local1++;
};
}
public function isSoundPausedByAll(_arg1:String):Boolean{
return (this._soundsDict[_arg1].pausedByAll);
}
public function getSoundObject(_arg1:String):Sound{
return (this._soundsDict[_arg1].sound);
}
public function pauseSound(_arg1:String):void{
var _local2:Object;
_local2 = this._soundsDict[_arg1];
_local2.paused = true;
_local2.position = _local2.channel.position;
_local2.channel.stop();
}
public function playSound(_arg1:String, _arg2:Number=1, _arg3:Number=0, _arg4:int=0):void{
var _local5:Object;
_local5 = this._soundsDict[_arg1];
_local5.volume = _arg2;
if (Activo){
_local5.volume = _arg2;
_local5.channel.soundTransform.volume = _arg2;
} else {
_local5.volume = 0;
};
_local5.startTime = _arg3;
_local5.loops = _arg4;
if (_local5.paused){
_local5.channel = _local5.sound.play(_arg3, _local5.loops, new SoundTransform(_local5.volume));
} else {
_local5.channel = _local5.sound.play(_arg3, _local5.loops, new SoundTransform(_local5.volume));
};
_local5.paused = false;
}
public static function getInstance():MusicManager{
if (MusicManager._instance == null){
MusicManager._allowInstance = true;
MusicManager._instance = new (MusicManager);
MusicManager._allowInstance = false;
};
return (MusicManager._instance);
}
}
}//package com.tanoku.utils
Section 135
//SoundManager (com.tanoku.utils.SoundManager)
package com.tanoku.utils {
import flash.media.*;
import flash.utils.*;
import flash.net.*;
public class SoundManager {
private var _soundsDict:Dictionary;
private var _sounds:Array;
public var Activo:Boolean;// = true
private static var _instance:SoundManager;
private static var _allowInstance:Boolean;
public function SoundManager(){
Activo = true;
super();
this._soundsDict = new Dictionary(true);
this._sounds = new Array();
if (!SoundManager._allowInstance){
throw (new Error("Error: Use SoundManager.getInstance() instead of the new keyword."));
};
}
public function fadeSound(_arg1:String, _arg2:Number=0, _arg3:Number=1):void{
var _local4:SoundChannel;
_local4 = this._soundsDict[_arg1].channel;
TweenLite.to(_local4, _arg3, {volume:_arg2});
}
public function get sounds():Array{
return (this._sounds);
}
public function Mute():void{
Activo = !(Activo);
if (Activo){
unmuteAllSounds();
} else {
muteAllSounds();
};
}
public function getSoundDuration(_arg1:String):Number{
return (this._soundsDict[_arg1].sound.length);
}
public function setSoundVolume(_arg1:String, _arg2:Number):void{
var _local3:Object;
var _local4:SoundTransform;
_local3 = this._soundsDict[_arg1];
_local4 = _local3.channel.soundTransform;
_local4.volume = _arg2;
_local3.channel.soundTransform = _local4;
}
public function getSoundVolume(_arg1:String):Number{
return (this._soundsDict[_arg1].channel.soundTransform.volume);
}
public function addLibrarySound(_arg1, _arg2:String):Boolean{
var _local3:int;
var _local4:Object;
var _local5:Sound;
_local3 = 0;
while (_local3 < this._sounds.length) {
if (this._sounds[_local3].name == _arg2){
return (false);
};
_local3++;
};
_local4 = new Object();
_local5 = new (_arg1);
_local4.name = _arg2;
_local4.sound = _local5;
_local4.channel = new SoundChannel();
_local4.position = 0;
_local4.paused = true;
_local4.volume = 1;
_local4.startTime = 0;
_local4.loops = 0;
_local4.pausedByAll = false;
this._soundsDict[_arg2] = _local4;
this._sounds.push(_local4);
return (true);
}
public function toString():String{
return (getQualifiedClassName(this));
}
public function isSoundPaused(_arg1:String):Boolean{
return (this._soundsDict[_arg1].paused);
}
public function removeAllSounds():void{
var _local1:int;
_local1 = 0;
while (_local1 < this._sounds.length) {
this._sounds[_local1] = null;
_local1++;
};
this._sounds = new Array();
this._soundsDict = new Dictionary(true);
}
public function getSoundPosition(_arg1:String):Number{
return (this._soundsDict[_arg1].channel.position);
}
public function stopAllSounds(_arg1:Boolean=true):void{
var _local2:int;
var _local3:String;
_local2 = 0;
while (_local2 < this._sounds.length) {
_local3 = this._sounds[_local2].name;
if (_arg1){
if (!this._soundsDict[_local3].paused){
this._soundsDict[_local3].pausedByAll = true;
this.stopSound(_local3);
};
} else {
this.stopSound(_local3);
};
_local2++;
};
}
public function removeSound(_arg1:String):void{
var _local2:int;
_local2 = 0;
while (_local2 < this._sounds.length) {
if (this._sounds[_local2].name == _arg1){
this._sounds[_local2] = null;
this._sounds.splice(_local2, 1);
};
_local2++;
};
delete this._soundsDict[_arg1];
}
public function muteAllSounds():void{
var _local1:int;
var _local2:String;
_local1 = 0;
while (_local1 < this._sounds.length) {
_local2 = this._sounds[_local1].name;
this.setSoundVolume(_local2, 0);
_local1++;
};
}
public function stopSound(_arg1:String):void{
var _local2:Object;
_local2 = this._soundsDict[_arg1];
_local2.paused = true;
_local2.channel.stop();
_local2.position = _local2.channel.position;
}
public function pauseAllSounds(_arg1:Boolean=true):void{
var _local2:int;
var _local3:String;
_local2 = 0;
while (_local2 < this._sounds.length) {
_local3 = this._sounds[_local2].name;
if (_arg1){
if (!this._soundsDict[_local3].paused){
this._soundsDict[_local3].pausedByAll = true;
this.pauseSound(_local3);
};
} else {
this.pauseSound(_local3);
};
_local2++;
};
}
public function playAllSounds(_arg1:Boolean=false):void{
var _local2:int;
var _local3:String;
_local2 = 0;
while (_local2 < this._sounds.length) {
_local3 = this._sounds[_local2].name;
if (_arg1){
if (this._soundsDict[_local3].pausedByAll){
this._soundsDict[_local3].pausedByAll = false;
this.playSound(_local3);
};
} else {
this.playSound(_local3);
};
_local2++;
};
}
public function addExternalSound(_arg1:String, _arg2:String, _arg3:Number=1000, _arg4:Boolean=false):Boolean{
var _local5:int;
var _local6:Object;
var _local7:Sound;
_local5 = 0;
while (_local5 < this._sounds.length) {
if (this._sounds[_local5].name == _arg2){
return (false);
};
_local5++;
};
_local6 = new Object();
_local7 = new Sound(new URLRequest(_arg1), new SoundLoaderContext(_arg3, _arg4));
_local6.name = _arg2;
_local6.sound = _local7;
_local6.channel = new SoundChannel();
_local6.position = 0;
_local6.paused = true;
_local6.volume = 1;
_local6.startTime = 0;
_local6.loops = 0;
_local6.pausedByAll = false;
this._soundsDict[_arg2] = _local6;
this._sounds.push(_local6);
return (true);
}
public function unmuteAllSounds():void{
var _local1:int;
var _local2:String;
var _local3:Object;
var _local4:SoundTransform;
_local1 = 0;
while (_local1 < this._sounds.length) {
_local2 = this._sounds[_local1].name;
_local3 = this._soundsDict[_local2];
_local4 = _local3.channel.soundTransform;
_local4.volume = 1;
_local3.channel.soundTransform = _local4;
_local1++;
};
}
public function isSoundPausedByAll(_arg1:String):Boolean{
return (this._soundsDict[_arg1].pausedByAll);
}
public function getSoundObject(_arg1:String):Sound{
return (this._soundsDict[_arg1].sound);
}
public function pauseSound(_arg1:String):void{
var _local2:Object;
_local2 = this._soundsDict[_arg1];
_local2.paused = true;
_local2.position = _local2.channel.position;
_local2.channel.stop();
}
public function playSound(_arg1:String, _arg2:Number=1, _arg3:Number=0, _arg4:int=0):void{
var _local5:Object;
_local5 = this._soundsDict[_arg1];
if (Activo){
_local5.volume = _arg2;
} else {
_local5.volume = 0;
};
_local5.startTime = _arg3;
_local5.loops = _arg4;
if (_local5.paused){
_local5.channel = _local5.sound.play(_local5.position, _local5.loops, new SoundTransform(_local5.volume));
} else {
_local5.channel = _local5.sound.play(_arg3, _local5.loops, new SoundTransform(_local5.volume));
};
_local5.paused = false;
}
public static function getInstance():SoundManager{
if (SoundManager._instance == null){
SoundManager._allowInstance = true;
SoundManager._instance = new (SoundManager);
SoundManager._allowInstance = false;
};
return (SoundManager._instance);
}
}
}//package com.tanoku.utils
Section 136
//TweenLite (com.tanoku.utils.TweenLite)
package com.tanoku.utils {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class TweenLite {
public var delay:Number;
protected var _hasUpdate:Boolean;
public var started:Boolean;
protected var _subTweens:Array;
public var initted:Boolean;
public var startTime:Number;
public var forceActive:Boolean;
public var duration:Number;
protected var _specialVars:Object;
public var target:Object;
protected var _hst:Boolean;
public var gc:Boolean;
protected var _isDisplayObject:Boolean;
public var vars:Object;
public var ease:Function;
public var tweens:Array;
public var combinedTimeScale:Number;
public var initTime:Number;
private static var _timer:Timer = new Timer(2000);
private static var _classInitted:Boolean;
public static var defaultEase:Function = TweenLite.easeOut;
public static var version:Number = 9.24;
public static var masterList:Dictionary = new Dictionary(false);
private static var _sprite:Sprite = new Sprite();
public static var currentTime:uint;
public static var overwriteManager:Object;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
var _local4:int;
super();
if (_arg1 == null){
return;
};
if (!_classInitted){
currentTime = getTimer();
_sprite.addEventListener(Event.ENTER_FRAME, executeAll);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
_timer.addEventListener("timer", killGarbage);
_timer.start();
_classInitted = true;
};
this.vars = _arg3;
this.duration = ((_arg2) || (0.001));
this.delay = ((_arg3.delay) || (0));
this.combinedTimeScale = ((_arg3.timeScale) || (1));
this.forceActive = (((_arg2 == 0)) && ((this.delay == 0)));
this.target = _arg1;
_isDisplayObject = (_arg1 is DisplayObject);
if (!(this.vars.ease is Function)){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
this.ease = this.vars.ease;
if (!isNaN(Number(this.vars.autoAlpha))){
this.vars.alpha = Number(this.vars.autoAlpha);
this.vars.visible = (this.vars.alpha > 0);
};
_specialVars = ((this.vars.isTV)==true) ? this.vars.exposedProps : this.vars;
this.tweens = [];
_subTweens = [];
_hst = (this.initted = false);
this.initTime = currentTime;
this.startTime = (this.initTime + (this.delay * 1000));
_local4 = ((((_arg3.overwrite == undefined)) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
if ((((masterList[_arg1] == undefined)) || (((!((_arg1 == null))) && ((_local4 == 1)))))){
masterList[_arg1] = [];
};
masterList[_arg1].push(this);
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (this.forceActive))){
initTweenVals();
if (this.forceActive){
render((this.startTime + 1));
} else {
render(this.startTime);
};
};
}
protected function addSubTween(_arg1:String, _arg2:Function, _arg3:Object, _arg4:Object, _arg5:Object=null):void{
var _local6:String;
_subTweens[_subTweens.length] = {name:_arg1, proxy:_arg2, target:_arg3, info:_arg5};
for (_local6 in _arg4) {
if (typeof(_arg4[_local6]) == "number"){
this.tweens[this.tweens.length] = [_arg3, _local6, _arg3[_local6], (_arg4[_local6] - _arg3[_local6]), _arg1];
} else {
this.tweens[this.tweens.length] = [_arg3, _local6, _arg3[_local6], Number(_arg4[_local6]), _arg1];
};
};
_hst = true;
}
public function get active():Boolean{
if (this.forceActive){
return (true);
};
if (this.gc){
return (false);
};
if (currentTime >= this.startTime){
this.started = (this.forceActive = true);
if (!this.initted){
initTweenVals();
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
return (true);
//unresolved jump
};
return (false);
}
public function render(_arg1:uint):void{
var _local2:Number;
var _local3:Number;
var _local4:Object;
var _local5:int;
_local2 = ((_arg1 - this.startTime) / 1000);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4[0][_local4[1]] = (_local4[2] + (_local3 * _local4[3]));
_local5--;
};
if (_hst){
_local5 = (_subTweens.length - 1);
while (_local5 > -1) {
_subTweens[_local5].proxy(_subTweens[_local5], _local2);
_local5--;
};
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function clear():void{
this.tweens = [];
_subTweens = [];
this.vars = {};
_hst = (_hasUpdate = false);
}
public function get enabled():Boolean{
return (!(this.gc));
}
public function initTweenVals(_arg1:Boolean=false, _arg2:String=""):void{
var _local3:String;
var _local4:int;
var _local5:Array;
var _local6:ColorTransform;
var _local7:ColorTransform;
var _local8:Object;
if (((!(_arg1)) && (overwriteManager.enabled))){
overwriteManager.manageOverwrites(this, masterList[this.target]);
};
if ((this.target is Array)){
_local5 = ((this.vars.endArray) || ([]));
_local4 = 0;
while (_local4 < _local5.length) {
if (((!((this.target[_local4] == _local5[_local4]))) && (!((this.target[_local4] == undefined))))){
this.tweens[this.tweens.length] = [this.target, _local4.toString(), this.target[_local4], (_local5[_local4] - this.target[_local4]), _local4.toString()];
};
_local4++;
};
} else {
if (((((!((typeof(_specialVars.tint) == "undefined"))) || ((this.vars.removeTint == true)))) && (_isDisplayObject))){
_local6 = this.target.transform.colorTransform;
_local7 = new ColorTransform();
if (_specialVars.alpha != undefined){
_local7.alphaMultiplier = _specialVars.alpha;
delete _specialVars.alpha;
} else {
_local7.alphaMultiplier = this.target.alpha;
};
if (((!((this.vars.removeTint == true))) && (((((!((_specialVars.tint == null))) && (!((_specialVars.tint == ""))))) || ((_specialVars.tint == 0)))))){
_local7.color = _specialVars.tint;
};
addSubTween("tint", tintProxy, {progress:0}, {progress:1}, {target:this.target, color:_local6, endColor:_local7});
};
if (((!((_specialVars.frame == null))) && (_isDisplayObject))){
addSubTween("frame", frameProxy, {frame:this.target.currentFrame}, {frame:_specialVars.frame}, {target:this.target});
};
if (((!(isNaN(this.vars.volume))) && (this.target.hasOwnProperty("soundTransform")))){
addSubTween("volume", volumeProxy, this.target.soundTransform, {volume:this.vars.volume}, {target:this.target});
};
if (((!((_specialVars.visible == null))) && (_isDisplayObject))){
addSubTween("visible", visibleProxy, {}, {}, {tween:this});
};
for (_local3 in _specialVars) {
if ((((((((((((((((((((((((((((((((((((((_local3 == "ease")) || ((_local3 == "delay")))) || ((_local3 == "overwrite")))) || ((_local3 == "onComplete")))) || ((_local3 == "onCompleteParams")))) || ((_local3 == "runBackwards")))) || ((_local3 == "visible")))) || ((_local3 == "autoOverwrite")))) || ((_local3 == "persist")))) || ((_local3 == "onUpdate")))) || ((_local3 == "onUpdateParams")))) || ((_local3 == "autoAlpha")))) || ((((_local3 == "timeScale")) && (!((this.target is TweenLite))))))) || ((_local3 == "onStart")))) || ((_local3 == "onStartParams")))) || ((_local3 == "renderOnStart")))) || ((_local3 == "proxiedEase")))) || ((_local3 == "easeParams")))) || (((_arg1) && (!((_arg2.indexOf(((" " + _local3) + " ")) == -1))))))){
} else {
if (((!(((_isDisplayObject) && ((((((_local3 == "tint")) || ((_local3 == "removeTint")))) || ((_local3 == "frame"))))))) && (!((((_local3 == "volume")) && (this.target.hasOwnProperty("soundTransform"))))))){
if (typeof(_specialVars[_local3]) == "number"){
this.tweens[this.tweens.length] = [this.target, _local3, this.target[_local3], (_specialVars[_local3] - this.target[_local3]), _local3];
} else {
this.tweens[this.tweens.length] = [this.target, _local3, this.target[_local3], Number(_specialVars[_local3]), _local3];
};
};
};
};
};
if (this.vars.runBackwards == true){
_local4 = (this.tweens.length - 1);
while (_local4 > -1) {
_local8 = this.tweens[_local4];
_local8[2] = (_local8[2] + _local8[3]);
_local8[3] = (_local8[3] * -1);
_local4--;
};
};
if (this.vars.onUpdate != null){
_hasUpdate = true;
};
this.initted = true;
}
public function killVars(_arg1:Object):void{
if (overwriteManager.enabled){
overwriteManager.killVars(_arg1, this.vars, this.tweens, _subTweens, []);
};
}
public function complete(_arg1:Boolean=false):void{
if (!_arg1){
if (!this.initted){
initTweenVals();
};
this.startTime = (currentTime - ((this.duration * 1000) / this.combinedTimeScale));
render(currentTime);
return;
};
if (this.vars.persist != true){
this.enabled = false;
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
}
public function set enabled(_arg1:Boolean):void{
var _local2:Array;
var _local3:Boolean;
var _local4:int;
if (_arg1){
if (masterList[this.target] == undefined){
masterList[this.target] = [this];
} else {
_local2 = masterList[this.target];
_local4 = (_local2.length - 1);
while (_local4 > -1) {
if (_local2[_local4] == this){
_local3 = true;
break;
};
_local4--;
};
if (!_local3){
masterList[this.target].push(this);
};
};
} else {
if ((this.target is DisplayObject)){
};
};
this.gc = !(_arg1);
if (this.gc){
this.forceActive = false;
} else {
this.forceActive = this.started;
};
}
public static function frameProxy(_arg1:Object, _arg2:Number):void{
_arg1.info.target.gotoAndStop(Math.round(_arg1.target.frame));
}
public static function removeTween(_arg1:TweenLite, _arg2:Boolean=true):void{
if (_arg1 != null){
if (_arg2){
_arg1.clear();
};
_arg1.enabled = false;
};
}
public static function visibleProxy(_arg1:Object, _arg2:Number):void{
var _local3:TweenLite;
_local3 = _arg1.info.tween;
if (_local3.duration == _arg2){
if (((!((_local3.vars.runBackwards == true))) && ((_local3.ease == _local3.vars.ease)))){
_local3.target.visible = _local3.vars.visible;
};
} else {
if ((((_arg2 == 0)) && ((_local3.vars.runBackwards == true)))){
_local3.target.visible = _local3.vars.visible;
} else {
if (_local3.target.visible != true){
_local3.target.visible = true;
};
};
};
}
public static function killTweensOf(_arg1:Object=null, _arg2:Boolean=false):void{
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
if (((!((_arg1 == null))) && (!((masterList[_arg1] == undefined))))){
_local3 = masterList[_arg1];
_local4 = (_local3.length - 1);
while (_local4 > -1) {
_local5 = _local3[_local4];
if (((_arg2) && (!(_local5.gc)))){
_local5.complete(false);
};
_local5.clear();
_local4--;
};
delete masterList[_arg1];
};
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, overwrite:0}));
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function executeAll(_arg1:Event=null):void{
var _local2:uint;
var _local3:Dictionary;
var _local4:Array;
var _local5:int;
_local2 = (currentTime = getTimer());
_local3 = masterList;
for each (_local4 in _local3) {
_local5 = (_local4.length - 1);
while (_local5 > -1) {
if (((!((_local4[_local5] == null))) && (_local4[_local5].active))){
_local4[_local5].render(_local2);
};
_local5--;
};
};
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function volumeProxy(_arg1:Object, _arg2:Number):void{
_arg1.info.target.soundTransform = _arg1.target;
}
public static function killGarbage(_arg1:TimerEvent):void{
var _local2:Dictionary;
var _local3:Object;
var _local4:Array;
var _local5:int;
_local2 = masterList;
for (_local3 in _local2) {
_local4 = _local2[_local3];
_local5 = (_local4.length - 1);
while (_local5 > -1) {
if (_local4[_local5].gc){
_local4.splice(_local5, 1);
};
_local5--;
};
if (_local4.length == 0){
delete _local2[_local3];
};
};
}
public static function tintProxy(_arg1:Object, _arg2:Number):void{
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
_local3 = _arg1.target.progress;
_local4 = (1 - _local3);
_local5 = _arg1.info.color;
_local6 = _arg1.info.endColor;
_arg1.info.target.transform.colorTransform = new ColorTransform(((_local5.redMultiplier * _local4) + (_local6.redMultiplier * _local3)), ((_local5.greenMultiplier * _local4) + (_local6.greenMultiplier * _local3)), ((_local5.blueMultiplier * _local4) + (_local6.blueMultiplier * _local3)), ((_local5.alphaMultiplier * _local4) + (_local6.alphaMultiplier * _local3)), ((_local5.redOffset * _local4) + (_local6.redOffset * _local3)), ((_local5.greenOffset * _local4) + (_local6.greenOffset * _local3)), ((_local5.blueOffset * _local4) + (_local6.blueOffset * _local3)), ((_local5.alphaOffset * _local4) + (_local6.alphaOffset * _local3)));
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package com.tanoku.utils
Section 137
//Color (fl.motion.Color)
package fl.motion {
import flash.display.*;
import flash.geom.*;
public class Color extends ColorTransform {
private var _tintMultiplier:Number;// = 0
private var _tintColor:Number;// = 0
public function Color(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1, _arg4:Number=1, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0, _arg8:Number=0){
_tintColor = 0;
_tintMultiplier = 0;
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
public function setTint(_arg1:uint, _arg2:Number):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
this._tintColor = _arg1;
this._tintMultiplier = _arg2;
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = (1 - _arg2)));
_local3 = ((_arg1 >> 16) & 0xFF);
_local4 = ((_arg1 >> 8) & 0xFF);
_local5 = (_arg1 & 0xFF);
this.redOffset = Math.round((_local3 * _arg2));
this.greenOffset = Math.round((_local4 * _arg2));
this.blueOffset = Math.round((_local5 * _arg2));
}
public function set tintColor(_arg1:uint):void{
this.setTint(_arg1, this.tintMultiplier);
}
public function get brightness():Number{
return ((this.redOffset) ? (1 - this.redMultiplier) : (this.redMultiplier - 1));
}
private function deriveTintColor():uint{
var _local1:Number;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
_local1 = (1 / this.tintMultiplier);
_local2 = Math.round((this.redOffset * _local1));
_local3 = Math.round((this.greenOffset * _local1));
_local4 = Math.round((this.blueOffset * _local1));
_local5 = (((_local2 << 16) | (_local3 << 8)) | _local4);
return (_local5);
}
public function get tintMultiplier():Number{
return (this._tintMultiplier);
}
public function get tintColor():uint{
return (this._tintColor);
}
public function set brightness(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (_arg1 > 1){
_arg1 = 1;
} else {
if (_arg1 < -1){
_arg1 = -1;
};
};
_local2 = (1 - Math.abs(_arg1));
_local3 = 0;
if (_arg1 > 0){
_local3 = (_arg1 * 0xFF);
};
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = _local2));
this.redOffset = (this.greenOffset = (this.blueOffset = _local3));
}
public function set tintMultiplier(_arg1:Number):void{
this.setTint(this.tintColor, _arg1);
}
private function parseXML(_arg1:XML=null):Color{
var _local2:XML;
var _local3:XML;
var _local4:String;
var _local5:uint;
if (!_arg1){
return (this);
};
_local2 = _arg1.elements()[0];
if (!_local2){
return (this);
};
for each (_local3 in _local2.attributes()) {
_local4 = _local3.localName();
if (_local4 == "tintColor"){
_local5 = (Number(_local3.toString()) as uint);
this.tintColor = _local5;
} else {
this[_local4] = Number(_local3.toString());
};
};
return (this);
}
public static function interpolateColor(_arg1:uint, _arg2:uint, _arg3:Number):uint{
var _local4:Number;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:uint;
var _local14:uint;
var _local15:uint;
var _local16:uint;
var _local17:uint;
_local4 = (1 - _arg3);
_local5 = ((_arg1 >> 24) & 0xFF);
_local6 = ((_arg1 >> 16) & 0xFF);
_local7 = ((_arg1 >> 8) & 0xFF);
_local8 = (_arg1 & 0xFF);
_local9 = ((_arg2 >> 24) & 0xFF);
_local10 = ((_arg2 >> 16) & 0xFF);
_local11 = ((_arg2 >> 8) & 0xFF);
_local12 = (_arg2 & 0xFF);
_local13 = ((_local5 * _local4) + (_local9 * _arg3));
_local14 = ((_local6 * _local4) + (_local10 * _arg3));
_local15 = ((_local7 * _local4) + (_local11 * _arg3));
_local16 = ((_local8 * _local4) + (_local12 * _arg3));
_local17 = ((((_local13 << 24) | (_local14 << 16)) | (_local15 << 8)) | _local16);
return (_local17);
}
public static function interpolateTransform(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{
var _local4:Number;
var _local5:ColorTransform;
_local4 = (1 - _arg3);
_local5 = new ColorTransform(((_arg1.redMultiplier * _local4) + (_arg2.redMultiplier * _arg3)), ((_arg1.greenMultiplier * _local4) + (_arg2.greenMultiplier * _arg3)), ((_arg1.blueMultiplier * _local4) + (_arg2.blueMultiplier * _arg3)), ((_arg1.alphaMultiplier * _local4) + (_arg2.alphaMultiplier * _arg3)), ((_arg1.redOffset * _local4) + (_arg2.redOffset * _arg3)), ((_arg1.greenOffset * _local4) + (_arg2.greenOffset * _arg3)), ((_arg1.blueOffset * _local4) + (_arg2.blueOffset * _arg3)), ((_arg1.alphaOffset * _local4) + (_arg2.alphaOffset * _arg3)));
return (_local5);
}
public static function fromXML(_arg1:XML):Color{
return (Color(new (Color).parseXML(_arg1)));
}
}
}//package fl.motion
Section 138
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
public var begin:Number;// = NAN
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var change:Number;// = NAN
private var _finish:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
isPlaying = false;
obj = null;
prop = "";
func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
begin = NaN;
change = NaN;
useSeconds = false;
prevTime = NaN;
prevPos = NaN;
looping = false;
_duration = NaN;
_time = NaN;
_fps = NaN;
_position = NaN;
_startTime = NaN;
_intervalID = 0;
_finish = NaN;
_timer = null;
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean;
_local2 = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 139
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var time:Number;// = NAN
public var position:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_LOOP:String = "motionLoop";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_RESUME:String = "motionResume";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
time = NaN;
position = NaN;
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 140
//Back (gs.easing.Back)
package gs.easing {
public class Back {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) - _arg5))) + _arg2));
};
_arg1 = (_arg1 - 2);
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 2)) + _arg2));
}
}
}//package gs.easing
Section 141
//TweenEvent (gs.events.TweenEvent)
package gs.events {
import flash.events.*;
public class TweenEvent extends Event {
public var info:Object;
public static const UPDATE:String = "update";
public static const START:String = "start";
public static const version:Number = 0.9;
public static const COMPLETE:String = "complete";
public function TweenEvent(_arg1:String, _arg2:Object=null, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.info = _arg2;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.info, this.bubbles, this.cancelable));
}
}
}//package gs.events
Section 142
//AutoAlphaPlugin (gs.plugins.AutoAlphaPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class AutoAlphaPlugin extends TweenPlugin {
protected var _tweenVisible:Boolean;
protected var _tween:TweenLite;
protected var _visible:Boolean;
protected var _target:Object;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function AutoAlphaPlugin(){
this.propName = "autoAlpha";
this.overwriteProps = ["alpha", "visible"];
this.onComplete = onCompleteTween;
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
if (((!((_target.visible == true))) && (_tweenVisible))){
_target.visible = true;
};
}
public function onCompleteTween():void{
if (((((_tweenVisible) && (!((_tween.vars.runBackwards == true))))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_tween = _arg3;
_visible = Boolean(!((_arg2 == 0)));
_tweenVisible = true;
addTween(_arg1, "alpha", _arg1.alpha, _arg2, "alpha");
return (true);
}
override public function killProps(_arg1:Object):void{
super.killProps(_arg1);
_tweenVisible = !(Boolean(("visible" in _arg1)));
}
}
}//package gs.plugins
Section 143
//BevelFilterPlugin (gs.plugins.BevelFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class BevelFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BevelFilterPlugin(){
this.propName = "bevelFilter";
this.overwriteProps = ["bevelFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = BevelFilter;
initFilter(_arg2, new BevelFilter(0, 0, 0xFFFFFF, 0.5, 0, 0.5, 2, 2, 0, ((_arg2.quality) || (2))));
return (true);
}
}
}//package gs.plugins
Section 144
//BezierPlugin (gs.plugins.BezierPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class BezierPlugin extends TweenPlugin {
protected var _future:Object;
protected var _orient:Boolean;
protected var _orientData:Array;
protected var _beziers:Object;
protected var _target:Object;
protected static const _RAD2DEG:Number = 57.2957795130823;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function BezierPlugin(){
_future = {};
super();
this.propName = "bezier";
this.overwriteProps = [];
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:String;
var _local4:Object;
var _local5:Number;
var _local6:uint;
var _local7:Number;
var _local8:int;
var _local9:Object;
var _local10:Boolean;
var _local11:Number;
var _local12:Number;
var _local13:Array;
var _local14:Number;
if (_arg1 == 1){
for (_local3 in _beziers) {
_local2 = (_beziers[_local3].length - 1);
_target[_local3] = _beziers[_local3][_local2][2];
};
} else {
for (_local3 in _beziers) {
_local6 = _beziers[_local3].length;
if (_arg1 < 0){
_local2 = 0;
} else {
if (_arg1 >= 1){
_local2 = (_local6 - 1);
} else {
_local2 = int((_local6 * _arg1));
};
};
_local5 = ((_arg1 - (_local2 * (1 / _local6))) * _local6);
_local4 = _beziers[_local3][_local2];
if (this.round){
_local7 = (_local4[0] + (_local5 * (((2 * (1 - _local5)) * (_local4[1] - _local4[0])) + (_local5 * (_local4[2] - _local4[0])))));
_local8 = ((_local7)<0) ? -1 : 1;
_target[_local3] = ((((_local7 % 1) * _local8))>0.5) ? (int(_local7) + _local8) : int(_local7);
} else {
_target[_local3] = (_local4[0] + (_local5 * (((2 * (1 - _local5)) * (_local4[1] - _local4[0])) + (_local5 * (_local4[2] - _local4[0])))));
};
};
};
if (_orient){
_local9 = _target;
_local10 = this.round;
_target = _future;
this.round = false;
_orient = false;
this.changeFactor = (_arg1 + 0.01);
_target = _local9;
this.round = _local10;
_orient = true;
_local2 = 0;
while (_local2 < _orientData.length) {
_local13 = _orientData[_local2];
_local14 = ((_local13[3]) || (0));
_local11 = (_future[_local13[0]] - _target[_local13[0]]);
_local12 = (_future[_local13[1]] - _target[_local13[1]]);
_target[_local13[2]] = ((Math.atan2(_local12, _local11) * _RAD2DEG) + _local14);
_local2++;
};
};
}
protected function init(_arg1:TweenLite, _arg2:Array, _arg3:Boolean):void{
var _local4:Object;
var _local5:int;
var _local6:String;
_target = _arg1.target;
if (_arg1.exposedVars.orientToBezier == true){
_orientData = [["x", "y", "rotation", 0]];
_orient = true;
} else {
if ((_arg1.exposedVars.orientToBezier is Array)){
_orientData = _arg1.exposedVars.orientToBezier;
_orient = true;
};
};
_local4 = {};
_local5 = 0;
while (_local5 < _arg2.length) {
for (_local6 in _arg2[_local5]) {
if (_local4[_local6] == undefined){
_local4[_local6] = [_arg1.target[_local6]];
};
if (typeof(_arg2[_local5][_local6]) == "number"){
_local4[_local6].push(_arg2[_local5][_local6]);
} else {
_local4[_local6].push((_arg1.target[_local6] + Number(_arg2[_local5][_local6])));
};
};
_local5++;
};
for (_local6 in _local4) {
this.overwriteProps[this.overwriteProps.length] = _local6;
if (_arg1.exposedVars[_local6] != undefined){
if (typeof(_arg1.exposedVars[_local6]) == "number"){
_local4[_local6].push(_arg1.exposedVars[_local6]);
} else {
_local4[_local6].push((_arg1.target[_local6] + Number(_arg1.exposedVars[_local6])));
};
delete _arg1.exposedVars[_local6];
_local5 = (_arg1.tweens.length - 1);
while (_local5 > -1) {
if (_arg1.tweens[_local5].name == _local6){
_arg1.tweens.splice(_local5, 1);
};
_local5--;
};
};
};
_beziers = parseBeziers(_local4, _arg3);
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg2 is Array)){
return (false);
};
init(_arg3, (_arg2 as Array), false);
return (true);
}
override public function killProps(_arg1:Object):void{
var _local2:String;
for (_local2 in _beziers) {
if ((_local2 in _arg1)){
delete _beziers[_local2];
};
};
super.killProps(_arg1);
}
public static function parseBeziers(_arg1:Object, _arg2:Boolean=false):Object{
var _local3:int;
var _local4:Array;
var _local5:Object;
var _local6:String;
var _local7:Object;
_local7 = {};
if (_arg2){
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 2){
_local5[_local5.length] = [_local4[0], (_local4[1] - ((_local4[2] - _local4[0]) / 4)), _local4[1]];
_local3 = 1;
while (_local3 < (_local4.length - 1)) {
_local5[_local5.length] = [_local4[_local3], (_local4[_local3] + (_local4[_local3] - _local5[(_local3 - 1)][1])), _local4[(_local3 + 1)]];
_local3++;
};
} else {
_local5[_local5.length] = [_local4[0], ((_local4[0] + _local4[1]) / 2), _local4[1]];
};
};
} else {
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 3){
_local5[_local5.length] = [_local4[0], _local4[1], ((_local4[1] + _local4[2]) / 2)];
_local3 = 2;
while (_local3 < (_local4.length - 2)) {
_local5[_local5.length] = [_local5[(_local3 - 2)][2], _local4[_local3], ((_local4[_local3] + _local4[(_local3 + 1)]) / 2)];
_local3++;
};
_local5[_local5.length] = [_local5[(_local5.length - 1)][2], _local4[(_local4.length - 2)], _local4[(_local4.length - 1)]];
} else {
if (_local4.length == 3){
_local5[_local5.length] = [_local4[0], _local4[1], _local4[2]];
} else {
if (_local4.length == 2){
_local5[_local5.length] = [_local4[0], ((_local4[0] + _local4[1]) / 2), _local4[1]];
};
};
};
};
};
return (_local7);
}
}
}//package gs.plugins
Section 145
//BezierThroughPlugin (gs.plugins.BezierThroughPlugin)
package gs.plugins {
import gs.*;
public class BezierThroughPlugin extends BezierPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BezierThroughPlugin(){
this.propName = "bezierThrough";
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg2 is Array)){
return (false);
};
init(_arg3, (_arg2 as Array), true);
return (true);
}
}
}//package gs.plugins
Section 146
//BlurFilterPlugin (gs.plugins.BlurFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class BlurFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BlurFilterPlugin(){
this.propName = "blurFilter";
this.overwriteProps = ["blurFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = BlurFilter;
initFilter(_arg2, new BlurFilter(0, 0, ((_arg2.quality) || (2))));
return (true);
}
}
}//package gs.plugins
Section 147
//ColorMatrixFilterPlugin (gs.plugins.ColorMatrixFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class ColorMatrixFilterPlugin extends FilterPlugin {
protected var _matrix:Array;
protected var _matrixTween:EndArrayPlugin;
public static const API:Number = 1;
public static const VERSION:Number = 1.1;
protected static var _lumG:Number = 0.71516;
protected static var _lumR:Number = 0.212671;
protected static var _idMatrix:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
protected static var _lumB:Number = 0.072169;
public function ColorMatrixFilterPlugin(){
this.propName = "colorMatrixFilter";
this.overwriteProps = ["colorMatrixFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:Object;
var _local5:Array;
_target = _arg1;
_type = ColorMatrixFilter;
_local4 = _arg2;
initFilter({remove:_arg2.remove, index:_arg2.index, addFilter:_arg2.addFilter}, new ColorMatrixFilter(_idMatrix.slice()));
_matrix = ColorMatrixFilter(_filter).matrix;
_local5 = [];
if (((!((_local4.matrix == null))) && ((_local4.matrix is Array)))){
_local5 = _local4.matrix;
} else {
if (_local4.relative == true){
_local5 = _matrix.slice();
} else {
_local5 = _idMatrix.slice();
};
_local5 = setBrightness(_local5, _local4.brightness);
_local5 = setContrast(_local5, _local4.contrast);
_local5 = setHue(_local5, _local4.hue);
_local5 = setSaturation(_local5, _local4.saturation);
_local5 = setThreshold(_local5, _local4.threshold);
if (!isNaN(_local4.colorize)){
_local5 = colorize(_local5, _local4.colorize, _local4.amount);
};
};
_matrixTween = new EndArrayPlugin();
_matrixTween.init(_matrix, _local5);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
_matrixTween.changeFactor = _arg1;
ColorMatrixFilter(_filter).matrix = _matrix;
super.changeFactor = _arg1;
}
public static function setSaturation(_arg1:Array, _arg2:Number):Array{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Array;
if (isNaN(_arg2)){
return (_arg1);
};
_local3 = (1 - _arg2);
_local4 = (_local3 * _lumR);
_local5 = (_local3 * _lumG);
_local6 = (_local3 * _lumB);
_local7 = [(_local4 + _arg2), _local5, _local6, 0, 0, _local4, (_local5 + _arg2), _local6, 0, 0, _local4, _local5, (_local6 + _arg2), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local7, _arg1));
}
public static function setHue(_arg1:Array, _arg2:Number):Array{
var _local3:Number;
var _local4:Number;
var _local5:Array;
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 * (Math.PI / 180));
_local3 = Math.cos(_arg2);
_local4 = Math.sin(_arg2);
_local5 = [((_lumR + (_local3 * (1 - _lumR))) + (_local4 * -(_lumR))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * -(_lumG))), ((_lumB + (_local3 * -(_lumB))) + (_local4 * (1 - _lumB))), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * 0.143)), ((_lumG + (_local3 * (1 - _lumG))) + (_local4 * 0.14)), ((_lumB + (_local3 * -(_lumB))) + (_local4 * -0.283)), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * -((1 - _lumR)))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * _lumG)), ((_lumB + (_local3 * (1 - _lumB))) + (_local4 * _lumB)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
return (applyMatrix(_local5, _arg1));
}
public static function setThreshold(_arg1:Array, _arg2:Number):Array{
var _local3:Array;
if (isNaN(_arg2)){
return (_arg1);
};
_local3 = [(_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function applyMatrix(_arg1:Array, _arg2:Array):Array{
var _local3:Array;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (_arg2);
};
_local3 = [];
_local4 = 0;
_local5 = 0;
_local6 = 0;
while (_local6 < 4) {
_local7 = 0;
while (_local7 < 5) {
if (_local7 == 4){
_local5 = _arg1[(_local4 + 4)];
} else {
_local5 = 0;
};
_local3[(_local4 + _local7)] = (((((_arg1[_local4] * _arg2[_local7]) + (_arg1[(_local4 + 1)] * _arg2[(_local7 + 5)])) + (_arg1[(_local4 + 2)] * _arg2[(_local7 + 10)])) + (_arg1[(_local4 + 3)] * _arg2[(_local7 + 15)])) + _local5);
_local7++;
};
_local4 = (_local4 + 5);
_local6++;
};
return (_local3);
}
public static function colorize(_arg1:Array, _arg2:Number, _arg3:Number=1):Array{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Array;
if (isNaN(_arg2)){
return (_arg1);
};
if (isNaN(_arg3)){
_arg3 = 1;
};
_local4 = (((_arg2 >> 16) & 0xFF) / 0xFF);
_local5 = (((_arg2 >> 8) & 0xFF) / 0xFF);
_local6 = ((_arg2 & 0xFF) / 0xFF);
_local7 = (1 - _arg3);
_local8 = [(_local7 + ((_arg3 * _local4) * _lumR)), ((_arg3 * _local4) * _lumG), ((_arg3 * _local4) * _lumB), 0, 0, ((_arg3 * _local5) * _lumR), (_local7 + ((_arg3 * _local5) * _lumG)), ((_arg3 * _local5) * _lumB), 0, 0, ((_arg3 * _local6) * _lumR), ((_arg3 * _local6) * _lumG), (_local7 + ((_arg3 * _local6) * _lumB)), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local8, _arg1));
}
public static function setBrightness(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = ((_arg2 * 100) - 100);
return (applyMatrix([1, 0, 0, 0, _arg2, 0, 1, 0, 0, _arg2, 0, 0, 1, 0, _arg2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], _arg1));
}
public static function setContrast(_arg1:Array, _arg2:Number):Array{
var _local3:Array;
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 + 0.01);
_local3 = [_arg2, 0, 0, 0, (128 * (1 - _arg2)), 0, _arg2, 0, 0, (128 * (1 - _arg2)), 0, 0, _arg2, 0, (128 * (1 - _arg2)), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
}
}//package gs.plugins
Section 148
//DropShadowFilterPlugin (gs.plugins.DropShadowFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class DropShadowFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function DropShadowFilterPlugin(){
this.propName = "dropShadowFilter";
this.overwriteProps = ["dropShadowFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = DropShadowFilter;
initFilter(_arg2, new DropShadowFilter(0, 45, 0, 0, 0, 0, 1, ((_arg2.quality) || (2)), _arg2.inner, _arg2.knockout, _arg2.hideObject));
return (true);
}
}
}//package gs.plugins
Section 149
//EndArrayPlugin (gs.plugins.EndArrayPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class EndArrayPlugin extends TweenPlugin {
protected var _info:Array;
protected var _a:Array;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function EndArrayPlugin(){
_info = [];
super();
this.propName = "endArray";
this.overwriteProps = ["endArray"];
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:ArrayTweenInfo;
var _local4:Number;
var _local5:int;
if (this.round){
_local2 = (_info.length - 1);
while (_local2 > -1) {
_local3 = _info[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_local5 = ((_local4)<0) ? -1 : 1;
_a[_local3.index] = ((((_local4 % 1) * _local5))>0.5) ? (int(_local4) + _local5) : int(_local4);
_local2--;
};
} else {
_local2 = (_info.length - 1);
while (_local2 > -1) {
_local3 = _info[_local2];
_a[_local3.index] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
};
}
public function init(_arg1:Array, _arg2:Array):void{
var _local3:int;
_a = _arg1;
_local3 = (_arg2.length - 1);
while (_local3 > -1) {
if (((!((_arg1[_local3] == _arg2[_local3]))) && (!((_arg1[_local3] == null))))){
_info[_info.length] = new ArrayTweenInfo(_local3, _a[_local3], (_arg2[_local3] - _a[_local3]));
};
_local3--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (false);
};
init((_arg1 as Array), _arg2);
return (true);
}
}
}//package gs.plugins
Section 150
//FilterPlugin (gs.plugins.FilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
import gs.utils.tween.*;
public class FilterPlugin extends TweenPlugin {
protected var _index:int;
protected var _filter:BitmapFilter;
protected var _type:Class;
protected var _remove:Boolean;
protected var _target:Object;
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:TweenInfo;
var _local4:Array;
_local4 = _target.filters;
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
if (!(_local4[_index] is _type)){
_index = (_local4.length - 1);
_local2 = (_local4.length - 1);
while (_local2 > -1) {
if ((_local4[_local2] is _type)){
_index = _local2;
break;
};
_local2--;
};
};
_local4[_index] = _filter;
_target.filters = _local4;
}
public function onCompleteTween():void{
var _local1:int;
var _local2:Array;
if (_remove){
_local2 = _target.filters;
if (!(_local2[_index] is _type)){
_local1 = (_local2.length - 1);
while (_local1 > -1) {
if ((_local2[_local1] is _type)){
_local2.splice(_local1, 1);
break;
};
_local1--;
};
} else {
_local2.splice(_index, 1);
};
_target.filters = _local2;
};
}
protected function initFilter(_arg1:Object, _arg2:BitmapFilter):void{
var _local3:Array;
var _local4:String;
var _local5:int;
var _local6:HexColorsPlugin;
var _local7:Object;
_local3 = _target.filters;
_index = -1;
if (_arg1.index != null){
_index = _arg1.index;
} else {
_local5 = (_local3.length - 1);
while (_local5 > -1) {
if ((_local3[_local5] is _type)){
_index = _local5;
break;
};
_local5--;
};
};
if ((((((_index == -1)) || ((_local3[_index] == null)))) || ((_arg1.addFilter == true)))){
_index = ((_arg1.index)!=null) ? _arg1.index : _local3.length;
_local3[_index] = _arg2;
_target.filters = _local3;
};
_filter = _local3[_index];
_remove = Boolean((_arg1.remove == true));
if (_remove){
this.onComplete = onCompleteTween;
};
_local7 = ((_arg1.isTV)==true) ? _arg1.exposedVars : _arg1;
for (_local4 in _local7) {
if (((((((((!((_local4 in _filter))) || ((_filter[_local4] == _local7[_local4])))) || ((_local4 == "remove")))) || ((_local4 == "index")))) || ((_local4 == "addFilter")))){
} else {
if ((((((_local4 == "color")) || ((_local4 == "highlightColor")))) || ((_local4 == "shadowColor")))){
_local6 = new HexColorsPlugin();
_local6.initColor(_filter, _local4, _filter[_local4], _local7[_local4]);
_tweens[_tweens.length] = new TweenInfo(_local6, "changeFactor", 0, 1, _local4, false);
} else {
if ((((((((_local4 == "quality")) || ((_local4 == "inner")))) || ((_local4 == "knockout")))) || ((_local4 == "hideObject")))){
_filter[_local4] = _local7[_local4];
} else {
addTween(_filter, _local4, _filter[_local4], _local7[_local4], _local4);
};
};
};
};
}
}
}//package gs.plugins
Section 151
//FramePlugin (gs.plugins.FramePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class FramePlugin extends TweenPlugin {
public var frame:int;
protected var _target:MovieClip;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function FramePlugin(){
this.propName = "frame";
this.overwriteProps = ["frame"];
this.round = true;
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.gotoAndStop(this.frame);
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is MovieClip))) || (isNaN(_arg2)))){
return (false);
};
_target = (_arg1 as MovieClip);
this.frame = _target.currentFrame;
addTween(this, "frame", this.frame, _arg2, "frame");
return (true);
}
}
}//package gs.plugins
Section 152
//GlowFilterPlugin (gs.plugins.GlowFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class GlowFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function GlowFilterPlugin(){
this.propName = "glowFilter";
this.overwriteProps = ["glowFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = GlowFilter;
initFilter(_arg2, new GlowFilter(0xFFFFFF, 0, 0, 0, ((_arg2.strength) || (1)), ((_arg2.quality) || (2)), _arg2.inner, _arg2.knockout));
return (true);
}
}
}//package gs.plugins
Section 153
//HexColorsPlugin (gs.plugins.HexColorsPlugin)
package gs.plugins {
import gs.*;
public class HexColorsPlugin extends TweenPlugin {
protected var _colors:Array;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function HexColorsPlugin(){
this.propName = "hexColors";
this.overwriteProps = [];
_colors = [];
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:Array;
_local2 = (_colors.length - 1);
while (_local2 > -1) {
_local3 = _colors[_local2];
_local3[0][_local3[1]] = ((((_local3[2] + (_arg1 * _local3[3])) << 16) | ((_local3[4] + (_arg1 * _local3[5])) << 8)) | (_local3[6] + (_arg1 * _local3[7])));
_local2--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:String;
for (_local4 in _arg2) {
initColor(_arg1, _local4, uint(_arg1[_local4]), uint(_arg2[_local4]));
};
return (true);
}
override public function killProps(_arg1:Object):void{
var _local2:int;
_local2 = (_colors.length - 1);
while (_local2 > -1) {
if (_arg1[_colors[_local2][1]] != undefined){
_colors.splice(_local2, 1);
};
_local2--;
};
super.killProps(_arg1);
}
public function initColor(_arg1:Object, _arg2:String, _arg3:uint, _arg4:uint):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
if (_arg3 != _arg4){
_local5 = (_arg3 >> 16);
_local6 = ((_arg3 >> 8) & 0xFF);
_local7 = (_arg3 & 0xFF);
_colors[_colors.length] = [_arg1, _arg2, _local5, ((_arg4 >> 16) - _local5), _local6, (((_arg4 >> 8) & 0xFF) - _local6), _local7, ((_arg4 & 0xFF) - _local7)];
this.overwriteProps[this.overwriteProps.length] = _arg2;
};
}
}
}//package gs.plugins
Section 154
//RemoveTintPlugin (gs.plugins.RemoveTintPlugin)
package gs.plugins {
public class RemoveTintPlugin extends TintPlugin {
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function RemoveTintPlugin(){
this.propName = "removeTint";
}
}
}//package gs.plugins
Section 155
//RoundPropsPlugin (gs.plugins.RoundPropsPlugin)
package gs.plugins {
public class RoundPropsPlugin extends TweenPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function RoundPropsPlugin(){
this.propName = "roundProps";
this.overwriteProps = [];
this.round = true;
}
public function add(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number):void{
addTween(_arg1, _arg2, _arg3, (_arg3 + _arg4), _arg2);
this.overwriteProps[this.overwriteProps.length] = _arg2;
}
}
}//package gs.plugins
Section 156
//ShortRotationPlugin (gs.plugins.ShortRotationPlugin)
package gs.plugins {
import gs.*;
public class ShortRotationPlugin extends TweenPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function ShortRotationPlugin(){
this.propName = "shortRotation";
this.overwriteProps = [];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:String;
if (typeof(_arg2) == "number"){
trace("WARNING: You appear to be using the old shortRotation syntax. Instead of passing a number, please pass an object with properties that correspond to the rotations values For example, TweenMax.to(mc, 2, {shortRotation:{rotationX:-170, rotationY:25}})");
return (false);
};
for (_local4 in _arg2) {
initRotation(_arg1, _local4, _arg1[_local4], _arg2[_local4]);
};
return (true);
}
public function initRotation(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number):void{
var _local5:Number;
_local5 = ((_arg4 - _arg3) % 360);
if (((_arg4 - _arg3) % 360) != (_local5 % 180)){
_local5 = ((_local5)<0) ? (_local5 + 360) : (_local5 - 360);
};
addTween(_arg1, _arg2, _arg3, (_arg3 + _local5), _arg2);
this.overwriteProps[this.overwriteProps.length] = _arg2;
}
}
}//package gs.plugins
Section 157
//TintPlugin (gs.plugins.TintPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.geom.*;
import gs.utils.tween.*;
public class TintPlugin extends TweenPlugin {
protected var _ct:ColorTransform;
protected var _ignoreAlpha:Boolean;
protected var _target:DisplayObject;
public static const VERSION:Number = 1.1;
public static const API:Number = 1;
protected static var _props:Array = ["redMultiplier", "greenMultiplier", "blueMultiplier", "alphaMultiplier", "redOffset", "greenOffset", "blueOffset", "alphaOffset"];
public function TintPlugin(){
this.propName = "tint";
this.overwriteProps = ["tint"];
}
override public function set changeFactor(_arg1:Number):void{
var _local2:ColorTransform;
updateTweens(_arg1);
if (_ignoreAlpha){
_local2 = _target.transform.colorTransform;
_ct.alphaMultiplier = _local2.alphaMultiplier;
_ct.alphaOffset = _local2.alphaOffset;
};
_target.transform.colorTransform = _ct;
}
public function init(_arg1:DisplayObject, _arg2:ColorTransform):void{
var _local3:int;
var _local4:String;
_target = _arg1;
_ct = _target.transform.colorTransform;
_local3 = (_props.length - 1);
while (_local3 > -1) {
_local4 = _props[_local3];
if (_ct[_local4] != _arg2[_local4]){
_tweens[_tweens.length] = new TweenInfo(_ct, _local4, _ct[_local4], (_arg2[_local4] - _ct[_local4]), "tint", false);
};
_local3--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:ColorTransform;
if (!(_arg1 is DisplayObject)){
return (false);
};
_local4 = new ColorTransform();
if (((!((_arg2 == null))) && (!((_arg3.exposedVars.removeTint == true))))){
_local4.color = uint(_arg2);
};
_ignoreAlpha = true;
init((_arg1 as DisplayObject), _local4);
return (true);
}
}
}//package gs.plugins
Section 158
//TweenPlugin (gs.plugins.TweenPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class TweenPlugin {
public var overwriteProps:Array;
protected var _tweens:Array;
public var round:Boolean;
public var onComplete:Function;
public var propName:String;
protected var _changeFactor:Number;// = 0
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
public function TweenPlugin(){
_tweens = [];
_changeFactor = 0;
super();
}
protected function updateTweens(_arg1:Number):void{
var _local2:int;
var _local3:TweenInfo;
var _local4:Number;
var _local5:int;
if (this.round){
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_local5 = ((_local4)<0) ? -1 : 1;
_local3.target[_local3.property] = ((((_local4 % 1) * _local5))>0.5) ? (int(_local4) + _local5) : int(_local4);
_local2--;
};
} else {
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
};
}
public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_changeFactor = _arg1;
}
protected function addTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4, _arg5:String=null):void{
var _local6:Number;
if (_arg4 != null){
_local6 = ((typeof(_arg4))=="number") ? (_arg4 - _arg3) : Number(_arg4);
if (_local6 != 0){
_tweens[_tweens.length] = new TweenInfo(_arg1, _arg2, _arg3, _local6, ((_arg5) || (_arg2)), false);
};
};
}
public function killProps(_arg1:Object):void{
var _local2:int;
_local2 = (this.overwriteProps.length - 1);
while (_local2 > -1) {
if ((this.overwriteProps[_local2] in _arg1)){
this.overwriteProps.splice(_local2, 1);
};
_local2--;
};
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
if ((_tweens[_local2].name in _arg1)){
_tweens.splice(_local2, 1);
};
_local2--;
};
}
public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
addTween(_arg1, this.propName, _arg1[this.propName], _arg2, this.propName);
return (true);
}
public function get changeFactor():Number{
return (_changeFactor);
}
public static function activate(_arg1:Array):Boolean{
var _local2:int;
var _local3:Object;
_local2 = (_arg1.length - 1);
while (_local2 > -1) {
_local3 = new (_arg1[_local2]);
TweenLite.plugins[_local3.propName] = _arg1[_local2];
_local2--;
};
return (true);
}
}
}//package gs.plugins
Section 159
//VisiblePlugin (gs.plugins.VisiblePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class VisiblePlugin extends TweenPlugin {
protected var _tween:TweenLite;
protected var _visible:Boolean;
protected var _target:Object;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function VisiblePlugin(){
this.propName = "visible";
this.overwriteProps = ["visible"];
this.onComplete = onCompleteTween;
}
override public function set changeFactor(_arg1:Number):void{
if (_target.visible != true){
_target.visible = true;
};
}
public function onCompleteTween():void{
if (((!((_tween.vars.runBackwards == true))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_tween = _arg3;
_visible = Boolean(_arg2);
return (true);
}
}
}//package gs.plugins
Section 160
//VolumePlugin (gs.plugins.VolumePlugin)
package gs.plugins {
import flash.media.*;
import flash.display.*;
import gs.*;
public class VolumePlugin extends TweenPlugin {
protected var _st:SoundTransform;
protected var _target:Object;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function VolumePlugin(){
this.propName = "volume";
this.overwriteProps = ["volume"];
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.soundTransform = _st;
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((isNaN(_arg2)) || (!(_arg1.hasOwnProperty("soundTransform"))))){
return (false);
};
_target = _arg1;
_st = _target.soundTransform;
addTween(_st, "volume", _st.volume, _arg2, "volume");
return (true);
}
}
}//package gs.plugins
Section 161
//ArrayTweenInfo (gs.utils.tween.ArrayTweenInfo)
package gs.utils.tween {
public class ArrayTweenInfo {
public var change:Number;
public var index:uint;
public var start:Number;
public function ArrayTweenInfo(_arg1:uint, _arg2:Number, _arg3:Number){
this.index = _arg1;
this.start = _arg2;
this.change = _arg3;
}
}
}//package gs.utils.tween
Section 162
//TweenInfo (gs.utils.tween.TweenInfo)
package gs.utils.tween {
public class TweenInfo {
public var start:Number;
public var name:String;
public var change:Number;
public var target:Object;
public var property:String;
public var isPlugin:Boolean;
public function TweenInfo(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Boolean){
this.target = _arg1;
this.property = _arg2;
this.start = _arg3;
this.change = _arg4;
this.name = _arg5;
this.isPlugin = _arg6;
}
}
}//package gs.utils.tween
Section 163
//OverwriteManager (gs.OverwriteManager)
package gs {
import flash.utils.*;
import gs.utils.tween.*;
import flash.errors.*;
public class OverwriteManager {
public static const ALL:int = 1;
public static const NONE:int = 0;
public static const AUTO:int = 2;
public static const CONCURRENT:int = 3;
public static const version:Number = 3.12;
public static var mode:int;
public static var enabled:Boolean;
public static function killVars(_arg1:Object, _arg2:Object, _arg3:Array):void{
var _local4:int;
var _local5:String;
var _local6:TweenInfo;
_local4 = (_arg3.length - 1);
while (_local4 > -1) {
_local6 = _arg3[_local4];
if ((_local6.name in _arg1)){
_arg3.splice(_local4, 1);
} else {
if (((_local6.isPlugin) && ((_local6.name == "_MULTIPLE_")))){
_local6.target.killProps(_arg1);
if (_local6.target.overwriteProps.length == 0){
_arg3.splice(_local4, 1);
};
};
};
_local4--;
};
for (_local5 in _arg1) {
delete _arg2[_local5];
};
}
public static function manageOverwrites(_arg1:TweenLite, _arg2:Array):void{
var _local3:Object;
var _local4:int;
var _local5:Number;
var _local6:Array;
var _local7:int;
var _local8:TweenLite;
var _local9:int;
var _local10:Array;
var _local11:Object;
var _local12:int;
var _local13:TweenInfo;
var _local14:Array;
_local3 = _arg1.vars;
_local4 = ((_local3.overwrite)==undefined) ? mode : int(_local3.overwrite);
if ((((_local4 < 2)) || ((_arg2 == null)))){
return;
};
_local5 = _arg1.startTime;
_local6 = [];
_local9 = -1;
_local7 = (_arg2.length - 1);
while (_local7 > -1) {
_local8 = _arg2[_local7];
if (_local8 == _arg1){
_local9 = _local7;
} else {
if ((((((_local7 < _local9)) && ((_local8.startTime <= _local5)))) && (((_local8.startTime + ((_local8.duration * 1000) / _local8.combinedTimeScale)) > _local5)))){
_local6[_local6.length] = _local8;
};
};
_local7--;
};
if ((((_local6.length == 0)) || ((_arg1.tweens.length == 0)))){
return;
};
if (_local4 == AUTO){
_local10 = _arg1.tweens;
_local11 = {};
_local7 = (_local10.length - 1);
while (_local7 > -1) {
_local13 = _local10[_local7];
if (_local13.isPlugin){
if (_local13.name == "_MULTIPLE_"){
_local14 = _local13.target.overwriteProps;
_local12 = (_local14.length - 1);
while (_local12 > -1) {
_local11[_local14[_local12]] = true;
_local12--;
};
} else {
_local11[_local13.name] = true;
};
_local11[_local13.target.propName] = true;
} else {
_local11[_local13.name] = true;
};
_local7--;
};
_local7 = (_local6.length - 1);
while (_local7 > -1) {
killVars(_local11, _local6[_local7].exposedVars, _local6[_local7].tweens);
_local7--;
};
} else {
_local7 = (_local6.length - 1);
while (_local7 > -1) {
_local6[_local7].enabled = false;
_local7--;
};
};
}
public static function init(_arg1:int=2):int{
if (TweenLite.version < 10.09){
trace("TweenLite warning: Your TweenLite class needs to be updated to work with OverwriteManager (or you may need to clear your ASO files). Please download and install the latest version from http://www.tweenlite.com.");
};
TweenLite.overwriteManager = OverwriteManager;
mode = _arg1;
enabled = true;
return (mode);
}
}
}//package gs
Section 164
//TweenLite (gs.TweenLite)
package gs {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import gs.utils.tween.*;
import gs.plugins.*;
public class TweenLite {
public var delay:Number;
protected var _hasUpdate:Boolean;
protected var _hasPlugins:Boolean;
public var started:Boolean;
public var initted:Boolean;
public var active:Boolean;
public var startTime:Number;
public var target:Object;
public var duration:Number;
public var gc:Boolean;
public var vars:Object;
public var ease:Function;
public var tweens:Array;
public var exposedVars:Object;
public var combinedTimeScale:Number;
public var initTime:Number;
public static const version:Number = 10.092;
private static var _timer:Timer = new Timer(2000);
public static var defaultEase:Function = TweenLite.easeOut;
public static var plugins:Object = {};
public static var currentTime:uint;
public static var masterList:Dictionary = new Dictionary(false);
protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, persist:1, renderOnStart:1, proxiedEase:1, easeParams:1, yoyo:1, loop:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, orientToBezier:1, timeScale:1};
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public static var timingSprite:Sprite = new Sprite();
public static var overwriteManager:Object;
private static var _tlInitted:Boolean;
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
var _local4:int;
super();
if (_arg1 == null){
return;
};
if (!_tlInitted){
TweenPlugin.activate([TintPlugin, RemoveTintPlugin, FramePlugin, AutoAlphaPlugin, VisiblePlugin, VolumePlugin, EndArrayPlugin]);
currentTime = getTimer();
timingSprite.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
_timer.addEventListener("timer", killGarbage, false, 0, true);
_timer.start();
_tlInitted = true;
};
this.vars = _arg3;
this.duration = ((_arg2) || (0.001));
this.delay = ((_arg3.delay) || (0));
this.combinedTimeScale = ((_arg3.timeScale) || (1));
this.active = Boolean((((_arg2 == 0)) && ((this.delay == 0))));
this.target = _arg1;
if (typeof(this.vars.ease) != "function"){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
this.ease = this.vars.ease;
this.exposedVars = ((this.vars.isTV)==true) ? this.vars.exposedVars : this.vars;
this.tweens = [];
this.initTime = currentTime;
this.startTime = (this.initTime + (this.delay * 1000));
_local4 = ((((_arg3.overwrite == undefined)) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
if (((!((_arg1 in masterList))) || ((_local4 == 1)))){
masterList[_arg1] = [this];
} else {
masterList[_arg1].push(this);
};
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (this.active))){
initTweenVals();
if (this.active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
if (((((!((this.exposedVars.visible == null))) && ((this.vars.runBackwards == true)))) && ((this.target is DisplayObject)))){
this.target.visible = this.exposedVars.visible;
};
};
}
public function set enabled(_arg1:Boolean):void{
var _local2:Array;
var _local3:Boolean;
var _local4:int;
if (_arg1){
if (!(this.target in masterList)){
masterList[this.target] = [this];
} else {
_local2 = masterList[this.target];
_local4 = (_local2.length - 1);
while (_local4 > -1) {
if (_local2[_local4] == this){
_local3 = true;
break;
};
_local4--;
};
if (!_local3){
_local2[_local2.length] = this;
};
};
};
this.gc = (_arg1) ? false : true;
if (this.gc){
this.active = false;
} else {
this.active = this.started;
};
}
public function clear():void{
this.tweens = [];
this.vars = (this.exposedVars = {ease:this.vars.ease});
_hasUpdate = false;
}
public function render(_arg1:uint):void{
var _local2:Number;
var _local3:Number;
var _local4:TweenInfo;
var _local5:int;
_local2 = ((_arg1 - this.startTime) * 0.001);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4.target[_local4.property] = (_local4.start + (_local3 * _local4.change));
_local5--;
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
public function activate():void{
this.started = (this.active = true);
if (!this.initted){
initTweenVals();
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
}
public function get enabled():Boolean{
return ((this.gc) ? false : true);
}
public function initTweenVals():void{
var _local1:String;
var _local2:int;
var _local3:*;
var _local4:TweenInfo;
if (((!((this.exposedVars.timeScale == undefined))) && (this.target.hasOwnProperty("timeScale")))){
this.tweens[this.tweens.length] = new TweenInfo(this.target, "timeScale", this.target.timeScale, (this.exposedVars.timeScale - this.target.timeScale), "timeScale", false);
};
for (_local1 in this.exposedVars) {
if ((_local1 in _reservedProps)){
} else {
if ((_local1 in plugins)){
_local3 = new (plugins[_local1]);
if (_local3.onInitTween(this.target, this.exposedVars[_local1], this) == false){
this.tweens[this.tweens.length] = new TweenInfo(this.target, _local1, this.target[_local1], ((typeof(this.exposedVars[_local1]))=="number") ? (this.exposedVars[_local1] - this.target[_local1]) : Number(this.exposedVars[_local1]), _local1, false);
} else {
this.tweens[this.tweens.length] = new TweenInfo(_local3, "changeFactor", 0, 1, ((_local3.overwriteProps.length)==1) ? _local3.overwriteProps[0] : "_MULTIPLE_", true);
_hasPlugins = true;
};
} else {
this.tweens[this.tweens.length] = new TweenInfo(this.target, _local1, this.target[_local1], ((typeof(this.exposedVars[_local1]))=="number") ? (this.exposedVars[_local1] - this.target[_local1]) : Number(this.exposedVars[_local1]), _local1, false);
};
};
};
if (this.vars.runBackwards == true){
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
_local4 = this.tweens[_local2];
this.tweens[_local2].start = (_local4.start + _local4.change);
_local4.change = -(_local4.change);
_local2--;
};
};
if (this.vars.onUpdate != null){
_hasUpdate = true;
};
if (((TweenLite.overwriteManager.enabled) && ((this.target in masterList)))){
overwriteManager.manageOverwrites(this, masterList[this.target]);
};
this.initted = true;
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function killVars(_arg1:Object):void{
if (overwriteManager.enabled){
overwriteManager.killVars(_arg1, this.exposedVars, this.tweens);
};
}
public function complete(_arg1:Boolean=false):void{
var _local2:int;
if (!_arg1){
if (!this.initted){
initTweenVals();
};
this.startTime = (currentTime - ((this.duration * 1000) / this.combinedTimeScale));
render(currentTime);
return;
};
if (_hasPlugins){
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
if (((this.tweens[_local2].isPlugin) && (!((this.tweens[_local2].target.onComplete == null))))){
this.tweens[_local2].target.onComplete();
};
_local2--;
};
};
if (this.vars.persist != true){
this.enabled = false;
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
}
public static function updateAll(_arg1:Event=null):void{
var _local2:uint;
var _local3:Dictionary;
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
_local2 = (currentTime = getTimer());
_local3 = masterList;
for each (_local4 in _local3) {
_local5 = (_local4.length - 1);
while (_local5 > -1) {
_local6 = _local4[_local5];
if (_local6.active){
_local6.render(_local2);
} else {
if (_local6.gc){
_local4.splice(_local5, 1);
} else {
if (_local2 >= _local6.startTime){
_local6.activate();
_local6.render(_local2);
};
};
};
_local5--;
};
};
}
public static function removeTween(_arg1:TweenLite, _arg2:Boolean=true):void{
if (_arg1 != null){
if (_arg2){
_arg1.clear();
};
_arg1.enabled = false;
};
}
public static function killTweensOf(_arg1:Object=null, _arg2:Boolean=false):void{
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
if (((!((_arg1 == null))) && ((_arg1 in masterList)))){
_local3 = masterList[_arg1];
_local4 = (_local3.length - 1);
while (_local4 > -1) {
_local5 = _local3[_local4];
if (((_arg2) && (!(_local5.gc)))){
_local5.complete(false);
};
_local5.clear();
_local4--;
};
delete masterList[_arg1];
};
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
protected static function killGarbage(_arg1:TimerEvent):void{
var _local2:Dictionary;
var _local3:Object;
_local2 = masterList;
for (_local3 in _local2) {
if (_local2[_local3].length == 0){
delete _local2[_local3];
};
};
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, overwrite:0}));
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 165
//TweenMax (gs.TweenMax)
package gs {
import flash.events.*;
import flash.utils.*;
import gs.utils.tween.*;
import gs.plugins.*;
import gs.events.*;
public class TweenMax extends TweenLite implements IEventDispatcher {
protected var _dispatcher:EventDispatcher;
protected var _callbacks:Object;
public var pauseTime:Number;
protected var _repeatCount:Number;
protected var _timeScale:Number;
public static const version:Number = 10.12;
public static var removeTween:Function = TweenLite.removeTween;
private static var _overwriteMode:int = (OverwriteManager.enabled) ? OverwriteManager.mode : OverwriteManager.init();
;
protected static var _pausedTweens:Dictionary = new Dictionary(false);
protected static var _globalTimeScale:Number = 1;
public static var killTweensOf:Function = TweenLite.killTweensOf;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _activatedPlugins:Boolean = TweenPlugin.activate([TintPlugin, RemoveTintPlugin, FramePlugin, AutoAlphaPlugin, VisiblePlugin, VolumePlugin, EndArrayPlugin, HexColorsPlugin, BlurFilterPlugin, ColorMatrixFilterPlugin, BevelFilterPlugin, DropShadowFilterPlugin, GlowFilterPlugin, RoundPropsPlugin, BezierPlugin, BezierThroughPlugin, ShortRotationPlugin]);
public function TweenMax(_arg1:Object, _arg2:Number, _arg3:Object){
super(_arg1, _arg2, _arg3);
if (TweenLite.version < 10.092){
trace("TweenMax error! Please update your TweenLite class or try deleting your ASO files. TweenMax requires a more recent version. Download updates at http://www.TweenMax.com.");
};
if (((!((this.combinedTimeScale == 1))) && ((this.target is TweenMax)))){
_timeScale = 1;
this.combinedTimeScale = _globalTimeScale;
} else {
_timeScale = this.combinedTimeScale;
this.combinedTimeScale = (this.combinedTimeScale * _globalTimeScale);
};
if (((!((this.combinedTimeScale == 1))) && (!((this.delay == 0))))){
this.startTime = (this.initTime + (this.delay * (1000 / this.combinedTimeScale)));
};
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
initDispatcher();
if ((((_arg2 == 0)) && ((this.delay == 0)))){
onUpdateDispatcher();
onCompleteDispatcher();
};
};
_repeatCount = 0;
if (((!(isNaN(this.vars.yoyo))) || (!(isNaN(this.vars.loop))))){
this.vars.persist = true;
};
if ((((this.delay == 0)) && (!((this.vars.startAt == null))))){
this.vars.startAt.overwrite = 0;
new TweenMax(this.target, 0, this.vars.startAt);
};
}
public function set repeatCount(_arg1:Number):void{
_repeatCount = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
if (!_arg1){
_pausedTweens[this] = null;
delete _pausedTweens[this];
};
super.enabled = _arg1;
if (_arg1){
this.combinedTimeScale = (_timeScale * _globalTimeScale);
};
}
public function set reversed(_arg1:Boolean):void{
if (this.reversed != _arg1){
reverse();
};
}
override public function render(_arg1:uint):void{
var _local2:Number;
var _local3:Number;
var _local4:TweenInfo;
var _local5:int;
_local2 = (((_arg1 - this.startTime) * 0.001) * this.combinedTimeScale);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4.target[_local4.property] = (_local4.start + (_local3 * _local4.change));
_local5--;
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
protected function adjustStartValues():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:TweenInfo;
var _local6:int;
_local1 = this.progress;
if (_local1 != 0){
_local2 = this.ease(_local1, 0, 1, 1);
_local3 = (1 / (1 - _local2));
_local6 = (this.tweens.length - 1);
while (_local6 > -1) {
_local5 = this.tweens[_local6];
_local4 = (_local5.start + _local5.change);
if (_local5.isPlugin){
_local5.change = ((_local4 - _local2) * _local3);
} else {
_local5.change = ((_local4 - _local5.target[_local5.property]) * _local3);
};
_local5.start = (_local4 - _local5.change);
_local6--;
};
};
}
public function get timeScale():Number{
return (_timeScale);
}
public function restart(_arg1:Boolean=false):void{
if (_arg1){
this.initTime = currentTime;
this.startTime = (currentTime + (this.delay * (1000 / this.combinedTimeScale)));
} else {
this.startTime = currentTime;
this.initTime = (currentTime - (this.delay * (1000 / this.combinedTimeScale)));
};
_repeatCount = 0;
if (this.target != this.vars.onComplete){
render(this.startTime);
};
this.pauseTime = NaN;
_pausedTweens[this] = null;
delete _pausedTweens[this];
this.enabled = true;
}
public function get paused():Boolean{
return (!(isNaN(this.pauseTime)));
}
public function killProperties(_arg1:Array):void{
var _local2:Object;
var _local3:int;
_local2 = {};
_local3 = (_arg1.length - 1);
while (_local3 > -1) {
_local2[_arg1[_local3]] = true;
_local3--;
};
killVars(_local2);
}
public function resume():void{
this.enabled = true;
if (!isNaN(this.pauseTime)){
this.initTime = (this.initTime + (currentTime - this.pauseTime));
this.startTime = (this.initTime + (this.delay * (1000 / this.combinedTimeScale)));
this.pauseTime = NaN;
if (((!(this.started)) && ((currentTime >= this.startTime)))){
activate();
} else {
this.active = this.started;
};
_pausedTweens[this] = null;
delete _pausedTweens[this];
};
}
override public function complete(_arg1:Boolean=false):void{
if (((((!(isNaN(this.vars.yoyo))) && ((((_repeatCount < this.vars.yoyo)) || ((this.vars.yoyo == 0)))))) || (((!(isNaN(this.vars.loop))) && ((((_repeatCount < this.vars.loop)) || ((this.vars.loop == 0)))))))){
_repeatCount++;
if (!isNaN(this.vars.yoyo)){
this.ease = ((this.vars.ease)==this.ease) ? reverseEase : this.vars.ease;
};
this.startTime = (_arg1) ? (this.startTime + (this.duration * (1000 / this.combinedTimeScale))) : currentTime;
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
} else {
if (this.vars.persist == true){
pause();
};
};
super.complete(_arg1);
}
public function invalidate(_arg1:Boolean=true):void{
var _local2:Number;
if (this.initted){
_local2 = this.progress;
if (((!(_arg1)) && (!((_local2 == 0))))){
this.progress = 0;
};
this.tweens = [];
_hasPlugins = false;
this.exposedVars = ((this.vars.isTV)==true) ? this.vars.exposedProps : this.vars;
initTweenVals();
_timeScale = ((this.vars.timeScale) || (1));
this.combinedTimeScale = (_timeScale * _globalTimeScale);
this.delay = ((this.vars.delay) || (0));
if (isNaN(this.pauseTime)){
this.startTime = (this.initTime + ((this.delay * 1000) / this.combinedTimeScale));
};
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
if (_dispatcher != null){
this.vars.onStart = _callbacks.onStart;
this.vars.onUpdate = _callbacks.onUpdate;
this.vars.onComplete = _callbacks.onComplete;
_dispatcher = null;
};
initDispatcher();
};
if (_local2 != 0){
if (_arg1){
adjustStartValues();
} else {
this.progress = _local2;
};
};
};
}
public function get progress():Number{
var _local1:Number;
var _local2:Number;
_local1 = (isNaN(this.pauseTime)) ? currentTime : this.pauseTime;
_local2 = (((((_local1 - this.initTime) * 0.001) - (this.delay / this.combinedTimeScale)) / this.duration) * this.combinedTimeScale);
if (_local2 > 1){
return (1);
};
if (_local2 < 0){
return (0);
};
return (_local2);
}
public function willTrigger(_arg1:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.willTrigger(_arg1));
}
public function dispatchEvent(_arg1:Event):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.dispatchEvent(_arg1));
}
public function get reversed():Boolean{
return ((this.ease == reverseEase));
}
public function get repeatCount():Number{
return (_repeatCount);
}
protected function onStartDispatcher(... _args):void{
if (_callbacks.onStart != null){
_callbacks.onStart.apply(null, this.vars.onStartParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START));
}
public function setDestination(_arg1:String, _arg2, _arg3:Boolean=true):void{
var _local4:Number;
var _local5:int;
var _local6:TweenInfo;
var _local7:Object;
var _local8:Object;
var _local9:Array;
var _local10:Boolean;
var _local11:Array;
var _local12:Object;
_local4 = this.progress;
if (this.initted){
if (!_arg3){
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local6 = this.tweens[_local5];
if (_local6.name == _arg1){
_local6.target[_local6.property] = _local6.start;
};
_local5--;
};
};
_local7 = this.vars;
_local8 = this.exposedVars;
_local9 = this.tweens;
_local10 = _hasPlugins;
this.tweens = [];
this.vars = (this.exposedVars = {});
this.vars[_arg1] = _arg2;
initTweenVals();
if (((!((this.ease == reverseEase))) && ((_local7.ease is Function)))){
this.ease = _local7.ease;
};
if (((_arg3) && (!((_local4 == 0))))){
adjustStartValues();
};
_local11 = this.tweens;
this.vars = _local7;
this.exposedVars = _local8;
this.tweens = _local9;
_local12 = {};
_local12[_arg1] = true;
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local6 = this.tweens[_local5];
if (_local6.name == _arg1){
this.tweens.splice(_local5, 1);
} else {
if (((_local6.isPlugin) && ((_local6.name == "_MULTIPLE_")))){
_local6.target.killProps(_local12);
if (_local6.target.overwriteProps.length == 0){
this.tweens.splice(_local5, 1);
};
};
};
_local5--;
};
this.tweens = this.tweens.concat(_local11);
_hasPlugins = Boolean(((_local10) || (_hasPlugins)));
};
this.vars[_arg1] = (this.exposedVars[_arg1] = _arg2);
}
public function set timeScale(_arg1:Number):void{
if (_arg1 < 1E-5){
_arg1 = (_timeScale = 1E-5);
} else {
_timeScale = _arg1;
_arg1 = (_arg1 * _globalTimeScale);
};
this.initTime = ((currentTime - ((((currentTime - this.initTime) - (this.delay * (1000 / this.combinedTimeScale))) * this.combinedTimeScale) * (1 / _arg1))) - (this.delay * (1000 / _arg1)));
if (this.startTime != 999999999999999){
this.startTime = (this.initTime + (this.delay * (1000 / _arg1)));
};
this.combinedTimeScale = _arg1;
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
if (_dispatcher != null){
_dispatcher.removeEventListener(_arg1, _arg2, _arg3);
};
}
override public function initTweenVals():void{
var _local1:int;
var _local2:int;
var _local3:String;
var _local4:String;
var _local5:Array;
var _local6:Object;
var _local7:TweenInfo;
if (((!((this.vars.startAt == null))) && (!((this.delay == 0))))){
this.vars.startAt.overwrite = 0;
new TweenMax(this.target, 0, this.vars.startAt);
};
super.initTweenVals();
if ((((this.exposedVars.roundProps is Array)) && (!((TweenLite.plugins.roundProps == null))))){
_local5 = this.exposedVars.roundProps;
_local1 = (_local5.length - 1);
while (_local1 > -1) {
_local3 = _local5[_local1];
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
_local7 = this.tweens[_local2];
if (_local7.name == _local3){
if (_local7.isPlugin){
_local7.target.round = true;
} else {
if (_local6 == null){
_local6 = new TweenLite.plugins.roundProps();
_local6.add(_local7.target, _local3, _local7.start, _local7.change);
_hasPlugins = true;
this.tweens[_local2] = new TweenInfo(_local6, "changeFactor", 0, 1, _local3, true);
} else {
_local6.add(_local7.target, _local3, _local7.start, _local7.change);
this.tweens.splice(_local2, 1);
};
};
} else {
if (((((_local7.isPlugin) && ((_local7.name == "_MULTIPLE_")))) && (!(_local7.target.round)))){
_local4 = ((" " + _local7.target.overwriteProps.join(" ")) + " ");
if (_local4.indexOf(((" " + _local3) + " ")) != -1){
_local7.target.round = true;
};
};
};
_local2--;
};
_local1--;
};
};
}
protected function initDispatcher():void{
var _local1:Object;
var _local2:String;
if (_dispatcher == null){
_dispatcher = new EventDispatcher(this);
_callbacks = {onStart:this.vars.onStart, onUpdate:this.vars.onUpdate, onComplete:this.vars.onComplete};
if (this.vars.isTV == true){
this.vars = this.vars.clone();
} else {
_local1 = {};
for (_local2 in this.vars) {
_local1[_local2] = this.vars[_local2];
};
this.vars = _local1;
};
this.vars.onStart = onStartDispatcher;
this.vars.onComplete = onCompleteDispatcher;
if ((this.vars.onStartListener is Function)){
_dispatcher.addEventListener(TweenEvent.START, this.vars.onStartListener, false, 0, true);
};
if ((this.vars.onUpdateListener is Function)){
_dispatcher.addEventListener(TweenEvent.UPDATE, this.vars.onUpdateListener, false, 0, true);
this.vars.onUpdate = onUpdateDispatcher;
_hasUpdate = true;
};
if ((this.vars.onCompleteListener is Function)){
_dispatcher.addEventListener(TweenEvent.COMPLETE, this.vars.onCompleteListener, false, 0, true);
};
};
}
protected function onUpdateDispatcher(... _args):void{
if (_callbacks.onUpdate != null){
_callbacks.onUpdate.apply(null, this.vars.onUpdateParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
}
public function set progress(_arg1:Number):void{
this.startTime = (currentTime - ((this.duration * _arg1) * 1000));
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
if (!this.started){
activate();
};
render(currentTime);
if (!isNaN(this.pauseTime)){
this.pauseTime = currentTime;
this.startTime = 999999999999999;
this.active = false;
};
}
public function reverse(_arg1:Boolean=true, _arg2:Boolean=true):void{
var _local3:Number;
this.ease = ((this.vars.ease)==this.ease) ? reverseEase : this.vars.ease;
_local3 = this.progress;
if (((_arg1) && ((_local3 > 0)))){
this.startTime = (currentTime - ((((1 - _local3) * this.duration) * 1000) / this.combinedTimeScale));
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
};
if (_arg2 != false){
if (_local3 < 1){
resume();
} else {
restart();
};
};
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
if (_dispatcher == null){
initDispatcher();
};
if ((((_arg1 == TweenEvent.UPDATE)) && (!((this.vars.onUpdate == onUpdateDispatcher))))){
this.vars.onUpdate = onUpdateDispatcher;
_hasUpdate = true;
};
_dispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function set paused(_arg1:Boolean):void{
if (_arg1){
pause();
} else {
resume();
};
}
public function hasEventListener(_arg1:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.hasEventListener(_arg1));
}
public function pause():void{
if (isNaN(this.pauseTime)){
this.pauseTime = currentTime;
this.startTime = 999999999999999;
this.enabled = false;
_pausedTweens[this] = this;
};
}
public function reverseEase(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.ease((_arg4 - _arg1), _arg2, _arg3, _arg4));
}
protected function onCompleteDispatcher(... _args):void{
if (_callbacks.onComplete != null){
_callbacks.onComplete.apply(null, this.vars.onCompleteParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
}
public static function set globalTimeScale(_arg1:Number):void{
setGlobalTimeScale(_arg1);
}
public static function pauseAll(_arg1:Boolean=true, _arg2:Boolean=false):void{
changePause(true, _arg1, _arg2);
}
public static function killAllDelayedCalls(_arg1:Boolean=false):void{
killAll(_arg1, false, true);
}
public static function setGlobalTimeScale(_arg1:Number):void{
var _local2:Dictionary;
var _local3:int;
var _local4:Array;
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
_local2 = masterList;
_globalTimeScale = _arg1;
for each (_local4 in _local2) {
_local3 = (_local4.length - 1);
while (_local3 > -1) {
if ((_local4[_local3] is TweenMax)){
_local4[_local3].timeScale = (_local4[_local3].timeScale * 1);
};
_local3--;
};
};
}
public static function get globalTimeScale():Number{
return (_globalTimeScale);
}
public static function getTweensOf(_arg1:Object):Array{
var _local2:Array;
var _local3:Array;
var _local4:TweenLite;
var _local5:int;
_local2 = masterList[_arg1];
_local3 = [];
if (_local2 != null){
_local5 = (_local2.length - 1);
while (_local5 > -1) {
if (!_local2[_local5].gc){
_local3[_local3.length] = _local2[_local5];
};
_local5--;
};
};
for each (_local4 in _pausedTweens) {
if (_local4.target == _arg1){
_local3[_local3.length] = _local4;
};
};
return (_local3);
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenMax{
return (new TweenMax(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, persist:_arg4, overwrite:0}));
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:Array;
var _local3:int;
_local2 = getTweensOf(_arg1);
_local3 = (_local2.length - 1);
while (_local3 > -1) {
if (((((_local2[_local3].active) || ((_local2[_local3].startTime == currentTime)))) && (!(_local2[_local3].gc)))){
return (true);
};
_local3--;
};
return (false);
}
public static function changePause(_arg1:Boolean, _arg2:Boolean=true, _arg3:Boolean=false):void{
var _local4:Array;
var _local5:Boolean;
var _local6:int;
_local4 = getAllTweens();
_local6 = (_local4.length - 1);
while (_local6 > -1) {
_local5 = (_local4[_local6].target == _local4[_local6].vars.onComplete);
if ((((_local4[_local6] is TweenMax)) && ((((_local5 == _arg3)) || (!((_local5 == _arg2))))))){
_local4[_local6].paused = _arg1;
};
_local6--;
};
}
public static function killAllTweens(_arg1:Boolean=false):void{
killAll(_arg1, true, false);
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
_arg3.runBackwards = true;
return (new TweenMax(_arg1, _arg2, _arg3));
}
public static function killAll(_arg1:Boolean=false, _arg2:Boolean=true, _arg3:Boolean=true):void{
var _local4:Array;
var _local5:Boolean;
var _local6:int;
_local4 = getAllTweens();
_local6 = (_local4.length - 1);
while (_local6 > -1) {
_local5 = (_local4[_local6].target == _local4[_local6].vars.onComplete);
if ((((_local5 == _arg3)) || (!((_local5 == _arg2))))){
if (_arg1){
_local4[_local6].complete(false);
_local4[_local6].clear();
} else {
TweenLite.removeTween(_local4[_local6], true);
};
};
_local6--;
};
}
public static function getAllTweens():Array{
var _local1:Dictionary;
var _local2:Array;
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
_local1 = masterList;
_local2 = [];
for each (_local3 in _local1) {
_local4 = (_local3.length - 1);
while (_local4 > -1) {
if (!_local3[_local4].gc){
_local2[_local2.length] = _local3[_local4];
};
_local4--;
};
};
for each (_local5 in _pausedTweens) {
_local2[_local2.length] = _local5;
};
return (_local2);
}
public static function resumeAll(_arg1:Boolean=true, _arg2:Boolean=false):void{
changePause(false, _arg1, _arg2);
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
return (new TweenMax(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 166
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const LOGGED_IN:String = "LoggedIn";
public static const STORE_ITEMS:String = "StoreItems";
public static const NO_USER:String = "NoUser";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const ITEM_NEW:String = "ItemNew";
public static const USER_INFO:String = "UserInfo";
public static const IO_ERROR:String = "IOError";
public static const ITEM_OWNED:String = "ItemOwned";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const ERROR:String = "Error";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_HIDE:String = "LoginHide";
public static const LOGIN_SHOW:String = "LoginShow";
public static const STORE_SHOW:String = "StoreShow";
public static const PROFILE_HIDE:String = "ProfileHide";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static function showItem(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:_arg1}, null, null);
}
public static function saveUserProperties(_arg1:Object):void{
MochiServices.send("coins_saveUserProperties", _arg1);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function showLoginWidget(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showLoginWidget", {options:_arg1});
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showStore(_arg1:Object=null):void{
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:_arg1}, null, null);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function getUserInfo():void{
MochiServices.send("coins_getUserInfo");
}
public static function hideLoginWidget():void{
MochiServices.send("coins_hideLoginWidget");
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function showVideo(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:_arg1}, null, null);
}
}
}//package mochi.as3
Section 167
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
Encoder = 0;
setValue(_arg1, _arg2);
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function reencode():void{
var _local1:uint;
_local1 = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function toString():String{
var _local1:String;
_local1 = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
public function get value():Number{
return (Number(this.toString()));
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String;
_local3 = _arg1.toString();
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
Fragment = (_local3.charCodeAt(_temp1) ^ Encoder);
if (_arg2 < _local3.length){
Sibling = new MochiDigits(_arg1, _arg2);
} else {
Sibling = null;
};
reencode();
}
public function addValue(_arg1:Number):void{
value = (value + _arg1);
}
}
}//package mochi.as3
Section 168
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
eventTable = {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
return;
};
for (_local3 in eventTable[_arg1]) {
var _local6 = eventTable[_arg1];
_local6[_local3](_arg2);
};
}
public function removeEventListener(_arg1:String, _arg2:Function):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
eventTable[_arg1] = [];
return;
};
for (_local3 in eventTable[_arg1]) {
if (eventTable[_arg1][_local3] != _arg2){
} else {
eventTable[_arg1].splice(Number(_local3), 1);
};
};
}
public function addEventListener(_arg1:String, _arg2:Function):void{
removeEventListener(_arg1, _arg2);
eventTable[_arg1].push(_arg2);
}
}
}//package mochi.as3
Section 169
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var gameStart:Number;
private static var levelStart:Number;
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function startSession(_arg1:String):void{
MochiServices.send("events_beginSession", {achievementID:_arg1}, null, null);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function setNotifications(_arg1:MovieClip, _arg2:Object):void{
var _local3:Object;
var _local4:Object;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
_local3.clip = _arg1;
MochiServices.send("events_setNotifications", _local3, null, null);
}
public static function endGame():void{
var _local1:Number;
_local1 = (new Date().time - gameStart);
trigger("end_game", {time:_local1});
}
public static function startGame():void{
gameStart = new Date().time;
trigger("start_game");
}
public static function trigger(_arg1:String, _arg2:Object=null):void{
if (_arg2 == null){
_arg2 = {};
} else {
if (_arg2["kind"] != undefined){
trace("WARNING: optional arguements package contains key 'id', it will be overwritten");
_arg2["kind"] = _arg1;
};
};
MochiServices.send("events_triggerEvent", {eventObject:_arg2}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startLevel():void{
levelStart = new Date().time;
trigger("start_level");
}
public static function endLevel():void{
var _local1:Number;
_local1 = (new Date().time - levelStart);
trigger("end_level", {time:_local1});
}
}
}//package mochi.as3
Section 170
//MochiScores (mochi.as3.MochiScores)
package mochi.as3 {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public static function showLeaderboard(_arg1:Object=null):void{
var n:Number;
var options = _arg1;
if (options != null){
delete options.clip;
MochiServices.setContainer();
MochiServices.bringToTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
} else {
if ((options.score is MochiDigits)){
options.score = options.score.value;
};
};
n = Number(options.score);
if (isNaN(n)){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(n) != n){
trace((("WARNING: Submitted score '" + options.score) + "' will be truncated"));
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2);
}
public static function requestList(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_requestList", null, _arg1, _arg2);
}
public static function scoresArrayToObjects(_arg1:Object):Object{
var _local2:Object;
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
_local2 = {};
for (_local7 in _arg1) {
if (typeof(_arg1[_local7]) == "object"){
if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){
_local2[_local7] = [];
_local5 = _arg1[_local7];
_local4 = 0;
while (_local4 < _local5.rows.length) {
_local6 = {};
_local3 = 0;
while (_local3 < _local5.cols.length) {
_local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3];
_local3++;
};
_local2[_local7].push(_local6);
_local4++;
};
} else {
_local2[_local7] = {};
for (_local8 in _arg1[_local7]) {
_local2[_local7][_local8] = _arg1[_local7][_local8];
};
};
} else {
_local2[_local7] = _arg1[_local7];
};
};
return (_local2);
}
public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{
_arg1 = Number(_arg1);
if (isNaN(_arg1)){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((_arg1 == Number.NEGATIVE_INFINITY)) || ((_arg1 == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(_arg1) != _arg1){
trace((("WARNING: Submitted score '" + String(_arg1)) + "' will be truncated"));
};
_arg1 = Number(_arg1);
};
};
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function onClose(_arg1:Object=null):void{
if (((((_arg1) && ((_arg1.error == true)))) && (onErrorHandler))){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiServices.warnID(_arg1, true);
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package mochi.as3
Section 171
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
public static var servicesSync:MochiSync = new MochiSync();
private static var _clip:MovieClip;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _loader:Loader;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(_arg1:Object):void{
var cb:String;
var cblst:Object;
var method:*;
var methodName:String;
var obj:Object;
var pkg = _arg1;
cb = pkg.callbackID;
cblst = _clip._callbacks[cb];
if (!cblst){
return;
};
method = cblst.callbackMethod;
methodName = "";
obj = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete _clip._callbacks[cb];
}
public static function get childClip():Object{
return (_clip);
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + _arg1));
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_clip._queue.push({methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
};
if (_clip != null){
if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){
_clip._callbacks[_clip._nextcallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_clip._nextcallbackID++;
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local3:Array;
var _local4:int;
var _local5:Array;
var _local6:Array;
var _local7:MovieClip;
var _local8:LocalConnection;
var _local9:String;
var _local10:ByteArray;
var _local11:ByteArray;
var _local12:uint;
var _local13:uint;
var _local14:Loader;
_local3 = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
_local5 = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
_local6 = [0, 64, 0, 0, 0];
_local7 = new MovieClip();
_local8 = new LocalConnection();
_local9 = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
_local10 = new ByteArray();
_local11 = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
_local12 = ((_local3.length + _local11.length) + 4);
_local13 = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var vars:Object;
var avm1Click:DisplayObject;
var s:String;
var i:Number;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
vars = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
s = "?";
i = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (_arg1:String):void{
var _local2:Rectangle;
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(_arg1, onClick);
_local2 = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = _local2.x;
avm1Click.y = _local2.y;
avm1Click.scaleX = (0.01 * _local2.width);
avm1Click.scaleY = (0.01 * _local2.height);
};
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
setURL(burl);
};
complete = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function warnID(_arg1:String, _arg2:Boolean):void{
var _local3:Number;
_arg1 = _arg1.toLowerCase();
if (_arg1.length != 16){
trace((("WARNING: " + (_arg2) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (_arg1 == "1e113c7239048b3f"){
if (_arg2){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (_arg1 == "84993a1de4031cd8"){
if (_arg2){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
_local3 = 0;
while (_local3 < _arg1.length) {
switch (_arg1.charAt(_local3)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + _arg1));
return;
};
_local3++;
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_mochiLocalConnection.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
};
return (_local2);
}
public static function getVersion():String{
return ("3.2 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (((_clip) && (_clip._queue))){
while (_clip._queue.length > 0) {
_local2 = _clip._queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _clip._callbacks[_local2.callbackID];
};
delete _clip._callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(_arg1:Object):void{
var _local2:String;
var _local3:String;
_local2 = _arg1.target;
_local3 = _arg1.event;
switch (_local2){
case "events":
MochiEvents.triggerEvent(_arg1.event, _arg1.args);
break;
case "coins":
MochiCoins.triggerEvent(_arg1.event, _arg1.args);
break;
case "sync":
servicesSync.triggerEvent(_arg1.event, _arg1.args);
break;
};
}
private static function urlOptions(_arg1:Object):Object{
var _local2:Object;
var _local3:String;
var _local4:Array;
var _local5:Number;
var _local6:Array;
_local2 = {};
_local3 = _arg1.loaderInfo.parameters.mochiad_options;
if (_local3){
_local4 = _local3.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].split("=");
_local2[unescape(_local6[0])] = unescape(_local6[1]);
_local5++;
};
};
return (_local2);
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_arg1 != null){
if ((_arg1 is Sprite)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is Sprite)){
Sprite(_container).addChild(_clip);
};
};
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
private static function loadError(_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, clip:_container, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_clip._queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function loadLCBridge(_arg1:Object):void{
var loader:Loader;
var mochiLCURL:String;
var req:URLRequest;
var complete:Function;
var clip = _arg1;
loader = new Loader();
mochiLCURL = (_servURL + _mochiLC);
req = new URLRequest(mochiLCURL);
complete = function (_arg1:Object):void{
_mochiLocalConnection = MovieClip(loader.content);
listen();
};
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
loader.load(req);
clip.addChild(loader);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var _local3:String;
var _local4:String;
var _local5:URLRequest;
var _local6:URLVariables;
_local3 = ("_mochiservices_com_" + _arg1);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(_arg2).servURL){
_servURL = urlOptions(_arg2).servURL;
};
_local4 = (_servURL + _services);
if (urlOptions(_arg2).servicesURL){
_local4 = urlOptions(_arg2).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(_local4);
_clip = createEmptyMovieClip(_arg2, _local3, 10336, false);
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
_local5 = new URLRequest(_local4);
_local6 = new URLVariables();
_local6.listenLC = _listenChannelName;
_local6.mochiad_options = _arg2.loaderInfo.parameters.mochiad_options;
_local6.api_version = getVersion();
if (widget){
_local6.widget = true;
};
_local5.data = _local6;
_loader.load(_local5);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_clip._nextcallbackID = 0;
_clip._callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
warnID(id, false);
if ((clip is DisplayObject)){
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{
var mc:MovieClip;
var parent = _arg1;
var name = _arg2;
var depth = _arg3;
var doAdd = _arg4;
mc = new MovieClip();
if (doAdd){
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
};
try {
parent[name] = mc;
} catch(e:Error) {
throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
mc["_name"] = name;
return (mc);
}
public static function bringToTop(_arg1:Event=null):void{
var e = _arg1;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
}
public static function connectWait(_arg1:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
}
}
}//package mochi.as3
Section 172
//MochiSync (mochi.as3.MochiSync)
package mochi.as3 {
import flash.utils.*;
public dynamic class MochiSync extends Proxy {
private var _syncContainer:Object;
public static var SYNC_PROPERTY:String = "UpdateProperty";
public static var SYNC_REQUEST:String = "SyncRequest";
public function MochiSync():void{
_syncContainer = {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
switch (_arg1){
case SYNC_REQUEST:
MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY:
_syncContainer[_arg2.name] = _arg2.value;
break;
};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
return (_syncContainer[_arg1]);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:String;
if (_syncContainer[_arg1] == _arg2){
return;
};
_local3 = _arg1.toString();
_syncContainer[_local3] = _arg2;
MochiServices.send("sync_propUpdate", {name:_local3, value:_arg2});
}
}
}//package mochi.as3
Section 173
//achievement_165 (MoreZombies_fla.achievement_165)
package MoreZombies_fla {
import flash.display.*;
import flash.text.*;
public dynamic class achievement_165 extends MovieClip {
public var info:TextField;
}
}//package MoreZombies_fla
Section 174
//achievementspages_176 (MoreZombies_fla.achievementspages_176)
package MoreZombies_fla {
import flash.display.*;
public dynamic class achievementspages_176 extends MovieClip {
public var chk_Demolition:MovieClip;
public var chk_InfiniteAmmo:MovieClip;
public var chk_Samurai:MovieClip;
public var chk_Headache:MovieClip;
public var chk_Jedi:MovieClip;
public var chk_Pyromania:MovieClip;
public var chk_MoreBullets:MovieClip;
public var chk_Hunter:MovieClip;
public var chk_Disintegrate:MovieClip;
public var chk_Massacre:MovieClip;
public var chk_HomeRun:MovieClip;
public var chk_BloodyCircus:MovieClip;
public var chk_FullyArmed:MovieClip;
public var chk_MegaSlash:MovieClip;
public var chk_Terminator:MovieClip;
public var chk_Jurassic:MovieClip;
public var chk_Hitman:MovieClip;
public var chk_Glacier:MovieClip;
}
}//package MoreZombies_fla
Section 175
//aitsoeffect_3 (MoreZombies_fla.aitsoeffect_3)
package MoreZombies_fla {
import flash.display.*;
public dynamic class aitsoeffect_3 extends MovieClip {
public function aitsoeffect_3(){
addFrameScript(106, frame107);
}
function frame107(){
stop();
}
}
}//package MoreZombies_fla
Section 176
//ARCADEMODES_178 (MoreZombies_fla.ARCADEMODES_178)
package MoreZombies_fla {
import flash.display.*;
public dynamic class ARCADEMODES_178 extends MovieClip {
public function ARCADEMODES_178(){
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(1);
}
}
}//package MoreZombies_fla
Section 177
//area_azul_64 (MoreZombies_fla.area_azul_64)
package MoreZombies_fla {
import flash.display.*;
public dynamic class area_azul_64 extends MovieClip {
public function area_azul_64(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
this.visible = false;
}
}
}//package MoreZombies_fla
Section 178
//area_juego_65 (MoreZombies_fla.area_juego_65)
package MoreZombies_fla {
import flash.display.*;
public dynamic class area_juego_65 extends MovieClip {
public var cam:MovieClip;
}
}//package MoreZombies_fla
Section 179
//array_casquillos_309 (MoreZombies_fla.array_casquillos_309)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class array_casquillos_309 extends MovieClip {
public var tar;
public function array_casquillos_309(){
addFrameScript(0, frame1);
}
function frame1(){
tar = this.parent.parent.parent;
gotoAndStop(tar.indice_casquillo);
}
}
}//package MoreZombies_fla
Section 180
//AssetHolder_1 (MoreZombies_fla.AssetHolder_1)
package MoreZombies_fla {
import flash.display.*;
public dynamic class AssetHolder_1 extends MovieClip {
public function AssetHolder_1(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MoreZombies_fla
Section 181
//BIDON_281 (MoreZombies_fla.BIDON_281)
package MoreZombies_fla {
import flash.display.*;
public dynamic class BIDON_281 extends MovieClip {
public var hitarea:MovieClip;
public function BIDON_281(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MoreZombies_fla
Section 182
//bidonarray_283 (MoreZombies_fla.bidonarray_283)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class bidonarray_283 extends MovieClip {
public var tar;
public function bidonarray_283(){
addFrameScript(0, frame1);
}
function frame1(){
tar = this.parent.parent.parent;
gotoAndStop(tar.indice_estado);
}
}
}//package MoreZombies_fla
Section 183
//bidondamaged_287 (MoreZombies_fla.bidondamaged_287)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class bidondamaged_287 extends MovieClip {
public var tar;
public function bidondamaged_287(){
addFrameScript(2, frame3);
}
function frame3(){
tar = this.parent;
tar.gotoAndStop(1);
}
}
}//package MoreZombies_fla
Section 184
//bidonmuerte_288 (MoreZombies_fla.bidonmuerte_288)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class bidonmuerte_288 extends MovieClip {
public var tar;
public function bidonmuerte_288(){
addFrameScript(20, frame21);
}
function frame21(){
tar = this.parent.parent;
tar.destruido();
stop();
}
}
}//package MoreZombies_fla
Section 185
//CARRITO_299 (MoreZombies_fla.CARRITO_299)
package MoreZombies_fla {
import flash.display.*;
public dynamic class CARRITO_299 extends MovieClip {
public var hitarea:MovieClip;
}
}//package MoreZombies_fla
Section 186
//carritoarray_301 (MoreZombies_fla.carritoarray_301)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class carritoarray_301 extends MovieClip {
public var tar;
public function carritoarray_301(){
addFrameScript(0, frame1);
}
function frame1(){
tar = this.parent.parent.parent;
gotoAndStop(tar.indice_estado);
}
}
}//package MoreZombies_fla
Section 187
//carritodamaged_302 (MoreZombies_fla.carritodamaged_302)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class carritodamaged_302 extends MovieClip {
public var tar;
public function carritodamaged_302(){
addFrameScript(2, frame3);
}
function frame3(){
tar = this.parent;
tar.gotoAndStop(1);
}
}
}//package MoreZombies_fla
Section 188
//carritomc_304 (MoreZombies_fla.carritomc_304)
package MoreZombies_fla {
import flash.display.*;
public dynamic class carritomc_304 extends MovieClip {
public var hitarea:MovieClip;
}
}//package MoreZombies_fla
Section 189
//carritomuerte_303 (MoreZombies_fla.carritomuerte_303)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class carritomuerte_303 extends MovieClip {
public var tar;
public function carritomuerte_303(){
addFrameScript(1, frame2);
}
function frame2(){
tar = this.parent.parent;
tar.destruido();
stop();
}
}
}//package MoreZombies_fla
Section 190
//carteles_combo_356 (MoreZombies_fla.carteles_combo_356)
package MoreZombies_fla {
import flash.display.*;
public dynamic class carteles_combo_356 extends MovieClip {
public var mc_mascara:MovieClip;
public var cartel2:MovieClip;
public var cartel:MovieClip;
}
}//package MoreZombies_fla
Section 191
//casquillo1anim1_314 (MoreZombies_fla.casquillo1anim1_314)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class casquillo1anim1_314 extends MovieClip {
public var tar;
public function casquillo1anim1_314(){
addFrameScript(30, frame31, 51, frame52);
}
function frame31(){
tar = this.parent.parent;
tar.lanzarSonido();
}
function frame52(){
stop();
tar.finalize(this);
}
}
}//package MoreZombies_fla
Section 192
//casquillo1anim2_315 (MoreZombies_fla.casquillo1anim2_315)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class casquillo1anim2_315 extends MovieClip {
public var tar;
public function casquillo1anim2_315(){
addFrameScript(24, frame25, 44, frame45);
}
function frame25(){
tar = this.parent.parent;
tar.lanzarSonido();
}
function frame45(){
stop();
tar.finalize(this);
}
}
}//package MoreZombies_fla
Section 193
//casquillo1anim3_316 (MoreZombies_fla.casquillo1anim3_316)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class casquillo1anim3_316 extends MovieClip {
public var tar;
public function casquillo1anim3_316(){
addFrameScript(24, frame25, 44, frame45);
}
function frame25(){
tar = this.parent.parent;
tar.lanzarSonido();
}
function frame45(){
stop();
tar.finalize(this);
}
}
}//package MoreZombies_fla
Section 194
//casquilloanim4_317 (MoreZombies_fla.casquilloanim4_317)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class casquilloanim4_317 extends MovieClip {
public var tar;
public function casquilloanim4_317(){
addFrameScript(10, frame11, 30, frame31);
}
function frame31(){
stop();
tar.finalize(this);
}
function frame11(){
tar = this.parent.parent;
tar.lanzarSonido();
}
}
}//package MoreZombies_fla
Section 195
//casquilloanim5_318 (MoreZombies_fla.casquilloanim5_318)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class casquilloanim5_318 extends MovieClip {
public var tar;
public function casquilloanim5_318(){
addFrameScript(10, frame11, 30, frame31);
}
function frame31(){
stop();
tar.finalize(this);
}
function frame11(){
tar = this.parent.parent;
tar.lanzarSonido();
}
}
}//package MoreZombies_fla
Section 196
//casquilloanim6_319 (MoreZombies_fla.casquilloanim6_319)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class casquilloanim6_319 extends MovieClip {
public var tar;
public function casquilloanim6_319(){
addFrameScript(10, frame11, 30, frame31);
}
function frame31(){
stop();
tar.finalize(this);
}
function frame11(){
tar = this.parent.parent;
tar.lanzarSonido();
}
}
}//package MoreZombies_fla
Section 197
//CHARCOSANGRE_playerdead_40 (MoreZombies_fla.CHARCOSANGRE_playerdead_40)
package MoreZombies_fla {
import com.tanoku.MoreZombies.*;
import flash.display.*;
public dynamic class CHARCOSANGRE_playerdead_40 extends MovieClip {
public function CHARCOSANGRE_playerdead_40(){
addFrameScript(0, frame1, 29, frame30);
}
function frame1(){
if (Globals.SANGRE_ACTIVA == false){
visible = false;
};
}
function frame30(){
stop();
}
}
}//package MoreZombies_fla
Section 198
//clip_sd88detincelle_410 (MoreZombies_fla.clip_sd88detincelle_410)
package MoreZombies_fla {
import flash.display.*;
public dynamic class clip_sd88detincelle_410 extends MovieClip {
public function clip_sd88detincelle_410(){
addFrameScript(13, frame14);
}
function frame14(){
stop();
}
}
}//package MoreZombies_fla
Section 199
//dynamite_623 (MoreZombies_fla.dynamite_623)
package MoreZombies_fla {
import flash.media.*;
import com.tanoku.MoreZombies.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class dynamite_623 extends MovieClip {
public var tar;
public function dynamite_623(){
addFrameScript(0, frame1, 1, frame2, 10, frame11);
}
function frame1(){
tar = this.parent.parent.parent.parent.parent;
gotoAndStop(tar.indice_dinamita);
cacheAsBitmap = true;
}
function frame2(){
if ((((Globals.CALIDAD == "HIGH")) || ((Globals.CALIDAD == "MEDIUM")))){
gotoAndPlay(3);
};
}
function frame11(){
gotoAndPlay(2);
}
}
}//package MoreZombies_fla
Section 200
//dynamiteback_621 (MoreZombies_fla.dynamiteback_621)
package MoreZombies_fla {
import flash.media.*;
import com.tanoku.MoreZombies.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class dynamiteback_621 extends MovieClip {
public var tar;
public function dynamiteback_621(){
addFrameScript(0, frame1, 1, frame2, 10, frame11);
}
function frame1(){
tar = this.parent.parent.parent.parent.parent;
gotoAndStop(tar.indice_dinamita);
cacheAsBitmap = true;
}
function frame2(){
if ((((Globals.CALIDAD == "HIGH")) || ((Globals.CALIDAD == "MEDIUM")))){
gotoAndPlay(3);
};
}
function frame11(){
gotoAndPlay(2);
}
}
}//package MoreZombies_fla
Section 201
//explosionaerea_32 (MoreZombies_fla.explosionaerea_32)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class explosionaerea_32 extends MovieClip {
public var tar;
public function explosionaerea_32(){
addFrameScript(20, frame21);
}
function frame21(){
tar = this;
stop();
tar.parent.gotoAndStop("fin");
}
}
}//package MoreZombies_fla
Section 202
//explosionclaymore_33 (MoreZombies_fla.explosionclaymore_33)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class explosionclaymore_33 extends MovieClip {
public var tar;
public function explosionclaymore_33(){
addFrameScript(24, frame25);
}
function frame25(){
tar = this;
stop();
tar.parent.gotoAndStop("fin");
}
}
}//package MoreZombies_fla
Section 203
//explosioncongela_34 (MoreZombies_fla.explosioncongela_34)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class explosioncongela_34 extends MovieClip {
public var tar;
public var tarParent;
public function explosioncongela_34(){
addFrameScript(43, frame44);
}
function frame44(){
tarParent = this;
tar = this.parent;
stop();
tar.copiar(this);
tarParent.parent.gotoAndStop("fin");
stop();
}
}
}//package MoreZombies_fla
Section 204
//explosiongranada_36 (MoreZombies_fla.explosiongranada_36)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class explosiongranada_36 extends MovieClip {
public var tar;
public function explosiongranada_36(){
addFrameScript(24, frame25);
}
function frame25(){
tar = this;
stop();
tar.parent.gotoAndStop("fin");
}
}
}//package MoreZombies_fla
Section 205
//explosionpetacraneos_37 (MoreZombies_fla.explosionpetacraneos_37)
package MoreZombies_fla {
import com.tanoku.utils.*;
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class explosionpetacraneos_37 extends MovieClip {
public var tar;
public var soundManager:SoundManager;
public function explosionpetacraneos_37(){
addFrameScript(1, frame2, 25, frame26);
}
function frame26(){
tar = this;
stop();
tar.parent.gotoAndStop("fin");
}
function frame2(){
soundManager = SoundManager.getInstance();
soundManager.playSound("Cranium", 1, 1);
}
}
}//package MoreZombies_fla
Section 206
//explosiontank_38 (MoreZombies_fla.explosiontank_38)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class explosiontank_38 extends MovieClip {
public var tar;
public function explosiontank_38(){
addFrameScript(24, frame25);
}
function frame25(){
tar = this;
stop();
tar.parent.gotoAndStop("fin");
}
}
}//package MoreZombies_fla
Section 207
//extinguisherbala1_269 (MoreZombies_fla.extinguisherbala1_269)
package MoreZombies_fla {
import flash.display.*;
public dynamic class extinguisherbala1_269 extends MovieClip {
public function extinguisherbala1_269(){
addFrameScript(27, frame28);
}
function frame28(){
stop();
}
}
}//package MoreZombies_fla
Section 208
//extinguisherbala2_270 (MoreZombies_fla.extinguisherbala2_270)
package MoreZombies_fla {
import flash.display.*;
public dynamic class extinguisherbala2_270 extends MovieClip {
public function extinguisherbala2_270(){
addFrameScript(27, frame28);
}
function frame28(){
stop();
}
}
}//package MoreZombies_fla
Section 209
//extinguisherbala3_271 (MoreZombies_fla.extinguisherbala3_271)
package MoreZombies_fla {
import flash.display.*;
public dynamic class extinguisherbala3_271 extends MovieClip {
public function extinguisherbala3_271(){
addFrameScript(27, frame28);
}
function frame28(){
stop();
}
}
}//package MoreZombies_fla
Section 210
//extinguisherbala4_272 (MoreZombies_fla.extinguisherbala4_272)
package MoreZombies_fla {
import flash.display.*;
public dynamic class extinguisherbala4_272 extends MovieClip {
public function extinguisherbala4_272(){
addFrameScript(27, frame28);
}
function frame28(){
stop();
}
}
}//package MoreZombies_fla
Section 211
//extinguisherbala5_273 (MoreZombies_fla.extinguisherbala5_273)
package MoreZombies_fla {
import flash.display.*;
public dynamic class extinguisherbala5_273 extends MovieClip {
public function extinguisherbala5_273(){
addFrameScript(27, frame28);
}
function frame28(){
stop();
}
}
}//package MoreZombies_fla
Section 212
//FIRE_LARM_507 (MoreZombies_fla.FIRE_LARM_507)
package MoreZombies_fla {
import flash.media.*;
import com.tanoku.MoreZombies.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class FIRE_LARM_507 extends MovieClip {
public var weaponManager:WeaponManager;
public function FIRE_LARM_507(){
addFrameScript(0, frame1);
}
function frame1(){
weaponManager = WeaponManager.getInstance();
gotoAndStop(weaponManager.weaponList[weaponManager.currentWeapon].index);
}
}
}//package MoreZombies_fla
Section 213
//FIRE_RARM_474 (MoreZombies_fla.FIRE_RARM_474)
package MoreZombies_fla {
import flash.media.*;
import com.tanoku.MoreZombies.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class FIRE_RARM_474 extends MovieClip {
public var weaponManager:WeaponManager;
public function FIRE_RARM_474(){
addFrameScript(0, frame1);
}
function frame1(){
weaponManager = WeaponManager.getInstance();
gotoAndStop(weaponManager.weaponList[weaponManager.currentWeapon].index);
}
}
}//package MoreZombies_fla
Section 214
//flamethrowerfire1_274 (MoreZombies_fla.flamethrowerfire1_274)
package MoreZombies_fla {
import flash.display.*;
public dynamic class flamethrowerfire1_274 extends MovieClip {
public function flamethrowerfire1_274(){
addFrameScript(27, frame28);
}
function frame28(){
stop();
}
}
}//package MoreZombies_fla
Section 215
//flamethrowerfire2_275 (MoreZombies_fla.flamethrowerfire2_275)
package MoreZombies_fla {
import flash.display.*;
public dynamic class flamethrowerfire2_275 extends MovieClip {
public function flamethrowerfire2_275(){
addFrameScript(27, frame28);
}
function frame28(){
stop();
}
}
}//package MoreZombies_fla
Section 216
//flamethrowerfire3_276 (MoreZombies_fla.flamethrowerfire3_276)
package MoreZombies_fla {
import flash.display.*;
public dynamic class flamethrowerfire3_276 extends MovieClip {
public function flamethrowerfire3_276(){
addFrameScript(27, frame28);
}
function frame28(){
stop();
}
}
}//package MoreZombies_fla
Section 217
//flamethrowerfire4_277 (MoreZombies_fla.flamethrowerfire4_277)
package MoreZombies_fla {
import flash.display.*;
public dynamic class flamethrowerfire4_277 extends MovieClip {
public function flamethrowerfire4_277(){
addFrameScript(27, frame28);
}
function frame28(){
stop();
}
}
}//package MoreZombies_fla
Section 218
//flamethrowerfire5_278 (MoreZombies_fla.flamethrowerfire5_278)
package MoreZombies_fla {
import flash.display.*;
public dynamic class flamethrowerfire5_278 extends MovieClip {
public function flamethrowerfire5_278(){
addFrameScript(27, frame28);
}
function frame28(){
stop();
}
}
}//package MoreZombies_fla
Section 219
//FPS_724 (MoreZombies_fla.FPS_724)
package MoreZombies_fla {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public dynamic class FPS_724 extends MovieClip {
public var prevSecondTime:Number;
public var secondTime:Number;
public var tf:TextField;
public var frames:Number;
public var time:Number;
public var frameTime:Number;
public var fps:String;
public var prevFrameTime:Number;
public var iBar:MovieClip;
public function FPS_724(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
prevFrameTime = getTimer();
prevSecondTime = getTimer();
frames = 0;
fps = "...";
}
function frame2(){
stop();
this.addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(_arg1:Event):void{
time = getTimer();
frameTime = (time - prevFrameTime);
secondTime = (time - prevSecondTime);
if (secondTime >= 1000){
fps = frames.toString();
frames = 0;
prevSecondTime = time;
} else {
frames++;
};
prevFrameTime = time;
tf.text = (((fps + " FPS / ") + frameTime) + " MS");
iBar.scaleX = (iBar.scaleX - ((iBar.scaleX - (frameTime / 10)) / 5));
parent.setChildIndex(this, (parent.numChildren - 1));
}
}
}//package MoreZombies_fla
Section 220
//freeinternetgames_409 (MoreZombies_fla.freeinternetgames_409)
package MoreZombies_fla {
import flash.display.*;
public dynamic class freeinternetgames_409 extends MovieClip {
public function freeinternetgames_409(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package MoreZombies_fla
Section 221
//fuegozombieburn_693 (MoreZombies_fla.fuegozombieburn_693)
package MoreZombies_fla {
import flash.display.*;
public dynamic class fuegozombieburn_693 extends MovieClip {
public var contador:int;
public function fuegozombieburn_693(){
addFrameScript(0, frame1, 20, frame21);
}
function frame1(){
contador = 0;
cacheAsBitmap = true;
}
function frame21(){
}
}
}//package MoreZombies_fla
Section 222
//gotascaen_414 (MoreZombies_fla.gotascaen_414)
package MoreZombies_fla {
import flash.display.*;
public dynamic class gotascaen_414 extends MovieClip {
public function gotascaen_414(){
addFrameScript(179, frame180);
}
function frame180(){
stop();
}
}
}//package MoreZombies_fla
Section 223
//hits_168 (MoreZombies_fla.hits_168)
package MoreZombies_fla {
import flash.display.*;
import flash.text.*;
public dynamic class hits_168 extends MovieClip {
public var t_hits:TextField;
}
}//package MoreZombies_fla
Section 224
//IDLE_FIRE_CHAINSAW_516 (MoreZombies_fla.IDLE_FIRE_CHAINSAW_516)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class IDLE_FIRE_CHAINSAW_516 extends MovieClip {
public var tar;
public function IDLE_FIRE_CHAINSAW_516(){
addFrameScript(8, frame9);
}
function frame9(){
tar = this.parent;
tar.gotoAndStop(1);
}
}
}//package MoreZombies_fla
Section 225
//IDLE_FIRE_EXTINGUISHER_515 (MoreZombies_fla.IDLE_FIRE_EXTINGUISHER_515)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class IDLE_FIRE_EXTINGUISHER_515 extends MovieClip {
public var tar;
public function IDLE_FIRE_EXTINGUISHER_515(){
addFrameScript(9, frame10);
}
function frame10(){
tar = this.parent;
tar.gotoAndStop(1);
}
}
}//package MoreZombies_fla
Section 226
//IDLE_FIRE_FIREARM1_511 (MoreZombies_fla.IDLE_FIRE_FIREARM1_511)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class IDLE_FIRE_FIREARM1_511 extends MovieClip {
public var tar;
public function IDLE_FIRE_FIREARM1_511(){
addFrameScript(2, frame3);
}
function frame3(){
tar = this.parent;
tar.gotoAndStop(1);
}
}
}//package MoreZombies_fla
Section 227
//IDLE_FIRE_FIREARM2_513 (MoreZombies_fla.IDLE_FIRE_FIREARM2_513)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class IDLE_FIRE_FIREARM2_513 extends MovieClip {
public var tar;
public function IDLE_FIRE_FIREARM2_513(){
addFrameScript(8, frame9);
}
function frame9(){
tar = this.parent;
tar.gotoAndStop(1);
}
}
}//package MoreZombies_fla
Section 228
//IDLE_FIRE_FIREARM3_514 (MoreZombies_fla.IDLE_FIRE_FIREARM3_514)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class IDLE_FIRE_FIREARM3_514 extends MovieClip {
public var tar;
public function IDLE_FIRE_FIREARM3_514(){
addFrameScript(11, frame12);
}
function frame12(){
tar = this.parent;
tar.gotoAndStop(1);
}
}
}//package MoreZombies_fla
Section 229
//IDLE_FIRE_FLAMETHROWER_517 (MoreZombies_fla.IDLE_FIRE_FLAMETHROWER_517)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class IDLE_FIRE_FLAMETHROWER_517 extends MovieClip {
public var tar;
public function IDLE_FIRE_FLAMETHROWER_517(){
addFrameScript(8, frame9);
}
function frame9(){
tar = this.parent;
tar.gotoAndStop(1);
}
}
}//package MoreZombies_fla
Section 230
//IDLE_FIRE_PUSHBUTTON_519 (MoreZombies_fla.IDLE_FIRE_PUSHBUTTON_519)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class IDLE_FIRE_PUSHBUTTON_519 extends MovieClip {
public var tar2;
public var tar;
public function IDLE_FIRE_PUSHBUTTON_519(){
addFrameScript(10, frame11);
}
function frame11(){
tar2 = this.parent.parent.parent.parent;
tar = this.parent;
tar.gotoAndStop(1);
tar2.detonate();
}
}
}//package MoreZombies_fla
Section 231
//IDLE_TORSO_466 (MoreZombies_fla.IDLE_TORSO_466)
package MoreZombies_fla {
import flash.media.*;
import com.tanoku.MoreZombies.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class IDLE_TORSO_466 extends MovieClip {
public var weaponManager:WeaponManager;
public function IDLE_TORSO_466(){
addFrameScript(0, frame1);
}
function frame1(){
weaponManager = WeaponManager.getInstance();
gotoAndStop(weaponManager.weaponList[weaponManager.currentWeapon].torso_group);
}
}
}//package MoreZombies_fla
Section 232
//impacto1_49 (MoreZombies_fla.impacto1_49)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class impacto1_49 extends MovieClip {
public var tar;
public function impacto1_49(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
tar = this.parent.parent;
tar.finalize();
}
}
}//package MoreZombies_fla
Section 233
//impacto2_50 (MoreZombies_fla.impacto2_50)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class impacto2_50 extends MovieClip {
public var tar;
public function impacto2_50(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
tar = this.parent.parent;
tar.finalize();
}
}
}//package MoreZombies_fla
Section 234
//impacto3_51 (MoreZombies_fla.impacto3_51)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class impacto3_51 extends MovieClip {
public var tar;
public function impacto3_51(){
addFrameScript(13, frame14);
}
function frame14(){
stop();
tar = this.parent.parent;
tar.finalize();
}
}
}//package MoreZombies_fla
Section 235
//impacto4_52 (MoreZombies_fla.impacto4_52)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class impacto4_52 extends MovieClip {
public var tar;
public function impacto4_52(){
addFrameScript(13, frame14);
}
function frame14(){
stop();
tar = this.parent.parent;
tar.finalize();
}
}
}//package MoreZombies_fla
Section 236
//impacto5_53 (MoreZombies_fla.impacto5_53)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class impacto5_53 extends MovieClip {
public var tar;
public function impacto5_53(){
addFrameScript(13, frame14);
}
function frame14(){
stop();
tar = this.parent.parent;
tar.finalize();
}
}
}//package MoreZombies_fla
Section 237
//impacto6_54 (MoreZombies_fla.impacto6_54)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class impacto6_54 extends MovieClip {
public var tar;
public function impacto6_54(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
tar = this.parent.parent;
tar.finalize();
}
}
}//package MoreZombies_fla
Section 238
//impacto7_55 (MoreZombies_fla.impacto7_55)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class impacto7_55 extends MovieClip {
public var tar;
public function impacto7_55(){
addFrameScript(15, frame16);
}
function frame16(){
stop();
tar = this.parent.parent;
tar.finalize();
}
}
}//package MoreZombies_fla
Section 239
//IntroCompleta_399 (MoreZombies_fla.IntroCompleta_399)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class IntroCompleta_399 extends MovieClip {
public var skip:btn_skip;
public var tar;
public function IntroCompleta_399(){
addFrameScript(0, frame1, 3, frame4, 4, frame5);
}
function frame1(){
stop();
x = 0;
y = 0;
}
function frame4(){
skip.addEventListener(MouseEvent.CLICK, on_button_clicked);
}
function frame5(){
tar = this;
tar.parent.nextFrame();
}
public function on_button_clicked(_arg1:MouseEvent){
switch (_arg1.target.name){
case "skip":
gotoAndStop("end");
break;
default:
trace((_arg1.target.name + " UNDEFINED"));
break;
};
}
}
}//package MoreZombies_fla
Section 240
//Intromc_415 (MoreZombies_fla.Intromc_415)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Intromc_415 extends MovieClip {
public var tar;
public function Intromc_415(){
addFrameScript(2728, frame2729);
}
function frame2729(){
tar = this;
tar.parent.nextFrame();
}
}
}//package MoreZombies_fla
Section 241
//jugador_01_456 (MoreZombies_fla.jugador_01_456)
package MoreZombies_fla {
import flash.display.*;
public dynamic class jugador_01_456 extends MovieClip {
public var hitarea:MovieClip;
public var body2:MovieClip;
public function jugador_01_456(){
addFrameScript(1, frame2);
}
function frame2(){
stop();
}
}
}//package MoreZombies_fla
Section 242
//LANZAGRANADA_TORSO_574 (MoreZombies_fla.LANZAGRANADA_TORSO_574)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class LANZAGRANADA_TORSO_574 extends MovieClip {
public var tar;
public function LANZAGRANADA_TORSO_574(){
addFrameScript(0, frame1, 8, frame9, 19, frame20);
}
function frame1(){
tar = this.parent.parent.parent;
tar.wait_animation(true);
tar.canMove = false;
}
function frame9(){
tar.createBullet();
}
function frame20(){
tar.wait_animation(false);
tar.canMove = true;
tar.siguiente_estado(tar.QUIETO);
}
}
}//package MoreZombies_fla
Section 243
//marcoascensor_811 (MoreZombies_fla.marcoascensor_811)
package MoreZombies_fla {
import flash.display.*;
public dynamic class marcoascensor_811 extends MovieClip {
public function marcoascensor_811(){
addFrameScript(198, frame199);
}
function frame199(){
stop();
}
}
}//package MoreZombies_fla
Section 244
//NOFIRE_LARM_526 (MoreZombies_fla.NOFIRE_LARM_526)
package MoreZombies_fla {
import flash.media.*;
import com.tanoku.MoreZombies.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class NOFIRE_LARM_526 extends MovieClip {
public var weaponManager:WeaponManager;
public function NOFIRE_LARM_526(){
addFrameScript(0, frame1);
}
function frame1(){
weaponManager = WeaponManager.getInstance();
gotoAndStop(weaponManager.weaponList[weaponManager.currentWeapon].index);
}
}
}//package MoreZombies_fla
Section 245
//NOFIRE_RARM_529 (MoreZombies_fla.NOFIRE_RARM_529)
package MoreZombies_fla {
import flash.media.*;
import com.tanoku.MoreZombies.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class NOFIRE_RARM_529 extends MovieClip {
public var weaponManager:WeaponManager;
public function NOFIRE_RARM_529(){
addFrameScript(0, frame1);
}
function frame1(){
weaponManager = WeaponManager.getInstance();
gotoAndStop(weaponManager.weaponList[weaponManager.currentWeapon].index);
}
}
}//package MoreZombies_fla
Section 246
//panel_armas_354 (MoreZombies_fla.panel_armas_354)
package MoreZombies_fla {
import flash.display.*;
import flash.text.*;
public dynamic class panel_armas_354 extends MovieClip {
public var estado_slot3:MovieClip;
public var estado_melee:MovieClip;
public var municion_slot2:TextField;
public var municion_slot4:TextField;
public var arma_slot1:weapons_buttons_array;
public var arma_slot3:weapons_buttons_array;
public var arma_melee:weapons_buttons_array;
public var arma_slot2:weapons_buttons_array;
public var municion_slot1:TextField;
public var arma_slot4:weapons_buttons_array;
public var municion_slot3:TextField;
public var estado_slot1:MovieClip;
public var estado_slot2:MovieClip;
public var estado_slot4:MovieClip;
}
}//package MoreZombies_fla
Section 247
//panel_barriles_restantes_212 (MoreZombies_fla.panel_barriles_restantes_212)
package MoreZombies_fla {
import flash.display.*;
import flash.text.*;
public dynamic class panel_barriles_restantes_212 extends MovieClip {
public var bidones:TextField;
}
}//package MoreZombies_fla
Section 248
//panel_oleadas_restantes_214 (MoreZombies_fla.panel_oleadas_restantes_214)
package MoreZombies_fla {
import flash.display.*;
import flash.text.*;
public dynamic class panel_oleadas_restantes_214 extends MovieClip {
public var restantes:TextField;
}
}//package MoreZombies_fla
Section 249
//panel_reloj_377 (MoreZombies_fla.panel_reloj_377)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class panel_reloj_377 extends MovieClip {
public var mc_mascara:MovieClip;
public var mc_reloj2:MovieClip;
public var mc_reloj:MovieClip;
public function panel_reloj_377(){
addFrameScript(0, frame1);
}
function frame1(){
mc_mascara.setMask = mc_reloj;
}
}
}//package MoreZombies_fla
Section 250
//panel_vida_carrito_215 (MoreZombies_fla.panel_vida_carrito_215)
package MoreZombies_fla {
import flash.display.*;
public dynamic class panel_vida_carrito_215 extends MovieClip {
public var vida:MovieClip;
}
}//package MoreZombies_fla
Section 251
//PLAYER_AITSOFIRE_596 (MoreZombies_fla.PLAYER_AITSOFIRE_596)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class PLAYER_AITSOFIRE_596 extends MovieClip {
public var tar;
public function PLAYER_AITSOFIRE_596(){
addFrameScript(0, frame1, 43, frame44, 107, frame108);
}
function frame1(){
tar = this.parent.parent;
tar.wait_animation(true);
tar.canMove = false;
tar.soundManager.playSound("AITSO", 1, 1);
}
function frame108(){
tar.wait_animation(false);
tar.canMove = true;
tar.siguiente_estado(tar.QUIETO);
}
function frame44(){
tar.createBullet();
}
}
}//package MoreZombies_fla
Section 252
//PLAYER_COMBOMELEE1_555 (MoreZombies_fla.PLAYER_COMBOMELEE1_555)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class PLAYER_COMBOMELEE1_555 extends MovieClip {
public var val:int;
public var tar;
public var area:area_roja;
public var canMove;
public function PLAYER_COMBOMELEE1_555(){
addFrameScript(0, frame1, 3, frame4, 6, frame7, 20, frame21);
}
function frame7(){
if (canMove){
tar.mover("adelante", 15.5);
};
tar.checkHit(area, true, 39.9);
}
function frame1(){
tar = this.parent.parent;
tar.wait_animation(true);
tar.canMove = false;
canMove = true;
}
function frame4(){
if (canMove){
tar.mover("adelante", 24.4);
};
tar.suavizar_movimiento_camara = true;
val = ((Math.random() * 2) + 1);
if (val == 1){
tar.soundManager.playSound("woosh_corto_01", 1, 1);
};
if (val == 2){
tar.soundManager.playSound("woosh_corto_02", 1, 1);
};
}
function frame21(){
tar.wait_animation(false);
tar.canMove = true;
tar.siguiente_estado(tar.QUIETO);
tar.suavizar_movimiento_camara = false;
}
}
}//package MoreZombies_fla
Section 253
//PLAYER_COMBOMELEE2_561 (MoreZombies_fla.PLAYER_COMBOMELEE2_561)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class PLAYER_COMBOMELEE2_561 extends MovieClip {
public var val:int;
public var tar;
public var area:area_roja;
public var canMove;
public function PLAYER_COMBOMELEE2_561(){
addFrameScript(0, frame1, 3, frame4, 6, frame7, 9, frame10, 12, frame13, 21, frame22);
}
function frame10(){
if (canMove){
tar.mover("adelante", 10);
};
val = ((Math.random() * 2) + 1);
if (val == 1){
tar.soundManager.playSound("woosh_corto_01", 1, 1);
};
if (val == 2){
tar.soundManager.playSound("woosh_corto_02", 1, 1);
};
}
function frame7(){
if (canMove){
tar.mover("adelante", 20);
};
}
function frame1(){
tar = this.parent.parent;
tar.wait_animation(true);
tar.canMove = false;
canMove = true;
if (canMove){
tar.mover("adelante", 19.5);
};
tar.suavizar_movimiento_camara = true;
}
function frame22(){
tar.wait_animation(false);
tar.canMove = true;
tar.siguiente_estado(tar.QUIETO);
tar.suavizar_movimiento_camara = false;
}
function frame13(){
if (canMove){
tar.mover("adelante", 10);
};
tar.checkHit(area, true, 60);
}
function frame4(){
if (canMove){
tar.mover("adelante", 10.5);
};
}
}
}//package MoreZombies_fla
Section 254
//PLAYER_COMBOMELEE3_565 (MoreZombies_fla.PLAYER_COMBOMELEE3_565)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class PLAYER_COMBOMELEE3_565 extends MovieClip {
public var val:int;
public var tar;
public var area:area_roja;
public var canMove;
public function PLAYER_COMBOMELEE3_565(){
addFrameScript(0, frame1, 3, frame4, 6, frame7, 9, frame10, 20, frame21);
}
function frame10(){
if (canMove){
tar.mover("adelante", 8.5);
};
tar.checkHit(area, true, 54.1);
}
function frame7(){
if (canMove){
tar.mover("adelante", 15);
};
}
function frame1(){
tar = this.parent.parent;
tar.wait_animation(true);
tar.canMove = false;
canMove = true;
if (canMove){
tar.mover("adelante", 15);
};
tar.suavizar_movimiento_camara = true;
}
function frame4(){
if (canMove){
tar.mover("adelante", 15.6);
};
val = ((Math.random() * 2) + 1);
if (val == 1){
tar.soundManager.playSound("woosh_medio_01", 1, 1);
};
if (val == 2){
tar.soundManager.playSound("woosh_medio_02", 1, 1);
};
}
function frame21(){
tar.wait_animation(false);
tar.canMove = true;
tar.siguiente_estado(tar.QUIETO);
tar.suavizar_movimiento_camara = false;
}
}
}//package MoreZombies_fla
Section 255
//PLAYER_COMBOMELEE4_568 (MoreZombies_fla.PLAYER_COMBOMELEE4_568)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class PLAYER_COMBOMELEE4_568 extends MovieClip {
public var val:int;
public var tar;
public var area:area_roja;
public var canMove;
public function PLAYER_COMBOMELEE4_568(){
addFrameScript(0, frame1, 4, frame5, 8, frame9, 12, frame13, 16, frame17, 31, frame32);
}
function frame1(){
tar = this.parent.parent;
tar.wait_animation(true);
tar.canMove = false;
canMove = true;
if (canMove){
tar.mover("adelante", 41.5);
};
tar.suavizar_movimiento_camara = true;
}
function frame13(){
if (canMove){
tar.mover("adelante", 12.5);
};
}
function frame17(){
if (canMove){
tar.mover("adelante", 5);
};
tar.checkHit(area, true, 86.5);
}
function frame9(){
if (canMove){
tar.mover("adelante", 13.5);
};
val = ((Math.random() * 2) + 1);
if (val == 1){
tar.soundManager.playSound("woosh_largo_01", 1, 1);
};
if (val == 2){
tar.soundManager.playSound("woosh_largo_02", 1, 1);
};
}
function frame5(){
if (canMove){
tar.mover("adelante", 14);
};
}
function frame32(){
tar.wait_animation(false);
tar.canMove = true;
tar.siguiente_estado(tar.QUIETO);
tar.suavizar_movimiento_camara = false;
}
}
}//package MoreZombies_fla
Section 256
//PLAYER_DAMAGEDDELANTE_548 (MoreZombies_fla.PLAYER_DAMAGEDDELANTE_548)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class PLAYER_DAMAGEDDELANTE_548 extends MovieClip {
public var tar;
public function PLAYER_DAMAGEDDELANTE_548(){
addFrameScript(0, frame1, 38, frame39);
}
function frame1(){
tar = this.parent.parent;
tar.wait_animation(true);
tar.canMove = false;
}
function frame39(){
if (tar.bited == true){
gotoAndPlay(1);
} else {
tar.wait_animation(false);
tar.canMove = true;
tar.siguiente_estado(tar.QUIETO);
};
}
}
}//package MoreZombies_fla
Section 257
//PLAYER_DEJAMINA_576 (MoreZombies_fla.PLAYER_DEJAMINA_576)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class PLAYER_DEJAMINA_576 extends MovieClip {
public var tar;
public function PLAYER_DEJAMINA_576(){
addFrameScript(0, frame1, 14, frame15);
}
function frame15(){
tar.wait_animation(false);
tar.canMove = true;
tar.siguiente_estado(tar.QUIETO);
tar.createBullet();
}
function frame1(){
tar = this.parent.parent;
tar.wait_animation(true);
tar.canMove = false;
}
}
}//package MoreZombies_fla
Section 258
//PLAYER_DIED_585 (MoreZombies_fla.PLAYER_DIED_585)
package MoreZombies_fla {
import flash.display.*;
public dynamic class PLAYER_DIED_585 extends MovieClip {
public function PLAYER_DIED_585(){
addFrameScript(58, frame59);
}
function frame59(){
stop();
}
}
}//package MoreZombies_fla
Section 259
//PLAYER_EMPUJA_591 (MoreZombies_fla.PLAYER_EMPUJA_591)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class PLAYER_EMPUJA_591 extends MovieClip {
public var tar;
public var area:area_roja;
public function PLAYER_EMPUJA_591(){
addFrameScript(0, frame1, 9, frame10, 14, frame15, 26, frame27);
}
function frame10(){
tar.checkHit(area, false, 70);
tar.soundManager.playSound("player_zafarse", 1, 1);
}
function frame15(){
tar.zafarse();
}
function frame1(){
tar = this.parent.parent;
tar.wait_animation(true);
tar.canMove = false;
}
function frame27(){
tar.wait_animation(false);
tar.canMove = true;
tar.siguiente_estado(tar.QUIETO);
}
}
}//package MoreZombies_fla
Section 260
//PLAYER_IDLE_457 (MoreZombies_fla.PLAYER_IDLE_457)
package MoreZombies_fla {
import flash.display.*;
public dynamic class PLAYER_IDLE_457 extends MovieClip {
public var chest:MovieClip;
}
}//package MoreZombies_fla
Section 261
//PLAYER_MORDIDO_580 (MoreZombies_fla.PLAYER_MORDIDO_580)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class PLAYER_MORDIDO_580 extends MovieClip {
public var tar;
public function PLAYER_MORDIDO_580(){
addFrameScript(0, frame1, 65, frame66);
}
function frame1(){
tar = this.parent.parent;
tar.canMove = false;
}
function frame66(){
if (tar.bited == true){
gotoAndPlay(31);
} else {
tar.canMove = true;
tar.siguiente_estado(tar.QUIETO);
};
}
}
}//package MoreZombies_fla
Section 262
//PLAYER_MORIRCONGELADO_600 (MoreZombies_fla.PLAYER_MORIRCONGELADO_600)
package MoreZombies_fla {
import flash.display.*;
public dynamic class PLAYER_MORIRCONGELADO_600 extends MovieClip {
public function PLAYER_MORIRCONGELADO_600(){
addFrameScript(28, frame29);
}
function frame29(){
stop();
}
}
}//package MoreZombies_fla
Section 263
//PLAYER_RUN_533 (MoreZombies_fla.PLAYER_RUN_533)
package MoreZombies_fla {
import flash.display.*;
public dynamic class PLAYER_RUN_533 extends MovieClip {
public var chest:MovieClip;
}
}//package MoreZombies_fla
Section 264
//PLAYER_RUNINVERSE_547 (MoreZombies_fla.PLAYER_RUNINVERSE_547)
package MoreZombies_fla {
import flash.display.*;
public dynamic class PLAYER_RUNINVERSE_547 extends MovieClip {
public var chest:MovieClip;
}
}//package MoreZombies_fla
Section 265
//PLAYER_STINGER_FIRE_594 (MoreZombies_fla.PLAYER_STINGER_FIRE_594)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class PLAYER_STINGER_FIRE_594 extends MovieClip {
public var tar;
public function PLAYER_STINGER_FIRE_594(){
addFrameScript(0, frame1, 2, frame3, 49, frame50);
}
function frame3(){
tar.createBullet();
}
function frame1(){
tar = this.parent.parent;
tar.wait_animation(true);
tar.canMove = false;
}
function frame50(){
tar.wait_animation(false);
tar.canMove = true;
tar.siguiente_estado(tar.QUIETO);
}
}
}//package MoreZombies_fla
Section 266
//PLAYER_WALK_552 (MoreZombies_fla.PLAYER_WALK_552)
package MoreZombies_fla {
import flash.display.*;
public dynamic class PLAYER_WALK_552 extends MovieClip {
public var chest:MovieClip;
}
}//package MoreZombies_fla
Section 267
//PLAYER_WALKINVERSE_554 (MoreZombies_fla.PLAYER_WALKINVERSE_554)
package MoreZombies_fla {
import flash.display.*;
public dynamic class PLAYER_WALKINVERSE_554 extends MovieClip {
public var chest:MovieClip;
}
}//package MoreZombies_fla
Section 268
//PLAYER_VICTORIA_601 (MoreZombies_fla.PLAYER_VICTORIA_601)
package MoreZombies_fla {
import flash.display.*;
public dynamic class PLAYER_VICTORIA_601 extends MovieClip {
public function PLAYER_VICTORIA_601(){
addFrameScript(51, frame52);
}
function frame52(){
stop();
}
}
}//package MoreZombies_fla
Section 269
//polvocorre_47 (MoreZombies_fla.polvocorre_47)
package MoreZombies_fla {
import flash.display.*;
public dynamic class polvocorre_47 extends MovieClip {
public function polvocorre_47(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package MoreZombies_fla
Section 270
//reflejosueloquema_692 (MoreZombies_fla.reflejosueloquema_692)
package MoreZombies_fla {
import flash.display.*;
public dynamic class reflejosueloquema_692 extends MovieClip {
public var contador:int;
public function reflejosueloquema_692(){
addFrameScript(0, frame1, 20, frame21);
}
function frame1(){
contador = 0;
cacheAsBitmap = true;
}
function frame21(){
}
}
}//package MoreZombies_fla
Section 271
//RUN_FIRE_CHAINSAW_543 (MoreZombies_fla.RUN_FIRE_CHAINSAW_543)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class RUN_FIRE_CHAINSAW_543 extends MovieClip {
public var tar;
public function RUN_FIRE_CHAINSAW_543(){
addFrameScript(8, frame9);
}
function frame9(){
tar = this.parent;
tar.gotoAndStop(1);
}
}
}//package MoreZombies_fla
Section 272
//RUN_FIRE_EXTINGUISHER_542 (MoreZombies_fla.RUN_FIRE_EXTINGUISHER_542)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class RUN_FIRE_EXTINGUISHER_542 extends MovieClip {
public var tar;
public function RUN_FIRE_EXTINGUISHER_542(){
addFrameScript(2, frame3);
}
function frame3(){
tar = this.parent;
tar.gotoAndStop(1);
}
}
}//package MoreZombies_fla
Section 273
//RUN_FIRE_FIREARM1_539 (MoreZombies_fla.RUN_FIRE_FIREARM1_539)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class RUN_FIRE_FIREARM1_539 extends MovieClip {
public var tar;
public function RUN_FIRE_FIREARM1_539(){
addFrameScript(2, frame3);
}
function frame3(){
tar = this.parent;
tar.gotoAndStop(1);
}
}
}//package MoreZombies_fla
Section 274
//RUN_FIRE_FIREARM2_540 (MoreZombies_fla.RUN_FIRE_FIREARM2_540)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class RUN_FIRE_FIREARM2_540 extends MovieClip {
public var tar;
public function RUN_FIRE_FIREARM2_540(){
addFrameScript(8, frame9);
}
function frame9(){
tar = this.parent;
tar.gotoAndStop(1);
}
}
}//package MoreZombies_fla
Section 275
//RUN_FIRE_FIREARM3_541 (MoreZombies_fla.RUN_FIRE_FIREARM3_541)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class RUN_FIRE_FIREARM3_541 extends MovieClip {
public var tar;
public function RUN_FIRE_FIREARM3_541(){
addFrameScript(11, frame12);
}
function frame12(){
tar = this.parent.parent.parent.parent;
stop();
tar.siguiente_estado(tar.QUIETO);
}
}
}//package MoreZombies_fla
Section 276
//RUN_FIRE_FLAMETHROWER_544 (MoreZombies_fla.RUN_FIRE_FLAMETHROWER_544)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class RUN_FIRE_FLAMETHROWER_544 extends MovieClip {
public var tar;
public function RUN_FIRE_FLAMETHROWER_544(){
addFrameScript(2, frame3);
}
function frame3(){
tar = this.parent;
tar.gotoAndStop(1);
}
}
}//package MoreZombies_fla
Section 277
//RUN_FIRE_PUSHBUTTON_545 (MoreZombies_fla.RUN_FIRE_PUSHBUTTON_545)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class RUN_FIRE_PUSHBUTTON_545 extends MovieClip {
public var tar2;
public var tar;
public function RUN_FIRE_PUSHBUTTON_545(){
addFrameScript(10, frame11);
}
function frame11(){
tar2 = this.parent.parent.parent.parent;
tar = this.parent;
tar.gotoAndStop(1);
tar2.detonate();
}
}
}//package MoreZombies_fla
Section 278
//RUN_TORSO_535 (MoreZombies_fla.RUN_TORSO_535)
package MoreZombies_fla {
import flash.media.*;
import com.tanoku.MoreZombies.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class RUN_TORSO_535 extends MovieClip {
public var weaponManager:WeaponManager;
public function RUN_TORSO_535(){
addFrameScript(0, frame1);
}
function frame1(){
weaponManager = WeaponManager.getInstance();
gotoAndStop(weaponManager.weaponList[weaponManager.currentWeapon].torso_group);
}
}
}//package MoreZombies_fla
Section 279
//sangredinamica1_56 (MoreZombies_fla.sangredinamica1_56)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class sangredinamica1_56 extends MovieClip {
public var tar;
public function sangredinamica1_56(){
addFrameScript(34, frame35);
}
function frame35(){
stop();
tar = this.parent.parent;
tar.finalize();
}
}
}//package MoreZombies_fla
Section 280
//sangremordido_48 (MoreZombies_fla.sangremordido_48)
package MoreZombies_fla {
import com.tanoku.MoreZombies.*;
import flash.display.*;
public dynamic class sangremordido_48 extends MovieClip {
public function sangremordido_48(){
addFrameScript(0, frame1);
}
function frame1(){
if (Globals.SANGRE_ACTIVA == false){
visible = false;
};
}
}
}//package MoreZombies_fla
Section 281
//sentence_220 (MoreZombies_fla.sentence_220)
package MoreZombies_fla {
import flash.display.*;
import flash.text.*;
public dynamic class sentence_220 extends MovieClip {
public var info:TextField;
}
}//package MoreZombies_fla
Section 282
//sentence_combo_221 (MoreZombies_fla.sentence_combo_221)
package MoreZombies_fla {
import flash.display.*;
import flash.text.*;
public dynamic class sentence_combo_221 extends MovieClip {
public var info:TextField;
}
}//package MoreZombies_fla
Section 283
//sentence_flotante_222 (MoreZombies_fla.sentence_flotante_222)
package MoreZombies_fla {
import flash.display.*;
import flash.text.*;
public dynamic class sentence_flotante_222 extends MovieClip {
public var info:TextField;
}
}//package MoreZombies_fla
Section 284
//shadow_idle_608 (MoreZombies_fla.shadow_idle_608)
package MoreZombies_fla {
import flash.display.*;
public dynamic class shadow_idle_608 extends MovieClip {
public var contador:int;
public function shadow_idle_608(){
addFrameScript(0, frame1, 199, frame200);
}
function frame200(){
if (contador >= 3){
gotoAndPlay(1);
} else {
contador = (contador + 1);
gotoAndPlay(101);
};
}
function frame1(){
contador = 0;
cacheAsBitmap = true;
}
}
}//package MoreZombies_fla
Section 285
//shadow_muerde_639 (MoreZombies_fla.shadow_muerde_639)
package MoreZombies_fla {
import flash.display.*;
public dynamic class shadow_muerde_639 extends MovieClip {
public function shadow_muerde_639(){
addFrameScript(65, frame66);
}
function frame66(){
gotoAndPlay(31);
}
}
}//package MoreZombies_fla
Section 286
//shadow_victoria_602 (MoreZombies_fla.shadow_victoria_602)
package MoreZombies_fla {
import flash.display.*;
public dynamic class shadow_victoria_602 extends MovieClip {
public function shadow_victoria_602(){
addFrameScript(51, frame52);
}
function frame52(){
stop();
}
}
}//package MoreZombies_fla
Section 287
//Sponsormc_401 (MoreZombies_fla.Sponsormc_401)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Sponsormc_401 extends MovieClip {
public var tar;
public function Sponsormc_401(){
addFrameScript(310, frame311);
}
function frame311(){
tar = this;
tar.parent.nextFrame();
}
}
}//package MoreZombies_fla
Section 288
//submit_score_391 (MoreZombies_fla.submit_score_391)
package MoreZombies_fla {
import flash.display.*;
import flash.text.*;
public dynamic class submit_score_391 extends MovieClip {
public var nombre_player:TextField;
public var alerta:TextField;
public var btn_ok:SimpleButton;
public var submited:TextField;
public var btn_cancel:SimpleButton;
}
}//package MoreZombies_fla
Section 289
//Tanokumc_411 (MoreZombies_fla.Tanokumc_411)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Tanokumc_411 extends MovieClip {
public var tar;
public function Tanokumc_411(){
addFrameScript(179, frame180);
}
function frame180(){
tar = this;
tar.parent.nextFrame();
}
}
}//package MoreZombies_fla
Section 290
//time_225 (MoreZombies_fla.time_225)
package MoreZombies_fla {
import flash.display.*;
import flash.text.*;
public dynamic class time_225 extends MovieClip {
public var reloj:TextField;
}
}//package MoreZombies_fla
Section 291
//Warnig_400 (MoreZombies_fla.Warnig_400)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Warnig_400 extends MovieClip {
public var tar;
public function Warnig_400(){
addFrameScript(199, frame200);
}
function frame200(){
tar = this;
tar.parent.nextFrame();
}
}
}//package MoreZombies_fla
Section 292
//VCam_AS3_Interactive_417 (MoreZombies_fla.VCam_AS3_Interactive_417)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class VCam_AS3_Interactive_417 extends MovieClip {
public var sH:Number;
public var rp:Point;
public var sW:Number;
public var bounds_obj:Object;
public var camH:Number;
public var camW:Number;
public var oldScaleMode:String;
public function VCam_AS3_Interactive_417(){
addFrameScript(0, frame1);
}
public function set scaleX2(_arg1:Number):void{
setProperty2("scaleX", _arg1);
}
function frame1(){
mouseEnabled = false;
visible = false;
oldScaleMode = stage.scaleMode;
stage.scaleMode = "exactFit";
sW = stage.stageWidth;
sH = stage.stageHeight;
stage.scaleMode = oldScaleMode;
bounds_obj = this.getBounds(this);
camH = bounds_obj.height;
camW = bounds_obj.width;
rp = new Point(x, y);
addEventListener(Event.ENTER_FRAME, camControl);
addEventListener(Event.REMOVED_FROM_STAGE, reset);
camControl();
}
public function set x2(_arg1:Number):void{
var _local2:Point;
_local2 = parent.parent.globalToLocal(parent.localToGlobal(rp));
parent.x = (parent.x + (_arg1 - _local2.x));
}
public function get rotation2():Number{
return (parent.rotation);
}
public function camControl(... _args):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
rp.x = x;
rp.y = y;
_local2 = (camH * scaleY);
_local3 = (camW * scaleX);
_local4 = (sH / _local2);
_local5 = (sW / _local3);
x2 = ((_local3 / 2) * _local5);
y2 = ((_local2 / 2) * _local4);
scaleX2 = _local5;
scaleY2 = _local4;
rotation2 = -(rotation);
parent.filters = this.filters;
parent.transform.colorTransform = this.transform.colorTransform;
}
public function set scaleY2(_arg1:Number):void{
setProperty2("scaleY", _arg1);
}
public function get scaleX2():Number{
return (parent.scaleX);
}
public function get x2():Number{
var _local1:Point;
_local1 = parent.parent.globalToLocal(parent.localToGlobal(rp));
return (_local1.x);
}
public function setProperty2(_arg1:String, _arg2:Number):void{
var _local3:Point;
var _local4:Point;
_local3 = parent.parent.globalToLocal(parent.localToGlobal(rp));
parent[_arg1] = _arg2;
_local4 = parent.parent.globalToLocal(parent.localToGlobal(rp));
parent.x = (parent.x - (_local4.x - _local3.x));
parent.y = (parent.y - (_local4.y - _local3.y));
}
public function set y2(_arg1:Number):void{
var _local2:Point;
_local2 = parent.parent.globalToLocal(parent.localToGlobal(rp));
parent.y = (parent.y + (_arg1 - _local2.y));
}
public function reset(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, camControl);
removeEventListener(Event.REMOVED_FROM_STAGE, reset);
parent.scaleX = 1;
parent.scaleY = 1;
parent.x = 0;
parent.y = 0;
parent.rotation = 0;
parent.visible = true;
}
public function get scaleY2():Number{
return (parent.scaleY);
}
public function get y2():Number{
var _local1:Point;
_local1 = parent.parent.globalToLocal(parent.localToGlobal(rp));
return (_local1.y);
}
public function set rotation2(_arg1:Number):void{
setProperty2("rotation", _arg1);
}
}
}//package MoreZombies_fla
Section 293
//VCam_AS3_Interactive_66 (MoreZombies_fla.VCam_AS3_Interactive_66)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class VCam_AS3_Interactive_66 extends MovieClip {
public var sH:Number;
public var rp:Point;
public var sW:Number;
public var bounds_obj:Object;
public var camH:Number;
public var camW:Number;
public var oldScaleMode:String;
public function VCam_AS3_Interactive_66(){
addFrameScript(0, frame1);
}
public function set scaleX2(_arg1:Number):void{
setProperty2("scaleX", _arg1);
}
function frame1(){
mouseEnabled = false;
visible = false;
oldScaleMode = stage.scaleMode;
stage.scaleMode = "exactFit";
sW = stage.stageWidth;
sH = stage.stageHeight;
stage.scaleMode = oldScaleMode;
bounds_obj = this.getBounds(this);
camH = bounds_obj.height;
camW = bounds_obj.width;
rp = new Point(x, y);
addEventListener(Event.ENTER_FRAME, camControl);
addEventListener(Event.REMOVED_FROM_STAGE, reset);
camControl();
}
public function set x2(_arg1:Number):void{
var _local2:Point;
_local2 = parent.parent.globalToLocal(parent.localToGlobal(rp));
parent.x = (parent.x + (_arg1 - _local2.x));
}
public function get rotation2():Number{
return (parent.rotation);
}
public function camControl(... _args):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
rp.x = x;
rp.y = y;
_local2 = (camH * scaleY);
_local3 = (camW * scaleX);
_local4 = (sH / _local2);
_local5 = (sW / _local3);
x2 = ((_local3 / 2) * _local5);
y2 = ((_local2 / 2) * _local4);
scaleX2 = _local5;
scaleY2 = _local4;
rotation2 = -(rotation);
parent.filters = this.filters;
parent.transform.colorTransform = this.transform.colorTransform;
}
public function set scaleY2(_arg1:Number):void{
setProperty2("scaleY", _arg1);
}
public function get scaleX2():Number{
return (parent.scaleX);
}
public function get x2():Number{
var _local1:Point;
_local1 = parent.parent.globalToLocal(parent.localToGlobal(rp));
return (_local1.x);
}
public function setProperty2(_arg1:String, _arg2:Number):void{
var _local3:Point;
var _local4:Point;
_local3 = parent.parent.globalToLocal(parent.localToGlobal(rp));
parent[_arg1] = _arg2;
_local4 = parent.parent.globalToLocal(parent.localToGlobal(rp));
parent.x = (parent.x - (_local4.x - _local3.x));
parent.y = (parent.y - (_local4.y - _local3.y));
}
public function set y2(_arg1:Number):void{
var _local2:Point;
_local2 = parent.parent.globalToLocal(parent.localToGlobal(rp));
parent.y = (parent.y + (_arg1 - _local2.y));
}
public function reset(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, camControl);
removeEventListener(Event.REMOVED_FROM_STAGE, reset);
parent.scaleX = 1;
parent.scaleY = 1;
parent.x = 0;
parent.y = 0;
parent.rotation = 0;
parent.visible = true;
}
public function get scaleY2():Number{
return (parent.scaleY);
}
public function get y2():Number{
var _local1:Point;
_local1 = parent.parent.globalToLocal(parent.localToGlobal(rp));
return (_local1.y);
}
public function set rotation2(_arg1:Number):void{
setProperty2("rotation", _arg1);
}
}
}//package MoreZombies_fla
Section 294
//weapons_description_array_228 (MoreZombies_fla.weapons_description_array_228)
package MoreZombies_fla {
import flash.media.*;
import com.tanoku.MoreZombies.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class weapons_description_array_228 extends MovieClip {
public var weaponShop:WeaponShop;
public var nombre_arma:TextField;
public var range:TextField;
public var clip_ammo:TextField;
public var damage:TextField;
public var delay:TextField;
public var descripcion:TextField;
public var especial:TextField;
public var max_ammo:TextField;
public var current_ammo:TextField;
public function weapons_description_array_228(){
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);
}
public function updateData(){
var _local1:int;
_local1 = (currentFrame - 1);
nombre_arma.text = weaponShop.weaponList[_local1].name;
descripcion.text = "";
damage.text = "";
delay.text = "";
range.text = "";
max_ammo.text = "";
current_ammo.text = "";
clip_ammo.text = "";
especial.text = "";
descripcion.text = ("" + weaponShop.weaponList[_local1].desc);
if (weaponShop.weaponList[_local1].max_ammo > 0){
if (weaponShop.weaponList[_local1].damageOnImpact == false){
damage.text = (("Freeze: " + (weaponShop.weaponList[_local1].damage / 1000)) + " secs.");
delay.text = (("Delay: " + (weaponShop.weaponList[_local1].delay / 1000)) + " secs.");
range.text = ("Range: " + weaponShop.weaponList[_local1].range);
max_ammo.text = ("Max. ammo: " + weaponShop.weaponList[_local1].max_ammo);
current_ammo.text = ("Cur. ammo: " + weaponShop.weaponList[_local1].current_ammo);
clip_ammo.text = ("Clip: " + weaponShop.weaponList[_local1].clip);
} else {
damage.text = ("Damage: " + weaponShop.weaponList[_local1].damage);
delay.text = (("Delay: " + (weaponShop.weaponList[_local1].delay / 1000)) + " secs.");
range.text = ("Range: " + weaponShop.weaponList[_local1].range);
max_ammo.text = ("Max. ammo: " + weaponShop.weaponList[_local1].max_ammo);
current_ammo.text = ("Cur. ammo: " + weaponShop.weaponList[_local1].current_ammo);
clip_ammo.text = ("Clip: " + weaponShop.weaponList[_local1].clip);
};
} else {
if (weaponShop.weaponList[_local1].damageOnImpact == false){
damage.text = (("Freeze: " + (weaponShop.weaponList[_local1].damage / 1000)) + " secs.");
max_ammo.text = ("Max. combo: " + weaponShop.weaponList[_local1].maxCombo);
} else {
damage.text = ("Damage: " + weaponShop.weaponList[_local1].damage);
max_ammo.text = ("Max. combo: " + weaponShop.weaponList[_local1].maxCombo);
};
};
if (weaponShop.weaponList[_local1].special != ""){
especial.text = ("Special: " + weaponShop.weaponList[_local1].special);
};
}
function frame10(){
updateData();
}
function frame14(){
updateData();
}
function frame18(){
updateData();
}
function frame3(){
updateData();
}
function frame7(){
updateData();
}
function frame19(){
updateData();
}
function frame6(){
updateData();
}
function frame13(){
updateData();
}
function frame17(){
updateData();
}
function frame9(){
updateData();
}
function frame1(){
weaponShop = WeaponShop.getInstance();
}
function frame4(){
updateData();
}
function frame21(){
updateData();
}
function frame2(){
updateData();
}
function frame5(){
updateData();
}
function frame23(){
updateData();
}
function frame24(){
updateData();
}
function frame28(){
updateData();
}
function frame15(){
updateData();
}
function frame22(){
updateData();
}
function frame25(){
updateData();
}
function frame27(){
updateData();
}
function frame11(){
updateData();
}
function frame16(){
updateData();
}
function frame37(){
updateData();
}
function frame30(){
updateData();
}
function frame33(){
updateData();
}
function frame34(){
updateData();
}
function frame8(){
updateData();
}
function frame26(){
updateData();
}
function frame32(){
updateData();
}
function frame36(){
updateData();
}
function frame12(){
updateData();
}
function frame20(){
updateData();
}
function frame31(){
updateData();
}
function frame35(){
updateData();
}
function frame29(){
updateData();
}
}
}//package MoreZombies_fla
Section 295
//weapons_locked_array_229 (MoreZombies_fla.weapons_locked_array_229)
package MoreZombies_fla {
import flash.media.*;
import com.tanoku.MoreZombies.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class weapons_locked_array_229 extends MovieClip {
public var info:TextField;
public function weapons_locked_array_229(){
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);
}
public function updateData(){
var _local1:int;
var _local2:WeaponShop;
_local1 = (currentFrame - 1);
_local2 = WeaponShop.getInstance();
info.text = "";
info.text = (("Kill " + _local2.weaponList[_local1].killsToUnlock) + " zombies to unlock this weapon");
}
function frame10(){
updateData();
}
function frame14(){
updateData();
}
function frame18(){
updateData();
}
function frame12(){
updateData();
}
function frame3(){
updateData();
}
function frame6(){
updateData();
}
function frame7(){
updateData();
}
function frame1(){
}
function frame19(){
updateData();
}
function frame25(){
updateData();
}
function frame13(){
updateData();
}
function frame17(){
updateData();
}
function frame4(){
updateData();
}
function frame5(){
updateData();
}
function frame9(){
updateData();
}
function frame22(){
updateData();
}
function frame16(){
updateData();
}
function frame8(){
updateData();
}
function frame21(){
updateData();
}
function frame2(){
updateData();
}
function frame15(){
updateData();
}
function frame23(){
updateData();
}
function frame24(){
updateData();
}
function frame28(){
updateData();
}
function frame36(){
updateData();
}
function frame20(){
updateData();
}
function frame30(){
updateData();
}
function frame31(){
updateData();
}
function frame34(){
updateData();
}
function frame27(){
updateData();
}
function frame11(){
updateData();
}
function frame35(){
updateData();
}
function frame37(){
updateData();
}
function frame29(){
updateData();
}
function frame33(){
updateData();
}
function frame26(){
updateData();
}
function frame32(){
updateData();
}
}
}//package MoreZombies_fla
Section 296
//viento1_39 (MoreZombies_fla.viento1_39)
package MoreZombies_fla {
import flash.display.*;
public dynamic class viento1_39 extends MovieClip {
public function viento1_39(){
addFrameScript(18, frame19);
}
function frame19(){
stop();
}
}
}//package MoreZombies_fla
Section 297
//viny6_754 (MoreZombies_fla.viny6_754)
package MoreZombies_fla {
import flash.display.*;
public dynamic class viny6_754 extends MovieClip {
public function viny6_754(){
addFrameScript(104, frame105);
}
function frame105(){
stop();
}
}
}//package MoreZombies_fla
Section 298
//Z_ANTEBRAZOL_611 (MoreZombies_fla.Z_ANTEBRAZOL_611)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Z_ANTEBRAZOL_611 extends MovieClip {
public var tar;
public function Z_ANTEBRAZOL_611(){
addFrameScript(0, frame1);
}
function frame1(){
tar = this.parent.parent.parent;
gotoAndStop(tar.indice_torso);
}
}
}//package MoreZombies_fla
Section 299
//Z_ANTEBRAZOR_630 (MoreZombies_fla.Z_ANTEBRAZOR_630)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Z_ANTEBRAZOR_630 extends MovieClip {
public var tar;
public function Z_ANTEBRAZOR_630(){
addFrameScript(0, frame1);
}
function frame1(){
tar = this.parent.parent.parent;
gotoAndStop(tar.indice_torso);
}
}
}//package MoreZombies_fla
Section 300
//Z_BICEPSL_610 (MoreZombies_fla.Z_BICEPSL_610)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Z_BICEPSL_610 extends MovieClip {
public var tar;
public function Z_BICEPSL_610(){
addFrameScript(0, frame1);
}
function frame1(){
tar = this.parent.parent.parent;
gotoAndStop(tar.indice_torso);
}
}
}//package MoreZombies_fla
Section 301
//Z_BICEPSR_629 (MoreZombies_fla.Z_BICEPSR_629)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Z_BICEPSR_629 extends MovieClip {
public var tar;
public function Z_BICEPSR_629(){
addFrameScript(0, frame1);
}
function frame1(){
tar = this.parent.parent.parent;
gotoAndStop(tar.indice_torso);
}
}
}//package MoreZombies_fla
Section 302
//Z_BLOODamputacabezaBACK_673 (MoreZombies_fla.Z_BLOODamputacabezaBACK_673)
package MoreZombies_fla {
import com.tanoku.MoreZombies.*;
import flash.display.*;
public dynamic class Z_BLOODamputacabezaBACK_673 extends MovieClip {
public function Z_BLOODamputacabezaBACK_673(){
addFrameScript(0, frame1, 40, frame41);
}
function frame1(){
if (Globals.SANGRE_ACTIVA == false){
visible = false;
};
cacheAsBitmap = true;
}
function frame41(){
stop();
}
}
}//package MoreZombies_fla
Section 303
//Z_BLOODamputacabezaFRONT_674 (MoreZombies_fla.Z_BLOODamputacabezaFRONT_674)
package MoreZombies_fla {
import com.tanoku.MoreZombies.*;
import flash.display.*;
public dynamic class Z_BLOODamputacabezaFRONT_674 extends MovieClip {
public function Z_BLOODamputacabezaFRONT_674(){
addFrameScript(0, frame1, 40, frame41);
}
function frame1(){
if (Globals.SANGRE_ACTIVA == false){
visible = false;
};
cacheAsBitmap = true;
}
function frame41(){
stop();
}
}
}//package MoreZombies_fla
Section 304
//Z_BLOODamputamitad2BACK_681 (MoreZombies_fla.Z_BLOODamputamitad2BACK_681)
package MoreZombies_fla {
import com.tanoku.MoreZombies.*;
import flash.display.*;
public dynamic class Z_BLOODamputamitad2BACK_681 extends MovieClip {
public function Z_BLOODamputamitad2BACK_681(){
addFrameScript(0, frame1, 28, frame29);
}
function frame1(){
if (Globals.SANGRE_ACTIVA == false){
visible = false;
};
cacheAsBitmap = true;
}
function frame29(){
stop();
}
}
}//package MoreZombies_fla
Section 305
//Z_BLOODamputamitad2FRONT_682 (MoreZombies_fla.Z_BLOODamputamitad2FRONT_682)
package MoreZombies_fla {
import com.tanoku.MoreZombies.*;
import flash.display.*;
public dynamic class Z_BLOODamputamitad2FRONT_682 extends MovieClip {
public function Z_BLOODamputamitad2FRONT_682(){
addFrameScript(0, frame1, 28, frame29);
}
function frame1(){
if (Globals.SANGRE_ACTIVA == false){
visible = false;
};
cacheAsBitmap = true;
}
function frame29(){
stop();
}
}
}//package MoreZombies_fla
Section 306
//Z_BLOODamputamitadBACK_677 (MoreZombies_fla.Z_BLOODamputamitadBACK_677)
package MoreZombies_fla {
import com.tanoku.MoreZombies.*;
import flash.display.*;
public dynamic class Z_BLOODamputamitadBACK_677 extends MovieClip {
public function Z_BLOODamputamitadBACK_677(){
addFrameScript(0, frame1, 28, frame29);
}
function frame1(){
if (Globals.SANGRE_ACTIVA == false){
visible = false;
};
cacheAsBitmap = true;
}
function frame29(){
stop();
}
}
}//package MoreZombies_fla
Section 307
//Z_BLOODamputamitadFRONT_678 (MoreZombies_fla.Z_BLOODamputamitadFRONT_678)
package MoreZombies_fla {
import com.tanoku.MoreZombies.*;
import flash.display.*;
public dynamic class Z_BLOODamputamitadFRONT_678 extends MovieClip {
public function Z_BLOODamputamitadFRONT_678(){
addFrameScript(0, frame1, 28, frame29);
}
function frame1(){
if (Globals.SANGRE_ACTIVA == false){
visible = false;
};
cacheAsBitmap = true;
}
function frame29(){
stop();
}
}
}//package MoreZombies_fla
Section 308
//Z_BLOODcaeBACK_727 (MoreZombies_fla.Z_BLOODcaeBACK_727)
package MoreZombies_fla {
import com.tanoku.MoreZombies.*;
import flash.display.*;
public dynamic class Z_BLOODcaeBACK_727 extends MovieClip {
public function Z_BLOODcaeBACK_727(){
addFrameScript(0, frame1, 23, frame24);
}
function frame1(){
if (Globals.SANGRE_ACTIVA == false){
visible = false;
};
cacheAsBitmap = true;
}
function frame24(){
stop();
}
}
}//package MoreZombies_fla
Section 309
//Z_BLOODcaedelante_654 (MoreZombies_fla.Z_BLOODcaedelante_654)
package MoreZombies_fla {
import com.tanoku.MoreZombies.*;
import flash.display.*;
public dynamic class Z_BLOODcaedelante_654 extends MovieClip {
public function Z_BLOODcaedelante_654(){
addFrameScript(0, frame1, 23, frame24);
}
function frame1(){
if (Globals.SANGRE_ACTIVA == false){
visible = false;
};
cacheAsBitmap = true;
}
function frame24(){
stop();
}
}
}//package MoreZombies_fla
Section 310
//Z_BLOODcaedetras_657 (MoreZombies_fla.Z_BLOODcaedetras_657)
package MoreZombies_fla {
import com.tanoku.MoreZombies.*;
import flash.display.*;
public dynamic class Z_BLOODcaedetras_657 extends MovieClip {
public function Z_BLOODcaedetras_657(){
addFrameScript(0, frame1, 23, frame24);
}
function frame1(){
if (Globals.SANGRE_ACTIVA == false){
visible = false;
};
cacheAsBitmap = true;
}
function frame24(){
stop();
}
}
}//package MoreZombies_fla
Section 311
//Z_BLOODcaeFRONT_728 (MoreZombies_fla.Z_BLOODcaeFRONT_728)
package MoreZombies_fla {
import com.tanoku.MoreZombies.*;
import flash.display.*;
public dynamic class Z_BLOODcaeFRONT_728 extends MovieClip {
public function Z_BLOODcaeFRONT_728(){
addFrameScript(0, frame1, 23, frame24);
}
function frame1(){
if (Globals.SANGRE_ACTIVA == false){
visible = false;
};
}
function frame24(){
stop();
}
}
}//package MoreZombies_fla
Section 312
//Z_BLOODchofallBACK_669 (MoreZombies_fla.Z_BLOODchofallBACK_669)
package MoreZombies_fla {
import com.tanoku.MoreZombies.*;
import flash.display.*;
public dynamic class Z_BLOODchofallBACK_669 extends MovieClip {
public function Z_BLOODchofallBACK_669(){
addFrameScript(0, frame1, 36, frame37);
}
function frame1(){
if (Globals.SANGRE_ACTIVA == false){
visible = false;
};
cacheAsBitmap = true;
}
function frame37(){
stop();
}
}
}//package MoreZombies_fla
Section 313
//Z_BLOODchofallFRONT_670 (MoreZombies_fla.Z_BLOODchofallFRONT_670)
package MoreZombies_fla {
import com.tanoku.MoreZombies.*;
import flash.display.*;
public dynamic class Z_BLOODchofallFRONT_670 extends MovieClip {
public function Z_BLOODchofallFRONT_670(){
addFrameScript(0, frame1, 36, frame37);
}
function frame1(){
if (Globals.SANGRE_ACTIVA == false){
visible = false;
};
cacheAsBitmap = true;
}
function frame37(){
stop();
}
}
}//package MoreZombies_fla
Section 314
//Z_BLOODchofheadBACK_661 (MoreZombies_fla.Z_BLOODchofheadBACK_661)
package MoreZombies_fla {
import com.tanoku.MoreZombies.*;
import flash.display.*;
public dynamic class Z_BLOODchofheadBACK_661 extends MovieClip {
public function Z_BLOODchofheadBACK_661(){
addFrameScript(0, frame1, 40, frame41);
}
function frame1(){
if (Globals.SANGRE_ACTIVA == false){
visible = false;
};
cacheAsBitmap = true;
}
function frame41(){
stop();
}
}
}//package MoreZombies_fla
Section 315
//Z_BLOODchofheadFRONT_662 (MoreZombies_fla.Z_BLOODchofheadFRONT_662)
package MoreZombies_fla {
import com.tanoku.MoreZombies.*;
import flash.display.*;
public dynamic class Z_BLOODchofheadFRONT_662 extends MovieClip {
public function Z_BLOODchofheadFRONT_662(){
addFrameScript(0, frame1, 40, frame41);
}
function frame1(){
if (Globals.SANGRE_ACTIVA == false){
visible = false;
};
cacheAsBitmap = true;
}
function frame41(){
stop();
}
}
}//package MoreZombies_fla
Section 316
//Z_BLOODchoftopBACK_665 (MoreZombies_fla.Z_BLOODchoftopBACK_665)
package MoreZombies_fla {
import com.tanoku.MoreZombies.*;
import flash.display.*;
public dynamic class Z_BLOODchoftopBACK_665 extends MovieClip {
public function Z_BLOODchoftopBACK_665(){
addFrameScript(0, frame1, 36, frame37);
}
function frame1(){
if (Globals.SANGRE_ACTIVA == false){
visible = false;
};
cacheAsBitmap = true;
}
function frame37(){
stop();
}
}
}//package MoreZombies_fla
Section 317
//Z_BLOODchoftopFRONT_666 (MoreZombies_fla.Z_BLOODchoftopFRONT_666)
package MoreZombies_fla {
import com.tanoku.MoreZombies.*;
import flash.display.*;
public dynamic class Z_BLOODchoftopFRONT_666 extends MovieClip {
public function Z_BLOODchoftopFRONT_666(){
addFrameScript(0, frame1, 36, frame37);
}
function frame1(){
if (Globals.SANGRE_ACTIVA == false){
visible = false;
};
cacheAsBitmap = true;
}
function frame37(){
stop();
}
}
}//package MoreZombies_fla
Section 318
//Z_BLOODzatoichiBACK_685 (MoreZombies_fla.Z_BLOODzatoichiBACK_685)
package MoreZombies_fla {
import com.tanoku.MoreZombies.*;
import flash.display.*;
public dynamic class Z_BLOODzatoichiBACK_685 extends MovieClip {
public function Z_BLOODzatoichiBACK_685(){
addFrameScript(0, frame1, 43, frame44);
}
function frame1(){
if (Globals.SANGRE_ACTIVA == false){
visible = false;
};
cacheAsBitmap = true;
}
function frame44(){
stop();
}
}
}//package MoreZombies_fla
Section 319
//Z_BLOODzatoichiCENTER_686 (MoreZombies_fla.Z_BLOODzatoichiCENTER_686)
package MoreZombies_fla {
import com.tanoku.MoreZombies.*;
import flash.display.*;
public dynamic class Z_BLOODzatoichiCENTER_686 extends MovieClip {
public function Z_BLOODzatoichiCENTER_686(){
addFrameScript(0, frame1, 43, frame44);
}
function frame1(){
if (Globals.SANGRE_ACTIVA == false){
visible = false;
};
cacheAsBitmap = true;
}
function frame44(){
stop();
}
}
}//package MoreZombies_fla
Section 320
//Z_BLOODzatoichiFRONT_687 (MoreZombies_fla.Z_BLOODzatoichiFRONT_687)
package MoreZombies_fla {
import com.tanoku.MoreZombies.*;
import flash.display.*;
public dynamic class Z_BLOODzatoichiFRONT_687 extends MovieClip {
public function Z_BLOODzatoichiFRONT_687(){
addFrameScript(0, frame1, 43, frame44);
}
function frame1(){
if (Globals.SANGRE_ACTIVA == false){
visible = false;
};
cacheAsBitmap = true;
}
function frame44(){
stop();
}
}
}//package MoreZombies_fla
Section 321
//Z_FOOTL_612 (MoreZombies_fla.Z_FOOTL_612)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Z_FOOTL_612 extends MovieClip {
public var tar;
public function Z_FOOTL_612(){
addFrameScript(0, frame1);
}
function frame1(){
tar = this.parent.parent.parent;
gotoAndStop(tar.indice_pies);
}
}
}//package MoreZombies_fla
Section 322
//Z_FOOTR_616 (MoreZombies_fla.Z_FOOTR_616)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Z_FOOTR_616 extends MovieClip {
public var tar;
public function Z_FOOTR_616(){
addFrameScript(0, frame1);
}
function frame1(){
tar = this.parent.parent.parent;
gotoAndStop(tar.indice_pies);
}
}
}//package MoreZombies_fla
Section 323
//Z_HAIR_625 (MoreZombies_fla.Z_HAIR_625)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Z_HAIR_625 extends MovieClip {
public var tar;
public function Z_HAIR_625(){
addFrameScript(0, frame1);
}
function frame1(){
tar = this.parent.parent.parent;
gotoAndStop(tar.indice_pelo);
}
}
}//package MoreZombies_fla
Section 324
//Z_HANDL_IDLE_609 (MoreZombies_fla.Z_HANDL_IDLE_609)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Z_HANDL_IDLE_609 extends MovieClip {
public var tar;
public function Z_HANDL_IDLE_609(){
addFrameScript(0, frame1);
}
function frame1(){
tar = this.parent.parent.parent;
gotoAndStop(tar.indice_manos);
}
}
}//package MoreZombies_fla
Section 325
//Z_HANDL_MUERDE_640 (MoreZombies_fla.Z_HANDL_MUERDE_640)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Z_HANDL_MUERDE_640 extends MovieClip {
public var tar;
public function Z_HANDL_MUERDE_640(){
addFrameScript(0, frame1);
}
function frame1(){
tar = this.parent.parent.parent;
gotoAndStop(tar.indice_manos);
}
}
}//package MoreZombies_fla
Section 326
//Z_HANDL_WALK1_633 (MoreZombies_fla.Z_HANDL_WALK1_633)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Z_HANDL_WALK1_633 extends MovieClip {
public var tar;
public function Z_HANDL_WALK1_633(){
addFrameScript(0, frame1);
}
function frame1(){
tar = this.parent.parent.parent;
gotoAndStop(tar.indice_manos);
}
}
}//package MoreZombies_fla
Section 327
//Z_HANDR_IDLE_628 (MoreZombies_fla.Z_HANDR_IDLE_628)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Z_HANDR_IDLE_628 extends MovieClip {
public var tar;
public function Z_HANDR_IDLE_628(){
addFrameScript(0, frame1);
}
function frame1(){
tar = this.parent.parent.parent;
gotoAndStop(tar.indice_manos);
}
}
}//package MoreZombies_fla
Section 328
//Z_HANDR_MUERDE_641 (MoreZombies_fla.Z_HANDR_MUERDE_641)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Z_HANDR_MUERDE_641 extends MovieClip {
public var tar;
public function Z_HANDR_MUERDE_641(){
addFrameScript(0, frame1);
}
function frame1(){
tar = this.parent.parent.parent;
gotoAndStop(tar.indice_manos);
}
}
}//package MoreZombies_fla
Section 329
//Z_HANDR_WALK1_635 (MoreZombies_fla.Z_HANDR_WALK1_635)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Z_HANDR_WALK1_635 extends MovieClip {
public var tar;
public function Z_HANDR_WALK1_635(){
addFrameScript(0, frame1);
}
function frame1(){
tar = this.parent.parent.parent;
gotoAndStop(tar.indice_manos);
}
}
}//package MoreZombies_fla
Section 330
//Z_HEAD_624 (MoreZombies_fla.Z_HEAD_624)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Z_HEAD_624 extends MovieClip {
public var tar;
public function Z_HEAD_624(){
addFrameScript(0, frame1);
}
function frame1(){
tar = this.parent.parent.parent;
gotoAndStop(tar.indice_cabeza);
}
}
}//package MoreZombies_fla
Section 331
//Z_MUSLOL_613 (MoreZombies_fla.Z_MUSLOL_613)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Z_MUSLOL_613 extends MovieClip {
public var tar;
public function Z_MUSLOL_613(){
addFrameScript(0, frame1);
}
function frame1(){
tar = this.parent.parent.parent;
gotoAndStop(tar.indice_piernas);
}
}
}//package MoreZombies_fla
Section 332
//Z_MUSLOR_617 (MoreZombies_fla.Z_MUSLOR_617)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Z_MUSLOR_617 extends MovieClip {
public var tar;
public function Z_MUSLOR_617(){
addFrameScript(0, frame1);
}
function frame1(){
tar = this.parent.parent.parent;
gotoAndStop(tar.indice_piernas);
}
}
}//package MoreZombies_fla
Section 333
//Z_PELVIS_615 (MoreZombies_fla.Z_PELVIS_615)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Z_PELVIS_615 extends MovieClip {
public var tar;
public function Z_PELVIS_615(){
addFrameScript(0, frame1);
}
function frame1(){
tar = this.parent.parent.parent;
gotoAndStop(tar.indice_piernas);
}
}
}//package MoreZombies_fla
Section 334
//Z_TIBIAL_614 (MoreZombies_fla.Z_TIBIAL_614)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Z_TIBIAL_614 extends MovieClip {
public var tar;
public function Z_TIBIAL_614(){
addFrameScript(0, frame1);
}
function frame1(){
tar = this.parent.parent.parent;
gotoAndStop(tar.indice_piernas);
}
}
}//package MoreZombies_fla
Section 335
//Z_TIBIAR_618 (MoreZombies_fla.Z_TIBIAR_618)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Z_TIBIAR_618 extends MovieClip {
public var tar;
public function Z_TIBIAR_618(){
addFrameScript(0, frame1);
}
function frame1(){
tar = this.parent.parent.parent;
gotoAndStop(tar.indice_piernas);
}
}
}//package MoreZombies_fla
Section 336
//Z_TORSOCURVADO_619 (MoreZombies_fla.Z_TORSOCURVADO_619)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Z_TORSOCURVADO_619 extends MovieClip {
public var dyna_front:MovieClip;
public var tar;
public var dyna_back:MovieClip;
public function Z_TORSOCURVADO_619(){
addFrameScript(0, frame1);
}
function frame1(){
tar = this.parent.parent.parent;
gotoAndStop(tar.indice_torso);
}
}
}//package MoreZombies_fla
Section 337
//Z_TORSOERGUIDO_634 (MoreZombies_fla.Z_TORSOERGUIDO_634)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class Z_TORSOERGUIDO_634 extends MovieClip {
public var dyna_front:MovieClip;
public var tar;
public var dyna_back:MovieClip;
public function Z_TORSOERGUIDO_634(){
addFrameScript(0, frame1);
}
function frame1(){
tar = this.parent.parent.parent;
gotoAndStop(tar.indice_torso);
}
}
}//package MoreZombies_fla
Section 338
//zombie_01_606 (MoreZombies_fla.zombie_01_606)
package MoreZombies_fla {
import flash.display.*;
public dynamic class zombie_01_606 extends MovieClip {
public var hitarea:MovieClip;
public function zombie_01_606(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MoreZombies_fla
Section 339
//zombie_amputacabeza_671 (MoreZombies_fla.zombie_amputacabeza_671)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class zombie_amputacabeza_671 extends MovieClip {
public var tar;
public function zombie_amputacabeza_671(){
addFrameScript(0, frame1, 40, frame41);
}
function frame1(){
cacheAsBitmap = true;
}
function frame41(){
stop();
tar = this.parent.parent;
tar.zombieMuerto();
}
}
}//package MoreZombies_fla
Section 340
//zombie_amputamitad_675 (MoreZombies_fla.zombie_amputamitad_675)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class zombie_amputamitad_675 extends MovieClip {
public var tar;
public function zombie_amputamitad_675(){
addFrameScript(0, frame1, 28, frame29);
}
function frame1(){
cacheAsBitmap = true;
}
function frame29(){
stop();
tar = this.parent.parent;
tar.zombieMuerto();
}
}
}//package MoreZombies_fla
Section 341
//zombie_amputamitad_back_679 (MoreZombies_fla.zombie_amputamitad_back_679)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class zombie_amputamitad_back_679 extends MovieClip {
public var tar;
public function zombie_amputamitad_back_679(){
addFrameScript(0, frame1, 28, frame29);
}
function frame1(){
cacheAsBitmap = true;
}
function frame29(){
stop();
tar = this.parent.parent;
tar.zombieMuerto();
}
}
}//package MoreZombies_fla
Section 342
//zombie_amputazatoichi_683 (MoreZombies_fla.zombie_amputazatoichi_683)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class zombie_amputazatoichi_683 extends MovieClip {
public var tar;
public function zombie_amputazatoichi_683(){
addFrameScript(0, frame1, 43, frame44);
}
function frame1(){
cacheAsBitmap = true;
}
function frame44(){
stop();
tar = this.parent.parent;
tar.zombieMuerto();
}
}
}//package MoreZombies_fla
Section 343
//zombie_arde_691 (MoreZombies_fla.zombie_arde_691)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class zombie_arde_691 extends MovieClip {
public var contador:int;
public var tar;
public function zombie_arde_691(){
addFrameScript(0, frame1, 20, frame21, 56, frame57);
}
function frame1(){
contador = 0;
cacheAsBitmap = true;
}
function frame21(){
}
function frame57(){
stop();
tar = this.parent.parent;
tar.zombieMuerto();
}
}
}//package MoreZombies_fla
Section 344
//zombie_caedelante_653 (MoreZombies_fla.zombie_caedelante_653)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class zombie_caedelante_653 extends MovieClip {
public var tar;
public function zombie_caedelante_653(){
addFrameScript(0, frame1, 23, frame24);
}
function frame1(){
cacheAsBitmap = true;
}
function frame24(){
stop();
tar = this.parent.parent;
tar.zombieMuerto();
}
}
}//package MoreZombies_fla
Section 345
//zombie_caedetras_193 (MoreZombies_fla.zombie_caedetras_193)
package MoreZombies_fla {
import flash.display.*;
public dynamic class zombie_caedetras_193 extends MovieClip {
public function zombie_caedetras_193(){
addFrameScript(24, frame25);
}
function frame25(){
stop();
}
}
}//package MoreZombies_fla
Section 346
//zombie_caedetras_656 (MoreZombies_fla.zombie_caedetras_656)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class zombie_caedetras_656 extends MovieClip {
public var tar;
public function zombie_caedetras_656(){
addFrameScript(0, frame1, 23, frame24);
}
function frame1(){
cacheAsBitmap = true;
}
function frame24(){
stop();
tar = this.parent.parent;
tar.zombieMuerto();
}
}
}//package MoreZombies_fla
Section 347
//zombie_chofall_667 (MoreZombies_fla.zombie_chofall_667)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class zombie_chofall_667 extends MovieClip {
public var tar;
public function zombie_chofall_667(){
addFrameScript(0, frame1, 36, frame37);
}
function frame1(){
cacheAsBitmap = true;
}
function frame37(){
stop();
tar = this.parent.parent;
tar.zombieMuerto();
}
}
}//package MoreZombies_fla
Section 348
//zombie_chofhead_659 (MoreZombies_fla.zombie_chofhead_659)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class zombie_chofhead_659 extends MovieClip {
public var tar;
public function zombie_chofhead_659(){
addFrameScript(0, frame1, 40, frame41);
}
function frame1(){
cacheAsBitmap = true;
}
function frame41(){
stop();
tar = this.parent.parent;
tar.zombieMuerto();
}
}
}//package MoreZombies_fla
Section 349
//zombie_choftop_663 (MoreZombies_fla.zombie_choftop_663)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class zombie_choftop_663 extends MovieClip {
public var tar;
public function zombie_choftop_663(){
addFrameScript(0, frame1, 36, frame37);
}
function frame1(){
cacheAsBitmap = true;
}
function frame37(){
stop();
tar = this.parent.parent;
tar.zombieMuerto();
}
}
}//package MoreZombies_fla
Section 350
//zombie_congelado_652 (MoreZombies_fla.zombie_congelado_652)
package MoreZombies_fla {
import flash.display.*;
public dynamic class zombie_congelado_652 extends MovieClip {
public function zombie_congelado_652(){
addFrameScript(0, frame1);
}
function frame1(){
cacheAsBitmap = true;
}
}
}//package MoreZombies_fla
Section 351
//zombie_damaged1_644 (MoreZombies_fla.zombie_damaged1_644)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class zombie_damaged1_644 extends MovieClip {
public var tar;
public function zombie_damaged1_644(){
addFrameScript(0, frame1, 14, frame15);
}
function frame15(){
tar.wait_animation(false);
tar.body.gotoAndStop("idle");
}
function frame1(){
tar = this.parent.parent;
tar.wait_animation(true);
cacheAsBitmap = true;
}
}
}//package MoreZombies_fla
Section 352
//zombie_damaged2_646 (MoreZombies_fla.zombie_damaged2_646)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class zombie_damaged2_646 extends MovieClip {
public var tar;
public function zombie_damaged2_646(){
addFrameScript(0, frame1, 14, frame15);
}
function frame15(){
tar.wait_animation(false);
tar.body.gotoAndStop("idle");
}
function frame1(){
tar = this.parent.parent;
tar.wait_animation(true);
cacheAsBitmap = true;
}
}
}//package MoreZombies_fla
Section 353
//zombie_damaged3_648 (MoreZombies_fla.zombie_damaged3_648)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class zombie_damaged3_648 extends MovieClip {
public var tar;
public function zombie_damaged3_648(){
addFrameScript(0, frame1, 14, frame15);
}
function frame15(){
tar.wait_animation(false);
tar.body.gotoAndStop("idle");
}
function frame1(){
tar = this.parent.parent;
tar.wait_animation(true);
cacheAsBitmap = true;
}
}
}//package MoreZombies_fla
Section 354
//zombie_damaged4_650 (MoreZombies_fla.zombie_damaged4_650)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class zombie_damaged4_650 extends MovieClip {
public var tar;
public function zombie_damaged4_650(){
addFrameScript(0, frame1, 11, frame12);
}
function frame12(){
tar.wait_animation(false);
tar.body.gotoAndStop("idle");
}
function frame1(){
tar = this.parent.parent;
tar.wait_animation(true);
cacheAsBitmap = true;
}
}
}//package MoreZombies_fla
Section 355
//zombie_desintegrado_695 (MoreZombies_fla.zombie_desintegrado_695)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class zombie_desintegrado_695 extends MovieClip {
public var tar;
public function zombie_desintegrado_695(){
addFrameScript(0, frame1, 40, frame41);
}
function frame1(){
cacheAsBitmap = true;
}
function frame41(){
stop();
tar = this.parent.parent;
tar.zombieMuerto();
}
}
}//package MoreZombies_fla
Section 356
//zombie_golpea_636 (MoreZombies_fla.zombie_golpea_636)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class zombie_golpea_636 extends MovieClip {
public var tar;
public var area:area_roja;
public function zombie_golpea_636(){
addFrameScript(0, frame1, 16, frame17, 31, frame32);
}
function frame1(){
tar = this.parent.parent;
tar.wait_animation(true);
cacheAsBitmap = true;
}
function frame17(){
tar.checkHit(area);
}
function frame32(){
tar.wait_animation(false);
tar.body.gotoAndStop("idle");
}
}
}//package MoreZombies_fla
Section 357
//zombie_idle_607 (MoreZombies_fla.zombie_idle_607)
package MoreZombies_fla {
import flash.display.*;
public dynamic class zombie_idle_607 extends MovieClip {
public var contador:int;
public function zombie_idle_607(){
addFrameScript(0, frame1, 199, frame200);
}
function frame200(){
if (contador >= 3){
gotoAndPlay(1);
} else {
contador = (contador + 1);
gotoAndPlay(101);
};
}
function frame1(){
contador = 0;
cacheAsBitmap = true;
}
}
}//package MoreZombies_fla
Section 358
//zombie_morircongelado_697 (MoreZombies_fla.zombie_morircongelado_697)
package MoreZombies_fla {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class zombie_morircongelado_697 extends MovieClip {
public var tar;
public function zombie_morircongelado_697(){
addFrameScript(0, frame1, 28, frame29);
}
function frame1(){
cacheAsBitmap = true;
}
function frame29(){
stop();
tar = this.parent.parent;
tar.zombieMuerto();
}
}
}//package MoreZombies_fla
Section 359
//zombie_muerde_638 (MoreZombies_fla.zombie_muerde_638)
package MoreZombies_fla {
import flash.media.*;
import com.tanoku.MoreZombies.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class zombie_muerde_638 extends MovieClip {
public var tar;
public var area:area_roja;
public function zombie_muerde_638(){
addFrameScript(0, frame1, 30, frame31, 45, frame46, 65, frame66);
}
function frame1(){
tar = this.parent.parent;
tar.wait_animation(true);
cacheAsBitmap = true;
}
function frame31(){
if (((!(Globals.GamePaused)) || (!(Globals.GameOver)))){
tar.soundManager.playSound("mordisco_zombie", 1, 1);
};
}
function frame46(){
tar.checkHit(area);
}
function frame66(){
if (tar.player_.alive == true){
gotoAndPlay(31);
} else {
tar.stop_bite(tar);
};
gotoAndPlay(31);
}
}
}//package MoreZombies_fla
Section 360
//zombie_run_642 (MoreZombies_fla.zombie_run_642)
package MoreZombies_fla {
import flash.display.*;
public dynamic class zombie_run_642 extends MovieClip {
public function zombie_run_642(){
addFrameScript(0, frame1);
}
function frame1(){
cacheAsBitmap = true;
}
}
}//package MoreZombies_fla
Section 361
//zombie_walk_631 (MoreZombies_fla.zombie_walk_631)
package MoreZombies_fla {
import flash.display.*;
public dynamic class zombie_walk_631 extends MovieClip {
public function zombie_walk_631(){
addFrameScript(0, frame1);
}
function frame1(){
cacheAsBitmap = true;
}
}
}//package MoreZombies_fla
Section 362
//zombiechamuscado_694 (MoreZombies_fla.zombiechamuscado_694)
package MoreZombies_fla {
import flash.display.*;
public dynamic class zombiechamuscado_694 extends MovieClip {
public var contador:int;
public function zombiechamuscado_694(){
addFrameScript(0, frame1, 20, frame21);
}
function frame1(){
contador = 0;
cacheAsBitmap = true;
}
function frame21(){
}
}
}//package MoreZombies_fla
Section 363
//AITSO (AITSO)
package {
import flash.media.*;
public dynamic class AITSO extends Sound {
}
}//package
Section 364
//AK47 (AK47)
package {
import flash.media.*;
public dynamic class AK47 extends Sound {
}
}//package
Section 365
//amputa_cabeza (amputa_cabeza)
package {
import flash.media.*;
public dynamic class amputa_cabeza extends Sound {
}
}//package
Section 366
//amputa_mitad_01 (amputa_mitad_01)
package {
import flash.media.*;
public dynamic class amputa_mitad_01 extends Sound {
}
}//package
Section 367
//amputa_mitad_02 (amputa_mitad_02)
package {
import flash.media.*;
public dynamic class amputa_mitad_02 extends Sound {
}
}//package
Section 368
//area_amarilla (area_amarilla)
package {
import flash.display.*;
public dynamic class area_amarilla extends MovieClip {
}
}//package
Section 369
//area_roja (area_roja)
package {
import flash.display.*;
public dynamic class area_roja extends MovieClip {
public function area_roja(){
addFrameScript(0, frame1);
}
function frame1(){
this.visible = false;
}
}
}//package
Section 370
//area_verde (area_verde)
package {
import flash.display.*;
public dynamic class area_verde extends MovieClip {
}
}//package
Section 371
//bidon_destruir (bidon_destruir)
package {
import flash.media.*;
public dynamic class bidon_destruir extends Sound {
}
}//package
Section 372
//Blender (Blender)
package {
import flash.media.*;
public dynamic class Blender extends Sound {
}
}//package
Section 373
//BrokenDeck (BrokenDeck)
package {
import flash.media.*;
public dynamic class BrokenDeck extends Sound {
}
}//package
Section 374
//btn_skip (btn_skip)
package {
import flash.display.*;
public dynamic class btn_skip extends SimpleButton {
}
}//package
Section 375
//caida_01 (caida_01)
package {
import flash.media.*;
public dynamic class caida_01 extends Sound {
}
}//package
Section 376
//caida_02 (caida_02)
package {
import flash.media.*;
public dynamic class caida_02 extends Sound {
}
}//package
Section 377
//carteles_flotantes (carteles_flotantes)
package {
import flash.display.*;
public dynamic class carteles_flotantes extends MovieClip {
public var mc_mascara:MovieClip;
public var cartel2:MovieClip;
public var cartel:MovieClip;
}
}//package
Section 378
//carteles_juego (carteles_juego)
package {
import flash.display.*;
public dynamic class carteles_juego extends MovieClip {
public var mc_mascara:MovieClip;
public var cartel2:MovieClip;
public var cartel:MovieClip;
}
}//package
Section 379
//casquillo_disparo (casquillo_disparo)
package {
import flash.display.*;
public dynamic class casquillo_disparo extends MovieClip {
public var mc_Casquillo2:MovieClip;
public function casquillo_disparo(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 380
//casquillo_metal_01 (casquillo_metal_01)
package {
import flash.media.*;
public dynamic class casquillo_metal_01 extends Sound {
}
}//package
Section 381
//casquillo_metal_02 (casquillo_metal_02)
package {
import flash.media.*;
public dynamic class casquillo_metal_02 extends Sound {
}
}//package
Section 382
//casquillo_metal_03 (casquillo_metal_03)
package {
import flash.media.*;
public dynamic class casquillo_metal_03 extends Sound {
}
}//package
Section 383
//casquillo_plastico_01 (casquillo_plastico_01)
package {
import flash.media.*;
public dynamic class casquillo_plastico_01 extends Sound {
}
}//package
Section 384
//casquillo_plastico_02 (casquillo_plastico_02)
package {
import flash.media.*;
public dynamic class casquillo_plastico_02 extends Sound {
}
}//package
Section 385
//casquillo_plastico_03 (casquillo_plastico_03)
package {
import flash.media.*;
public dynamic class casquillo_plastico_03 extends Sound {
}
}//package
Section 386
//chorro_sangre (chorro_sangre)
package {
import flash.media.*;
public dynamic class chorro_sangre extends Sound {
}
}//package
Section 387
//ColtPython (ColtPython)
package {
import flash.media.*;
public dynamic class ColtPython extends Sound {
}
}//package
Section 388
//Cranium (Cranium)
package {
import flash.media.*;
public dynamic class Cranium extends Sound {
}
}//package
Section 389
//DesertEagle (DesertEagle)
package {
import flash.media.*;
public dynamic class DesertEagle extends Sound {
}
}//package
Section 390
//destello_arma (destello_arma)
package {
import flash.display.*;
public dynamic class destello_arma extends MovieClip {
public var mc_destello:MovieClip;
}
}//package
Section 391
//escena1 (escena1)
package {
import flash.display.*;
public dynamic class escena1 extends MovieClip {
}
}//package
Section 392
//escena2 (escena2)
package {
import flash.display.*;
public dynamic class escena2 extends MovieClip {
}
}//package
Section 393
//escena3 (escena3)
package {
import flash.display.*;
public dynamic class escena3 extends MovieClip {
}
}//package
Section 394
//escena4 (escena4)
package {
import flash.display.*;
public dynamic class escena4 extends MovieClip {
}
}//package
Section 395
//escena5 (escena5)
package {
import flash.display.*;
public dynamic class escena5 extends MovieClip {
}
}//package
Section 396
//ExplosionGrande (ExplosionGrande)
package {
import flash.media.*;
public dynamic class ExplosionGrande extends Sound {
}
}//package
Section 397
//Extintor (Extintor)
package {
import flash.media.*;
public dynamic class Extintor extends Sound {
}
}//package
Section 398
//FasterHarder (FasterHarder)
package {
import flash.media.*;
public dynamic class FasterHarder extends Sound {
}
}//package
Section 399
//freeze (freeze)
package {
import flash.media.*;
public dynamic class freeze extends Sound {
}
}//package
Section 400
//freezer_mine (freezer_mine)
package {
import flash.media.*;
public dynamic class freezer_mine extends Sound {
}
}//package
Section 401
//gameover (gameover)
package {
import flash.media.*;
public dynamic class gameover extends Sound {
}
}//package
Section 402
//GamerSafe (GamerSafe)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.system.*;
import flash.net.*;
public class GamerSafe extends Sprite {
private const _storedPasscode:String = "G1020ac2b10833794dbdc760c38eab39cd64f9543a:1247138990";
private const _storedHashseed:String = "09d260d0b4374dde5255afc8e3f64d6727d162de";
private var _stageHeight:Number;// = 400
private var _evt_useEnded:Function;// = null
private var _evt_networkingError:Function;// = null
private var _evt_accountChange:Function;// = null
private var _evt_itemPurchase:Function;// = null
private var _context:LoaderContext;
private var _evt_apiReady:Function;// = null
private var _evt_loginFailed:Function;// = null
private var _evt_login:Function;// = null
private var _evt_beginSession:Function;// = null
private var _gamerSafe:Object;// = null
private var _evt_useStarted:Function;// = null
private var _evt_confYes:Function;// = null
private var _stageWidth:Number;// = 550
private var _status:String;// = "Loading"
private var _inUse:Boolean;// = false
private var _loaded:Boolean;// = false
private var _evt_useChanged:Function;// = null
private var _loader:Loader;
private var _evt_beginSessionFailed:Function;// = null
private var _request:URLRequest;
private var _referrer:String;// = ""
private var _evt_confNo:Function;// = null
private var _evt_itemPurchaseFailed:Function;// = null
private var _stage:Stage;
public static const version:String = "01";
protected static var _instance:GamerSafe = null;
public function GamerSafe(_arg1){
var parent = _arg1;
_status = "Loading";
_loaded = false;
_stageWidth = 550;
_stageHeight = 400;
_inUse = false;
_referrer = "";
_loader = new Loader();
_context = new LoaderContext(true);
_request = new URLRequest((("http://components.gamersafe.com/GamerSafe." + version) + ".swf"));
_evt_networkingError = null;
_evt_accountChange = null;
_evt_login = null;
_evt_loginFailed = null;
_evt_beginSession = null;
_evt_beginSessionFailed = null;
_evt_itemPurchase = null;
_evt_itemPurchaseFailed = null;
_evt_apiReady = null;
_evt_confYes = null;
_evt_confNo = null;
_evt_useStarted = null;
_evt_useEnded = null;
_evt_useChanged = null;
_gamerSafe = null;
super();
if (_instance == null){
_instance = this;
} else {
trace("GamerSafe: Instance Error: The GamerSafe class is a singleton and should only be constructed once. Use Gamersafe.instance instead.");
return;
};
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_context.applicationDomain = ApplicationDomain.currentDomain;
_status = "Downloading";
try {
_loader.load(_request, _context);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onLoadingError);
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadingComplete);
} catch(s:SecurityError) {
_status = "Failed";
trace("Security error - GamerSafe library cannot load");
_loader = null;
};
addEventListener(Event.ADDED_TO_STAGE, setupStage);
if ((((((parent is Sprite)) || ((parent is MovieClip)))) || ((parent is Stage)))){
parent.addChild(this);
} else {
trace("Incompatible parent!");
};
}
public function flashBar():void{
if (_loaded == false){
return;
};
_gamerSafe.flashBar();
}
public function get loaded():Boolean{
return (_loaded);
}
public function set achievementPopupPosition(_arg1:Point):void{
if (_loaded == false){
return;
};
_gamerSafe.achievementPopupPosition = _arg1;
}
public function get highScore():Number{
if (_loaded == false){
return (0);
};
if (inSession == false){
return (0);
};
return (_gamerSafe.highScore);
}
public function set highScore(_arg1:Number):void{
if (_loaded == false){
return;
};
if (inSession == false){
return;
};
_gamerSafe.highScore = _arg1;
}
private function e_onBeginSessionFailed(_arg1:Event):void{
if (_evt_beginSessionFailed != null){
_evt_beginSessionFailed();
};
dispatchEvent(_arg1);
}
public function get inUse():Boolean{
return (_inUse);
}
public function set savedGame(_arg1:String):void{
if (_loaded == false){
return;
};
_gamerSafe.savedGame = _arg1;
}
public function get gamerTestMode():Boolean{
if (_loaded == false){
return (false);
};
return (_gamerSafe.gamerTestMode);
}
public function get iconUrl():String{
if (_loaded == false){
return ("");
};
return (_gamerSafe.iconUrl);
}
private function e_onNetworkingError(_arg1:Event):void{
if (_evt_networkingError != null){
_evt_networkingError();
};
dispatchEvent(_arg1);
}
public function hasAchievement(_arg1:int):Boolean{
if (_loaded == false){
return (false);
};
if (inSession == false){
return (false);
};
return (_gamerSafe.hasAchievement(_arg1));
}
public function get failed():Boolean{
if (_loaded == false){
return (false);
};
return (_gamerSafe.failed);
}
public function showStatusBar(_arg1:Object=null):void{
if (_loaded == false){
return;
};
_gamerSafe.showStatusBar(_arg1);
}
public function set onBeginSession(_arg1:Function):void{
_evt_beginSession = _arg1;
}
public function get onUseStarted():Function{
return (_evt_useStarted);
}
public function get loggedIn():Boolean{
if (_loaded == false){
return (false);
};
return (_gamerSafe.loggedIn);
}
private function e_onBeginSession(_arg1:Event):void{
if (_evt_beginSession != null){
_evt_beginSession();
};
dispatchEvent(_arg1);
}
private function e_onItemPurchaseFailed(_arg1:Event):void{
if (_evt_itemPurchaseFailed != null){
_evt_itemPurchaseFailed();
};
dispatchEvent(_arg1);
}
public function showLogin(_arg1:Object=null):void{
if (_loaded == false){
return;
};
_gamerSafe.showLogin(_arg1);
}
public function get onUseChanged():Function{
return (_evt_useChanged);
}
public function set onConfirmYes(_arg1:Function):void{
_evt_confYes = _arg1;
}
public function get onBeginSessionFailed():Function{
return (_evt_beginSessionFailed);
}
private function e_onUseEnded(_arg1):void{
if (_inUse == false){
return;
};
_inUse = false;
if (_evt_useChanged != null){
_evt_useChanged();
};
if (_evt_useEnded != null){
_evt_useEnded();
};
dispatchEvent(new Event("inUseEnded"));
dispatchEvent(new Event("inUseChanged"));
}
public function set onUseStarted(_arg1:Function):void{
_evt_useStarted = _arg1;
}
public function get FAQUrl():String{
if (_loaded == false){
return ("");
};
return (_gamerSafe.FAQUrl);
}
public function bestowFreeItem(_arg1:int):Boolean{
if (_loaded == false){
return (false);
};
_gamerSafe.bestowFreeItem(_arg1);
return (true);
}
public function get onUseEnded():Function{
return (_evt_useEnded);
}
private function setupStage(_arg1:Event):void{
if (stage == null){
return;
};
_stage = stage;
_stageWidth = stage.stageWidth;
_stageHeight = stage.stageHeight;
if (root != null){
_referrer = root.loaderInfo.loaderURL;
};
if (loaded){
_gamerSafe.componentWidth = _stageWidth;
_gamerSafe.componentHeight = _stageHeight;
_stage.addChild((_gamerSafe as Sprite));
};
}
public function get onAccountChange():Function{
return (_evt_accountChange);
}
public function get onApiReady():Function{
return (_evt_apiReady);
}
private function e_onConfirmNo(_arg1:Event):void{
if (_evt_confNo != null){
_evt_confNo();
};
dispatchEvent(new Event("confirmedNo"));
}
public function get onItemPurchase():Function{
return (_evt_itemPurchase);
}
private function onLoadingComplete(_arg1:Event):void{
_status = "Ready";
_loaded = true;
_gamerSafe = (_loader.content as Object);
_gamerSafe.componentWidth = _stageWidth;
_gamerSafe.componentHeight = _stageHeight;
_gamerSafe.addEventListener("networking_error", e_onNetworkingError);
_gamerSafe.addEventListener("account_change", e_onAccountChange);
_gamerSafe.addEventListener("login", e_onLogin);
_gamerSafe.addEventListener("login_failed", e_onLoginFailed);
_gamerSafe.addEventListener("begin_session", e_onBeginSession);
_gamerSafe.addEventListener("begin_session_failed", e_onBeginSessionFailed);
_gamerSafe.addEventListener("item_purchase", e_onItemPurchase);
_gamerSafe.addEventListener("item_purchase_failed", e_onItemPurchaseFailed);
_gamerSafe.addEventListener("yes", e_onConfirmYes);
_gamerSafe.addEventListener("no", e_onConfirmNo);
_gamerSafe.addEventListener("dialog_begin", e_onUseStarted);
_gamerSafe.addEventListener("dialog_end", e_onUseEnded);
if (_stage != null){
_stage.addChild((_gamerSafe as Sprite));
};
if (root != null){
_referrer = root.loaderInfo.loaderURL;
};
if (_storedPasscode != ""){
beginSession(_storedPasscode, _storedHashseed);
};
showStatusBar();
e_onApiReady(new Event("apiReady"));
}
public function showAchievements(_arg1:Object=null):void{
if (_loaded == false){
return;
};
_gamerSafe.showAchievements(_arg1);
}
private function e_onApiReady(_arg1:Event):void{
if (_evt_apiReady != null){
_evt_apiReady();
};
dispatchEvent(_arg1);
}
public function bestowAchievement(_arg1:uint):Boolean{
if (_loaded == false){
return (false);
};
_gamerSafe.bestowAchievement(_arg1);
return (true);
}
private function get sprite():Sprite{
if (_loaded == false){
return (null);
};
return (_gamerSafe.sprite);
}
public function get onLogin():Function{
return (_evt_login);
}
private function e_onAccountChange(_arg1:Event):void{
if (_evt_accountChange != null){
_evt_accountChange();
};
dispatchEvent(_arg1);
}
public function hasItem(_arg1:int):Boolean{
if (_loaded == false){
return (false);
};
if (inSession == false){
return (false);
};
return (_gamerSafe.hasItem(_arg1));
}
public function get onItemPurchaseFailed():Function{
return (_evt_itemPurchaseFailed);
}
public function get username():String{
if (_loaded == false){
return ("GamerSafe");
};
return (_gamerSafe.username);
}
public function set onUseChanged(_arg1:Function):void{
_evt_useChanged = _arg1;
}
private function e_onConfirmYes(_arg1:Event):void{
if (_evt_confYes != null){
_evt_confYes();
};
dispatchEvent(new Event("confirmedYes"));
}
public function set onUseEnded(_arg1:Function):void{
_evt_useEnded = _arg1;
}
private function e_onLogin(_arg1:Event):void{
if (_evt_login != null){
_evt_login();
};
flashBar();
dispatchEvent(_arg1);
}
public function get autoLogin():Boolean{
if (_loaded == false){
return (false);
};
return (_gamerSafe.autoLogin);
}
public function set onConfirmNo(_arg1:Function):void{
_evt_confNo = _arg1;
}
public function get achievementPopupPosition():Point{
if (_loaded == false){
return (new Point(0, 0));
};
return (_gamerSafe.achievementPopupPosition);
}
public function set onBeginSessionFailed(_arg1:Function):void{
_evt_beginSessionFailed = _arg1;
}
public function get savedGame():String{
if (_loaded == false){
return ("");
};
if (_gamerSafe.savedGame == null){
return ("");
};
return (_gamerSafe.savedGame);
}
public function set onNetworkingError(_arg1:Function):void{
_evt_networkingError = _arg1;
}
public function get onBeginSession():Function{
return (_evt_beginSession);
}
public function showMessageBox(_arg1:String, _arg2:String, _arg3:Boolean=true):void{
if (_loaded == false){
return;
};
_gamerSafe.messageBox(_arg1, _arg2, _arg3);
}
public function get achievements():Array{
if (_loaded == false){
return ([]);
};
if (inSession == false){
return ([]);
};
return (_gamerSafe.achievementList);
}
public function get signupUrl():String{
if (_loaded == false){
return ("");
};
return (_gamerSafe.signupUrl);
}
public function set onAccountChange(_arg1:Function):void{
_evt_accountChange = _arg1;
}
public function get gamerGold():uint{
if (_loaded == false){
return (0);
};
return (_gamerSafe.gamerGold);
}
private function e_onLoginFailed(_arg1:Event):void{
if (_evt_loginFailed != null){
_evt_loginFailed();
};
dispatchEvent(_arg1);
}
public function set onLoginFailed(_arg1:Function):void{
_evt_loginFailed = _arg1;
}
public function get onConfirmYes():Function{
return (_evt_confYes);
}
public function set onApiReady(_arg1:Function):void{
_evt_apiReady = _arg1;
}
public function set onItemPurchase(_arg1:Function):void{
_evt_itemPurchase = _arg1;
}
public function tryAutoLogin():void{
if (_loaded == false){
return;
};
if (inSession == false){
return;
};
_gamerSafe.tryAutoLogin();
}
public function get onConfirmNo():Function{
return (_evt_confNo);
}
public function get paymentUrl():String{
if (_loaded == false){
return ("");
};
return (_gamerSafe.paymentUrl);
}
public function logout():void{
if (_loaded == false){
return;
};
_gamerSafe.logout();
}
public function get onNetworkingError():Function{
return (_evt_networkingError);
}
public function showShop(_arg1:Object=null):void{
if (_loaded == false){
return;
};
_gamerSafe.showShop(_arg1);
}
public function hideStatusBar():void{
if (_loaded == false){
return;
};
_gamerSafe.hideStatusBar();
}
public function set onItemPurchaseFailed(_arg1:Function):void{
_evt_itemPurchaseFailed = _arg1;
}
public function get onLoginFailed():Function{
return (_evt_loginFailed);
}
public function get latestItemPurchaseInfo():Object{
if (_loaded == false){
return (null);
};
return (_gamerSafe.getLatestItemPurchaseInfo());
}
public function set onLogin(_arg1:Function):void{
_evt_login = _arg1;
}
private function beginSession(_arg1:String, _arg2:String):Boolean{
if (_loaded == false){
return (false);
};
_gamerSafe.beginSession(_arg1, _arg2, _referrer);
return (true);
}
public function showPopup(_arg1:String, _arg2:Object=null):void{
if (_loaded == false){
return;
};
_gamerSafe.showPopup(_arg1, _arg2);
}
public function get inSession():Boolean{
if (_loaded == false){
return (false);
};
return (_gamerSafe.inSession);
}
private function onLoadingError(_arg1:IOErrorEvent):void{
_loaded = false;
_status = "Failed";
trace("Failed to load GamerSafe");
}
public function purchaseItem(_arg1:int, _arg2:int=0):Boolean{
if (_loaded == false){
return (false);
};
return (_gamerSafe.purchaseItem(_arg1, _arg2));
}
public function get items():Array{
if (_loaded == false){
return ([]);
};
if (inSession == false){
return ([]);
};
return (_gamerSafe.itemList);
}
public function get gamerPoints():uint{
if (_loaded == false){
return (0);
};
return (_gamerSafe.gamerPoints);
}
public function get gamerXP():uint{
if (_loaded == false){
return (0);
};
return (_gamerSafe.gamerXP);
}
private function e_onItemPurchase(_arg1:Event):void{
if (_evt_itemPurchase != null){
_evt_itemPurchase();
};
dispatchEvent(_arg1);
}
private function e_onUseStarted(_arg1):void{
if (_inUse == true){
return;
};
_inUse = true;
if (_evt_useChanged != null){
_evt_useChanged();
};
if (_evt_useStarted != null){
_evt_useStarted();
};
dispatchEvent(new Event("inUseStarted"));
dispatchEvent(new Event("inUseChanged"));
}
public function get status():String{
return (_status);
}
public function get isGamerGoldPurchaseDisabled():Boolean{
if (_loaded == false){
return (true);
};
return (_gamerSafe.isGamerGoldPurchasingDisabled);
}
public function set autoLogin(_arg1:Boolean):void{
if (_loaded == false){
return;
};
_gamerSafe.autoLogin = _arg1;
}
public static function get api():GamerSafe{
if (_instance == null){
trace("GamerSafe: Instance Error: Attempted to get instance before initial construction.");
return (null);
};
return (_instance);
}
}
}//package
Section 403
//GranadaExplosion (GranadaExplosion)
package {
import flash.media.*;
public dynamic class GranadaExplosion extends Sound {
}
}//package
Section 404
//Gridiron (Gridiron)
package {
import flash.media.*;
public dynamic class Gridiron extends Sound {
}
}//package
Section 405
//Groove (Groove)
package {
import flash.media.*;
public dynamic class Groove extends Sound {
}
}//package
Section 406
//head_shot (head_shot)
package {
import flash.media.*;
public dynamic class head_shot extends Sound {
}
}//package
Section 407
//hollin_01 (hollin_01)
package {
import flash.display.*;
public dynamic class hollin_01 extends BitmapData {
public function hollin_01(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 408
//ice_break (ice_break)
package {
import flash.media.*;
public dynamic class ice_break extends Sound {
}
}//package
Section 409
//impacto_bidon_01 (impacto_bidon_01)
package {
import flash.media.*;
public dynamic class impacto_bidon_01 extends Sound {
}
}//package
Section 410
//impacto_bidon_02 (impacto_bidon_02)
package {
import flash.media.*;
public dynamic class impacto_bidon_02 extends Sound {
}
}//package
Section 411
//impacto_carrito_01 (impacto_carrito_01)
package {
import flash.media.*;
public dynamic class impacto_carrito_01 extends Sound {
}
}//package
Section 412
//impacto_carrito_02 (impacto_carrito_02)
package {
import flash.media.*;
public dynamic class impacto_carrito_02 extends Sound {
}
}//package
Section 413
//item (item)
package {
import flash.media.*;
public dynamic class item extends Sound {
}
}//package
Section 414
//Lanzallamas (Lanzallamas)
package {
import flash.media.*;
public dynamic class Lanzallamas extends Sound {
}
}//package
Section 415
//M16 (M16)
package {
import flash.media.*;
public dynamic class M16 extends Sound {
}
}//package
Section 416
//M249 (M249)
package {
import flash.media.*;
public dynamic class M249 extends Sound {
}
}//package
Section 417
//M60 (M60)
package {
import flash.media.*;
public dynamic class M60 extends Sound {
}
}//package
Section 418
//M9 (M9)
package {
import flash.media.*;
public dynamic class M9 extends Sound {
}
}//package
Section 419
//Mashem (Mashem)
package {
import flash.media.*;
public dynamic class Mashem extends Sound {
}
}//package
Section 420
//metro1 (metro1)
package {
import flash.display.*;
public dynamic class metro1 extends MovieClip {
}
}//package
Section 421
//metro2 (metro2)
package {
import flash.display.*;
public dynamic class metro2 extends MovieClip {
}
}//package
Section 422
//metro3 (metro3)
package {
import flash.display.*;
public dynamic class metro3 extends MovieClip {
}
}//package
Section 423
//Minigun (Minigun)
package {
import flash.media.*;
public dynamic class Minigun extends Sound {
}
}//package
Section 424
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.system.*;
import flash.net.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 425
//mordisco_zombie (mordisco_zombie)
package {
import flash.media.*;
public dynamic class mordisco_zombie extends Sound {
}
}//package
Section 426
//Motosierra (Motosierra)
package {
import flash.media.*;
public dynamic class Motosierra extends Sound {
}
}//package
Section 427
//MP5 (MP5)
package {
import flash.media.*;
public dynamic class MP5 extends Sound {
}
}//package
Section 428
//P90 (P90)
package {
import flash.media.*;
public dynamic class P90 extends Sound {
}
}//package
Section 429
//panel_detectar_tecla (panel_detectar_tecla)
package {
import flash.display.*;
import flash.text.*;
public dynamic class panel_detectar_tecla extends MovieClip {
public var texto:TextField;
}
}//package
Section 430
//park1 (park1)
package {
import flash.display.*;
public dynamic class park1 extends MovieClip {
}
}//package
Section 431
//park2 (park2)
package {
import flash.display.*;
public dynamic class park2 extends MovieClip {
}
}//package
Section 432
//park3 (park3)
package {
import flash.display.*;
public dynamic class park3 extends MovieClip {
}
}//package
Section 433
//player_damage (player_damage)
package {
import flash.media.*;
public dynamic class player_damage extends Sound {
}
}//package
Section 434
//player_zafarse (player_zafarse)
package {
import flash.media.*;
public dynamic class player_zafarse extends Sound {
}
}//package
Section 435
//punto_blanco (punto_blanco)
package {
import flash.display.*;
public dynamic class punto_blanco extends MovieClip {
public function punto_blanco(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
visible = true;
}
}
}//package
Section 436
//punto_rojo (punto_rojo)
package {
import flash.display.*;
public dynamic class punto_rojo extends MovieClip {
}
}//package
Section 437
//salpicadura_sangre (salpicadura_sangre)
package {
import flash.display.*;
public dynamic class salpicadura_sangre extends MovieClip {
public var mc_salpicadura:MovieClip;
public function salpicadura_sangre(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 438
//shiwes1 (shiwes1)
package {
import flash.media.*;
public dynamic class shiwes1 extends Sound {
}
}//package
Section 439
//SPAS12 (SPAS12)
package {
import flash.media.*;
public dynamic class SPAS12 extends Sound {
}
}//package
Section 440
//Stinger (Stinger)
package {
import flash.media.*;
public dynamic class Stinger extends Sound {
}
}//package
Section 441
//Stingermisile (Stingermisile)
package {
import flash.media.*;
public dynamic class Stingermisile extends Sound {
}
}//package
Section 442
//stingermissile_smoke (stingermissile_smoke)
package {
import flash.media.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class stingermissile_smoke extends MovieClip {
public var tar;
public function stingermissile_smoke(){
addFrameScript(44, frame45);
}
function frame45(){
stop();
tar = this.parent;
tar.finalize();
}
}
}//package
Section 443
//street1 (street1)
package {
import flash.display.*;
public dynamic class street1 extends MovieClip {
}
}//package
Section 444
//street2 (street2)
package {
import flash.display.*;
public dynamic class street2 extends MovieClip {
}
}//package
Section 445
//street3 (street3)
package {
import flash.display.*;
public dynamic class street3 extends MovieClip {
}
}//package
Section 446
//terraza1 (terraza1)
package {
import flash.display.*;
public dynamic class terraza1 extends MovieClip {
}
}//package
Section 447
//terraza2 (terraza2)
package {
import flash.display.*;
public dynamic class terraza2 extends MovieClip {
}
}//package
Section 448
//trofeo (trofeo)
package {
import flash.media.*;
public dynamic class trofeo extends Sound {
}
}//package
Section 449
//USP (USP)
package {
import flash.media.*;
public dynamic class USP extends Sound {
}
}//package
Section 450
//Uzi (Uzi)
package {
import flash.media.*;
public dynamic class Uzi extends Sound {
}
}//package
Section 451
//weapons_buttons_array (weapons_buttons_array)
package {
import flash.display.*;
public dynamic class weapons_buttons_array extends MovieClip {
}
}//package
Section 452
//victoria (victoria)
package {
import flash.media.*;
public dynamic class victoria extends Sound {
}
}//package
Section 453
//Winchester (Winchester)
package {
import flash.media.*;
public dynamic class Winchester extends Sound {
}
}//package
Section 454
//woosh_corto_01 (woosh_corto_01)
package {
import flash.media.*;
public dynamic class woosh_corto_01 extends Sound {
}
}//package
Section 455
//woosh_corto_02 (woosh_corto_02)
package {
import flash.media.*;
public dynamic class woosh_corto_02 extends Sound {
}
}//package
Section 456
//woosh_largo_01 (woosh_largo_01)
package {
import flash.media.*;
public dynamic class woosh_largo_01 extends Sound {
}
}//package
Section 457
//woosh_largo_02 (woosh_largo_02)
package {
import flash.media.*;
public dynamic class woosh_largo_02 extends Sound {
}
}//package
Section 458
//woosh_medio_01 (woosh_medio_01)
package {
import flash.media.*;
public dynamic class woosh_medio_01 extends Sound {
}
}//package
Section 459
//woosh_medio_02 (woosh_medio_02)
package {
import flash.media.*;
public dynamic class woosh_medio_02 extends Sound {
}
}//package
Section 460
//zatoichi (zatoichi)
package {
import flash.media.*;
public dynamic class zatoichi extends Sound {
}
}//package
Section 461
//zombie_arde (zombie_arde)
package {
import flash.media.*;
public dynamic class zombie_arde extends Sound {
}
}//package
Section 462
//zombie_damage_01 (zombie_damage_01)
package {
import flash.media.*;
public dynamic class zombie_damage_01 extends Sound {
}
}//package
Section 463
//zombie_damage_02 (zombie_damage_02)
package {
import flash.media.*;
public dynamic class zombie_damage_02 extends Sound {
}
}//package
Section 464
//zombie_pain1 (zombie_pain1)
package {
import flash.media.*;
public dynamic class zombie_pain1 extends Sound {
}
}//package
Section 465
//zombie_pain2 (zombie_pain2)
package {
import flash.media.*;
public dynamic class zombie_pain2 extends Sound {
}
}//package
Section 466
//zombie_pain3 (zombie_pain3)
package {
import flash.media.*;
public dynamic class zombie_pain3 extends Sound {
}
}//package
Section 467
//zombie_pain4 (zombie_pain4)
package {
import flash.media.*;
public dynamic class zombie_pain4 extends Sound {
}
}//package
Section 468
//zombie_pain5 (zombie_pain5)
package {
import flash.media.*;
public dynamic class zombie_pain5 extends Sound {
}
}//package