code
stringlengths 57
237k
|
|---|
package projects.tanks.clients.fp10.libraries.tanksservices.service.matchmakinggroup {
import alternativa.types.Long;
import flash.events.IEventDispatcher;
public interface MatchmakingGroupService extends IEventDispatcher {
function isGroupInviteEnabled() : Boolean;
function enableGroupInvite() : void;
function disableGroupInvite() : void;
function inviteUserToGroup(param1:Long) : void;
function removeUserFromGroup(param1:Long) : void;
function addUser(param1:Long) : void;
function removeUser(param1:Long) : void;
function removeUsers() : void;
function isUserInGroup(param1:Long) : Boolean;
}
}
|
package controls.rangicons
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class RangIcon_p30 extends BitmapAsset
{
public function RangIcon_p30()
{
super();
}
}
}
|
package projects.tanks.clients.fp10.libraries.tanksservices.model.friends.battleinvite {
import platform.client.fp10.core.model.ObjectLoadListener;
import platform.client.fp10.core.model.ObjectUnloadListener;
import projects.tanks.client.users.model.switchbattleinvite.INotificationEnabledModelBase;
import projects.tanks.client.users.model.switchbattleinvite.NotificationEnabledModelBase;
import projects.tanks.clients.fp10.libraries.tanksservices.model.IFriends;
import projects.tanks.clients.fp10.libraries.tanksservices.service.friend.battleinvite.BattleInviteEnableEvent;
import projects.tanks.clients.fp10.libraries.tanksservices.service.friend.battleinvite.IBattleInviteService;
[ModelInfo]
public class NotificationEnabledModel extends NotificationEnabledModelBase implements INotificationEnabledModelBase, ObjectLoadListener, ObjectUnloadListener {
[Inject]
public static var battleInviteService:IBattleInviteService;
public function NotificationEnabledModel() {
super();
}
public function objectLoaded() : void {
if(IFriends(object.adapt(IFriends)).isLocal()) {
battleInviteService.receiveBattleInvite = getInitParam().receiveBattleInvite;
battleInviteService.addEventListener(BattleInviteEnableEvent.UPDATE,getFunctionWrapper(this.onUpdateBattleInviteEnable));
}
}
private function onUpdateBattleInviteEnable(param1:BattleInviteEnableEvent) : void {
if(IFriends(object.adapt(IFriends)).isLocal()) {
server.enable(param1.enable);
}
}
public function objectUnloaded() : void {
if(IFriends(object.adapt(IFriends)).isLocal()) {
battleInviteService.removeEventListener(BattleInviteEnableEvent.UPDATE,getFunctionWrapper(this.onUpdateBattleInviteEnable));
}
}
}
}
|
package alternativa.tanks.camera.controllers.spectator {
import alternativa.math.Vector3;
import alternativa.tanks.camera.GameCamera;
public interface MovementMethod {
function getDisplacement(param1:UserInput, param2:GameCamera, param3:Number) : Vector3;
function invertAcceleration() : void;
function setAccelerationInverted(param1:Boolean) : void;
function accelerationInverted() : Boolean;
}
}
|
package com.alternativaplatform.projects.tanks.client.warfare.models.colortransform
{
public interface IColorTransformModelBase
{
}
}
|
package alternativa.tanks.gui.foreignclan {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.gui.foreignclan.ForeignClanWindow_bitmapKillsDeathsIcon.png")]
public class ForeignClanWindow_bitmapKillsDeathsIcon extends BitmapAsset {
public function ForeignClanWindow_bitmapKillsDeathsIcon() {
super();
}
}
}
|
package alternativa.engine3d.core {
import alternativa.gfx.agal.FragmentShader;
import alternativa.gfx.agal.SamplerDim;
import alternativa.gfx.agal.SamplerFilter;
import alternativa.gfx.agal.SamplerMipMap;
import alternativa.gfx.agal.SamplerRepeat;
public class DepthRendererLightFragmentShader extends FragmentShader {
public function DepthRendererLightFragmentShader(param1:int) {
super();
div(ft4,v0,v0.z);
mul(ft4,ft4,fc[4]);
add(ft4,ft4,fc[4]);
tex(ft0,ft4,fs0.dim(SamplerDim.D2).repeat(SamplerRepeat.CLAMP).filter(SamplerFilter.NEAREST).mipmap(SamplerMipMap.NONE));
mul(ft0.zw,ft0,fc[6]);
cos(ft1,ft0);
sin(ft2,ft0);
mul(ft1.x,ft1.w,ft1.z);
mul(ft1.y,ft2.w,ft1.z);
neg(ft1.z,ft2);
dp3(ft2.z,ft0,fc[0]);
mul(ft2.xy,ft4,fc[1]);
sub(ft2.xy,ft2,fc[2]);
mul(ft2.xy,ft2,ft2.z);
mul(ft2.xy,ft2,fc[3]);
if(param1 == 0) {
sub(ft3,v1,ft2);
dp3(ft3.w,ft3,ft3);
sqt(ft3.w,ft3);
div(ft3.xyz,ft3,ft3.w);
sub(ft3.w,v1,ft3);
mul(ft3.w,ft3,v2);
sat(ft3.w,ft3);
mul(ft3.w,ft3,ft3);
dp3(ft2.w,ft3,ft1);
max(ft2.w,ft2,fc[4]);
mul(ft3.w,ft3,ft2);
mul(ft0.xyz,v2,ft3.w);
} else {
if(param1 == 1) {
sub(ft3,v1,ft2);
dp3(ft3.w,ft3,ft3);
sqt(ft3.w,ft3);
div(ft3.xyz,ft3,ft3.w);
sub(ft3.w,v3.x,ft3);
mul(ft3.w,ft3,v3.y);
sat(ft3.w,ft3);
mul(ft3.w,ft3,ft3);
dp3(ft4.w,ft3,ft1);
max(ft4.w,ft4,fc[4]);
mul(ft3.w,ft3,ft4);
dp3(ft4.w,ft3,v2);
neg(ft4.w,ft4);
sub(ft4.w,ft4,v3.z);
mul(ft4.w,ft4,v3);
sat(ft4.w,ft4);
mul(ft4.w,ft4,ft4);
mul(ft3.w,ft3,ft4);
} else if(param1 == 2) {
sub(ft4,ft2,v1);
dp3(ft4.w,ft4,v2);
mul(ft4.xyz,v2,ft4.w);
add(ft4.xyz,v1,ft4);
abs(ft4.w,ft4);
sub(ft4.w,v3.z,ft4);
mul(ft4.w,ft4,v3);
sat(ft4.w,ft4);
mul(ft4.w,ft4,ft4);
sub(ft3,ft4,ft2);
dp3(ft3.w,ft3,ft3);
sqt(ft3.w,ft3);
div(ft3.xyz,ft3,ft3.w);
sub(ft3.w,v3.x,ft3);
mul(ft3.w,ft3,v3.y);
sat(ft3.w,ft3);
mul(ft3.w,ft3,ft3);
mul(ft3.w,ft3,ft4);
dp3(ft4.w,ft3,ft1);
max(ft4.w,ft4,fc[4]);
mul(ft3.w,ft3,ft4);
}
mul(ft0.xyz,v4,ft3.w);
}
mov(oc,ft0);
}
}
}
|
package projects.tanks.client.garage.models.garage {
import platform.client.fp10.core.resource.types.TextureResource;
import projects.tanks.client.commons.types.ItemCategoryEnum;
import projects.tanks.clients.flash.resources.resource.Tanks3DSResource;
public class GarageModelCC {
private var _cameraAltitude:Number;
private var _cameraDistance:Number;
private var _cameraFov:Number;
private var _cameraPitch:Number;
private var _garageBox:Tanks3DSResource;
private var _hideLinks:Boolean;
private var _mountableCategories:Vector.<ItemCategoryEnum>;
private var _skyboxBackSide:TextureResource;
private var _skyboxBottomSide:TextureResource;
private var _skyboxFrontSide:TextureResource;
private var _skyboxLeftSide:TextureResource;
private var _skyboxRightSide:TextureResource;
private var _skyboxTopSide:TextureResource;
public function GarageModelCC(param1:Number = 0, param2:Number = 0, param3:Number = 0, param4:Number = 0, param5:Tanks3DSResource = null, param6:Boolean = false, param7:Vector.<ItemCategoryEnum> = null, param8:TextureResource = null, param9:TextureResource = null, param10:TextureResource = null, param11:TextureResource = null, param12:TextureResource = null, param13:TextureResource = null) {
super();
this._cameraAltitude = param1;
this._cameraDistance = param2;
this._cameraFov = param3;
this._cameraPitch = param4;
this._garageBox = param5;
this._hideLinks = param6;
this._mountableCategories = param7;
this._skyboxBackSide = param8;
this._skyboxBottomSide = param9;
this._skyboxFrontSide = param10;
this._skyboxLeftSide = param11;
this._skyboxRightSide = param12;
this._skyboxTopSide = param13;
}
public function get cameraAltitude() : Number {
return this._cameraAltitude;
}
public function set cameraAltitude(param1:Number) : void {
this._cameraAltitude = param1;
}
public function get cameraDistance() : Number {
return this._cameraDistance;
}
public function set cameraDistance(param1:Number) : void {
this._cameraDistance = param1;
}
public function get cameraFov() : Number {
return this._cameraFov;
}
public function set cameraFov(param1:Number) : void {
this._cameraFov = param1;
}
public function get cameraPitch() : Number {
return this._cameraPitch;
}
public function set cameraPitch(param1:Number) : void {
this._cameraPitch = param1;
}
public function get garageBox() : Tanks3DSResource {
return this._garageBox;
}
public function set garageBox(param1:Tanks3DSResource) : void {
this._garageBox = param1;
}
public function get hideLinks() : Boolean {
return this._hideLinks;
}
public function set hideLinks(param1:Boolean) : void {
this._hideLinks = param1;
}
public function get mountableCategories() : Vector.<ItemCategoryEnum> {
return this._mountableCategories;
}
public function set mountableCategories(param1:Vector.<ItemCategoryEnum>) : void {
this._mountableCategories = param1;
}
public function get skyboxBackSide() : TextureResource {
return this._skyboxBackSide;
}
public function set skyboxBackSide(param1:TextureResource) : void {
this._skyboxBackSide = param1;
}
public function get skyboxBottomSide() : TextureResource {
return this._skyboxBottomSide;
}
public function set skyboxBottomSide(param1:TextureResource) : void {
this._skyboxBottomSide = param1;
}
public function get skyboxFrontSide() : TextureResource {
return this._skyboxFrontSide;
}
public function set skyboxFrontSide(param1:TextureResource) : void {
this._skyboxFrontSide = param1;
}
public function get skyboxLeftSide() : TextureResource {
return this._skyboxLeftSide;
}
public function set skyboxLeftSide(param1:TextureResource) : void {
this._skyboxLeftSide = param1;
}
public function get skyboxRightSide() : TextureResource {
return this._skyboxRightSide;
}
public function set skyboxRightSide(param1:TextureResource) : void {
this._skyboxRightSide = param1;
}
public function get skyboxTopSide() : TextureResource {
return this._skyboxTopSide;
}
public function set skyboxTopSide(param1:TextureResource) : void {
this._skyboxTopSide = param1;
}
public function toString() : String {
var local1:String = "GarageModelCC [";
local1 += "cameraAltitude = " + this.cameraAltitude + " ";
local1 += "cameraDistance = " + this.cameraDistance + " ";
local1 += "cameraFov = " + this.cameraFov + " ";
local1 += "cameraPitch = " + this.cameraPitch + " ";
local1 += "garageBox = " + this.garageBox + " ";
local1 += "hideLinks = " + this.hideLinks + " ";
local1 += "mountableCategories = " + this.mountableCategories + " ";
local1 += "skyboxBackSide = " + this.skyboxBackSide + " ";
local1 += "skyboxBottomSide = " + this.skyboxBottomSide + " ";
local1 += "skyboxFrontSide = " + this.skyboxFrontSide + " ";
local1 += "skyboxLeftSide = " + this.skyboxLeftSide + " ";
local1 += "skyboxRightSide = " + this.skyboxRightSide + " ";
local1 += "skyboxTopSide = " + this.skyboxTopSide + " ";
return local1 + "]";
}
}
}
|
package com.lorentz.SVG.display.base {
import flash.geom.Rectangle;
public interface ISVGViewBox {
function get svgViewBox():Rectangle;
function set svgViewBox(value:Rectangle):void;
}
}
|
package alternativa.tanks.models.weapon.machinegun.sfx {
import alternativa.engine3d.materials.TextureMaterial;
import alternativa.engine3d.objects.Sprite3D;
import alternativa.math.Vector3;
import alternativa.tanks.battle.scene3d.scene3dcontainer.Scene3DContainer;
public class Crumbs extends ParticleSystem {
private static const MIN_PARTICLE_SIZE:Number = 130;
private static const SPEED:Number = 6;
private static const MAX_TIME:Number = 0.2;
private static const GRAVITY:Number = 20;
private static const INTERVAL:int = 0.1;
private static const MAX_COUNT:int = 5;
private static const MIN_SCALE:Number = 0.1;
private static const DIRECTION:Vector3 = new Vector3();
private var emitterPosition:Vector3 = new Vector3();
private var material:TextureMaterial;
private var container:Scene3DContainer;
public function Crumbs() {
super(CrumbsParticle,INTERVAL,MAX_COUNT);
}
public function setMaterial(param1:TextureMaterial) : void {
this.material = param1;
}
public function setContainer(param1:Scene3DContainer) : void {
this.container = param1;
}
public function setEmitterPosition(param1:Vector3) : void {
this.emitterPosition.copy(param1);
}
override protected function onCreateParticle(param1:Particle) : void {
var local2:CrumbsParticle = CrumbsParticle(param1);
var local3:Number = MIN_PARTICLE_SIZE + Math.random() * MIN_PARTICLE_SIZE / 2;
var local4:Sprite3D = local2.sprite;
DIRECTION.x = Math.random() * 2 - 1;
DIRECTION.y = -Math.random();
DIRECTION.z = Math.random() * 2 - 1;
DIRECTION.normalize();
DIRECTION.scale(SPEED);
local2.init(local3,this.emitterPosition,DIRECTION,this.material);
this.container.addChild(local4);
}
override protected function onUpdateParticle(param1:Particle, param2:Number) : void {
var local3:CrumbsParticle = CrumbsParticle(param1);
var local4:Sprite3D = local3.sprite;
var local5:Vector3 = local3.direction;
local5.z -= GRAVITY * param2;
local4.x += local5.x;
local4.y += local5.y;
local4.z += local5.z;
local3.time += param2;
if(local3.time > MAX_TIME) {
local3.time = MAX_TIME;
}
local4.alpha = 1 - local3.time / MAX_TIME;
var local6:Number = 1 - local4.alpha;
if(local6 < MIN_SCALE) {
local6 = MIN_SCALE;
}
local4.scaleX = local6;
local4.scaleY = local6;
local4.scaleZ = local6;
if(local4.alpha <= 0) {
local3.alive = false;
}
}
override protected function onDeleteParticle(param1:Particle) : void {
this.container.removeChild(CrumbsParticle(param1).sprite);
}
override public function clear() : void {
super.clear();
this.material = null;
this.container = null;
}
}
}
|
package alternativa.tanks.model.challenge
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class ChallengeCongratulationWindow_damageBitmap extends BitmapAsset
{
public function ChallengeCongratulationWindow_damageBitmap()
{
super();
}
}
}
|
package alternativa.tanks.models.battlefield.gamemode
{
import alternativa.engine3d.core.ShadowMap;
import alternativa.engine3d.lights.DirectionalLight;
import alternativa.init.Main;
import alternativa.math.Matrix3;
import alternativa.math.Vector3;
import alternativa.osgi.service.storage.IStorageService;
import alternativa.tanks.camera.GameCamera;
import alternativa.tanks.model.panel.IBattleSettings;
import alternativa.tanks.models.battlefield.BattleView3D;
import flash.display.Bitmap;
import flash.display.BitmapData;
public class NewYearGameMode implements IGameMode
{
private var camera:GameCamera;
public function NewYearGameMode()
{
super();
}
public function applyChanges(viewport:BattleView3D) : void
{
var camera:GameCamera = null;
camera = null;
camera = viewport.camera;
this.camera = camera;
camera.directionalLightStrength = 1;
camera.ambientColor = 596004;
camera.deferredLighting = true;
var light:DirectionalLight = new DirectionalLight(596004);
light.useShadowMap = true;
var matrix:Matrix3 = new Matrix3();
matrix.setRotationMatrix(-1,0,-0.4);
var toPos:Vector3 = new Vector3(0,1,0);
toPos.vTransformBy3(matrix);
light.lookAt(toPos.x,toPos.y,toPos.z);
light.intensity = 1;
camera.directionalLight = light;
camera.fogColor = 6974058;
camera.fogNear = 100;
camera.fogFar = 5000;
camera.fogStrength = 1;
camera.fogAlpha = 0.9;
camera.shadowMap = new ShadowMap(2048,5000,10000,0,0);
camera.shadowMapStrength = 1;
camera.shadowMap.bias = 0.5;
camera.shadowMap.biasMultiplier = 30;
camera.shadowMap.additionalSpace = 10000;
camera.shadowMap.alphaThreshold = 0.1;
camera.useShadowMap = true;
}
public function applyChangesBeforeSettings(settings:IBattleSettings) : void
{
if(!(settings.fog && this.camera.fogStrength != 1))
{
if(!settings.fog)
{
this.camera.fogStrength = 0;
}
}
if(settings.shadows && !this.camera.useShadowMap)
{
this.camera.useShadowMap = true;
if(this.camera.directionalLight != null)
{
this.camera.directionalLight.useShadowMap = true;
}
this.camera.shadowMapStrength = 1;
}
else if(!settings.shadows)
{
this.camera.useShadowMap = false;
if(this.camera.directionalLight != null)
{
this.camera.directionalLight.useShadowMap = false;
}
this.camera.shadowMapStrength = 0;
}
if(settings.defferedLighting && this.camera.directionalLightStrength != 1)
{
this.camera.directionalLight.intensity = 1;
this.camera.directionalLightStrength = 1;
this.camera.deferredLighting = true;
this.camera.deferredLightingStrength = 1;
}
else if(!settings.defferedLighting)
{
this.camera.directionalLight.intensity = 0;
this.camera.directionalLightStrength = 0;
this.camera.deferredLighting = false;
this.camera.deferredLightingStrength = 0;
}
if(IStorageService(Main.osgi.getService(IStorageService)).getStorage().data["use_ssao"] != null)
{
this.camera.ssao = IStorageService(Main.osgi.getService(IStorageService)).getStorage().data["use_ssao"];
}
else
{
this.camera.ssao = false;
}
}
public function applyColorchangesToSkybox(skybox:BitmapData) : BitmapData
{
var btm:BitmapData = new BitmapData(1,1,false,1382169 + 7559484);
skybox.colorTransform(skybox.rect,new Bitmap(btm).transform.colorTransform);
return skybox;
}
}
}
|
package alternativa.tanks.battle.triggers {
import alternativa.tanks.battle.DeferredAction;
import alternativa.tanks.battle.Trigger;
public class DeferredTriggerDeletion implements DeferredAction {
private var triggers:Triggers;
private var trigger:Trigger;
public function DeferredTriggerDeletion(param1:Triggers, param2:Trigger) {
super();
this.triggers = param1;
this.trigger = param2;
}
public function execute() : void {
this.triggers.remove(this.trigger);
}
}
}
|
package controls.base
{
import controls.TankInput;
import flash.events.MouseEvent;
import flash.text.TextFieldType;
import flash.ui.Mouse;
import flash.ui.MouseCursor;
public class TankInputBase extends TankInput
{
public function TankInputBase()
{
super();
_label.sharpness = 40;
_label.thickness = 70;
textField.sharpness = -210;
textField.thickness = 50;
textField.addEventListener(MouseEvent.MOUSE_OVER,this.onMouseOver);
textField.addEventListener(MouseEvent.MOUSE_OUT,this.onMouseOut);
}
private function onMouseOver(param1:MouseEvent) : void
{
Mouse.cursor = MouseCursor.IBEAM;
}
private function onMouseOut(param1:MouseEvent) : void
{
Mouse.cursor = MouseCursor.AUTO;
}
public function set enable(param1:Boolean) : void
{
textField.type = !!param1 ? TextFieldType.INPUT : TextFieldType.DYNAMIC;
textField.selectable = param1;
textField.mouseEnabled = param1;
textField.mouseWheelEnabled = param1;
textField.tabEnabled = param1;
}
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 width(param1:Number) : void
{
super.width = Math.ceil(param1);
}
override public function set height(param1:Number) : void
{
super.height = Math.ceil(param1);
}
}
}
|
package alternativa.tanks.gui {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.gui.ItemInfoPanelBitmaps_bitmapDroneReload.png")]
public class ItemInfoPanelBitmaps_bitmapDroneReload extends BitmapAsset {
public function ItemInfoPanelBitmaps_bitmapDroneReload() {
super();
}
}
}
|
package projects.tanks.client.battlefield.models.user.damageindicator {
public class DamageIndicatorType {
public static const NORMAL:DamageIndicatorType = new DamageIndicatorType(0,"NORMAL");
public static const CRITICAL:DamageIndicatorType = new DamageIndicatorType(1,"CRITICAL");
public static const FATAL:DamageIndicatorType = new DamageIndicatorType(2,"FATAL");
public static const HEAL:DamageIndicatorType = new DamageIndicatorType(3,"HEAL");
private var _value:int;
private var _name:String;
public function DamageIndicatorType(param1:int, param2:String) {
super();
this._value = param1;
this._name = param2;
}
public static function get values() : Vector.<DamageIndicatorType> {
var local1:Vector.<DamageIndicatorType> = new Vector.<DamageIndicatorType>();
local1.push(NORMAL);
local1.push(CRITICAL);
local1.push(FATAL);
local1.push(HEAL);
return local1;
}
public function toString() : String {
return "DamageIndicatorType [" + this._name + "]";
}
public function get value() : int {
return this._value;
}
public function get name() : String {
return this._name;
}
}
}
|
package alternativa.tanks.model.gift
{
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;
public class GilfRoller extends Sprite
{
[Embed(source="1015.png")]
static var roller:Class;
private static const rollerBMP:BitmapData = new roller().bitmapData;
public var list:GiftRollerList;
public function GilfRoller(items:Array, _width:Number = 0, _height:* = 0)
{
super();
this.list = new GiftRollerList();
this.list.width = _width - 3;
this.list.height = _height;
this.list.y = 16;
addChild(this.list);
this.list.initData(items);
addChild(new Bitmap(rollerBMP));
}
public function init(items:Array) : void
{
this.list.initData(items);
}
}
}
|
package alternativa.tanks.model.payment.shop.shopabonement {
import platform.client.fp10.core.type.IGameObject;
[ModelInterface]
public interface ShopAbonements {
function getCategoriesWithBonus() : Vector.<IGameObject>;
}
}
|
package com.alternativaplatform.projects.tanks.client.models.tank.criticalhit
{
import scpacker.Base;
public class TankCriticalHitModelBase extends Base
{
public function TankCriticalHitModelBase()
{
super();
}
}
}
|
package alternativa.tanks.sfx {
import alternativa.engine3d.core.Object3D;
import alternativa.engine3d.lights.TubeLight;
import alternativa.math.Vector3;
import alternativa.tanks.battle.scene3d.scene3dcontainer.Scene3DContainer;
import alternativa.tanks.camera.GameCamera;
import alternativa.tanks.utils.objectpool.Pool;
import alternativa.tanks.utils.objectpool.PooledObject;
public class TubeLightEffect extends PooledObject implements GraphicEffect {
private static const CAMERA_DISTANCE_COEF:Number = 1.5;
private static const position:Vector3 = new Vector3();
private static const targetPositon:Vector3 = new Vector3();
private var light:TubeLight;
private var positionProvider:Object3DPositionProvider;
private var targetProvider:Object3DPositionProvider;
private var animation:LightAnimation;
private var currentTime:int;
private var timeToLive:int;
private var looped:Boolean;
private var alive:Boolean;
private var target:Object3D;
private var container:Scene3DContainer;
public function TubeLightEffect(param1:Pool) {
super(param1);
this.light = new TubeLight(0,0,0,0,0);
this.target = new Object3D();
}
public function init(param1:Object3DPositionProvider, param2:Object3DPositionProvider, param3:LightAnimation, param4:Boolean = false) : void {
this.initFromTime(param1,param2,param3.getLiveTime(),param3,param4);
}
public function initFromTime(param1:Object3DPositionProvider, param2:Object3DPositionProvider, param3:int, param4:LightAnimation, param5:Boolean = false) : void {
this.positionProvider = param1;
this.targetProvider = param2;
this.timeToLive = param3;
this.currentTime = 0;
this.animation = param4;
this.looped = param5;
this.alive = true;
}
public function addedToScene(param1:Scene3DContainer) : void {
this.container = param1;
param1.addChild(this.light);
param1.addChild(this.target);
}
public function play(param1:int, param2:GameCamera) : Boolean {
var local3:Number = NaN;
var local4:Number = NaN;
if(this.alive) {
this.animation.updateByTime(this.light,this.currentTime,this.timeToLive);
this.positionProvider.updateObjectPosition(this.light,param2,param1);
this.targetProvider.updateObjectPosition(this.target,param2,param1);
this.currentTime += param1;
position.x = this.light.x;
position.y = this.light.y;
position.z = this.light.z;
targetPositon.x = this.target.x;
targetPositon.y = this.target.y;
targetPositon.z = this.target.z;
local3 = Vector3.distanceBetween(position,targetPositon);
local4 = param2.farClipping / CAMERA_DISTANCE_COEF;
local3 = local3 > local4 ? local4 : local3;
this.light.length = local3;
if(this.currentTime > this.timeToLive) {
if(this.looped) {
this.currentTime %= this.timeToLive;
} else {
this.alive = false;
}
}
this.light.lookAt(this.target.x,this.target.y,this.target.z);
this.light.falloff = this.light.attenuationEnd - this.light.attenuationBegin;
return this.alive;
}
return false;
}
public function destroy() : void {
this.container.removeChild(this.light);
this.container.removeChild(this.target);
this.container = null;
this.animation = null;
this.positionProvider = null;
recycle();
}
public function kill() : void {
this.alive = false;
}
}
}
|
package init {
import alternativa.osgi.OSGi;
import alternativa.osgi.bundle.IBundleActivator;
import projects.tanks.clients.fp10.libraries.tanksservices.service.alertservices.IAlertService;
import services.alertservice.AlertService;
import services.buttonbar.ButtonBarService;
import services.buttonbar.IButtonBarService;
import services.contextmenu.ContextMenuService;
import services.contextmenu.IContextMenuService;
public class TanksFormsActivator implements IBundleActivator {
public function TanksFormsActivator() {
super();
}
public function start(param1:OSGi) : void {
param1.registerService(IContextMenuService,new ContextMenuService());
param1.registerService(IButtonBarService,new ButtonBarService());
param1.registerService(IAlertService,new AlertService());
}
public function stop(param1:OSGi) : void {
param1.unregisterService(IContextMenuService);
param1.unregisterService(IButtonBarService);
param1.unregisterService(IAlertService);
}
}
}
|
package alternativa.tanks.model.gift.server
{
public class GiftServerItem
{
public var id:String;
public var rare:int;
public var count:int;
public function GiftServerItem(id:String, rare:int, count:int)
{
super();
this.id = id;
this.rare = rare;
this.count = count;
}
}
}
|
package alternativa.tanks.model.item {
import alternativa.types.Long;
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.type.IGameObject;
public class BattleFriendsListenerAdapt implements BattleFriendsListener {
private var object:IGameObject;
private var impl:BattleFriendsListener;
public function BattleFriendsListenerAdapt(param1:IGameObject, param2:BattleFriendsListener) {
super();
this.object = param1;
this.impl = param2;
}
public function onAddFriend(param1:Long) : void {
var userId:Long = param1;
try {
Model.object = this.object;
this.impl.onAddFriend(userId);
}
finally {
Model.popObject();
}
}
public function onDeleteFriend(param1:Long) : void {
var userId:Long = param1;
try {
Model.object = this.object;
this.impl.onDeleteFriend(userId);
}
finally {
Model.popObject();
}
}
}
}
|
package controls.rangicons
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class RangIconNormal_p2 extends BitmapAsset
{
public function RangIconNormal_p2()
{
super();
}
}
}
|
package alternativa.tanks.model.news
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class NewsIcons_crystalls_book extends BitmapAsset
{
public function NewsIcons_crystalls_book()
{
super();
}
}
}
|
package projects.tanks.client.battleselect.model.matchmaking.group.invitewindow {
import alternativa.types.Long;
public class MatchMakingUserInfo {
private var _friend:Boolean;
private var _id:Long;
private var _onLine:Boolean;
private var _rank:int;
private var _sameClan:Boolean;
private var _uid:String;
public function MatchMakingUserInfo(param1:Boolean = false, param2:Long = null, param3:Boolean = false, param4:int = 0, param5:Boolean = false, param6:String = null) {
super();
this._friend = param1;
this._id = param2;
this._onLine = param3;
this._rank = param4;
this._sameClan = param5;
this._uid = param6;
}
public function get friend() : Boolean {
return this._friend;
}
public function set friend(param1:Boolean) : void {
this._friend = param1;
}
public function get id() : Long {
return this._id;
}
public function set id(param1:Long) : void {
this._id = param1;
}
public function get onLine() : Boolean {
return this._onLine;
}
public function set onLine(param1:Boolean) : void {
this._onLine = param1;
}
public function get rank() : int {
return this._rank;
}
public function set rank(param1:int) : void {
this._rank = param1;
}
public function get sameClan() : Boolean {
return this._sameClan;
}
public function set sameClan(param1:Boolean) : void {
this._sameClan = param1;
}
public function get uid() : String {
return this._uid;
}
public function set uid(param1:String) : void {
this._uid = param1;
}
public function toString() : String {
var local1:String = "MatchMakingUserInfo [";
local1 += "friend = " + this.friend + " ";
local1 += "id = " + this.id + " ";
local1 += "onLine = " + this.onLine + " ";
local1 += "rank = " + this.rank + " ";
local1 += "sameClan = " + this.sameClan + " ";
local1 += "uid = " + this.uid + " ";
return local1 + "]";
}
}
}
|
package alternativa.tanks.view.matchmaking {
import controls.base.LabelBase;
import flash.display.Sprite;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormatAlign;
public class MatchmakingInfoLine extends Sprite {
private static const WIDTH:int = 300;
private var dataLabel:LabelBase;
public function MatchmakingInfoLine(param1:String) {
super();
addChild(this.createLabel(param1));
this.dataLabel = this.createLabel();
addChild(this.dataLabel);
this.dataLabel.x = WIDTH - this.dataLabel.width;
}
private function createLabel(param1:String = "") : LabelBase {
var local2:LabelBase = new LabelBase();
local2.autoSize = TextFieldAutoSize.LEFT;
local2.wordWrap = false;
local2.multiline = true;
local2.align = TextFormatAlign.LEFT;
local2.text = param1;
local2.size = 12;
local2.color = 5898034;
return local2;
}
public function setText(param1:String) : void {
this.dataLabel.text = param1;
this.dataLabel.x = WIDTH - this.dataLabel.width;
}
}
}
|
package alternativa.tanks.models.clan.accepted {
import alternativa.types.Long;
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.type.IGameObject;
public class IClanAcceptedModelAdapt implements IClanAcceptedModel {
private var object:IGameObject;
private var impl:IClanAcceptedModel;
public function IClanAcceptedModelAdapt(param1:IGameObject, param2:IClanAcceptedModel) {
super();
this.object = param1;
this.impl = param2;
}
public function getAcceptedUsers() : Vector.<Long> {
var result:Vector.<Long> = null;
try {
Model.object = this.object;
result = this.impl.getAcceptedUsers();
}
finally {
Model.popObject();
}
return result;
}
}
}
|
package projects.tanks.client.panel.model.challenge.rewarding {
import alternativa.osgi.OSGi;
import alternativa.protocol.ICodec;
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;
public class ChallengesRewardingUserModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:ChallengesRewardingUserModelServer;
private var client:IChallengesRewardingUserModelBase = IChallengesRewardingUserModelBase(this);
private var modelId:Long = Long.getLong(142490486,-1012948578);
private var _rewardNotifyId:Long = Long.getLong(1979487962,1574221041);
private var _rewardNotify_tierStarsCodec:ICodec;
public function ChallengesRewardingUserModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new ChallengesRewardingUserModelServer(IModel(this));
this._rewardNotify_tierStarsCodec = this._protocol.getCodec(new TypeCodecInfo(int,false));
}
override public function invoke(param1:Long, param2:ProtocolBuffer) : void {
switch(param1) {
case this._rewardNotifyId:
this.client.rewardNotify(int(this._rewardNotify_tierStarsCodec.decode(param2)));
}
}
override public function get id() : Long {
return this.modelId;
}
}
}
|
package projects.tanks.client.users.model.userbattlestatistics.rank {
public class RankBounds {
private var _lowBound:int;
private var _topBound:int;
public function RankBounds(param1:int = 0, param2:int = 0) {
super();
this._lowBound = param1;
this._topBound = param2;
}
public function get lowBound() : int {
return this._lowBound;
}
public function set lowBound(param1:int) : void {
this._lowBound = param1;
}
public function get topBound() : int {
return this._topBound;
}
public function set topBound(param1:int) : void {
this._topBound = param1;
}
public function toString() : String {
var local1:String = "RankBounds [";
local1 += "lowBound = " + this.lowBound + " ";
local1 += "topBound = " + this.topBound + " ";
return local1 + "]";
}
}
}
|
package alternativa.tanks.models.battle.battlefield.keyboard {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.models.battle.battlefield.keyboard.DeviceIcons_lightweightordnanceautoloaderIconClass.png")]
public class DeviceIcons_lightweightordnanceautoloaderIconClass extends BitmapAsset {
public function DeviceIcons_lightweightordnanceautoloaderIconClass() {
super();
}
}
}
|
package _codec.projects.tanks.client.battlefield.models.battle.gui.inventory {
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.battlefield.models.battle.gui.inventory.InventoryCC;
public class CodecInventoryCC implements ICodec {
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var codec_ultimateEnabled:ICodec;
public function CodecInventoryCC() {
super();
}
public function init(param1:IProtocol) : void {
this.codec_ultimateEnabled = param1.getCodec(new TypeCodecInfo(Boolean,false));
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:InventoryCC = new InventoryCC();
local2.ultimateEnabled = this.codec_ultimateEnabled.decode(param1) as Boolean;
return local2;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:InventoryCC = InventoryCC(param2);
this.codec_ultimateEnabled.encode(param1,local3.ultimateEnabled);
}
}
}
|
package alternativa.tanks.model.payment.modes.gate2shop {
[ModelInterface]
public interface Gate2ShopPayment {
function emailInputRequired() : Boolean;
function registerEmailAndGetPaymentUrl(param1:String) : void;
}
}
|
package alternativa.tanks.models.sfx
{
import alternativa.engine3d.core.Light3D;
import alternativa.engine3d.lights.OmniLight;
import alternativa.engine3d.lights.SpotLight;
import alternativa.engine3d.lights.TubeLight;
public final class LightAnimation
{
private var frames:int;
private var time:Vector.<uint>;
private var intensity:Vector.<Number>;
private var color:Vector.<uint>;
private var attenuationBegin:Vector.<Number>;
private var attenuationEnd:Vector.<Number>;
public function LightAnimation(param1:Vector.<LightingEffectRecord>)
{
var _loc3_:LightingEffectRecord = null;
super();
this.frames = param1.length;
this.intensity = new Vector.<Number>(this.frames,true);
this.color = new Vector.<uint>(this.frames,true);
this.attenuationBegin = new Vector.<Number>(this.frames,true);
this.attenuationEnd = new Vector.<Number>(this.frames,true);
this.time = new Vector.<uint>(this.frames,true);
var _loc2_:int = 0;
while(_loc2_ < this.frames)
{
_loc3_ = param1[_loc2_];
this.intensity[_loc2_] = Number(_loc3_.intensity);
this.color[_loc2_] = uint(_loc3_.color);
this.attenuationBegin[_loc2_] = Number(_loc3_.attenuationBegin);
this.attenuationEnd[_loc2_] = Number(_loc3_.attenuationEnd);
this.time[_loc2_] = uint(_loc3_.time);
_loc2_++;
}
}
private static function lerpNumber(param1:Number, param2:Number, param3:Number) : Number
{
return param1 + (param2 - param1) * param3;
}
private static function lerpColor(param1:uint, param2:uint, param3:Number) : uint
{
var _loc4_:Number = (param1 >> 16 & 255) / 255;
var _loc5_:Number = (param1 >> 8 & 255) / 255;
var _loc6_:Number = (param1 & 255) / 255;
var _loc7_:Number = (param2 >> 16 & 255) / 255;
var _loc8_:Number = (param2 >> 8 & 255) / 255;
var _loc9_:Number = (param2 & 255) / 255;
var _loc10_:int = lerpNumber(_loc4_,_loc7_,param3) * 255;
var _loc11_:int = lerpNumber(_loc5_,_loc8_,param3) * 255;
var _loc12_:int = lerpNumber(_loc6_,_loc9_,param3) * 255;
return _loc10_ << 16 | _loc11_ << 8 | _loc12_;
}
private function getFrameByTime(param1:Number) : Number
{
var _loc3_:int = 0;
var _loc4_:Number = NaN;
var _loc5_:Number = NaN;
var _loc6_:Number = NaN;
var _loc2_:Number = 0;
if(param1 < this.time[this.frames - 1])
{
_loc3_ = 0;
while(_loc3_ < this.frames - 1)
{
_loc4_ = this.time[_loc3_];
_loc5_ = this.time[_loc3_ + 1];
if(param1 >= _loc4_ && param1 < _loc5_)
{
_loc6_ = (param1 - _loc4_) / (_loc5_ - _loc4_);
_loc2_ = _loc3_ + _loc6_;
break;
}
_loc3_++;
}
}
else
{
_loc2_ = this.frames - 1;
}
return _loc2_;
}
public function getFramesCount() : int
{
return this.frames;
}
private function limitFrame(param1:int) : int
{
return param1 < this.frames ? int(int(int(param1))) : int(int(int(this.frames - 1)));
}
private function updateSpotLight(param1:Number, param2:SpotLight) : void
{
var _loc3_:int = this.limitFrame(Math.floor(param1));
var _loc4_:int = this.limitFrame(Math.ceil(param1));
var _loc5_:Number = param1 - _loc3_;
var _loc6_:Number = this.intensity[_loc3_];
var _loc7_:Number = this.intensity[_loc4_];
var _loc8_:uint = this.color[_loc3_];
var _loc9_:uint = this.color[_loc4_];
var _loc10_:Number = this.attenuationBegin[_loc3_];
var _loc11_:Number = this.attenuationBegin[_loc4_];
var _loc12_:Number = this.attenuationEnd[_loc3_];
var _loc13_:Number = this.attenuationEnd[_loc4_];
param2.intensity = lerpNumber(_loc6_,_loc7_,_loc5_);
param2.color = lerpColor(_loc8_,_loc9_,_loc5_);
param2.attenuationBegin = lerpNumber(_loc10_,_loc11_,_loc5_);
param2.attenuationEnd = lerpNumber(_loc12_,_loc13_,_loc5_);
}
private function updateOmniLight(param1:Number, param2:OmniLight) : void
{
var _loc3_:int = this.limitFrame(Math.floor(param1));
var _loc4_:int = this.limitFrame(Math.ceil(param1));
var _loc5_:Number = param1 - _loc3_;
var _loc6_:Number = this.intensity[_loc3_];
var _loc7_:Number = this.intensity[_loc4_];
var _loc8_:uint = this.color[_loc3_];
var _loc9_:uint = this.color[_loc4_];
var _loc10_:Number = this.attenuationBegin[_loc3_];
var _loc11_:Number = this.attenuationBegin[_loc4_];
var _loc12_:Number = this.attenuationEnd[_loc3_];
var _loc13_:Number = this.attenuationEnd[_loc4_];
param2.intensity = lerpNumber(_loc6_,_loc7_,_loc5_);
param2.color = lerpColor(_loc8_,_loc9_,_loc5_);
param2.attenuationBegin = lerpNumber(_loc10_,_loc11_,_loc5_);
param2.attenuationEnd = lerpNumber(_loc12_,_loc13_,_loc5_);
}
private function updateTubeLight(param1:Number, param2:TubeLight) : void
{
var _loc3_:int = this.limitFrame(Math.floor(param1));
var _loc4_:int = this.limitFrame(Math.ceil(param1));
var _loc5_:Number = param1 - _loc3_;
var _loc6_:Number = this.intensity[_loc3_];
var _loc7_:Number = this.intensity[_loc4_];
var _loc8_:uint = this.color[_loc3_];
var _loc9_:uint = this.color[_loc4_];
var _loc10_:Number = this.attenuationBegin[_loc3_];
var _loc11_:Number = this.attenuationBegin[_loc4_];
var _loc12_:Number = this.attenuationEnd[_loc3_];
var _loc13_:Number = this.attenuationEnd[_loc4_];
param2.intensity = lerpNumber(_loc6_,_loc7_,_loc5_);
param2.color = lerpColor(_loc8_,_loc9_,_loc5_);
param2.attenuationBegin = lerpNumber(_loc10_,_loc11_,_loc5_);
param2.attenuationEnd = lerpNumber(_loc12_,_loc13_,_loc5_);
}
public function updateByTime(param1:Light3D, param2:int, param3:int = -1) : void
{
var _loc4_:Number = 1;
if(param3 > 0 && this.frames > 0)
{
_loc4_ = this.time[this.frames - 1] / param3;
}
var _loc5_:Number = this.getFrameByTime(param2 * _loc4_);
this.updateByFrame(param1,_loc5_);
}
private function updateByFrame(param1:Light3D, param2:Number) : void
{
if(param1 is OmniLight)
{
this.updateOmniLight(param2,OmniLight(param1));
}
else if(param1 is SpotLight)
{
this.updateSpotLight(param2,SpotLight(param1));
}
else if(param1 is TubeLight)
{
this.updateTubeLight(param2,TubeLight(param1));
}
param1.calculateBounds();
}
public function getLiveTime() : int
{
return this.time[this.frames - 1];
}
}
}
|
package alternativa.tanks.models.tank.spawn.spawnhandlers.spawn {
import alternativa.tanks.battle.BattleService;
import alternativa.tanks.battle.objects.tank.Tank;
import alternativa.tanks.models.tank.ITankModel;
import platform.client.fp10.core.type.IGameObject;
public class LocalSpawnHandler implements SpawnHandler {
[Inject]
public static var battleService:BattleService;
public function LocalSpawnHandler() {
super();
}
public function spawn(param1:Tank, param2:IGameObject) : void {
var local3:ITankModel = ITankModel(param1.user.adapt(ITankModel));
local3.addTankToExclusionSet(param1);
battleService.unlockFollowCamera();
battleService.activateFollowCamera();
battleService.getBattleRunner().setLocalBody(param1.getBody());
local3.getTitle().show();
local3.configureRemoteTankTitles();
}
}
}
|
package alternativa.engine3d.objects {
import alternativa.engine3d.alternativa3d;
import alternativa.engine3d.core.Vertex;
use namespace alternativa3d;
public class VertexBinding {
alternativa3d var next:VertexBinding;
alternativa3d var vertex:Vertex;
alternativa3d var weight:Number = 0;
public function VertexBinding() {
super();
}
}
}
|
package utils.tweener.easing {
public class Back {
public function Back() {
super();
}
public static function easeIn(param1:Number, param2:Number, param3:Number, param4:Number, param5:Number = 1.70158) : Number {
return param3 * (param1 = param1 / param4) * param1 * ((param5 + 1) * param1 - param5) + param2;
}
public static function easeOut(param1:Number, param2:Number, param3:Number, param4:Number, param5:Number = 1.70158) : Number {
return param3 * ((param1 = param1 / param4 - 1) * param1 * ((param5 + 1) * param1 + param5) + 1) + param2;
}
public static function easeInOut(param1:Number, param2:Number, param3:Number, param4:Number, param5:Number = 1.70158) : Number {
param1 = param1 / (param4 * 0.5);
if(param1 < 1) {
return param3 * 0.5 * (param1 * param1 * (((param5 = param5 * 1.525) + 1) * param1 - param5)) + param2;
}
return param3 / 2 * ((param1 = param1 - 2) * param1 * (((param5 = param5 * 1.525) + 1) * param1 + param5) + 2) + param2;
}
}
}
|
package _codec.projects.tanks.client.garage.models.item.delaymount {
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.garage.models.item.delaymount.DelayMountCategoryCC;
public class VectorCodecDelayMountCategoryCCLevel1 implements ICodec {
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecDelayMountCategoryCCLevel1(param1:Boolean) {
super();
this.optionalElement = param1;
}
public function init(param1:IProtocol) : void {
this.elementCodec = param1.getCodec(new TypeCodecInfo(DelayMountCategoryCC,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.<DelayMountCategoryCC> = new Vector.<DelayMountCategoryCC>(local2,true);
var local4:int = 0;
while(local4 < local2) {
local3[local4] = DelayMountCategoryCC(this.elementCodec.decode(param1));
local4++;
}
return local3;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
var local4:DelayMountCategoryCC = null;
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:Vector.<DelayMountCategoryCC> = Vector.<DelayMountCategoryCC>(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.osgi.service.locale {
import flash.display.BitmapData;
import flash.display.DisplayObjectContainer;
public interface ILocaleService {
function setText(param1:String, param2:String) : void;
function setImage(param1:String, param2:BitmapData) : void;
function setMovie(param1:String, param2:DisplayObjectContainer) : void;
function setBoolean(param1:String, param2:Boolean) : void;
function setNumber(param1:String, param2:Number) : void;
function setInt(param1:String, param2:int) : void;
function getText(param1:String, ... rest) : String;
function getImage(param1:String) : BitmapData;
function getMovie(param1:String) : DisplayObjectContainer;
function getBoolean(param1:String) : Boolean;
function getNumber(param1:String) : Number;
function getInt(param1:String) : int;
function get language() : String;
function get defaultLanguage() : String;
function getTextWithPrefix(param1:String) : Array;
}
}
|
package _codec.projects.tanks.client.panel.model.mobilequest.quest {
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.mobilequest.quest.MobileQuestCC;
public class VectorCodecMobileQuestCCLevel1 implements ICodec {
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecMobileQuestCCLevel1(param1:Boolean) {
super();
this.optionalElement = param1;
}
public function init(param1:IProtocol) : void {
this.elementCodec = param1.getCodec(new TypeCodecInfo(MobileQuestCC,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.<MobileQuestCC> = new Vector.<MobileQuestCC>(local2,true);
var local4:int = 0;
while(local4 < local2) {
local3[local4] = MobileQuestCC(this.elementCodec.decode(param1));
local4++;
}
return local3;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
var local4:MobileQuestCC = null;
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:Vector.<MobileQuestCC> = Vector.<MobileQuestCC>(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 projects.tanks.client.panel.model.mobilequest.profile {
public interface IMobileQuestProfileModelBase {
function changeProgress(param1:int) : void;
}
}
|
package alternativa.tanks.service.settings {
import flash.events.EventDispatcher;
import flash.media.SoundMixer;
import flash.media.SoundTransform;
import flash.net.SharedObject;
import projects.tanks.clients.flash.commons.models.gpu.GPUCapabilities;
import projects.tanks.clients.fp10.libraries.tanksservices.service.friend.battleinvite.IBattleInviteService;
import projects.tanks.clients.fp10.libraries.tanksservices.service.storage.IStorageService;
public class SettingsService extends EventDispatcher implements ISettingsService {
[Inject]
public static var storageService:IStorageService;
[Inject]
public static var battleInviteService:IBattleInviteService;
private static const DEFAULT_VOLUME:Number = 0.7;
private static const DEFAULT_MOUSE_SENSITIVE:int = 8;
private var email:String;
private var emailConfirmed:Boolean;
private var _isPasswordSet:Boolean = false;
public function SettingsService() {
super();
}
private static function updateSoundValue(param1:Boolean, param2:Number) : void {
SoundMixer.soundTransform = new SoundTransform(param1 ? 0 : param2);
}
public function get showDropZones() : Boolean {
return this.getBoolean(SettingEnum.SHOW_DROP_ZONES,true);
}
public function set showDropZones(param1:Boolean) : void {
this.setClientSetting(SettingEnum.SHOW_DROP_ZONES,param1);
}
public function get showSkyBox() : Boolean {
return this.getBoolean(SettingEnum.SHOW_SKY_BOX,true);
}
public function get showFPS() : Boolean {
return this.getBoolean(SettingEnum.SHOW_FPS,true);
}
public function get showChat() : Boolean {
return this.getBoolean(SettingEnum.SHOW_CHAT,true);
}
public function get mipMapping() : Boolean {
return this.getBoolean(SettingEnum.MIPMAPPING,true);
}
public function get alternateCamera() : Boolean {
return this.getBoolean(SettingEnum.ALTERNATE_CAMERA,false);
}
public function get adaptiveFPS() : Boolean {
return this.getBoolean(SettingEnum.ADAPTIVE_FPS,false);
}
public function get inverseBackDriving() : Boolean {
return this.getBoolean(SettingEnum.INVERSE_BACK_DRIVING,false);
}
public function get bgSound() : Boolean {
return this.getBoolean(SettingEnum.BG_SOUND,true);
}
public function get muteSound() : Boolean {
return this.getBoolean(SettingEnum.MUTE_SOUND,false);
}
public function set muteSound(param1:Boolean) : void {
SettingsService.updateSoundValue(param1,this.soundVolume);
this.setClientSetting(SettingEnum.MUTE_SOUND,param1);
}
public function get shadows() : Boolean {
return GPUCapabilities.gpuEnabled && !GPUCapabilities.constrained && this.getBoolean(SettingEnum.SHADOWS_UNDER_TANK,true);
}
public function get softParticles() : Boolean {
return GPUCapabilities.gpuEnabled && !GPUCapabilities.constrained && this.getBoolean(SettingEnum.SOFT_PARTICLES,false);
}
public function get dust() : Boolean {
return GPUCapabilities.gpuEnabled && !GPUCapabilities.constrained && this.getBoolean(SettingEnum.SOFT_PARTICLES,false) && this.getBoolean(SettingEnum.DUST,false);
}
public function get ssao() : Boolean {
return GPUCapabilities.gpuEnabled && !GPUCapabilities.constrained && this.getBoolean(SettingEnum.SSAO,false);
}
public function get fog() : Boolean {
return GPUCapabilities.gpuEnabled && !GPUCapabilities.constrained && this.getBoolean(SettingEnum.FOG,true);
}
public function get dynamicShadows() : Boolean {
return GPUCapabilities.gpuEnabled && !GPUCapabilities.constrained && this.getBoolean(SettingEnum.DYNAMIC_SHADOWS,false);
}
public function get dynamicLighting() : Boolean {
var local1:Boolean = this.dynamicShadows || this.ssao || this.softParticles;
return GPUCapabilities.gpuEnabled && !GPUCapabilities.constrained && this.getBoolean(SettingEnum.DYNAMIC_LIGHTING,local1);
}
public function get antialiasing() : Boolean {
return GPUCapabilities.gpuEnabled && !GPUCapabilities.constrained && this.getBoolean(SettingEnum.ANTIALIASING,false);
}
public function get graphicsAutoQuality() : Boolean {
if(this.settingExists(SettingEnum.GRAPHICS_AUTO_QUALITY)) {
return GPUCapabilities.gpuEnabled && !GPUCapabilities.constrained && this.getBoolean(SettingEnum.GRAPHICS_AUTO_QUALITY,false);
}
return GPUCapabilities.gpuEnabled && !GPUCapabilities.constrained;
}
private function settingExists(param1:SettingEnum) : Boolean {
return storageService.getStorage().data[param1.name] != null;
}
public function get soundVolume() : Number {
return this.getNumber(SettingEnum.SOUND_VOLUME,DEFAULT_VOLUME);
}
public function set soundVolume(param1:Number) : void {
updateSoundValue(this.muteSound,param1);
this.setClientSetting(SettingEnum.SOUND_VOLUME,param1);
}
public function initSoundValue() : void {
updateSoundValue(this.muteSound,this.soundVolume);
}
private function getBoolean(param1:SettingEnum, param2:Boolean) : Boolean {
var local3:* = storageService.getStorage().data[param1.name];
return local3 == null ? param2 : local3;
}
private function storeBoolean(param1:SettingEnum, param2:Boolean) : void {
storageService.getStorage().data[param1.name] = param2;
}
private function getNumber(param1:SettingEnum, param2:Number = 0) : Number {
var local3:Number = Number(storageService.getStorage().data[param1.name]);
return isNaN(local3) ? param2 : local3;
}
private function storeNumber(param1:SettingEnum, param2:Number) : void {
storageService.getStorage().data[param1.name] = param2;
}
public function setEmail(param1:String, param2:Boolean) : void {
this.email = param1;
this.emailConfirmed = param2;
}
public function isEmailSet() : Boolean {
return this.email != null && this.email != "";
}
public function isNeedEmailRemind() : Boolean {
return !this.isEmailConfirmed();
}
public function getEmail() : String {
return this.email != null ? this.email : "";
}
public function isEmailConfirmed() : Boolean {
return this.emailConfirmed;
}
public function setEmailConfirmed(param1:Boolean) : void {
this.emailConfirmed = param1;
}
public function get mouseControl() : Boolean {
return this.getBoolean(SettingEnum.MOUSE_CONTROL,true);
}
public function get mouseSensitivity() : int {
return this.getNumber(SettingEnum.MOUSE_SENSITIVITY,DEFAULT_MOUSE_SENSITIVE);
}
public function get mouseYInverse() : Boolean {
return this.getBoolean(SettingEnum.MOUSE_Y_INVERSE,false);
}
public function get mouseYInverseShaftAim() : Boolean {
return this.getBoolean(SettingEnum.MOUSE_Y_INVERSE_SHAFT_AIM,false);
}
public function get isPasswordSet() : Boolean {
return this._isPasswordSet;
}
public function set isPasswordSet(param1:Boolean) : void {
this._isPasswordSet = param1;
}
public function get showDamage() : Boolean {
return this.getBoolean(SettingEnum.SHOW_DAMAGE,true);
}
public function setClientSetting(param1:SettingEnum, param2:Object) : void {
var local3:SharedObject = storageService.getStorage();
local3.data[param1.name] = param2;
local3.flush();
dispatchEvent(new SettingsServiceEvent(SettingsServiceEvent.SETTINGS_CHANGED,param1));
}
public function get showLocalDrone() : Boolean {
return this.getBoolean(SettingEnum.SHOW_LOCAL_DRONE,true);
}
public function get showRemoteDrones() : Boolean {
return this.getBoolean(SettingEnum.SHOW_REMOTE_DRONES,true);
}
public function get receivePresents() : Boolean {
return this.getBoolean(SettingEnum.RECEIVE_PRESENTS,false);
}
public function set receivePresents(param1:Boolean) : void {
var local2:SharedObject = storageService.getStorage();
local2.data[SettingEnum.RECEIVE_PRESENTS] = param1;
}
}
}
|
package alternativa.tanks.models.tank.killhandlers {
import alternativa.tanks.battle.objects.tank.Tank;
import alternativa.tanks.models.tank.ITankModel;
import platform.client.fp10.core.type.IGameObject;
public class RemoteTankDieHandler extends CommonTankDieHandler implements TankDieHandler, TankDeathConfirmationHandler {
private var respawnDelay:int = 0;
public function RemoteTankDieHandler() {
super();
}
public function handleTankDie(param1:IGameObject, param2:int) : void {
this.respawnDelay = param2;
var local3:DeathConfirmationTimeoutTask = new DeathConfirmationTimeoutTask();
local3.start(param1,this.handleDeathConfirmation);
}
public function handleDeathConfirmation(param1:IGameObject) : void {
var local2:ITankModel = null;
var local3:Tank = null;
if(this.respawnDelay > 0) {
local2 = getTankModel(param1);
local3 = local2.getTank();
if(local3.isInBattle()) {
killTank(param1,this.respawnDelay);
}
this.respawnDelay = 0;
local3.isLastHitPointSet = false;
}
}
}
}
|
package forms.friends.list.renderer.background
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class UserOfflineCellSelected_rightIconClass extends BitmapAsset
{
public function UserOfflineCellSelected_rightIconClass()
{
super();
}
}
}
|
package controls {
[Embed(source="/_assets/assets.swf", symbol="symbol6")]
public class RedButton extends ColorButton {
public function RedButton() {
super();
setStyle(RED);
labelColor = 16777215;
}
}
}
|
package alternativa.tanks.model
{
import alternativa.init.Main;
import alternativa.model.IModel;
import alternativa.object.ClientObject;
import alternativa.osgi.service.dump.dumper.IDumper;
import alternativa.register.SpaceInfo;
import alternativa.service.IModelService;
import alternativa.service.ISpaceService;
import flash.utils.Dictionary;
public class ItemDumper implements IDumper
{
public function ItemDumper()
{
super();
}
public function dump(params:Vector.<String>) : String
{
var spaces:Array = null;
var i:int = 0;
var objects:Dictionary = null;
var obj:ClientObject = null;
var models:Vector.<String> = null;
var m:int = 0;
var itemParams:ItemParams = null;
var result:String = "\n";
var modelRegister:IModelService = IModelService(Main.osgi.getService(IModelService));
var itemModel:IItem = (modelRegister.getModelsByInterface(IItem) as Vector.<IModel>)[0] as IItem;
if(itemModel != null)
{
spaces = ISpaceService(Main.osgi.getService(ISpaceService)).spaceList;
for(i = 0; i < spaces.length; i++)
{
objects = SpaceInfo(spaces[i]).objectRegister.getObjects();
for each(obj in objects)
{
models = obj.getModels();
if(models.length > 0)
{
for(m = 0; m < models.length; m++)
{
if((itemModel as IModel).id == models[m] as String)
{
itemParams = itemModel.getParams(obj);
result += "\n" + itemParams.name;
result += " type: " + itemParams.itemType + "\n";
result += " description: " + itemParams.description + "\n";
result += " rankId: " + itemParams.rankId + "\n";
result += " price: " + itemParams.price + "\n";
}
}
}
}
}
}
else
{
result += "ItemModel not registered!";
}
return result + "\n";
}
public function get dumperName() : String
{
return "item";
}
}
}
|
package alternativa.tanks.servermodels.loginbyhash {
import alternativa.osgi.service.launcherparams.ILauncherParams;
import alternativa.tanks.service.IEntranceClientFacade;
import flash.net.SharedObject;
import mx.utils.StringUtil;
import projects.tanks.client.entrance.model.entrance.loginbyhash.ILoginByHashModelBase;
import projects.tanks.client.entrance.model.entrance.loginbyhash.LoginByHashModelBase;
import projects.tanks.clients.fp10.libraries.tanksservices.service.storage.IStorageService;
[ModelInfo]
public class LoginByHashModel extends LoginByHashModelBase implements ILoginByHash, ILoginByHashModelBase {
[Inject]
public static var clientFacade:IEntranceClientFacade;
[Inject]
public static var storageService:IStorageService;
[Inject]
public static var launcherParams:ILauncherParams;
public function LoginByHashModel() {
super();
}
public function loginBySingleUseHash(param1:String) : void {
launcherParams.removeParameter("singleUseHash");
server.loginBySingleUseHash(param1);
}
public function loginByHash(param1:String) : void {
server.loginByHash(param1);
}
public function loginBySingleUseHashFailed() : void {
this.goToLoginHashFailed();
}
public function loginByHashFailed() : void {
this.goToLoginHashFailed();
}
private function goToLoginHashFailed() : void {
var local1:SharedObject = storageService.getStorage();
var local2:SharedObject = storageService.getAccountsStorage();
if(Boolean(local2.data[local1.data.userName])) {
delete local2.data[local1.data.userName];
local2.flush();
}
local1.data.userHash = null;
clientFacade.goToLoginFormWithHashError();
}
public function rememberUsersHash(param1:String) : void {
var local2:SharedObject = storageService.getStorage();
local2.data.userHash = param1;
local2.flush();
}
public function rememberAccount(param1:String) : void {
var local5:String = null;
this.rememberUsersHash(param1);
var local2:SharedObject = storageService.getStorage();
if(StringUtil.trim(local2.data.userName).length == 0) {
return;
}
var local3:SharedObject = storageService.getAccountsStorage();
var local4:Object = {};
for(local5 in local2.data) {
local4[local5] = local2.data[local5];
}
local3.data[local2.data.userName] = local4;
local3.flush();
}
}
}
|
package alternativa.tanks.models.user.incoming {
import alternativa.types.Long;
[ModelInterface]
public interface IClanUserIncomingModel {
function getIncomingClans() : Vector.<Long>;
}
}
|
package projects.tanks.client.battlefield.models.tankparts.engine {
import platform.client.fp10.core.resource.types.SoundResource;
public class EngineCC {
private var _engineIdleSound:SoundResource;
private var _engineMovingSound:SoundResource;
private var _engineStartMovingSound:SoundResource;
private var _engineStartSound:SoundResource;
private var _engineStopMovingSound:SoundResource;
public function EngineCC(param1:SoundResource = null, param2:SoundResource = null, param3:SoundResource = null, param4:SoundResource = null, param5:SoundResource = null) {
super();
this._engineIdleSound = param1;
this._engineMovingSound = param2;
this._engineStartMovingSound = param3;
this._engineStartSound = param4;
this._engineStopMovingSound = param5;
}
public function get engineIdleSound() : SoundResource {
return this._engineIdleSound;
}
public function set engineIdleSound(param1:SoundResource) : void {
this._engineIdleSound = param1;
}
public function get engineMovingSound() : SoundResource {
return this._engineMovingSound;
}
public function set engineMovingSound(param1:SoundResource) : void {
this._engineMovingSound = param1;
}
public function get engineStartMovingSound() : SoundResource {
return this._engineStartMovingSound;
}
public function set engineStartMovingSound(param1:SoundResource) : void {
this._engineStartMovingSound = param1;
}
public function get engineStartSound() : SoundResource {
return this._engineStartSound;
}
public function set engineStartSound(param1:SoundResource) : void {
this._engineStartSound = param1;
}
public function get engineStopMovingSound() : SoundResource {
return this._engineStopMovingSound;
}
public function set engineStopMovingSound(param1:SoundResource) : void {
this._engineStopMovingSound = param1;
}
public function toString() : String {
var local1:String = "EngineCC [";
local1 += "engineIdleSound = " + this.engineIdleSound + " ";
local1 += "engineMovingSound = " + this.engineMovingSound + " ";
local1 += "engineStartMovingSound = " + this.engineStartMovingSound + " ";
local1 += "engineStartSound = " + this.engineStartSound + " ";
local1 += "engineStopMovingSound = " + this.engineStopMovingSound + " ";
return local1 + "]";
}
}
}
|
package projects.tanks.client.tanksservices.model.notifier.rank {
import projects.tanks.client.tanksservices.model.notifier.AbstractNotifier;
public class RankNotifierData extends AbstractNotifier {
private var _rank:int;
public function RankNotifierData(param1:int = 0) {
super();
this._rank = param1;
}
public function get rank() : int {
return this._rank;
}
public function set rank(param1:int) : void {
this._rank = param1;
}
override public function toString() : String {
var local1:String = "RankNotifierData [";
local1 += "rank = " + this.rank + " ";
local1 += super.toString();
return local1 + "]";
}
}
}
|
package projects.tanks.client.garage.models.item.mobilelootbox.deliverylootbox {
public interface IMobileLootBoxDeliveryModelBase {
}
}
|
package projects.tanks.clients.fp10.libraries.tanksservices.utils {
import alternativa.osgi.service.locale.ILocaleService;
import alternativa.types.Long;
import platform.client.fp10.core.service.address.AddressService;
import platform.clients.fp10.libraries.alternativapartners.service.IPartnerService;
import projects.tanks.client.battleservice.BattleMode;
import projects.tanks.clients.fp10.libraries.TanksLocale;
public class BattleInfoUtils {
[Inject]
public static var addressService:AddressService;
[Inject]
public static var partnersService:IPartnerService;
[Inject]
public static var localeService:ILocaleService;
private static const BATTLE_NAME_SEPARATOR:String = " ";
public function BattleInfoUtils() {
super();
}
public static function getBattleBaseUrl() : String {
var local1:String = "";
if(!partnersService.isRunningInsidePartnerEnvironment()) {
local1 = addressService.getBaseURL();
}
return local1;
}
public static function getBattleIdUhex(param1:Long) : String {
return intToUhex(param1.high) + intToUhex(param1.low);
}
private static function intToUhex(param1:int) : String {
var local2:String = null;
var local4:uint = 0;
if(param1 >= 0) {
local2 = param1.toString(16);
} else {
local4 = uint(param1 & ~2147483648 | 2147483648);
local2 = local4.toString(16);
}
var local3:int = 8 - local2.length;
while(local3 > 0) {
local2 = "0" + local2;
local3--;
}
return local2;
}
public static function buildBattleName(param1:String, param2:String) : String {
return param1 + BATTLE_NAME_SEPARATOR + getShortBattleModeName(param2);
}
private static function getShortBattleModeName(param1:String) : String {
switch(param1) {
case BattleMode.DM.name:
return localeService.getText(TanksLocale.TEXT_DM_SHORT_NAME);
case BattleMode.TDM.name:
return localeService.getText(TanksLocale.TEXT_TDM_SHORT_NAME);
case BattleMode.CTF.name:
return localeService.getText(TanksLocale.TEXT_CTF_SHORT_NAME);
case BattleMode.CP.name:
return localeService.getText(TanksLocale.TEXT_CP_SHORT_NAME);
case BattleMode.AS.name:
return localeService.getText(TanksLocale.TEXT_AS_SHORT_NAME);
case BattleMode.RUGBY.name:
return localeService.getText(TanksLocale.TEXT_RUGBY_SHORT_NAME);
case BattleMode.JGR.name:
return localeService.getText(TanksLocale.TEXT_JGR_SHORT_NAME);
default:
return null;
}
}
}
}
|
package alternativa.tanks.models.tank.armor.chassis.tracked {
[ModelInterface]
public interface ITrackedChassis {
function getDamping() : Number;
}
}
|
package alternativa.tanks.gui {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.gui.ItemInfoPanelBitmaps_bitmapVampireRate.png")]
public class ItemInfoPanelBitmaps_bitmapVampireRate extends BitmapAsset {
public function ItemInfoPanelBitmaps_bitmapVampireRate() {
super();
}
}
}
|
package assets.windowinner.elemets {
import flash.display.Sprite;
[Embed(source="/_assets/assets.swf", symbol="symbol770")]
public class WindowInnerBottomRightCorner extends Sprite {
public function WindowInnerBottomRightCorner() {
super();
}
}
}
|
package controls.resultassets {
import assets.resultwindow.bres_NORMAL_RED_PIXEL;
import assets.resultwindow.bres_NORMAL_RED_TL;
import controls.statassets.StatLineBase;
public class ResultWindowRedNormal extends StatLineBase {
public function ResultWindowRedNormal() {
super();
tl = new bres_NORMAL_RED_TL(1,1);
px = new bres_NORMAL_RED_PIXEL(1,1);
}
}
}
|
package alternativa.tanks.model.payment.modes.asyncurl {
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.type.IGameObject;
public class AsyncUrlPayModeEvents implements AsyncUrlPayMode {
private var object:IGameObject;
private var impl:Vector.<Object>;
public function AsyncUrlPayModeEvents(param1:IGameObject, param2:Vector.<Object>) {
super();
this.object = param1;
this.impl = param2;
}
public function requestAsyncUrl() : void {
var i:int = 0;
var m:AsyncUrlPayMode = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = AsyncUrlPayMode(this.impl[i]);
m.requestAsyncUrl();
i++;
}
}
finally {
Model.popObject();
}
}
}
}
|
package projects.tanks.client.battlefield.models.drone {
import alternativa.osgi.OSGi;
import alternativa.protocol.ICodec;
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 DroneIndicatorModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:DroneIndicatorModelServer;
private var client:IDroneIndicatorModelBase = IDroneIndicatorModelBase(this);
private var modelId:Long = Long.getLong(1936258281,-1608612342);
private var _notReadyId:Long = Long.getLong(1675079766,1720830299);
private var _readyId:Long = Long.getLong(1926631125,-1544324792);
private var _reloadId:Long = Long.getLong(403977249,629765924);
private var _reload_durationMsCodec:ICodec;
private var _setBatteriesAmountId:Long = Long.getLong(1248011373,2011342868);
private var _setBatteriesAmount_amountCodec:ICodec;
public function DroneIndicatorModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new DroneIndicatorModelServer(IModel(this));
var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry));
local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(DroneIndicatorCC,false)));
this._reload_durationMsCodec = this._protocol.getCodec(new TypeCodecInfo(int,false));
this._setBatteriesAmount_amountCodec = this._protocol.getCodec(new TypeCodecInfo(int,false));
}
protected function getInitParam() : DroneIndicatorCC {
return DroneIndicatorCC(initParams[Model.object]);
}
override public function invoke(param1:Long, param2:ProtocolBuffer) : void {
switch(param1) {
case this._notReadyId:
this.client.notReady();
break;
case this._readyId:
this.client.ready();
break;
case this._reloadId:
this.client.reload(int(this._reload_durationMsCodec.decode(param2)));
break;
case this._setBatteriesAmountId:
this.client.setBatteriesAmount(int(this._setBatteriesAmount_amountCodec.decode(param2)));
}
}
override public function get id() : Long {
return this.modelId;
}
}
}
|
package alternativa.tanks.models.sfx.shoot.thunder
{
import alternativa.engine3d.alternativa3d;
import alternativa.engine3d.core.Object3D;
import alternativa.engine3d.materials.FillMaterial;
import alternativa.engine3d.materials.Material;
import alternativa.engine3d.objects.Mesh;
import alternativa.engine3d.objects.Sprite3D;
import alternativa.math.Matrix3;
import alternativa.math.Matrix4;
import alternativa.math.Vector3;
import alternativa.object.ClientObject;
import alternativa.tanks.camera.GameCamera;
import alternativa.tanks.models.battlefield.scene3dcontainer.Scene3DContainer;
import alternativa.tanks.sfx.IGraphicEffect;
import alternativa.tanks.utils.objectpool.ObjectPool;
import alternativa.tanks.utils.objectpool.PooledObject;
import flash.display.BlendMode;
use namespace alternativa3d;
public class ThunderShotEffect extends PooledObject implements IGraphicEffect
{
private static const speed1:Number = 500;
private static const speed2:Number = 1000;
private static const speed3:Number = 1500;
private static const raySpeed1:Number = 1500;
private static const raySpeed2:Number = 2500;
private static const raySpeed3:Number = 1300;
private static var basePoint:Vector3 = new Vector3();
private static var direction:Vector3 = new Vector3();
private static var axis:Vector3 = new Vector3();
private static var eulerAngles:Vector3 = new Vector3();
private static var rayMaterial:FillMaterial = new FillMaterial(4294753806);
private static var turretMatrix:Matrix4 = new Matrix4();
private static var trailMatrix:Matrix3 = new Matrix3();
private static var trailMatrix2:Matrix3 = new Matrix3();
private var turret:Object3D;
private var localMuzzlePoint:Vector3;
private var sprite1:Sprite3D;
private var sprite2:Sprite3D;
private var sprite3:Sprite3D;
private var ray1:Trail;
private var ray2:Trail;
private var ray3:Trail;
private var distance1:Number = 40;
private var distance2:Number = 75;
private var distance3:Number = 80;
private var rayDistance1:Number = 0;
private var rayDistance2:Number = 0;
private var rayDistance3:Number = 0;
private var angle1:Number;
private var angle2:Number;
private var angle3:Number;
private var timeToLive:int;
public function ThunderShotEffect(objectPool:ObjectPool)
{
super(objectPool);
this.createParticles();
}
public function init(turret:Object3D, muzzleLocalPoint:Vector3, material:Material) : void
{
this.turret = turret;
this.localMuzzlePoint = muzzleLocalPoint;
this.sprite1.material = material;
this.sprite2.material = material;
this.sprite3.material = material;
this.timeToLive = 50;
this.distance1 = 40;
this.distance2 = 75;
this.distance3 = 80;
this.rayDistance1 = 0;
this.rayDistance2 = 0;
this.rayDistance3 = 0;
this.angle1 = Math.random() * 2 * Math.PI;
this.angle2 = Math.random() * 2 * Math.PI;
this.angle3 = Math.random() * 2 * Math.PI;
}
public function addToContainer(container:Scene3DContainer) : void
{
container.addChild(this.sprite1);
container.addChild(this.sprite2);
container.addChild(this.sprite3);
container.addChild(this.ray1);
container.addChild(this.ray2);
container.addChild(this.ray3);
}
public function play(millis:int, camera:GameCamera) : Boolean
{
if(this.timeToLive < 0)
{
return false;
}
turretMatrix.setMatrix(this.turret.x,this.turret.y,this.turret.z,this.turret.rotationX,this.turret.rotationY,this.turret.rotationZ);
turretMatrix.transformVector(this.localMuzzlePoint,basePoint);
direction.x = turretMatrix.b;
direction.y = turretMatrix.f;
direction.z = turretMatrix.j;
var dt:Number = 0.001 * millis;
this.rayDistance1 += dt * raySpeed1;
this.rayDistance2 += dt * raySpeed2;
this.rayDistance3 += dt * raySpeed3;
this.setSpritePosition(this.sprite1,basePoint,direction,this.distance1);
this.setSpritePosition(this.sprite2,basePoint,direction,this.distance2);
this.setSpritePosition(this.sprite3,basePoint,direction,this.distance3);
this.setRayMatrix(this.ray1,this.angle1,basePoint,direction,this.rayDistance1,0,10);
this.setRayMatrix(this.ray2,this.angle2,basePoint,direction,this.rayDistance2,-7,0);
this.setRayMatrix(this.ray3,this.angle3,basePoint,direction,this.rayDistance3,7,0);
this.distance1 += dt * speed1;
this.distance2 += dt * speed2;
this.distance3 += dt * speed3;
this.timeToLive -= millis;
return true;
}
public function destroy() : void
{
this.sprite1.removeFromParent();
this.sprite2.removeFromParent();
this.sprite3.removeFromParent();
this.ray1.removeFromParent();
this.ray2.removeFromParent();
this.ray3.removeFromParent();
storeInPool();
}
public function kill() : void
{
this.timeToLive = -1;
}
public function get owner() : ClientObject
{
return null;
}
override protected function getClass() : Class
{
return ThunderShotEffect;
}
private function createParticles() : void
{
this.sprite1 = this.createSprite(120);
this.sprite2 = this.createSprite(99.75);
this.sprite3 = this.createSprite(79.5);
this.ray1 = new Trail(0.8,rayMaterial);
this.ray2 = new Trail(0.75,rayMaterial);
this.ray3 = new Trail(0.82,rayMaterial);
}
private function createSprite(size:Number) : Sprite3D
{
var sprite:Sprite3D = new Sprite3D(size,size);
sprite.rotation = 2 * Math.PI * Math.random();
sprite.blendMode = BlendMode.SCREEN;
return sprite;
}
private function setSpritePosition(sprite:Sprite3D, basePoint:Vector3, dir:Vector3, distance:Number) : void
{
sprite.x = basePoint.x + dir.x * distance;
sprite.y = basePoint.y + dir.y * distance;
sprite.z = basePoint.z + dir.z * distance;
}
private function setRayMatrix(ray:Mesh, angle:Number, basePoint:Vector3, dir:Vector3, distance:Number, dx:Number, dz:Number) : void
{
trailMatrix.fromAxisAngle(Vector3.Y_AXIS,angle);
if(dir.y < -0.99999 || dir.y > 0.99999)
{
axis.x = 0;
axis.y = 0;
axis.z = 1;
angle = dir.y < 0 ? Number(Number(Math.PI)) : Number(Number(0));
}
else
{
axis.x = dir.z;
axis.y = 0;
axis.z = -dir.x;
axis.vNormalize();
angle = Math.acos(dir.y);
}
trailMatrix2.fromAxisAngle(axis,angle);
trailMatrix.append(trailMatrix2);
trailMatrix.getEulerAngles(eulerAngles);
ray.rotationX = eulerAngles.x;
ray.rotationY = eulerAngles.y;
ray.rotationZ = eulerAngles.z;
ray.x = basePoint.x + dir.x * distance + dx * trailMatrix.a + dz * trailMatrix.c;
ray.y = basePoint.y + dir.y * distance + dx * trailMatrix.e + dz * trailMatrix.g;
ray.z = basePoint.z + dir.z * distance + dx * trailMatrix.i + dz * trailMatrix.k;
}
}
}
import alternativa.engine3d.alternativa3d;
import alternativa.engine3d.core.Face;
import alternativa.engine3d.core.Vertex;
import alternativa.engine3d.core.Wrapper;
import alternativa.engine3d.materials.Material;
import alternativa.engine3d.objects.Mesh;
import flash.display.BlendMode;
use namespace alternativa3d;
class Trail extends Mesh
{
function Trail(scale:Number, material:Material)
{
super();
var h:Number = 240 * scale;
var a:Vertex = this.createVertex(-4,0,0,0,0);
var b:Vertex = this.createVertex(4,0,0,0,1);
var c:Vertex = this.createVertex(0,h,0,1,0.5);
this.createFace(a,b,c).material = material;
this.createFace(c,b,a).material = material;
calculateFacesNormals(true);
calculateBounds();
blendMode = BlendMode.SCREEN;
alpha = 0.3;
}
private function createVertex(x:Number, y:Number, z:Number, u:Number, v:Number) : Vertex
{
var newVertex:Vertex = new Vertex();
newVertex.next = vertexList;
vertexList = newVertex;
newVertex.x = x;
newVertex.y = y;
newVertex.z = z;
newVertex.u = u;
newVertex.v = v;
return newVertex;
}
private function createFace(a:Vertex, b:Vertex, c:Vertex) : Face
{
var newFace:Face = new Face();
newFace.next = faceList;
faceList = newFace;
newFace.wrapper = new Wrapper();
newFace.wrapper.vertex = a;
newFace.wrapper.next = new Wrapper();
newFace.wrapper.next.vertex = b;
newFace.wrapper.next.next = new Wrapper();
newFace.wrapper.next.next.vertex = c;
return newFace;
}
}
|
package controls.dropdownlist {
import assets.windowinner.bitmaps.WindowInnerBottom;
import assets.windowinner.bitmaps.WindowInnerLeft;
import assets.windowinner.bitmaps.WindowInnerRight;
import assets.windowinner.bitmaps.WindowInnerTop;
import assets.windowinner.elemets.WindowInnerBottomLeftCorner;
import assets.windowinner.elemets.WindowInnerBottomRightCorner;
import assets.windowinner.elemets.WindowInnerTopLeftCorner;
import assets.windowinner.elemets.WindowInnerTopRightCorner;
import flash.display.BitmapData;
import flash.display.Graphics;
import flash.display.Shape;
import flash.display.Sprite;
public class DPLBackground extends Sprite {
protected static var _bgBMP:BitmapData;
private static const bitmapBG:Class = DPLBackground_bitmapBG;
private var _width:int = 0;
private var _height:int = 0;
private var tl:WindowInnerTopLeftCorner = new WindowInnerTopLeftCorner();
private var tr:WindowInnerTopRightCorner = new WindowInnerTopRightCorner();
private var bl:WindowInnerBottomLeftCorner = new WindowInnerBottomLeftCorner();
private var br:WindowInnerBottomRightCorner = new WindowInnerBottomRightCorner();
private var topBMP:WindowInnerTop = new WindowInnerTop(0,0);
private var bottomBMP:WindowInnerBottom = new WindowInnerBottom(0,0);
private var leftBMP:WindowInnerLeft = new WindowInnerLeft(0,0);
private var rightBMP:WindowInnerRight = new WindowInnerRight(0,0);
private var bg:Sprite = new Sprite();
private var top:Shape = new Shape();
private var bottom:Shape = new Shape();
private var left:Shape = new Shape();
private var right:Shape = new Shape();
public function DPLBackground(param1:int, param2:int) {
super();
this._width = param1;
this._height = param2;
addChild(this.bg);
addChild(this.top);
addChild(this.bottom);
addChild(this.left);
addChild(this.right);
addChild(this.tl);
addChild(this.tr);
addChild(this.bl);
addChild(this.br);
this.draw();
}
protected function get bgBMP() : BitmapData {
if(!_bgBMP) {
_bgBMP = new bitmapBG().bitmapData;
}
return _bgBMP;
}
protected function draw() : void {
var local1:Graphics = null;
local1 = this.bg.graphics;
local1.clear();
local1.beginBitmapFill(this.bgBMP);
local1.drawRect(1,1,this._width - 2,this._height - 2);
local1.endFill();
local1 = this.top.graphics;
local1.clear();
local1.beginBitmapFill(this.topBMP);
local1.drawRect(0,0,this._width - 12,6);
local1.endFill();
this.top.x = 6;
local1 = this.bottom.graphics;
local1.clear();
local1.beginBitmapFill(this.bottomBMP);
local1.drawRect(0,0,this._width - 12,6);
local1.endFill();
this.bottom.x = 6;
this.bottom.y = this._height - 6;
local1 = this.left.graphics;
local1.clear();
local1.beginBitmapFill(this.leftBMP);
local1.drawRect(0,0,6,this._height - 12);
local1.endFill();
this.left.x = 0;
this.left.y = 6;
local1 = this.right.graphics;
local1.clear();
local1.beginBitmapFill(this.rightBMP);
local1.drawRect(0,0,6,this._height - 12);
local1.endFill();
this.right.x = this._width - 6;
this.right.y = 6;
this.tl.x = 0;
this.tl.y = 0;
this.tr.x = this._width - this.tr.width;
this.tr.y = 0;
this.bl.x = 0;
this.bl.y = this._height - this.bl.height;
this.br.x = this._width - this.br.width;
this.br.y = this._height - this.br.height;
}
override public function set width(param1:Number) : void {
if(this._width == int(param1)) {
return;
}
this._width = param1;
this.draw();
}
override public function get width() : Number {
return this._width;
}
override public function set height(param1:Number) : void {
if(this._height == int(param1)) {
return;
}
this._height = param1;
this.draw();
}
override public function get height() : Number {
return this._height;
}
public function setSize(param1:int, param2:int) : void {
this._width = param1;
this._height = param2;
this.draw();
}
}
}
|
package alternativa.tanks.gui
{
import alternativa.init.Main;
import alternativa.model.IModel;
import alternativa.osgi.service.locale.ILocaleService;
import alternativa.resource.StubBitmapData;
import alternativa.service.IModelService;
import alternativa.service.IResourceService;
import alternativa.tanks.gui.shopitems.item.kits.KitPackage;
import alternativa.tanks.gui.shopitems.item.kits.description.KitPackageDescriptionView;
import alternativa.tanks.gui.shopitems.item.kits.description.KitsData;
import alternativa.tanks.gui.shopitems.item.kits.description.KitsInfoData;
import alternativa.tanks.locale.constants.TextConst;
import alternativa.tanks.model.GarageModel;
import alternativa.tanks.model.IItemEffect;
import alternativa.tanks.model.ItemParams;
import alternativa.tanks.model.panel.IPanel;
import alternativa.tanks.model.user.IUserData;
import alternativa.tanks.model.user.UserData;
import assets.scroller.color.ScrollThumbSkinGreen;
import assets.scroller.color.ScrollTrackGreen;
import com.alternativaplatform.projects.tanks.client.commons.models.itemtype.ItemTypeEnum;
import com.alternativaplatform.projects.tanks.client.commons.types.ItemProperty;
import com.alternativaplatform.projects.tanks.client.garage.garage.ItemInfo;
import com.alternativaplatform.projects.tanks.client.garage.item.ItemPropertyValue;
import com.alternativaplatform.projects.tanks.client.garage.item.ModificationInfo;
import controls.Label;
import controls.NumStepper;
import controls.TankWindow;
import controls.TankWindowHeader;
import controls.TankWindowInner;
import fl.containers.ScrollPane;
import fl.controls.ScrollPolicy;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.DisplayObject;
import flash.display.Shape;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.net.URLRequest;
import flash.net.navigateToURL;
import flash.text.TextFieldType;
import flash.utils.Dictionary;
import forms.garage.GarageButton;
import forms.garage.GarageRenewalButton;
import projects.tanks.client.panel.model.shop.kitpackage.KitPackageItemInfo;
import scpacker.resource.ResourceType;
import scpacker.resource.ResourceUtil;
import scpacker.resource.images.ImageResource;
public class ItemInfoPanel extends Sprite
{
[Embed(source="907.png")]
private static const bitmapArea:Class;
private static const areaBd:BitmapData = new bitmapArea().bitmapData;
[Embed(source="1132.png")]
private static const bitmapArmorWear:Class;
private static const damageBd:BitmapData = new bitmapArmorWear().bitmapData;
[Embed(source="852.png")]
private static const bitmapArmor:Class;
private static const armorBd:BitmapData = new bitmapArmor().bitmapData;
[Embed(source="925.png")]
private static const bitmapEnergyConsumption:Class;
private static const energyConsumptionBd:BitmapData = new bitmapEnergyConsumption().bitmapData;
[Embed(source="1200.png")]
private static const bitmapPower:Class;
private static const powerBd:BitmapData = new bitmapPower().bitmapData;
[Embed(source="1072.png")]
private static const bitmapRange:Class;
private static const rangeBd:BitmapData = new bitmapRange().bitmapData;
[Embed(source="1057.png")]
private static const bitmapRateOfFire:Class;
private static const rateOfFireBd:BitmapData = new bitmapRateOfFire().bitmapData;
[Embed(source="859.png")]
private static const bitmapResourceWear:Class;
private static const resourceWearBd:BitmapData = new bitmapResourceWear().bitmapData;
[Embed(source="1114.png")]
private static const bitmapResource:Class;
private static const resourceBd:BitmapData = new bitmapResource().bitmapData;
[Embed(source="884.png")]
private static const bitmapSpread:Class;
private static const spreadBd:BitmapData = new bitmapSpread().bitmapData;
[Embed(source="908.png")]
private static const bitmapTurretRotationRate:Class;
private static const turretRotationRateBd:BitmapData = new bitmapTurretRotationRate().bitmapData;
[Embed(source="1192.png")]
private static const bitmapSpeed:Class;
private static const speedBd:BitmapData = new bitmapSpeed().bitmapData;
[Embed(source="786.png")]
private static const bitmapTurnSpeed:Class;
private static const turnspeedBd:BitmapData = new bitmapTurnSpeed().bitmapData;
[Embed(source="1131.png")]
private static const bitmapFireResistance:Class;
private static const fireResistanceBd:BitmapData = new bitmapFireResistance().bitmapData;
[Embed(source="969.png")]
private static const bitmapPlasmaResistance:Class;
private static const plasmaResistanceBd:BitmapData = new bitmapPlasmaResistance().bitmapData;
[Embed(source="1064.png")]
private static const bitmapMechResistance:Class;
private static const mechResistanceBd:BitmapData = new bitmapMechResistance().bitmapData;
[Embed(source="874.png")]
private static const bitmapRailResistance:Class;
private static const railResistanceBd:BitmapData = new bitmapRailResistance().bitmapData;
[Embed(source="1039.png")]
private static const bitmapTerminatorResistance:Class;
private static const terminatorResistanceBd:BitmapData = new bitmapTerminatorResistance().bitmapData;
[Embed(source="829.png")]
private static const bitmapCriticalChance:Class;
private static const criticalChanceBd:BitmapData = new bitmapCriticalChance().bitmapData;
[Embed(source="754.png")]
private static const bitmapHeatingTime:Class;
private static const heatingTimeBd:BitmapData = new bitmapHeatingTime().bitmapData;
[Embed(source="894.png")]
private static const bitmapMineResistance:Class;
private static const mineResistanceBd:BitmapData = new bitmapMineResistance().bitmapData;
[Embed(source="970.png")]
private static const bitmapVampireResistance:Class;
private static const vampireResistanceBd:BitmapData = new bitmapVampireResistance().bitmapData;
[Embed(source="1074.png")]
private static const bitmapThunderResistance:Class;
private static const thunderResistanceBd:BitmapData = new bitmapThunderResistance().bitmapData;
[Embed(source="1207.png")]
private static const bitmapFreezeResistance:Class;
private static const freezeResistanceBd:BitmapData = new bitmapFreezeResistance().bitmapData;
[Embed(source="1021.png")]
private static const bitmapRicochetResistance:Class;
private static const ricochetResistanceBd:BitmapData = new bitmapRicochetResistance().bitmapData;
[Embed(source="1113.png")]
private static const bitmapHealingRadius:Class;
private static const healingRadiusBd:BitmapData = new bitmapHealingRadius().bitmapData;
[Embed(source="1013.png")]
private static const bitmapHealRate:Class;
private static const healRateBd:BitmapData = new bitmapHealRate().bitmapData;
[Embed(source="785.png")]
private static const bitmapVampireRate:Class;
private static const vampireRateBd:BitmapData = new bitmapVampireRate().bitmapData;
[Embed(source="842.png")]
private static const shaftResistance:Class;
private static const shaftResistanceBd:BitmapData = new shaftResistance().bitmapData;
[Embed(source="806.png")]
private static const bitmapPropertiesLeft:Class;
private static const propertiesLeftBd:BitmapData = new bitmapPropertiesLeft().bitmapData;
[Embed(source="848.png")]
private static const bitmapPropertiesCenter:Class;
private static const propertiesCenterBd:BitmapData = new bitmapPropertiesCenter().bitmapData;
[Embed(source="1204.png")]
private static const bitmapPropertiesRight:Class;
private static const propertiesRightBd:BitmapData = new bitmapPropertiesRight().bitmapData;
[Embed(source="1154.png")]
private static const bitmapUpgradeTableLeft:Class;
private static const upgradeTableLeftBd:BitmapData = new bitmapUpgradeTableLeft().bitmapData;
[Embed(source="1014.png")]
private static const bitmapUpgradeTableCenter:Class;
private static const upgradeTableCenterBd:BitmapData = new bitmapUpgradeTableCenter().bitmapData;
[Embed(source="1003.png")]
private static const bitmapUpgradeTableRight:Class;
private static const upgradeTableRightBd:BitmapData = new bitmapUpgradeTableRight().bitmapData;
[Embed(source="1083.png")]
private static const bitmapDamageShaft:Class;
private static const shaftDamageBd:BitmapData = new bitmapDamageShaft().bitmapData;
[Embed(source="804.png")]
private static const bitmapFireRateShaft:Class;
private static const shaftFireRateBd:BitmapData = new bitmapFireRateShaft().bitmapData;
public static const INVENTORY_MAX_VALUE:int = 9999;
public static const INVENTORY_MIN_VALUE:int = 1;
private var resourceRegister:IResourceService;
private var modelRegister:IModelService;
private var localeService:ILocaleService;
private var panelModel:IPanel;
private var window:TankWindow;
public var size:Point;
public const margin:int = 11;
private const bottomMargin:int = 64;
private var inner:TankWindowInner;
private var preview:Bitmap;
private var previewVisible:Boolean;
public var nameTf:Label;
public var descrTf:Label;
public var buttonBuy:GarageButton;
public var buttonEquip:GarageButton;
public var buttonUpgrade:GarageButton;
public var buttonSkin:GarageButton;
public var buttonBuyCrystals:GarageRenewalButton;
public var inventoryNumStepper:NumStepper;
private const buttonSize:Point = new Point(120,50);
public var areaIcon:ItemPropertyIcon;
public var armorIcon:ItemPropertyIcon;
public var damageIcon:ItemPropertyIcon;
public var damagePerSecondIcon:ItemPropertyIcon;
public var energyConsumptionIcon:ItemPropertyIcon;
public var powerIcon:ItemPropertyIcon;
public var rangeIcon:ItemPropertyIcon;
public var rateOfFireIcon:ItemPropertyIcon;
public var resourceIcon:ItemPropertyIcon;
public var resourceWearIcon:ItemPropertyIcon;
public var shotWearIcon:ItemPropertyIcon;
public var timeWearIcon:ItemPropertyIcon;
public var shotTimeWearIcon:ItemPropertyIcon;
public var spreadIcon:ItemPropertyIcon;
public var turretRotationRateIcon:ItemPropertyIcon;
public var damageAngleIcon:ItemPropertyIcon;
public var speedIcon:ItemPropertyIcon;
public var turnSpeedIcon:ItemPropertyIcon;
public var criticalChanceIcon:ItemPropertyIcon;
public var heatingTimeIcon:ItemPropertyIcon;
public var mechResistanceIcon:ItemPropertyIcon;
public var plasmaResistanceIcon:ItemPropertyIcon;
public var fireResistanceIcon:ItemPropertyIcon;
public var railResistanceIcon:ItemPropertyIcon;
public var mineResistanceIcon:ItemPropertyIcon;
public var terminatorResistanceIcon:ItemPropertyIcon;
public var vampireResistanceIcon:ItemPropertyIcon;
public var thunderResistanceIcon:ItemPropertyIcon;
public var freezeResistanceIcon:ItemPropertyIcon;
public var ricochetResistanceIcon:ItemPropertyIcon;
public var shaftResistanceIcon:ItemPropertyIcon;
public var healingRadiusIcon:ItemPropertyIcon;
public var healRateIcon:ItemPropertyIcon;
public var vampireRateIcon:ItemPropertyIcon;
public var shaftDamageIcon:ItemPropertyIcon;
public var shaftRateOfFireIcon:ItemPropertyIcon;
private const iconSpace:int = 10;
private var visibleIcons:Array;
private var id:String;
private var params:ItemParams;
private var info:ItemInfo;
private var type:ItemTypeEnum;
private var upgradeProperties:Array;
private var scrollPane:ScrollPane;
private var scrollContainer:Sprite;
private var propertiesPanel:Sprite;
private var propertiesPanelLeft:Bitmap;
private var propertiesPanelCenter:Bitmap;
private var propertiesPanelRight:Bitmap;
private var area:Shape;
private var area2:Shape;
private var areaRect:Rectangle;
private var areaRect2:Rectangle;
private var horizMargin:int = 12;
private var vertMargin:int = 9;
private var spaceModule:int = 3;
private var cutPreview:int = 0;
private var hidePreviewLimit:int = 275;
private var timeIndicator:Label;
public var requiredCrystalsNum:int;
private var modTable:ModTable;
public var availableSkins:Array;
public var skinsParams:Dictionary;
private var skinText:String;
private var isKit:Boolean = false;
private var kitView:KitPackageDescriptionView;
public function ItemInfoPanel()
{
super();
this.resourceRegister = Main.osgi.getService(IResourceService) as IResourceService;
this.modelRegister = Main.osgi.getService(IModelService) as IModelService;
this.localeService = Main.osgi.getService(ILocaleService) as ILocaleService;
this.panelModel = Main.osgi.getService(IPanel) as IPanel;
this.availableSkins = new Array();
this.skinsParams = new Dictionary();
this.kitView = new KitPackageDescriptionView();
this.size = new Point(400,300);
this.window = new TankWindow(this.size.x,this.size.y);
addChild(this.window);
this.window.headerLang = this.localeService.getText(TextConst.GUI_LANG);
this.window.header = TankWindowHeader.INFORMATION;
this.inner = new TankWindowInner(164,106,TankWindowInner.GREEN);
this.inner.showBlink = true;
addChild(this.inner);
this.inner.x = this.margin;
this.inner.y = this.margin;
this.area = new Shape();
this.area2 = new Shape();
this.areaRect = new Rectangle();
this.areaRect2 = new Rectangle(this.horizMargin,this.vertMargin,0,0);
this.scrollContainer = new Sprite();
this.scrollContainer.x = this.margin + 1;
this.scrollContainer.y = this.margin + 1;
this.scrollContainer.addChild(this.area);
this.scrollContainer.addChild(this.area2);
this.scrollPane = new ScrollPane();
addChild(this.scrollPane);
this.confScroll();
this.scrollPane.horizontalScrollPolicy = ScrollPolicy.OFF;
this.scrollPane.verticalScrollPolicy = ScrollPolicy.AUTO;
this.scrollPane.source = this.scrollContainer;
this.scrollPane.focusEnabled = false;
this.scrollPane.x = this.margin + 1;
this.scrollPane.y = this.margin + 1 + this.spaceModule;
var userModel:UserData = Main.osgi.getService(IUserData) as UserData;
var userName:String = userModel.name;
this.nameTf = new Label();
this.nameTf.type = TextFieldType.DYNAMIC;
this.nameTf.text = "Hello, " + userName + "!";
this.nameTf.size = 18;
this.nameTf.color = 381208;
this.scrollContainer.addChild(this.nameTf);
this.nameTf.x = this.horizMargin - 3;
this.nameTf.y = this.vertMargin - 7;
this.descrTf = new Label();
this.descrTf.multiline = true;
this.descrTf.wordWrap = true;
this.descrTf.color = 381208;
this.descrTf.htmlText = "Description";
this.scrollContainer.addChild(this.descrTf);
this.descrTf.x = this.horizMargin - 3;
this.preview = new Bitmap();
this.buttonBuy = new GarageButton();
this.buttonEquip = new GarageButton();
this.buttonUpgrade = new GarageButton();
this.buttonSkin = new GarageButton();
this.buttonBuyCrystals = new GarageRenewalButton();
this.buttonBuy.icon = null;
this.buttonBuy.label = this.localeService.getText(TextConst.GARAGE_INFO_PANEL_BUTTON_BUY_TEXT);
this.buttonEquip.label = this.localeService.getText(TextConst.GARAGE_INFO_PANEL_BUTTON_EQUIP_TEXT);
this.buttonUpgrade.label = this.localeService.getText(TextConst.GARAGE_INFO_PANEL_BUTTON_UPGRADE_TEXT);
this.buttonBuyCrystals.label = this.localeService.getText(TextConst.GARAGE_INFO_PANEL_BUTTON_ADD_CRYSTALS_TEXT);
this.buttonBuyCrystals.addEventListener(MouseEvent.CLICK,function(e:MouseEvent):void
{
navigateToURL(new URLRequest("http://mytankspay.net/pay.php?cry=" + (-(panelModel.crystal >= params.price ? params.price : -params.price) - panelModel.crystal) + "&nick=" + panelModel.userName),"_self");
});
this.buttonSkin.label = "";
addChild(this.buttonBuy);
addChild(this.buttonEquip);
addChild(this.buttonUpgrade);
addChild(this.buttonSkin);
this.buttonSkin.visible = false;
addChild(this.buttonBuyCrystals);
this.inventoryNumStepper = new NumStepper();
addChild(this.inventoryNumStepper);
this.inventoryNumStepper.value = 1;
this.inventoryNumStepper.minValue = 1;
this.inventoryNumStepper.maxValue = ItemInfoPanel.INVENTORY_MAX_VALUE;
this.inventoryNumStepper.visible = false;
this.inventoryNumStepper.addEventListener(Event.CHANGE,this.inventoryNumChanged);
this.propertiesPanel = new Sprite();
this.propertiesPanelLeft = new Bitmap(propertiesLeftBd);
this.propertiesPanel.addChild(this.propertiesPanelLeft);
this.propertiesPanelCenter = new Bitmap(propertiesCenterBd);
this.propertiesPanel.addChild(this.propertiesPanelCenter);
this.propertiesPanelRight = new Bitmap(propertiesRightBd);
this.propertiesPanel.addChild(this.propertiesPanelRight);
this.propertiesPanelCenter.x = this.propertiesPanelLeft.width;
this.propertiesPanel.x = this.horizMargin;
this.propertiesPanel.y = Math.round(this.vertMargin * 2 + this.nameTf.textHeight - 7);
this.areaIcon = new ItemPropertyIcon(areaBd,this.localeService.getText(TextConst.GARAGE_INFO_PANEL_DISTANCE_UNIT_TEXT));
this.armorIcon = new ItemPropertyIcon(armorBd,this.localeService.getText(TextConst.GARAGE_INFO_PANEL_HEALTH_UNIT_TEXT));
this.damageIcon = new ItemPropertyIcon(damageBd,this.localeService.getText(TextConst.GARAGE_INFO_PANEL_HEALTH_UNIT_TEXT));
this.damagePerSecondIcon = new ItemPropertyIcon(damageBd,this.localeService.getText(TextConst.GARAGE_INFO_PANEL_DAMAGE_SPEED_UNIT_TEXT));
this.energyConsumptionIcon = new ItemPropertyIcon(energyConsumptionBd,this.localeService.getText(TextConst.GARAGE_INFO_PANEL_POWER_UNIT_TEXT));
this.powerIcon = new ItemPropertyIcon(powerBd,this.localeService.getText(TextConst.GARAGE_INFO_PANEL_POWER_UNIT_TEXT));
this.rangeIcon = new ItemPropertyIcon(rangeBd,this.localeService.getText(TextConst.GARAGE_INFO_PANEL_DISTANCE_UNIT_TEXT));
this.rateOfFireIcon = new ItemPropertyIcon(rateOfFireBd,this.localeService.getText(TextConst.GARAGE_INFO_PANEL_RATE_OF_FIRE_UNIT_TEXT));
this.resourceIcon = new ItemPropertyIcon(resourceBd,this.localeService.getText(TextConst.GARAGE_INFO_PANEL_RESOURCE_UNIT_TEXT));
this.resourceWearIcon = new ItemPropertyIcon(resourceWearBd,this.localeService.getText(TextConst.GARAGE_INFO_PANEL_RESOURCE_UNIT_TEXT));
this.shotWearIcon = new ItemPropertyIcon(resourceWearBd,this.localeService.getText(TextConst.GARAGE_INFO_PANEL_RESOURCE_SHOT_WEAR_UNIT_TEXT));
this.timeWearIcon = new ItemPropertyIcon(resourceWearBd,this.localeService.getText(TextConst.GARAGE_INFO_PANEL_RESOURCE_TIME_WEAR_UNIT_TEXT));
this.shotTimeWearIcon = new ItemPropertyIcon(resourceWearBd,this.localeService.getText(TextConst.GARAGE_INFO_PANEL_RESOURCE_SHOT_TIME_WEAR_UNIT_TEXT));
this.spreadIcon = new ItemPropertyIcon(spreadBd,this.localeService.getText(TextConst.GARAGE_INFO_PANEL_ANGLE_UNIT_TEXT));
this.turretRotationRateIcon = new ItemPropertyIcon(turretRotationRateBd,this.localeService.getText(TextConst.GARAGE_INFO_PANEL_TURN_SPEED_UNIT_TEXT));
this.damageAngleIcon = new ItemPropertyIcon(spreadBd,this.localeService.getText(TextConst.GARAGE_INFO_PANEL_ANGLE_UNIT_TEXT));
this.speedIcon = new ItemPropertyIcon(speedBd,this.localeService.getText(TextConst.GARAGE_INFO_PANEL_SPEED_UNIT_TEXT));
this.turnSpeedIcon = new ItemPropertyIcon(turnspeedBd,this.localeService.getText(TextConst.GARAGE_INFO_PANEL_TURN_SPEED_UNIT_TEXT));
this.criticalChanceIcon = new ItemPropertyIcon(criticalChanceBd,this.localeService.getText(TextConst.GARAGE_INFO_PANEL_CRITICAL_CHANCE_UNIT_TEXT));
this.heatingTimeIcon = new ItemPropertyIcon(heatingTimeBd,this.localeService.getText(TextConst.GARAGE_INFO_PANEL_HEATING_TIME_UNIT_TEXT));
this.mechResistanceIcon = new ItemPropertyIcon(mechResistanceBd,"%");
this.fireResistanceIcon = new ItemPropertyIcon(fireResistanceBd,"%");
this.plasmaResistanceIcon = new ItemPropertyIcon(plasmaResistanceBd,"%");
this.railResistanceIcon = new ItemPropertyIcon(railResistanceBd,"%");
this.terminatorResistanceIcon = new ItemPropertyIcon(terminatorResistanceBd,"%");
this.mineResistanceIcon = new ItemPropertyIcon(mineResistanceBd,"%");
this.vampireResistanceIcon = new ItemPropertyIcon(vampireResistanceBd,"%");
this.thunderResistanceIcon = new ItemPropertyIcon(thunderResistanceBd,"%");
this.freezeResistanceIcon = new ItemPropertyIcon(freezeResistanceBd,"%");
this.ricochetResistanceIcon = new ItemPropertyIcon(ricochetResistanceBd,"%");
this.shaftResistanceIcon = new ItemPropertyIcon(shaftResistanceBd,"%");
this.healingRadiusIcon = new ItemPropertyIcon(healingRadiusBd,this.localeService.getText(TextConst.GARAGE_INFO_PANEL_DISTANCE_UNIT_TEXT));
this.healRateIcon = new ItemPropertyIcon(healRateBd,this.localeService.getText(TextConst.GARAGE_INFO_PANEL_DAMAGE_SPEED_UNIT_TEXT));
this.vampireRateIcon = new ItemPropertyIcon(vampireRateBd,this.localeService.getText(TextConst.GARAGE_INFO_PANEL_DAMAGE_SPEED_UNIT_TEXT));
this.shaftDamageIcon = new ItemPropertyIcon(shaftDamageBd,"hp");
this.shaftRateOfFireIcon = new ItemPropertyIcon(shaftFireRateBd,"shot/min");
this.timeIndicator = new Label();
this.timeIndicator.size = 18;
this.timeIndicator.color = 381208;
this.visibleIcons = new Array();
this.modTable = new ModTable();
this.modTable.x = this.horizMargin;
}
public function hide() : void
{
this.resourceRegister = null;
this.modelRegister = null;
this.panelModel = null;
this.window = null;
this.inner = null;
this.preview = null;
this.nameTf = null;
this.descrTf = null;
this.visibleIcons = null;
this.id = null;
this.type = null;
this.upgradeProperties = null;
this.scrollPane = null;
this.scrollContainer = null;
this.propertiesPanel = null;
this.propertiesPanelLeft = null;
this.propertiesPanelCenter = null;
this.propertiesPanelRight = null;
this.area = null;
this.area2 = null;
this.areaRect = null;
this.areaRect2 = null;
this.buttonBuy = null;
this.buttonEquip = null;
this.buttonUpgrade = null;
this.buttonSkin = null;
this.buttonBuyCrystals = null;
this.areaIcon = null;
this.armorIcon = null;
this.damageIcon = null;
this.damagePerSecondIcon = null;
this.energyConsumptionIcon = null;
this.powerIcon = null;
this.rangeIcon = null;
this.rateOfFireIcon = null;
this.resourceIcon = null;
this.resourceWearIcon = null;
this.shotWearIcon = null;
this.timeWearIcon = null;
this.shotTimeWearIcon = null;
this.spreadIcon = null;
this.turretRotationRateIcon = null;
this.damageAngleIcon = null;
this.speedIcon = null;
this.turnSpeedIcon = null;
this.criticalChanceIcon = null;
this.heatingTimeIcon = null;
this.mechResistanceIcon = null;
this.fireResistanceIcon = null;
this.plasmaResistanceIcon = null;
this.railResistanceIcon = null;
this.terminatorResistanceIcon = null;
this.mineResistanceIcon = null;
this.vampireResistanceIcon = null;
this.thunderResistanceIcon = null;
this.freezeResistanceIcon = null;
this.ricochetResistanceIcon = null;
this.shaftResistanceIcon = null;
this.healingRadiusIcon = null;
this.healRateIcon = null;
this.vampireRateIcon = null;
this.vampireRateIcon = null;
this.vampireRateIcon = null;
this.vampireRateIcon = null;
this.vampireRateIcon = null;
this.shaftRateOfFireIcon = null;
this.shaftDamageIcon = null;
}
private function confScroll() : void
{
this.scrollPane.setStyle("downArrowUpSkin",ScrollArrowDownGreen);
this.scrollPane.setStyle("downArrowDownSkin",ScrollArrowDownGreen);
this.scrollPane.setStyle("downArrowOverSkin",ScrollArrowDownGreen);
this.scrollPane.setStyle("downArrowDisabledSkin",ScrollArrowDownGreen);
this.scrollPane.setStyle("upArrowUpSkin",ScrollArrowUpGreen);
this.scrollPane.setStyle("upArrowDownSkin",ScrollArrowUpGreen);
this.scrollPane.setStyle("upArrowOverSkin",ScrollArrowUpGreen);
this.scrollPane.setStyle("upArrowDisabledSkin",ScrollArrowUpGreen);
this.scrollPane.setStyle("trackUpSkin",ScrollTrackGreen);
this.scrollPane.setStyle("trackDownSkin",ScrollTrackGreen);
this.scrollPane.setStyle("trackOverSkin",ScrollTrackGreen);
this.scrollPane.setStyle("trackDisabledSkin",ScrollTrackGreen);
this.scrollPane.setStyle("thumbUpSkin",ScrollThumbSkinGreen);
this.scrollPane.setStyle("thumbDownSkin",ScrollThumbSkinGreen);
this.scrollPane.setStyle("thumbOverSkin",ScrollThumbSkinGreen);
this.scrollPane.setStyle("thumbDisabledSkin",ScrollThumbSkinGreen);
}
private function hideAllIcons() : void
{
var icon:DisplayObject = null;
Main.writeVarsToConsoleChannel("GARAGE WINDOW","hideAllIcons");
for(var i:int = 0; i < this.visibleIcons.length; i++)
{
icon = this.visibleIcons[i] as DisplayObject;
if(this.propertiesPanel.contains(icon))
{
this.propertiesPanel.removeChild(icon);
}
}
}
private function showIcons() : void
{
var icon:DisplayObject = null;
Main.writeVarsToConsoleChannel("GARAGE WINDOW","showIcons");
for(var i:int = 0; i < this.visibleIcons.length; i++)
{
icon = this.visibleIcons[i] as DisplayObject;
if(!this.propertiesPanel.contains(icon))
{
this.propertiesPanel.addChild(icon);
}
icon.visible = true;
}
}
public function showItemInfo(itemId:String, itemParams:ItemParams, storeItem:Boolean, itemInfo:ItemInfo = null, mountedItems:Array = null) : void
{
var i:int = 0;
var p:ItemPropertyValue = null;
var j:int = 0;
var pv:ItemPropertyValue = null;
var data:KitsData = null;
var kitPackage:Vector.<KitPackageItemInfo> = null;
var mods:Array = null;
var text:Array = null;
var m:int = 0;
var modInfo:ModificationInfo = null;
var row:ModInfoRow = null;
var maxWidth:int = 0;
var modProperties:Array = null;
var rank:int = 0;
var cost:int = 0;
var acceptableNum:int = 0;
var itemEffectModel:IItemEffect = null;
Main.writeVarsToConsoleChannel("GARAGE WINDOW"," ");
Main.writeVarsToConsoleChannel("GARAGE WINDOW","showItemInfooooo (itemId: %1)",itemId);
this.id = itemId;
this.type = itemParams.itemType;
this.params = itemParams;
this.info = itemInfo;
this.nameTf.text = itemParams.name;
this.descrTf.htmlText = itemParams.description;
var resource:ImageResource = ResourceUtil.getResource(ResourceType.IMAGE,itemId + "_preview") as ImageResource;
var previewBd:BitmapData = null;
if(resource != null)
{
previewBd = resource.bitmapData as BitmapData;
}
else
{
previewBd = new StubBitmapData(16711680);
}
this.preview.bitmapData = previewBd;
var showProperties:Boolean = !(this.type == ItemTypeEnum.ARMOR || this.type == ItemTypeEnum.WEAPON);
this.hideAllIcons();
this.visibleIcons = new Array();
var properties:Array = itemParams.itemProperties;
if(itemId.indexOf("shaft_") < 0)
{
if(properties != null)
{
for(i = 0; i < properties.length; i++)
{
p = properties[i] as ItemPropertyValue;
switch(p.property)
{
case ItemProperty.ARMOR:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: ARMOR");
if(showProperties)
{
this.armorIcon.labelText = p.value;
}
else
{
this.armorIcon.labelText = "";
}
this.visibleIcons[5] = this.armorIcon;
break;
case ItemProperty.DAMAGE:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: DAMAGE");
if(showProperties)
{
this.damageIcon.labelText = p.value;
}
else
{
this.damageIcon.labelText = "";
}
this.visibleIcons[5] = this.damageIcon;
break;
case ItemProperty.DAMAGE_PER_SECOND:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: DAMAGE_PER_SECOND");
if(showProperties)
{
this.damagePerSecondIcon.labelText = p.value;
}
else
{
this.damagePerSecondIcon.labelText = "";
}
this.visibleIcons[5] = this.damagePerSecondIcon;
break;
case ItemProperty.AIMING_ERROR:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: AIMING_ERROR");
if(showProperties)
{
this.spreadIcon.labelText = p.value;
}
else
{
this.spreadIcon.labelText = "";
}
this.visibleIcons[8] = this.spreadIcon;
break;
case ItemProperty.CONE_ANGLE:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: CONE_ANGLE");
if(showProperties)
{
this.damageAngleIcon.labelText = p.value;
}
else
{
this.damageAngleIcon.labelText = "";
}
this.visibleIcons[8] = this.damageAngleIcon;
break;
case ItemProperty.SHOT_AREA:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: SHOT_AREA");
if(showProperties)
{
this.areaIcon.labelText = p.value;
}
else
{
this.areaIcon.labelText = "";
}
this.visibleIcons[10] = this.areaIcon;
break;
case ItemProperty.SHOT_FREQUENCY:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: SHOT_FREQUENCY");
if(showProperties)
{
this.rateOfFireIcon.labelText = p.value;
}
else
{
this.rateOfFireIcon.labelText = "";
}
this.visibleIcons[6] = this.rateOfFireIcon;
break;
case ItemProperty.SHAFT_DAMAGE:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: SHOT_FREQUENCY");
if(showProperties)
{
this.shaftDamageIcon.labelText = p.value;
}
else
{
this.shaftDamageIcon.labelText = "";
}
this.visibleIcons[7] = this.shaftDamageIcon;
break;
case ItemProperty.SHAFT_FIRE_RATE:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: SHOT_FREQUENCY");
if(showProperties)
{
this.shaftRateOfFireIcon.labelText = p.value;
}
else
{
this.shaftRateOfFireIcon.labelText = "";
}
this.visibleIcons[8] = this.shaftRateOfFireIcon;
break;
case ItemProperty.SHOT_RANGE:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: SHOT_RANGE");
if(showProperties)
{
this.rangeIcon.labelText = p.value;
}
else
{
this.rangeIcon.labelText = "";
}
this.visibleIcons[9] = this.rangeIcon;
break;
case ItemProperty.TURRET_TURN_SPEED:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: TURRET_TURN_SPEED");
if(showProperties)
{
this.turretRotationRateIcon.labelText = p.value;
}
else
{
this.turretRotationRateIcon.labelText = "";
}
this.visibleIcons[7] = this.turretRotationRateIcon;
break;
case ItemProperty.SPEED:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: SPEED");
if(showProperties)
{
this.speedIcon.labelText = p.value;
}
else
{
this.speedIcon.labelText = "";
}
this.visibleIcons[11] = this.speedIcon;
break;
case ItemProperty.TURN_SPEED:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: TURN_SPEED");
if(showProperties)
{
this.turnSpeedIcon.labelText = p.value;
}
else
{
this.turnSpeedIcon.labelText = "";
}
this.visibleIcons[12] = this.turnSpeedIcon;
break;
case ItemProperty.CRITICAL_CHANCE:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: CRITICAL_CHANCE");
if(showProperties)
{
this.criticalChanceIcon.labelText = p.value;
}
else
{
this.criticalChanceIcon.labelText = "";
}
this.visibleIcons[25] = this.criticalChanceIcon;
break;
case ItemProperty.HEATING_TIME:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: HEATING_TIME");
if(showProperties)
{
this.heatingTimeIcon.labelText = p.value;
}
else
{
this.heatingTimeIcon.labelText = "";
}
this.visibleIcons[26] = this.heatingTimeIcon;
break;
case ItemProperty.MECH_RESISTANCE:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: MECH_RESISTANCE");
if(showProperties)
{
this.mechResistanceIcon.labelText = p.value;
}
else
{
this.mechResistanceIcon.labelText = "";
}
this.visibleIcons[13] = this.mechResistanceIcon;
break;
case ItemProperty.FIRE_RESISTANCE:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: FIRE_RESISTANCE");
if(showProperties)
{
this.fireResistanceIcon.labelText = p.value;
}
else
{
this.fireResistanceIcon.labelText = "";
}
this.visibleIcons[14] = this.fireResistanceIcon;
break;
case ItemProperty.PLASMA_RESISTANCE:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: PLASMA_RESISTANCE");
if(showProperties)
{
this.plasmaResistanceIcon.labelText = p.value;
}
else
{
this.plasmaResistanceIcon.labelText = "";
}
this.visibleIcons[15] = this.plasmaResistanceIcon;
break;
case ItemProperty.RAIL_RESISTANCE:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: RAIL_RESISTANCE");
if(showProperties)
{
this.railResistanceIcon.labelText = p.value;
}
this.visibleIcons[16] = this.railResistanceIcon;
break;
case ItemProperty.TERMINATOR_RESISTANCE:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: TERMINATOR_RESISTANCE");
if(showProperties)
{
this.terminatorResistanceIcon.labelText = p.value;
}
this.visibleIcons[17] = this.terminatorResistanceIcon;
break;
case ItemProperty.MINE_RESISTANCE:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: TERMINATOR_RESISTANCE");
if(showProperties)
{
this.mineResistanceIcon.labelText = p.value;
}
this.visibleIcons[24] = this.mineResistanceIcon;
break;
case ItemProperty.VAMPIRE_RESISTANCE:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: VAMPIRE_RESISTANCE");
if(showProperties)
{
this.vampireResistanceIcon.labelText = p.value;
}
else
{
this.vampireResistanceIcon.labelText = "";
}
this.visibleIcons[18] = this.vampireResistanceIcon;
break;
case ItemProperty.THUNDER_RESISTANCE:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: THUNDER_RESISTANCE");
if(showProperties)
{
this.thunderResistanceIcon.labelText = p.value;
}
else
{
this.thunderResistanceIcon.labelText = "";
}
this.visibleIcons[19] = this.thunderResistanceIcon;
break;
case ItemProperty.FREEZE_RESISTANCE:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: VAMPIRE_RESISTANCE");
if(showProperties)
{
this.freezeResistanceIcon.labelText = p.value;
}
else
{
this.freezeResistanceIcon.labelText = "";
}
this.visibleIcons[20] = this.freezeResistanceIcon;
break;
case ItemProperty.RICOCHET_RESISTANCE:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: VAMPIRE_RESISTANCE");
if(showProperties)
{
this.ricochetResistanceIcon.labelText = p.value;
}
else
{
this.ricochetResistanceIcon.labelText = "";
}
this.visibleIcons[21] = this.ricochetResistanceIcon;
break;
case ItemProperty.SHAFT_RESISTANCE:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: VAMPIRE_RESISTANCE");
if(showProperties)
{
this.shaftResistanceIcon.labelText = p.value;
}
else
{
this.shaftResistanceIcon.labelText = "";
}
this.visibleIcons[22] = this.shaftResistanceIcon;
break;
case ItemProperty.HEALING_RADUIS:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: HEALING_RADUIS");
if(showProperties)
{
this.healingRadiusIcon.labelText = p.value;
}
else
{
this.healingRadiusIcon.labelText = "";
}
this.visibleIcons[23] = this.healingRadiusIcon;
break;
case ItemProperty.HEAL_RATE:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: HEAL_RATE");
if(showProperties)
{
this.healRateIcon.labelText = p.value;
}
else
{
this.healRateIcon.labelText = "";
}
this.visibleIcons[5] = this.healRateIcon;
break;
case ItemProperty.VAMPIRE_RATE:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: VAMPIRE_RATE");
if(showProperties)
{
this.vampireRateIcon.labelText = p.value;
}
else
{
this.vampireRateIcon.labelText = "";
}
this.visibleIcons[6] = this.vampireRateIcon;
break;
}
}
Main.writeVarsToConsoleChannel("GARAGE WINDOW"," ");
}
}
else
{
for(j = 0; j < properties.length; j++)
{
pv = properties[j] as ItemPropertyValue;
switch(pv.property)
{
case ItemProperty.TURRET_TURN_SPEED:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: TURRET_TURN_SPEED");
if(showProperties)
{
this.turretRotationRateIcon.labelText = p.value;
}
else
{
this.turretRotationRateIcon.labelText = "";
}
this.visibleIcons[4] = this.turretRotationRateIcon;
break;
case ItemProperty.SHAFT_DAMAGE:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: SHOT_FREQUENCY");
if(showProperties)
{
this.shaftDamageIcon.labelText = p.value;
}
else
{
this.shaftDamageIcon.labelText = "";
}
this.visibleIcons[2] = this.shaftDamageIcon;
break;
case ItemProperty.SHAFT_FIRE_RATE:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: SHOT_FREQUENCY");
if(showProperties)
{
this.shaftRateOfFireIcon.labelText = p.value;
}
else
{
this.shaftRateOfFireIcon.labelText = "";
}
this.visibleIcons[3] = this.shaftRateOfFireIcon;
break;
case ItemProperty.SHOT_FREQUENCY:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: SHOT_FREQUENCY");
if(showProperties)
{
this.rateOfFireIcon.labelText = p.value;
}
else
{
this.rateOfFireIcon.labelText = "";
}
this.visibleIcons[1] = this.rateOfFireIcon;
break;
case ItemProperty.DAMAGE:
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemProperty: SHOT_FREQUENCY");
if(showProperties)
{
this.damageIcon.labelText = p.value;
}
else
{
this.damageIcon.labelText = "";
}
this.visibleIcons[0] = this.damageIcon;
break;
}
}
}
Main.writeVarsToConsoleChannel("GARAGE WINDOW"," visibleIcons.length before: %1",this.visibleIcons.length);
i = 0;
while(i < this.visibleIcons.length)
{
if(this.visibleIcons[i] == null)
{
this.visibleIcons.splice(i,1);
}
else
{
i++;
}
}
Main.writeVarsToConsoleChannel("GARAGE WINDOW"," visibleIcons.length after: %1",this.visibleIcons.length);
if(this.visibleIcons.length > 0)
{
this.showIcons();
if(!this.scrollContainer.contains(this.propertiesPanel))
{
this.scrollContainer.addChild(this.propertiesPanel);
}
}
else if(this.scrollContainer.contains(this.propertiesPanel))
{
this.scrollContainer.removeChild(this.propertiesPanel);
}
if(itemParams.itemType == ItemTypeEnum.KIT)
{
data = KitsInfoData.getData(itemParams.baseItemId);
if(data != null)
{
kitPackage = data.info;
this.isKit = true;
this.hideKitInfoPanel();
this.kitView = new KitPackageDescriptionView();
this.addKitInfoPanel();
this.kitView.show(new KitPackage(kitPackage),data.discount);
}
else
{
this.isKit = false;
this.hideKitInfoPanel();
}
}
else
{
this.isKit = false;
this.hideKitInfoPanel();
}
if(this.type == ItemTypeEnum.ARMOR || this.type == ItemTypeEnum.WEAPON)
{
this.propertiesPanelLeft.bitmapData = upgradeTableLeftBd;
this.propertiesPanelCenter.bitmapData = upgradeTableCenterBd;
this.propertiesPanelRight.bitmapData = upgradeTableRightBd;
mods = itemParams.modifications;
this.showModTable();
this.modTable.changeRowCount(mods.length);
this.modTable.select(itemParams.modificationIndex);
for(m = 0; m < mods.length; m++)
{
modInfo = ModificationInfo(mods[m]);
Main.writeVarsToConsoleChannel("GARAGE WINDOW"," modInfo: %1",modInfo);
row = ModInfoRow(this.modTable.rows[m]);
if(row != null)
{
row.costLabel.text = modInfo.crystalPrice.toString();
if(maxWidth < row.costLabel.width)
{
maxWidth = row.costLabel.width;
}
this.modTable.maxCostWidth = maxWidth;
Main.writeVarsToConsoleChannel("GARAGE WINDOW"," maxCostWidth: %1",this.modTable.maxCostWidth);
Main.writeVarsToConsoleChannel("GARAGE WINDOW"," constWidth: %1",this.modTable.constWidth);
row.rankIcon.rang = modInfo.rankId;
text = new Array();
modProperties = modInfo.itemProperties;
if(itemId.indexOf("shaft_") < 0)
{
Main.writeVarsToConsoleChannel("GARAGE WINDOW"," modProperties: %1",modProperties);
for(i = 0; i < modProperties.length; i++)
{
p = modProperties[i] as ItemPropertyValue;
switch(p.property)
{
case ItemProperty.ARMOR:
text[5] = p.value;
break;
case ItemProperty.DAMAGE:
text[5] = p.value;
break;
case ItemProperty.DAMAGE_PER_SECOND:
text[5] = p.value;
break;
case ItemProperty.AIMING_ERROR:
text[8] = p.value;
break;
case ItemProperty.CONE_ANGLE:
text[8] = p.value;
break;
case ItemProperty.SHOT_AREA:
text[10] = p.value;
break;
case ItemProperty.SHOT_FREQUENCY:
text[6] = p.value;
break;
case ItemProperty.SHAFT_DAMAGE:
text[7] = p.value;
break;
case ItemProperty.SHAFT_FIRE_RATE:
text[8] = p.value;
break;
case ItemProperty.SHOT_RANGE:
text[9] = p.value;
break;
case ItemProperty.TURRET_TURN_SPEED:
text[7] = p.value;
break;
case ItemProperty.SPEED:
text[11] = p.value;
break;
case ItemProperty.TURN_SPEED:
text[12] = p.value;
break;
case ItemProperty.MECH_RESISTANCE:
text[13] = p.value;
break;
case ItemProperty.FIRE_RESISTANCE:
text[14] = p.value;
break;
case ItemProperty.PLASMA_RESISTANCE:
text[15] = p.value;
break;
case ItemProperty.RAIL_RESISTANCE:
text[16] = p.value;
break;
case ItemProperty.VAMPIRE_RESISTANCE:
text[17] = p.value;
break;
case ItemProperty.SHAFT_RESISTANCE:
text[18] = p.value;
break;
case ItemProperty.HEALING_RADUIS:
text[18] = p.value;
break;
case ItemProperty.CRITICAL_CHANCE:
text[19] = p.value;
break;
case ItemProperty.HEATING_TIME:
text[20] = p.value;
break;
case ItemProperty.HEAL_RATE:
text[5] = p.value;
break;
case ItemProperty.VAMPIRE_RATE:
text[6] = p.value;
break;
}
}
}
else
{
for(i = 0; i < modProperties.length; i++)
{
p = modProperties[i] as ItemPropertyValue;
switch(p.property)
{
case ItemProperty.SHAFT_DAMAGE:
text[2] = p.value;
break;
case ItemProperty.SHAFT_FIRE_RATE:
text[3] = p.value;
break;
case ItemProperty.DAMAGE:
text[0] = p.value;
break;
case ItemProperty.TURRET_TURN_SPEED:
text[4] = p.value;
break;
case ItemProperty.SHOT_FREQUENCY:
text[1] = p.value;
break;
}
}
}
i = 0;
while(i < text.length)
{
if(text[i] == null)
{
text.splice(i,1);
}
else
{
i++;
}
}
row.setLabelsNum(text.length);
row.setLabelsText(text);
}
}
this.modTable.correctNonintegralValues();
}
else
{
this.propertiesPanelLeft.bitmapData = propertiesLeftBd;
this.propertiesPanelCenter.bitmapData = propertiesCenterBd;
this.propertiesPanelRight.bitmapData = propertiesRightBd;
this.hideModTable();
}
if(storeItem)
{
this.buttonBuy.visible = true;
this.buttonEquip.visible = false;
this.buttonUpgrade.visible = false;
}
else if(this.type == ItemTypeEnum.INVENTORY)
{
this.buttonBuy.visible = true;
this.buttonEquip.visible = false;
this.buttonUpgrade.visible = false;
}
else
{
this.buttonBuy.visible = false;
if(this.type == ItemTypeEnum.PLUGIN)
{
this.buttonEquip.visible = false;
this.buttonUpgrade.visible = false;
this.buttonBuyCrystals.visible = false;
}
else
{
this.buttonEquip.visible = true;
if(this.type == ItemTypeEnum.ARMOR || this.type == ItemTypeEnum.WEAPON)
{
this.buttonUpgrade.visible = itemParams.modificationIndex < 3 && itemParams.modifications.length > 1;
}
else
{
this.buttonUpgrade.visible = false;
}
}
}
if(this.buttonBuy.visible)
{
rank = this.panelModel.rank >= this.params.rankId ? int(this.params.rankId) : int(-this.params.rankId);
if(this.type == ItemTypeEnum.INVENTORY)
{
cost = this.panelModel.crystal >= this.inventoryNumStepper.value * this.params.price ? int(this.inventoryNumStepper.value * this.params.price) : int(-this.inventoryNumStepper.value * this.params.price);
this.inventoryNumStepper.visible = true;
acceptableNum = Math.min(ItemInfoPanel.INVENTORY_MAX_VALUE,Math.floor(this.panelModel.crystal / this.params.price));
if(rank > 0)
{
if(acceptableNum > 0)
{
this.inventoryNumStepper.enabled = true;
this.inventoryNumStepper.alpha = 1;
}
else
{
this.inventoryNumStepper.enabled = false;
this.inventoryNumStepper.alpha = 0.7;
}
}
else
{
this.inventoryNumStepper.enabled = false;
this.inventoryNumStepper.alpha = 0.7;
}
}
else
{
cost = this.panelModel.crystal >= this.params.price ? int(this.params.price) : int(-this.params.price);
this.inventoryNumStepper.visible = false;
}
this.buttonBuy.setInfo(cost,rank);
this.buttonBuy.enable = cost >= 0 && rank > 0;
if(rank > 0 && cost < 0)
{
this.requiredCrystalsNum = -cost - this.panelModel.crystal;
this.buttonBuyCrystals.visible = true;
this.buttonBuyCrystals.setInfo(this.requiredCrystalsNum,this.requiredCrystalsNum * GarageModel.buyCrystalRate);
}
else
{
this.buttonBuyCrystals.visible = false;
}
}
else if(this.buttonUpgrade.visible)
{
this.inventoryNumStepper.visible = false;
cost = this.params.nextModificationPrice > this.panelModel.crystal ? int(-this.params.nextModificationPrice) : int(this.params.nextModificationPrice);
rank = this.panelModel.rank >= this.params.nextModificationRankId ? int(this.params.nextModificationRankId) : int(-this.params.nextModificationRankId);
this.buttonUpgrade.setInfo(cost,rank);
this.buttonUpgrade.enable = cost > 0 && rank > 0;
if(this.params.nextModificationPrice > this.panelModel.crystal && this.panelModel.rank >= this.params.nextModificationRankId)
{
this.requiredCrystalsNum = -cost - this.panelModel.crystal;
this.buttonBuyCrystals.visible = true;
this.buttonBuyCrystals.setInfo(this.requiredCrystalsNum,this.requiredCrystalsNum * GarageModel.buyCrystalRate);
}
else
{
this.buttonBuyCrystals.visible = false;
}
}
else
{
this.inventoryNumStepper.visible = false;
this.buttonBuyCrystals.visible = false;
}
this.posButtons();
if(this.type == ItemTypeEnum.PLUGIN && !storeItem)
{
if(!this.scrollContainer.contains(this.timeIndicator))
{
this.scrollContainer.addChild(this.timeIndicator);
}
itemEffectModel = (this.modelRegister.getModelsByInterface(IItemEffect) as Vector.<IModel>)[0] as IItemEffect;
this.timeRemaining = new Date(itemEffectModel.getTimeRemaining(itemId));
}
else if(this.scrollContainer.contains(this.timeIndicator))
{
this.scrollContainer.removeChild(this.timeIndicator);
}
}
private function posButtons() : void
{
var buttonY:int = this.size.y - this.margin - this.buttonSize.y + 1;
if(this.buttonBuy.visible)
{
this.buttonBuy.y = buttonY;
if(this.type == ItemTypeEnum.INVENTORY)
{
this.inventoryNumStepper.x = -7;
this.inventoryNumStepper.y = this.buttonBuy.y + Math.round((this.buttonSize.y - this.inventoryNumStepper.height) * 0.5);
this.buttonBuy.x = this.inventoryNumStepper.x + this.inventoryNumStepper.width + 10;
}
else
{
this.buttonBuy.x = this.margin;
}
}
if(this.buttonEquip.visible)
{
this.buttonEquip.y = buttonY;
this.buttonEquip.x = this.size.x - this.margin - this.buttonSize.x;
}
if(this.buttonUpgrade.visible)
{
this.buttonUpgrade.y = buttonY;
this.buttonUpgrade.x = this.margin;
}
if(this.buttonBuyCrystals.visible)
{
this.buttonBuyCrystals.y = buttonY;
if(this.buttonBuy.visible)
{
this.buttonBuyCrystals.x = this.buttonBuy.x + this.buttonSize.x + 15;
}
else
{
this.buttonBuyCrystals.x = this.buttonUpgrade.x + this.buttonSize.x + 15;
}
}
}
private function addKitInfoPanel() : void
{
if(!this.scrollContainer.contains(this.kitView))
{
this.scrollContainer.addChild(this.kitView);
}
}
private function hideKitInfoPanel() : void
{
if(this.scrollContainer.contains(this.kitView))
{
this.scrollContainer.removeChild(this.kitView);
}
}
public function getSkinText() : String
{
return this.skinText;
}
public function resize(width:int, height:int) : void
{
var minContainerHeight:int = 0;
var iconsNum:int = 0;
var iconY:int = 0;
var iconsWidth:int = 0;
var summWidth:int = 0;
var leftMargin:int = 0;
var coords:Array = null;
var i:int = 0;
var icon:ItemPropertyIcon = null;
var m:int = 0;
var row:ModInfoRow = null;
Main.writeVarsToConsoleChannel("GARAGE WINDOW","ItemInfoPanel resize width: %1, height: %2",width,height);
this.scrollPane.update();
this.size.x = width;
this.size.y = height;
this.window.width = width;
this.window.height = height;
this.inner.width = width - this.margin * 2;
this.inner.height = height - this.margin - this.bottomMargin;
this.areaRect.width = width - this.margin * 2 - 2;
this.areaRect2.width = this.areaRect.width - this.horizMargin * 2;
this.descrTf.x = this.horizMargin - 3;
this.descrTf.width = this.areaRect2.width;
if(this.visibleIcons != null)
{
iconsNum = this.visibleIcons.length;
if(iconsNum > 0)
{
minContainerHeight = this.propertiesPanel.y + this.propertiesPanel.height + this.vertMargin;
this.propertiesPanelRight.x = this.areaRect2.width - this.propertiesPanelRight.width;
this.propertiesPanelCenter.width = this.propertiesPanelRight.x - this.propertiesPanelCenter.x;
iconY = 6;
iconsWidth = armorBd.width * iconsNum + this.iconSpace * (iconsNum - 1);
summWidth = iconsWidth;
if(this.scrollContainer.contains(this.modTable))
{
summWidth += this.modTable.constWidth;
}
Main.writeVarsToConsoleChannel("GARAGE WINDOW"," summWidth: %1",summWidth);
leftMargin = Math.round((this.propertiesPanel.width - summWidth) * 0.5);
Main.writeVarsToConsoleChannel("GARAGE WINDOW"," leftMargin: %1",leftMargin);
coords = new Array();
for(i = 0; i < iconsNum; i++)
{
icon = this.visibleIcons[i] as ItemPropertyIcon;
icon.x = leftMargin + i * (armorBd.width + this.iconSpace);
icon.y = iconY;
if(this.type == ItemTypeEnum.ARMOR || this.type == ItemTypeEnum.WEAPON)
{
coords.push(this.propertiesPanel.x + icon.x - this.modTable.x + armorBd.width * 0.5);
}
}
Main.writeVarsToConsoleChannel("GARAGE WINDOW"," coords: %1",coords);
if(this.type == ItemTypeEnum.ARMOR || this.type == ItemTypeEnum.WEAPON)
{
this.modTable.y = this.propertiesPanel.y + 6 + icon.height + 2;
this.modTable.resizeSelection(this.areaRect2.width);
for(m = 0; m < 4; m++)
{
row = ModInfoRow(this.modTable.rows[m]);
if(row != null)
{
row.setLabelsPos(coords);
row.setConstPartCoord(leftMargin + iconsWidth + row.hSpace);
}
}
}
this.descrTf.y = this.propertiesPanel.y + this.propertiesPanel.height + this.vertMargin - 4;
}
else
{
this.descrTf.y = this.areaRect2.y + 24 - 7;
}
}
else
{
this.descrTf.y = this.areaRect2.y + 24 - 7;
}
minContainerHeight += this.vertMargin + this.descrTf.textHeight - 4;
var withoutPreviewHeight:int = minContainerHeight;
if(this.preview.bitmapData != null)
{
this.previewVisible = true;
this.preview.x = this.horizMargin - (this.horizMargin + this.cutPreview);
if(iconsNum > 0)
{
this.preview.y = this.propertiesPanel.y + this.propertiesPanel.height + this.vertMargin;
}
else
{
this.preview.y = this.areaRect2.y + 24;
}
this.descrTf.x = this.preview.x + this.preview.width - this.cutPreview - 3;
this.descrTf.width = this.areaRect2.width - this.descrTf.x - 3;
minContainerHeight = Math.max(this.descrTf.y + 3 + this.descrTf.textHeight + this.vertMargin,this.preview.y + this.preview.height + this.vertMargin);
}
else
{
minContainerHeight = this.descrTf.y + 3 + this.descrTf.textHeight + this.vertMargin;
}
var containerHeight:int = Math.max(minContainerHeight,height - this.margin - this.bottomMargin - 2 - this.spaceModule * 2);
var delta:int = this.preview.y + this.preview.height + 10 + this.kitView.height - containerHeight + 15;
this.areaRect.height = containerHeight + (!!this.isKit ? (delta > 0 ? delta : 0) : 0);
this.areaRect2.height = this.area.height - this.vertMargin * 2;
if(containerHeight > height - this.margin - this.bottomMargin - 2 - this.spaceModule * 2)
{
this.previewVisible = false;
this.descrTf.x = this.horizMargin - 3;
this.descrTf.width = this.areaRect2.width;
minContainerHeight = withoutPreviewHeight;
containerHeight = Math.max(minContainerHeight,height - this.margin - this.bottomMargin - 2 - this.spaceModule * 2);
this.areaRect.height = containerHeight;
this.areaRect2.height = this.area.height - this.vertMargin * 2;
}
this.area.graphics.clear();
this.area.graphics.beginFill(16711680,0);
this.area.graphics.drawRect(this.areaRect.x,this.areaRect.y,this.areaRect.width,this.areaRect.height);
if(this.previewVisible)
{
this.showPreview();
}
else
{
this.hidePreview();
}
this.posButtons();
this.scrollPane.setSize(width - this.margin * 2 - 2 + 6,height - this.margin - this.bottomMargin - 2 - this.spaceModule * 2);
this.scrollPane.update();
if(this.scrollContainer.contains(this.timeIndicator))
{
this.timeIndicator.x = this.areaRect2.x + this.areaRect2.width - this.timeIndicator.width + 3;
this.timeIndicator.y = this.areaRect2.y - 7;
}
if(this.isKit)
{
if(this.kitView != null)
{
this.kitView.x = Math.round((this.scrollContainer.width - this.kitView.width) * 0.5);
this.kitView.y = this.preview.y + this.preview.height + 10;
}
}
}
public function hideModTable() : void
{
if(this.scrollContainer.contains(this.modTable))
{
this.scrollContainer.removeChild(this.modTable);
}
}
public function showModTable() : void
{
if(!this.scrollContainer.contains(this.modTable))
{
this.scrollContainer.addChild(this.modTable);
}
}
public function hidePreview() : void
{
if(this.scrollContainer.contains(this.preview))
{
this.scrollContainer.removeChild(this.preview);
}
}
public function showPreview() : void
{
var previewId:String = null;
var resource:ImageResource = null;
var previewBd:BitmapData = null;
if(!this.scrollContainer.contains(this.preview))
{
this.scrollContainer.addChild(this.preview);
if(this.id != null)
{
previewId = (GarageModel.getItemParams(this.id) as ItemParams).previewId;
if(previewId != null)
{
resource = ResourceUtil.getResource(ResourceType.IMAGE,previewId + "_preview") as ImageResource;
previewBd = null;
if(resource != null)
{
previewBd = resource.bitmapData as BitmapData;
}
else
{
previewBd = new StubBitmapData(16711680);
}
this.preview.bitmapData = previewBd;
}
}
}
}
public function set timeRemaining(time:Date) : void
{
var dataString:String = null;
Main.writeVarsToConsoleChannel("TIME INDICATOR"," ");
var timeString:String = (time.hours < 10 ? "0" + String(time.hours) : String(time.hours)) + ":" + (time.minutes < 10 ? "0" + String(time.minutes) : String(time.minutes));
var monthString:String = time.month + 1 < 10 ? "0" + String(time.month + 1) : String(time.month + 1);
var dayString:String = time.date < 10 ? "0" + String(time.date) : String(time.date);
if(this.localeService.getText(TextConst.GUI_LANG) == "ru")
{
dataString = dayString + "-" + monthString + "-" + String(time.fullYear);
}
else
{
dataString = monthString + "-" + dayString + "-" + String(time.fullYear);
}
this.timeIndicator.text = dayString != "NaN" ? timeString + " " + dataString : " ";
Main.writeVarsToConsoleChannel("TIME INDICATOR","set remainingDate: " + timeString + " " + dataString);
this.resize(this.size.x,this.size.y);
}
private function inventoryNumChanged(e:Event = null) : void
{
Main.writeVarsToConsoleChannel("GARAGE WINDOW","inventoryNumChanged");
Main.writeVarsToConsoleChannel("GARAGE WINDOW","totalPrice: " + this.params.price * this.inventoryNumStepper.value);
var rank:int = this.panelModel.rank >= this.params.rankId ? int(this.params.rankId) : int(-this.params.rankId);
var cost:int = this.panelModel.crystal >= this.params.price * this.inventoryNumStepper.value ? int(this.params.price * this.inventoryNumStepper.value) : int(-this.params.price * this.inventoryNumStepper.value);
this.buttonBuy.setInfo(cost,rank);
this.buttonBuy.enable = cost >= 0 && rank > 0;
if(rank > 0 && cost < 0)
{
this.requiredCrystalsNum = -cost - this.panelModel.crystal;
this.buttonBuyCrystals.visible = true;
this.buttonBuyCrystals.setInfo(this.requiredCrystalsNum,this.requiredCrystalsNum * GarageModel.buyCrystalRate);
}
else
{
this.buttonBuyCrystals.visible = false;
}
this.posButtons();
}
}
}
|
package projects.tanks.client.panel.model.shop.androidspecialoffer.banner {
public class AndroidBannerType {
public static const BEGINNER_QUEST:AndroidBannerType = new AndroidBannerType(0,"BEGINNER_QUEST");
public static const BATTLE_PASS:AndroidBannerType = new AndroidBannerType(1,"BATTLE_PASS");
public static const BEGINNER_STARTER_PACK:AndroidBannerType = new AndroidBannerType(2,"BEGINNER_STARTER_PACK");
public static const PREMIUM_SPECIAL_OFFER:AndroidBannerType = new AndroidBannerType(3,"PREMIUM_SPECIAL_OFFER");
public static const MEDIUM_TIME_PACK:AndroidBannerType = new AndroidBannerType(4,"MEDIUM_TIME_PACK");
public static const KIT_FULL_OFFER:AndroidBannerType = new AndroidBannerType(5,"KIT_FULL_OFFER");
public static const PROGRESS_OFFER:AndroidBannerType = new AndroidBannerType(6,"PROGRESS_OFFER");
private var _value:int;
private var _name:String;
public function AndroidBannerType(param1:int, param2:String) {
super();
this._value = param1;
this._name = param2;
}
public static function get values() : Vector.<AndroidBannerType> {
var local1:Vector.<AndroidBannerType> = new Vector.<AndroidBannerType>();
local1.push(BEGINNER_QUEST);
local1.push(BATTLE_PASS);
local1.push(BEGINNER_STARTER_PACK);
local1.push(PREMIUM_SPECIAL_OFFER);
local1.push(MEDIUM_TIME_PACK);
local1.push(KIT_FULL_OFFER);
local1.push(PROGRESS_OFFER);
return local1;
}
public function toString() : String {
return "AndroidBannerType [" + this._name + "]";
}
public function get value() : int {
return this._value;
}
public function get name() : String {
return this._name;
}
}
}
|
package projects.tanks.client.garage.skins {
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 MountSkinItemModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:MountSkinItemModelServer;
private var client:IMountSkinItemModelBase = IMountSkinItemModelBase(this);
private var modelId:Long = Long.getLong(194373973,-369589677);
public function MountSkinItemModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new MountSkinItemModelServer(IModel(this));
var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry));
local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(MountedSkinCC,false)));
}
protected function getInitParam() : MountedSkinCC {
return MountedSkinCC(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.models.battle.gui.inventory {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.models.battle.gui.inventory.HudInventoryIcon_armorBgdClass.png")]
public class HudInventoryIcon_armorBgdClass extends BitmapAsset {
public function HudInventoryIcon_armorBgdClass() {
super();
}
}
}
|
package projects.tanks.client.battleselect.model.matchmaking.notify {
import projects.tanks.client.battleselect.model.matchmaking.queue.MatchmakingMode;
public interface IMatchmakingNotifyModelBase {
function registrationCancelled() : void;
function registrationTimeout() : void;
function userRegistrationSuccessful(param1:int, param2:MatchmakingMode) : void;
}
}
|
package alternativa.tanks.model.antiaddiction
{
import alternativa.init.Main;
import alternativa.model.IModel;
import alternativa.model.IObjectLoadListener;
import alternativa.object.ClientObject;
import alternativa.osgi.service.mainContainer.IMainContainerService;
import alternativa.service.IModelService;
import alternativa.tanks.gui.AntiAddictionWindow;
import alternativa.tanks.model.panel.IPanel;
import flash.display.DisplayObjectContainer;
import flash.events.Event;
import forms.Alert;
import forms.AlertAnswer;
import projects.tanks.client.panel.model.antiaddictionalert.AntiAddictionAlertModelBase;
import projects.tanks.client.panel.model.antiaddictionalert.IAntiAddictionAlertModelBase;
public class AntiAddictionAlertModel extends AntiAddictionAlertModelBase implements IAntiAddictionAlert, IAntiAddictionAlertModelBase, IObjectLoadListener
{
private var dialogsLayer:DisplayObjectContainer;
private var antiAddictionWindow:AntiAddictionWindow;
private var clientObject:ClientObject;
public function AntiAddictionAlertModel()
{
super();
_interfaces.push(IModel);
_interfaces.push(IAntiAddictionAlertModelBase);
_interfaces.push(IAntiAddictionAlert);
_interfaces.push(IObjectLoadListener);
this.dialogsLayer = (Main.osgi.getService(IMainContainerService) as IMainContainerService).dialogsLayer as DisplayObjectContainer;
}
public function showAntiAddictionAlert(clientObject:ClientObject, minutesPlayedToday:int) : void
{
Main.writeVarsToConsoleChannel("AA MODEL","show aaAlert clientObject = %1",clientObject);
this.showAntiAddictionWindow(minutesPlayedToday);
}
public function setIdNumberCheckResult(clientObject:ClientObject, result:Boolean) : void
{
var modelRegister:IModelService = Main.osgi.getService(IModelService) as IModelService;
var panelModel:IPanel = modelRegister.getModelsByInterface(IPanel)[0] as IPanel;
if(this.antiAddictionWindow != null && this.dialogsLayer.contains(this.antiAddictionWindow))
{
if(!result)
{
panelModel._showMessage("该身份证错误,请重新输入");
this.antiAddictionWindow.enableButtons();
}
else
{
panelModel._showMessage("您的身份证信息已通过验证");
panelModel.unblur();
this.dialogsLayer.removeChild(this.antiAddictionWindow);
}
}
else
{
panelModel.setIdNumberCheckResult(result);
}
}
public function setIdNumberAndRealName(realName:String, idNumber:String) : void
{
}
private function showAntiAddictionWindow(minutesPlayedToday:int) : void
{
var message:String = null;
var alert:Alert = null;
var modelRegister:IModelService = Main.osgi.getService(IModelService) as IModelService;
var panelModel:IPanel = modelRegister.getModelsByInterface(IPanel)[0] as IPanel;
if(minutesPlayedToday >= 210)
{
panelModel.blur();
if(this.antiAddictionWindow != null && this.dialogsLayer.contains(this.antiAddictionWindow))
{
this.dialogsLayer.removeChild(this.antiAddictionWindow);
}
this.antiAddictionWindow = new AntiAddictionWindow(minutesPlayedToday);
this.antiAddictionWindow.addEventListener(Event.COMPLETE,this.onIDCardEntered);
this.antiAddictionWindow.addEventListener(Event.CANCEL,this.onIDCardCanceled);
this.dialogsLayer.addChild(this.antiAddictionWindow);
Main.stage.addEventListener(Event.RESIZE,this.alignAntiAddictionWindow);
this.alignAntiAddictionWindow();
}
else
{
message = "";
if(minutesPlayedToday >= 180)
{
message = "您累计在线时间已满3小时,请您下线休息,做适当身体活动。";
}
else if(minutesPlayedToday >= 120)
{
message = "您累计在线时间已满2小时。";
}
else if(minutesPlayedToday >= 60)
{
message = "您累计在线时间已满1小时。";
}
alert = new Alert();
alert.showAlert(message,[AlertAnswer.OK]);
this.dialogsLayer.addChild(alert);
}
}
private function onIDCardEntered(e:Event) : void
{
this.setIdNumberAndRealName(this.antiAddictionWindow.realNameInput.value,this.antiAddictionWindow.idCardInput.value);
this.antiAddictionWindow.disableButtons();
}
private function onIDCardCanceled(e:Event) : void
{
var modelRegister:IModelService = Main.osgi.getService(IModelService) as IModelService;
var panelModel:IPanel = modelRegister.getModelsByInterface(IPanel)[0] as IPanel;
panelModel.unblur();
this.dialogsLayer.removeChild(this.antiAddictionWindow);
}
private function alignAntiAddictionWindow(e:Event = null) : void
{
this.antiAddictionWindow.x = Math.round((Main.stage.stageWidth - this.antiAddictionWindow.windowSize.x) * 0.5);
this.antiAddictionWindow.y = Math.round((Main.stage.stageHeight - this.antiAddictionWindow.windowSize.y) * 0.5);
}
public function objectLoaded(object:ClientObject) : void
{
Main.writeVarsToConsoleChannel("AA MODEL","Loaded clientObject = %1",object);
this.clientObject = object;
}
public function objectUnloaded(object:ClientObject) : void
{
if(this.antiAddictionWindow != null && this.dialogsLayer.contains(this.antiAddictionWindow))
{
this.dialogsLayer.removeChild(this.antiAddictionWindow);
}
}
}
}
|
package utils.tweener.easing {
public class Bounce {
public function Bounce() {
super();
}
public static function easeOut(param1:Number, param2:Number, param3:Number, param4:Number) : Number {
param1 = param1 / param4;
if(param1 < 1 / 2.75) {
return param3 * (7.5625 * param1 * param1) + param2;
}
if(param1 < 2 / 2.75) {
return param3 * (7.5625 * (param1 = param1 - 1.5 / 2.75) * param1 + 0.75) + param2;
}
if(param1 < 2.5 / 2.75) {
return param3 * (7.5625 * (param1 = param1 - 2.25 / 2.75) * param1 + 0.9375) + param2;
}
return param3 * (7.5625 * (param1 = param1 - 2.625 / 2.75) * param1 + 0.984375) + param2;
}
public static function easeIn(param1:Number, param2:Number, param3:Number, param4:Number) : Number {
return param3 - easeOut(param4 - param1,0,param3,param4) + param2;
}
public static function easeInOut(param1:Number, param2:Number, param3:Number, param4:Number) : Number {
if(param1 < param4 * 0.5) {
return easeIn(param1 * 2,0,param3,param4) * 0.5 + param2;
}
return easeOut(param1 * 2 - param4,0,param3,param4) * 0.5 + param3 * 0.5 + param2;
}
}
}
|
package forms.buttons
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class NewsButton_image extends BitmapAsset
{
public function NewsButton_image()
{
super();
}
}
}
|
package alternativa.tanks.models.tank {
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.type.IGameObject;
public class DestroyTankPartEvents implements DestroyTankPart {
private var object:IGameObject;
private var impl:Vector.<Object>;
public function DestroyTankPartEvents(param1:IGameObject, param2:Vector.<Object>) {
super();
this.object = param1;
this.impl = param2;
}
public function destroyTankPart() : void {
var i:int = 0;
var m:DestroyTankPart = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = DestroyTankPart(this.impl[i]);
m.destroyTankPart();
i++;
}
}
finally {
Model.popObject();
}
}
}
}
|
package controls.buttons.h50px {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/controls.buttons.h50px.GreyBigButtonSkin_rightDownClass.png")]
public class GreyBigButtonSkin_rightDownClass extends BitmapAsset {
public function GreyBigButtonSkin_rightDownClass() {
super();
}
}
}
|
package alternativa.physics.collision.colliders
{
import alternativa.math.Matrix4;
import alternativa.math.Vector3;
import alternativa.physics.Contact;
import alternativa.physics.ContactPoint;
import alternativa.physics.altphysics;
import alternativa.physics.collision.CollisionPrimitive;
import alternativa.physics.collision.primitives.CollisionBox;
use namespace altphysics;
public class BoxBoxCollider extends BoxCollider
{
private var epsilon:Number = 0.001;
private var vectorToBox1:Vector3;
private var axis:Vector3;
private var axis10:Vector3;
private var axis11:Vector3;
private var axis12:Vector3;
private var axis20:Vector3;
private var axis21:Vector3;
private var axis22:Vector3;
private var bestAxisIndex:int;
private var minOverlap:Number;
private var points1:Vector.<Vector3>;
private var points2:Vector.<Vector3>;
private var tmpPoints:Vector.<ContactPoint>;
private var pcount:int;
public function BoxBoxCollider()
{
this.vectorToBox1 = new Vector3();
this.axis = new Vector3();
this.axis10 = new Vector3();
this.axis11 = new Vector3();
this.axis12 = new Vector3();
this.axis20 = new Vector3();
this.axis21 = new Vector3();
this.axis22 = new Vector3();
this.points1 = new Vector.<Vector3>(8,true);
this.points2 = new Vector.<Vector3>(8,true);
this.tmpPoints = new Vector.<ContactPoint>(8,true);
super();
for(var i:int = 0; i < 8; i++)
{
this.tmpPoints[i] = new ContactPoint();
this.points1[i] = new Vector3();
this.points2[i] = new Vector3();
}
}
override public function getContact(prim1:CollisionPrimitive, prim2:CollisionPrimitive, contact:Contact) : Boolean
{
var box1:CollisionBox = null;
var box2:CollisionBox = null;
if(!this.haveCollision(prim1,prim2))
{
return false;
}
if(prim1.body != null)
{
box1 = prim1 as CollisionBox;
box2 = prim2 as CollisionBox;
}
else
{
box1 = prim2 as CollisionBox;
box2 = prim1 as CollisionBox;
}
if(this.bestAxisIndex < 6)
{
if(!this.findFaceContactPoints(box1,box2,this.vectorToBox1,this.bestAxisIndex,contact))
{
return false;
}
}
else
{
this.bestAxisIndex -= 6;
this.findEdgesIntersection(box1,box2,this.vectorToBox1,int(this.bestAxisIndex / 3),this.bestAxisIndex % 3,contact);
}
contact.body1 = box1.body;
contact.body2 = box2.body;
return true;
}
override public function haveCollision(prim1:CollisionPrimitive, prim2:CollisionPrimitive) : Boolean
{
var box1:CollisionBox = null;
var box2:CollisionBox = null;
var transform1:Matrix4 = null;
box1 = null;
box2 = null;
transform1 = null;
var transform2:Matrix4 = null;
this.minOverlap = 10000000000;
if(prim1.body != null)
{
box1 = prim1 as CollisionBox;
box2 = prim2 as CollisionBox;
}
else
{
box1 = prim2 as CollisionBox;
box2 = prim1 as CollisionBox;
}
transform1 = box1.transform;
transform2 = box2.transform;
this.vectorToBox1.x = transform1.d - transform2.d;
this.vectorToBox1.y = transform1.h - transform2.h;
this.vectorToBox1.z = transform1.l - transform2.l;
this.axis10.x = transform1.a;
this.axis10.y = transform1.e;
this.axis10.z = transform1.i;
if(!this.testMainAxis(box1,box2,this.axis10,0,this.vectorToBox1))
{
return false;
}
this.axis11.x = transform1.b;
this.axis11.y = transform1.f;
this.axis11.z = transform1.j;
if(!this.testMainAxis(box1,box2,this.axis11,1,this.vectorToBox1))
{
return false;
}
this.axis12.x = transform1.c;
this.axis12.y = transform1.g;
this.axis12.z = transform1.k;
if(!this.testMainAxis(box1,box2,this.axis12,2,this.vectorToBox1))
{
return false;
}
this.axis20.x = transform2.a;
this.axis20.y = transform2.e;
this.axis20.z = transform2.i;
if(!this.testMainAxis(box1,box2,this.axis20,3,this.vectorToBox1))
{
return false;
}
this.axis21.x = transform2.b;
this.axis21.y = transform2.f;
this.axis21.z = transform2.j;
if(!this.testMainAxis(box1,box2,this.axis21,4,this.vectorToBox1))
{
return false;
}
this.axis22.x = transform2.c;
this.axis22.y = transform2.g;
this.axis22.z = transform2.k;
if(!this.testMainAxis(box1,box2,this.axis22,5,this.vectorToBox1))
{
return false;
}
if(!this.testDerivedAxis(box1,box2,this.axis10,this.axis20,6,this.vectorToBox1))
{
return false;
}
if(!this.testDerivedAxis(box1,box2,this.axis10,this.axis21,7,this.vectorToBox1))
{
return false;
}
if(!this.testDerivedAxis(box1,box2,this.axis10,this.axis22,8,this.vectorToBox1))
{
return false;
}
if(!this.testDerivedAxis(box1,box2,this.axis11,this.axis20,9,this.vectorToBox1))
{
return false;
}
if(!this.testDerivedAxis(box1,box2,this.axis11,this.axis21,10,this.vectorToBox1))
{
return false;
}
if(!this.testDerivedAxis(box1,box2,this.axis11,this.axis22,11,this.vectorToBox1))
{
return false;
}
if(!this.testDerivedAxis(box1,box2,this.axis12,this.axis20,12,this.vectorToBox1))
{
return false;
}
if(!this.testDerivedAxis(box1,box2,this.axis12,this.axis21,13,this.vectorToBox1))
{
return false;
}
if(!this.testDerivedAxis(box1,box2,this.axis12,this.axis22,14,this.vectorToBox1))
{
return false;
}
return true;
}
private function findFaceContactPoints(box1:CollisionBox, box2:CollisionBox, vectorToBox1:Vector3, faceAxisIdx:int, contact:Contact) : Boolean
{
var pen:Number = NaN;
var cp:ContactPoint = null;
var cpPos:Vector3 = null;
var r:Vector3 = null;
var transform1:Matrix4 = null;
var transform2:Matrix4 = null;
var colAxis:Vector3 = null;
var incidentAxisDot:Number = NaN;
pen = NaN;
var tmpBox:CollisionBox = null;
var dot:Number = NaN;
var absDot:Number = NaN;
var v:Vector3 = null;
cp = null;
cpPos = null;
r = null;
var swapNormal:Boolean = false;
if(faceAxisIdx > 2)
{
tmpBox = box1;
box1 = box2;
box2 = tmpBox;
vectorToBox1.x = -vectorToBox1.x;
vectorToBox1.y = -vectorToBox1.y;
vectorToBox1.z = -vectorToBox1.z;
faceAxisIdx -= 3;
swapNormal = true;
}
transform1 = box1.transform;
transform2 = box2.transform;
colAxis = contact.normal;
transform1.getAxis(faceAxisIdx,colAxis);
var negativeFace:Boolean = colAxis.x * vectorToBox1.x + colAxis.y * vectorToBox1.y + colAxis.z * vectorToBox1.z > 0;
var code:int = 1 << (faceAxisIdx << 1);
if(negativeFace)
{
code <<= 1;
}
if((code & box1.excludedFaces) != 0)
{
return false;
}
if(!negativeFace)
{
colAxis.x = -colAxis.x;
colAxis.y = -colAxis.y;
colAxis.z = -colAxis.z;
}
var incidentAxisIdx:int = 0;
var maxDot:Number = 0;
for(var axisIdx:int = 0; axisIdx < 3; axisIdx++)
{
transform2.getAxis(axisIdx,this.axis);
dot = this.axis.x * colAxis.x + this.axis.y * colAxis.y + this.axis.z * colAxis.z;
absDot = dot < 0 ? Number(Number(-dot)) : Number(Number(dot));
if(absDot > maxDot)
{
maxDot = absDot;
incidentAxisDot = dot;
incidentAxisIdx = axisIdx;
}
}
transform2.getAxis(incidentAxisIdx,this.axis);
getFaceVertsByAxis(box2.hs,incidentAxisIdx,incidentAxisDot < 0,this.points1);
transform2.transformVectorsN(this.points1,this.points2,4);
transform1.transformVectorsInverseN(this.points2,this.points1,4);
var pnum:int = this.clip(box1.hs,faceAxisIdx);
this.pcount = 0;
for(var i:int = 0; i < pnum; i++)
{
v = this.points1[i];
if((pen = this.getPointBoxPenetration(box1.hs,v,faceAxisIdx,negativeFace)) > -this.epsilon)
{
cp = this.tmpPoints[this.pcount++];
cpPos = cp.pos;
cpPos.x = transform1.a * v.x + transform1.b * v.y + transform1.c * v.z + transform1.d;
cpPos.y = transform1.e * v.x + transform1.f * v.y + transform1.g * v.z + transform1.h;
cpPos.z = transform1.i * v.x + transform1.j * v.y + transform1.k * v.z + transform1.l;
r = cp.r1;
r.x = cpPos.x - transform1.d;
r.y = cpPos.y - transform1.h;
r.z = cpPos.z - transform1.l;
r = cp.r2;
r.x = cpPos.x - transform2.d;
r.y = cpPos.y - transform2.h;
r.z = cpPos.z - transform2.l;
cp.penetration = pen;
}
}
if(swapNormal)
{
colAxis.x = -colAxis.x;
colAxis.y = -colAxis.y;
colAxis.z = -colAxis.z;
}
if(this.pcount > 4)
{
this.reducePoints();
}
for(i = 0; i < this.pcount; i++)
{
cp = contact.points[i];
cp.copyFrom(this.tmpPoints[i]);
}
contact.pcount = this.pcount;
return true;
}
private function reducePoints() : void
{
var i:int = 0;
var minIdx:int = 0;
var cp1:ContactPoint = null;
var cp2:ContactPoint = null;
var minLen:Number = NaN;
var p1:Vector3 = null;
var p2:Vector3 = null;
var ii:int = 0;
var dx:Number = NaN;
var dy:Number = NaN;
var dz:Number = NaN;
var len:Number = NaN;
while(this.pcount > 4)
{
minLen = 10000000000;
p1 = (this.tmpPoints[int(this.pcount - 1)] as ContactPoint).pos;
for(i = 0; i < this.pcount; i++)
{
p2 = (this.tmpPoints[i] as ContactPoint).pos;
dx = p2.x - p1.x;
dy = p2.y - p1.y;
dz = p2.z - p1.z;
len = dx * dx + dy * dy + dz * dz;
if(len < minLen)
{
minLen = len;
minIdx = i;
}
p1 = p2;
}
ii = minIdx == 0 ? int(int(this.pcount - 1)) : int(int(minIdx - 1));
cp1 = this.tmpPoints[ii];
cp2 = this.tmpPoints[minIdx];
p1 = cp1.pos;
p2 = cp2.pos;
p2.x = 0.5 * (p1.x + p2.x);
p2.y = 0.5 * (p1.y + p2.y);
p2.z = 0.5 * (p1.z + p2.z);
cp2.penetration = 0.5 * (cp1.penetration + cp2.penetration);
if(minIdx > 0)
{
for(i = minIdx; i < this.pcount; i++)
{
this.tmpPoints[int(i - 1)] = this.tmpPoints[i];
}
this.tmpPoints[int(this.pcount - 1)] = cp1;
}
--this.pcount;
}
}
private function getPointBoxPenetration(hs:Vector3, p:Vector3, faceAxisIdx:int, reverse:Boolean) : Number
{
switch(faceAxisIdx)
{
case 0:
if(reverse)
{
return p.x + hs.x;
}
return hs.x - p.x;
break;
case 1:
if(reverse)
{
return p.y + hs.y;
}
return hs.y - p.y;
break;
case 2:
if(reverse)
{
return p.z + hs.z;
}
return hs.z - p.z;
break;
default:
return 0;
}
}
private function clip(hs:Vector3, faceAxisIdx:int) : int
{
var pnum:int = 4;
switch(faceAxisIdx)
{
case 0:
if((pnum = clipLowZ(-hs.z,pnum,this.points1,this.points2,this.epsilon)) == 0)
{
return 0;
}
if((pnum = clipHighZ(hs.z,pnum,this.points2,this.points1,this.epsilon)) == 0)
{
return 0;
}
if((pnum = clipLowY(-hs.y,pnum,this.points1,this.points2,this.epsilon)) == 0)
{
return 0;
}
return clipHighY(hs.y,pnum,this.points2,this.points1,this.epsilon);
break;
case 1:
if((pnum = clipLowZ(-hs.z,pnum,this.points1,this.points2,this.epsilon)) == 0)
{
return 0;
}
if((pnum = clipHighZ(hs.z,pnum,this.points2,this.points1,this.epsilon)) == 0)
{
return 0;
}
if((pnum = clipLowX(-hs.x,pnum,this.points1,this.points2,this.epsilon)) == 0)
{
return 0;
}
return clipHighX(hs.x,pnum,this.points2,this.points1,this.epsilon);
break;
case 2:
if((pnum = clipLowX(-hs.x,pnum,this.points1,this.points2,this.epsilon)) == 0)
{
return 0;
}
if((pnum = clipHighX(hs.x,pnum,this.points2,this.points1,this.epsilon)) == 0)
{
return 0;
}
if((pnum = clipLowY(-hs.y,pnum,this.points1,this.points2,this.epsilon)) == 0)
{
return 0;
}
return clipHighY(hs.y,pnum,this.points2,this.points1,this.epsilon);
break;
default:
return 0;
}
}
private function findEdgesIntersection(box1:CollisionBox, box2:CollisionBox, vectorToBox1:Vector3, axisIdx1:int, axisIdx2:int, contact:Contact) : void
{
var halfLen1:Number = NaN;
var halfLen2:Number = NaN;
var transform1:Matrix4 = box1.transform;
var transform2:Matrix4 = box2.transform;
transform1.getAxis(axisIdx1,this.axis10);
transform2.getAxis(axisIdx2,this.axis20);
var colAxis:Vector3 = contact.normal;
colAxis.x = this.axis10.y * this.axis20.z - this.axis10.z * this.axis20.y;
colAxis.y = this.axis10.z * this.axis20.x - this.axis10.x * this.axis20.z;
colAxis.z = this.axis10.x * this.axis20.y - this.axis10.y * this.axis20.x;
var k:Number = 1 / Math.sqrt(colAxis.x * colAxis.x + colAxis.y * colAxis.y + colAxis.z * colAxis.z);
colAxis.x *= k;
colAxis.y *= k;
colAxis.z *= k;
if(colAxis.x * vectorToBox1.x + colAxis.y * vectorToBox1.y + colAxis.z * vectorToBox1.z < 0)
{
colAxis.x = -colAxis.x;
colAxis.y = -colAxis.y;
colAxis.z = -colAxis.z;
}
var tx:Number = box1.hs.x;
var ty:Number = box1.hs.y;
var tz:Number = box1.hs.z;
var x2:Number = box2.hs.x;
var y2:Number = box2.hs.y;
var z2:Number = box2.hs.z;
if(axisIdx1 == 0)
{
tx = 0;
halfLen1 = box1.hs.x;
}
else if(colAxis.x * transform1.a + colAxis.y * transform1.e + colAxis.z * transform1.i > 0)
{
tx = -tx;
}
if(axisIdx2 == 0)
{
x2 = 0;
halfLen2 = box2.hs.x;
}
else if(colAxis.x * transform2.a + colAxis.y * transform2.e + colAxis.z * transform2.i < 0)
{
x2 = -x2;
}
if(axisIdx1 == 1)
{
ty = 0;
halfLen1 = box1.hs.y;
}
else if(colAxis.x * transform1.b + colAxis.y * transform1.f + colAxis.z * transform1.j > 0)
{
ty = -ty;
}
if(axisIdx2 == 1)
{
y2 = 0;
halfLen2 = box2.hs.y;
}
else if(colAxis.x * transform2.b + colAxis.y * transform2.f + colAxis.z * transform2.j < 0)
{
y2 = -y2;
}
if(axisIdx1 == 2)
{
tz = 0;
halfLen1 = box1.hs.z;
}
else if(colAxis.x * transform1.c + colAxis.y * transform1.g + colAxis.z * transform1.k > 0)
{
tz = -tz;
}
if(axisIdx2 == 2)
{
z2 = 0;
halfLen2 = box2.hs.z;
}
else if(colAxis.x * transform2.c + colAxis.y * transform2.g + colAxis.z * transform2.k < 0)
{
z2 = -z2;
}
var x1:Number = transform1.a * tx + transform1.b * ty + transform1.c * tz + transform1.d;
var y1:Number = transform1.e * tx + transform1.f * ty + transform1.g * tz + transform1.h;
var z1:Number = transform1.i * tx + transform1.j * ty + transform1.k * tz + transform1.l;
tx = x2;
ty = y2;
tz = z2;
x2 = transform2.a * tx + transform2.b * ty + transform2.c * tz + transform2.d;
y2 = transform2.e * tx + transform2.f * ty + transform2.g * tz + transform2.h;
z2 = transform2.i * tx + transform2.j * ty + transform2.k * tz + transform2.l;
k = this.axis10.x * this.axis20.x + this.axis10.y * this.axis20.y + this.axis10.z * this.axis20.z;
var det:Number = k * k - 1;
tx = x2 - x1;
ty = y2 - y1;
tz = z2 - z1;
var c1:Number = this.axis10.x * tx + this.axis10.y * ty + this.axis10.z * tz;
var c2:Number = this.axis20.x * tx + this.axis20.y * ty + this.axis20.z * tz;
var t1:Number = (c2 * k - c1) / det;
var t2:Number = (c2 - c1 * k) / det;
contact.pcount = 1;
var cp:ContactPoint = contact.points[0];
var cpPos:Vector3 = cp.pos;
cp.pos.x = 0.5 * (x1 + this.axis10.x * t1 + x2 + this.axis20.x * t2);
cp.pos.y = 0.5 * (y1 + this.axis10.y * t1 + y2 + this.axis20.y * t2);
cp.pos.z = 0.5 * (z1 + this.axis10.z * t1 + z2 + this.axis20.z * t2);
var r:Vector3 = cp.r1;
r.x = cpPos.x - transform1.d;
r.y = cpPos.y - transform1.h;
r.z = cpPos.z - transform1.l;
r = cp.r2;
r.x = cpPos.x - transform2.d;
r.y = cpPos.y - transform2.h;
r.z = cpPos.z - transform2.l;
cp.penetration = this.minOverlap;
}
private function testMainAxis(box1:CollisionBox, box2:CollisionBox, axis:Vector3, axisIndex:int, toBox1:Vector3) : Boolean
{
var overlap:Number = this.overlapOnAxis(box1,box2,axis,toBox1);
if(overlap < -this.epsilon)
{
return false;
}
if(overlap + this.epsilon < this.minOverlap)
{
this.minOverlap = overlap;
this.bestAxisIndex = axisIndex;
}
return true;
}
private function testDerivedAxis(box1:CollisionBox, box2:CollisionBox, axis1:Vector3, axis2:Vector3, axisIndex:int, toBox1:Vector3) : Boolean
{
this.axis.x = axis1.y * axis2.z - axis1.z * axis2.y;
this.axis.y = axis1.z * axis2.x - axis1.x * axis2.z;
this.axis.z = axis1.x * axis2.y - axis1.y * axis2.x;
var lenSqr:Number = this.axis.x * this.axis.x + this.axis.y * this.axis.y + this.axis.z * this.axis.z;
if(lenSqr < 0.0001)
{
return true;
}
var k:Number = 1 / Math.sqrt(lenSqr);
this.axis.x *= k;
this.axis.y *= k;
this.axis.z *= k;
var overlap:Number = this.overlapOnAxis(box1,box2,this.axis,toBox1);
if(overlap < -this.epsilon)
{
return false;
}
if(overlap + this.epsilon < this.minOverlap)
{
this.minOverlap = overlap;
this.bestAxisIndex = axisIndex;
}
return true;
}
public function overlapOnAxis(box1:CollisionBox, box2:CollisionBox, axis:Vector3, vectorToBox1:Vector3) : Number
{
var m:Matrix4 = box1.transform;
var d:Number = (m.a * axis.x + m.e * axis.y + m.i * axis.z) * box1.hs.x;
if(d < 0)
{
d = -d;
}
var projection:Number = d;
d = (m.b * axis.x + m.f * axis.y + m.j * axis.z) * box1.hs.y;
if(d < 0)
{
d = -d;
}
projection += d;
d = (m.c * axis.x + m.g * axis.y + m.k * axis.z) * box1.hs.z;
if(d < 0)
{
d = -d;
}
projection += d;
m = box2.transform;
d = (m.a * axis.x + m.e * axis.y + m.i * axis.z) * box2.hs.x;
if(d < 0)
{
d = -d;
}
projection += d;
d = (m.b * axis.x + m.f * axis.y + m.j * axis.z) * box2.hs.y;
if(d < 0)
{
d = -d;
}
projection += d;
d = (m.c * axis.x + m.g * axis.y + m.k * axis.z) * box2.hs.z;
if(d < 0)
{
d = -d;
}
projection += d;
d = vectorToBox1.x * axis.x + vectorToBox1.y * axis.y + vectorToBox1.z * axis.z;
if(d < 0)
{
d = -d;
}
return projection - d;
}
override public function destroy() : void
{
var v:Vector3 = null;
var v1:Vector3 = null;
var p:ContactPoint = null;
this.vectorToBox1 = null;
this.axis = null;
this.axis10 = null;
this.axis11 = null;
this.axis12 = null;
this.axis20 = null;
this.axis21 = null;
this.axis22 = null;
if(this.points1 != null)
{
for each(v in this.points1)
{
v = null;
}
this.points1 = null;
}
if(this.points2 != null)
{
for each(v1 in this.points2)
{
v1 = null;
}
this.points2 = null;
}
if(this.tmpPoints != null)
{
for each(p in this.tmpPoints)
{
p.destroy();
p = null;
}
this.tmpPoints = null;
}
}
}
}
import alternativa.math.Vector3;
class CollisionPointTmp
{
public var pos:Vector3;
public var penetration:Number;
public var feature1:int;
public var feature2:int;
function CollisionPointTmp()
{
this.pos = new Vector3();
super();
}
}
|
package controls {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/controls.VKButton_pressedBitmapVK.png")]
public class VKButton_pressedBitmapVK extends BitmapAsset {
public function VKButton_pressedBitmapVK() {
super();
}
}
}
|
package projects.tanks.client.users.services.chatmoderator {
public class ChatModeratorLevel {
public static const NONE:ChatModeratorLevel = new ChatModeratorLevel(0,"NONE");
public static const COMMUNITY_MANAGER:ChatModeratorLevel = new ChatModeratorLevel(1,"COMMUNITY_MANAGER");
public static const BATTLE_ADMINISTRATOR:ChatModeratorLevel = new ChatModeratorLevel(2,"BATTLE_ADMINISTRATOR");
public static const BATTLE_MODERATOR:ChatModeratorLevel = new ChatModeratorLevel(3,"BATTLE_MODERATOR");
public static const BATTLE_CANDIDATE:ChatModeratorLevel = new ChatModeratorLevel(4,"BATTLE_CANDIDATE");
public static const ADMINISTRATOR:ChatModeratorLevel = new ChatModeratorLevel(5,"ADMINISTRATOR");
public static const MODERATOR:ChatModeratorLevel = new ChatModeratorLevel(6,"MODERATOR");
public static const CANDIDATE:ChatModeratorLevel = new ChatModeratorLevel(7,"CANDIDATE");
public static const EVENT_CHAT_ADMIN:ChatModeratorLevel = new ChatModeratorLevel(8,"EVENT_CHAT_ADMIN");
public static const EVENT_CHAT_MODERATOR:ChatModeratorLevel = new ChatModeratorLevel(9,"EVENT_CHAT_MODERATOR");
public static const EVENT_CHAT_CANDIDATE:ChatModeratorLevel = new ChatModeratorLevel(10,"EVENT_CHAT_CANDIDATE");
private var _value:int;
private var _name:String;
public function ChatModeratorLevel(param1:int, param2:String) {
super();
this._value = param1;
this._name = param2;
}
public static function get values() : Vector.<ChatModeratorLevel> {
var local1:Vector.<ChatModeratorLevel> = new Vector.<ChatModeratorLevel>();
local1.push(NONE);
local1.push(COMMUNITY_MANAGER);
local1.push(BATTLE_ADMINISTRATOR);
local1.push(BATTLE_MODERATOR);
local1.push(BATTLE_CANDIDATE);
local1.push(ADMINISTRATOR);
local1.push(MODERATOR);
local1.push(CANDIDATE);
local1.push(EVENT_CHAT_ADMIN);
local1.push(EVENT_CHAT_MODERATOR);
local1.push(EVENT_CHAT_CANDIDATE);
return local1;
}
public function toString() : String {
return "ChatModeratorLevel [" + this._name + "]";
}
public function get value() : int {
return this._value;
}
public function get name() : String {
return this._name;
}
}
}
|
package projects.tanks.client.panel.model.payment {
public interface IPaymentModelBase {
}
}
|
package projects.tanks.clients.fp10.libraries.tanksservices.service.friend.battleinvite {
import flash.events.Event;
public class BattleInviteEnableEvent extends Event {
public static const UPDATE:String = "BattleInviteEnableEvent.UPDATE";
public var enable:Boolean;
public function BattleInviteEnableEvent(param1:String, param2:Boolean, param3:Boolean = false, param4:Boolean = false) {
super(param1,param3,param4);
this.enable = param2;
}
}
}
|
package {
import flash.display.Sprite;
import flash.system.Security;
[ExcludeClass]
public class _de68b03b4e596989b4e210adc752713b73942625669c16df2db5ad553e1de174_flash_display_Sprite extends Sprite {
public function _de68b03b4e596989b4e210adc752713b73942625669c16df2db5ad553e1de174_flash_display_Sprite() {
super();
}
public function allowDomainInRSL(... rest) : void {
Security.allowDomain.apply(null,rest);
}
public function allowInsecureDomainInRSL(... rest) : void {
Security.allowInsecureDomain.apply(null,rest);
}
}
}
|
package alternativa.tanks.models.battle.gui.inventory {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.models.battle.gui.inventory.HudInventoryIcon_droneIconClass.png")]
public class HudInventoryIcon_droneIconClass extends BitmapAsset {
public function HudInventoryIcon_droneIconClass() {
super();
}
}
}
|
package alternativa.protocol.codec
{
import alternativa.protocol.codec.complex.ArrayCodec;
import alternativa.protocol.factory.ICodecFactory;
import alternativa.register.ClassInfo;
import alternativa.types.Long;
import flash.utils.IDataInput;
public class ClassCodec extends AbstractCodec
{
private var codecFactory:ICodecFactory;
public function ClassCodec(codecFactory:ICodecFactory)
{
super();
this.codecFactory = codecFactory;
}
override protected function doDecode(reader:IDataInput, nullmap:NullMap, notnull:Boolean) : Object
{
var longCodec:ICodec = this.codecFactory.getCodec(Long);
var id:Long = Long(longCodec.decode(reader,nullmap,true));
var parentId:Long = Long(longCodec.decode(reader,nullmap,false));
var name:String = String(this.codecFactory.getCodec(String).decode(reader,nullmap,true));
var longArrayCodec:ArrayCodec = ArrayCodec(this.codecFactory.getArrayCodec(Long,false));
var modelsToAdd:Array = longArrayCodec.decode(reader,nullmap,false) as Array;
var modelsToRemove:Array = longArrayCodec.decode(reader,nullmap,false) as Array;
return new ClassInfo(id,parentId,name,modelsToAdd,modelsToRemove);
}
}
}
|
package alternativa.tanks.gui.category {
import flash.events.Event;
import projects.tanks.client.commons.types.ItemViewCategoryEnum;
public class CategoryButtonsListEvent extends Event {
public static const CATEGORY_SELECTED:String = "CategoryButtonsListEvent:CategorySelected";
private var category:ItemViewCategoryEnum;
public function CategoryButtonsListEvent(param1:String, param2:ItemViewCategoryEnum) {
super(param1);
this.category = param2;
}
public function getCategory() : ItemViewCategoryEnum {
return this.category;
}
}
}
|
package alternativa.tanks.model.payment.androidspecialoffer {
import projects.tanks.client.panel.model.payment.loader.IShopItemLoaderForAndroidModelBase;
import projects.tanks.client.panel.model.payment.loader.ShopItemLoaderForAndroidModelBase;
[ModelInfo]
public class ShopItemLoaderForAndroidModel extends ShopItemLoaderForAndroidModelBase implements IShopItemLoaderForAndroidModelBase {
public function ShopItemLoaderForAndroidModel() {
super();
}
public function specialOfferLoaded() : void {
}
}
}
|
package alternativa.tanks.models.weapon.machinegun.sfx {
import alternativa.engine3d.core.Object3D;
import alternativa.math.Vector3;
import alternativa.tanks.battle.BattleService;
import alternativa.tanks.battle.scene3d.scene3dcontainer.Scene3DContainer;
import alternativa.tanks.camera.GameCamera;
import alternativa.tanks.engine3d.AnimatedSprite3D;
import alternativa.tanks.engine3d.TextureAnimation;
import alternativa.tanks.models.weapon.BasicGlobalGunParams;
import alternativa.tanks.models.weapon.WeaponUtils;
import alternativa.tanks.sfx.AnimatedPlane;
import alternativa.tanks.sfx.GraphicEffect;
import alternativa.tanks.sfx.SFXUtils;
import alternativa.tanks.sfx.StaticObject3DPositionProvider;
import alternativa.tanks.utils.objectpool.Pool;
import alternativa.tanks.utils.objectpool.PooledObject;
import flash.display.BlendMode;
public class MachineGunShotEffect extends PooledObject implements GraphicEffect {
[Inject]
public static var battleService:BattleService;
private static const SPARKLES_SIZE:int = 150;
private static const TANK_SPARKLES_SIZE:int = 200;
private static const SPARKLES_OFFSET_TO_CAMERA:int = 50;
private static const FIRE_ALONG_WIDTH:Number = 150;
private static const FIRE_ALONG_LENGTH:Number = 210;
private static const FIRE_ALONG_Y_OFFSET:Number = -10;
private static const FIRE_ACROSS_SIZE:Number = 130;
private static const FIRE_ACROSS_Y_OFFSET:Number = 35;
private static const SMOKE_Y_OFFSET:Number = 60;
private static const SMOKE_SIZE:Number = 170;
private static const SMOKE_SPEED:Number = 300;
private static const SMOKE_TOP:Number = 170;
private static const SMOKE_INTERVAL:Number = 0.3;
private static const TRACER_Y_OFFSET:Number = 50;
private static const TRACER_MAX_LENGTH:Number = 22222;
private static const gunParams:BasicGlobalGunParams = new BasicGlobalGunParams();
private static const origin:Vector3 = new Vector3();
private static const tracerDirection:Vector3 = new Vector3();
private const fireAlong:AnimatedPlane = new AnimatedPlane(FIRE_ALONG_WIDTH,FIRE_ALONG_LENGTH,0,FIRE_ALONG_LENGTH * 0.5,0);
private const fireAcross:AnimatedPlane = new AnimatedPlane(FIRE_ACROSS_SIZE,FIRE_ACROSS_SIZE,0,0,0);
private const sparkles:AnimatedSprite3D = new AnimatedSprite3D(SPARKLES_SIZE,SPARKLES_SIZE);
private const tankSparkles:AnimatedSprite3D = new AnimatedSprite3D(TANK_SPARKLES_SIZE,TANK_SPARKLES_SIZE);
private const tracer:Tracer = new Tracer();
private const smoke:Smoke = new Smoke(SMOKE_SIZE,SMOKE_SPEED,SMOKE_TOP,SMOKE_INTERVAL);
private const targetPosition:Vector3 = new Vector3();
private const muzzleLocalPoint:Vector3 = new Vector3();
private var time:Number = 0;
private var container:Scene3DContainer;
private var machineGunSFX:MachineGunSFXData;
private var turret:Object3D;
private var sparklesPosProvider:StaticObject3DPositionProvider;
private var isPlaying:Boolean;
private var isShooting:Boolean;
private var hasHit:Boolean;
private var isHitInTank:Boolean;
private var isDummyShot:Boolean;
public function MachineGunShotEffect(param1:Pool) {
super(param1);
SFXUtils.setEffectParams(this.fireAlong);
SFXUtils.setEffectParams(this.fireAcross);
}
public function init(param1:Object3D, param2:Vector3, param3:MachineGunSFXData) : void {
this.machineGunSFX = param3;
this.turret = param1;
this.muzzleLocalPoint.copy(param2);
WeaponUtils.calculateBasicGunParams(param1,param2,gunParams);
this.initFire(param3);
this.targetPosition.copy(gunParams.muzzlePosition);
this.smoke.setAnimation(param3.smokeTexture);
this.tracer.init(param3.tracerTexture);
this.sparklesPosProvider = StaticObject3DPositionProvider(battleService.getObjectPool().getObject(StaticObject3DPositionProvider));
this.sparklesPosProvider.init(this.targetPosition,SPARKLES_OFFSET_TO_CAMERA);
this.sparkles.looped = true;
this.sparkles.setAnimationData(param3.sparklesTexture);
this.tankSparkles.looped = true;
this.tankSparkles.setAnimationData(param3.tankSparklesTexture);
this.time = 0;
this.hasHit = false;
this.isDummyShot = false;
}
public function addedToScene(param1:Scene3DContainer) : void {
this.container = param1;
param1.addChild(this.fireAlong);
param1.addChild(this.fireAcross);
param1.addChild(this.tracer);
param1.addChild(this.sparkles);
param1.addChild(this.tankSparkles);
this.smoke.setContainer(param1);
this.smoke.start();
this.tracer.visible = true;
this.fireAlong.visible = true;
this.fireAcross.visible = true;
this.isShooting = true;
}
public function play(param1:int, param2:GameCamera) : Boolean {
WeaponUtils.calculateBasicGunParams(this.turret,this.muzzleLocalPoint,gunParams);
var local3:Number = param1 / 1000;
this.playFire(param2);
this.playTracerAndSparkles(local3,param2,param1);
this.playSmokeAndSetPlaying(local3);
this.time += local3;
return this.isPlaying || this.isShooting;
}
public function setTargetPosition(param1:Vector3, param2:Boolean) : void {
this.targetPosition.copy(param1);
this.hasHit = true;
this.isHitInTank = param2;
}
public function clearTargetPosition(param1:Boolean) : void {
this.hasHit = false;
this.isDummyShot = param1;
}
public function destroy() : void {
this.kill();
this.fireAcross.clear();
this.fireAlong.clear();
this.smoke.clear();
this.sparkles.clear();
this.tankSparkles.clear();
this.container = null;
this.machineGunSFX = null;
this.turret = null;
this.sparklesPosProvider.destroy();
this.sparklesPosProvider = null;
recycle();
}
public function kill() : void {
this.container.removeChild(this.fireAlong);
this.container.removeChild(this.fireAcross);
this.container.removeChild(this.tracer);
this.container.removeChild(this.sparkles);
this.container.removeChild(this.tankSparkles);
}
public function stop() : void {
this.smoke.stop();
this.tracer.visible = false;
this.fireAlong.visible = false;
this.fireAcross.visible = false;
this.sparkles.visible = false;
this.tankSparkles.visible = false;
this.isShooting = false;
}
private function initFire(param1:MachineGunSFXData) : void {
var local2:TextureAnimation = param1.fireAlongTexture;
this.fireAlong.init(local2,local2.fps);
this.fireAlong.blendMode = BlendMode.ADD;
var local3:TextureAnimation = param1.fireAcrossTexture;
this.fireAcross.init(local3,local3.fps);
this.fireAcross.blendMode = BlendMode.ADD;
this.rotateAcrossEffect();
}
private function rotateAcrossEffect() : void {
var local1:Number = gunParams.direction.x;
var local2:Number = gunParams.direction.y;
this.fireAcross.rotationX = Math.atan2(gunParams.direction.z,Math.sqrt(local1 * local1 + local2 * local2)) - Math.PI / 2;
this.fireAcross.rotationY = 0;
this.fireAcross.rotationZ = -Math.atan2(local1,local2);
}
private function playFire(param1:GameCamera) : void {
SFXUtils.calculateAlphaForObject(this.fireAlong,param1.position,gunParams.direction,false,8,0.9);
SFXUtils.calculateAlphaForObject(this.fireAcross,param1.position,gunParams.direction,true,4,0.3);
this.offsetPosition(gunParams.muzzlePosition,gunParams.direction,FIRE_ALONG_Y_OFFSET,origin);
SFXUtils.alignObjectPlaneToView(this.fireAlong,origin,gunParams.direction,param1.position);
this.fireAlong.setTime(this.time % this.fireAlong.getOneLoopTime());
this.rotateAcrossEffect();
this.alignObject(this.fireAcross,gunParams.muzzlePosition,gunParams.direction,FIRE_ACROSS_Y_OFFSET);
this.fireAcross.setTime(this.time % this.fireAcross.getOneLoopTime());
}
private function playTracerAndSparkles(param1:Number, param2:GameCamera, param3:int) : void {
var local4:Number = NaN;
if(this.hasHit) {
tracerDirection.copy(this.targetPosition);
tracerDirection.subtract(gunParams.muzzlePosition);
local4 = tracerDirection.length();
tracerDirection.normalize();
this.playSparkles(param1,param2,param3);
} else {
local4 = this.isDummyShot ? 0 : TRACER_MAX_LENGTH;
tracerDirection.copy(gunParams.direction);
this.hideSparkles();
}
this.offsetPosition(gunParams.muzzlePosition,gunParams.direction,TRACER_Y_OFFSET,origin);
SFXUtils.alignObjectPlaneToView(this.tracer,origin,tracerDirection,param2.position);
this.tracer.update(param3,local4 - TRACER_Y_OFFSET);
}
private function playSparkles(param1:Number, param2:GameCamera, param3:int) : void {
this.hideSparkles();
var local4:AnimatedSprite3D = this.isHitInTank ? this.tankSparkles : this.sparkles;
local4.visible = this.isShooting;
local4.update(param1);
this.sparklesPosProvider.init(this.targetPosition,SPARKLES_OFFSET_TO_CAMERA);
this.sparklesPosProvider.updateObjectPosition(local4,param2,param3);
}
private function hideSparkles() : void {
this.sparkles.visible = false;
this.tankSparkles.visible = false;
}
private function playSmokeAndSetPlaying(param1:Number) : void {
this.offsetPosition(gunParams.muzzlePosition,gunParams.direction,SMOKE_Y_OFFSET,origin);
this.smoke.setEmitterPosition(origin);
this.isPlaying = this.smoke.update(param1);
}
private function offsetPosition(param1:Vector3, param2:Vector3, param3:Number, param4:Vector3) : void {
param4.copy(param1).addScaled(param3,param2);
}
private function alignObject(param1:Object3D, param2:Vector3, param3:Vector3, param4:Number) : void {
param1.x = param2.x + param4 * param3.x;
param1.y = param2.y + param4 * param3.y;
param1.z = param2.z + param4 * param3.z;
}
}
}
|
package alternativa.debug
{
import alternativa.init.Main;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.geom.Point;
import flash.text.*;
public class ErrorWindow extends Sprite
{
[Embed(source="781.png")]
private static const backBitmap:Class;
private static const backBd:BitmapData = new backBitmap().bitmapData;
[Embed(source="1029.png")]
private static const okButtonBitmap:Class;
private static const okButtonBd:BitmapData = new okButtonBitmap().bitmapData;
private var back:Bitmap;
private var message:TextField;
private var buttonOkBitmap:Bitmap;
private var buttonOk:Sprite;
private var _currentSize:Point;
public function ErrorWindow()
{
super();
mouseEnabled = false;
tabEnabled = false;
this.back = new Bitmap(backBd);
addChild(this.back);
this.back.x = -7;
this.back.y = -7;
this.message = new TextField();
this.message.thickness = 50;
this.message.sharpness = -50;
with(this.message)
{
defaultTextFormat = new TextFormat("Sign",12,0);
defaultTextFormat.leading = 30;
type = TextFieldType.DYNAMIC;
autoSize = TextFieldAutoSize.NONE;
antiAliasType = AntiAliasType.ADVANCED;
embedFonts = true;
selectable = true;
multiline = false;
mouseEnabled = false;
tabEnabled = false;
}
addChild(this.message);
this.buttonOk = new Sprite();
addChild(this.buttonOk);
this.buttonOkBitmap = new Bitmap(okButtonBd);
this.buttonOk.addChild(this.buttonOkBitmap);
this.buttonOk.addEventListener(MouseEvent.CLICK,this.onOkButtonClick);
this._currentSize = new Point(367,248);
this.repaint();
}
public function set text(value:String) : void
{
this.message.width = 300;
this.message.text = value;
this.message.x = (this._currentSize.x - this.message.textWidth) * 0.5;
this.message.y = 38;
}
public function get currentSize() : Point
{
return this._currentSize;
}
private function repaint() : void
{
this.message.autoSize = TextFieldAutoSize.CENTER;
this.message.width = 200;
this.message.autoSize = TextFieldAutoSize.NONE;
this.message.x = (this._currentSize.x - this.message.textWidth) * 0.5;
this.message.y = 38;
this.buttonOk.x = (this._currentSize.x - this.buttonOk.width) * 0.5;
this.buttonOk.y = this._currentSize.y - 30 - this.buttonOk.height;
}
private function onOkButtonClick(e:MouseEvent) : void
{
Main.debug.hideErrorWindow();
}
}
}
|
package assets.resultwindow {
import flash.display.BitmapData;
[Embed(source="/_assets/assets.resultwindow.bres_HEADER_GREEN_PIXEL.png")]
public dynamic class bres_HEADER_GREEN_PIXEL extends BitmapData {
public function bres_HEADER_GREEN_PIXEL(param1:int = 4, param2:int = 4) {
super(param1,param2);
}
}
}
|
package forms.stat {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/forms.stat.ReferralWindowBigButton_bitmapGreen.png")]
public class ReferralWindowBigButton_bitmapGreen extends BitmapAsset {
public function ReferralWindowBigButton_bitmapGreen() {
super();
}
}
}
|
package forms.garage
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class PartsList__discountImage extends BitmapAsset
{
public function PartsList__discountImage()
{
super();
}
}
}
|
package alternativa.engine3d.materials {
import alternativa.engine3d.alternativa3d;
import alternativa.engine3d.core.Camera3D;
import alternativa.engine3d.core.Canvas;
import alternativa.engine3d.core.Face;
import alternativa.engine3d.core.Object3D;
import flash.utils.getQualifiedClassName;
use namespace alternativa3d;
public class Material {
public var name:String;
public var alphaTestThreshold:Number = 0;
public var zOffset:Boolean = false;
public var uploadEveryFrame:Boolean = false;
alternativa3d var useVerticesNormals:Boolean = false;
public function Material() {
super();
}
alternativa3d function get transparent() : Boolean {
return false;
}
alternativa3d function set transparent(param1:Boolean) : void {
}
public function clone() : Material {
var local1:Material = new Material();
local1.clonePropertiesFrom(this);
return local1;
}
protected function clonePropertiesFrom(param1:Material) : void {
this.name = param1.name;
this.alphaTestThreshold = param1.alphaTestThreshold;
this.alternativa3d::useVerticesNormals = param1.alternativa3d::useVerticesNormals;
}
public function toString() : String {
var local1:String = getQualifiedClassName(this);
return "[" + local1.substr(local1.indexOf("::") + 2) + " " + this.name + "]";
}
alternativa3d function draw(param1:Camera3D, param2:Canvas, param3:Face, param4:Number) : void {
this.alternativa3d::clearLinks(param3);
}
alternativa3d function drawOpaque(param1:Camera3D, param2:Object, param3:Object, param4:int, param5:int, param6:Object3D) : void {
}
alternativa3d function drawTransparent(param1:Camera3D, param2:Object, param3:Object, param4:int, param5:int, param6:Object3D, param7:Boolean = false) : void {
}
alternativa3d function drawViewAligned(param1:Camera3D, param2:Canvas, param3:Face, param4:Number, param5:Number, param6:Number, param7:Number, param8:Number, param9:Number, param10:Number) : void {
this.alternativa3d::clearLinks(param3);
}
alternativa3d function clearLinks(param1:Face) : void {
var local2:Face = null;
while(param1 != null) {
local2 = param1.alternativa3d::processNext;
param1.alternativa3d::processNext = null;
param1 = local2;
}
}
public function dispose() : void {
}
}
}
|
package alternativa.tanks.model.quest.common.gui.window.buttons.skin {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.model.quest.common.gui.window.buttons.skin.GreenBigButtonSkin_middleUpClass.png")]
public class GreenBigButtonSkin_middleUpClass extends BitmapAsset {
public function GreenBigButtonSkin_middleUpClass() {
super();
}
}
}
|
package projects.tanks.clients.fp10.libraries.tanksservices.service.servername {
public interface ServerNumberToLocaleServerService {
function isLocalServer() : Boolean;
}
}
|
package projects.tanks.client.battlefield.models.battle.pointbased.assault {
import platform.client.fp10.core.resource.types.TextureResource;
import projects.tanks.clients.flash.resources.resource.Tanks3DSResource;
public class AssaultCC {
private var _flagPedestalModel:Tanks3DSResource;
private var _flagSprite:TextureResource;
private var _pointBigMarker:TextureResource;
private var _pointPedestalModel:Tanks3DSResource;
private var _pointSmallMarker:TextureResource;
private var _sounds:AssaultSoundFX;
public function AssaultCC(param1:Tanks3DSResource = null, param2:TextureResource = null, param3:TextureResource = null, param4:Tanks3DSResource = null, param5:TextureResource = null, param6:AssaultSoundFX = null) {
super();
this._flagPedestalModel = param1;
this._flagSprite = param2;
this._pointBigMarker = param3;
this._pointPedestalModel = param4;
this._pointSmallMarker = param5;
this._sounds = param6;
}
public function get flagPedestalModel() : Tanks3DSResource {
return this._flagPedestalModel;
}
public function set flagPedestalModel(param1:Tanks3DSResource) : void {
this._flagPedestalModel = param1;
}
public function get flagSprite() : TextureResource {
return this._flagSprite;
}
public function set flagSprite(param1:TextureResource) : void {
this._flagSprite = param1;
}
public function get pointBigMarker() : TextureResource {
return this._pointBigMarker;
}
public function set pointBigMarker(param1:TextureResource) : void {
this._pointBigMarker = param1;
}
public function get pointPedestalModel() : Tanks3DSResource {
return this._pointPedestalModel;
}
public function set pointPedestalModel(param1:Tanks3DSResource) : void {
this._pointPedestalModel = param1;
}
public function get pointSmallMarker() : TextureResource {
return this._pointSmallMarker;
}
public function set pointSmallMarker(param1:TextureResource) : void {
this._pointSmallMarker = param1;
}
public function get sounds() : AssaultSoundFX {
return this._sounds;
}
public function set sounds(param1:AssaultSoundFX) : void {
this._sounds = param1;
}
public function toString() : String {
var local1:String = "AssaultCC [";
local1 += "flagPedestalModel = " + this.flagPedestalModel + " ";
local1 += "flagSprite = " + this.flagSprite + " ";
local1 += "pointBigMarker = " + this.pointBigMarker + " ";
local1 += "pointPedestalModel = " + this.pointPedestalModel + " ";
local1 += "pointSmallMarker = " + this.pointSmallMarker + " ";
local1 += "sounds = " + this.sounds + " ";
return local1 + "]";
}
}
}
|
package alternativa.tanks.service.impl {
import alternativa.tanks.service.AccountService;
import projects.tanks.clients.fp10.libraries.tanksservices.service.storage.IStorageService;
public class AccountServiceImpl implements AccountService {
[Inject]
public var storageService:IStorageService;
public function AccountServiceImpl() {
super();
}
public function get haveVisitedTankiAlready() : Boolean {
return this.storageService.getStorage().data.alreadyPlayedTanks != null ? Boolean(this.storageService.getStorage().data.alreadyPlayedTanks) : false;
}
public function set haveVisitedTankiAlready(param1:Boolean) : void {
this.storageService.getStorage().data.alreadyPlayedTanks = true;
}
public function get storedUserName() : String {
return this.storageService.getStorage().data.userName;
}
public function set storedUserName(param1:String) : void {
this.storageService.getStorage().data.userName = param1;
}
public function get entranceHash() : String {
return this.storageService.getStorage().data.userHash;
}
}
}
|
package alternativa.tanks.models.battle.rugby.explosion {
import alternativa.math.Vector3;
import alternativa.tanks.battle.BattleService;
import alternativa.tanks.engine3d.EffectsMaterialRegistry;
import alternativa.tanks.engine3d.TextureAnimation;
import alternativa.tanks.models.battle.facilities.FacilityDispellEffect;
import alternativa.tanks.models.sfx.lighting.LightingSfx;
import alternativa.tanks.sfx.AnimatedLightEffect;
import alternativa.tanks.sfx.AnimatedSpriteEffect;
import alternativa.tanks.sfx.LightAnimation;
import alternativa.tanks.sfx.MovingObject3DPositionProvider;
import alternativa.tanks.sfx.Sound3D;
import alternativa.tanks.sfx.Sound3DEffect;
import alternativa.tanks.sfx.StaticObject3DPositionProvider;
import alternativa.tanks.utils.GraphicsUtils;
import alternativa.tanks.utils.objectpool.ObjectPool;
import flash.media.Sound;
import platform.client.fp10.core.model.ObjectLoadListener;
import platform.client.fp10.core.model.ObjectUnloadListener;
import platform.client.fp10.core.resource.types.MultiframeTextureResource;
import projects.tanks.client.battlefield.models.battle.pointbased.rugby.explosion.BallExplosionModelBase;
import projects.tanks.client.battlefield.models.battle.pointbased.rugby.explosion.IBallExplosionModelBase;
[ModelInfo]
public class BallExplosionModel extends BallExplosionModelBase implements IBallExplosionModelBase, ObjectLoadListener, ObjectUnloadListener, BallExplosion, FacilityDispellEffect {
[Inject]
public static var materialRegistry:EffectsMaterialRegistry;
[Inject]
public static var battleService:BattleService;
private static const EXPLOSION_SIZE:Number = 800;
private static const SMOKE_SIZE:Number = 400;
private static const MIN_SMOKE_SPEED:Number = 800;
private static const SMOKE_SPEED_DELTA:Number = 200;
private static const SMOKE_ACCELERATION:Number = -2000;
private static const EXPLOSION_FIRE_OFFSET_TO_CAMERA:int = 200;
private static const EXPLOSION_SOUND_VOLUME:Number = 0.4;
private static const SCALE:Number = 1;
private const velocity:Vector3 = new Vector3();
private var flameAnimation:TextureAnimation;
private var smokeAnimation:TextureAnimation;
private var lightAnimation:LightAnimation;
private var explosionSound:Sound;
public function BallExplosionModel() {
super();
}
public function objectLoaded() : void {
this.flameAnimation = this.getTextureAnimation(getInitParam().explosionTexture,EXPLOSION_SIZE);
this.smokeAnimation = this.getTextureAnimation(getInitParam().smokeTextureId,SMOKE_SIZE);
var local1:LightingSfx = new LightingSfx(getInitParam().lightingSFXEntity);
this.lightAnimation = local1.createAnimation("ball_explosion");
this.explosionSound = getInitParam().explosionSound.sound;
}
private function getTextureAnimation(param1:MultiframeTextureResource, param2:Number) : TextureAnimation {
var local3:TextureAnimation = GraphicsUtils.getTextureAnimationFromResource(materialRegistry,param1);
local3.material.resolution = param2 / param1.frameWidth;
return local3;
}
public function objectUnloaded() : void {
this.releaseMaterials();
}
public function createDispellEffects(param1:Vector3) : void {
this.createExplosionEffects(param1);
}
public function createExplosionEffects(param1:Vector3) : void {
var local2:ObjectPool = battleService.getObjectPool();
this.createExplosionFire(param1,local2);
this.createExplosionSmoke(param1,local2);
this.createExplosionLighting(param1,local2);
this.createExplosionSound(param1);
}
private function createExplosionSound(param1:Vector3) : void {
var local2:Sound3D = Sound3D.create(this.explosionSound,EXPLOSION_SOUND_VOLUME);
battleService.addSound3DEffect(Sound3DEffect.create(param1,local2,0,0));
}
private function createExplosionLighting(param1:Vector3, param2:ObjectPool) : void {
var local3:StaticObject3DPositionProvider = StaticObject3DPositionProvider(param2.getObject(StaticObject3DPositionProvider));
var local4:AnimatedLightEffect = AnimatedLightEffect(param2.getObject(AnimatedLightEffect));
local3.init(param1,0);
local4.init(local3,this.lightAnimation);
battleService.addGraphicEffect(local4);
}
private function releaseMaterials() : void {
materialRegistry.releaseMaterial(this.flameAnimation.material);
materialRegistry.releaseMaterial(this.smokeAnimation.material);
}
private function createExplosionFire(param1:Vector3, param2:ObjectPool) : void {
var local3:StaticObject3DPositionProvider = StaticObject3DPositionProvider(param2.getObject(StaticObject3DPositionProvider));
local3.init(param1,EXPLOSION_FIRE_OFFSET_TO_CAMERA);
var local4:AnimatedSpriteEffect = AnimatedSpriteEffect(param2.getObject(AnimatedSpriteEffect));
var local5:Number = EXPLOSION_SIZE * SCALE;
local4.init(local5,local5,this.flameAnimation,Math.random() * 2 * Math.PI,local3);
battleService.getBattleScene3D().addGraphicEffect(local4);
}
private function createExplosionSmoke(param1:Vector3, param2:ObjectPool) : void {
var local4:Number = NaN;
var local5:MovingObject3DPositionProvider = null;
var local6:AnimatedSpriteEffect = null;
var local7:Number = NaN;
var local3:int = 0;
while(local3 < 3) {
local4 = MIN_SMOKE_SPEED + Math.random() * SMOKE_SPEED_DELTA;
this.velocity.x = local4 * (1 - 2 * Math.random());
this.velocity.y = local4 * (1 - 2 * Math.random());
this.velocity.z = local4 * 0.5 * (1 + Math.random());
local5 = MovingObject3DPositionProvider(param2.getObject(MovingObject3DPositionProvider));
local5.init(param1,this.velocity,SMOKE_ACCELERATION);
local6 = AnimatedSpriteEffect(param2.getObject(AnimatedSpriteEffect));
local7 = SMOKE_SIZE * SCALE;
local6.init(local7,local7,this.smokeAnimation,Math.random() * 2 * Math.PI,local5);
battleService.getBattleScene3D().addGraphicEffect(local6);
local3++;
}
}
}
}
|
package alternativa.engine3d.animation.events {
import alternativa.engine3d.animation.AnimationNotify;
import flash.events.Event;
public class NotifyEvent extends Event {
public static const NOTIFY:String = "notify";
public function NotifyEvent(param1:AnimationNotify) {
super(NOTIFY);
}
public function get notify() : AnimationNotify {
return AnimationNotify(target);
}
}
}
|
package alternativa.utils {
import alternativa.engine3d.materials.TextureMaterial;
import alternativa.tanks.materials.AnimatedPaintMaterial;
import alternativa.tanks.materials.PaintMaterial;
import alternativa.types.Long;
import flash.display.BitmapData;
import platform.client.fp10.core.resource.types.MultiframeTextureResource;
import platform.client.fp10.core.resource.types.TextureResource;
// FFDec bug: qualified [alternativa.types.Long] because there is another [Long] in the same package
public interface TextureMaterialRegistry {
function getAnimatedPaint(param1:MultiframeTextureResource, param2:BitmapData, param3:BitmapData, param4:alternativa.types.Long) : AnimatedPaintMaterial;
function getPaint(param1:TextureResource, param2:BitmapData, param3:BitmapData, param4:alternativa.types.Long) : PaintMaterial;
function getMaterial(param1:BitmapData, param2:Boolean = true) : TextureMaterial;
function addMaterial(param1:TextureMaterial) : void;
function releaseMaterial(param1:TextureMaterial) : void;
function setMipMapping(param1:Boolean) : void;
function clear() : void;
}
}
|
package alternativa.tanks.models.weapon.shotgun {
import alternativa.math.Vector3;
import alternativa.tanks.battle.BattleUtils;
import alternativa.tanks.battle.objects.tank.Tank;
import alternativa.tanks.battle.objects.tank.WeaponPlatform;
import alternativa.tanks.models.weapon.common.WeaponCommonData;
import alternativa.tanks.models.weapon.shotgun.sfx.ShotgunEffects;
import alternativa.tanks.models.weapon.weakening.DistanceWeakening;
import alternativa.tanks.models.weapons.common.CommonLocalWeapon;
import flash.utils.getTimer;
import projects.tanks.client.battlefield.models.tankparts.weapons.shotgun.shot.ShotgunShotCC;
import projects.tanks.client.garage.models.item.properties.ItemProperty;
public class ShotgunWeapon extends CommonLocalWeapon {
private var params:ShotgunShotCC;
private var reminderShots:int;
private var nextShotTime:int;
private var targeting:ShotgunRicochetTargetingSystem;
private var fullDamageDistance:Number;
private var bestDirection:Vector3 = new Vector3();
private var weaponObject:ShotgunObject;
private var reloadTimeMS:int;
private var effects:ShotgunEffects;
private var isMagazineReloading:Boolean;
private var lastShotTime:int;
private var buffedMode:Boolean;
private var stunEnergy:Number;
private var stunned:Boolean;
public function ShotgunWeapon(param1:ShotgunShotCC, param2:ShotgunObject, param3:ShotgunRicochetTargetingSystem, param4:ShotgunEffects) {
super(true);
this.params = param1;
this.weaponObject = param2;
this.targeting = param3;
this.reloadTimeMS = param2.getReloadTimeMS();
var local5:DistanceWeakening = param2.distanceWeakening();
this.fullDamageDistance = local5.getFullDamageDistance();
this.effects = param4;
this.stunned = false;
this.reset();
}
override public function getStatus() : Number {
if(this.isMagazineReloading) {
if(this.stunned) {
return this.stunEnergy;
}
return 1 - (this.nextShotTime - getTimer()) / this.params.magazineReloadTime;
}
return this.reminderShots / Number(this.params.magazineSize);
}
override public function runLogic(param1:int, param2:int) : void {
if(isShooting() && param1 >= this.nextShotTime) {
this.shoot(param1);
}
}
private function shoot(param1:int) : void {
var local4:Vector.<Tank> = null;
this.lastShotTime = param1;
var local2:WeaponPlatform = this.getWeaponPlatform();
if(!this.buffedMode && --this.reminderShots == 0) {
this.isMagazineReloading = true;
this.reminderShots = this.params.magazineSize;
this.nextShotTime = param1 + this.params.magazineReloadTime;
this.effects.createMagazineReloadSoundEffect(local2.getTurret3D(),this.params.magazineReloadTime);
} else {
this.isMagazineReloading = false;
this.nextShotTime = param1 + this.reloadTimeMS;
if(!this.buffedMode) {
this.effects.createReloadSoundEffect(local2.getTurret3D(),this.reloadTimeMS);
}
}
local2.getAllGunParams(gunParams);
var local3:WeaponCommonData = this.weaponObject.commonData();
local2.getBody().addWorldForceScaled(gunParams.barrelOrigin,gunParams.direction,-local3.getRecoilForce());
local2.addDust();
if(BattleUtils.isTurretAboveGround(local2.getBody(),gunParams)) {
local4 = this.targeting.getShotDirection(gunParams,local2.getBody(),this.bestDirection);
this.weaponObject.discrete().tryToShoot(param1,this.bestDirection,local4);
} else {
this.bestDirection.copy(gunParams.direction);
this.weaponObject.discrete().tryToDummyShoot(param1,this.bestDirection);
}
this.effects.createShotEffects(this.weaponObject,gunParams,local2,this.bestDirection);
}
override public function reset() : void {
super.reset();
this.effects.stopEffects();
this.reminderShots = this.params.magazineSize;
this.nextShotTime = getTimer();
this.isMagazineReloading = false;
}
override public function getWeaponPlatform() : WeaponPlatform {
return super.getWeaponPlatform();
}
override public function destroy() : void {
super.destroy();
this.weaponObject = null;
this.targeting = null;
this.params = null;
this.effects.stopEffects();
this.effects = null;
}
override public function disable(param1:Boolean) : void {
super.disable(param1);
this.effects.stopEffects();
}
override public function getResistanceProperty() : ItemProperty {
return ItemProperty.SHOTGUN_RESISTANCE;
}
public function setRemainingShots(param1:int) : void {
this.reminderShots = Math.min(param1,this.params.magazineSize);
if(this.isMagazineReloading) {
if(battleService.getBattleRunner().getPhysicsTime() < this.nextShotTime) {
this.nextShotTime = this.lastShotTime + this.reloadTimeMS;
}
this.isMagazineReloading = false;
}
}
public function setBuffedMode(param1:Boolean) : void {
this.buffedMode = param1;
this.reloadTimeMS = this.weaponObject.getReloadTimeMS();
if(param1) {
this.effects.stopEffects();
}
}
override public function weaponReloadTimeChanged(param1:int, param2:int) : void {
this.nextShotTime += param2 - param1;
}
override public function fullyRecharge() : void {
this.nextShotTime = getTimer();
this.isMagazineReloading = false;
}
override public function stun() : void {
if(this.isMagazineReloading) {
this.stunEnergy = this.getStatus();
}
this.stunned = true;
}
override public function calm(param1:int) : void {
var local2:Number = NaN;
var local3:WeaponPlatform = null;
if(this.isMagazineReloading) {
local2 = this.params.magazineReloadTime * (1 - this.stunEnergy);
local3 = this.getWeaponPlatform();
this.effects.createMagazineReloadSoundEffect(local3.getTurret3D(),local2);
}
this.nextShotTime += param1;
this.stunned = false;
}
}
}
|
package controls.panel
{
import controls.Label;
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.filters.DropShadowFilter;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormatAlign;
public class BaseButton extends MovieClip
{
public var icon:MovieClip;
public var b:MovieClip;
private var bg:MovieClip;
private var _label:Label;
private var _short:Boolean = false;
public var type:int = 0;
private var _enable:Boolean = true;
private var _labeltext:String;
public function BaseButton()
{
this._label = new Label();
super();
this.configUI();
this.enable = true;
tabEnabled = false;
}
public function set enable(param1:Boolean) : void
{
this._enable = param1;
if(this._enable)
{
this.addListeners();
}
else
{
this.removeListeners();
}
}
public function get enable() : Boolean
{
return this._enable;
}
public function set short(param1:Boolean) : void
{
this._short = param1;
this._label.visible = !this._short;
this._label.width = !!this._short ? Number(1) : Number(65);
this._label.text = !!this._short ? "" : this._labeltext;
this.enable = this._enable;
}
public function set label(param1:String) : void
{
this._label.autoSize = TextFieldAutoSize.NONE;
this._label.align = TextFormatAlign.CENTER;
this._label.height = 19;
this._label.x = 23;
this._label.y = 4;
this._label.width = 66;
this._label.mouseEnabled = false;
this._label.filters = [new DropShadowFilter(1,45,0,0.7,1,1,1)];
this._label.text = param1;
this._labeltext = param1;
}
protected function configUI() : void
{
this.bg = getChildByName("b") as MovieClip;
addChild(this._label);
}
protected function addListeners() : void
{
gotoAndStop(2);
this.bg.gotoAndStop(2 + (!!this._short ? 4 : 0));
buttonMode = true;
mouseEnabled = true;
mouseChildren = true;
addEventListener(MouseEvent.MOUSE_OVER,this.onMouseEvent);
addEventListener(MouseEvent.MOUSE_OUT,this.onMouseEvent);
addEventListener(MouseEvent.MOUSE_DOWN,this.onMouseEvent);
addEventListener(MouseEvent.MOUSE_UP,this.onMouseEvent);
}
protected function removeListeners() : void
{
gotoAndStop(1);
this.bg.gotoAndStop(1 + (!!this._short ? 4 : 0));
this._label.y = 4;
buttonMode = false;
mouseEnabled = false;
mouseChildren = false;
removeEventListener(MouseEvent.MOUSE_OVER,this.onMouseEvent);
removeEventListener(MouseEvent.MOUSE_OUT,this.onMouseEvent);
removeEventListener(MouseEvent.MOUSE_DOWN,this.onMouseEvent);
removeEventListener(MouseEvent.MOUSE_UP,this.onMouseEvent);
}
protected function onMouseEvent(param1:MouseEvent) : void
{
switch(param1.type)
{
case MouseEvent.MOUSE_OVER:
this._label.y = 4;
gotoAndStop(3);
this.bg.gotoAndStop(3 + (!!this._short ? 4 : 0));
break;
case MouseEvent.MOUSE_OUT:
this._label.y = 4;
gotoAndStop(2);
this.bg.gotoAndStop(2 + (!!this._short ? 4 : 0));
break;
case MouseEvent.MOUSE_DOWN:
this._label.y = 5;
gotoAndStop(4);
this.bg.gotoAndStop(4 + (!!this._short ? 4 : 0));
break;
case MouseEvent.MOUSE_UP:
this._label.y = 4;
gotoAndStop(2);
this.bg.gotoAndStop(2 + (!!this._short ? 4 : 0));
}
}
}
}
|
package forms.friends
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class FriendsWindowStateBigButton_friendsClass extends BitmapAsset
{
public function FriendsWindowStateBigButton_friendsClass()
{
super();
}
}
}
|
package forms.ranks {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/forms.ranks.PremiumRankBitmaps_bitmapBigRank09.png")]
public class PremiumRankBitmaps_bitmapBigRank09 extends BitmapAsset {
public function PremiumRankBitmaps_bitmapBigRank09() {
super();
}
}
}
|
package alternativa.tanks.vehicles.tanks
{
import alternativa.engine3d.objects.Mesh;
import alternativa.math.Vector3;
import alternativa.tanks.models.battlefield.Object3DNames;
public class TankSkinTurret extends TankSkinPart
{
public var flagMountPoint:Vector3;
public var mesh1:Mesh;
public var shaftMuzzle:Vector3;
public function TankSkinTurret(mesh:Mesh, flagMountPoint:Vector3, muzzle:Vector3)
{
super(mesh,false);
this.flagMountPoint = flagMountPoint;
this.mesh1 = mesh;
this.shaftMuzzle = muzzle;
mesh.shadowMapAlphaThreshold = 0.1;
mesh.calculateVerticesNormalsBySmoothingGroups(0.01);
mesh.name = Object3DNames.TANK_PART;
}
override protected function getMesh() : Mesh
{
return this.mesh1;
}
}
}
|
package alternativa.physics.collision.colliders
{
import alternativa.math.Vector3;
import alternativa.physics.Contact;
import alternativa.physics.ContactPoint;
import alternativa.physics.altphysics;
import alternativa.physics.collision.CollisionPrimitive;
import alternativa.physics.collision.ICollider;
import alternativa.physics.collision.primitives.CollisionBox;
import alternativa.physics.collision.primitives.CollisionSphere;
use namespace altphysics;
public class BoxSphereCollider implements ICollider
{
private var center:Vector3;
private var closestPt:Vector3;
private var bPos:Vector3;
private var sPos:Vector3;
public function BoxSphereCollider()
{
this.center = new Vector3();
this.closestPt = new Vector3();
this.bPos = new Vector3();
this.sPos = new Vector3();
super();
}
public function getContact(prim1:CollisionPrimitive, prim2:CollisionPrimitive, contact:Contact) : Boolean
{
var box:CollisionBox = null;
var sphere:CollisionSphere = prim1 as CollisionSphere;
if(sphere == null)
{
sphere = prim2 as CollisionSphere;
box = prim1 as CollisionBox;
}
else
{
box = prim2 as CollisionBox;
}
sphere.transform.getAxis(3,this.sPos);
box.transform.getAxis(3,this.bPos);
box.transform.transformVectorInverse(this.sPos,this.center);
var hs:Vector3 = box.hs;
var sx:Number = hs.x + sphere.r;
var sy:Number = hs.y + sphere.r;
var sz:Number = hs.z + sphere.r;
if(this.center.x > sx || this.center.x < -sx || this.center.y > sy || this.center.y < -sy || this.center.z > sz || this.center.z < -sz)
{
return false;
}
if(this.center.x > hs.x)
{
this.closestPt.x = hs.x;
}
else if(this.center.x < -hs.x)
{
this.closestPt.x = -hs.x;
}
else
{
this.closestPt.x = this.center.x;
}
if(this.center.y > hs.y)
{
this.closestPt.y = hs.y;
}
else if(this.center.y < -hs.y)
{
this.closestPt.y = -hs.y;
}
else
{
this.closestPt.y = this.center.y;
}
if(this.center.z > hs.z)
{
this.closestPt.z = hs.z;
}
else if(this.center.z < -hs.z)
{
this.closestPt.z = -hs.z;
}
else
{
this.closestPt.z = this.center.z;
}
var distSqr:Number = this.center.vSubtract(this.closestPt).vLengthSqr();
if(distSqr > sphere.r * sphere.r)
{
return false;
}
contact.body1 = sphere.body;
contact.body2 = box.body;
contact.normal.vCopy(this.closestPt).vTransformBy4(box.transform).vSubtract(this.sPos).vNormalize().vReverse();
contact.pcount = 1;
var cp:ContactPoint = contact.points[0];
cp.penetration = sphere.r - Math.sqrt(distSqr);
cp.pos.vCopy(contact.normal).vScale(-sphere.r).vAdd(this.sPos);
cp.r1.vDiff(cp.pos,this.sPos);
cp.r2.vDiff(cp.pos,this.bPos);
return true;
}
public function haveCollision(prim1:CollisionPrimitive, prim2:CollisionPrimitive) : Boolean
{
var box:CollisionBox = null;
var sphere:CollisionSphere = prim1 as CollisionSphere;
if(sphere == null)
{
sphere = prim2 as CollisionSphere;
box = prim1 as CollisionBox;
}
else
{
box = prim2 as CollisionBox;
}
sphere.transform.getAxis(3,this.sPos);
box.transform.getAxis(3,this.bPos);
box.transform.transformVectorInverse(this.sPos,this.center);
var hs:Vector3 = box.hs;
var sx:Number = hs.x + sphere.r;
var sy:Number = hs.y + sphere.r;
var sz:Number = hs.z + sphere.r;
if(this.center.x > sx || this.center.x < -sx || this.center.y > sy || this.center.y < -sy || this.center.z > sz || this.center.z < -sz)
{
return false;
}
if(this.center.x > hs.x)
{
this.closestPt.x = hs.x;
}
else if(this.center.x < -hs.x)
{
this.closestPt.x = -hs.x;
}
else
{
this.closestPt.x = this.center.x;
}
if(this.center.y > hs.y)
{
this.closestPt.y = hs.y;
}
else if(this.center.y < -hs.y)
{
this.closestPt.y = -hs.y;
}
else
{
this.closestPt.y = this.center.y;
}
if(this.center.z > hs.z)
{
this.closestPt.z = hs.z;
}
else if(this.center.z < -hs.z)
{
this.closestPt.z = -hs.z;
}
else
{
this.closestPt.z = this.center.z;
}
var distSqr:Number = this.center.vSubtract(this.closestPt).vLengthSqr();
if(distSqr > sphere.r * sphere.r)
{
return false;
}
return true;
}
public function destroy() : void
{
this.center = null;
this.closestPt = null;
this.bPos = null;
this.sPos = null;
}
}
}
|
package platform.client.fp10.core.registry.impl {
import alternativa.types.Long;
import platform.client.fp10.core.registry.SpaceRegistry;
import platform.client.fp10.core.type.ISpace;
public class SpaceRegistryImpl implements SpaceRegistry {
private var _spaces:Vector.<ISpace> = new Vector.<ISpace>();
private var _currentSpace:ISpace;
public function SpaceRegistryImpl() {
super();
}
public function addSpace(param1:ISpace) : void {
this._spaces.push(param1);
}
public function removeSpace(param1:ISpace) : void {
var local2:int = int(this._spaces.indexOf(param1));
if(local2 < 0) {
throw new Error("Space not found: " + param1.id);
}
this._spaces.splice(local2,1);
if(this._currentSpace == param1) {
this._currentSpace = null;
}
}
public function get spaces() : Vector.<ISpace> {
return this._spaces;
}
public function getSpace(param1:Long) : ISpace {
var local2:ISpace = null;
for each(local2 in this._spaces) {
if(local2.id == param1) {
return local2;
}
}
return null;
}
public function get currentSpace() : ISpace {
return this._currentSpace;
}
public function set currentSpace(param1:ISpace) : void {
this._currentSpace = param1;
}
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.