code
stringlengths
57
237k
package controls { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/controls.TankWindowInner_rightClass.png")] public class TankWindowInner_rightClass extends BitmapAsset { public function TankWindowInner_rightClass() { super(); } } }
package projects.tanks.client.clans.clan.clanflag { import alternativa.types.Long; import platform.client.fp10.core.resource.types.ImageResource; public class ClanFlag { private var _flagImage:ImageResource; private var _id:Long; private var _name:String; public function ClanFlag(param1:ImageResource = null, param2:Long = null, param3:String = null) { super(); this._flagImage = param1; this._id = param2; this._name = param3; } public function get flagImage() : ImageResource { return this._flagImage; } public function set flagImage(param1:ImageResource) : void { this._flagImage = param1; } public function get id() : Long { return this._id; } public function set id(param1:Long) : void { this._id = param1; } public function get name() : String { return this._name; } public function set name(param1:String) : void { this._name = param1; } public function toString() : String { var local1:String = "ClanFlag ["; local1 += "flagImage = " + this.flagImage + " "; local1 += "id = " + this.id + " "; local1 += "name = " + this.name + " "; return local1 + "]"; } } }
package alternativa.tanks.models.tank { import alternativa.tanks.battle.objects.tank.Tank; import platform.client.fp10.core.model.impl.Model; import platform.client.fp10.core.type.IGameObject; public class InitTankPartAdapt implements InitTankPart { private var object:IGameObject; private var impl:InitTankPart; public function InitTankPartAdapt(param1:IGameObject, param2:InitTankPart) { super(); this.object = param1; this.impl = param2; } public function initTankPart(param1:Tank) : void { var tank:Tank = param1; try { Model.object = this.object; this.impl.initTankPart(tank); } finally { Model.popObject(); } } } }
package alternativa.tanks.locale.en { import mx.core.BitmapAsset; [ExcludeClass] public class Image_bitmapAbon extends BitmapAsset { public function Image_bitmapAbon() { super(); } } }
package _codec.projects.tanks.client.battlefield.models.user.suicide { import alternativa.protocol.ICodec; import alternativa.protocol.IProtocol; import alternativa.protocol.ProtocolBuffer; import alternativa.protocol.codec.OptionalCodecDecorator; import alternativa.protocol.impl.LengthCodecHelper; import alternativa.protocol.info.TypeCodecInfo; import projects.tanks.client.battlefield.models.user.suicide.SuicideCC; public class VectorCodecSuicideCCLevel1 implements ICodec { private var elementCodec:ICodec; private var optionalElement:Boolean; public function VectorCodecSuicideCCLevel1(param1:Boolean) { super(); this.optionalElement = param1; } public function init(param1:IProtocol) : void { this.elementCodec = param1.getCodec(new TypeCodecInfo(SuicideCC,false)); if(this.optionalElement) { this.elementCodec = new OptionalCodecDecorator(this.elementCodec); } } public function decode(param1:ProtocolBuffer) : Object { var local2:int = int(LengthCodecHelper.decodeLength(param1)); var local3:Vector.<SuicideCC> = new Vector.<SuicideCC>(local2,true); var local4:int = 0; while(local4 < local2) { local3[local4] = SuicideCC(this.elementCodec.decode(param1)); local4++; } return local3; } public function encode(param1:ProtocolBuffer, param2:Object) : void { var local4:SuicideCC = null; if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:Vector.<SuicideCC> = Vector.<SuicideCC>(param2); var local5:int = int(local3.length); LengthCodecHelper.encodeLength(param1,local5); var local6:int = 0; while(local6 < local5) { this.elementCodec.encode(param1,local3[local6]); local6++; } } } }
package alternativa.tanks.utils { import flash.events.Event; import flash.events.EventDispatcher; public class TaskSequence extends EventDispatcher { private var tasks:Vector.<Task>; private var currentTask:int; private var killed:Boolean; public function TaskSequence() { super(); this.tasks = new Vector.<Task>(); } public function kill() : void { this.killed = true; } public function addTask(param1:Task) : void { if(this.tasks.indexOf(param1) < 0) { this.tasks.push(param1); param1.taskSequence = this; } } public function run() : void { if(this.tasks.length > 0) { this.currentTask = 0; this.runCurrentTask(); } else { this.tasks = null; dispatchEvent(new Event(Event.COMPLETE)); } } private function runCurrentTask() : void { var local1:Task = this.tasks[this.currentTask]; local1.run(); } internal function taskComplete(param1:Task) : void { if(!this.killed) { if(++this.currentTask < this.tasks.length) { this.runCurrentTask(); } else { dispatchEvent(new Event(Event.COMPLETE)); } } } } }
package alternativa.tanks.model.payment.shop.specialkit.view { import projects.tanks.client.panel.model.shop.specialkit.view.IPayPalKitViewModelBase; import projects.tanks.client.panel.model.shop.specialkit.view.PayPalKitViewModelBase; [ModelInfo] public class PayPalKitViewModel extends PayPalKitViewModelBase implements IPayPalKitViewModelBase, PayPalKitView { public function PayPalKitViewModel() { super(); } } }
package projects.tanks.client.panel.model.rulesupdate.showing { public interface IRulesUpdateShowingModelBase { } }
package alternativa.tanks.model.payment.modes.gate2shop { import alternativa.tanks.gui.EmailBlockRequestEvent; import alternativa.tanks.gui.payment.forms.PayModeForm; import alternativa.tanks.gui.payment.forms.gate2shop.Gate2ShopForm; import alternativa.tanks.model.payment.category.PayModeView; import alternativa.tanks.model.payment.modes.PayUrl; import alternativa.tanks.model.payment.modes.asyncurl.AsyncUrlPayMode; import alternativa.tanks.model.payment.paymentstate.PaymentWindowService; import platform.client.fp10.core.model.ObjectLoadListener; import platform.client.fp10.core.model.ObjectUnloadListener; import projects.tanks.client.panel.model.payment.modes.gate2shop.Gate2ShopPaymentModelBase; import projects.tanks.client.panel.model.payment.modes.gate2shop.IGate2ShopPaymentModelBase; import projects.tanks.client.panel.model.payment.types.PaymentRequestUrl; [ModelInfo] public class Gate2ShopPaymentModel extends Gate2ShopPaymentModelBase implements IGate2ShopPaymentModelBase, Gate2ShopPayment, AsyncUrlPayMode, ObjectLoadListener, PayModeView, ObjectUnloadListener { [Inject] public static var paymentWindowService:PaymentWindowService; private var emailFormPassed:Boolean = false; public function Gate2ShopPaymentModel() { super(); } public function objectLoaded() : void { putData(PayModeForm,new Gate2ShopForm(object)); this.view.addEventListener(EmailBlockRequestEvent.SEND_VALIDATE_EMAIL_REQUEST_EVENT,getFunctionWrapper(this.onValidateEmail)); } public function requestAsyncUrl() : void { server.getPaymentUrl(paymentWindowService.getChosenItem().id); } public function registerEmailAndGetPaymentUrl(param1:String) : void { this.emailFormPassed = true; server.registerEmailAndGetPaymentUrl(paymentWindowService.getChosenItem().id,param1); } public function receiveUrl(param1:PaymentRequestUrl) : void { PayUrl(object.adapt(PayUrl)).forceGoToOrderedUrl(param1); } public function objectUnloaded() : void { this.view.removeEventListener(EmailBlockRequestEvent.SEND_VALIDATE_EMAIL_REQUEST_EVENT,getFunctionWrapper(this.onValidateEmail)); this.view.destroy(); clearData(PayModeForm); } public function getView() : PayModeForm { return PayModeForm(Gate2ShopForm(getData(PayModeForm))); } public function emailInputRequired() : Boolean { return getInitParam().emailInputRequired && !this.emailFormPassed; } private function onValidateEmail(param1:EmailBlockRequestEvent) : void { server.validateEmail(param1.email); } public function showEmailIsBusy(param1:String) : void { this.view.showEmailIsBusy(param1); } public function showEmailIsForbidden(param1:String) : void { this.view.showEmailIsForbidden(param1); } public function showEmailIsFree(param1:String) : void { this.view.showEmailIsFree(param1); } private function get view() : Gate2ShopForm { return Gate2ShopForm(getData(PayModeForm)); } } }
package alternativa.tanks.view.icons { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/alternativa.tanks.view.icons.BattleParamsCheckButtonIcons_friendlyFireClass.png")] public class BattleParamsCheckButtonIcons_friendlyFireClass extends BitmapAsset { public function BattleParamsCheckButtonIcons_friendlyFireClass() { super(); } } }
package forms.buttons { import mx.core.BitmapAsset; [ExcludeClass] public class MainPanelFriendsButton_overBtn extends BitmapAsset { public function MainPanelFriendsButton_overBtn() { super(); } } }
package alternativa.engine3d.loaders { import alternativa.engine3d.alternativa3d; import alternativa.engine3d.animation.AnimationClip; import alternativa.engine3d.animation.keys.Track; import alternativa.engine3d.containers.LODContainer; import alternativa.engine3d.core.Light3D; import alternativa.engine3d.core.Object3D; import alternativa.engine3d.core.Object3DContainer; import alternativa.engine3d.loaders.collada.DaeDocument; import alternativa.engine3d.loaders.collada.DaeMaterial; import alternativa.engine3d.loaders.collada.DaeNode; import alternativa.engine3d.loaders.collada.DaeObject; import alternativa.engine3d.materials.Material; import alternativa.engine3d.materials.TextureMaterial; import flash.utils.Dictionary; use namespace alternativa3d; public class ParserCollada { public static const STATIC_OBJECT:uint = 0; public static const STATIC_GEOMETRY:uint = 1; public static const SPLITTER:uint = 2; public var objects:Vector.<Object3D>; public var parents:Vector.<Object3D>; public var hierarchy:Vector.<Object3D>; public var lights:Vector.<Light3D>; public var materials:Vector.<Material>; public var textureMaterials:Vector.<TextureMaterial>; public var animations:Vector.<AnimationClip>; private var layers:Dictionary; private var bspContainerChildrenTypes:Dictionary; public function ParserCollada() { super(); } public static function parseAnimation(param1:XML) : AnimationClip { var local2:DaeDocument = new DaeDocument(param1); var local3:AnimationClip = new AnimationClip(); collectAnimation(local3,local2.scene.nodes); return local3.numTracks > 0 ? local3 : null; } private static function collectAnimation(param1:AnimationClip, param2:Vector.<DaeNode>) : void { var local5:DaeNode = null; var local6:AnimationClip = null; var local7:int = 0; var local8:int = 0; var local9:Track = null; var local3:int = 0; var local4:int = int(param2.length); while(local3 < local4) { local5 = param2[local3]; local6 = local5.parseAnimation(); if(local6 != null) { local7 = 0; local8 = local6.numTracks; while(local7 < local8) { local9 = local6.getTrackAt(local7); param1.addTrack(local9); local7++; } } else { param1.addTrack(local5.createStaticTransformTrack()); } collectAnimation(param1,local5.nodes); local3++; } } public function clean() : void { this.objects = null; this.parents = null; this.hierarchy = null; this.lights = null; this.animations = null; this.materials = null; this.textureMaterials = null; this.layers = null; this.bspContainerChildrenTypes = null; } public function getObjectLayer(param1:Object3D) : String { return this.layers[param1]; } public function getBspContainerChildType(param1:Object3D) : uint { return this.bspContainerChildrenTypes[param1]; } private function init(param1:XML) : DaeDocument { this.clean(); this.objects = new Vector.<Object3D>(); this.parents = new Vector.<Object3D>(); this.hierarchy = new Vector.<Object3D>(); this.lights = new Vector.<Light3D>(); this.animations = new Vector.<AnimationClip>(); this.materials = new Vector.<Material>(); this.textureMaterials = new Vector.<TextureMaterial>(); this.layers = new Dictionary(); this.bspContainerChildrenTypes = new Dictionary(); return new DaeDocument(param1); } public function parse(param1:XML, param2:String = null, param3:Boolean = false) : void { var local4:DaeDocument = this.init(param1); if(local4.scene != null) { this.parseNodes(local4.scene.nodes,null,false); this.parseMaterials(local4.materials,param2,param3); } } private function hasSignifiantChildren(param1:DaeNode, param2:Boolean) : Boolean { var local6:DaeNode = null; var local3:Vector.<DaeNode> = param1.nodes; var local4:int = 0; var local5:int = int(local3.length); while(local4 < local5) { local6 = local3[local4]; local6.parse(); if(local6.skins != null) { return true; } if(local6.skinOrTopmostJoint == false) { if(param2 == false) { return true; } } if(this.hasSignifiantChildren(local6,true)) { return true; } local4++; } return false; } private function addObject(param1:DaeObject, param2:Object3D, param3:String) : Object3D { var local6:LODContainer = null; var local7:Number = NaN; var local4:Object3D = param1.object as Object3D; this.objects.push(local4); this.parents.push(param2); if(param2 == null) { this.hierarchy.push(local4); } var local5:Object3DContainer = param2 as Object3DContainer; if(local5 != null) { local5.addChild(local4); local6 = local5 as LODContainer; if(local6 != null) { local7 = param1.lodDistance; if(local7 != 0) { local6.setChildDistance(local4,local7); } } } if(local4 is Light3D) { this.lights.push(Light3D(local4)); } if(param1.animation != null) { this.animations.push(param1.animation); } if(Boolean(param3)) { this.layers[local4] = param3; } if(param1.isStaticGeometry) { this.bspContainerChildrenTypes[local4] = STATIC_GEOMETRY; } else if(param1.isSplitter) { this.bspContainerChildrenTypes[local4] = SPLITTER; } return local4; } private function addObjects(param1:Vector.<DaeObject>, param2:Object3D, param3:String) : Object3D { var local4:Object3D = this.addObject(param1[0],param2,param3); var local5:int = 1; var local6:int = int(param1.length); while(local5 < local6) { this.addObject(param1[local5],param2,param3); local5++; } return local4; } private function parseNodes(param1:Vector.<DaeNode>, param2:Object3DContainer, param3:Boolean = false) : void { var local6:DaeNode = null; var local7:Object3DContainer = null; var local8:Boolean = false; var local9:Object3D = null; var local4:int = 0; var local5:int = int(param1.length); while(local4 < local5) { local6 = param1[local4]; local6.parse(); local7 = null; local8 = false; if(local6.skins != null) { this.addObjects(local6.skins,param2,local6.layer); } else if(param3 == false && local6.skinOrTopmostJoint == false) { if(local6.objects != null) { local7 = this.addObjects(local6.objects,param2,local6.layer) as Object3DContainer; } else { local8 = true; } } if(local7 == null) { if(this.hasSignifiantChildren(local6,param3 || local6.skinOrTopmostJoint)) { local7 = new Object3DContainer(); local7.name = local6.name; this.addObject(local6.applyAnimation(local6.applyTransformations(local7)),param2,local6.layer); this.parseNodes(local6.nodes,local7,param3 || local6.skinOrTopmostJoint); local7.calculateBounds(); } else if(local8) { local9 = new Object3D(); local9.name = local6.name; this.addObject(local6.applyAnimation(local6.applyTransformations(local9)),param2,local6.layer); } } else { this.parseNodes(local6.nodes,local7,param3 || local6.skinOrTopmostJoint); local7.calculateBounds(); } local4++; } } private function trimPath(param1:String) : String { var local2:int = int(param1.lastIndexOf("/")); return local2 < 0 ? param1 : param1.substr(local2 + 1); } private function parseMaterials(param1:Object, param2:String, param3:Boolean) : void { var local4:TextureMaterial = null; var local5:DaeMaterial = null; var local6:String = null; var local7:int = 0; for each(local5 in param1) { if(local5.used) { local5.parse(); this.materials.push(local5.material); local4 = local5.material as TextureMaterial; if(local4 != null) { this.textureMaterials.push(local4); } } } if(param3) { for each(local4 in this.textureMaterials) { if(local4.diffuseMapURL != null) { local4.diffuseMapURL = this.trimPath(this.fixURL(local4.diffuseMapURL)); } if(local4.opacityMapURL != null) { local4.opacityMapURL = this.trimPath(this.fixURL(local4.opacityMapURL)); } } } else { for each(local4 in this.textureMaterials) { if(local4.diffuseMapURL != null) { local4.diffuseMapURL = this.fixURL(local4.diffuseMapURL); } if(local4.opacityMapURL != null) { local4.opacityMapURL = this.fixURL(local4.opacityMapURL); } } } if(param2 != null) { param2 = this.fixURL(param2); local7 = int(param2.lastIndexOf("/")); local6 = local7 < 0 ? "" : param2.substr(0,local7); for each(local4 in this.textureMaterials) { if(local4.diffuseMapURL != null) { local4.diffuseMapURL = this.resolveURL(local4.diffuseMapURL,local6); } if(local4.opacityMapURL != null) { local4.opacityMapURL = this.resolveURL(local4.opacityMapURL,local6); } } } } private function fixURL(param1:String) : String { var local2:int = int(param1.indexOf("://")); local2 = local2 < 0 ? 0 : local2 + 3; var local3:int = int(param1.indexOf("?",local2)); local3 = local3 < 0 ? int(param1.indexOf("#",local2)) : local3; var local4:String = param1.substring(local2,local3 < 0 ? 2147483647 : local3); local4 = local4.replace(/\\/g,"/"); var local5:int = int(param1.indexOf("file://")); if(local5 >= 0) { if(param1.charAt(local2) == "/") { return "file://" + local4 + (local3 >= 0 ? param1.substring(local3) : ""); } return "file:///" + local4 + (local3 >= 0 ? param1.substring(local3) : ""); } return param1.substring(0,local2) + local4 + (local3 >= 0 ? param1.substring(local3) : ""); } private function mergePath(param1:String, param2:String, param3:Boolean = false) : String { var local8:String = null; var local9:String = null; var local4:Array = param2.split("/"); var local5:Array = param1.split("/"); var local6:int = 0; var local7:int = int(local5.length); while(local6 < local7) { local8 = local5[local6]; if(local8 == "..") { local9 = local4.pop(); while(local9 == "." || local9 == "" && local9 != null) { local9 = local4.pop(); } if(param3) { if(local9 == "..") { local4.push("..",".."); } else if(local9 == null) { local4.push(".."); } } } else { local4.push(local8); } local6++; } return local4.join("/"); } private function resolveURL(param1:String, param2:String) : String { var local5:int = 0; var local6:String = null; var local7:String = null; var local8:String = null; var local9:int = 0; var local10:int = 0; var local11:int = 0; var local12:String = null; var local13:String = null; if(param2 == "") { return param1; } if(param1.charAt(0) == "." && param1.charAt(1) == "/") { return param2 + param1.substr(1); } if(param1.charAt(0) == "/") { return param1; } if(param1.charAt(0) == "." && param1.charAt(1) == ".") { local5 = int(param1.indexOf("?")); local5 = local5 < 0 ? int(param1.indexOf("#")) : local5; if(local5 < 0) { local7 = ""; local6 = param1; } else { local7 = param1.substring(local5); local6 = param1.substring(0,local5); } local9 = int(param2.indexOf("/")); local10 = int(param2.indexOf(":")); local11 = int(param2.indexOf("//")); if(local11 < 0 || local11 > local9) { if(local10 >= 0 && local10 < local9) { local12 = param2.substring(0,local10 + 1); local8 = param2.substring(local10 + 1); if(local8.charAt(0) == "/") { return local12 + "/" + this.mergePath(local6,local8.substring(1),false) + local7; } return local12 + this.mergePath(local6,local8,false) + local7; } if(param2.charAt(0) == "/") { return "/" + this.mergePath(local6,param2.substring(1),false) + local7; } return this.mergePath(local6,param2,true) + local7; } local9 = int(param2.indexOf("/",local11 + 2)); if(local9 >= 0) { local13 = param2.substring(0,local9 + 1); local8 = param2.substring(local9 + 1); return local13 + this.mergePath(local6,local8,false) + local7; } local13 = param2; return local13 + "/" + this.mergePath(local6,"",false); } var local3:int = int(param1.indexOf(":")); var local4:int = int(param1.indexOf("/")); if(local3 >= 0 && (local3 < local4 || local4 < 0)) { return param1; } return param2 + "/" + param1; } public function getObjectByName(param1:String) : Object3D { var local2:Object3D = null; for each(local2 in this.objects) { if(local2.name == param1) { return local2; } } return null; } public function getAnimationByObject(param1:Object) : AnimationClip { var local2:AnimationClip = null; var local3:Array = null; for each(local2 in this.animations) { local3 = local2.alternativa3d::_objects; if(local3.indexOf(param1) >= 0) { return local2; } } return null; } } }
package projects.tanks.client.entrance.model.entrance.telegram { import alternativa.osgi.OSGi; import alternativa.protocol.IProtocol; import alternativa.protocol.ProtocolBuffer; import alternativa.protocol.info.TypeCodecInfo; import alternativa.types.Long; import platform.client.fp10.core.model.IModel; import platform.client.fp10.core.model.impl.Model; import platform.client.fp10.core.registry.ModelRegistry; public class TelegramEntranceModelBase extends Model { private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol)); protected var server:TelegramEntranceModelServer; private var client:ITelegramEntranceModelBase = ITelegramEntranceModelBase(this); private var modelId:Long = Long.getLong(1128540715,1798214066); public function TelegramEntranceModelBase() { super(); this.initCodecs(); } protected function initCodecs() : void { this.server = new TelegramEntranceModelServer(IModel(this)); var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry)); local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(TelegramEntranceModelCC,false))); } protected function getInitParam() : TelegramEntranceModelCC { return TelegramEntranceModelCC(initParams[Model.object]); } override public function invoke(param1:Long, param2:ProtocolBuffer) : void { var local3:* = param1; switch(false ? 0 : 0) { } } override public function get id() : Long { return this.modelId; } } }
package alternativa.tanks.gui.shop.shopitems.item.crystalitem { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/alternativa.tanks.gui.shop.shopitems.item.crystalitem.CrystalPackageItemIcons_crystalWhiteClass.png")] public class CrystalPackageItemIcons_crystalWhiteClass extends BitmapAsset { public function CrystalPackageItemIcons_crystalWhiteClass() { super(); } } }
package alternativa.tanks.model.gift.icons { import mx.core.BitmapAsset; [ExcludeClass] public class ItemGiftBackgrounds__bg_rare extends BitmapAsset { public function ItemGiftBackgrounds__bg_rare() { super(); } } }
package projects.tanks.client.battlefield.models.tankparts.weapons.rocketlauncher { public class RocketLauncherCC { private var _angularVelocity:Number; private var _boostPhaseDuration:int; private var _maxSpeed:Number; private var _minSpeed:Number; private var _salvoAimingGracePeriod:int; private var _salvoAimingTime:int; private var _salvoReloadTime:int; private var _salvoSize:int; private var _shellRadius:Number; private var _shotRange:Number; private var _timeBetweenShotsOfSalvo:int; public function RocketLauncherCC(param1:Number = 0, param2:int = 0, param3:Number = 0, param4:Number = 0, param5:int = 0, param6:int = 0, param7:int = 0, param8:int = 0, param9:Number = 0, param10:Number = 0, param11:int = 0) { super(); this._angularVelocity = param1; this._boostPhaseDuration = param2; this._maxSpeed = param3; this._minSpeed = param4; this._salvoAimingGracePeriod = param5; this._salvoAimingTime = param6; this._salvoReloadTime = param7; this._salvoSize = param8; this._shellRadius = param9; this._shotRange = param10; this._timeBetweenShotsOfSalvo = param11; } public function get angularVelocity() : Number { return this._angularVelocity; } public function set angularVelocity(param1:Number) : void { this._angularVelocity = param1; } public function get boostPhaseDuration() : int { return this._boostPhaseDuration; } public function set boostPhaseDuration(param1:int) : void { this._boostPhaseDuration = param1; } public function get maxSpeed() : Number { return this._maxSpeed; } public function set maxSpeed(param1:Number) : void { this._maxSpeed = param1; } public function get minSpeed() : Number { return this._minSpeed; } public function set minSpeed(param1:Number) : void { this._minSpeed = param1; } public function get salvoAimingGracePeriod() : int { return this._salvoAimingGracePeriod; } public function set salvoAimingGracePeriod(param1:int) : void { this._salvoAimingGracePeriod = param1; } public function get salvoAimingTime() : int { return this._salvoAimingTime; } public function set salvoAimingTime(param1:int) : void { this._salvoAimingTime = param1; } public function get salvoReloadTime() : int { return this._salvoReloadTime; } public function set salvoReloadTime(param1:int) : void { this._salvoReloadTime = param1; } public function get salvoSize() : int { return this._salvoSize; } public function set salvoSize(param1:int) : void { this._salvoSize = param1; } public function get shellRadius() : Number { return this._shellRadius; } public function set shellRadius(param1:Number) : void { this._shellRadius = param1; } public function get shotRange() : Number { return this._shotRange; } public function set shotRange(param1:Number) : void { this._shotRange = param1; } public function get timeBetweenShotsOfSalvo() : int { return this._timeBetweenShotsOfSalvo; } public function set timeBetweenShotsOfSalvo(param1:int) : void { this._timeBetweenShotsOfSalvo = param1; } public function toString() : String { var local1:String = "RocketLauncherCC ["; local1 += "angularVelocity = " + this.angularVelocity + " "; local1 += "boostPhaseDuration = " + this.boostPhaseDuration + " "; local1 += "maxSpeed = " + this.maxSpeed + " "; local1 += "minSpeed = " + this.minSpeed + " "; local1 += "salvoAimingGracePeriod = " + this.salvoAimingGracePeriod + " "; local1 += "salvoAimingTime = " + this.salvoAimingTime + " "; local1 += "salvoReloadTime = " + this.salvoReloadTime + " "; local1 += "salvoSize = " + this.salvoSize + " "; local1 += "shellRadius = " + this.shellRadius + " "; local1 += "shotRange = " + this.shotRange + " "; local1 += "timeBetweenShotsOfSalvo = " + this.timeBetweenShotsOfSalvo + " "; return local1 + "]"; } } }
package projects.tanks.clients.flash.commons.models.runtime { import alternativa.types.Long; import platform.client.fp10.core.model.impl.Model; import platform.client.fp10.core.type.IGameObject; import projects.tanks.client.commons.models.runtime.DataOwnerModelBase; import projects.tanks.client.commons.models.runtime.IDataOwnerModelBase; [ModelInfo] public class DataOwnerModel extends DataOwnerModelBase implements IDataOwnerModelBase, DataOwner { public function DataOwnerModel() { super(); } public function equals(param1:IGameObject) : Boolean { var local2:Long = this.getDataOwnerId(); var local3:Long = this.getDataOwnerIdFor(param1); return local2.high == local3.high && local2.low == local3.low; } public function getDataOwnerId() : Long { return getInitParam().dataOwnerId; } private function getDataOwnerIdFor(param1:IGameObject) : Long { var local2:Long = null; Model.object = param1; local2 = getInitParam().dataOwnerId; Model.popObject(); return local2; } } }
package projects.tanks.client.commons.models.alert { import alternativa.osgi.OSGi; import alternativa.protocol.IProtocol; import alternativa.protocol.OptionalMap; import alternativa.protocol.ProtocolBuffer; import flash.utils.ByteArray; import platform.client.fp10.core.model.IModel; public class AlertModelServer { private var protocol:IProtocol; private var protocolBuffer:ProtocolBuffer; private var model:IModel; public function AlertModelServer(param1:IModel) { super(); this.model = param1; var local2:ByteArray = new ByteArray(); this.protocol = IProtocol(OSGi.getInstance().getService(IProtocol)); this.protocolBuffer = new ProtocolBuffer(local2,local2,new OptionalMap()); } } }
package alternativa.tanks.battle.objects.tank.tankskin.dynamic { import alternativa.engine3d.core.Face; import alternativa.engine3d.materials.Material; public interface DynamicSkin { function addFace(param1:Face) : void; function init() : void; function rotate(param1:Number) : void; function reset() : void; function setMaterial(param1:Material) : void; } }
package _codec.projects.tanks.client.panel.model.tutorialhints { import alternativa.osgi.OSGi; import alternativa.osgi.service.clientlog.IClientLog; import alternativa.protocol.ICodec; import alternativa.protocol.IProtocol; import alternativa.protocol.ProtocolBuffer; import alternativa.protocol.info.TypeCodecInfo; import projects.tanks.client.panel.model.tutorialhints.TutorialHintsCC; import projects.tanks.client.panel.model.tutorialhints.TutorialHintsData; public class CodecTutorialHintsCC implements ICodec { public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog)); private var codec_tutorialHintsData:ICodec; public function CodecTutorialHintsCC() { super(); } public function init(param1:IProtocol) : void { this.codec_tutorialHintsData = param1.getCodec(new TypeCodecInfo(TutorialHintsData,false)); } public function decode(param1:ProtocolBuffer) : Object { var local2:TutorialHintsCC = new TutorialHintsCC(); local2.tutorialHintsData = this.codec_tutorialHintsData.decode(param1) as TutorialHintsData; return local2; } public function encode(param1:ProtocolBuffer, param2:Object) : void { if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:TutorialHintsCC = TutorialHintsCC(param2); this.codec_tutorialHintsData.encode(param1,local3.tutorialHintsData); } } }
package alternativa.osgi.service.serverlog { import alternativa.osgi.OSGi; import alternativa.osgi.service.logging.LogService; public class ServerLoggingServiceStub implements ServerLoggingService { private const FAKE_SERVER_LOGGING_CHANNEL_NAME:String = "fake_server_logs"; public function ServerLoggingServiceStub() { super(); } public function sendDataToServer(param1:String) : void { LogService(OSGi.getInstance().getService(LogService)).getLogger(this.FAKE_SERVER_LOGGING_CHANNEL_NAME).error(param1); } } }
package alternativa.tanks.model.garage.resistance { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/alternativa.tanks.model.garage.resistance.ResistancesIcons_machinegunResistanceClass.png")] public class ResistancesIcons_machinegunResistanceClass extends BitmapAsset { public function ResistancesIcons_machinegunResistanceClass() { super(); } } }
package alternativa.tanks.models.foreignclan { import flash.events.Event; public class ForeignClanEvent extends Event { public static const SEND_REQUEST:String = "ForeignClanEvent.SEND_REQUEST"; public static const ACCEPT_REQUEST:String = "ForeignClanEvent.ACCEPT_REQUEST"; public static const REVOKE_REQUEST:String = "ForeignClanEvent.REJECT_REQUEST"; public function ForeignClanEvent(param1:String) { super(param1,true,false); } } }
package projects.tanks.client.garage.models.item.container.resources { import alternativa.osgi.OSGi; import alternativa.protocol.IProtocol; import alternativa.protocol.OptionalMap; import alternativa.protocol.ProtocolBuffer; import flash.utils.ByteArray; import platform.client.fp10.core.model.IModel; public class ContainerResourceModelServer { private var protocol:IProtocol; private var protocolBuffer:ProtocolBuffer; private var model:IModel; public function ContainerResourceModelServer(param1:IModel) { super(); this.model = param1; var local2:ByteArray = new ByteArray(); this.protocol = IProtocol(OSGi.getInstance().getService(IProtocol)); this.protocolBuffer = new ProtocolBuffer(local2,local2,new OptionalMap()); } } }
package com.lorentz.SVG.data.text { import flash.display.DisplayObject; public class SVGDrawnText { public function SVGDrawnText(displayObject:DisplayObject = null, textWidth:Number = 0, startX:Number = 0, startY:Number = 0, baseLineShift:Number = 0){ this.displayObject = displayObject; this.textWidth = textWidth; this.startX = startX; this.startY = startY; this.baseLineShift = baseLineShift; } public var displayObject:DisplayObject; public var textWidth:Number = 0; public var startX:Number = 0; public var startY:Number = 0; public var direction:String; public var baseLineShift:Number = 0; } }
package com.lorentz.SVG.text { import com.lorentz.SVG.data.text.SVGDrawnText; import com.lorentz.SVG.data.text.SVGTextToDraw; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.text.TextFormat; import flash.text.TextLineMetrics; public class TextFieldSVGTextDrawer implements ISVGTextDrawer { public function start():void { } public function drawText(data:SVGTextToDraw):SVGDrawnText { var textField:TextField = new TextField(); textField.autoSize = TextFieldAutoSize.LEFT; textField.text = data.text; textField.embedFonts = data.useEmbeddedFonts; var textFormat:TextFormat = new TextFormat(); textFormat.font = data.fontFamily; textFormat.size = data.fontSize; textFormat.bold = data.fontWeight == "bold"; textFormat.italic = data.fontStyle == "italic"; textFormat.color = data.color; textFormat.letterSpacing = data.letterSpacing; textField.setTextFormat(textFormat); var lineMetrics:TextLineMetrics = textField.getLineMetrics(0); return new SVGDrawnText(textField, textField.textWidth, 2, lineMetrics.ascent + 2); } public function end():void { } } }
package alternativa.tanks.model.item.discount { import platform.client.fp10.core.model.impl.Model; import platform.client.fp10.core.type.IGameObject; public class ICollectDiscountAdapt implements ICollectDiscount { private var object:IGameObject; private var impl:ICollectDiscount; public function ICollectDiscountAdapt(param1:IGameObject, param2:ICollectDiscount) { super(); this.object = param1; this.impl = param2; } public function collectDiscountsInfo(param1:IDiscountCollector) : void { var collector:IDiscountCollector = param1; try { Model.object = this.object; this.impl.collectDiscountsInfo(collector); } finally { Model.popObject(); } } } }
package projects.tanks.client.battlefield.models.tankparts.weapon.healing { public class IsisCC { private var _capacity:Number; private var _chargeRate:Number; private var _checkPeriodMsec:int; private var _coneAngle:Number; private var _dischargeDamageRate:Number; private var _dischargeHealingRate:Number; private var _dischargeIdleRate:Number; private var _radius:Number; public function IsisCC(param1:Number = 0, param2:Number = 0, param3:int = 0, param4:Number = 0, param5:Number = 0, param6:Number = 0, param7:Number = 0, param8:Number = 0) { super(); this._capacity = param1; this._chargeRate = param2; this._checkPeriodMsec = param3; this._coneAngle = param4; this._dischargeDamageRate = param5; this._dischargeHealingRate = param6; this._dischargeIdleRate = param7; this._radius = param8; } public function get capacity() : Number { return this._capacity; } public function set capacity(param1:Number) : void { this._capacity = param1; } public function get chargeRate() : Number { return this._chargeRate; } public function set chargeRate(param1:Number) : void { this._chargeRate = param1; } public function get checkPeriodMsec() : int { return this._checkPeriodMsec; } public function set checkPeriodMsec(param1:int) : void { this._checkPeriodMsec = param1; } public function get coneAngle() : Number { return this._coneAngle; } public function set coneAngle(param1:Number) : void { this._coneAngle = param1; } public function get dischargeDamageRate() : Number { return this._dischargeDamageRate; } public function set dischargeDamageRate(param1:Number) : void { this._dischargeDamageRate = param1; } public function get dischargeHealingRate() : Number { return this._dischargeHealingRate; } public function set dischargeHealingRate(param1:Number) : void { this._dischargeHealingRate = param1; } public function get dischargeIdleRate() : Number { return this._dischargeIdleRate; } public function set dischargeIdleRate(param1:Number) : void { this._dischargeIdleRate = param1; } public function get radius() : Number { return this._radius; } public function set radius(param1:Number) : void { this._radius = param1; } public function toString() : String { var local1:String = "IsisCC ["; local1 += "capacity = " + this.capacity + " "; local1 += "chargeRate = " + this.chargeRate + " "; local1 += "checkPeriodMsec = " + this.checkPeriodMsec + " "; local1 += "coneAngle = " + this.coneAngle + " "; local1 += "dischargeDamageRate = " + this.dischargeDamageRate + " "; local1 += "dischargeHealingRate = " + this.dischargeHealingRate + " "; local1 += "dischargeIdleRate = " + this.dischargeIdleRate + " "; local1 += "radius = " + this.radius + " "; return local1 + "]"; } } }
package alternativa.utils.filters { import flash.filters.ColorMatrixFilter; import flash.utils.Dictionary; public class BCSHFilter { private static const DELTA:Number = 0.01; private static var filters:Dictionary = new Dictionary(); public function BCSHFilter() { super(); } public static function createFilter(param1:Number, param2:Number, param3:Number, param4:Number) : ColorMatrixFilter { var local5:Object = null; var local6:AdjustColor = null; var local7:ColorMatrixFilter = null; var local8:Object = null; for(local5 in filters) { if(areEqual(param1,local5.b) && areEqual(param2,local5.c) && areEqual(param3,local5.s) && areEqual(param4,local5.h)) { return filters[local5]; } } local6 = new AdjustColor(); local6.brightness = param1; local6.contrast = param2; local6.saturation = param3; local6.hue = param4; local7 = new ColorMatrixFilter(); local7.matrix = local6.CalculateFinalFlatArray(); local8 = { "b":param1, "c":param2, "s":param3, "h":param4 }; filters[local8] = local7; return local7; } private static function areEqual(param1:Number, param2:Number) : Boolean { return Math.abs(param1 - param2) < DELTA; } } }
package alternativa.tanks.models.battle.gui.gui.statistics.messages { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/alternativa.tanks.models.battle.gui.gui.statistics.messages.ActionOutputLine_playerJoinTheBattleIcon.png")] public class ActionOutputLine_playerJoinTheBattleIcon extends BitmapAsset { public function ActionOutputLine_playerJoinTheBattleIcon() { super(); } } }
package alternativa.tanks.models.map { import platform.client.fp10.core.resource.types.SoundResource; import projects.tanks.client.battlefield.models.map.DustParams; import projects.tanks.client.battlefield.models.map.DynamicShadowParams; import projects.tanks.client.battlefield.models.map.FogParams; import projects.tanks.client.battlefield.models.map.SkyboxSides; import projects.tanks.client.battlefield.types.Vector3d; import projects.tanks.clients.flash.resources.resource.MapResource; [ModelInterface] public interface IBattleMap { function getMapResource() : MapResource; function getEnvironmentSound() : SoundResource; function getSkybox() : SkyboxSides; function getGravity() : Number; function getSkyboxRevolutionAxis() : Vector3d; function getSkyBoxRevolutionSpeed() : Number; function getFogParams() : FogParams; function getDynamicShadowParams() : DynamicShadowParams; function getDustParams() : DustParams; function getSSAOColor() : uint; } }
package scpacker.resource.images { import alternativa.model.IResourceLoadListener; import alternativa.resource.StubBitmapData; import flash.display.Bitmap; import flash.display.Loader; import flash.events.ErrorEvent; import flash.events.Event; import flash.events.IOErrorEvent; import flash.net.URLLoader; import flash.net.URLLoaderDataFormat; import flash.net.URLRequest; import flash.utils.ByteArray; import scpacker.resource.cache.CacheURLLoader; import sineysoft.WebpSwc; import specter.resource.ImageType; public class ImageResource { public var bitmapData:Object; public var id:String; public var animatedMaterial:Boolean; public var multiframeData:MultiframeResourceData; public var url:String; private var imageLoader:Object; private var nativeLoader:Loader; private var completeLoadListeners:Vector.<IResourceLoadListener>; private var loading:Boolean = false; public var isWebP:Boolean = false; public var isSVG:Boolean = false; public var type:uint; public function ImageResource(bitmapData:Object, id:String, animatedMaterial:Boolean, multiframeData:MultiframeResourceData, url:String) { super(); this.bitmapData = bitmapData; this.id = id; this.animatedMaterial = animatedMaterial; this.multiframeData = multiframeData; this.url = url; if(bitmapData is String) { if(String(bitmapData).toLowerCase().indexOf(".webp") != -1) { this.type = ImageType.WEBP; } else if(String(bitmapData).toLowerCase().indexOf(".svg") != -1) { this.type = ImageType.SVG; } else if(String(bitmapData).toLowerCase().indexOf(".jp2") != -1) { this.type = ImageType.JPEG2000; } else { this.type = ImageType.COMMON; } } this.completeLoadListeners = new Vector.<IResourceLoadListener>(); } public function set completeLoadListener(object:IResourceLoadListener) : void { this.completeLoadListeners.push(object); } public function load() : void { if(this.loaded() || this.loading) { return; } if(this.type == ImageType.WEBP) { this.imageLoader = new URLLoader(); this.imageLoader.dataFormat = URLLoaderDataFormat.BINARY; this.imageLoader.addEventListener(Event.COMPLETE,this.onPictureLoadingComplete); this.imageLoader.addEventListener(IOErrorEvent.IO_ERROR,this.onPictureLoadingError); this.imageLoader.load(new URLRequest(this.url)); } else if(this.type == ImageType.COMMON) { this.imageLoader = new CacheURLLoader(); this.imageLoader.dataFormat = URLLoaderDataFormat.BINARY; this.imageLoader.addEventListener(Event.COMPLETE,this.onPictureLoadingComplete); this.imageLoader.addEventListener(IOErrorEvent.IO_ERROR,this.onPictureLoadingError); this.imageLoader.load(new URLRequest(this.url)); } this.loading = true; } private function onPictureLoadingComplete(e:Event) : void { var listener:IResourceLoadListener = null; if(this.type == ImageType.WEBP) { this.bitmapData = WebpSwc.decode(ByteArray(e.currentTarget.data)); this.destroyImageLoader(); if(this.completeLoadListeners != null) { for each(listener in this.completeLoadListeners) { listener.resourceLoaded(this); } } } else { this.nativeLoader = new Loader(); this.nativeLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,this.onNativeLoaderComplete); this.nativeLoader.loadBytes(e.target.data); } } private function onNativeLoaderComplete(e:Event) : void { var listener:IResourceLoadListener = null; this.bitmapData = Bitmap(e.target.content).bitmapData; this.destroyImageLoader(); if(this.completeLoadListeners != null) { for each(listener in this.completeLoadListeners) { listener.resourceLoaded(this); } } } private function destroyImageLoader() : void { if(this.imageLoader == null) { return; } if(this.type == ImageType.WEBP) { this.imageLoader.removeEventListener(Event.COMPLETE,this.onPictureLoadingComplete); this.imageLoader.removeEventListener(IOErrorEvent.IO_ERROR,this.onPictureLoadingError); } else if(this.type == ImageType.COMMON) { this.imageLoader.removeEventListener(Event.COMPLETE,this.onPictureLoadingComplete); this.imageLoader.removeEventListener(IOErrorEvent.IO_ERROR,this.onPictureLoadingError); if(this.nativeLoader != null) { this.nativeLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE,this.onNativeLoaderComplete); } } this.imageLoader = null; this.loading = false; } private function onPictureLoadingError(e:ErrorEvent) : void { var listener:IResourceLoadListener = null; this.bitmapData = new StubBitmapData(16711680); this.destroyImageLoader(); if(this.completeLoadListeners != null) { for each(listener in this.completeLoadListeners) { listener.resourceLoaded(this); } } } public function loaded() : Boolean { return this.bitmapData != null && !(this.bitmapData is String); } public function toString() : String { return "ImageResource:[ID: \"" + this.id + "\"; animated: " + this.animatedMaterial + "; URL:\"" + this.url + "\"; loading: " + this.loading + "; data: " + this.bitmapData + "]"; } public function clone() : ImageResource { return new ImageResource(this.bitmapData,this.id,this.animatedMaterial,this.multiframeData,this.url); } } }
package alternativa.engine3d.core { import alternativa.gfx.agal.VertexShader; public class DepthRendererLightVertexShader extends VertexShader { public function DepthRendererLightVertexShader(param1:int) { super(); if(param1 == 0) { mov(vt1,cc.rel(va1.x,0)); mov(v1,vt1); mov(v2,cc.rel(va1.x,1)); mul(vt0,va0,vt1.w); add(vt0,vt0,vt1); div(vt0.xy,vt0,vc[3]); } else { mov(vt2,cc.rel(va1.y,0)); mov(vt3,cc.rel(va1.y,1)); mov(vt4,cc.rel(va1.y,2)); mov(vt5,cc.rel(va1.y,3)); mov(vt6,cc.rel(va1.y,4)); if(param1 == 1) { mul(v1.x,vt2.w,vc[3]); mul(v1.y,vt3.w,vc[3]); mov(v1.zw,vt4.w); mul(v2.x,vt2.z,vc[3]); mul(v2.y,vt3.z,vc[3]); mov(v2.zw,vt4.z); mov(v3,vt5); mov(v4,vt6); mul(vt0,va0,vt6.w); mul(vt0.z,va0,vt5.x); add(vt0.z,vt0,vt5.x); mul(vt0.z,vt0,vc[3].w); } else if(param1 == 2) { mul(vt0.x,vt2.z,vc[3]); mul(vt0.y,vt3.z,vc[3]); mov(vt0.zw,vt4.z); mov(v2,vt0); mul(vt1.x,vt2.w,vc[3]); mul(vt1.y,vt3.w,vc[3]); mov(vt1.zw,vt4.w); mul(vt0,vt0,vt6.w); add(v1,vt1,vt0); mov(v3,vt5); mov(v4,vt6); mul(vt0.xy,va0,vt5.x); mul(vt0.z,va0,vt5); add(vt0.z,vt0,vt6.w); } mov(vt0.w,vc[1]); dp4(vt1.x,vt0,vt2); dp4(vt1.y,vt0,vt3); dp4(vt1.z,vt0,vt4); mov(vt0.xyz,vt1.xyz); } mul(vt0.xy,vt0,vc[1]); mul(vt1,vc[2],vt0.z); sub(vt0.xy,vt0,vt1); mov(v0,vt0); mov(op.xw,vt0.xz); neg(op.y,vt0); mul(vt0.z,vt0,vc[0]); add(op.z,vt0,vc[0].w); } } }
package alternativa.tanks.model.item.upgradable.calculators { public class RangePropertyCalculator implements PropertyCalculator { private var minValue:BasePropertyCalculator; private var maxValue:BasePropertyCalculator; public function RangePropertyCalculator(param1:BasePropertyCalculator, param2:BasePropertyCalculator) { super(); if(param1.getNumberValue(0) < param2.getNumberValue(0)) { this.minValue = param1; this.maxValue = param2; } else { this.minValue = param2; this.maxValue = param1; } } public function getValue(param1:int) : String { return this.minValue.getValue(param1) + "-" + this.maxValue.getValue(param1); } public function getDelta(param1:int) : String { return this.maxValue.getDelta(param1); } public function getPrecision() : int { return this.maxValue.getPrecision(); } } }
package projects.tanks.clients.fp10.libraries.tanksservices.service.blur { import flash.display.DisplayObject; import flash.events.IEventDispatcher; public interface IBlurService extends IEventDispatcher { function blurBattleContent() : void; function unblurBattleContent() : void; function blurGameContent() : void; function unblurGameContent() : void; function blurDialogContent() : void; function unblurDialogContent() : void; function blurAllContent() : void; function unblurAllContent() : void; function blurComponent(param1:DisplayObject) : void; function unblurComponent(param1:DisplayObject) : void; function unblurAllComponents() : void; } }
package _codec.projects.tanks.client.panel.model.kitoffer { import alternativa.osgi.OSGi; import alternativa.osgi.service.clientlog.IClientLog; import alternativa.protocol.ICodec; import alternativa.protocol.IProtocol; import alternativa.protocol.ProtocolBuffer; import alternativa.protocol.info.TypeCodecInfo; import platform.client.fp10.core.resource.types.LocalizedImageResource; import platform.client.fp10.core.type.IGameObject; import projects.tanks.client.panel.model.kitoffer.KitOfferInfo; public class CodecKitOfferInfo implements ICodec { public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog)); private var codec_currencyName:ICodec; private var codec_currencyRoundPrecision:ICodec; private var codec_image:ICodec; private var codec_price:ICodec; private var codec_shopItem:ICodec; public function CodecKitOfferInfo() { super(); } public function init(param1:IProtocol) : void { this.codec_currencyName = param1.getCodec(new TypeCodecInfo(String,false)); this.codec_currencyRoundPrecision = param1.getCodec(new TypeCodecInfo(int,false)); this.codec_image = param1.getCodec(new TypeCodecInfo(LocalizedImageResource,false)); this.codec_price = param1.getCodec(new TypeCodecInfo(Number,false)); this.codec_shopItem = param1.getCodec(new TypeCodecInfo(IGameObject,false)); } public function decode(param1:ProtocolBuffer) : Object { var local2:KitOfferInfo = new KitOfferInfo(); local2.currencyName = this.codec_currencyName.decode(param1) as String; local2.currencyRoundPrecision = this.codec_currencyRoundPrecision.decode(param1) as int; local2.image = this.codec_image.decode(param1) as LocalizedImageResource; local2.price = this.codec_price.decode(param1) as Number; local2.shopItem = this.codec_shopItem.decode(param1) as IGameObject; return local2; } public function encode(param1:ProtocolBuffer, param2:Object) : void { if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:KitOfferInfo = KitOfferInfo(param2); this.codec_currencyName.encode(param1,local3.currencyName); this.codec_currencyRoundPrecision.encode(param1,local3.currencyRoundPrecision); this.codec_image.encode(param1,local3.image); this.codec_price.encode(param1,local3.price); this.codec_shopItem.encode(param1,local3.shopItem); } } }
package projects.tanks.client.battlefield.models.tankparts.weapon.splash { public class SplashCC { private var _impactForce:Number; private var _minSplashDamagePercent:Number; private var _radiusOfMaxSplashDamage:Number; private var _splashDamageRadius:Number; public function SplashCC(param1:Number = 0, param2:Number = 0, param3:Number = 0, param4:Number = 0) { super(); this._impactForce = param1; this._minSplashDamagePercent = param2; this._radiusOfMaxSplashDamage = param3; this._splashDamageRadius = param4; } public function get impactForce() : Number { return this._impactForce; } public function set impactForce(param1:Number) : void { this._impactForce = param1; } public function get minSplashDamagePercent() : Number { return this._minSplashDamagePercent; } public function set minSplashDamagePercent(param1:Number) : void { this._minSplashDamagePercent = param1; } public function get radiusOfMaxSplashDamage() : Number { return this._radiusOfMaxSplashDamage; } public function set radiusOfMaxSplashDamage(param1:Number) : void { this._radiusOfMaxSplashDamage = param1; } public function get splashDamageRadius() : Number { return this._splashDamageRadius; } public function set splashDamageRadius(param1:Number) : void { this._splashDamageRadius = param1; } public function toString() : String { var local1:String = "SplashCC ["; local1 += "impactForce = " + this.impactForce + " "; local1 += "minSplashDamagePercent = " + this.minSplashDamagePercent + " "; local1 += "radiusOfMaxSplashDamage = " + this.radiusOfMaxSplashDamage + " "; local1 += "splashDamageRadius = " + this.splashDamageRadius + " "; return local1 + "]"; } } }
package alternativa.protocol.codec.primitive { import alternativa.protocol.codec.AbstractCodec; import alternativa.protocol.codec.NullMap; import flash.utils.IDataInput; import flash.utils.IDataOutput; public class ShortCodec extends AbstractCodec { public function ShortCodec() { super(); nullValue = int.MIN_VALUE; } override protected function doDecode(reader:IDataInput, nullmap:NullMap, notnull:Boolean) : Object { return reader.readShort(); } override protected function doEncode(dest:IDataOutput, object:Object, nullmap:NullMap, notnull:Boolean) : void { dest.writeShort(int(object)); } } }
package alternativa.tanks.battle { import alternativa.math.Vector3; import alternativa.tanks.battle.scene3d.BattleScene3D; import alternativa.tanks.camera.CameraController; import alternativa.tanks.camera.CameraTarget; import alternativa.tanks.models.weapon.ricochet.RicochetTargetEvaluator; import alternativa.tanks.models.weapon.shared.CommonTargetEvaluator; import alternativa.tanks.models.weapon.shared.ConicAreaTargetValidator; import alternativa.tanks.models.weapon.shared.HealingGunTargetEvaluator; import alternativa.tanks.models.weapon.shared.RailgunTargetEvaluator; import alternativa.tanks.sfx.GraphicEffect; import alternativa.tanks.sfx.ISound3DEffect; import alternativa.tanks.sound.ISoundManager; import alternativa.tanks.utils.objectpool.ObjectPool; import flash.display.BitmapData; import flash.media.Sound; import flash.utils.Dictionary; import platform.client.fp10.core.type.IGameObject; public interface BattleService { function getObjectPool() : ObjectPool; function getBattleRunner() : BattleRunner; function getBattleScene3D() : BattleScene3D; function getBattleView() : BattleView; function getCommonTargetEvaluator() : CommonTargetEvaluator; function setCommonTargetEvaluator(param1:CommonTargetEvaluator) : void; function getConicAreaTargetValidator() : ConicAreaTargetValidator; function getHealingGunTargetEvaluator() : HealingGunTargetEvaluator; function setHealingGunTargetEvaluator(param1:HealingGunTargetEvaluator) : void; function getRailgunTargetEvaluator() : RailgunTargetEvaluator; function setRailgunTargetEvaluator(param1:RailgunTargetEvaluator) : void; function getIdleKickPeriod() : int; function getTankExplosionSound() : Sound; function get soundManager() : ISoundManager; function setFollowCameraTarget(param1:CameraTarget) : void; function addGraphicEffect(param1:GraphicEffect) : void; function addSound3DEffect(param1:ISound3DEffect) : void; function setCameraController(param1:CameraController) : void; function activateFollowCamera() : void; function lockFollowCamera() : void; function unlockFollowCamera() : void; function setFollowCameraState(param1:Vector3, param2:Vector3) : void; function activateFlyCamera(param1:Vector3, param2:Vector3) : void; function isBattleActive() : Boolean; function getExcludedObjects3D() : Dictionary; function getRicochetTargetEvaluator() : RicochetTargetEvaluator; function setRicochetTargetEvaluator(param1:RicochetTargetEvaluator) : void; function setBillboardImage(param1:BitmapData) : void; function unlockBattle() : void; function getPhysicsTime() : int; function setLocalTankLoaded() : void; function isLocalTankFirstLoad() : Boolean; function getRespawnDurationMs() : int; function isLocalTankPaused() : Boolean; function setLocalTankPaused(param1:Boolean) : void; function getBattle() : IGameObject; } }
package alternativa.tanks.service.clan { import flash.events.Event; public class ClanPanelNotificationEvent extends Event { public static const UPDATE:String = "ClanPanelNotificationEvent.UPDATE"; private var _notification:int; public function ClanPanelNotificationEvent(param1:String, param2:int, param3:Boolean = false, param4:Boolean = false) { this._notification = param2; super(param1,param3,param4); } public function get notification() : int { return this._notification; } public function set notification(param1:int) : void { this._notification = param1; } } }
package alternativa.tanks.models.battle.battlefield { import alternativa.math.Vector3; import alternativa.osgi.OSGi; import alternativa.osgi.service.display.IDisplay; import alternativa.osgi.service.locale.ILocaleService; import alternativa.osgi.service.logging.LogService; import alternativa.osgi.service.logging.Logger; import alternativa.physics.collision.types.AABB; import alternativa.tanks.battle.BattleRunner; import alternativa.tanks.battle.BattleService; import alternativa.tanks.battle.BattleUtils; import alternativa.tanks.battle.BattleView; import alternativa.tanks.battle.SpeedHackChecker; import alternativa.tanks.battle.events.BattleEventDispatcher; import alternativa.tanks.battle.events.BattleEventSupport; import alternativa.tanks.battle.events.BattleFinishEvent; import alternativa.tanks.battle.events.BattleRestartEvent; import alternativa.tanks.battle.events.MapBuildingCompleteEvent; import alternativa.tanks.battle.events.SpeedHackEvent; import alternativa.tanks.battle.scene3d.BattleScene3D; import alternativa.tanks.battle.scene3d.DecalFactory; import alternativa.tanks.bg.IBackgroundService; import alternativa.tanks.bonuses.BonusCache; import alternativa.tanks.camera.CameraController; import alternativa.tanks.camera.CameraTarget; import alternativa.tanks.camera.FlyCameraController; import alternativa.tanks.camera.FollowCameraController; import alternativa.tanks.camera.controllers.spectator.SpectatorSupport; import alternativa.tanks.gui.error.ErrorForm; import alternativa.tanks.gui.error.ErrorNotification; import alternativa.tanks.models.battle.battlefield.keyboard.AdditionUserTitleSwitcher; import alternativa.tanks.models.battle.battlefield.map.MapBuilder; import alternativa.tanks.models.coloradjust.IColorAdjust; import alternativa.tanks.models.map.IBattleMap; import alternativa.tanks.models.mapbonuslight.IMapBonusLight; import alternativa.tanks.models.sfx.lighting.LightingSfx; import alternativa.tanks.models.tank.support.DialogWindowSupport; import alternativa.tanks.models.weapon.ricochet.RicochetTargetEvaluator; import alternativa.tanks.models.weapon.shared.CommonTargetEvaluator; import alternativa.tanks.models.weapon.shared.ConicAreaTargetValidator; import alternativa.tanks.models.weapon.shared.HealingGunTargetEvaluator; import alternativa.tanks.models.weapon.shared.RailgunTargetEvaluator; import alternativa.tanks.models.weapon.shared.streamweapon.DefaultConicAreaTargetValidator; import alternativa.tanks.service.settings.ISettingsService; import alternativa.tanks.service.settings.SettingsServiceEvent; import alternativa.tanks.service.settings.keybinding.GameActionEnum; import alternativa.tanks.services.battlegui.BattleGUIService; import alternativa.tanks.services.battleinput.BattleInputLockType; import alternativa.tanks.services.battleinput.BattleInputService; import alternativa.tanks.services.battleinput.GameActionListener; import alternativa.tanks.services.battlereadiness.BattleReadinessService; import alternativa.tanks.services.colortransform.ColorTransformService; import alternativa.tanks.services.colortransform.ColorTransformUtils; import alternativa.tanks.services.lightingeffects.ILightingEffectsService; import alternativa.tanks.services.memoryleakguard.MemoryLeakTrackerService; import alternativa.tanks.services.mipmapping.MipMappingService; import alternativa.tanks.sfx.GraphicEffect; import alternativa.tanks.sfx.ISound3DEffect; import alternativa.tanks.sound.ISoundManager; import alternativa.tanks.utils.DataValidationErrorEvent; import alternativa.tanks.utils.DataValidator; import alternativa.tanks.utils.DebugPanel; import alternativa.tanks.utils.KeyCodes; import alternativa.tanks.utils.objectpool.ObjectPool; import alternativa.types.Long; import alternativa.utils.TextureMaterialRegistry; import flash.display.BitmapData; import flash.events.Event; import flash.events.KeyboardEvent; import flash.media.Sound; import flash.net.SharedObject; import flash.utils.Dictionary; import platform.client.fp10.core.logging.serverlog.ServerLogTarget; import platform.client.fp10.core.model.ObjectLoadListener; import platform.client.fp10.core.model.ObjectLoadPostListener; import platform.client.fp10.core.model.ObjectUnloadPostListener; import platform.client.fp10.core.model.impl.Model; import platform.client.fp10.core.network.connection.ControlConnectionSender; import platform.client.fp10.core.type.IGameObject; import projects.tanks.client.battlefield.models.battle.battlefield.BattlefieldModelBase; import projects.tanks.client.battlefield.models.battle.battlefield.IBattlefieldModelBase; import projects.tanks.client.battlefield.models.battle.battlefield.fps.FpsStatisticType; import projects.tanks.client.battlefield.models.battle.battlefield.types.HitTraceData; import projects.tanks.client.battlefield.models.map.DynamicShadowParams; import projects.tanks.client.battlefield.models.map.FogParams; import projects.tanks.client.battleservice.BattleRoundParameters; import projects.tanks.clients.flash.commons.models.gpu.GPUCapabilities; import projects.tanks.clients.flash.commons.services.notification.INotificationService; import projects.tanks.clients.flash.resources.resource.MapResource; import projects.tanks.clients.fp10.libraries.TanksLocale; import projects.tanks.clients.fp10.libraries.tanksservices.service.address.TanksAddressService; import projects.tanks.clients.fp10.libraries.tanksservices.service.battle.IBattleInfoService; import projects.tanks.clients.fp10.libraries.tanksservices.service.layout.ILobbyLayoutService; import projects.tanks.clients.fp10.libraries.tanksservices.service.storage.IStorageService; [ModelInfo] public class BattlefieldModel extends BattlefieldModelBase implements IBattlefieldModelBase, ObjectLoadListener, ObjectLoadPostListener, ObjectUnloadPostListener, BattleService, BattleSfx, GameActionListener { [Inject] public static var logService:LogService; [Inject] public static var storageService:IStorageService; [Inject] public static var addressService:TanksAddressService; [Inject] public static var display:IDisplay; [Inject] public static var battleEventDispatcher:BattleEventDispatcher; [Inject] public static var dataValidator:DataValidator; [Inject] public static var settings:ISettingsService; [Inject] public static var backgroundService:IBackgroundService; [Inject] public static var mipMappingService:MipMappingService; [Inject] public static var materialRegistry:TextureMaterialRegistry; [Inject] public static var colorTransformService:ColorTransformService; [Inject] public static var battleInfoService:IBattleInfoService; [Inject] public static var memoryLeakTrackerService:MemoryLeakTrackerService; [Inject] public static var battleReadinessService:BattleReadinessService; [Inject] public static var battleInputService:BattleInputService; [Inject] public static var battleGuiService:BattleGUIService; [Inject] public static var lobbyLayoutService:ILobbyLayoutService; [Inject] public static var localeService:ILocaleService; [Inject] public static var lightingAdjustService:ILightingEffectsService; [Inject] public static var notificationService:INotificationService; private static const cameraPosition:Vector3 = new Vector3(); private static const cameraAngles:Vector3 = new Vector3(); private static const CHANNEL:String = "battle"; private static const SERVER_CHANNEL:String = "battle2server"; private static const SPECTATOR_ADDITIONAL_HEIGHT:int = 5000; private static const LAST_SERVER:String = "LAST_SERVER"; private const objectPool:ObjectPool = new ObjectPool(); private var debugPanel:DebugPanel; private const fullTimeStatistics:TimeStatistics = new TimeStatistics(); private var followCameraController:FollowCameraController; private var flyCameraController:FlyCameraController; private var initialFrameRate:Number; private var battleEventSupport:BattleEventSupport; private var commonTargetEvaluator:CommonTargetEvaluator; private const conicAreaTargetValidator:ConicAreaTargetValidator = new DefaultConicAreaTargetValidator(); private var healingGunTargetEvaluator:HealingGunTargetEvaluator; private var railgunTargetEvaluator:RailgunTargetEvaluator; private var ricochetTargetEvaluator:RicochetTargetEvaluator; private var battleActive:Boolean; private var ambientSound:AmbientSound; private var speedHackChecker:SpeedHackChecker; private var frameRateController:StageFrameRateController; private var skyboxRevolver:Object3DRevolver; private var battleScene:BattleScene3D; private var battleView:BattleView; private var battleRunner:BattleRunner; private var battleData:BattleData; private var gameObject:IGameObject; private var logger:Logger; private var serverLogger:Logger; private var battleCounter:int; private var mapId:Long; private var localTankLoad:Boolean; private var lightingCommands:LightingCommands; private var criticalErrorLogged:Boolean; private var localTankPaused:Boolean; public function BattlefieldModel() { super(); logService.addLogTarget(new ServerLogTarget(new ControlConnectionSender(),SERVER_CHANNEL + ":e")); this.serverLogger = logService.getLogger(SERVER_CHANNEL); this.logger = logService.getLogger(CHANNEL); this.initBattleEventHandlers(); } private static function showErrorAlert() : void { var local1:ErrorForm = new ErrorForm(localeService); local1.setErrorText(localeService.getText(TanksLocale.TEXT_ERROR_FATAL)); local1.setSupportUrl(localeService.getText(TanksLocale.TEXT_FATAL_ERROR_WIKI_LINK)); display.contentLayer.addChild(local1); } private function initBattleEventHandlers() : void { this.battleEventSupport = new BattleEventSupport(battleEventDispatcher); this.battleEventSupport.addEventHandler(SpeedHackEvent,this.onSpeedHack); this.battleEventSupport.addEventHandler(DataValidationErrorEvent,this.onDataValidationError); this.battleEventSupport.addEventHandler(TimeStatisticsTimerEvent,this.onTimeStatisticsTimer); this.battleEventSupport.activateHandlers(); } [Obfuscation(rename="false")] public function traceHit(param1:HitTraceData) : void { HitTracer.trace(param1); } [Obfuscation(rename="false")] public function battleFinish() : void { this.battleActive = false; battleEventDispatcher.dispatchEvent(new BattleFinishEvent()); this.sendTimeStatisticsToServer(); } private function sendTimeStatisticsToServer() : void { if(this.gameObject != null) { Model.object = this.gameObject; try { server.sendTimeStatisticsCommand(this.getFpsStatisticType(),this.fullTimeStatistics.getAverageFPS()); } finally { Model.popObject(); } } } private function getFpsStatisticType() : FpsStatisticType { var local1:FpsStatisticType = null; if(!GPUCapabilities.gpuEnabled) { local1 = FpsStatisticType.SOFTWARE; } else if(GPUCapabilities.constrained) { local1 = FpsStatisticType.HARDWARE_CONSTRAINT; } else { local1 = FpsStatisticType.HARDWARE_BASELINE; } return local1; } [Obfuscation(rename="false")] public function battleRestart() : void { this.battleActive = true; battleEventDispatcher.dispatchEvent(new BattleRestartEvent()); this.fullTimeStatistics.reset(); battleInfoService.battleRestart(); } [Obfuscation(rename="false")] public function battleStart(param1:BattleRoundParameters) : void { this.battleActive = true; battleInfoService.battleStart(param1); } public function addSound3DEffect(param1:ISound3DEffect) : void { this.battleRunner.getSoundManager().addEffect(param1); } private function addListeners() : void { display.stage.addEventListener(Event.ENTER_FRAME,this.onEnterFrame); display.stage.addEventListener(KeyboardEvent.KEY_DOWN,getFunctionWrapper(this.onKey)); display.stage.addEventListener(KeyboardEvent.KEY_UP,getFunctionWrapper(this.onKey)); battleInputService.addGameActionListener(this); } private function removeListeners() : void { battleInputService.removeGameActionListener(this); Model.object = this.gameObject; try { display.stage.removeEventListener(Event.ENTER_FRAME,this.onEnterFrame); display.stage.removeEventListener(KeyboardEvent.KEY_DOWN,getFunctionWrapper(this.onKey)); display.stage.removeEventListener(KeyboardEvent.KEY_UP,getFunctionWrapper(this.onKey)); } finally { Model.popObject(); } } private function onEnterFrame(param1:Event) : void { var event:Event = param1; try { this.tick(); } catch(e:Error) { processTickError(e); } } private function tick() : void { this.fullTimeStatistics.update(); this.battleRunner.tick(); } private function processTickError(param1:Error) : void { if(!this.criticalErrorLogged) { this.criticalErrorLogged = true; this.serverLogger.error(param1.message); this.showErrorNotification(); } } private function showErrorNotification() : void { notificationService.addNotification(new ErrorNotification()); } public function onGameAction(param1:GameActionEnum, param2:Boolean) : void { if(param1 == GameActionEnum.OPEN_GARAGE && param2) { if(Boolean(lobbyLayoutService.inBattle()) && Boolean(battleInfoService.enterGarageCausesExitBattle)) { lobbyLayoutService.exitFromBattleToGarageThroughAlert(); } else { lobbyLayoutService.showGarage(); } } } private function onKey(param1:KeyboardEvent) : void { if(!battleInputService.isInputLocked()) { if(param1.type == KeyboardEvent.KEY_DOWN) { this.handleKeyDown(param1); } } } private function handleKeyDown(param1:KeyboardEvent) : void { switch(param1.keyCode) { case KeyCodes.M: this.onDebugKey1(param1); break; case KeyCodes.B: this.onDebugKey2(param1); } } private function onDebugKey1(param1:KeyboardEvent) : void { } private function onDebugKey2(param1:KeyboardEvent) : void { } [Obfuscation(rename="false")] public function objectLoaded() : void { this.saveServerNumber(); ++this.battleCounter; this.gameObject = object; battleInputService.unlock(BattleInputLockType.INACTIVE_BATTLE); battleInfoService.spectatorMode = getInitParam().spectator; if(getInitParam().spectator) { battleInputService.forbidMouseLock(); } else { battleInputService.allowMouseLock(); } if(getInitParam().proBattle) { battleInfoService.setCurrentSelectionBattle(getInitParam().battleId,getInitParam().range.min,getInitParam().range.max); battleInfoService.currentBattleId = getInitParam().battleId; } else { battleInfoService.currentBattleId = null; } battleInfoService.setInBattle(true); battleInfoService.reArmorEnabled = getInitParam().reArmorEnabled; battleInfoService.withoutSupplies = getInitParam().withoutSupplies; battleInfoService.withoutBonuses = getInitParam().withoutBonuses; battleInfoService.withoutDrones = getInitParam().withoutDrones; battleInfoService.enterGarageCausesExitBattle = false; this.battleActive = getInitParam().active; var local1:IBattleMap = this.getBattleMap(); colorTransformService.setColorTransform(ColorTransformUtils.calculateColorTransform(local1.getDynamicShadowParams(),getInitParam().colorTransformMultiplier)); this.initBattleData(); this.initBattleCore(); this.initBattleMap(); this.initColorAdjust(); this.initBonusAdjust(); this.battleRunner.getSoundManager().setMute(true); this.ambientSound = new AmbientSound(this.battleData.ambientSound,this.battleRunner.getSoundManager()); this.addSettingsListeners(); this.initialFrameRate = display.stage.frameRate; this.speedHackChecker = new SpeedHackChecker(battleEventDispatcher); this.fullTimeStatistics.reset(); this.addListeners(); this.startTimeStatisticsTimer(); BattlefieldEvents(object.adapt(BattlefieldEvents)).onBattleLoaded(); } public function getLightingSfx() : LightingSfx { return new LightingSfx(getInitParam().mineExplosionLighting); } private function saveServerNumber() : void { var local1:Number = Number(addressService.getServerNumber()); var local2:SharedObject = SharedObject.getLocal("launcherStorage"); local2.data[LAST_SERVER] = local1; local2.flush(); } private function clearServerNumber() : void { var local1:SharedObject = SharedObject.getLocal("launcherStorage"); if(local1.data.hasOwnProperty(LAST_SERVER)) { delete local1.data[LAST_SERVER]; local1.flush(); } } private function initBonusAdjust() : void { var local1:IMapBonusLight = IMapBonusLight(getInitParam().map.adapt(IMapBonusLight)); lightingAdjustService.setBonusLighting(local1.getBonusLightIntensity(),local1.getHWBonusColorAdjust(),local1.getSoftBonusColorAdjust()); } private function initColorAdjust() : void { var local1:IColorAdjust = IColorAdjust(getInitParam().map.adapt(IColorAdjust)); colorTransformService.setColorAdjust(local1.getSoftHeat(),local1.getSoftFrost(),local1.getHWHeat(),local1.getHWFrost()); } private function addSettingsListeners() : void { settings.addEventListener(SettingsServiceEvent.SETTINGS_CHANGED,this.settingsAccepted); } private function removeSettingsListeners() : void { settings.removeEventListener(SettingsServiceEvent.SETTINGS_CHANGED,this.settingsAccepted); } private function getBattleMap() : IBattleMap { return IBattleMap(getInitParam().map.adapt(IBattleMap)); } [Obfuscation(rename="false")] public function objectLoadedPost() : void { this.setGraphicSettings(); if(getInitParam().spectator) { this.initSpectatorMode(); } else { this.initNonSpectatorMode(); } battleEventDispatcher.dispatchEvent(new BattleLoadEvent()); battleInfoService.battleLoad(); putData(AdditionUserTitleSwitcher,new AdditionUserTitleSwitcher()); } private function startTimeStatisticsTimer() : void { var local1:TimeStatisticsTimer = new TimeStatisticsTimer(battleEventDispatcher); local1.start(); } [Obfuscation(rename="false")] public function objectUnloadedPost() : void { battleInputService.lock(BattleInputLockType.INACTIVE_BATTLE); this.battleActive = false; this.clearServerNumber(); battleEventDispatcher.dispatchEvent(new BattleUnloadEvent()); this.frameRateController.restoreStageParams(); this.frameRateController = null; this.removeSettingsListeners(); this.removeListeners(); this.battleScene.shutdown(); this.battleRunner.shutdown(); this.battleView.removeFromScreen(); this.battleView.destroy(); this.battleView = null; this.battleScene = null; this.battleRunner = null; this.battleData = null; display.stage.removeChild(this.debugPanel); display.stage.frameRate = this.initialFrameRate; this.debugPanel = null; this.skyboxRevolver = null; this.speedHackChecker.stop(); this.speedHackChecker = null; backgroundService.drawBg(); battleInfoService.setInBattle(false); battleInfoService.resetCurrentBattle(); dataValidator.removeAllValidators(); this.gameObject = null; colorTransformService.setColorTransform(null); OSGi.getInstance().unregisterService(BattleService); battleReadinessService.reset(); battleGuiService.hide(); this.followCameraController = null; this.flyCameraController = null; BonusCache.clear(); this.localTankLoad = false; this.getObjectPool().clear(); this.localTankPaused = false; } private function initBattleData() : void { this.battleData = new BattleData(); this.battleData.respawnDurationMs = getInitParam().respawnDuration; this.battleData.setIdleKickPeriod(getInitParam().idleKickPeriodMsec); this.battleData.ambientSound = this.getBattleMap().getEnvironmentSound().sound; this.battleData.battleFinishSound = getInitParam().battlefieldSounds.battleFinishSound.sound; this.battleData.tankExplosionSound = getInitParam().battlefieldSounds.killSound.sound; } private function lightingChanged(param1:uint, param2:uint, param3:Number, param4:Number, param5:uint) : void { } public function initBattleCore() : void { OSGi.getInstance().registerService(BattleService,this); this.battleScene = new BattleScene3D(display.stage,materialRegistry,getInitParam().shadowMapCorrectionFactor); memoryLeakTrackerService.track(this.battleScene,this.battleCounter.toString()); var local1:IBattleMap = this.getBattleMap(); var local2:FogParams = local1.getFogParams(); var local3:DynamicShadowParams = local1.getDynamicShadowParams(); this.battleScene.setupFog(local2.color,local2.alpha,local2.nearLimit,local2.farLimit); this.battleScene.setupDynamicShadows(local3.lightColor,local3.shadowColor,local3.angleX,local3.angleZ); this.battleView = new BattleView(); memoryLeakTrackerService.track(this.battleView,this.battleCounter.toString()); var local4:Number = Number(local1.getGravity()); this.battleRunner = new BattleRunner(local4,this.battleData.ambientSound,battleEventDispatcher); memoryLeakTrackerService.track(this.battleRunner,this.battleCounter.toString()); this.battleScene.setDecalFactory(new DecalFactory(this.battleRunner.getCollisionDetector())); this.battleScene.initDustEngine(this,local1.getDustParams()); this.battleScene.setSSAOColor(local1.getSSAOColor()); this.frameRateController = new StageFrameRateController(display.stage,this.battleRunner,this.fullTimeStatistics); this.frameRateController.setAdaptiveFrameRate(settings.adaptiveFPS); this.battleView.addToScreen(battleGuiService.getViewportContainer()); this.debugPanel = new DebugPanel(); this.debugPanel.visible = false; display.stage.addChild(this.debugPanel); this.followCameraController = new FollowCameraController(); this.flyCameraController = new FlyCameraController(getInitParam().respawnDuration); putData(DialogWindowSupport,new DialogWindowSupport()); } private function initBattleMap() : void { this.initSkyBox(); var local1:IBattleMap = this.getBattleMap(); var local2:MapResource = local1.getMapResource(); this.mapId = local2.id; var local3:XML = XML(local2.mapData.toString()); var local4:MapBuilder = new MapBuilder(materialRegistry,local2.libRegistry); local4.build(local3,getFunctionWrapper(this.onMapBuildingComplete)); putData(MapBuilder,local4); } private function initSkyBox() : void { var local1:IBattleMap = this.getBattleMap(); var local2:BattleSkyBox = new BattleSkyBox(local1.getSkybox()); this.battleScene.setSkyBox(local2); this.battleScene.setSkyBoxVisible(settings.showSkyBox); var local3:Vector3 = BattleUtils.getVector3(local1.getSkyboxRevolutionAxis()); var local4:Number = Number(local1.getSkyBoxRevolutionSpeed()); this.skyboxRevolver = new Object3DRevolver(local2,local3,local4); this.battleScene.addRenderer(this.skyboxRevolver,0); } private function onMapBuildingComplete() : void { var local1:MapBuilder = MapBuilder(getData(MapBuilder)); this.followCameraController.setCollisionObject(local1.getMapContainer()); this.fixHardwareKeyboardInputBug(); battleReadinessService.unlockMap(); battleEventDispatcher.dispatchEvent(new MapBuildingCompleteEvent()); } private function fixHardwareKeyboardInputBug() : void { display.stage.frameRate += 1; display.stage.frameRate -= 1; } private function initSpectatorMode() : void { var local1:Vector3 = new Vector3(); var local2:Vector3 = new Vector3(); var local3:MapBuilder = MapBuilder(getData(MapBuilder)); this.fillInInitialSpectatorState(local1,local2,local3.getMapBounds()); this.battleScene.getCamera().setPosition(local1); this.battleScene.getCamera().lookAt(local2.x,local2.y,local2.z); var local4:SpectatorSupport = new SpectatorSupport(); putData(SpectatorSupport,local4); var local5:SpectatorUserTitleRenderer = new SpectatorUserTitleRenderer(); putData(SpectatorUserTitleRenderer,local5); this.battleScene.setUserTitleRenderer(local5); battleReadinessService.unlockUser(); if(!lobbyLayoutService.isSwitchInProgress()) { battleInputService.unlock(BattleInputLockType.MODAL_DIALOG); } } public function fillInInitialSpectatorState(param1:Vector3, param2:Vector3, param3:AABB) : void { param1.x = param3.minX; param1.y = param3.minY; param1.z = param3.maxZ + SPECTATOR_ADDITIONAL_HEIGHT; param2.x = (param3.minX + param3.maxX) / 2; param2.y = (param3.minY + param3.maxY) / 2; param2.z = param3.minZ; } private function initNonSpectatorMode() : void { } public function setCameraController(param1:CameraController) : void { this.battleScene.setCameraController(param1); } public function setFollowCameraTarget(param1:CameraTarget) : void { this.followCameraController.setTarget(param1); } public function getObjectPool() : ObjectPool { return this.objectPool; } public function getBattleRunner() : BattleRunner { return this.battleRunner; } public function getBattleScene3D() : BattleScene3D { return this.battleScene; } public function getBattleView() : BattleView { return this.battleView; } public function getCommonTargetEvaluator() : CommonTargetEvaluator { return this.commonTargetEvaluator; } public function setCommonTargetEvaluator(param1:CommonTargetEvaluator) : void { this.commonTargetEvaluator = param1; } public function getConicAreaTargetValidator() : ConicAreaTargetValidator { return this.conicAreaTargetValidator; } public function getHealingGunTargetEvaluator() : HealingGunTargetEvaluator { return this.healingGunTargetEvaluator; } public function setHealingGunTargetEvaluator(param1:HealingGunTargetEvaluator) : void { this.healingGunTargetEvaluator = param1; } public function getRailgunTargetEvaluator() : RailgunTargetEvaluator { return this.railgunTargetEvaluator; } public function setRailgunTargetEvaluator(param1:RailgunTargetEvaluator) : void { this.railgunTargetEvaluator = param1; } public function getIdleKickPeriod() : int { return this.battleData.getIdleKickPeriod(); } public function getTankExplosionSound() : Sound { return this.battleData.tankExplosionSound; } public function get soundManager() : ISoundManager { return this.battleRunner.getSoundManager(); } public function addGraphicEffect(param1:GraphicEffect) : void { this.battleScene.addGraphicEffect(param1); } public function activateFollowCamera() : void { this.setCameraController(this.followCameraController); } public function lockFollowCamera() : void { this.followCameraController.setLocked(true); } public function unlockFollowCamera() : void { this.followCameraController.setLocked(false); } public function setFollowCameraState(param1:Vector3, param2:Vector3) : void { this.followCameraController.setCurrentState(param1,param2); } public function activateFlyCamera(param1:Vector3, param2:Vector3) : void { if(this.battleScene.getCameraController() != this.followCameraController) { return; } this.followCameraController.getCameraState(param1,param2,cameraPosition,cameraAngles); this.flyCameraController.init(cameraPosition,cameraAngles); this.battleScene.setCameraController(this.flyCameraController); } public function isBattleActive() : Boolean { return this.battleActive; } public function getExcludedObjects3D() : Dictionary { return this.battleScene.getExcludedObjects(); } public function getRicochetTargetEvaluator() : RicochetTargetEvaluator { return this.ricochetTargetEvaluator; } public function setRicochetTargetEvaluator(param1:RicochetTargetEvaluator) : void { this.ricochetTargetEvaluator = param1; } private function onSpeedHack(param1:SpeedHackEvent) : void { var event:SpeedHackEvent = param1; Model.object = this.gameObject; try { server.dg(Vector.<int>(event.deltas)); } finally { Model.popObject(); } } private function onDataValidationError(param1:DataValidationErrorEvent) : void { this.reportDataValidationError(param1.type); } private function reportDataValidationError(param1:int) : void { var type:int = param1; Model.object = this.gameObject; try { server.kd(type); } finally { Model.popObject(); } } private function onTimeStatisticsTimer(param1:Object) : void { this.sendTimeStatisticsToServer(); } private function updateSoundSettings() : void { var local1:Boolean = false; if(battleReadinessService.isBattleReady()) { local1 = Boolean(settings.muteSound); this.battleRunner.getSoundManager().setMute(local1); this.ambientSound.play(!local1 && Boolean(settings.bgSound)); } } private function settingsAccepted(param1:Event) : void { if(this.gameObject != null) { this.battleScene.setSkyBoxVisible(settings.showSkyBox); this.updateSoundSettings(); this.setGraphicSettings(); this.frameRateController.setAdaptiveFrameRate(settings.adaptiveFPS); } } private function setGraphicSettings() : void { this.battleScene.enableAutoQuality(settings.graphicsAutoQuality,this.mapId.toString()); if(!settings.graphicsAutoQuality) { this.battleScene.enableFog(settings.fog); this.battleScene.enableAmbientShadows(settings.shadows); this.battleScene.enableDynamicShadows(settings.dynamicShadows); this.battleScene.enableSoftTransparency(settings.softParticles); this.battleScene.enableDust(settings.dust); this.battleScene.enableSSAO(settings.ssao); this.battleScene.enableDynamicLighting(settings.dynamicLighting); this.battleScene.enableAntialiasing(settings.antialiasing); } this.battleScene.enableLighting(true); mipMappingService.setMipMapping(settings.mipMapping); } public function setBillboardImage(param1:BitmapData) : void { this.battleScene.setBillboardImage(param1); } public function unlockBattle() : void { battleGuiService.show(); this.battleScene.enableRendering(); this.updateSoundSettings(); } public function getPhysicsTime() : int { return this.battleRunner.getPhysicsTime(); } public function setLocalTankLoaded() : void { this.localTankLoad = true; } public function isLocalTankFirstLoad() : Boolean { return !this.localTankLoad; } public function getRespawnDurationMs() : int { return this.battleData.respawnDurationMs; } public function isLocalTankPaused() : Boolean { return this.localTankPaused; } public function setLocalTankPaused(param1:Boolean) : void { this.localTankPaused = param1; } public function getBattle() : IGameObject { return this.gameObject; } } }
package forms.stat { import mx.core.BitmapAsset; [ExcludeClass] public class ReferralWindowBigButton_bitmapGreen extends BitmapAsset { public function ReferralWindowBigButton_bitmapGreen() { super(); } } }
package alternativa.tanks.bonuses { public class BonusState { public static const FALLING:int = 0; public static const RESTING:int = 1; public static const REMOVING:int = 2; public static const REMOVED:int = 3; public static const TAKEN:int = 4; public function BonusState() { super(); } } }
package alternativa.tanks.models.sfx.shoot.shaft { import alternativa.engine3d.materials.Material; import alternativa.math.Vector3; import alternativa.tanks.sfx.IGraphicEffect; public interface ShaftTrailEffect extends IGraphicEffect { function init(param1:Vector3, param2:Vector3, param3:Number, param4:Number, param5:Material, param6:int) : void; } }
package projects.tanks.client.battlefield.models.user.tank.commands { public class TurretControlType { public static const ROTATION_DIRECTION:TurretControlType = new TurretControlType(0,"ROTATION_DIRECTION"); public static const TARGET_ANGLE_LOCAL:TurretControlType = new TurretControlType(1,"TARGET_ANGLE_LOCAL"); public static const TARGET_ANGLE_WORLD:TurretControlType = new TurretControlType(2,"TARGET_ANGLE_WORLD"); private var _value:int; private var _name:String; public function TurretControlType(param1:int, param2:String) { super(); this._value = param1; this._name = param2; } public static function get values() : Vector.<TurretControlType> { var local1:Vector.<TurretControlType> = new Vector.<TurretControlType>(); local1.push(ROTATION_DIRECTION); local1.push(TARGET_ANGLE_LOCAL); local1.push(TARGET_ANGLE_WORLD); return local1; } public function toString() : String { return "TurretControlType [" + this._name + "]"; } public function get value() : int { return this._value; } public function get name() : String { return this._name; } } }
package forms.stat { import flash.display.Bitmap; import flash.display.BitmapData; import flash.events.MouseEvent; import flash.text.TextFieldAutoSize; import flash.text.TextFormatAlign; import forms.battlelist.BattleBigButton; public class ReferralWindowBigButton extends BattleBigButton { private static const bitmapGreen:Class = ReferralWindowBigButton_bitmapGreen; private static const green:BitmapData = new bitmapGreen().bitmapData; private var labelY:int; public function ReferralWindowBigButton() { super(); _label.size = 12; _label.color = 52238; _label.multiline = true; _label.align = TextFormatAlign.LEFT; _label.autoSize = TextFieldAutoSize.LEFT; _label.wordWrap = true; this.width = 156; var greenBitmap:Bitmap = new Bitmap(green); greenBitmap.y = 7; greenBitmap.x = 7; addChildAt(greenBitmap,getChildIndex(_label)); } override public function set label(value:String) : void { super.label = value; this.labelY = 24 - _label.textHeight / 2; this.width = _width; } override public function set width(w:Number) : void { _width = int(w); stateDOWN.width = stateOFF.width = stateOVER.width = stateUP.width = _width; if(_icon.bitmapData != null) { _icon.x = 12; _icon.y = int(27 - _icon.height / 2); _label.width = _width - 8 - _icon.width; _label.x = _icon.width + 14; _label.y = this.labelY; } } override protected function onMouseEvent(event:MouseEvent) : void { if(_enable) { switch(event.type) { case MouseEvent.MOUSE_OVER: setState(2); _label.y = this.labelY; break; case MouseEvent.MOUSE_OUT: setState(1); _label.y = this.labelY; break; case MouseEvent.MOUSE_DOWN: setState(3); _label.y = this.labelY + 1; break; case MouseEvent.MOUSE_UP: setState(1); _label.y = this.labelY; } if(_icon != null) { _icon.y = int(27 - _icon.height / 2) + (event.type == MouseEvent.MOUSE_DOWN ? 1 : 0); } } } } }
package scpacker.resource { import flash.utils.Dictionary; public class SoundResourcesList { private var sounds:Dictionary; public function SoundResourcesList() { super(); this.sounds = new Dictionary(); } public function add(sound:SoundResource) : void { if(this.sounds[sound.nameID] == null) { if(sound.sound == null) { throw new Error("Sound null!"); } this.sounds[sound.nameID] = sound; } else { trace("Sound arleady registered!"); } } public function getSound(key:String) : SoundResource { return this.sounds[key]; } } }
package alternativa.tanks.models.tank.killhandlers { import alternativa.tanks.battle.BattleRunner; import alternativa.tanks.battle.BattleService; import alternativa.tanks.battle.events.BattleEventDispatcher; import alternativa.tanks.battle.events.death.TankDeadEvent; import alternativa.tanks.battle.objects.tank.Tank; import alternativa.tanks.battle.objects.tank.TankControlLockBits; import alternativa.tanks.models.sfx.lighting.LightingSfx; import alternativa.tanks.models.tank.ITankModel; import alternativa.tanks.models.tank.configuration.TankConfiguration; import alternativa.tanks.models.tank.explosion.ITankExplosionModel; import alternativa.tanks.models.tank.hullcommon.HullCommon; import alternativa.tanks.models.tank.spawn.ReadyToSpawnTask; import alternativa.tanks.sfx.LightAnimation; import flash.utils.getTimer; import platform.client.fp10.core.type.IGameObject; import projects.tanks.client.battlefield.models.tankparts.sfx.lighting.entity.LightingSFXEntity; public class CommonTankDieHandler { [Inject] public static var battleService:BattleService; [Inject] public static var battleEventDispatcher:BattleEventDispatcher; public function CommonTankDieHandler() { super(); } protected static function getTankModel(param1:IGameObject) : ITankModel { return ITankModel(param1.adapt(ITankModel)); } private static function createDeathEffects(param1:Tank) : void { param1.getBody().clearAccumulators(); param1.getBody().state.velocity.z = param1.getBody().state.velocity.z + 500; param1.getBody().state.angularVelocity.reset(2,2,2); param1.getSkin().setDeadState(); var local2:TankConfiguration = TankConfiguration(param1.user.adapt(TankConfiguration)); var local3:IGameObject = local2.getHullObject(); var local4:ITankExplosionModel = ITankExplosionModel(local3.adapt(ITankExplosionModel)); local4.createExplosionEffects(local3,param1,getExplosionAnimation(local3)); } private static function getExplosionAnimation(param1:IGameObject) : LightAnimation { var local2:LightingSFXEntity = HullCommon(param1.adapt(HullCommon)).getCC().lightingSFXEntity; return new LightingSfx(local2).createAnimation("explosion"); } protected function killTank(param1:IGameObject, param2:int) : void { var local3:ITankModel = getTankModel(param1); local3.lockMovementControl(TankControlLockBits.DEAD); local3.getWeaponController().lockWeapon(TankControlLockBits.DEAD,false); local3.getWeaponController().deactivateWeapon(); var local4:Tank = local3.getTank(); local4.kill(); var local5:BattleRunner = battleService.getBattleRunner(); local5.addLogicUnit(new ReadyToSpawnTask(getTimer() + param2,local4)); createDeathEffects(local4); battleEventDispatcher.dispatchEvent(new TankDeadEvent(param1)); } } }
package _codec.projects.tanks.client.panel.model.donationalert { import alternativa.protocol.ICodec; import alternativa.protocol.IProtocol; import alternativa.protocol.ProtocolBuffer; import alternativa.protocol.codec.OptionalCodecDecorator; import alternativa.protocol.impl.LengthCodecHelper; import alternativa.protocol.info.TypeCodecInfo; import projects.tanks.client.panel.model.donationalert.DonationAlertCC; public class VectorCodecDonationAlertCCLevel1 implements ICodec { private var elementCodec:ICodec; private var optionalElement:Boolean; public function VectorCodecDonationAlertCCLevel1(param1:Boolean) { super(); this.optionalElement = param1; } public function init(param1:IProtocol) : void { this.elementCodec = param1.getCodec(new TypeCodecInfo(DonationAlertCC,false)); if(this.optionalElement) { this.elementCodec = new OptionalCodecDecorator(this.elementCodec); } } public function decode(param1:ProtocolBuffer) : Object { var local2:int = LengthCodecHelper.decodeLength(param1); var local3:Vector.<DonationAlertCC> = new Vector.<DonationAlertCC>(local2,true); var local4:int = 0; while(local4 < local2) { local3[local4] = DonationAlertCC(this.elementCodec.decode(param1)); local4++; } return local3; } public function encode(param1:ProtocolBuffer, param2:Object) : void { var local4:DonationAlertCC = null; if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:Vector.<DonationAlertCC> = Vector.<DonationAlertCC>(param2); var local5:int = int(local3.length); LengthCodecHelper.encodeLength(param1,local5); var local6:int = 0; while(local6 < local5) { this.elementCodec.encode(param1,local3[local6]); local6++; } } } }
package com.alternativaplatform.projects.tanks.client.models.battlefield.mine { public class BattleMine { public var mineId:String; public var ownerId:String; public var x:Number; public var y:Number; public var z:Number; public var activated:Boolean; public function BattleMine(activated:Boolean, mineId:String, ownerId:String, x:Number, y:Number, z:Number) { super(); this.activated = activated; this.mineId = mineId; this.ownerId = ownerId; this.x = x; this.y = y; this.z = z; } } }
package alternativa.tanks.service.impl { import alternativa.tanks.controller.events.logging.RegistrationUXFormEvent; import alternativa.tanks.controller.events.logging.RegistrationUXNavigationFinishEvent; import alternativa.tanks.controller.events.logging.RegistrationUXNavigationStartEvent; import alternativa.tanks.service.IRegistrationUXService; import flash.events.EventDispatcher; import projects.tanks.client.entrance.model.entrance.logging.RegistrationUXFormAction; import projects.tanks.client.entrance.model.entrance.logging.RegistrationUXScreen; public class RegistrationUXService extends EventDispatcher implements IRegistrationUXService { public function RegistrationUXService() { super(); } public function logFormAction(param1:RegistrationUXFormAction) : void { dispatchEvent(new RegistrationUXFormEvent(param1,1)); } public function logCountableFormAction(param1:RegistrationUXFormAction, param2:int) : void { if(param2 > 0) { dispatchEvent(new RegistrationUXFormEvent(param1,param2)); } } public function logNavigationStart(param1:RegistrationUXScreen) : void { dispatchEvent(new RegistrationUXNavigationStartEvent(param1)); } public function logNavigationFinish() : void { dispatchEvent(new RegistrationUXNavigationFinishEvent()); } } }
package alternativa.tanks.models.tank { import alternativa.object.ClientObject; import alternativa.tanks.models.weapon.IWeapon; import alternativa.tanks.sfx.TankSounds; import alternativa.tanks.utils.CircularObjectBuffer; import alternativa.tanks.vehicles.tanks.Tank; import com.alternativaplatform.projects.tanks.client.models.tank.TankSpawnState; import flash.display.BitmapData; import projects.tanks.client.battleservice.model.team.BattleTeamType; public class TankData { public static var EVENT_BUFFER_SIZE:int = 10; public static var localTankData:TankData; public var battlefield:ClientObject; public var user:ClientObject; public var turret:ClientObject; public var hull:ClientObject; public var weapon:IWeapon; public var coloring:BitmapData; public var deadColoring:BitmapData; public var local:Boolean; public var health:int; public var tank:Tank; public var ctrlBits:int; public var enabled:Boolean; public var teamType:BattleTeamType; public var userName:String; public var userRank:int; public var sounds:TankSounds; public var tankCollisionCount:int; public var spawnState:TankSpawnState; public var mass:Number = 1; public var power:Number = 0; public var incarnation:int; public var activationTime:int; public var controlsLocked:Boolean = false; public var deadTime:int; private var events:CircularObjectBuffer; public function TankData() { this.events = new CircularObjectBuffer(EVENT_BUFFER_SIZE); super(); } public function logEvent(event:Object) : void { this.events.addObject(event); } public function toString() : String { var event:Object = null; var s:String = "user id=" + this.user.id + "\n" + "user name=" + this.userName + "\n" + "user rank=" + this.userRank + "\n" + "local=" + this.local + "\n" + "team type=" + (this.teamType == null ? "none" : this.teamType.toString()) + "\n" + "incarnation=" + this.incarnation + "\n" + "health=" + this.health + "\n" + "enabled=" + this.enabled + "\n" + "ctrlBits=" + this.ctrlBits + "\n" + "mass=" + this.mass + "\n" + "power=" + this.power + "\n" + "maxSpeed=" + (this.tank == null ? "none" : this.tank.maxSpeed) + "\n" + "turret id=" + (this.turret == null ? null : this.turret.id) + "\n" + "hull id=" + (this.hull == null ? null : this.hull.id) + "\n" + "title.hidden=" + (this.tank == null ? "none" : this.tank.title.isHidden()) + "\n" + "collisionGroup=" + (this.tank == null ? "none" : this.tank.collisionGroup) + "\n" + "hullAlpha=" + (this.tank == null ? "none" : this.tank.skin.hullMesh.alpha) + "\n" + "pos=" + (this.tank == null ? "none" : this.tank.state.pos) + "\n" + "orientation=" + (this.tank == null ? "none" : this.tank.state.orientation) + "\n"; s += "Last events: \n"; for each(event in this.events.getObjects()) { s += event.toString() + "\n"; } return s; } } }
package alternativa.tanks.model.challenge.server { public class UserProgressServerData { public var level:int; public var targetProgress:int; public var progress:int; public function UserProgressServerData() { super(); } } }
package alternativa.proplib.objects { public class PropObjectType { public static const MESH:int = 1; public static const SPRITE:int = 2; public function PropObjectType() { super(); } } }
package alternativa.tanks.models.weapons.targeting.direction { import alternativa.tanks.models.weapon.AllGlobalGunParams; public interface TargetingDirectionCalculator { function getDirections(param1:AllGlobalGunParams) : Vector.<TargetingDirection>; } }
package forms.friends.list.renderer.background { import mx.core.BitmapAsset; [ExcludeClass] public class FriendCellSelected_centerIconClass extends BitmapAsset { public function FriendCellSelected_centerIconClass() { super(); } } }
package alternativa.network { public interface ICommandHandler { function open() : void; function close() : void; function disconnect(param1:String) : void; function executeCommand(param1:Object) : void; function get commandSender() : ICommandSender; function set commandSender(param1:ICommandSender) : void; } }
package alternativa.tanks.battle.objects.tank.tankskin.turret { import alternativa.engine3d.core.Object3D; import alternativa.math.Matrix4; import alternativa.math.Vector3; public class TurretGeometryItem { private var halfSize:Vector3; private var transform:Matrix4; public function TurretGeometryItem(param1:Object3D) { super(); this.halfSize = new Vector3(param1.boundMaxX - param1.boundMinX,param1.boundMaxY - param1.boundMinY,param1.boundMaxZ - param1.boundMinZ); this.halfSize = this.halfSize.scale(0.5); this.transform = new Matrix4(); var local2:Vector3 = new Vector3(param1.boundMaxX + param1.boundMinX,param1.boundMinY + param1.boundMaxY,param1.boundMinZ + param1.boundMaxZ); local2.scale(0.5); this.transform.setMatrix(local2.x + param1.x,local2.y + param1.y,local2.z + param1.z,param1.rotationX,param1.rotationY,param1.rotationZ); } public function getHalfSize() : Vector3 { return this.halfSize; } public function getTransform() : Matrix4 { return this.transform; } } }
package alternativa.tanks.loader { import mx.core.BitmapAsset; [ExcludeClass] public class LoaderWindow_bitmapWindowSmall extends BitmapAsset { public function LoaderWindow_bitmapWindowSmall() { super(); } } }
package controls { import assets.icons.InputCheckIcon; import utils.tweener.TweenLite; public class ValidationIcon extends InputCheckIcon { private static const OFF:int = 0; private static const PROGRESS:int = 1; private static const VALID:int = 2; private static const INVALID:int = 3; public var fadeTime:Number; private var currentState:int = -1; public function ValidationIcon() { super(); this.turnOff(); } private function setCompleteVisible(param1:Boolean) : void { visible = param1; if(!visible) { gotoAndStop(this.currentState); if(this.currentState != OFF) { visible = true; if(this.fadeTime > 0) { alpha = 0; TweenLite.to(this,this.fadeTime,{"alpha":1}); } } } } private function changeState(param1:int) : void { if(this.currentState != param1) { this.currentState = param1; if(this.fadeTime > 0) { TweenLite.to(this,this.fadeTime,{ "alpha":0, "onComplete":this.setCompleteVisible, "onCompleteParams":[false] }); } else { this.setCompleteVisible(false); } } } public function startProgress() : void { this.changeState(PROGRESS); } public function turnOff() : void { this.changeState(OFF); } public function markAsValid() : void { this.changeState(VALID); } public function markAsInvalid() : void { this.changeState(INVALID); } } }
package _codec.projects.tanks.client.panel.model.shop.featuring { import alternativa.protocol.ICodec; import alternativa.protocol.IProtocol; import alternativa.protocol.ProtocolBuffer; import alternativa.protocol.codec.OptionalCodecDecorator; import alternativa.protocol.impl.LengthCodecHelper; import alternativa.protocol.info.TypeCodecInfo; import projects.tanks.client.panel.model.shop.featuring.ShopItemFeaturingCC; public class VectorCodecShopItemFeaturingCCLevel1 implements ICodec { private var elementCodec:ICodec; private var optionalElement:Boolean; public function VectorCodecShopItemFeaturingCCLevel1(param1:Boolean) { super(); this.optionalElement = param1; } public function init(param1:IProtocol) : void { this.elementCodec = param1.getCodec(new TypeCodecInfo(ShopItemFeaturingCC,false)); if(this.optionalElement) { this.elementCodec = new OptionalCodecDecorator(this.elementCodec); } } public function decode(param1:ProtocolBuffer) : Object { var local2:int = LengthCodecHelper.decodeLength(param1); var local3:Vector.<ShopItemFeaturingCC> = new Vector.<ShopItemFeaturingCC>(local2,true); var local4:int = 0; while(local4 < local2) { local3[local4] = ShopItemFeaturingCC(this.elementCodec.decode(param1)); local4++; } return local3; } public function encode(param1:ProtocolBuffer, param2:Object) : void { var local4:ShopItemFeaturingCC = null; if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:Vector.<ShopItemFeaturingCC> = Vector.<ShopItemFeaturingCC>(param2); var local5:int = int(local3.length); LengthCodecHelper.encodeLength(param1,local5); var local6:int = 0; while(local6 < local5) { this.elementCodec.encode(param1,local3[local6]); local6++; } } } }
package alternativa.tanks.models.teamlight { import projects.tanks.client.battleservice.model.battle.team.BattleTeam; public final class ModeLight { private var redTeam:TeamLightColor; private var blueTeam:TeamLightColor; private var neutralTeam:TeamLightColor; private var attenuationBegin:Number; private var attenuatrionEnd:Number; public function ModeLight(param1:TeamLightColor, param2:TeamLightColor, param3:TeamLightColor, param4:Number, param5:Number) { super(); this.redTeam = param1; this.blueTeam = param2; this.neutralTeam = param3; this.attenuationBegin = param4; this.attenuatrionEnd = param5; } public function getLightForTeam(param1:BattleTeam) : TeamLightColor { switch(param1.value) { case BattleTeam.BLUE.value: return this.blueTeam; case BattleTeam.NONE.value: return this.neutralTeam; case BattleTeam.RED.value: return this.redTeam; default: return null; } } public function getAttenuationBegin() : Number { return this.attenuationBegin; } public function getAttenuationEnd() : Number { return this.attenuatrionEnd; } } }
package alternativa.tanks.model.gift { import mx.core.BitmapAsset; [ExcludeClass] public class GiftRollerList__bg extends BitmapAsset { public function GiftRollerList__bg() { super(); } } }
package projects.tanks.client.battleservice { public class BattleMode { public static const DM:BattleMode = new BattleMode(0,"DM"); public static const TDM:BattleMode = new BattleMode(1,"TDM"); public static const CTF:BattleMode = new BattleMode(2,"CTF"); public static const CP:BattleMode = new BattleMode(3,"CP"); public static const AS:BattleMode = new BattleMode(4,"AS"); public static const RUGBY:BattleMode = new BattleMode(5,"RUGBY"); public static const SUR:BattleMode = new BattleMode(6,"SUR"); public static const JGR:BattleMode = new BattleMode(7,"JGR"); private var _value:int; private var _name:String; public function BattleMode(param1:int, param2:String) { super(); this._value = param1; this._name = param2; } public static function get values() : Vector.<BattleMode> { var local1:Vector.<BattleMode> = new Vector.<BattleMode>(); local1.push(DM); local1.push(TDM); local1.push(CTF); local1.push(CP); local1.push(AS); local1.push(RUGBY); local1.push(SUR); local1.push(JGR); return local1; } public function toString() : String { return "BattleMode [" + this._name + "]"; } public function get value() : int { return this._value; } public function get name() : String { return this._name; } } }
package alternativa.tanks.models.controlpoints.hud.panel { import alternativa.tanks.battle.scene3d.Renderer; import alternativa.tanks.models.battle.gui.gui.statistics.field.LayoutManager; import alternativa.tanks.models.battle.gui.gui.statistics.field.Widget; import alternativa.tanks.models.controlpoints.hud.*; import controls.Label; import controls.resultassets.WhiteFrame; import flash.display.Shape; import flash.display.Sprite; public class KeyPointsHUDPanel extends Sprite implements Renderer, Widget { private static const SPACING:int = 1; private var shape:Shape = new Shape(); private var indicators:Vector.<KeyPointHUDIndicator>; private var _width:int; private var _height:int; public function KeyPointsHUDPanel(param1:Vector.<KeyPoint>) { super(); this.createIndicators(param1); this.createBorder(param1.length); addChild(this.shape); this.bringLabelsToFront(); } public function removeFromParent() : void { if(parent != null) { parent.removeChild(this); } } private function bringLabelsToFront() : void { var local1:KeyPointHUDIndicator = null; for each(local1 in this.indicators) { addChild(local1.getLabel()); } } public function setLayoutManager(param1:LayoutManager) : void { } public function render(param1:int, param2:int) : void { this.update(); } public function update() : void { var local1:KeyPointHUDIndicator = null; for each(local1 in this.indicators) { local1.update(); } } private function createIndicators(param1:Vector.<KeyPoint>) : void { var local5:KeyPoint = null; var local6:KeyPointHUDIndicator = null; var local7:Label = null; var local2:Vector.<KeyPoint> = this.sortPoints(param1); var local3:int = 2; this.indicators = new Vector.<KeyPointHUDIndicator>(param1.length); var local4:int = 0; while(local4 < local2.length) { local5 = local2[local4]; local6 = new KeyPointHUDIndicator(local5); local6.x = local3; local6.y = 2; addChild(local6); local7 = local6.getLabel(); local7.y = 8; local7.x = int(local6.x + (local6.width - local7.width) / 2); if(local4 < local2.length - 1) { this.shape.graphics.lineStyle(0,16777215); this.shape.graphics.moveTo(local6.x + 36,2); this.shape.graphics.lineTo(local6.x + 36,38); } this.indicators[local4] = local6; local3 += local6.width + SPACING; local4++; } } private function sortPoints(param1:Vector.<KeyPoint>) : Vector.<KeyPoint> { var points:Vector.<KeyPoint> = param1; return points.concat().sort(function(param1:KeyPoint, param2:KeyPoint):Number { if(param1.getName() < param2.getName()) { return -1; } if(param1.getName() > param2.getName()) { return 1; } return 0; }); } private function createBorder(param1:int) : void { var local2:WhiteFrame = new WhiteFrame(); local2.width = param1 * (36 + SPACING) - SPACING + 4; addChild(local2); this._width = local2.width; this._height = local2.height; } [Obfuscation(rename="false")] override public function get width() : Number { return this._width; } [Obfuscation(rename="false")] override public function get height() : Number { return this._height; } } }
package alternativa.tanks.gui.shop.payment.item { import alternativa.tanks.gui.shop.payment.event.PayModeChosen; import alternativa.tanks.gui.shop.shopitems.item.base.ShopButton; import alternativa.tanks.model.payment.modes.PayMode; import alternativa.tanks.model.payment.shop.discount.ShopDiscount; import flash.display.Bitmap; import flash.events.MouseEvent; import platform.client.fp10.core.type.IGameObject; public class PayModeButton extends ShopButton { public static const WIDTH:int = 157; public static const HEIGHT:int = 52; private var payMode:IGameObject; private var isSpecialOffer:Boolean = false; public function PayModeButton(param1:IGameObject, param2:Boolean) { this.payMode = param1; this.isSpecialOffer = param2; addEventListener(MouseEvent.CLICK,this.onMouseClick); super(PaymentItemSkin.SKIN); } private function onMouseClick(param1:MouseEvent) : void { dispatchEvent(new PayModeChosen(this.payMode)); } override protected function init() : void { super.init(); var local1:Bitmap = new Bitmap(PayMode(this.payMode.adapt(PayMode)).getImage().data); addChild(local1); local1.x = WIDTH - local1.width >> 1; local1.y = HEIGHT - local1.height >> 1; if(this.hasDiscount()) { salesIcon.x = local1.x + local1.width - salesIcon.width + 1; salesIcon.y = local1.y - 1; addChild(salesIcon); } } public function hasDiscount() : Boolean { return Boolean(ShopDiscount(this.payMode.adapt(ShopDiscount)).isEnabled()) && !this.isSpecialOffer; } override public function destroy() : void { super.destroy(); this.payMode = null; removeEventListener(MouseEvent.CLICK,this.onMouseClick); } override public function get width() : Number { return WIDTH; } override public function get height() : Number { return HEIGHT; } } }
package controls { import flash.text.AntiAliasType; import flash.text.GridFitType; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.text.TextFormat; import fonts.TanksFontService; public class Label extends TextField { private var format:TextFormat; public function Label() { super(); this.format = TanksFontService.getTextFormat(12); this.format.color = 16777215; this.selectable = false; this.embedFonts = TanksFontService.isEmbedFonts(); this.antiAliasType = AntiAliasType.ADVANCED; this.gridFitType = GridFitType.SUBPIXEL; this.width = 10; this.height = 12; this.autoSize = TextFieldAutoSize.LEFT; this.defaultTextFormat = this.format; this.size = 12; } private function updateformat() : void { this.defaultTextFormat = this.format; this.setTextFormat(this.format); } public function set size(param1:Number) : void { this.format.size = param1; this.updateformat(); } public function set bold(param1:Boolean) : void { this.format.bold = param1; this.updateformat(); } public function set color(param1:uint) : void { this.format.color = param1; this.updateformat(); } public function set align(param1:String) : void { this.format.align = param1; this.updateformat(); } override public function set x(param1:Number) : void { super.x = int(param1); } override public function set y(param1:Number) : void { super.y = int(param1); } override public function set height(param1:Number) : void { super.height = Math.ceil(param1); } override public function set width(param1:Number) : void { super.width = Math.ceil(param1); } } }
package platform.client.fp10.core.network.command.control.server { import alternativa.protocol.ICodec; import alternativa.protocol.IProtocol; import alternativa.protocol.ProtocolBuffer; import alternativa.protocol.info.TypeCodecInfo; import alternativa.types.Byte; import flash.utils.ByteArray; public class HashResponseCommandCodec implements ICodec { private static const HASH_BYTE_LENGTH:int = 32; private var byteCodec:ICodec; private var booleanCodec:ICodec; public function HashResponseCommandCodec(param1:IProtocol) { super(); this.init(param1); } public function init(param1:IProtocol) : void { this.byteCodec = param1.getCodec(new TypeCodecInfo(Byte,false)); this.booleanCodec = param1.getCodec(new TypeCodecInfo(Boolean,false)); } public function encode(param1:ProtocolBuffer, param2:Object) : void { } public function decode(param1:ProtocolBuffer) : Object { var local2:ByteArray = new ByteArray(); var local3:int = 0; while(local3 < HASH_BYTE_LENGTH) { local2.writeByte(int(this.byteCodec.decode(param1))); local3++; } local2.position = 0; var local4:Boolean = Boolean(this.booleanCodec.decode(param1)); return new HashResponseCommand(local2,local4); } } }
package alternativa.tanks.model.shop.items.base { public class RedShopItemSkin extends ButtonItemSkin { [Embed(source="1056.png")] private static const normalStateClass:Class; [Embed(source="822.png")] private static const overStateClass:Class; public function RedShopItemSkin() { super(); normalState = new normalStateClass().bitmapData; overState = new overStateClass().bitmapData; } } }
package _codec.projects.tanks.client.battlefield.models.tankparts.armor.explosion { import alternativa.protocol.ICodec; import alternativa.protocol.IProtocol; import alternativa.protocol.ProtocolBuffer; import alternativa.protocol.codec.OptionalCodecDecorator; import alternativa.protocol.impl.LengthCodecHelper; import alternativa.protocol.info.TypeCodecInfo; import projects.tanks.client.battlefield.models.tankparts.armor.explosion.TankExplosionCC; public class VectorCodecTankExplosionCCLevel1 implements ICodec { private var elementCodec:ICodec; private var optionalElement:Boolean; public function VectorCodecTankExplosionCCLevel1(param1:Boolean) { super(); this.optionalElement = param1; } public function init(param1:IProtocol) : void { this.elementCodec = param1.getCodec(new TypeCodecInfo(TankExplosionCC,false)); if(this.optionalElement) { this.elementCodec = new OptionalCodecDecorator(this.elementCodec); } } public function decode(param1:ProtocolBuffer) : Object { var local2:int = int(LengthCodecHelper.decodeLength(param1)); var local3:Vector.<TankExplosionCC> = new Vector.<TankExplosionCC>(local2,true); var local4:int = 0; while(local4 < local2) { local3[local4] = TankExplosionCC(this.elementCodec.decode(param1)); local4++; } return local3; } public function encode(param1:ProtocolBuffer, param2:Object) : void { var local4:TankExplosionCC = null; if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:Vector.<TankExplosionCC> = Vector.<TankExplosionCC>(param2); var local5:int = int(local3.length); LengthCodecHelper.encodeLength(param1,local5); var local6:int = 0; while(local6 < local5) { this.elementCodec.encode(param1,local3[local6]); local6++; } } } }
package alternativa.model.description { import platform.client.models.commons.description.DescriptionModelBase; import platform.client.models.commons.description.IDescriptionModelBase; [ModelInfo] public class DescriptionModel extends DescriptionModelBase implements IDescription, IDescriptionModelBase { public function DescriptionModel() { super(); } public function getName() : String { return getInitParam().name; } public function getDescription() : String { return getInitParam().description; } } }
package alternativa.tanks.gui.payment.forms { import alternativa.tanks.model.payment.paymentstate.PaymentWindowService; import base.DiscreteSprite; import platform.client.fp10.core.type.AutoClosable; import platform.client.fp10.core.type.IGameObject; import projects.tanks.clients.fp10.libraries.tanksservices.service.logging.paymentactions.UserPaymentActionsService; public class PayModeForm extends DiscreteSprite implements AutoClosable { [Inject] public static var userPaymentActionsService:UserPaymentActionsService; [Inject] public static var paymentWindowService:PaymentWindowService; protected var payMode:IGameObject; protected var _width:int; protected var _height:int; public function PayModeForm(param1:IGameObject) { super(); this.payMode = param1; } public function getPayMode() : IGameObject { return this.payMode; } public function activate() : void { } protected function logProceedAction() : void { userPaymentActionsService.proceed(this.payMode.id,paymentWindowService.getChosenItem().id); } public function close() : void { this.destroy(); } public function destroy() : void { this.payMode = null; } public function isWithoutChosenItem() : Boolean { return false; } public function shouldBeOmitted() : Boolean { return false; } public function getMinHeight() : int { return 300; } } }
package alternativa.debug { import mx.core.BitmapAsset; [ExcludeClass] public class ErrorWindow_okButtonBitmap extends BitmapAsset { public function ErrorWindow_okButtonBitmap() { super(); } } }
package _codec.projects.tanks.client.panel.model.payment { import alternativa.osgi.OSGi; import alternativa.osgi.service.clientlog.IClientLog; import alternativa.protocol.ICodec; import alternativa.protocol.IProtocol; import alternativa.protocol.ProtocolBuffer; import alternativa.protocol.info.CollectionCodecInfo; import alternativa.protocol.info.TypeCodecInfo; import projects.tanks.client.panel.model.payment.CrystalsPaymentCC; import projects.tanks.client.panel.model.payment.PaymentPackage; public class CodecCrystalsPaymentCC implements ICodec { public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog)); private var codec_accountId:ICodec; private var codec_calculatorEnabled:ICodec; private var codec_crystalCost:ICodec; private var codec_defaultAmountOfCrystals:ICodec; private var codec_greaterMaximumCrystalsMessage:ICodec; private var codec_greaterMaximumMoneyMessage:ICodec; private var codec_lessMinimumCrystalsMessage:ICodec; private var codec_lessMinimumMoneyMessage:ICodec; private var codec_manualDescription:ICodec; private var codec_paymentPackages:ICodec; public function CodecCrystalsPaymentCC() { super(); } public function init(param1:IProtocol) : void { this.codec_accountId = param1.getCodec(new TypeCodecInfo(String,false)); this.codec_calculatorEnabled = param1.getCodec(new TypeCodecInfo(Boolean,false)); this.codec_crystalCost = param1.getCodec(new TypeCodecInfo(Number,false)); this.codec_defaultAmountOfCrystals = param1.getCodec(new TypeCodecInfo(int,false)); this.codec_greaterMaximumCrystalsMessage = param1.getCodec(new TypeCodecInfo(String,true)); this.codec_greaterMaximumMoneyMessage = param1.getCodec(new TypeCodecInfo(String,true)); this.codec_lessMinimumCrystalsMessage = param1.getCodec(new TypeCodecInfo(String,true)); this.codec_lessMinimumMoneyMessage = param1.getCodec(new TypeCodecInfo(String,true)); this.codec_manualDescription = param1.getCodec(new TypeCodecInfo(String,false)); this.codec_paymentPackages = param1.getCodec(new CollectionCodecInfo(new TypeCodecInfo(PaymentPackage,false),false,1)); } public function decode(param1:ProtocolBuffer) : Object { var local2:CrystalsPaymentCC = new CrystalsPaymentCC(); local2.accountId = this.codec_accountId.decode(param1) as String; local2.calculatorEnabled = this.codec_calculatorEnabled.decode(param1) as Boolean; local2.crystalCost = this.codec_crystalCost.decode(param1) as Number; local2.defaultAmountOfCrystals = this.codec_defaultAmountOfCrystals.decode(param1) as int; local2.greaterMaximumCrystalsMessage = this.codec_greaterMaximumCrystalsMessage.decode(param1) as String; local2.greaterMaximumMoneyMessage = this.codec_greaterMaximumMoneyMessage.decode(param1) as String; local2.lessMinimumCrystalsMessage = this.codec_lessMinimumCrystalsMessage.decode(param1) as String; local2.lessMinimumMoneyMessage = this.codec_lessMinimumMoneyMessage.decode(param1) as String; local2.manualDescription = this.codec_manualDescription.decode(param1) as String; local2.paymentPackages = this.codec_paymentPackages.decode(param1) as Vector.<PaymentPackage>; return local2; } public function encode(param1:ProtocolBuffer, param2:Object) : void { if(param2 == null) { throw new Error("Object is null. Use @ProtocolOptional annotation."); } var local3:CrystalsPaymentCC = CrystalsPaymentCC(param2); this.codec_accountId.encode(param1,local3.accountId); this.codec_calculatorEnabled.encode(param1,local3.calculatorEnabled); this.codec_crystalCost.encode(param1,local3.crystalCost); this.codec_defaultAmountOfCrystals.encode(param1,local3.defaultAmountOfCrystals); this.codec_greaterMaximumCrystalsMessage.encode(param1,local3.greaterMaximumCrystalsMessage); this.codec_greaterMaximumMoneyMessage.encode(param1,local3.greaterMaximumMoneyMessage); this.codec_lessMinimumCrystalsMessage.encode(param1,local3.lessMinimumCrystalsMessage); this.codec_lessMinimumMoneyMessage.encode(param1,local3.lessMinimumMoneyMessage); this.codec_manualDescription.encode(param1,local3.manualDescription); this.codec_paymentPackages.encode(param1,local3.paymentPackages); } } }
package alternativa.tanks.gui.settings { import flash.events.Event; public class SettingEvent extends Event { public function SettingEvent(param1:String) { super(param1,true,false); } } }
package forms.friends.battleLink { import alternativa.init.Main; import alternativa.osgi.service.locale.ILocaleService; import alternativa.tanks.model.panel.IPanel; import alternativa.tanks.model.panel.PanelModel; import controls.Label; import flash.display.Bitmap; import flash.display.Sprite; import flash.events.MouseEvent; import forms.ColorConstants; import scpacker.networking.INetworker; import scpacker.networking.Network; public class BattleLink extends Sprite { public static var localeService:ILocaleService; private var _userId:String; private var _label:Label; private var _labelCont:Sprite; private var _availableBattleIcon:Bitmap; public function BattleLink(param1:String) { super(); this._userId = param1; if(param1 != null && param1 != "null" && param1 != "") { this.init(); this.addEventListener(MouseEvent.CLICK,this.onBattleLinkClick,false,0,true); } } private function onBattleLinkClick(param1:MouseEvent) : void { if(PanelModel(Main.osgi.getService(IPanel)).isInBattle) { PanelModel(Main.osgi.getService(IPanel)).showQuitBattleDialog(); return; } if(PanelModel(Main.osgi.getService(IPanel)).isBattleSelect) { Network(Main.osgi.getService(INetworker)).send("lobby;get_show_battle_info;" + this._userId); } else { PanelModel(Main.osgi.getService(IPanel)).showBattleSelect(null); } } private function init() : void { mouseChildren = true; mouseEnabled = true; buttonMode = true; tabEnabled = false; tabChildren = false; this._labelCont = new Sprite(); addChild(this._labelCont); this._label = new Label(); this._label.text = this._userId.split("@")[1]; this._label.color = ColorConstants.GREEN_LABEL; this._labelCont.addChild(this._label); this._labelCont.y = -1; this._labelCont.useHandCursor = true; } public function removeEvents() : void { this.removeEventListener(MouseEvent.CLICK,this.onBattleLinkClick); } public function get labelCont() : Sprite { return this._labelCont; } } }
package alternativa.tanks.gui.shopitems.item.kits { import projects.tanks.client.panel.model.shop.kitpackage.KitPackageItemInfo; public class KitPackage { private var items:Vector.<KitPackageItemInfo>; public function KitPackage(kit:Vector.<KitPackageItemInfo>) { super(); this.items = kit; } public function getItemInfos() : Vector.<KitPackageItemInfo> { return this.items; } } }
package platform.client.fp10.core.network { import alternativa.protocol.IProtocol; import flash.utils.ByteArray; public class ControlChannelContext { public var hash:ByteArray; public var channelProtectionEnabled:Boolean; public var spaceProtocol:IProtocol; public function ControlChannelContext() { super(); } } }
package alternativa.tanks.display.usertitle { public class Size2D { public var width:int; public var height:int; public function Size2D() { super(); } public function setToZero() : void { this.width = 0; this.height = 0; } public function setWidth(param1:int) : void { this.width = param1; } public function setHeight(param1:int) : void { this.height = param1; } public function setWidthIfGreater(param1:int) : void { if(this.width < param1) { this.width = param1; } } public function addHeight(param1:int) : void { this.height += param1; } public function addWidth(param1:int) : void { this.width += param1; } } }
package forms.friends.list.renderer { import alternativa.init.Main; import alternativa.osgi.service.locale.ILocaleService; import controls.base.LabelBase; import fl.controls.listClasses.CellRenderer; import fl.controls.listClasses.ListData; import flash.display.DisplayObject; import flash.display.Sprite; import flash.events.Event; import flash.events.MouseEvent; import flash.events.TimerEvent; import flash.utils.Timer; import forms.ColorConstants; import forms.friends.FriendActionIndicator; import forms.friends.list.renderer.background.RendererBackGroundIncomingList; import forms.userlabel.UserLabel; import scpacker.networking.INetworker; import scpacker.networking.Network; public class FriendsIncomingListRenderer extends CellRenderer { public static var localeService:ILocaleService; private var _labelsContainer:DisplayObject; private var _userLabel:UserLabel; private var _acceptRequestIndicator:FriendActionIndicator; private var _rejectRequestIndicator:FriendActionIndicator; private var _isNewLabel:LabelBase; public function FriendsIncomingListRenderer() { super(); } override public function set data(param1:Object) : void { _data = param1; mouseEnabled = true; mouseChildren = true; useHandCursor = false; buttonMode = false; var _loc2_:RendererBackGroundIncomingList = new RendererBackGroundIncomingList(false); var _loc3_:RendererBackGroundIncomingList = new RendererBackGroundIncomingList(true); setStyle("upSkin",_loc2_); setStyle("downSkin",_loc2_); setStyle("overSkin",_loc2_); setStyle("selectedUpSkin",_loc3_); setStyle("selectedOverSkin",_loc3_); setStyle("selectedDownSkin",_loc3_); this._labelsContainer = this.createLabels(_data); if(this._acceptRequestIndicator == null) { this._acceptRequestIndicator = new FriendActionIndicator(FriendActionIndicator.YES); addChild(this._acceptRequestIndicator); } this._acceptRequestIndicator.visible = false; if(this._rejectRequestIndicator == null) { this._rejectRequestIndicator = new FriendActionIndicator(FriendActionIndicator.NO); addChild(this._rejectRequestIndicator); } this._rejectRequestIndicator.visible = false; if(this._isNewLabel == null) { this._isNewLabel = new LabelBase(); this._isNewLabel.text = "Новый"; this._isNewLabel.height = 18; this._isNewLabel.y = -1; this._isNewLabel.color = ColorConstants.GREEN_LABEL; addChild(this._isNewLabel); this._isNewLabel.mouseEnabled = false; } this._isNewLabel.visible = _data.isNew; this.addEventListener(Event.RESIZE,this.onResize,false,0,true); this.addEventListener(MouseEvent.ROLL_OVER,this.onRollOver,false,0,true); this.addEventListener(MouseEvent.ROLL_OUT,this.onRollOut,false,0,true); this.resize(); this._acceptRequestIndicator.addEventListener(MouseEvent.CLICK,this.onClickAcceptRequest,false,0,true); this._rejectRequestIndicator.addEventListener(MouseEvent.CLICK,this.onClickRejectRequest,false,0,true); } private function onResize(param1:Event) : void { this.resize(); } private function resize() : void { this._rejectRequestIndicator.x = _width - this._rejectRequestIndicator.width - 6; this._acceptRequestIndicator.x = this._rejectRequestIndicator.x - this._acceptRequestIndicator.width - 1; this._isNewLabel.x = _width - this._isNewLabel.width - 6; } private function createLabels(param1:Object) : Sprite { var _loc2_:Sprite = null; _loc2_ = new Sprite(); if(param1.id != null) { this._userLabel = new UserLabel(param1.id); this._userLabel.x = -3; this._userLabel.y = -1; _loc2_.addChild(this._userLabel); this._userLabel.setRank(param1.rank); this._userLabel.setUid(param1.uid,param1.uid); this._userLabel.setUidColor(ColorConstants.GREEN_LABEL); this._userLabel.addEventListener(MouseEvent.CLICK,this.fgu); } return _loc2_; } private function fgu(param1:MouseEvent) : void { var tim:Timer = new Timer(100,1); tim.addEventListener(TimerEvent.TIMER_COMPLETE,function(param1:Event):void { }); tim.start(); } private function onRollOver(param1:MouseEvent) : void { this._acceptRequestIndicator.visible = true; this._rejectRequestIndicator.visible = true; if(_data.isNew) { this._isNewLabel.visible = false; } super.selected = true; } private function onRollOut(param1:MouseEvent) : void { this._acceptRequestIndicator.visible = false; this._rejectRequestIndicator.visible = false; if(_data.isNew) { this._isNewLabel.visible = true; } super.selected = false; } private function onClickAcceptRequest(param1:MouseEvent) : void { Network(Main.osgi.getService(INetworker)).send("lobby;accept_friend;" + this._userLabel.uid); trace("Принимаем"); } private function onClickRejectRequest(param1:MouseEvent) : void { Network(Main.osgi.getService(INetworker)).send("lobby;deny_friend;" + this._userLabel.uid); trace("Оклоняем"); } override public function set listData(param1:ListData) : void { _listData = param1; label = _listData.label; if(this._labelsContainer != null) { setStyle("icon",this._labelsContainer); } } override protected function drawBackground() : void { var _loc1_:* = !!enabled ? mouseState : "disabled"; if(selected) { _loc1_ = "selected" + _loc1_.substr(0,1).toUpperCase() + _loc1_.substr(1); } _loc1_ += "Skin"; var _loc2_:DisplayObject = background; background = getDisplayObjectInstance(getStyleValue(_loc1_)); addChildAt(background,0); if(_loc2_ != null && _loc2_ != background) { removeChild(_loc2_); } } override public function set selected(param1:Boolean) : void { } } }
package alternativa.tanks.models.weapon.railgun { import alternativa.math.Vector3; import alternativa.physics.Body; import platform.client.fp10.core.model.impl.Model; import platform.client.fp10.core.type.IGameObject; public class RailgunCallbackAdapt implements RailgunCallback { private var object:IGameObject; private var impl:RailgunCallback; public function RailgunCallbackAdapt(param1:IGameObject, param2:RailgunCallback) { super(); this.object = param1; this.impl = param2; } public function onStartCharging(param1:int) : void { var time:int = param1; try { Model.object = this.object; this.impl.onStartCharging(time); } finally { Model.popObject(); } } public function onShot(param1:int, param2:Vector3, param3:Vector.<Body>, param4:Vector.<Vector3>) : void { var time:int = param1; var staticHitPoint:Vector3 = param2; var targets:Vector.<Body> = param3; var targetHitPoints:Vector.<Vector3> = param4; try { Model.object = this.object; this.impl.onShot(time,staticHitPoint,targets,targetHitPoints); } finally { Model.popObject(); } } public function onShotDummy(param1:int) : void { var time:int = param1; try { Model.object = this.object; this.impl.onShotDummy(time); } finally { Model.popObject(); } } } }
package alternativa.physics.rigid { import alternativa.math.Matrix3; import alternativa.physics.Body; import alternativa.tanks.models.battlefield.scene3dcontainer.Scene3DContainer; public class Body3D extends Body { public function Body3D(invMass:Number, invInertia:Matrix3, localTank:Boolean = false) { super(invMass,invInertia,localTank); } public function addToContainer(container:Scene3DContainer) : void { } public function removeFromContainer() : void { } public function updateSkin(t:Number) : void { } } }
package alternativa.tanks.models.battle.commonflag { import alternativa.tanks.battle.objects.tank.Tank; import platform.client.fp10.core.type.IGameObject; [ModelInterface] public interface FlagNotification { function guiShowFlagDropped(param1:CommonFlag) : void; function guiShowFlagCarried(param1:CommonFlag) : void; function guiShowFlagAtBase(param1:CommonFlag) : void; function notifyFlagTaken(param1:CommonFlag, param2:Tank) : void; function notifyFlagReturned(param1:CommonFlag, param2:IGameObject) : void; function notifyFlagDropped(param1:CommonFlag) : void; function notifyFlagThrown(param1:CommonFlag) : void; function notifyFlagDelivered(param1:CommonFlag, param2:Tank) : void; function notifyFlagFacedOff(param1:CommonFlag) : void; function notifyReadyToFaceOff() : void; } }
package alternativa.tanks.model.userproperties { import alternativa.types.Long; import platform.client.fp10.core.model.impl.Model; import platform.client.fp10.core.type.IGameObject; public class IUserPropertiesEvents implements IUserProperties { private var object:IGameObject; private var impl:Vector.<Object>; public function IUserPropertiesEvents(param1:IGameObject, param2:Vector.<Object>) { super(); this.object = param1; this.impl = param2; } public function getId() : Long { var result:Long = null; var i:int = 0; var m:IUserProperties = null; try { Model.object = this.object; i = 0; while(i < this.impl.length) { m = IUserProperties(this.impl[i]); result = m.getId(); i++; } } finally { Model.popObject(); } return result; } public function getName() : String { var result:String = null; var i:int = 0; var m:IUserProperties = null; try { Model.object = this.object; i = 0; while(i < this.impl.length) { m = IUserProperties(this.impl[i]); result = m.getName(); i++; } } finally { Model.popObject(); } return result; } public function getScore() : int { var result:int = 0; var i:int = 0; var m:IUserProperties = null; try { Model.object = this.object; i = 0; while(i < this.impl.length) { m = IUserProperties(this.impl[i]); result = int(m.getScore()); i++; } } finally { Model.popObject(); } return result; } public function getRank() : int { var result:int = 0; var i:int = 0; var m:IUserProperties = null; try { Model.object = this.object; i = 0; while(i < this.impl.length) { m = IUserProperties(this.impl[i]); result = int(m.getRank()); i++; } } finally { Model.popObject(); } return result; } public function getNextScore() : int { var result:int = 0; var i:int = 0; var m:IUserProperties = null; try { Model.object = this.object; i = 0; while(i < this.impl.length) { m = IUserProperties(this.impl[i]); result = int(m.getNextScore()); i++; } } finally { Model.popObject(); } return result; } public function getPlace() : int { var result:int = 0; var i:int = 0; var m:IUserProperties = null; try { Model.object = this.object; i = 0; while(i < this.impl.length) { m = IUserProperties(this.impl[i]); result = int(m.getPlace()); i++; } } finally { Model.popObject(); } return result; } } }
package alternativa.tanks.model.payment.shop.notification.service { import flash.events.EventDispatcher; public class ShopNotifierServiceImpl extends EventDispatcher implements ShopNotifierService { public function ShopNotifierServiceImpl() { super(); } public function showNotificationAboutNewItems() : void { dispatchEvent(new ShopNotificationEvent(ShopNotificationEvent.SHOW_NOTIFICATION_ABOUT_NEW_ITEMS)); } public function showNotificationAboutDiscounts() : void { dispatchEvent(new ShopNotificationEvent(ShopNotificationEvent.SHOW_NOTIFICATION_ABOUT_DISCOUNTS)); } public function hideNotification() : void { dispatchEvent(new ShopNotificationEvent(ShopNotificationEvent.HIDE_NOTIFICATION)); } } }
package alternativa.tanks.models.weapon.shaft { import alternativa.object.ClientObject; import flash.display.BitmapData; public class Indicator { [Embed(source="879.png")] private static const aim_m0:Class; [Embed(source="877.png")] private static const aim_m1:Class; [Embed(source="878.png")] private static const aim_m2:Class; [Embed(source="880.png")] private static const aim_m3:Class; private static var aimM0:BitmapData = new aim_m0().bitmapData; private static var aimM1:BitmapData = new aim_m1().bitmapData; private static var aimM2:BitmapData = new aim_m2().bitmapData; private static var aimM3:BitmapData = new aim_m3().bitmapData; public function Indicator() { super(); } public static function getIndicator(turret:ClientObject) : BitmapData { switch(turret.id) { case "shaft_m0": return aimM0; case "shaft_m1": return aimM1; case "shaft_m2": return aimM2; case "shaft_m3": return aimM3; default: return aimM0; } } } }
package controls { import flash.display.MovieClip; [Embed(source="/_assets/assets.swf", symbol="symbol1004")] public class InventoryIcon extends MovieClip { public static const MEDIC:int = 1; public static const ARMOR:int = 2; public static const FIRE:int = 3; public static const NOS:int = 4; public static const MINE:int = 5; public static const REM:int = 6; public static const EMPTY:int = 7; public function InventoryIcon(param1:int = 1, param2:Boolean = false) { super(); gotoAndStop(param1 + (param2 ? 7 : 0)); } } }
package alternativa.tanks.models.weapon.gauss.state.targetselection { import alternativa.tanks.models.weapon.gauss.LocalGaussWeapon; import alternativa.tanks.models.weapon.gauss.state.TargetSelectionState; public class LockingState implements IGaussAimState { private var weapon:LocalGaussWeapon; private var parentState:TargetSelectionState; private var prevTime:int = 0; private var remainingLockTime:Number = 0; private var lockResult:* = new LockResult(); public function LockingState(param1:LocalGaussWeapon, param2:TargetSelectionState) { super(); this.weapon = param1; this.parentState = param2; } public function enter(param1:int, param2:GaussAimEventType, param3:*) : void { var local4:* = TargetFoundData(param3); this.prevTime = this.weapon.getTime(); if(Boolean(local4.isNewTarget)) { this.remainingLockTime = this.weapon.getTargetLockDurationMs(); } this.lockResult.copy(local4.lockResult); } public function update(param1:int, param2:int) : void { if(this.weapon.isTriggerPulled()) { if(this.weapon.lockTarget(this.lockResult,this.lockResult.targetId)) { this.remainingLockTime -= this.weapon.getTime() - this.prevTime; this.prevTime = this.weapon.getTime(); this.weapon.weaponStatus = this.remainingLockTime / this.weapon.getTargetLockDurationMs(); if(this.remainingLockTime <= 0) { this.parentState.processEvent(GaussAimEventType.TARGET_LOCKED,this.lockResult); } } else { this.parentState.processEvent(GaussAimEventType.TARGET_LOCK_LOST,this.lockResult.targetId); } } else { this.parentState.processEvent(GaussAimEventType.DEACTIVATED,this.lockResult.targetId); } } } }
package projects.tanks.client.battlefield.models.map { import platform.client.fp10.core.resource.types.TextureResource; public class SkyboxSides { private var _back:TextureResource; private var _bottom:TextureResource; private var _front:TextureResource; private var _left:TextureResource; private var _right:TextureResource; private var _top:TextureResource; public function SkyboxSides(param1:TextureResource = null, param2:TextureResource = null, param3:TextureResource = null, param4:TextureResource = null, param5:TextureResource = null, param6:TextureResource = null) { super(); this._back = param1; this._bottom = param2; this._front = param3; this._left = param4; this._right = param5; this._top = param6; } public function get back() : TextureResource { return this._back; } public function set back(param1:TextureResource) : void { this._back = param1; } public function get bottom() : TextureResource { return this._bottom; } public function set bottom(param1:TextureResource) : void { this._bottom = param1; } public function get front() : TextureResource { return this._front; } public function set front(param1:TextureResource) : void { this._front = param1; } public function get left() : TextureResource { return this._left; } public function set left(param1:TextureResource) : void { this._left = param1; } public function get right() : TextureResource { return this._right; } public function set right(param1:TextureResource) : void { this._right = param1; } public function get top() : TextureResource { return this._top; } public function set top(param1:TextureResource) : void { this._top = param1; } public function toString() : String { var local1:String = "SkyboxSides ["; local1 += "back = " + this.back + " "; local1 += "bottom = " + this.bottom + " "; local1 += "front = " + this.front + " "; local1 += "left = " + this.left + " "; local1 += "right = " + this.right + " "; local1 += "top = " + this.top + " "; return local1 + "]"; } } }
package projects.tanks.client.garage.skins.shot { import alternativa.osgi.OSGi; import alternativa.protocol.IProtocol; import alternativa.protocol.ProtocolBuffer; import alternativa.protocol.info.TypeCodecInfo; import alternativa.types.Long; import platform.client.fp10.core.model.IModel; import platform.client.fp10.core.model.impl.Model; import platform.client.fp10.core.registry.ModelRegistry; public class AvailableShotSkinsModelBase extends Model { private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol)); protected var server:AvailableShotSkinsModelServer; private var client:IAvailableShotSkinsModelBase = IAvailableShotSkinsModelBase(this); private var modelId:Long = Long.getLong(271121565,-563433199); public function AvailableShotSkinsModelBase() { super(); this.initCodecs(); } protected function initCodecs() : void { this.server = new AvailableShotSkinsModelServer(IModel(this)); var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry)); local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(AvailableShotSkinsCC,false))); } protected function getInitParam() : AvailableShotSkinsCC { return AvailableShotSkinsCC(initParams[Model.object]); } override public function invoke(param1:Long, param2:ProtocolBuffer) : void { var local3:* = param1; switch(false ? 0 : 0) { } } override public function get id() : Long { return this.modelId; } } }
package controls { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/controls.TankWindowInner_bottomClass.png")] public class TankWindowInner_bottomClass extends BitmapAsset { public function TankWindowInner_bottomClass() { super(); } } }
package forms.ranks { import mx.core.BitmapAsset; [ExcludeClass] [Embed(source="/_assets/forms.ranks.DefaultRanksBitmaps_bitmapSmallRank17.png")] public class DefaultRanksBitmaps_bitmapSmallRank17 extends BitmapAsset { public function DefaultRanksBitmaps_bitmapSmallRank17() { super(); } } }
package alternativa.physics.collision.primitives { import alternativa.math.Matrix4; import alternativa.math.Vector3; import alternativa.physics.PhysicsMaterial; import alternativa.physics.collision.CollisionShape; import alternativa.physics.collision.types.AABB; public class CollisionTriangle extends CollisionShape { public var v0:Vector3 = new Vector3(); public var v1:Vector3 = new Vector3(); public var v2:Vector3 = new Vector3(); public var e0:Vector3 = new Vector3(); public var e1:Vector3 = new Vector3(); public var e2:Vector3 = new Vector3(); public function CollisionTriangle(param1:Vector3, param2:Vector3, param3:Vector3, param4:int, param5:PhysicsMaterial) { super(TRIANGLE,param4,param5); this.initVertices(param1,param2,param3); } override public function calculateAABB() : AABB { var local4:Number = NaN; var local5:Number = NaN; var local1:AABB = this.aabb; var local2:Matrix4 = this.transform; var local3:Number = 0.005; var local6:Number = local3 * local2.m02; var local7:Number = local3 * local2.m12; var local8:Number = local3 * local2.m22; local4 = this.v0.x * local2.m00 + this.v0.y * local2.m01; local1.minX = local1.maxX = local4 + local6; local5 = local4 - local6; if(local5 > local1.maxX) { local1.maxX = local5; } else if(local5 < local1.minX) { local1.minX = local5; } local4 = this.v0.x * local2.m10 + this.v0.y * local2.m11; local1.minY = local1.maxY = local4 + local7; local5 = local4 - local7; if(local5 > local1.maxY) { local1.maxY = local5; } else if(local5 < local1.minY) { local1.minY = local5; } local4 = this.v0.x * local2.m20 + this.v0.y * local2.m21; local1.minZ = local1.maxZ = local4 + local8; local5 = local4 - local8; if(local5 > local1.maxZ) { local1.maxZ = local5; } else if(local5 < local1.minZ) { local1.minZ = local5; } local4 = this.v1.x * local2.m00 + this.v1.y * local2.m01; local5 = local4 + local6; if(local5 > local1.maxX) { local1.maxX = local5; } else if(local5 < local1.minX) { local1.minX = local5; } local5 = local4 - local6; if(local5 > local1.maxX) { local1.maxX = local5; } else if(local5 < local1.minX) { local1.minX = local5; } local4 = this.v1.x * local2.m10 + this.v1.y * local2.m11; local5 = local4 + local7; if(local5 > local1.maxY) { local1.maxY = local5; } else if(local5 < local1.minY) { local1.minY = local5; } local5 = local4 - local7; if(local5 > local1.maxY) { local1.maxY = local5; } else if(local5 < local1.minY) { local1.minY = local5; } local4 = this.v1.x * local2.m20 + this.v1.y * local2.m21; local5 = local4 + local8; if(local5 > local1.maxZ) { local1.maxZ = local5; } else if(local5 < local1.minZ) { local1.minZ = local5; } local5 = local4 - local8; if(local5 > local1.maxZ) { local1.maxZ = local5; } else if(local5 < local1.minZ) { local1.minZ = local5; } local4 = this.v2.x * local2.m00 + this.v2.y * local2.m01; local5 = local4 + local6; if(local5 > local1.maxX) { local1.maxX = local5; } else if(local5 < local1.minX) { local1.minX = local5; } local5 = local4 - local6; if(local5 > local1.maxX) { local1.maxX = local5; } else if(local5 < local1.minX) { local1.minX = local5; } local4 = this.v2.x * local2.m10 + this.v2.y * local2.m11; local5 = local4 + local7; if(local5 > local1.maxY) { local1.maxY = local5; } else if(local5 < local1.minY) { local1.minY = local5; } local5 = local4 - local7; if(local5 > local1.maxY) { local1.maxY = local5; } else if(local5 < local1.minY) { local1.minY = local5; } local4 = this.v2.x * local2.m20 + this.v2.y * local2.m21; local5 = local4 + local8; if(local5 > local1.maxZ) { local1.maxZ = local5; } else if(local5 < local1.minZ) { local1.minZ = local5; } local5 = local4 - local8; if(local5 > local1.maxZ) { local1.maxZ = local5; } else if(local5 < local1.minZ) { local1.minZ = local5; } local1.minX += local2.m03; local1.maxX += local2.m03; local1.minY += local2.m13; local1.maxY += local2.m13; local1.minZ += local2.m23; local1.maxZ += local2.m23; return local1; } override public function raycast(param1:Vector3, param2:Vector3, param3:Number, param4:Vector3) : Number { var local5:Matrix4 = null; local5 = this.transform; var local6:Number = param2.x * local5.m02 + param2.y * local5.m12 + param2.z * local5.m22; if(local6 < param3 && local6 > -param3) { return -1; } var local7:Number = param1.x - local5.m03; var local8:Number = param1.y - local5.m13; var local9:Number = param1.z - local5.m23; var local10:Number = local7 * local5.m02 + local8 * local5.m12 + local9 * local5.m22; var local11:Number = -local10 / local6; if(local11 < 0) { return -1; } var local12:Number = local7 * local5.m00 + local8 * local5.m10 + local9 * local5.m20; var local13:Number = local7 * local5.m01 + local8 * local5.m11 + local9 * local5.m21; local7 = local12 + local11 * (param2.x * local5.m00 + param2.y * local5.m10 + param2.z * local5.m20); local8 = local13 + local11 * (param2.x * local5.m01 + param2.y * local5.m11 + param2.z * local5.m21); if(this.e0.x * (local8 - this.v0.y) - this.e0.y * (local7 - this.v0.x) < 0 || this.e1.x * (local8 - this.v1.y) - this.e1.y * (local7 - this.v1.x) < 0 || this.e2.x * (local8 - this.v2.y) - this.e2.y * (local7 - this.v2.x) < 0) { return -1; } if(param2.x * local5.m02 + param2.y * local5.m12 + param2.z * local5.m22 > 0) { param4.x = -local5.m02; param4.y = -local5.m12; param4.z = -local5.m22; } else { param4.x = local5.m02; param4.y = local5.m12; param4.z = local5.m22; } return local11; } override public function copyFrom(param1:CollisionShape) : CollisionShape { super.copyFrom(param1); var local2:CollisionTriangle = param1 as CollisionTriangle; if(local2 != null) { this.v0.copy(local2.v0); this.v1.copy(local2.v1); this.v2.copy(local2.v2); this.e0.copy(local2.e0); this.e1.copy(local2.e1); this.e2.copy(local2.e2); } return this; } override protected function createPrimitive() : CollisionShape { return new CollisionTriangle(this.v0,this.v1,this.v2,collisionGroup,material); } private function initVertices(param1:Vector3, param2:Vector3, param3:Vector3) : void { this.v0.copy(param1); this.v1.copy(param2); this.v2.copy(param3); this.e0.diff(param2,param1); this.e0.normalize(); this.e1.diff(param3,param2); this.e1.normalize(); this.e2.diff(param1,param3); this.e2.normalize(); } } }
package alternativa.tanks.physics { import alternativa.math.Matrix3; import alternativa.math.Vector3; import alternativa.physics.Body; import alternativa.physics.BodyContact; import alternativa.physics.ShapeContact; import alternativa.physics.collision.Collider; import alternativa.physics.collision.CollisionDetector; import alternativa.physics.collision.CollisionKdNode; import alternativa.physics.collision.CollisionKdTree; import alternativa.physics.collision.CollisionShape; import alternativa.physics.collision.IRayCollisionFilter; import alternativa.physics.collision.colliders.BoxBoxCollider; import alternativa.physics.collision.colliders.BoxRectCollider; import alternativa.physics.collision.colliders.BoxSphereCollider; import alternativa.physics.collision.colliders.BoxTriangleCollider; import alternativa.physics.collision.types.AABB; import alternativa.physics.collision.types.RayHit; import alternativa.tanks.battle.objects.tank.Tank; public class TanksCollisionDetector implements CollisionDetector { private static const AABB_INTERSECTION_EPSILON:Number = 0.01; private const colliders:Object = {}; private const _rayHit:RayHit = new RayHit(); private const _time:MinMax = new MinMax(); private const _normal:Vector3 = new Vector3(); private const _o:Vector3 = new Vector3(); private const _dynamicRayHit:RayHit = new RayHit(); private const _rayAABB:AABB = new AABB(); private const shapeContacts:Vector.<ShapeContact> = new Vector.<ShapeContact>(); private var tree:CollisionKdTree = new CollisionKdTree(); private var threshold:Number = 0.0001; private var tankBodies:Vector.<TankBody> = new Vector.<TankBody>(); private var staticBody:Body; public function TanksCollisionDetector() { super(); var local1:Number = 0.000001; this.setCollider(CollisionShape.BOX,CollisionShape.BOX,new BoxBoxCollider(local1)); this.setCollider(CollisionShape.BOX,CollisionShape.RECT,new BoxRectCollider(local1)); this.setCollider(CollisionShape.BOX,CollisionShape.TRIANGLE,new BoxTriangleCollider(local1)); this.setCollider(CollisionShape.BOX,CollisionShape.SPHERE,new BoxSphereCollider()); this.createStaticBody(); } private function setCollider(param1:int, param2:int, param3:Collider) : void { this.colliders[param1 | param2] = param3; } private function createStaticBody() : void { this.staticBody = new Body(1,new Matrix3(),10000000000); this.staticBody.movable = false; } public function buildKdTree(param1:Vector.<CollisionShape>, param2:AABB = null) : void { var local3:CollisionShape = null; for each(local3 in param1) { local3.body = this.staticBody; } this.tree.createTree(param1,param2); } public function addTankBody(param1:TankBody) : void { param1.hasContactsWithStatic = false; this.tankBodies.push(param1); } public function removeTankBody(param1:TankBody) : void { var local3:int = 0; var local2:int = int(this.tankBodies.indexOf(param1)); if(local2 > -1) { local3 = this.tankBodies.length - 1; this.tankBodies[local2] = this.tankBodies[local3]; this.tankBodies.length = local3; } } public function getTankBodies() : Vector.<TankBody> { return this.tankBodies; } public function getBodyContacts(param1:Vector.<BodyContact>) : void { var local4:TankBody = null; var local5:Tank = null; var local6:int = 0; var local2:int = int(this.tankBodies.length); var local3:int = 0; while(local3 < local2) { local4 = this.tankBodies[local3]; local4.wasContactWithStatic = local4.hasContactsWithStatic; local5 = local4.body.tank; local4.hasContactsWithStatic = local5.hasTracksContactsWithStatic(); local4.penetratedBodies.length = 0; local3++; } local3 = 0; while(local3 < local2) { local4 = this.tankBodies[local3]; local6 = int(param1.length); this.getContactsWithStatic(local4,param1); if(local6 != param1.length) { local4.hasContactsWithStatic = true; } local6 = int(param1.length); this.getContactsWithOtherBodies(local4,local3 + 1,param1); local3++; } } public function getShapeContactsWithStatic(param1:CollisionShape, param2:Vector.<ShapeContact>) : void { return this.getShapeNodeCollisions(this.tree.rootNode,param1,param2); } private function getContactsWithStatic(param1:TankBody, param2:Vector.<BodyContact>) : void { var local3:int = 0; var local4:int = 0; var local5:BodyContact = null; if(!param1.body.frozen) { local3 = int(param1.staticShapes.length); local4 = 0; while(local4 < local3) { this.getShapeNodeCollisions(this.tree.rootNode,param1.staticShapes[local4],this.shapeContacts); local4++; } if(this.shapeContacts.length > 0) { local5 = BodyContact.create(); local5.body1 = param1.body; local5.body2 = this.staticBody; local5.setShapeContacts(this.shapeContacts); this.shapeContacts.length = 0; param2[param2.length] = local5; } } } private function getContactsWithOtherBodies(param1:TankBody, param2:int, param3:Vector.<BodyContact>) : void { var local6:TankBody = null; var local7:Body = null; var local8:Body = null; var local9:int = 0; var local10:Boolean = false; var local11:Boolean = false; var local12:BodyContact = null; var local13:int = 0; var local14:ShapeContact = null; var local4:int = int(this.tankBodies.length); var local5:int = param2; while(local5 < local4) { local6 = this.tankBodies[local5]; local7 = param1.body; local8 = local6.body; if(!(local7.frozen && local8.frozen) && local7.aabb.intersects(local8.aabb,AABB_INTERSECTION_EPSILON)) { this.getContacts(param1.tankCollisionBox,local6.tankCollisionBox,this.shapeContacts); local9 = int(this.shapeContacts.length); if(local9 > 0) { local10 = local7.postCollisionFilter == null || Boolean(local7.postCollisionFilter.considerBodies(local7,local8)); local11 = local8.postCollisionFilter == null || Boolean(local8.postCollisionFilter.considerBodies(local8,local7)); if(local10 && local11) { local12 = BodyContact.create(); local12.body1 = local7; local12.body2 = local8; local12.setShapeContacts(this.shapeContacts); param3[param3.length] = local12; param1.penetratedBodies.push(local8); local6.penetratedBodies.push(local7); } else { local13 = 0; while(local13 < local9) { local14 = this.shapeContacts[local13]; local14.dispose(); local13++; } } this.shapeContacts.length = 0; } } local5++; } } public function getContacts(param1:CollisionShape, param2:CollisionShape, param3:Vector.<ShapeContact>) : void { if((param1.collisionGroup & param2.collisionGroup) == 0) { return; } if(param1.body == param2.body) { return; } if(!param1.aabb.intersects(param2.aabb,AABB_INTERSECTION_EPSILON)) { return; } var local4:Collider = this.colliders[param1.type | param2.type]; local4.getContacts(param1,param2,param3); } public function testCollision(param1:CollisionShape, param2:CollisionShape) : Boolean { if((param1.collisionGroup & param2.collisionGroup) == 0) { return false; } if(param1.body == param2.body) { return false; } if(!param1.aabb.intersects(param2.aabb,AABB_INTERSECTION_EPSILON)) { return false; } var local3:Collider = this.colliders[param1.type | param2.type]; return local3.haveCollision(param1,param2); } public function raycast(param1:Vector3, param2:Vector3, param3:int, param4:Number, param5:IRayCollisionFilter, param6:RayHit) : Boolean { var local7:Boolean = this.raycastStatic(param1,param2,param3,param4,param5,param6); var local8:Boolean = this.raycastDynamic(param1,param2,param3,param4,param5,this._dynamicRayHit); if(!(local8 || local7)) { return false; } if(local8 && local7) { if(param6.t > this._dynamicRayHit.t) { param6.copy(this._dynamicRayHit); } this._dynamicRayHit.clear(); return true; } if(local7) { this._dynamicRayHit.clear(); return true; } param6.copy(this._dynamicRayHit); this._dynamicRayHit.clear(); return true; } public function raycastStatic(param1:Vector3, param2:Vector3, param3:int, param4:Number, param5:IRayCollisionFilter, param6:RayHit) : Boolean { if(!this.getRayBoundBoxIntersection(param1,param2,this.tree.rootNode.boundBox,this._time)) { return false; } if(this._time.max < 0 || this._time.min > param4) { return false; } if(this._time.min <= 0) { this._time.min = 0; this._o.x = param1.x; this._o.y = param1.y; this._o.z = param1.z; } else { this._o.x = param1.x + this._time.min * param2.x; this._o.y = param1.y + this._time.min * param2.y; this._o.z = param1.z + this._time.min * param2.z; } if(this._time.max > param4) { this._time.max = param4; } var local7:Boolean = this.testRayAgainstNode(this.tree.rootNode,param1,this._o,param2,param3,this._time.min,this._time.max,param5,param6); return local7 ? param6.t <= param4 : false; } public function hasStaticHit(param1:Vector3, param2:Vector3, param3:int, param4:Number, param5:IRayCollisionFilter = null) : Boolean { var local6:Boolean = this.raycastStatic(param1,param2,param3,param4,param5,this._rayHit); this._rayHit.clear(); return local6; } private function getShapeNodeCollisions(param1:CollisionKdNode, param2:CollisionShape, param3:Vector.<ShapeContact>) : void { var local4:Number = NaN; var local5:Number = NaN; var local6:Vector.<CollisionShape> = null; var local7:Vector.<int> = null; var local8:int = 0; var local9:int = 0; if(param1.indices != null) { local6 = this.tree.staticChildren; local7 = param1.indices; local8 = int(local7.length); local9 = 0; while(local9 < local8) { this.getContacts(param2,local6[local7[local9]],param3); local9++; } } if(param1.axis == -1) { return; } switch(param1.axis) { case 0: local4 = param2.aabb.minX; local5 = param2.aabb.maxX; break; case 1: local4 = param2.aabb.minY; local5 = param2.aabb.maxY; break; case 2: local4 = param2.aabb.minZ; local5 = param2.aabb.maxZ; } if(local4 < param1.coord) { this.getShapeNodeCollisions(param1.negativeNode,param2,param3); } if(local5 > param1.coord) { this.getShapeNodeCollisions(param1.positiveNode,param2,param3); } if(param1.splitTree != null && local4 < param1.coord && local5 > param1.coord) { this.getShapeNodeCollisions(param1.splitTree.rootNode,param2,param3); } } private function testShapeNodeCollision(param1:CollisionShape, param2:CollisionKdNode) : Boolean { var local3:Number = NaN; var local4:Number = NaN; var local5:Vector.<CollisionShape> = null; var local6:Vector.<int> = null; var local7:int = 0; var local8:int = 0; if(param2.indices != null) { local5 = this.tree.staticChildren; local6 = param2.indices; local7 = int(local6.length); local8 = 0; while(local8 < local7) { if(this.testCollision(param1,local5[local6[local8]])) { return true; } local8++; } } if(param2.axis == -1) { return false; } switch(param2.axis) { case 0: local3 = param1.aabb.minX; local4 = param1.aabb.maxX; break; case 1: local3 = param1.aabb.minY; local4 = param1.aabb.maxY; break; case 2: local3 = param1.aabb.minZ; local4 = param1.aabb.maxZ; } if(param2.splitTree != null && local3 < param2.coord && local4 > param2.coord) { if(this.testShapeNodeCollision(param1,param2.splitTree.rootNode)) { return true; } } if(local3 < param2.coord) { if(this.testShapeNodeCollision(param1,param2.negativeNode)) { return true; } } if(local4 > param2.coord) { if(this.testShapeNodeCollision(param1,param2.positiveNode)) { return true; } } return false; } private function raycastDynamic(param1:Vector3, param2:Vector3, param3:int, param4:Number, param5:IRayCollisionFilter, param6:RayHit) : Boolean { var local13:TankBody = null; var local14:Body = null; var local15:AABB = null; var local16:int = 0; var local17:CollisionShape = null; var local18:Number = NaN; var local7:Number = param1.x + param2.x * param4; var local8:Number = param1.y + param2.y * param4; var local9:Number = param1.z + param2.z * param4; if(local7 < param1.x) { this._rayAABB.minX = local7; this._rayAABB.maxX = param1.x; } else { this._rayAABB.minX = param1.x; this._rayAABB.maxX = local7; } if(local8 < param1.y) { this._rayAABB.minY = local8; this._rayAABB.maxY = param1.y; } else { this._rayAABB.minY = param1.y; this._rayAABB.maxY = local8; } if(local9 < param1.z) { this._rayAABB.minZ = local9; this._rayAABB.maxZ = param1.z; } else { this._rayAABB.minZ = param1.z; this._rayAABB.maxZ = local9; } var local10:Number = param4 + 1; var local11:int = int(this.tankBodies.length); var local12:int = 0; while(local12 < local11) { local13 = this.tankBodies[local12]; local14 = local13.body; local15 = local14.aabb; if(!(this._rayAABB.maxX < local15.minX || this._rayAABB.minX > local15.maxX || this._rayAABB.maxY < local15.minY || this._rayAABB.minY > local15.maxY || this._rayAABB.maxZ < local15.minZ || this._rayAABB.minZ > local15.maxZ)) { local16 = 0; while(local16 < local14.numCollisionShapes) { local17 = local14.collisionShapes[local16]; if((local17.collisionGroup & param3) != 0) { local15 = local17.aabb; if(!(this._rayAABB.maxX < local15.minX || this._rayAABB.minX > local15.maxX || this._rayAABB.maxY < local15.minY || this._rayAABB.minY > local15.maxY || this._rayAABB.maxZ < local15.minZ || this._rayAABB.minZ > local15.maxZ)) { if(!(param5 != null && !param5.considerBody(local14))) { local18 = local17.raycast(param1,param2,this.threshold,this._normal); if(local18 >= 0 && local18 < local10) { local10 = local18; param6.shape = local17; param6.normal.x = this._normal.x; param6.normal.y = this._normal.y; param6.normal.z = this._normal.z; } } } } local16++; } } local12++; } if(local10 > param4) { return false; } param6.position.x = param1.x + param2.x * local10; param6.position.y = param1.y + param2.y * local10; param6.position.z = param1.z + param2.z * local10; param6.t = local10; return true; } private function getRayBoundBoxIntersection(param1:Vector3, param2:Vector3, param3:AABB, param4:MinMax) : Boolean { var local5:Number = NaN; var local6:Number = NaN; param4.min = -1; param4.max = 1e+308; var local7:int = 0; for(; local7 < 3; local7++) { switch(local7) { case 0: if(!(param2.x < this.threshold && param2.x > -this.threshold)) { local5 = (param3.minX - param1.x) / param2.x; local6 = (param3.maxX - param1.x) / param2.x; break; } if(param1.x < param3.minX || param1.x > param3.maxX) { return false; } continue; case 1: if(!(param2.y < this.threshold && param2.y > -this.threshold)) { local5 = (param3.minY - param1.y) / param2.y; local6 = (param3.maxY - param1.y) / param2.y; break; } if(param1.y < param3.minY || param1.y > param3.maxY) { return false; } continue; case 2: if(!(param2.z < this.threshold && param2.z > -this.threshold)) { local5 = (param3.minZ - param1.z) / param2.z; local6 = (param3.maxZ - param1.z) / param2.z; break; } if(param1.z < param3.minZ || param1.z > param3.maxZ) { return false; } continue; } if(local5 < local6) { if(local5 > param4.min) { param4.min = local5; } if(local6 < param4.max) { param4.max = local6; } } else { if(local6 > param4.min) { param4.min = local6; } if(local5 < param4.max) { param4.max = local5; } } if(param4.max < param4.min) { return false; } } return true; } private function testRayAgainstNode(param1:CollisionKdNode, param2:Vector3, param3:Vector3, param4:Vector3, param5:int, param6:Number, param7:Number, param8:IRayCollisionFilter, param9:RayHit) : Boolean { var local10:Number = NaN; var local11:CollisionKdNode = null; var local12:Boolean = false; var local13:CollisionKdNode = null; var local14:int = 0; var local15:int = 0; var local16:CollisionShape = null; if(param1.indices != null && this.getRayNodeIntersection(param2,param4,param5,this.tree.staticChildren,param1.indices,param8,param9)) { return true; } if(param1.axis == -1) { return false; } switch(param1.axis) { case 0: if(param4.x > -this.threshold && param4.x < this.threshold) { local10 = param7 + 1; } else { local10 = (param1.coord - param2.x) / param4.x; } local11 = param3.x < param1.coord ? param1.negativeNode : param1.positiveNode; break; case 1: if(param4.y > -this.threshold && param4.y < this.threshold) { local10 = param7 + 1; } else { local10 = (param1.coord - param2.y) / param4.y; } local11 = param3.y < param1.coord ? param1.negativeNode : param1.positiveNode; break; case 2: if(param4.z > -this.threshold && param4.z < this.threshold) { local10 = param7 + 1; } else { local10 = (param1.coord - param2.z) / param4.z; } local11 = param3.z < param1.coord ? param1.negativeNode : param1.positiveNode; } if(local10 < param6 || local10 > param7) { return this.testRayAgainstNode(local11,param2,param3,param4,param5,param6,param7,param8,param9); } local12 = this.testRayAgainstNode(local11,param2,param3,param4,param5,param6,local10,param8,param9); if(local12) { return true; } this._o.x = param2.x + local10 * param4.x; this._o.y = param2.y + local10 * param4.y; this._o.z = param2.z + local10 * param4.z; if(param1.splitTree != null) { local13 = param1.splitTree.rootNode; while(local13 != null && local13.axis != -1) { switch(local13.axis) { case 0: local13 = this._o.x < local13.coord ? local13.negativeNode : local13.positiveNode; break; case 1: local13 = this._o.y < local13.coord ? local13.negativeNode : local13.positiveNode; break; case 2: local13 = this._o.z < local13.coord ? local13.negativeNode : local13.positiveNode; break; } } if(local13 != null && local13.indices != null) { local14 = int(local13.indices.length); local15 = 0; while(local15 < local14) { local16 = this.tree.staticChildren[local13.indices[local15]]; if((local16.collisionGroup & param5) != 0) { if(!(param8 != null && !param8.considerBody(local16.body))) { param9.t = local16.raycast(param2,param4,this.threshold,param9.normal); if(param9.t >= 0) { param9.position.copy(this._o); param9.shape = local16; return true; } } } local15++; } } } return this.testRayAgainstNode(local11 == param1.negativeNode ? param1.positiveNode : param1.negativeNode,param2,this._o,param4,param5,local10,param7,param8,param9); } private function getRayNodeIntersection(param1:Vector3, param2:Vector3, param3:int, param4:Vector.<CollisionShape>, param5:Vector.<int>, param6:IRayCollisionFilter, param7:RayHit) : Boolean { var local11:CollisionShape = null; var local12:Number = NaN; var local8:int = int(param5.length); var local9:Number = 1e+308; var local10:int = 0; while(local10 < local8) { local11 = param4[param5[local10]]; if((local11.collisionGroup & param3) != 0) { if(!(param6 != null && !param6.considerBody(local11.body))) { local12 = local11.raycast(param1,param2,this.threshold,this._normal); if(local12 > 0 && local12 < local9) { local9 = local12; param7.shape = local11; param7.normal.x = this._normal.x; param7.normal.y = this._normal.y; param7.normal.z = this._normal.z; } } } local10++; } if(local9 == 1e+308) { return false; } param7.position.x = param1.x + param2.x * local9; param7.position.y = param1.y + param2.y * local9; param7.position.z = param1.z + param2.z * local9; param7.t = local9; return true; } public function testStaticCollision(param1:CollisionShape) : Boolean { return this.testShapeNodeCollision(param1,this.tree.rootNode); } public function destroy() : void { var local1:TankBody = null; this.tree.destroyTree(); this.tree = null; for each(local1 in this.tankBodies) { local1.destroy(); } this.tankBodies.length = 0; this.staticBody = null; } } }
package alternativa.physics { import alternativa.math.Matrix3; import alternativa.math.Matrix4; import alternativa.math.Quaternion; import alternativa.math.Vector3; import alternativa.physics.collision.CollisionPrimitive; import alternativa.physics.collision.IBodyCollisionPredicate; import alternativa.physics.collision.types.BoundBox; use namespace altphysics; public class Body { public static var linDamping:Number = 0.997; public static var rotDamping:Number = 0.997; private static var _r:Vector3 = new Vector3(); private static var _f:Vector3 = new Vector3(); public var id:int; public var name:String; public var world:PhysicsScene; public var movable:Boolean = true; public var canFreeze:Boolean = false; public var freezeCounter:int; public var frozen:Boolean = false; public var aabb:BoundBox; public var postCollisionPredicate:IBodyCollisionPredicate; public var state:BodyState; public var prevState:BodyState; public var accel:Vector3; public var angleAccel:Vector3; public var material:BodyMaterial; public var invMass:Number = 1; public var invInertia:Matrix3; public var invInertiaWorld:Matrix3; public var baseMatrix:Matrix3; public const MAX_CONTACTS:int = 20; public var contacts:Vector.<Contact>; public var contactsNum:int; public var collisionPrimitives:CollisionPrimitiveList; public var forceAccum:Vector3; public var torqueAccum:Vector3; public function Body(invMass:Number, invInertia:Matrix3, localTank:Boolean = false) { this.aabb = new BoundBox(); this.prevState = new BodyState(); this.accel = new Vector3(); this.angleAccel = new Vector3(); this.material = new BodyMaterial(); this.invInertia = new Matrix3(); this.invInertiaWorld = new Matrix3(); this.baseMatrix = new Matrix3(); this.contacts = new Vector.<Contact>(this.MAX_CONTACTS); this.forceAccum = new Vector3(); this.torqueAccum = new Vector3(); super(); this.invMass = invMass; this.invInertia.copy(invInertia); this.state = new BodyState(localTank); } public function addCollisionPrimitive(primitive:CollisionPrimitive, localTransform:Matrix4 = null) : void { if(primitive == null) { throw new ArgumentError("Primitive cannot be null"); } if(this.collisionPrimitives == null) { this.collisionPrimitives = new CollisionPrimitiveList(); } this.collisionPrimitives.append(primitive); primitive.setBody(this,localTransform); } public function removeCollisionPrimitive(primitive:CollisionPrimitive) : void { if(this.collisionPrimitives == null) { return; } primitive.setBody(null); this.collisionPrimitives.remove(primitive); if(this.collisionPrimitives.size == 0) { this.collisionPrimitives = null; } } public function interpolate(t:Number, pos:Vector3, orientation:Quaternion) : void { var t1:Number = NaN; t1 = NaN; t1 = 1 - t; pos.x = this.prevState.pos.x * t1 + this.state.pos.x * t; pos.y = this.prevState.pos.y * t1 + this.state.pos.y * t; pos.z = this.prevState.pos.z * t1 + this.state.pos.z * t; orientation.w = this.prevState.orientation.w * t1 + this.state.orientation.w * t; orientation.x = this.prevState.orientation.x * t1 + this.state.orientation.x * t; orientation.y = this.prevState.orientation.y * t1 + this.state.orientation.y * t; orientation.z = this.prevState.orientation.z * t1 + this.state.orientation.z * t; } public function setPosition(pos:Vector3) : void { this.state.pos.vCopy(pos); } public function setPositionXYZ(x:Number, y:Number, z:Number) : void { this.state.pos.vReset(x,y,z); } public function setVelocity(vel:Vector3) : void { this.state.velocity.vCopy(vel); } public function setVelocityXYZ(x:Number, y:Number, z:Number) : void { this.state.velocity.vReset(x,y,z); } public function setRotation(rot:Vector3) : void { this.state.rotation.vCopy(rot); } public function setRotationXYZ(x:Number, y:Number, z:Number) : void { this.state.rotation.vReset(x,y,z); } public function setOrientation(q:Quaternion) : void { this.state.orientation.copy(q); } public function applyRelPosWorldImpulse(r:Vector3, dir:Vector3, magnitude:Number) : void { var d:Number = NaN; var x:Number = NaN; var z:Number = NaN; d = NaN; x = NaN; z = NaN; d = magnitude * this.invMass; this.state.velocity.x += d * dir.x; this.state.velocity.y += d * dir.y; this.state.velocity.z += d * dir.z; x = (r.y * dir.z - r.z * dir.y) * magnitude; var y:Number = (r.z * dir.x - r.x * dir.z) * magnitude; z = (r.x * dir.y - r.y * dir.x) * magnitude; this.state.rotation.x += this.invInertiaWorld.a * x + this.invInertiaWorld.b * y + this.invInertiaWorld.c * z; this.state.rotation.y += this.invInertiaWorld.e * x + this.invInertiaWorld.f * y + this.invInertiaWorld.g * z; this.state.rotation.z += this.invInertiaWorld.i * x + this.invInertiaWorld.j * y + this.invInertiaWorld.k * z; } public function addForce(f:Vector3) : void { this.forceAccum.vAdd(f); } public function addForceXYZ(fx:Number, fy:Number, fz:Number) : void { this.forceAccum.x += fx; this.forceAccum.y += fy; this.forceAccum.z += fz; } public function addWorldForceXYZ(px:Number, py:Number, pz:Number, fx:Number, fy:Number, fz:Number) : void { this.forceAccum.x += fx; this.forceAccum.y += fy; this.forceAccum.z += fz; var pos:Vector3 = this.state.pos; var rx:Number = px - pos.x; var ry:Number = py - pos.y; var rz:Number = pz - pos.z; this.torqueAccum.x += ry * fz - rz * fy; this.torqueAccum.y += rz * fx - rx * fz; this.torqueAccum.z += rx * fy - ry * fx; } public function addWorldForce(pos:Vector3, force:Vector3) : void { this.forceAccum.vAdd(force); this.torqueAccum.vAdd(_r.vDiff(pos,this.state.pos).vCross(force)); } public function addWorldForceScaled(pos:Vector3, force:Vector3, scale:Number) : void { _f.x = scale * force.x; _f.y = scale * force.y; _f.z = scale * force.z; this.forceAccum.vAdd(_f); this.torqueAccum.vAdd(_r.vDiff(pos,this.state.pos).vCross(_f)); } public function addLocalForce(pos:Vector3, force:Vector3) : void { this.baseMatrix.transformVector(pos,_r); this.baseMatrix.transformVector(force,_f); this.forceAccum.vAdd(_f); this.torqueAccum.vAdd(_r.vCross(_f)); } public function addWorldForceAtLocalPoint(localPos:Vector3, worldForce:Vector3) : void { this.baseMatrix.transformVector(localPos,_r); this.forceAccum.vAdd(worldForce); this.torqueAccum.vAdd(_r.vCross(worldForce)); } public function beforePhysicsStep(dt:Number) : void { } public function addTorque(t:Vector3) : void { this.torqueAccum.vAdd(t); } altphysics function clearAccumulators() : void { this.forceAccum.x = this.forceAccum.y = this.forceAccum.z = 0; this.torqueAccum.x = this.torqueAccum.y = this.torqueAccum.z = 0; } altphysics function calcAccelerations() : void { this.accel.x = this.forceAccum.x * this.invMass; this.accel.y = this.forceAccum.y * this.invMass; this.accel.z = this.forceAccum.z * this.invMass; this.angleAccel.x = this.invInertiaWorld.a * this.torqueAccum.x + this.invInertiaWorld.b * this.torqueAccum.y + this.invInertiaWorld.c * this.torqueAccum.z; this.angleAccel.y = this.invInertiaWorld.e * this.torqueAccum.x + this.invInertiaWorld.f * this.torqueAccum.y + this.invInertiaWorld.g * this.torqueAccum.z; this.angleAccel.z = this.invInertiaWorld.i * this.torqueAccum.x + this.invInertiaWorld.j * this.torqueAccum.y + this.invInertiaWorld.k * this.torqueAccum.z; } public function calcDerivedData() : void { var item:CollisionPrimitiveListItem = null; var primitive:CollisionPrimitive = null; this.state.orientation.toMatrix3(this.baseMatrix); this.invInertiaWorld.copy(this.invInertia).append(this.baseMatrix).prependTransposed(this.baseMatrix); if(this.collisionPrimitives != null) { this.aabb.infinity(); item = this.collisionPrimitives.head; while(item != null) { primitive = item.primitive; primitive.transform.setFromMatrix3(this.baseMatrix,this.state.pos); if(primitive.localTransform != null) { primitive.transform.prepend(primitive.localTransform); } primitive.calculateAABB(); this.aabb.addBoundBox(primitive.aabb); item = item.next; } } } altphysics function saveState() : void { this.prevState.copy(this.state); } altphysics function restoreState() : void { this.state.copy(this.prevState); } altphysics function integrateVelocity(dt:Number) : void { this.state.velocity.x += this.accel.x * dt; this.state.velocity.y += this.accel.y * dt; this.state.velocity.z += this.accel.z * dt; this.state.rotation.x += this.angleAccel.x * dt; this.state.rotation.y += this.angleAccel.y * dt; this.state.rotation.z += this.angleAccel.z * dt; this.state.velocity.x *= linDamping; this.state.velocity.y *= linDamping; this.state.velocity.z *= linDamping; this.state.rotation.x *= rotDamping; this.state.rotation.y *= rotDamping; this.state.rotation.z *= rotDamping; } altphysics function integratePosition(dt:Number) : void { this.state.pos.x += this.state.velocity.x * dt; this.state.pos.y += this.state.velocity.y * dt; this.state.pos.z += this.state.velocity.z * dt; this.state.orientation.addScaledVector(this.state.rotation,dt); } } }
package alternativa.tanks.utils { import alternativa.physics.collision.primitives.CollisionBox; public class StaticCollisionBoxValidator extends StaticCollisionPrimitiveValidator { private var vectorValidator:Vector3Validator; public function StaticCollisionBoxValidator(param1:CollisionBox) { super(param1); this.vectorValidator = new Vector3Validator(param1.hs); } override public function hasIncorrectData() : Boolean { return super.hasIncorrectData() || this.vectorValidator.isInvalid(); } } }
package projects.tanks.client.battlefield.models.tankparts.weapon.gauss { import alternativa.osgi.OSGi; import alternativa.protocol.ICodec; import alternativa.protocol.IProtocol; import alternativa.protocol.OptionalMap; import alternativa.protocol.ProtocolBuffer; import alternativa.protocol.info.TypeCodecInfo; import alternativa.types.Long; import flash.utils.ByteArray; import platform.client.fp10.core.model.IModel; import platform.client.fp10.core.model.impl.Model; import platform.client.fp10.core.network.command.SpaceCommand; import platform.client.fp10.core.type.IGameObject; import platform.client.fp10.core.type.ISpace; import projects.tanks.client.battlefield.types.Vector3d; public class GaussModelServer { private var protocol:IProtocol; private var protocolBuffer:ProtocolBuffer; private var _dummyShotCommandId:Long = Long.getLong(1849472538,1291058021); private var _dummyShotCommand_clientTimeCodec:ICodec; private var _primaryHitStaticCommandId:Long = Long.getLong(922383116,1651838310); private var _primaryHitStaticCommand_clientTimeCodec:ICodec; private var _primaryHitStaticCommand_shotIdCodec:ICodec; private var _primaryHitStaticCommand_hitPointWorldCodec:ICodec; private var _primaryHitTargetCommandId:Long = Long.getLong(848229176,-171315735); private var _primaryHitTargetCommand_clientTimeCodec:ICodec; private var _primaryHitTargetCommand_shotIdCodec:ICodec; private var _primaryHitTargetCommand_targetCodec:ICodec; private var _primaryHitTargetCommand_targetPositionCodec:ICodec; private var _primaryHitTargetCommand_hitPointWorldCodec:ICodec; private var _primaryShotCommandId:Long = Long.getLong(693669628,-864971393); private var _primaryShotCommand_clientTimeCodec:ICodec; private var _primaryShotCommand_shotIdCodec:ICodec; private var _primaryShotCommand_shotDirectionCodec:ICodec; private var _secondaryHitTargetCommandId:Long = Long.getLong(128655614,-748587511); private var _secondaryHitTargetCommand_clientTimeCodec:ICodec; private var _secondaryHitTargetCommand_targetCodec:ICodec; private var _secondaryHitTargetCommand_targetPositionCodec:ICodec; private var _secondaryHitTargetCommand_localHitPositionCodec:ICodec; private var _secondaryHitTargetCommand_worldHitPositionCodec:ICodec; private var _startAimingId:Long = Long.getLong(1529985580,1009791181); private var _startAiming_clientTimeCodec:ICodec; private var _stopAimingId:Long = Long.getLong(603543791,36139025); private var _stopAiming_clientTimeCodec:ICodec; private var model:IModel; public function GaussModelServer(param1:IModel) { super(); this.model = param1; var local2:ByteArray = new ByteArray(); this.protocol = IProtocol(OSGi.getInstance().getService(IProtocol)); this.protocolBuffer = new ProtocolBuffer(local2,local2,new OptionalMap()); this._dummyShotCommand_clientTimeCodec = this.protocol.getCodec(new TypeCodecInfo(int,false)); this._primaryHitStaticCommand_clientTimeCodec = this.protocol.getCodec(new TypeCodecInfo(int,false)); this._primaryHitStaticCommand_shotIdCodec = this.protocol.getCodec(new TypeCodecInfo(int,false)); this._primaryHitStaticCommand_hitPointWorldCodec = this.protocol.getCodec(new TypeCodecInfo(Vector3d,false)); this._primaryHitTargetCommand_clientTimeCodec = this.protocol.getCodec(new TypeCodecInfo(int,false)); this._primaryHitTargetCommand_shotIdCodec = this.protocol.getCodec(new TypeCodecInfo(int,false)); this._primaryHitTargetCommand_targetCodec = this.protocol.getCodec(new TypeCodecInfo(IGameObject,false)); this._primaryHitTargetCommand_targetPositionCodec = this.protocol.getCodec(new TypeCodecInfo(Vector3d,false)); this._primaryHitTargetCommand_hitPointWorldCodec = this.protocol.getCodec(new TypeCodecInfo(Vector3d,false)); this._primaryShotCommand_clientTimeCodec = this.protocol.getCodec(new TypeCodecInfo(int,false)); this._primaryShotCommand_shotIdCodec = this.protocol.getCodec(new TypeCodecInfo(int,false)); this._primaryShotCommand_shotDirectionCodec = this.protocol.getCodec(new TypeCodecInfo(Vector3d,false)); this._secondaryHitTargetCommand_clientTimeCodec = this.protocol.getCodec(new TypeCodecInfo(int,false)); this._secondaryHitTargetCommand_targetCodec = this.protocol.getCodec(new TypeCodecInfo(IGameObject,false)); this._secondaryHitTargetCommand_targetPositionCodec = this.protocol.getCodec(new TypeCodecInfo(Vector3d,false)); this._secondaryHitTargetCommand_localHitPositionCodec = this.protocol.getCodec(new TypeCodecInfo(Vector3d,false)); this._secondaryHitTargetCommand_worldHitPositionCodec = this.protocol.getCodec(new TypeCodecInfo(Vector3d,false)); this._startAiming_clientTimeCodec = this.protocol.getCodec(new TypeCodecInfo(int,false)); this._stopAiming_clientTimeCodec = this.protocol.getCodec(new TypeCodecInfo(int,false)); } public function dummyShotCommand(param1:int) : void { ByteArray(this.protocolBuffer.writer).position = 0; ByteArray(this.protocolBuffer.writer).length = 0; this._dummyShotCommand_clientTimeCodec.encode(this.protocolBuffer,param1); ByteArray(this.protocolBuffer.writer).position = 0; if(Model.object == null) { throw new Error("Execute method without model context."); } var local2:SpaceCommand = new SpaceCommand(Model.object.id,this._dummyShotCommandId,this.protocolBuffer); var local3:IGameObject = Model.object; var local4:ISpace = local3.space; local4.commandSender.sendCommand(local2); this.protocolBuffer.optionalMap.clear(); } public function primaryHitStaticCommand(param1:int, param2:int, param3:Vector3d) : void { ByteArray(this.protocolBuffer.writer).position = 0; ByteArray(this.protocolBuffer.writer).length = 0; this._primaryHitStaticCommand_clientTimeCodec.encode(this.protocolBuffer,param1); this._primaryHitStaticCommand_shotIdCodec.encode(this.protocolBuffer,param2); this._primaryHitStaticCommand_hitPointWorldCodec.encode(this.protocolBuffer,param3); ByteArray(this.protocolBuffer.writer).position = 0; if(Model.object == null) { throw new Error("Execute method without model context."); } var local4:SpaceCommand = new SpaceCommand(Model.object.id,this._primaryHitStaticCommandId,this.protocolBuffer); var local5:IGameObject = Model.object; var local6:ISpace = local5.space; local6.commandSender.sendCommand(local4); this.protocolBuffer.optionalMap.clear(); } public function primaryHitTargetCommand(param1:int, param2:int, param3:IGameObject, param4:Vector3d, param5:Vector3d) : void { ByteArray(this.protocolBuffer.writer).position = 0; ByteArray(this.protocolBuffer.writer).length = 0; this._primaryHitTargetCommand_clientTimeCodec.encode(this.protocolBuffer,param1); this._primaryHitTargetCommand_shotIdCodec.encode(this.protocolBuffer,param2); this._primaryHitTargetCommand_targetCodec.encode(this.protocolBuffer,param3); this._primaryHitTargetCommand_targetPositionCodec.encode(this.protocolBuffer,param4); this._primaryHitTargetCommand_hitPointWorldCodec.encode(this.protocolBuffer,param5); ByteArray(this.protocolBuffer.writer).position = 0; if(Model.object == null) { throw new Error("Execute method without model context."); } var local6:SpaceCommand = new SpaceCommand(Model.object.id,this._primaryHitTargetCommandId,this.protocolBuffer); var local7:IGameObject = Model.object; var local8:ISpace = local7.space; local8.commandSender.sendCommand(local6); this.protocolBuffer.optionalMap.clear(); } public function primaryShotCommand(param1:int, param2:int, param3:Vector3d) : void { ByteArray(this.protocolBuffer.writer).position = 0; ByteArray(this.protocolBuffer.writer).length = 0; this._primaryShotCommand_clientTimeCodec.encode(this.protocolBuffer,param1); this._primaryShotCommand_shotIdCodec.encode(this.protocolBuffer,param2); this._primaryShotCommand_shotDirectionCodec.encode(this.protocolBuffer,param3); ByteArray(this.protocolBuffer.writer).position = 0; if(Model.object == null) { throw new Error("Execute method without model context."); } var local4:SpaceCommand = new SpaceCommand(Model.object.id,this._primaryShotCommandId,this.protocolBuffer); var local5:IGameObject = Model.object; var local6:ISpace = local5.space; local6.commandSender.sendCommand(local4); this.protocolBuffer.optionalMap.clear(); } public function secondaryHitTargetCommand(param1:int, param2:IGameObject, param3:Vector3d, param4:Vector3d, param5:Vector3d) : void { ByteArray(this.protocolBuffer.writer).position = 0; ByteArray(this.protocolBuffer.writer).length = 0; this._secondaryHitTargetCommand_clientTimeCodec.encode(this.protocolBuffer,param1); this._secondaryHitTargetCommand_targetCodec.encode(this.protocolBuffer,param2); this._secondaryHitTargetCommand_targetPositionCodec.encode(this.protocolBuffer,param3); this._secondaryHitTargetCommand_localHitPositionCodec.encode(this.protocolBuffer,param4); this._secondaryHitTargetCommand_worldHitPositionCodec.encode(this.protocolBuffer,param5); ByteArray(this.protocolBuffer.writer).position = 0; if(Model.object == null) { throw new Error("Execute method without model context."); } var local6:SpaceCommand = new SpaceCommand(Model.object.id,this._secondaryHitTargetCommandId,this.protocolBuffer); var local7:IGameObject = Model.object; var local8:ISpace = local7.space; local8.commandSender.sendCommand(local6); this.protocolBuffer.optionalMap.clear(); } public function startAiming(param1:int) : void { ByteArray(this.protocolBuffer.writer).position = 0; ByteArray(this.protocolBuffer.writer).length = 0; this._startAiming_clientTimeCodec.encode(this.protocolBuffer,param1); ByteArray(this.protocolBuffer.writer).position = 0; if(Model.object == null) { throw new Error("Execute method without model context."); } var local2:SpaceCommand = new SpaceCommand(Model.object.id,this._startAimingId,this.protocolBuffer); var local3:IGameObject = Model.object; var local4:ISpace = local3.space; local4.commandSender.sendCommand(local2); this.protocolBuffer.optionalMap.clear(); } public function stopAiming(param1:int) : void { ByteArray(this.protocolBuffer.writer).position = 0; ByteArray(this.protocolBuffer.writer).length = 0; this._stopAiming_clientTimeCodec.encode(this.protocolBuffer,param1); ByteArray(this.protocolBuffer.writer).position = 0; if(Model.object == null) { throw new Error("Execute method without model context."); } var local2:SpaceCommand = new SpaceCommand(Model.object.id,this._stopAimingId,this.protocolBuffer); var local3:IGameObject = Model.object; var local4:ISpace = local3.space; local4.commandSender.sendCommand(local2); this.protocolBuffer.optionalMap.clear(); } } }
package projects.tanks.client.clans.space.createclan { public class ClanCreateCC { private var _minRankForCreateClan:int; public function ClanCreateCC(param1:int = 0) { super(); this._minRankForCreateClan = param1; } public function get minRankForCreateClan() : int { return this._minRankForCreateClan; } public function set minRankForCreateClan(param1:int) : void { this._minRankForCreateClan = param1; } public function toString() : String { var local1:String = "ClanCreateCC ["; local1 += "minRankForCreateClan = " + this.minRankForCreateClan + " "; return local1 + "]"; } } }
package alternativa.tanks.models.battle.gui.chat { public class ChatEvent { public static const OPEN:int = 1; public static const CLOSE:int = 2; private var type:int; public function ChatEvent(param1:int) { super(); this.type = param1; } public function getType() : int { return this.type; } } }
package alternativa.tanks.materials { import alternativa.gfx.agal.VertexShader; public class PaintVertexShader extends VertexShader { public function PaintVertexShader(param1:Boolean, param2:Boolean, param3:Boolean, param4:Boolean, param5:Boolean, param6:Boolean, param7:Boolean, param8:Boolean, param9:Boolean, param10:Boolean) { super(); mov(vt0,vc[4]); if(param1) { dp4(vt0.x,va0,vc[0]); dp4(vt0.y,va0,vc[1]); dp4(vt0.z,va0,vc[2]); mul(v0,va1,vc[4]); mov(vt1,vc[4]); dp3(vt1.x,va1,vc[14]); dp3(vt1.y,va1,vc[15]); add(vt1.x,vt1.x,vc[14].z); add(vt1.y,vt1.y,vc[15].z); mov(v6,vt1); } else { mov(vt0.xyz,cc.rel(va0.x,0)); mov(vt1,cc.rel(va0.x,1)); mul(v0,vt1,vc[4]); mov(vt2,vc[4]); dp3(vt2.x,vt1,vc[14]); dp3(vt2.y,vt1,vc[15]); add(vt2.x,vt2.x,vc[14].z); add(vt2.y,vt2.y,vc[15].z); mov(v6,vt2); } if(param2 || param3) { mov(v1,vt0); } if(param3) { if(param1) { if(param4) { mul(vt1,va2,vc[11]); nrm(vt1.xyz,vt1.xyz); div(vt1,vt1,vc[11]); } else { mov(vt1,vc[4]); dp3(vt1.x,va2,vc[0]); dp3(vt1.y,va2,vc[1]); dp3(vt1.z,va2,vc[2]); } } else { mov(vt2,vc[4]); mov(vt2.x,cc.rel(va0.x,0).w); mov(vt2.y,cc.rel(va0.x,1).z); mov(vt2.z,cc.rel(va0.x,1).w); if(param4) { mul(vt1,vt2,vc[11]); nrm(vt1.xyz,vt1.xyz); div(vt1,vt1,vc[11]); } else { mov(vt1,vc[4]); dp3(vt1.x,vt2,vc[0]); dp3(vt1.y,vt2,vc[1]); dp3(vt1.z,vt2,vc[2]); } } dp3(vt1.w,vt1,vc[10]); if(param4) { sub(vt1.w,vc[4],vt1); mul(v1.w,vt1,vc[11]); } else { sub(v1.w,vc[4],vt1); } } else if(param5 || param6 || param9 || param10) { mov(vt1,vc[4]); } if(param5) { dp4(v2.x,vt0,vc[6]); dp4(v2.y,vt0,vc[7]); dp4(v2.z,vt0,vc[8]); sub(vt1.w,vt0.z,vc[9].x); div(vt1.w,vt1,vc[9].y); sub(v2.w,vc[4],vt1); } if(param6) { sub(vt1.w,vt0.z,vc[5].z); div(v0.w,vt1,vc[5]); } if(param8) { mov(vt1,vt0); mul(vt1.x,vt1,vc[11].w); mul(vt1.y,vt1,vc[12].w); sub(vt1,vt1,vc[11]); dp3(v0.z,vt1,vc[12]); } if(param7) { mul(vt0.xyz,vt0,vc[11]); } if(param9) { div(vt1.z,vc[3].w,vt0); add(vt1.z,vt1,vc[3]); mul(vt1.z,vt1,vc[3].x); sub(vt1.z,vt1,vc[3].y); div(vt1.z,vt1,vc[3].x); sub(vt1.z,vt1,vc[3]); div(vt1.z,vc[3].w,vt1); mov(vt2,vc[4]); nrm(vt2.xyz,vt0.xyz); sub(vt1.z,vt0,vt1); div(vt1.z,vt1,vt2); mul(vt2,vt2,vt1.z); sub(vt0,vt0,vt2); } if(param10) { mul(vt0.xy,vt0,vc[13]); mul(vt1.xy,vc[13].zw,vt0.z); add(vt0.xy,vt0,vt1); } mov(op.xw,vt0.xz); neg(op.y,vt0); mul(vt0.z,vt0,vc[3]); add(op.z,vt0,vc[3].w); } } }