code stringlengths 57 237k |
|---|
package alternativa.tanks.models.weapon.shaft.states {
import alternativa.tanks.models.weapon.shaft.ShaftEventType;
import alternativa.tanks.models.weapon.shaft.ShaftWeapon;
public class IdleState implements IShaftState {
private var weapon:ShaftWeapon;
private var triggerPulled:Boolean;
public function IdleState(param1:ShaftWeapon) {
super();
this.weapon = param1;
}
public function enter(param1:int) : void {
this.weapon.startIdleState();
this.triggerPulled = this.weapon.isTriggerPulled();
}
public function update(param1:int, param2:int) : void {
if(this.triggerPulled) {
this.readyToShoot();
}
}
public function exit() : void {
}
public function processEvent(param1:ShaftEventType, param2:*) : void {
switch(param1) {
case ShaftEventType.TRIGGER_PULL:
if(!this.triggerPulled) {
this.triggerPulled = true;
this.readyToShoot();
}
break;
case ShaftEventType.TRIGGER_RELEASE:
this.triggerPulled = false;
}
}
private function readyToShoot() : void {
if(this.weapon.canShoot()) {
this.weapon.processEvent(ShaftEventType.READY_TO_SHOOT);
this.triggerPulled = false;
}
}
}
}
|
package controls.scroller.red
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class ScrollSkinRed_trackTop extends BitmapAsset
{
public function ScrollSkinRed_trackTop()
{
super();
}
}
}
|
package alternativa.tanks.gui.components.flag {
import controls.dropdownlist.ComboBoxRenderer;
import flash.display.Bitmap;
import flash.display.Sprite;
public class FlagsRenderer extends ComboBoxRenderer {
public function FlagsRenderer() {
super();
}
override protected function myIcon(param1:Object) : Sprite {
var local2:Sprite = new Sprite();
var local3:Bitmap = Flag.getFlag(param1.country);
local2.addChild(local3);
return local2;
}
}
}
|
package alternativa.tanks.models.battle.meteor {
import alternativa.engine3d.materials.TextureMaterial;
import alternativa.tanks.sfx.LightAnimation;
import alternativa.tanks.sfx.Sound3D;
import alternativa.utils.TextureMaterialRegistry;
import projects.tanks.client.battlefield.models.battle.battlefield.meteors.MeteorStormCC;
import projects.tanks.clients.flash.resources.resource.Tanks3DSResource;
public class MeteorSFXData {
private var _tailLight:LightAnimation;
private var _impactSoundTimerLabel:int;
private var _meteorResource:Tanks3DSResource;
private var _meteorDistantSound:Sound3D;
private var _meteorArrivingSound:Sound3D;
private var _nuclearBangSound:Sound3D;
private var _tailSmoke:TextureMaterial;
private var _tailFlame:TextureMaterial;
private var _nuclearBangFlame:TextureMaterial;
private var _nuclearBangLight:TextureMaterial;
private var _nuclearBangSmoke:TextureMaterial;
private var _nuclearBangWave:TextureMaterial;
private var _craterDecal:TextureMaterial;
public function MeteorSFXData(param1:MeteorStormCC, param2:TextureMaterialRegistry) {
super();
this._meteorResource = param1.meteorModel;
this._impactSoundTimerLabel = param1.impactSoundTimelabel;
this._tailLight = new LightAnimation(param1.tailLight);
this._tailSmoke = param2.getMaterial(param1.tailSmoke.data);
this._tailFlame = param2.getMaterial(param1.tailFlame.data);
this._nuclearBangFlame = param2.getMaterial(param1.nuclearBangFlame.data);
this._nuclearBangLight = param2.getMaterial(param1.nuclearBangLight.data);
this._nuclearBangSmoke = param2.getMaterial(param1.nuclearBangSmoke.data);
this._nuclearBangWave = param2.getMaterial(param1.nuclearBangWave.data);
this._craterDecal = param2.getMaterial(param1.craterDecal.data);
this._meteorDistantSound = Sound3D.create(param1.meteorDistantSound.sound);
this._meteorArrivingSound = Sound3D.create(param1.meteorArrivingSound.sound);
this._nuclearBangSound = Sound3D.create(param1.nuclearBangSound.sound);
}
public function get meteorResource() : Tanks3DSResource {
return this._meteorResource;
}
public function get tailSmoke() : TextureMaterial {
return this._tailSmoke;
}
public function get tailFlame() : TextureMaterial {
return this._tailFlame;
}
public function get tailLight() : LightAnimation {
return this._tailLight;
}
public function get nuclearBangFlame() : TextureMaterial {
return this._nuclearBangFlame;
}
public function get nuclearBangLight() : TextureMaterial {
return this._nuclearBangLight;
}
public function get nuclearBangSmoke() : TextureMaterial {
return this._nuclearBangSmoke;
}
public function get nuclearBangWave() : TextureMaterial {
return this._nuclearBangWave;
}
public function get meteorDistantSound() : Sound3D {
return this._meteorDistantSound;
}
public function get meteorArrivingSound() : Sound3D {
return this._meteorArrivingSound;
}
public function get nuclearBangSound() : Sound3D {
return this._nuclearBangSound;
}
public function get craterDecal() : TextureMaterial {
return this._craterDecal;
}
public function get impactSoundTimerLabel() : int {
return this._impactSoundTimerLabel;
}
}
}
|
package alternativa.tanks.models.weapon.ricochet {
import alternativa.math.Matrix3;
import alternativa.math.Vector3;
import alternativa.physics.Body;
import alternativa.physics.collision.IRayCollisionFilter;
import alternativa.physics.collision.types.RayHit;
import alternativa.tanks.models.weapon.shared.MarginalCollider;
import alternativa.tanks.physics.CollisionGroup;
import alternativa.tanks.physics.TanksCollisionDetector;
public class RicochetTargetingSystem implements IRayCollisionFilter {
private static const rayHit:RayHit = new RayHit();
private static const currOrigin:Vector3 = new Vector3();
private static const currDirection:Vector3 = new Vector3();
private static const direction:Vector3 = new Vector3();
private static const matrix:Matrix3 = new Matrix3();
private var angleUp:Number;
private var numRaysUp:int;
private var angleDown:Number;
private var numRaysDown:int;
private var maxDistance:Number;
private var targetEvaluator:RicochetTargetEvaluator;
private var maxPriority:Number;
private var ricochetCount:int;
private var shooterBody:Body;
private var collisionDetector:TanksCollisionDetector;
private var maxRicochetCount:int;
public function RicochetTargetingSystem(param1:Number, param2:int, param3:Number, param4:int, param5:Number, param6:TanksCollisionDetector, param7:RicochetTargetEvaluator, param8:int) {
super();
this.angleUp = param1;
this.numRaysUp = param2;
this.angleDown = param3;
this.numRaysDown = param4;
this.maxDistance = param5;
this.targetEvaluator = param7;
this.collisionDetector = param6;
this.maxRicochetCount = param8;
}
public function considerBody(param1:Body) : Boolean {
return this.shooterBody != param1 || this.ricochetCount > 0;
}
public function getShotDirection(param1:Vector3, param2:Vector3, param3:Vector3, param4:Body, param5:Vector3) : void {
this.initTargetSearch(param4);
this.checkDirection(param1,param2,0,param5);
this.checkSector(param1,param2,param3,this.angleUp / this.numRaysUp,this.numRaysUp,param5);
this.checkSector(param1,param2,param3,-this.angleDown / this.numRaysDown,this.numRaysDown,param5);
this.finishTargetSearch(param5,param2);
}
private function initTargetSearch(param1:Body) : void {
this.shooterBody = param1;
this.maxPriority = 0;
}
private function checkDirection(param1:Vector3, param2:Vector3, param3:Number, param4:Vector3) : void {
var local6:Body = null;
var local7:Boolean = false;
this.ricochetCount = 0;
currOrigin.copy(param1);
currDirection.copy(param2);
var local5:Number = this.maxDistance;
while(local5 > 0) {
if(!this.collisionDetector.raycast(currOrigin,currDirection,CollisionGroup.WEAPON,local5,this,rayHit)) {
return;
}
local5 -= rayHit.t;
if(local5 < 0) {
local5 = 0;
}
local6 = rayHit.shape.body;
local7 = false;
if(local6.tank != null) {
if(this.ricochetCount > 0) {
local7 = true;
} else {
local7 = !MarginalCollider.segmentWithStaticIntersection(currOrigin,rayHit.position);
}
}
if(local6.tank != null && local6 != this.shooterBody && local7) {
this.processTargetHit(local6,local5,param3,param2,param4);
return;
}
if(local7) {
return;
}
if(!this.processRicochet()) {
return;
}
}
}
private function processTargetHit(param1:Body, param2:Number, param3:Number, param4:Vector3, param5:Vector3) : void {
var local6:Number = this.maxDistance - param2;
var local7:Number = Number(this.targetEvaluator.getTargetPriority(param1,this.ricochetCount,local6,param3,this.maxDistance,Math.max(this.angleUp,this.angleDown)));
if(local7 > this.maxPriority) {
this.maxPriority = local7;
param5.copy(param4);
}
}
private function processRicochet() : Boolean {
var local1:Vector3 = null;
if(this.ricochetCount < this.maxRicochetCount) {
++this.ricochetCount;
local1 = rayHit.normal;
currDirection.addScaled(-2 * currDirection.dot(local1),local1);
currOrigin.copy(rayHit.position).addScaled(0.5,local1);
return true;
}
return false;
}
private function checkSector(param1:Vector3, param2:Vector3, param3:Vector3, param4:Number, param5:int, param6:Vector3) : void {
direction.copy(param2);
matrix.fromAxisAngle(param3,param4);
if(param4 < 0) {
param4 = -param4;
}
var local7:Number = param4;
var local8:int = 0;
while(local8 < param5) {
direction.transform3(matrix);
this.checkDirection(param1,direction,local7,param6);
local8++;
local7 += param4;
}
}
private function finishTargetSearch(param1:Vector3, param2:Vector3) : void {
this.shooterBody = null;
if(this.maxPriority == 0) {
param1.copy(param2);
}
}
}
}
|
package alternativa.tanks.service.payment {
import platform.clients.fp10.libraries.alternativapartners.service.IPartnerService;
import projects.tanks.client.panel.model.payment.CrystalsPaymentCC;
import projects.tanks.client.panel.model.payment.panel.PaymentButtonCC;
import projects.tanks.client.panel.model.payment.types.PaymentRequestUrl;
public class PaymentService implements IPaymentService {
[Inject]
public static var partnerService:IPartnerService;
private var crystals:int;
private var locationChooseEnabled:Boolean;
private var crystalsConfig:CrystalsPaymentCC;
private var paymentButtonConfig:PaymentButtonCC;
private var _manualDescription:String;
public function PaymentService() {
super();
}
public function getAccountId() : String {
return this.crystalsConfig.accountId;
}
public function getManualDescription() : String {
return this._manualDescription;
}
public function getCrystalCost() : Number {
return this.crystalsConfig.crystalCost;
}
public function getLessMinimumCrystalsMessage() : String {
return this.crystalsConfig.lessMinimumCrystalsMessage;
}
public function getLessMinimumMoneyMessage() : String {
return this.crystalsConfig.lessMinimumMoneyMessage;
}
public function getGreaterMaximumCrystalsMessage() : String {
return this.crystalsConfig.greaterMaximumCrystalsMessage;
}
public function getGreaterMaximumMoneyMessage() : String {
return this.crystalsConfig.greaterMaximumMoneyMessage;
}
public function getCrystals() : int {
return this.crystals;
}
public function shouldChooseLocation() : Boolean {
return this.locationChooseEnabled && !partnerService.hasOwnPaymentSystem();
}
public function setCrystals(param1:int) : void {
this.crystals = param1;
}
public function isEnabled() : Boolean {
return this.isEnabledFullPayment() || partnerService.hasPaymentAction() || partnerService.hasOwnPaymentSystem() || this.isPaymentInLinkMode();
}
public function initManualDescription(param1:String) : void {
this._manualDescription = param1;
}
public function setShouldChooseLocation(param1:Boolean) : void {
this.locationChooseEnabled = param1;
}
public function init(param1:CrystalsPaymentCC) : void {
this.crystalsConfig = param1;
this.crystals = param1.defaultAmountOfCrystals;
}
public function initPaymentMode(param1:PaymentButtonCC) : void {
this.paymentButtonConfig = param1;
}
public function isEnabledFullPayment() : Boolean {
if(Boolean(this.paymentButtonConfig)) {
return this.paymentButtonConfig.enabledFullPayment && !partnerService.hasPaymentAction();
}
return false;
}
public function isPaymentInLinkMode() : Boolean {
if(Boolean(this.paymentButtonConfig)) {
return !this.paymentButtonConfig.enabledFullPayment && this.paymentButtonConfig.paymentUrl != null;
}
return false;
}
public function getPaymentUrl() : PaymentRequestUrl {
return this.paymentButtonConfig.paymentUrl;
}
}
}
|
package projects.tanks.client.tanksservices.model.notifier.socialnetworks {
public interface ISNUidNotifierModelBase {
function setSNUid(param1:Vector.<SNUidNotifierData>) : void;
}
}
|
package alternativa.tanks.battle.utils {
public class DampedSpring {
private var a:Number = 0;
private var b:Number = 0;
private var epsilon:Number = 0;
private var velocity:Number = 0;
private var acceleration:Number = 0;
public var value:Number = 0;
public function DampedSpring(param1:Number, param2:Number, param3:Number) {
super();
this.a = 2 * param1 * param2;
this.b = param1 * param1;
this.epsilon = param3;
}
public function reset(param1:Number = 0, param2:Number = 0) : void {
this.value = param1;
this.velocity = param2;
}
public function resetValue(param1:Number) : void {
this.value = param1;
}
public function update(param1:Number, param2:Number) : void {
var local3:Number = this.value - param2 + param1 * this.velocity;
this.velocity += param1 * this.acceleration;
var local4:Number = this.difference(local3,0,this.epsilon);
this.acceleration = -this.a * this.velocity - this.b * local4;
this.value = param2 + local3;
}
private function difference(param1:Number, param2:Number, param3:Number) : Number {
var local4:Number = param1 - param2;
if(local4 > param3) {
return local4 - param3;
}
if(local4 < -param3) {
return local4 + param3;
}
return 0;
}
}
}
|
package platform.client.fp10.core.network.connection {
import alternativa.osgi.service.launcherparams.ILauncherParams;
import alternativa.osgi.service.logging.LogService;
import alternativa.osgi.service.logging.Logger;
import alternativa.osgi.service.network.INetworkService;
import alternativa.protocol.CompressionType;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.OptionalMap;
import alternativa.protocol.ProtocolBuffer;
import com.hurlant.crypto.tls.TLSConfig;
import com.hurlant.crypto.tls.TLSEngine;
import com.hurlant.crypto.tls.TLSSecurityParameters;
import com.hurlant.crypto.tls.TLSSocket;
import flash.events.ErrorEvent;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.ProgressEvent;
import flash.events.SecurityErrorEvent;
import flash.net.Socket;
import flash.utils.ByteArray;
import flash.utils.IDataOutput;
import platform.client.fp10.core.network.ICommandHandler;
import platform.client.fp10.core.network.command.IConnectionInitCommand;
import platform.client.fp10.core.network.connection.protection.PrimitiveProtectionContext;
import platform.client.fp10.core.service.errormessage.IErrorMessageService;
import platform.client.fp10.core.service.errormessage.errors.CannotEstablishConnectionError;
import platform.client.fp10.core.service.errormessage.errors.TransportError;
import platform.client.fp10.core.service.errormessage.errors.UnclassifyedError;
public class SocketConnection implements IConnection {
[Inject]
public static var logService:LogService;
[Inject]
public static var messageBoxService:IErrorMessageService;
[Inject]
public static var launcherParams:ILauncherParams;
[Inject]
public static var networkService:INetworkService;
protected static var connectionLogger:Logger;
protected static var networkLogger:Logger;
protected static var serverCommandLogger:Logger;
private static const PARAM_CLOSE_ON_ERROR:String = "closeonerror";
public var host:String;
public var ports:Vector.<int>;
protected var portIndex:int;
protected var connectionStatus:ConnectionStatus;
protected var protocol:IProtocol;
protected var commandCodec:ICodec;
protected var commandHandler:ICommandHandler;
protected var secure:Boolean;
private var protectionContext:IProtectionContext;
protected var rawDataBuffer:ByteArray;
private var dataBuffer:ByteArray;
private var currentPacketPosition:int;
private var socket:Socket;
public function SocketConnection(param1:ConnectionInitializers) {
var local2:TLSConfig = null;
var local3:TLSSocket = null;
this.connectionStatus = ConnectionStatus.IDLE;
this.rawDataBuffer = new ByteArray();
this.dataBuffer = new ByteArray();
super();
this.commandCodec = param1.commandCodec;
this.protocol = param1.protocol;
this.commandHandler = param1.commandHandler;
this.secure = param1.secure;
this.protectionContext = param1.protectionContext;
initLoggers();
if(this.secure) {
local2 = new TLSConfig(TLSEngine.CLIENT);
local2.version = TLSSecurityParameters.PROTOCOL_VERSION;
local2.trustAllCertificates = true;
local2.ignoreCommonNameMismatch = true;
local2.trustSelfSignedCertificates = true;
local3 = new TLSSocket();
local3.setTLSConfig(local2);
this.socket = local3;
} else {
this.socket = new Socket();
}
this.initializeListeners();
}
private static function initLoggers() : void {
connectionLogger = connectionLogger || logService.getLogger("connection");
networkLogger = networkLogger || logService.getLogger("network");
serverCommandLogger = serverCommandLogger || logService.getLogger("command");
}
public function connect(param1:ConnectionConnectParameters) : void {
this.host = param1.host;
this.preparePorts(param1);
this.connectionStatus = ConnectionStatus.CONNECTING;
this.portIndex = -1;
this.tryNextPort();
}
protected function tryNextPort() : void {
++this.portIndex;
if(this.portIndex < this.ports.length) {
this.tryConnect();
} else {
messageBoxService.showMessage(new CannotEstablishConnectionError(this.host,this.ports));
}
}
protected function writeCommand(param1:Object, param2:IDataOutput) : void {
var local3:Boolean = param1 is IConnectionInitCommand;
var local4:ByteArray = new ByteArray();
var local5:ProtocolBuffer = new ProtocolBuffer(local4,local4,new OptionalMap());
this.commandCodec.encode(local5,param1);
local4.position = 0;
var local6:ByteArray = new ByteArray();
this.protocol.wrapPacket(local6,local5,CompressionType.DEFLATE_AUTO);
local6.position = 0;
var local7:IProtectionContext = local3 ? PrimitiveProtectionContext.INSTANCE : this.protectionContext;
local7.wrap(param2,local6);
}
protected function processDataBuffer() : void {
var byteArray:ByteArray = null;
var packetData:ProtocolBuffer = null;
var command:Object = null;
this.dataBuffer.position = this.dataBuffer.length;
this.protectionContext.unwrap(this.dataBuffer,this.rawDataBuffer);
this.dataBuffer.position = this.currentPacketPosition;
if(this.dataBuffer.bytesAvailable == 0) {
return;
}
while(true) {
byteArray = new ByteArray();
packetData = new ProtocolBuffer(byteArray,byteArray,new OptionalMap());
if(!this.protocol.unwrapPacket(this.dataBuffer,packetData,CompressionType.NONE)) {
return;
}
ByteArray(packetData.reader).position = 0;
while(Boolean(packetData.reader.bytesAvailable)) {
command = null;
try {
command = this.commandCodec.decode(packetData);
if(command == null) {
throw new Error("Decoded command is null");
}
}
catch(e:Error) {
handleDataProcessingError("AbstractConnection::processDataBuffer() command decoding error: " + e.message + ", " + e.getStackTrace());
break;
}
this.commandHandler.executeCommand(command);
}
if(this.dataBuffer.bytesAvailable == 0) {
this.dataBuffer.clear();
this.currentPacketPosition = 0;
return;
}
this.currentPacketPosition = this.dataBuffer.position;
}
}
protected function handleDataProcessingError(param1:String) : void {
serverCommandLogger.error(param1);
if(launcherParams.isDebug) {
messageBoxService.showMessage(new UnclassifyedError(param1));
}
if(Boolean(launcherParams.getParameter(PARAM_CLOSE_ON_ERROR))) {
this.close(ConnectionCloseStatus.DATA_PROCESSING_ERROR,param1);
}
}
protected function handleDataSendingError(param1:Error) : void {
var local2:String = param1.message + ", " + param1.getStackTrace();
messageBoxService.showMessage(new UnclassifyedError(local2));
}
protected function onTransportError(param1:ErrorEvent) : void {
networkLogger.error(param1.toString());
if(this.connectionStatus == ConnectionStatus.CONNECTING) {
this.tryNextPort();
} else if(this.connectionStatus == ConnectionStatus.CONNECTED) {
this.closeConnectionOnTransportError();
}
}
public function closeConnectionOnTransportError() : void {
messageBoxService.showMessage(new TransportError());
this.close(ConnectionCloseStatus.CONNECTION_ERROR,"Transport error");
}
private function initializeListeners() : void {
this.socket.addEventListener(Event.CLOSE,this.onSocketClose);
this.socket.addEventListener(Event.CONNECT,this.onConnect);
this.socket.addEventListener(IOErrorEvent.IO_ERROR,this.onTransportError);
this.socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR,this.onTransportError);
this.socket.addEventListener(ProgressEvent.SOCKET_DATA,this.onSocketData);
}
protected function preparePorts(param1:ConnectionConnectParameters) : void {
this.ports = param1.ports;
this.moveLastSuccessfulPortToFront();
}
private function moveLastSuccessfulPortToFront() : void {
var lastPort:int = 0;
var index:Number = NaN;
try {
lastPort = int(networkService.getLastPort(this.host));
if(lastPort > 0) {
index = Number(this.ports.indexOf(lastPort));
if(index >= 0) {
this.ports.splice(index,1);
this.ports.unshift(lastPort);
}
}
}
catch(e:Error) {
connectionLogger.warning("Error read stored port from shared object, message = %1",[e]);
}
}
protected function onConnect(param1:Event) : void {
networkService.saveLastPort(this.host,this.ports[this.portIndex]);
this.connectionStatus = ConnectionStatus.CONNECTED;
this.commandCodec.init(this.protocol);
this.commandHandler.onConnectionOpen(this);
}
protected function tryConnect() : void {
this.socket.connect(this.host,this.ports[this.portIndex]);
}
public function close(param1:ConnectionCloseStatus, param2:String = null) : void {
this.socket.flush();
this.socket.close();
this.connectionStatus = ConnectionStatus.DISCONNECTED;
this.commandHandler.onConnectionClose(param1,param2);
}
public function sendCommand(param1:Object) : void {
var command:Object = param1;
if(this.connectionStatus == ConnectionStatus.CONNECTED) {
try {
this.writeCommand(command,this.socket);
this.socket.flush();
}
catch(error:Error) {
handleDataSendingError(error);
}
}
}
private function onSocketClose(param1:Event) : void {
this.close(ConnectionCloseStatus.CLOSED_BY_SERVER);
}
private function onSocketData(param1:ProgressEvent) : void {
this.rawDataBuffer.clear();
this.socket.readBytes(this.rawDataBuffer);
this.processDataBuffer();
}
}
}
|
package alternativa.tanks.gui.shop.shopitems.item.base {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.gui.shop.shopitems.item.base.GreyShopItemSkin_overStateClass.png")]
public class GreyShopItemSkin_overStateClass extends BitmapAsset {
public function GreyShopItemSkin_overStateClass() {
super();
}
}
}
|
package _codec.projects.tanks.client.panel.model.profile.rename {
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.profile.rename.AndroidRenameCC;
public class VectorCodecAndroidRenameCCLevel1 implements ICodec {
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecAndroidRenameCCLevel1(param1:Boolean) {
super();
this.optionalElement = param1;
}
public function init(param1:IProtocol) : void {
this.elementCodec = param1.getCodec(new TypeCodecInfo(AndroidRenameCC,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.<AndroidRenameCC> = new Vector.<AndroidRenameCC>(local2,true);
var local4:int = 0;
while(local4 < local2) {
local3[local4] = AndroidRenameCC(this.elementCodec.decode(param1));
local4++;
}
return local3;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
var local4:AndroidRenameCC = null;
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:Vector.<AndroidRenameCC> = Vector.<AndroidRenameCC>(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.tanksservices.model.listener {
import alternativa.types.Long;
public class UserNotifierCC {
private var _currentUserId:Long;
public function UserNotifierCC(param1:Long = null) {
super();
this._currentUserId = param1;
}
public function get currentUserId() : Long {
return this._currentUserId;
}
public function set currentUserId(param1:Long) : void {
this._currentUserId = param1;
}
public function toString() : String {
var local1:String = "UserNotifierCC [";
local1 += "currentUserId = " + this.currentUserId + " ";
return local1 + "]";
}
}
}
|
package alternativa.tanks.models.weapon.shaft.cameracontrollers {
import alternativa.math.Matrix3;
import alternativa.math.Quaternion;
import alternativa.math.Vector3;
import alternativa.osgi.service.display.IDisplay;
import alternativa.tanks.battle.BattleService;
import alternativa.tanks.battle.objects.tank.WeaponPlatform;
import alternativa.tanks.camera.CameraController;
import alternativa.tanks.camera.GameCamera;
import alternativa.tanks.models.weapon.AllGlobalGunParams;
import alternativa.tanks.models.weapon.shaft.LinearInterpolator;
import alternativa.tanks.models.weapon.shaft.ShaftAimingType;
import alternativa.tanks.models.weapon.shaft.ShaftWeapon;
import alternativa.tanks.utils.MathUtils;
import alternativa.utils.removeDisplayObject;
import flash.display.Bitmap;
import flash.display.BitmapData;
public class AimingCameraController implements CameraController {
[Inject]
public static var display:IDisplay;
[Inject]
public static var battleService:BattleService;
private static const OFFSET_ELIMINATION_SPEED:Number = 1;
private static const Cross:Class = AimingCameraController_Cross;
private static const CrossBitmap:BitmapData = new Cross().bitmapData;
private var cross:Bitmap = new Bitmap(CrossBitmap);
private var weapon:ShaftWeapon;
private var weaponPlatform:WeaponPlatform;
private const gunParams:AllGlobalGunParams = new AllGlobalGunParams();
private const rotation:Quaternion = new Quaternion();
private const directionRotation:Quaternion = new Quaternion();
private const elevationRotation:Quaternion = new Quaternion();
private const m3:Matrix3 = new Matrix3();
private const yAxis:Vector3 = new Vector3();
private const globalAimDirection:Vector3 = new Vector3();
private var aimingType:ShaftAimingType = ShaftAimingType.DIRECTIONAL;
private var elevationOffset:Number = 0;
private var directionOffset:Number = 0;
private var fovInterpolator:LinearInterpolator = new LinearInterpolator();
public function AimingCameraController(param1:ShaftWeapon, param2:WeaponPlatform, param3:Number, param4:Number) {
super();
this.weapon = param1;
this.weaponPlatform = param2;
this.fovInterpolator.setInterval(param3,param4);
}
public function activate(param1:GameCamera) : void {
this.elevationOffset = 0;
this.directionOffset = 0;
this.showReticle();
if(this.aimingType == ShaftAimingType.MOUSE) {
this.showCross();
}
}
public function deactivate() : void {
this.hideCross();
this.hideReticle();
}
private function showReticle() : void {
battleService.getBattleView().getParentDisplayContainer().addChild(this.weapon.getReticleDisplay());
this.weapon.getReticleDisplay().centerOnScreen();
}
private function hideReticle() : void {
removeDisplayObject(this.weapon.getReticleDisplay());
}
private function showCross() : void {
battleService.getBattleView().getParentDisplayContainer().addChild(this.cross);
this.updateCrossPosition();
}
private function hideCross() : void {
removeDisplayObject(this.cross);
}
public function setAimingType(param1:ShaftAimingType) : void {
if(this.aimingType != param1) {
this.aimingType = param1;
switch(param1) {
case ShaftAimingType.DIRECTIONAL:
this.directionOffset = MathUtils.clampAngleDelta(this.weapon.getTargetDirection(),this.weaponPlatform.getWeaponMount().getTurretInterpolatedDirection());
this.elevationOffset = this.weapon.getTargetElevation() - this.weapon.getInterpolatedElevation();
this.hideCross();
break;
case ShaftAimingType.MOUSE:
this.showCross();
}
}
}
public function update(param1:GameCamera, param2:int, param3:int) : void {
var local6:Number = NaN;
var local7:Number = NaN;
var local8:Number = NaN;
param1.fov = this.fovInterpolator.interpolate(this.weapon.getAimingModeEnergyFraction());
this.weaponPlatform.getAllGunParams(this.gunParams);
var local4:Vector3 = this.gunParams.elevationAxis;
var local5:Vector3 = this.gunParams.direction;
this.yAxis.cross2(local5,local4);
this.m3.setAxis(local4,this.yAxis,local5);
this.m3.rotationMatrixToQuaternion(this.rotation);
switch(this.aimingType) {
case ShaftAimingType.DIRECTIONAL:
local8 = OFFSET_ELIMINATION_SPEED * 0.001 * param3;
this.directionOffset = MathUtils.moveValueTowards(this.directionOffset,0,local8);
this.elevationOffset = MathUtils.moveValueTowards(this.elevationOffset,0,local8);
local7 = this.directionOffset;
local6 = this.weapon.getInterpolatedElevation() + this.elevationOffset;
break;
case ShaftAimingType.MOUSE:
local7 = MathUtils.clampAngleDelta(this.weapon.getTargetDirection(),this.weaponPlatform.getWeaponMount().getTurretInterpolatedDirection());
local6 = this.weapon.getTargetElevation();
this.updateCrossPosition();
}
this.directionRotation.setFromAxisAngle(Vector3.Y_AXIS,-local7);
this.elevationRotation.setFromAxisAngle(Vector3.X_AXIS,local6);
this.rotation.prepend(this.directionRotation);
this.rotation.prepend(this.elevationRotation);
param1.setPosition(this.gunParams.barrelOrigin);
param1.setQRotation(this.rotation);
this.weapon.getAimDirection(this.globalAimDirection);
this.weapon.getReticleDisplay().updatePositon(this.globalAimDirection);
}
private function updateCrossPosition() : void {
this.cross.x = display.stage.stageWidth - this.cross.width >> 1;
this.cross.y = display.stage.stageHeight - this.cross.height >> 1;
}
}
}
|
package projects.tanks.client.entrance.model.entrance.email {
public interface IEmailRegistrationModelBase {
function emailDomainIsForbidden() : void;
function emailIsBusy() : void;
function emailIsFree() : void;
function emailIsInvalid() : void;
function emailWithPasswordSuccessfullySent() : void;
}
}
|
package alternativa.tanks.models.controlpoints.sfx {
import alternativa.engine3d.materials.TextureMaterial;
import alternativa.osgi.service.console.variables.ConsoleVarFloat;
import alternativa.utils.TextureMaterialRegistry;
import platform.client.fp10.core.resource.types.TextureResource;
import projects.tanks.client.battlefield.models.battle.cp.resources.DominationResources;
import projects.tanks.client.battleservice.model.battle.team.BattleTeam;
public class AllBeamProperties {
private static const conBeamWidth:ConsoleVarFloat = new ConsoleVarFloat("beam_width",100,0,1000);
private static const conUnitLength:ConsoleVarFloat = new ConsoleVarFloat("beam_ulength",500,0,10000);
private static const conAnimationSpeed:ConsoleVarFloat = new ConsoleVarFloat("beam_anim_speed",-0.6,-1000,1000);
private static const conURange:ConsoleVarFloat = new ConsoleVarFloat("beam_urange",0.6,0.1,1);
private static const conAlpha:ConsoleVarFloat = new ConsoleVarFloat("beam_alpha",1,0,1);
private var blueBeamProperties:BeamProperties;
private var redBeamProperties:BeamProperties;
public function AllBeamProperties(param1:TextureMaterialRegistry, param2:DominationResources) {
super();
this.blueBeamProperties = createBeamProperties(param1,param2.blueRay,param2.blueRayTip,50,100,1,1,1);
this.redBeamProperties = createBeamProperties(param1,param2.redRay,param2.redRayTip,50,100,1,1,1);
}
private static function createBeamProperties(param1:TextureMaterialRegistry, param2:TextureResource, param3:TextureResource, param4:Number, param5:Number, param6:Number, param7:Number, param8:Number) : BeamProperties {
var local9:TextureMaterial = param1.getMaterial(param2.data);
local9.repeat = true;
var local10:TextureMaterial = param1.getMaterial(param3.data);
return new BeamProperties(local9,local10,param4,param5,param6,param7,param8);
}
private static function createProperties(param1:BeamProperties) : BeamProperties {
return new BeamProperties(param1.beamMaterial,param1.beamTipMaterial,conBeamWidth.value,conUnitLength.value,conAnimationSpeed.value,conURange.value,conAlpha.value);
}
private function getBlueBeamProperties() : BeamProperties {
return createProperties(this.blueBeamProperties);
}
private function getRedBeamProperties() : BeamProperties {
return createProperties(this.redBeamProperties);
}
public function getBeamProperties(param1:BattleTeam) : BeamProperties {
return param1 == BattleTeam.BLUE ? this.getBlueBeamProperties() : this.getRedBeamProperties();
}
}
}
|
package projects.tanks.client.battleservice.model.statistics {
import alternativa.types.Long;
public class UserReward {
private var _newbiesAbonementBonusReward:int;
private var _premiumBonusReward:int;
private var _reward:int;
private var _starsReward:int;
private var _starsRewardForPremium:int;
private var _userId:Long;
public function UserReward(param1:int = 0, param2:int = 0, param3:int = 0, param4:int = 0, param5:int = 0, param6:Long = null) {
super();
this._newbiesAbonementBonusReward = param1;
this._premiumBonusReward = param2;
this._reward = param3;
this._starsReward = param4;
this._starsRewardForPremium = param5;
this._userId = param6;
}
public function get newbiesAbonementBonusReward() : int {
return this._newbiesAbonementBonusReward;
}
public function set newbiesAbonementBonusReward(param1:int) : void {
this._newbiesAbonementBonusReward = param1;
}
public function get premiumBonusReward() : int {
return this._premiumBonusReward;
}
public function set premiumBonusReward(param1:int) : void {
this._premiumBonusReward = param1;
}
public function get reward() : int {
return this._reward;
}
public function set reward(param1:int) : void {
this._reward = param1;
}
public function get starsReward() : int {
return this._starsReward;
}
public function set starsReward(param1:int) : void {
this._starsReward = param1;
}
public function get starsRewardForPremium() : int {
return this._starsRewardForPremium;
}
public function set starsRewardForPremium(param1:int) : void {
this._starsRewardForPremium = param1;
}
public function get userId() : Long {
return this._userId;
}
public function set userId(param1:Long) : void {
this._userId = param1;
}
public function toString() : String {
var local1:String = "UserReward [";
local1 += "newbiesAbonementBonusReward = " + this.newbiesAbonementBonusReward + " ";
local1 += "premiumBonusReward = " + this.premiumBonusReward + " ";
local1 += "reward = " + this.reward + " ";
local1 += "starsReward = " + this.starsReward + " ";
local1 += "starsRewardForPremium = " + this.starsRewardForPremium + " ";
local1 += "userId = " + this.userId + " ";
return local1 + "]";
}
}
}
|
package alternativa.tanks.gui {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.gui.ItemInfoPanelBitmaps_bitmapDroneOverdriveBoost.png")]
public class ItemInfoPanelBitmaps_bitmapDroneOverdriveBoost extends BitmapAsset {
public function ItemInfoPanelBitmaps_bitmapDroneOverdriveBoost() {
super();
}
}
}
|
package com.alternativaplatform.projects.tanks.client.models.battlefield
{
public class BattlefieldSoundScheme
{
public var environmentSoundId:String;
public var ambientSound:String;
public var bonusTakeSoundId:String;
public var battleFinishSoundId:String;
public var killSoundId:String;
public function BattlefieldSoundScheme()
{
super();
}
}
}
|
package projects.tanks.client.battlefield.models.ultimate.effects.wasp.bomb {
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 WaspUltimateBombModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:WaspUltimateBombModelServer;
private var client:IWaspUltimateBombModelBase = IWaspUltimateBombModelBase(this);
private var modelId:Long = Long.getLong(730448159,-745262215);
private var _bangId:Long = Long.getLong(401765853,1762190228);
public function WaspUltimateBombModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new WaspUltimateBombModelServer(IModel(this));
var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry));
local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(WaspUltimateBombCC,false)));
}
protected function getInitParam() : WaspUltimateBombCC {
return WaspUltimateBombCC(initParams[Model.object]);
}
override public function invoke(param1:Long, param2:ProtocolBuffer) : void {
switch(param1) {
case this._bangId:
this.client.bang();
}
}
override public function get id() : Long {
return this.modelId;
}
}
}
|
package alternativa.tanks.model.gift.opened
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class GiftOpenedView_Background extends BitmapAsset
{
public function GiftOpenedView_Background()
{
super();
}
}
}
|
package com.alternativaplatform.projects.tanks.client.models.battlefield
{
import com.alternativaplatform.projects.tanks.client.commons.types.Vector3d;
public class BattleBonus
{
public var id:String;
public var objectId:String;
public var position:Vector3d;
public var timeFromAppearing:int;
public function BattleBonus()
{
super();
}
}
}
|
package projects.tanks.client.battlefield.models.bonus.battle.bonusregions {
import projects.tanks.client.battlefield.models.bonus.bonus.BonusesType;
import projects.tanks.client.battlefield.types.Vector3d;
public class BonusRegionData {
private var _position:Vector3d;
private var _regionType:BonusesType;
private var _rotation:Vector3d;
public function BonusRegionData(param1:Vector3d = null, param2:BonusesType = null, param3:Vector3d = null) {
super();
this._position = param1;
this._regionType = param2;
this._rotation = param3;
}
public function get position() : Vector3d {
return this._position;
}
public function set position(param1:Vector3d) : void {
this._position = param1;
}
public function get regionType() : BonusesType {
return this._regionType;
}
public function set regionType(param1:BonusesType) : void {
this._regionType = param1;
}
public function get rotation() : Vector3d {
return this._rotation;
}
public function set rotation(param1:Vector3d) : void {
this._rotation = param1;
}
public function toString() : String {
var local1:String = "BonusRegionData [";
local1 += "position = " + this.position + " ";
local1 += "regionType = " + this.regionType + " ";
local1 += "rotation = " + this.rotation + " ";
return local1 + "]";
}
}
}
|
package alternativa.tanks.gui.notinclan.dialogs {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.gui.notinclan.dialogs.ClanCreateDialog_licenseImageClass.png")]
public class ClanCreateDialog_licenseImageClass extends BitmapAsset {
public function ClanCreateDialog_licenseImageClass() {
super();
}
}
}
|
package alternativa.tanks.gui.notinclan.dialogs.requests {
import alternativa.osgi.service.locale.ILocaleService;
import alternativa.tanks.gui.notinclan.clanslist.ClanListType;
import alternativa.tanks.gui.notinclan.clanslist.ClansListEvent;
import alternativa.tanks.models.user.ClanUserService;
import alternativa.tanks.models.user.IClanUserModel;
import alternativa.tanks.models.user.incoming.IClanUserIncomingModel;
import controls.base.DefaultButtonBase;
import controls.base.LabelBase;
import controls.base.TankInputBase;
import flash.events.Event;
import flash.events.FocusEvent;
import flash.events.KeyboardEvent;
import flash.events.MouseEvent;
import flash.utils.clearTimeout;
import flash.utils.setTimeout;
import forms.ColorConstants;
import forms.events.LoginFormEvent;
import projects.tanks.clients.fp10.libraries.TanksLocale;
public class UserIncomingRequestsDialog extends UserRequestsDialog {
[Inject]
public static var localeService:ILocaleService;
[Inject]
public static var clanUserService:ClanUserService;
private static const SEARCH_TIMEOUT:int = 600;
protected var actionButton:DefaultButtonBase = new DefaultButtonBase();
protected var clanNameInput:TankInputBase = new TankInputBase();
protected var searchLabel:LabelBase = new LabelBase();
private var searchInListTimeOut:Number;
private var labelClanAction:String = localeService.getText(TanksLocale.TEXT_CLAN_SEARCH_CLAN_IN_LIST);
public function UserIncomingRequestsDialog(param1:int) {
this.closeButtonWidth = param1;
super();
this.actionButton.addEventListener(MouseEvent.CLICK,this.onActionClick);
this.clanNameInput.addEventListener(FocusEvent.FOCUS_IN,this.onFocusInSearchInput);
this.clanNameInput.addEventListener(FocusEvent.FOCUS_OUT,this.onFocusOutSearchInput);
this.clanNameInput.maxChars = 20;
this.searchLabel.mouseEnabled = false;
this.searchLabel.color = ColorConstants.LIST_LABEL_HINT;
this.actionButton.label = localeService.getText(TanksLocale.TEXT_FRIENDS_DECLINE_ALL_BUTTON);
this.actionButton.enable = true;
this.actionButton.width = 120;
this.searchLabel.text = this.labelClanAction;
this.clanNameInput.addEventListener(LoginFormEvent.TEXT_CHANGED,this.onClanNameChanged);
var local2:IClanUserIncomingModel = clanUserService.userObject.adapt(IClanUserIncomingModel) as IClanUserIncomingModel;
clansList.fillClansList(local2.getIncomingClans(),ClanListType.INCOMING);
ClansListEvent.getDispatcher().addEventListener(ClansListEvent.INCOMING + ClansListEvent.ADD,onAddRequest);
ClansListEvent.getDispatcher().addEventListener(ClansListEvent.INCOMING + ClansListEvent.REMOVE,onCancelRequest);
this.clanNameInput.addEventListener(KeyboardEvent.KEY_UP,onKeyUp);
addChild(this.actionButton);
addChild(this.clanNameInput);
addChild(this.searchLabel);
}
override protected function onResize(param1:Event = null) : void {
heightSearchUnit = Math.max(this.actionButton.height,this.clanNameInput.height);
super.onResize(param1);
this.actionButton.x = width - this.actionButton.width - 2 * MARGIN - closeButtonWidth;
this.actionButton.y = height - this.actionButton.height - MARGIN;
this.clanNameInput.x = MARGIN;
this.clanNameInput.y = height - MARGIN - this.clanNameInput.height;
this.clanNameInput.width = width - this.actionButton.width - 4 * MARGIN - closeButtonWidth;
this.searchLabel.x = this.clanNameInput.x + 3;
this.searchLabel.y = this.clanNameInput.y + 7;
}
override protected function onActionClick(param1:MouseEvent) : void {
(clanUserService.userObject.adapt(IClanUserModel) as IClanUserModel).rejectAll();
}
private function onClanNameChanged(param1:LoginFormEvent) : void {
clearTimeout(this.searchInListTimeOut);
this.searchInListTimeOut = setTimeout(clansList.filterByProperty,SEARCH_TIMEOUT,"name",this.clanNameInput.value);
}
override protected function confirmationKeyPressed() : void {
super.confirmationKeyPressed();
}
override protected function removeEvents() : void {
super.removeEvents();
ClansListEvent.getDispatcher().removeEventListener(ClansListEvent.INCOMING + ClansListEvent.ADD,onAddRequest);
ClansListEvent.getDispatcher().removeEventListener(ClansListEvent.INCOMING + ClansListEvent.REMOVE,onCancelRequest);
this.clanNameInput.removeEventListener(KeyboardEvent.KEY_UP,onKeyUp);
this.clanNameInput.removeEventListener(LoginFormEvent.TEXT_CHANGED,this.onClanNameChanged);
}
override public function destroy() : void {
clansList.removeAllViewed();
super.destroy();
}
private function onFocusInSearchInput(param1:FocusEvent) : void {
this.searchLabel.visible = false;
}
private function onFocusOutSearchInput(param1:FocusEvent) : void {
if(this.clanNameInput.value.length == 0) {
this.searchLabel.visible = true;
}
}
}
}
|
package _codec.projects.tanks.client.battlefield.models.effects.duration.time {
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import projects.tanks.client.battlefield.models.effects.duration.time.DurationCC;
public class VectorCodecDurationCCLevel1 implements ICodec {
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecDurationCCLevel1(param1:Boolean) {
super();
this.optionalElement = param1;
}
public function init(param1:IProtocol) : void {
this.elementCodec = param1.getCodec(new TypeCodecInfo(DurationCC,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.<DurationCC> = new Vector.<DurationCC>(local2,true);
var local4:int = 0;
while(local4 < local2) {
local3[local4] = DurationCC(this.elementCodec.decode(param1));
local4++;
}
return local3;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
var local4:DurationCC = null;
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:Vector.<DurationCC> = Vector.<DurationCC>(param2);
var local5:int = int(local3.length);
LengthCodecHelper.encodeLength(param1,local5);
var local6:int = 0;
while(local6 < local5) {
this.elementCodec.encode(param1,local3[local6]);
local6++;
}
}
}
}
|
package alternativa.tanks.models.sfx.shoot.gun
{
import alternativa.engine3d.core.Camera3D;
import alternativa.engine3d.core.Object3D;
import alternativa.engine3d.materials.TextureMaterial;
import alternativa.engine3d.objects.Mesh;
import alternativa.init.Main;
import alternativa.math.Vector3;
import alternativa.model.IModel;
import alternativa.object.ClientObject;
import alternativa.tanks.engine3d.MaterialSequence;
import alternativa.tanks.engine3d.MaterialType;
import alternativa.tanks.engine3d.TextureAnimation;
import alternativa.tanks.models.battlefield.BattlefieldModel;
import alternativa.tanks.models.battlefield.IBattleField;
import alternativa.tanks.models.sfx.AnimatedLightEffect;
import alternativa.tanks.models.sfx.LightDataManager;
import alternativa.tanks.models.sfx.MuzzlePositionProvider;
import alternativa.tanks.models.sfx.shoot.ICommonShootSFX;
import alternativa.tanks.services.materialregistry.IMaterialRegistry;
import alternativa.tanks.services.objectpool.IObjectPoolService;
import alternativa.tanks.sfx.AnimatedSpriteEffectNew;
import alternativa.tanks.sfx.EffectsPair;
import alternativa.tanks.sfx.PlaneMuzzleFlashEffect;
import alternativa.tanks.sfx.Sound3D;
import alternativa.tanks.sfx.Sound3DEffect;
import alternativa.tanks.sfx.SoundOptions;
import alternativa.tanks.sfx.StaticObject3DPositionProvider;
import alternativa.tanks.utils.GraphicsUtils;
import com.alternativaplatform.projects.tanks.client.warfare.models.sfx.shoot.gun.GunShootSFXModelBase;
import com.alternativaplatform.projects.tanks.client.warfare.models.sfx.shoot.gun.IGunShootSFXModelBase;
import flash.display.BitmapData;
import flash.media.Sound;
import scpacker.resource.ResourceType;
import scpacker.resource.ResourceUtil;
public class SmokySFXModel extends GunShootSFXModelBase implements IGunShootSFXModelBase, ICommonShootSFX
{
private static const SHOT_SOUND_VOLUME:Number = 1;
private static const EXPLOSION_BASE_SIZE:Number = 600;
private static const EXPLOSION_OFFSET_TO_CAMERA:Number = 135;
private static var objectPoolService:IObjectPoolService;
private static var materialRegistry:IMaterialRegistry;
private static var MIPMAP_RESOLUTION:Number = 2;
private static var position:Vector3 = new Vector3();
private static var bfModel:BattlefieldModel;
public function SmokySFXModel()
{
super();
_interfaces.push(IModel,IGunShootSFXModelBase,ICommonShootSFX);
}
public function initObject(clientObject:ClientObject, explosionResourceId:String, explosionSoundResourceId:String, shotResourceId:String, shotSoundResourceId:String) : void
{
objectPoolService = IObjectPoolService(Main.osgi.getService(IObjectPoolService));
materialRegistry = IMaterialRegistry(Main.osgi.getService(IMaterialRegistry));
var data:GunShootSFXData = new GunShootSFXData();
var shotTexture:BitmapData = ResourceUtil.getResource(ResourceType.IMAGE,shotResourceId).bitmapData as BitmapData;
data.shotMaterial = materialRegistry.textureMaterialRegistry.getMaterial(MaterialType.EFFECT,shotTexture,EXPLOSION_BASE_SIZE / shotTexture.width,false);
var explosionTexture:BitmapData = ResourceUtil.getResource(ResourceType.IMAGE,explosionResourceId).bitmapData as BitmapData;
var sequence:MaterialSequence = materialRegistry.materialSequenceRegistry.getSequence(MaterialType.EFFECT,explosionTexture,explosionTexture.height,MIPMAP_RESOLUTION);
data.explosionMaterials = sequence.materials;
data.shotSound = ResourceUtil.getResource(ResourceType.SOUND,"smoky_shot").sound as Sound;
data.explosionSound = ResourceUtil.getResource(ResourceType.SOUND,"smoky_exp").sound as Sound;
var animExpl:TextureAnimation = GraphicsUtils.getTextureAnimation(null,explosionTexture,200,200);
animExpl.fps = 30;
var animShot:TextureAnimation = GraphicsUtils.getTextureAnimation(null,shotTexture,30,105);
animShot.fps = 1;
data.explosionData = animExpl;
data.shotData = animShot;
clientObject.putParams(SmokySFXModel,data);
}
public function createShotEffects(clientObject:ClientObject, localMuzzlePosition:Vector3, turret:Object3D, camera:Camera3D) : EffectsPair
{
var data:GunShootSFXData = null;
data = null;
data = this.getSfxData(clientObject);
var sound:Sound3D = Sound3D.create(data.shotSound,SoundOptions.nearRadius,SoundOptions.farRadius,SoundOptions.farDelimiter,SHOT_SOUND_VOLUME);
position.x = turret.x;
position.y = turret.y;
position.z = turret.z;
var soundEffect:Sound3DEffect = Sound3DEffect.create(objectPoolService.objectPool,null,position,sound);
var graphicEffect:PlaneMuzzleFlashEffect = PlaneMuzzleFlashEffect(objectPoolService.objectPool.getObject(PlaneMuzzleFlashEffect));
graphicEffect.init(localMuzzlePosition,turret,data.shotMaterial as TextureMaterial,100,60,210);
this.createMuzzleFlashLightEffect(localMuzzlePosition,turret as Mesh,clientObject);
return new EffectsPair(graphicEffect,soundEffect);
}
public function createExplosionEffects(clientObject:ClientObject, position:Vector3, camera:Camera3D, weakeningCoeff:Number) : EffectsPair
{
var data:GunShootSFXData = this.getSfxData(clientObject);
var sound:Sound3D = Sound3D.create(data.explosionSound,SoundOptions.nearRadius,SoundOptions.farRadius,SoundOptions.farDelimiter,1);
var soundEffect:Sound3DEffect = Sound3DEffect.create(objectPoolService.objectPool,null,position,sound,100);
var graphicEffect:AnimatedSpriteEffectNew = AnimatedSpriteEffectNew(objectPoolService.objectPool.getObject(AnimatedSpriteEffectNew));
var posProvider:StaticObject3DPositionProvider = StaticObject3DPositionProvider(objectPoolService.objectPool.getObject(StaticObject3DPositionProvider));
posProvider.init(position,EXPLOSION_OFFSET_TO_CAMERA);
var size:Number = EXPLOSION_BASE_SIZE * weakeningCoeff;
this.createExplosionLightEffect(position,clientObject);
graphicEffect.init(size,size,data.explosionData,0,posProvider);
return new EffectsPair(graphicEffect,soundEffect);
}
private function getSfxData(clientObject:ClientObject) : GunShootSFXData
{
return GunShootSFXData(clientObject.getParams(SmokySFXModel));
}
private function createMuzzleFlashLightEffect(param1:Vector3, param2:Mesh, turretObj:ClientObject) : void
{
var _loc3_:AnimatedLightEffect = AnimatedLightEffect(objectPoolService.objectPool.getObject(AnimatedLightEffect));
var _loc4_:MuzzlePositionProvider = MuzzlePositionProvider(objectPoolService.objectPool.getObject(MuzzlePositionProvider));
_loc4_.init(param2,param1,0);
_loc3_.init(_loc4_,LightDataManager.getLightDataMuzzle(turretObj.id));
bfModel = Main.osgi.getService(IBattleField) as BattlefieldModel;
bfModel.addGraphicEffect(_loc3_);
}
private function createExplosionLightEffect(param1:Vector3, turretObj:ClientObject) : void
{
var _loc2_:AnimatedLightEffect = AnimatedLightEffect(objectPoolService.objectPool.getObject(AnimatedLightEffect));
var _loc3_:StaticObject3DPositionProvider = StaticObject3DPositionProvider(objectPoolService.objectPool.getObject(StaticObject3DPositionProvider));
_loc3_.init(param1,30);
if(_loc3_ == null)
{
throw new ArgumentError("pos can not be null");
}
_loc2_.init(_loc3_,LightDataManager.getLightDataExplosion(turretObj.id));
bfModel = Main.osgi.getService(IBattleField) as BattlefieldModel;
bfModel.addGraphicEffect(_loc2_);
}
}
}
|
package assets.window.elemets {
import flash.display.Sprite;
[Embed(source="/_assets/assets.swf", symbol="symbol31")]
public class WindowBottomLeftCorner extends Sprite {
public function WindowBottomLeftCorner() {
super();
}
}
}
|
package projects.tanks.client.battlefield.models.battle.gui.group {
public interface IMatchmakingGroupInfoModelBase {
}
}
|
package projects.tanks.client.partners.impl.china.partner360platform {
public interface IPartner360PlatformModelBase {
}
}
|
package projects.tanks.client.tanksservices.model.rankloader {
public interface IRankLoaderModelBase {
}
}
|
package controls.resultassets {
import assets.resultwindow.bres_SELECTED_BLUE_PIXEL;
import assets.resultwindow.bres_SELECTED_BLUE_TL;
import controls.statassets.StatLineBase;
public class ResultWindowBlueSelected extends StatLineBase {
public function ResultWindowBlueSelected() {
super();
tl = new bres_SELECTED_BLUE_TL(1,1);
px = new bres_SELECTED_BLUE_PIXEL(1,1);
frameColor = 7520742;
}
}
}
|
package alternativa.engine3d.core {
public class Sorting {
public static const NONE:int = 0;
public static const AVERAGE_Z:int = 1;
public static const DYNAMIC_BSP:int = 2;
public function Sorting() {
super();
}
}
}
|
package alternativa.tanks.model.shop
{
import alternativa.init.Main;
import alternativa.osgi.service.locale.ILocaleService;
import alternativa.osgi.service.mainContainer.IMainContainerService;
import alternativa.tanks.model.panel.IPanel;
import alternativa.tanks.model.panel.PanelModel;
import alternativa.tanks.model.shop.event.ShopItemChosen;
import flash.display.DisplayObjectContainer;
import flash.events.Event;
import scpacker.networking.INetworker;
import scpacker.networking.Network;
public class ShopModel
{
private var localeService:ILocaleService;
private var dialogsService:DisplayObjectContainer;
private var window:ShopWindow;
public function ShopModel()
{
super();
}
public function init(json:Object) : void
{
var category:Object = null;
var items:Array = null;
var item:Object = null;
this.localeService = Main.osgi.getService(ILocaleService) as ILocaleService;
this.dialogsService = (Main.osgi.getService(IMainContainerService) as IMainContainerService).dialogsLayer as DisplayObjectContainer;
ShopWindow.haveDoubleCrystalls = json.have_double_crystals;
this.window = new ShopWindow();
var data:Object = json.data;
var lang:String = (Main.osgi.getService(ILocaleService) as ILocaleService).language;
if(lang == null)
{
lang = "EN";
}
else
{
lang = lang.toUpperCase();
}
var categories:Array = data.categories;
for each(category in categories)
{
this.window.addCategory(category.header_text[lang],category.description[lang],category.category_id);
}
items = data.items;
for each(item in items)
{
this.window.addItem(item.category_id,item.item_id,item.additional_data);
}
this.window.addEventListener(ShopItemChosen.EVENT_TYPE,this.onSelectItem);
}
private function onClose(e:Event) : void
{
this.dialogsService.removeChild(this.window);
this.window.removeEventListener(Event.CLOSE,this.onClose);
Main.stage.removeEventListener(Event.RESIZE,this.onResize);
PanelModel(Main.osgi.getService(IPanel)).closeShopWindow();
this.window = null;
}
private function onResize(e:Event = null) : void
{
this.window.x = Math.round((Main.stage.stageWidth - this.window.width) * 0.5);
this.window.y = Math.round((Main.stage.stageHeight - this.window.height) * 0.5);
}
public function onEventWindow() : void
{
this.window.addEventListener(Event.CLOSE,this.onClose);
Main.stage.addEventListener(Event.RESIZE,this.onResize);
this.dialogsService.addChild(this.window);
this.onResize();
}
private function onSelectItem(e:ShopItemChosen) : void
{
Network(Main.osgi.getService(INetworker)).send("lobby;shop_buy_item;" + e.itemId);
}
}
}
|
package alternativa.tanks.view.battleinfo.team {
import alternativa.tanks.view.battleinfo.AbstractBattleInfoView;
import alternativa.tanks.view.battleinfo.BattleInfoUserList;
import alternativa.tanks.view.battleinfo.BattleInfoViewEvent;
import alternativa.tanks.view.battleinfo.LocaleBattleInfo;
import alternativa.tanks.view.battleinfo.renderer.BattleInfoBlueUserListRenderer;
import alternativa.tanks.view.battleinfo.renderer.BattleInfoRedUserListRenderer;
import alternativa.tanks.view.battlelist.forms.BattleBigButton;
import assets.icons.play_icons_BLUE;
import assets.icons.play_icons_RED;
import controls.TankWindowInner;
import controls.base.LabelBase;
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.filters.GlowFilter;
import flash.text.TextFieldAutoSize;
import forms.Styles;
import projects.tanks.client.battleservice.model.battle.team.BattleTeam;
import utils.ScrollStyleUtils;
public class BattleInfoTeamView extends AbstractBattleInfoView {
private var _listInnerRed:TankWindowInner;
private var _listInnerBlue:TankWindowInner;
public var redFightButton:BattleBigButton;
public var blueFightButton:BattleBigButton;
public var blueUserList:BattleInfoUserList;
public var redUserList:BattleInfoUserList;
private var _redScoreLabel:LabelBase;
private var _blueScoreLabel:LabelBase;
private var scorePanel:Sprite;
public function BattleInfoTeamView() {
super();
}
override protected function createUserList() : void {
this._listInnerRed = new TankWindowInner(100,100,TankWindowInner.RED);
this._listInnerRed.showBlink = true;
addChild(this._listInnerRed);
this._listInnerBlue = new TankWindowInner(100,100,TankWindowInner.BLUE);
this._listInnerBlue.showBlink = true;
addChild(this._listInnerBlue);
this.blueUserList = new BattleInfoUserList();
this.blueUserList.setStyle(Styles.CELL_RENDERER,BattleInfoBlueUserListRenderer);
addChild(this.blueUserList);
this.redUserList = new BattleInfoUserList();
this.redUserList.setStyle(Styles.CELL_RENDERER,BattleInfoRedUserListRenderer);
addChild(this.redUserList);
ScrollStyleUtils.setRedStyle(this.redUserList);
ScrollStyleUtils.setBlueStyle(this.blueUserList);
}
override protected function addControlsToPanel() : void {
this.redFightButton = new BattleBigButton();
this.redFightButton.label = LocaleBattleInfo.fightButtonLabel;
this.redFightButton.icon = new play_icons_RED(0,0);
addChild(this.redFightButton);
this.blueFightButton = new BattleBigButton();
this.blueFightButton.label = LocaleBattleInfo.fightButtonLabel;
this.blueFightButton.icon = new play_icons_BLUE(0,0);
addChild(this.blueFightButton);
this.scorePanel = new Sprite();
addChild(this.scorePanel);
this._redScoreLabel = new LabelBase();
this._redScoreLabel.size = 22;
this._redScoreLabel.color = TankWindowInner.RED;
this._redScoreLabel.x = -74;
this._redScoreLabel.width = 70;
this._redScoreLabel.autoSize = TextFieldAutoSize.RIGHT;
this.scorePanel.addChild(this._redScoreLabel);
this._blueScoreLabel = new LabelBase();
this._blueScoreLabel.size = 22;
this._blueScoreLabel.color = TankWindowInner.BLUE;
this._blueScoreLabel.x = 5;
this._blueScoreLabel.width = 70;
this._blueScoreLabel.autoSize = TextFieldAutoSize.LEFT;
this.scorePanel.addChild(this._blueScoreLabel);
var local1:LabelBase = new LabelBase();
local1.size = 22;
local1.text = ":";
local1.x = -4;
local1.y = -2;
this.scorePanel.addChild(local1);
this.scorePanel.filters = [new GlowFilter(13434828,0.5)];
}
override protected function setEvents() : void {
super.setEvents();
this.redFightButton.addEventListener(MouseEvent.CLICK,this.onFightButtonRedClick);
this.blueFightButton.addEventListener(MouseEvent.CLICK,this.onFightButtonBlueClick);
}
override protected function removeEvents() : void {
super.removeEvents();
this.redFightButton.removeEventListener(MouseEvent.CLICK,this.onFightButtonRedClick);
this.blueFightButton.removeEventListener(MouseEvent.CLICK,this.onFightButtonBlueClick);
}
override public function destroy() : void {
super.destroy();
this._listInnerRed = null;
this._listInnerBlue = null;
this.redFightButton = null;
this.blueFightButton = null;
this.blueUserList = null;
this.redUserList = null;
this._redScoreLabel = null;
this._blueScoreLabel = null;
this.scorePanel = null;
}
override protected function resizeUserList(param1:Number, param2:Number) : void {
this._listInnerRed.width = int(param1 - 25) / 2;
this._listInnerRed.height = param2 - battleInfoParamsView.height - (proBattlePassAlert.visible ? 164 : 80);
this._listInnerRed.x = 11;
this._listInnerRed.y = battleInfoParamsView.height + 14;
this._listInnerBlue.width = param1 - this._listInnerRed.width - 25;
this._listInnerBlue.height = param2 - battleInfoParamsView.height - (proBattlePassAlert.visible ? 164 : 80);
this._listInnerBlue.x = 14 + this._listInnerRed.width;
this._listInnerBlue.y = battleInfoParamsView.height + 14;
this.redUserList.x = this._listInnerRed.x + 4;
this.redUserList.y = this._listInnerRed.y + 4;
this.redUserList.setSize(this._listInnerRed.width - (this.redUserList.verticalScrollBar.visible ? 1 : 4),this._listInnerRed.height - 8);
this.blueUserList.x = this._listInnerBlue.x + 4;
this.blueUserList.y = this._listInnerBlue.y + 4;
this.blueUserList.setSize(this._listInnerBlue.width - (this.blueUserList.verticalScrollBar.visible ? 1 : 4),this._listInnerBlue.height - 8);
}
override protected function resizeControlsPanel(param1:Number, param2:Number) : void {
this.blueFightButton.width = this.redFightButton.width = Math.min(130,int((param1 - 110) / 2));
this.redFightButton.x = 11;
this.redFightButton.y = param2 - 61;
this.blueFightButton.x = param1 - this.blueFightButton.width - 11;
this.blueFightButton.y = param2 - 61;
this.scorePanel.x = this._listInnerBlue.x - 3;
this.scorePanel.y = param2 - 51;
}
override protected function invalidateDataProviders() : void {
this.redUserList.dataProvider.invalidate();
this.blueUserList.dataProvider.invalidate();
}
override protected function updateAchievementPosition() : void {
}
override public function showProBattlePassAlert() : void {
super.showProBattlePassAlert();
this.blueFightButton.visible = false;
this.redFightButton.visible = false;
}
override public function hideNoSupplies() : void {
super.hideNoSupplies();
this.blueFightButton.visible = true;
this.redFightButton.visible = true;
}
override public function updateScore(param1:BattleTeam, param2:int) : void {
var local3:LabelBase = param1 == BattleTeam.RED ? this._redScoreLabel : this._blueScoreLabel;
local3.text = String(param2);
}
private function onFightButtonRedClick(param1:MouseEvent) : void {
dispatchEvent(new BattleInfoViewEvent(BattleInfoViewEvent.ENTER_BATTLE,BattleTeam.RED));
}
private function onFightButtonBlueClick(param1:MouseEvent) : void {
dispatchEvent(new BattleInfoViewEvent(BattleInfoViewEvent.ENTER_BATTLE,BattleTeam.BLUE));
}
override public function updateInBattleState() : void {
this.blueFightButton.visible = false;
this.redFightButton.visible = false;
super.updateInBattleState();
}
}
}
|
package alternativa.tanks.models.battle.gui.gui.statistics.field {
import assets.icons.BattleInfoIcons;
import controls.Label;
import flash.display.DisplayObject;
import flash.display.Sprite;
public class IconField extends Sprite {
protected var icon:DisplayObject;
protected var label:Label;
public function IconField(param1:DisplayObject) {
super();
this.icon = param1;
this.init();
}
public static function getIcon(param1:int) : DisplayObject {
var local2:BattleInfoIcons = new BattleInfoIcons();
local2.type = param1;
return local2;
}
protected function init() : void {
if(Boolean(this.icon)) {
addChild(this.icon);
this.icon.x = 0;
this.icon.y = 0;
}
this.label = new Label();
this.label.color = 16777215;
if(Boolean(this.icon)) {
this.label.x = this.icon.width + 3;
}
addChild(this.label);
}
public function set text(param1:String) : void {
this.label.htmlText = param1;
}
public function set size(param1:Number) : void {
this.label.size = param1;
}
}
}
|
package _codec.projects.tanks.client.garage.models.user.present {
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.user.present.PresentsCC;
public class VectorCodecPresentsCCLevel1 implements ICodec {
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecPresentsCCLevel1(param1:Boolean) {
super();
this.optionalElement = param1;
}
public function init(param1:IProtocol) : void {
this.elementCodec = param1.getCodec(new TypeCodecInfo(PresentsCC,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.<PresentsCC> = new Vector.<PresentsCC>(local2,true);
var local4:int = 0;
while(local4 < local2) {
local3[local4] = PresentsCC(this.elementCodec.decode(param1));
local4++;
}
return local3;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
var local4:PresentsCC = null;
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:Vector.<PresentsCC> = Vector.<PresentsCC>(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.proplib.objects
{
import alternativa.engine3d.objects.Sprite3D;
import alternativa.utils.textureutils.TextureByteData;
public class PropSprite extends PropObject
{
public var textureData:TextureByteData;
public var scale:Number;
public function PropSprite(textureData:TextureByteData, originX:Number = 0.5, originY:Number = 0.5, scale:Number = 1)
{
super(PropObjectType.SPRITE);
this.textureData = textureData;
this.scale = scale;
var sprite:Sprite3D = new Sprite3D(1,1);
sprite.originX = originX;
sprite.originY = originY;
object = sprite;
}
override public function traceProp() : void
{
super.traceProp();
}
public function remove() : *
{
var s:Sprite3D = object as Sprite3D;
s.destroy();
s = null;
}
}
}
|
package controls.rangicons
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class RangIcon_p6 extends BitmapAsset
{
public function RangIcon_p6()
{
super();
}
}
}
|
package alternativa.tanks.model.garage.resistance {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.model.garage.resistance.ResistancesIcons_resistanceIconClass.png")]
public class ResistancesIcons_resistanceIconClass extends BitmapAsset {
public function ResistancesIcons_resistanceIconClass() {
super();
}
}
}
|
package projects.tanks.client.garage.models.item.kit {
import platform.client.fp10.core.resource.types.ImageResource;
public class GarageKitCC {
private var _discountInPercent:int;
private var _image:ImageResource;
private var _kitItems:Vector.<KitItem>;
public function GarageKitCC(param1:int = 0, param2:ImageResource = null, param3:Vector.<KitItem> = null) {
super();
this._discountInPercent = param1;
this._image = param2;
this._kitItems = param3;
}
public function get discountInPercent() : int {
return this._discountInPercent;
}
public function set discountInPercent(param1:int) : void {
this._discountInPercent = param1;
}
public function get image() : ImageResource {
return this._image;
}
public function set image(param1:ImageResource) : void {
this._image = param1;
}
public function get kitItems() : Vector.<KitItem> {
return this._kitItems;
}
public function set kitItems(param1:Vector.<KitItem>) : void {
this._kitItems = param1;
}
public function toString() : String {
var local1:String = "GarageKitCC [";
local1 += "discountInPercent = " + this.discountInPercent + " ";
local1 += "image = " + this.image + " ";
local1 += "kitItems = " + this.kitItems + " ";
return local1 + "]";
}
}
}
|
package projects.tanks.client.battlefield.models.tankparts.weapons.rocketlauncher.sfx {
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 RocketLauncherSfxModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:RocketLauncherSfxModelServer;
private var client:IRocketLauncherSfxModelBase = IRocketLauncherSfxModelBase(this);
private var modelId:Long = Long.getLong(1535860802,1721952390);
public function RocketLauncherSfxModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new RocketLauncherSfxModelServer(IModel(this));
var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry));
local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(RocketLauncherSfxCC,false)));
}
protected function getInitParam() : RocketLauncherSfxCC {
return RocketLauncherSfxCC(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.model.news
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class NewsIcons_ml5 extends BitmapAsset
{
public function NewsIcons_ml5()
{
super();
}
}
}
|
package alternativa.tanks.models.weapons.targeting.priority.targeting {
import alternativa.tanks.battle.BattleService;
import alternativa.tanks.battle.objects.tank.Tank;
import alternativa.tanks.models.weapon.WeaponObject;
import alternativa.tanks.models.weapon.angles.verticals.autoaiming.VerticalAutoAiming;
import alternativa.tanks.models.weapon.shared.CommonTargetEvaluator;
public class CommonTargetPriorityCalculator implements TargetPriorityCalculator {
[Inject]
public static var battleService:BattleService;
private var commonTargetEvaluator:CommonTargetEvaluator;
private var maxAngle:Number;
private var fullDamageDistance:Number;
public function CommonTargetPriorityCalculator(param1:WeaponObject) {
super();
this.commonTargetEvaluator = battleService.getCommonTargetEvaluator();
this.fullDamageDistance = this.getFullDamageDistance(param1);
var local2:VerticalAutoAiming = param1.verticalAutoAiming();
this.maxAngle = local2.getMaxAngle();
}
public function getTargetPriority(param1:Tank, param2:Number, param3:Number) : Number {
return this.commonTargetEvaluator.getTargetPriority(param1.getBody(),param2,param3,this.fullDamageDistance,this.maxAngle);
}
protected function getFullDamageDistance(param1:WeaponObject) : Number {
return param1.distanceWeakening().getFullDamageDistance();
}
}
}
|
package projects.tanks.clients.fp10.libraries.tanksservices.model.listener {
import alternativa.types.Long;
import platform.client.fp10.core.model.ObjectLoadListener;
import platform.client.fp10.core.model.ObjectUnloadListener;
import projects.tanks.client.tanksservices.model.listener.IUserNotifierModelBase;
import projects.tanks.client.tanksservices.model.listener.UserNotifierModelBase;
import projects.tanks.clients.fp10.libraries.tanksservices.model.UserRefresh;
import projects.tanks.clients.fp10.libraries.tanksservices.model.notifier.UserInfoConsumer;
import projects.tanks.clients.fp10.libraries.tanksservices.service.user.IUserInfoService;
[ModelInfo]
public class UserNotifierModel extends UserNotifierModelBase implements IUserNotifierModelBase, UserNotifier, ObjectLoadListener, ObjectUnloadListener {
[Inject]
public static var userInfoService:IUserInfoService;
public function UserNotifierModel() {
super();
}
public function subcribe(param1:Long, param2:UserInfoConsumer) : void {
this.refresh(param1,param2);
server.subscribe(param1);
}
public function refresh(param1:Long, param2:UserInfoConsumer) : void {
UserRefresh(object.event(UserRefresh)).refresh(param1,param2);
}
public function unsubcribe(param1:Vector.<Long>) : void {
var local2:Long = null;
for each(local2 in param1) {
UserRefresh(object.event(UserRefresh)).remove(local2);
}
server.unsubscribe(param1);
}
public function hasDataConsumer(param1:Long) : Boolean {
return userInfoService.hasConsumer(param1);
}
public function getDataConsumer(param1:Long) : UserInfoConsumer {
return userInfoService.getConsumer(param1);
}
public function objectLoaded() : void {
userInfoService.init(object);
}
public function objectUnloaded() : void {
userInfoService.unload();
}
public function getCurrentUserId() : Long {
return getInitParam().currentUserId;
}
}
}
|
package alternativa.tanks.models.controlpoints.sfx {
import alternativa.engine3d.materials.TextureMaterial;
public class BeamProperties {
public var beamMaterial:TextureMaterial;
public var beamTipMaterial:TextureMaterial;
public var beamWidth:Number;
public var unitLength:Number;
public var animationSpeed:Number;
public var uRange:Number;
public var alpha:Number;
public function BeamProperties(param1:TextureMaterial, param2:TextureMaterial, param3:Number, param4:Number, param5:Number, param6:Number, param7:Number) {
super();
this.beamMaterial = param1;
this.beamTipMaterial = param2;
this.beamWidth = param3;
this.unitLength = param4;
this.animationSpeed = param5;
this.uRange = param6;
this.alpha = param7;
}
}
}
|
package alternativa.tanks.model.item.discount {
import flash.utils.getTimer;
public class DiscountInfo {
public static const NO_DISCOUNT:DiscountInfo = new DiscountInfo(0,0,0);
public static const FULL_DISCOUNT:DiscountInfo = new DiscountInfo(100);
private var discountInPercent:int;
private var beginTime:uint;
private var endTime:uint;
public function DiscountInfo(param1:int, param2:uint = 0, param3:uint = 4294967295) {
super();
if(getTimer() > param3) {
param1 = 0;
param2 = 0;
param3 = 0;
return;
}
this.discountInPercent = param1;
this.beginTime = param2;
this.endTime = param3;
}
public function getDiscountInPercent() : int {
return this.discountInPercent;
}
public function getBeginTime() : uint {
return this.beginTime;
}
public function getEndTime() : uint {
return this.endTime;
}
public function isDiscountTime(param1:uint) : Boolean {
return this.beginTime <= param1 && param1 < this.endTime;
}
public function hasDiscount() : Boolean {
return this.discountInPercent > 0;
}
}
}
|
package alternativa.tanks.loader.stylishdishonestprogressbar {
import alternativa.osgi.OSGi;
import alternativa.osgi.service.display.IDisplay;
import flash.display.Bitmap;
import flash.display.Sprite;
import flash.display.Stage;
import flash.events.Event;
import flash.utils.clearTimeout;
import flash.utils.getTimer;
public class StylishDishonestProgressBar extends Sprite {
private static const progressLineClass:Class = StylishDishonestProgressBar_progressLineClass;
private static const rightGlowClass:Class = StylishDishonestProgressBar_rightGlowClass;
private static const DEFAULT_HEIGHT:int = 58;
private var _progressLine:Bitmap;
private var _rightGlow:Bitmap;
private var _complete:Function;
private var _timeOutComplete:int;
private var _frameTime:int;
private var _stage:Stage;
private var _progress:Number = 0;
private var _speed:Number = 1;
private var _isFinish:Boolean = false;
public function StylishDishonestProgressBar(param1:Function) {
super();
this._complete = param1;
this.init();
}
private function init() : void {
var local1:IDisplay = IDisplay(OSGi.getInstance().getService(IDisplay));
this._stage = local1.stage;
this._progressLine = new progressLineClass();
this._progressLine.height = DEFAULT_HEIGHT;
this._rightGlow = new rightGlowClass();
this._rightGlow.height = DEFAULT_HEIGHT;
addChild(this._progressLine);
addChild(this._rightGlow);
}
public function start() : void {
this._isFinish = false;
clearTimeout(this._timeOutComplete);
addEventListener(Event.RESIZE,this.onResize);
addEventListener(Event.ENTER_FRAME,this.onEnterFrame);
}
private function onResize(param1:Event) : void {
this.setPercentWidth(this._progress);
}
private function onEnterFrame(param1:Event) : void {
if(this._isFinish) {
this.onCompleted();
return;
}
if(getTimer() - this._frameTime < 5) {
return;
}
this._frameTime = getTimer();
this._progress += this._speed;
if(this._progress >= 100) {
this._progress = 50;
this._speed /= 2;
}
this.setPercentWidth(this._progress);
}
private function setPercentWidth(param1:Number) : void {
var local2:Number = param1 * (this._stage.stageWidth / 100);
this._progressLine.width = local2;
this._rightGlow.x = local2;
}
private function onCompleted() : void {
this._complete.apply();
}
public function forciblyFinish() : void {
this.forciblyStop();
}
public function forciblyStop() : void {
this._isFinish = true;
removeEventListener(Event.ENTER_FRAME,this.onEnterFrame);
removeEventListener(Event.RESIZE,this.onResize);
clearTimeout(this._timeOutComplete);
}
}
}
|
package alternativa.engine3d.loaders.collada {
import alternativa.engine3d.alternativa3d;
import alternativa.engine3d.core.Vertex;
import alternativa.engine3d.objects.Mesh;
use namespace collada;
use namespace alternativa3d;
use namespace daeAlternativa3DMesh;
public class DaeGeometry extends DaeElement {
private var primitives:Vector.<DaePrimitive>;
private var vertices:DaeVertices;
public function DaeGeometry(param1:XML, param2:DaeDocument) {
super(param1,param2);
this.constructVertices();
}
private function constructVertices() : void {
var local1:XML = data.mesh.vertices[0];
if(local1 != null) {
this.vertices = new DaeVertices(local1,document);
document.vertices[this.vertices.id] = this.vertices;
}
}
override protected function parseImplementation() : Boolean {
if(this.vertices != null) {
return this.parsePrimitives();
}
return false;
}
private function parsePrimitives() : Boolean {
var local4:XML = null;
this.primitives = new Vector.<DaePrimitive>();
var local1:XMLList = data.mesh.children();
var local2:int = 0;
var local3:int = int(local1.length());
while(local2 < local3) {
local4 = local1[local2];
switch(local4.localName()) {
case "polygons":
case "polylist":
case "triangles":
case "trifans":
case "tristrips":
this.primitives.push(new DaePrimitive(local4,document));
break;
}
local2++;
}
return true;
}
public function parseMesh(param1:Object) : Mesh {
var local2:Mesh = null;
if(data.mesh.length() > 0) {
local2 = new Mesh();
this.fillInMesh(local2,param1);
this.cleanVertices(local2);
local2.calculateFacesNormals(true);
local2.calculateBounds();
return local2;
}
return null;
}
public function fillInMesh(param1:Mesh, param2:Object) : Vector.<Vertex> {
var local6:DaePrimitive = null;
this.vertices.parse();
var local3:Vector.<Vertex> = this.vertices.fillInMesh(param1);
var local4:int = 0;
var local5:int = int(this.primitives.length);
while(local4 < local5) {
local6 = this.primitives[local4];
local6.parse();
if(local6.verticesEquals(this.vertices)) {
local6.fillInMesh(param1,local3,param2[local6.materialSymbol]);
}
local4++;
}
return local3;
}
public function cleanVertices(param1:Mesh) : void {
var local2:Vertex = param1.alternativa3d::vertexList;
while(local2 != null) {
local2.alternativa3d::index = 0;
local2.alternativa3d::value = null;
local2 = local2.alternativa3d::next;
}
}
}
}
|
package projects.tanks.client.battlefield.models.tankparts.weapon.railgun {
import alternativa.osgi.OSGi;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.OptionalMap;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.CollectionCodecInfo;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Long;
import alternativa.types.Short;
import flash.utils.ByteArray;
import platform.client.fp10.core.model.IModel;
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.network.command.SpaceCommand;
import platform.client.fp10.core.type.IGameObject;
import platform.client.fp10.core.type.ISpace;
import projects.tanks.client.battlefield.types.Vector3d;
public class RailgunModelServer {
private var protocol:IProtocol;
private var protocolBuffer:ProtocolBuffer;
private var _fireCommandId:Long = Long.getLong(448278927,-679337769);
private var _fireCommand_clientTimeCodec:ICodec;
private var _fireCommand_staticHitPointCodec:ICodec;
private var _fireCommand_targetsCodec:ICodec;
private var _fireCommand_targetHitPointsCodec:ICodec;
private var _fireCommand_targetIncarnationsCodec:ICodec;
private var _fireCommand_targetPositionsCodec:ICodec;
private var _fireCommand_hitPointsWorldCodec:ICodec;
private var _fireDummyCommandId:Long = Long.getLong(1791455660,457007003);
private var _fireDummyCommand_clientTimeCodec:ICodec;
private var _startChargingCommandId:Long = Long.getLong(747256245,1216344676);
private var _startChargingCommand_timeCodec:ICodec;
private var model:IModel;
public function RailgunModelServer(param1:IModel) {
super();
this.model = param1;
var local2:ByteArray = new ByteArray();
this.protocol = IProtocol(OSGi.getInstance().getService(IProtocol));
this.protocolBuffer = new ProtocolBuffer(local2,local2,new OptionalMap());
this._fireCommand_clientTimeCodec = this.protocol.getCodec(new TypeCodecInfo(int,false));
this._fireCommand_staticHitPointCodec = this.protocol.getCodec(new TypeCodecInfo(Vector3d,true));
this._fireCommand_targetsCodec = this.protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(IGameObject,false),true,1));
this._fireCommand_targetHitPointsCodec = this.protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(Vector3d,false),true,1));
this._fireCommand_targetIncarnationsCodec = this.protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(Short,false),true,1));
this._fireCommand_targetPositionsCodec = this.protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(Vector3d,false),true,1));
this._fireCommand_hitPointsWorldCodec = this.protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(Vector3d,false),true,1));
this._fireDummyCommand_clientTimeCodec = this.protocol.getCodec(new TypeCodecInfo(int,false));
this._startChargingCommand_timeCodec = this.protocol.getCodec(new TypeCodecInfo(int,false));
}
public function fireCommand(param1:int, param2:Vector3d, param3:Vector.<IGameObject>, param4:Vector.<Vector3d>, param5:Vector.<int>, param6:Vector.<Vector3d>, param7:Vector.<Vector3d>) : void {
ByteArray(this.protocolBuffer.writer).position = 0;
ByteArray(this.protocolBuffer.writer).length = 0;
this._fireCommand_clientTimeCodec.encode(this.protocolBuffer,param1);
this._fireCommand_staticHitPointCodec.encode(this.protocolBuffer,param2);
this._fireCommand_targetsCodec.encode(this.protocolBuffer,param3);
this._fireCommand_targetHitPointsCodec.encode(this.protocolBuffer,param4);
this._fireCommand_targetIncarnationsCodec.encode(this.protocolBuffer,param5);
this._fireCommand_targetPositionsCodec.encode(this.protocolBuffer,param6);
this._fireCommand_hitPointsWorldCodec.encode(this.protocolBuffer,param7);
ByteArray(this.protocolBuffer.writer).position = 0;
if(Model.object == null) {
throw new Error("Execute method without model context.");
}
var local8:SpaceCommand = new SpaceCommand(Model.object.id,this._fireCommandId,this.protocolBuffer);
var local9:IGameObject = Model.object;
var local10:ISpace = local9.space;
local10.commandSender.sendCommand(local8);
this.protocolBuffer.optionalMap.clear();
}
public function fireDummyCommand(param1:int) : void {
ByteArray(this.protocolBuffer.writer).position = 0;
ByteArray(this.protocolBuffer.writer).length = 0;
this._fireDummyCommand_clientTimeCodec.encode(this.protocolBuffer,param1);
ByteArray(this.protocolBuffer.writer).position = 0;
if(Model.object == null) {
throw new Error("Execute method without model context.");
}
var local2:SpaceCommand = new SpaceCommand(Model.object.id,this._fireDummyCommandId,this.protocolBuffer);
var local3:IGameObject = Model.object;
var local4:ISpace = local3.space;
local4.commandSender.sendCommand(local2);
this.protocolBuffer.optionalMap.clear();
}
public function startChargingCommand(param1:int) : void {
ByteArray(this.protocolBuffer.writer).position = 0;
ByteArray(this.protocolBuffer.writer).length = 0;
this._startChargingCommand_timeCodec.encode(this.protocolBuffer,param1);
ByteArray(this.protocolBuffer.writer).position = 0;
if(Model.object == null) {
throw new Error("Execute method without model context.");
}
var local2:SpaceCommand = new SpaceCommand(Model.object.id,this._startChargingCommandId,this.protocolBuffer);
var local3:IGameObject = Model.object;
var local4:ISpace = local3.space;
local4.commandSender.sendCommand(local2);
this.protocolBuffer.optionalMap.clear();
}
}
}
|
package alternativa.tanks.bg
{
import flash.geom.Rectangle;
public interface IBackgroundService
{
function showBg() : void;
function hideBg() : void;
function drawBg(param1:Rectangle = null) : void;
}
}
|
package projects.tanks.client.panel.model.garage.availableupgrades {
public class AvailableUpgradesCC {
private var _availableUpgradeItems:Vector.<AvailableUpgradeItem>;
public function AvailableUpgradesCC(param1:Vector.<AvailableUpgradeItem> = null) {
super();
this._availableUpgradeItems = param1;
}
public function get availableUpgradeItems() : Vector.<AvailableUpgradeItem> {
return this._availableUpgradeItems;
}
public function set availableUpgradeItems(param1:Vector.<AvailableUpgradeItem>) : void {
this._availableUpgradeItems = param1;
}
public function toString() : String {
var local1:String = "AvailableUpgradesCC [";
local1 += "availableUpgradeItems = " + this.availableUpgradeItems + " ";
return local1 + "]";
}
}
}
|
package alternativa.tanks.models.weapon.terminator.state {
import alternativa.tanks.battle.objects.tank.WeaponPlatform;
import alternativa.tanks.models.weapon.rocketlauncher.RocketLauncherObject;
import alternativa.tanks.models.weapon.rocketlauncher.weapon.salvo.SalvoShotState;
import alternativa.tanks.models.weapon.terminator.ITerminatorWeapon;
import projects.tanks.client.battlefield.models.tankparts.weapons.rocketlauncher.RocketLauncherCC;
public class SecondaryShotState extends SalvoShotState {
private var weapon:ITerminatorWeapon;
public function SecondaryShotState(param1:ITerminatorWeapon, param2:WeaponPlatform, param3:RocketLauncherObject, param4:RocketLauncherCC) {
super(param1,param2,param3,param4);
this.weapon = param1;
}
override public function start(param1:int) : void {
super.start(param1);
if(this.weapon.canShoot(param1)) {
this.weapon.secondaryOpen(param1);
}
}
}
}
|
package alternativa.tanks.models.battle.facilities {
import alternativa.math.Vector3;
import alternativa.tanks.battle.objects.tank.Tank;
public class CheckZone {
private var _position:Vector3;
private var _tank:Tank;
private var _radiusSqr:Number;
private var _checkRaycast:Boolean;
public function CheckZone() {
super();
}
public static function create(param1:Vector3, param2:Number, param3:Boolean) : CheckZone {
var local4:CheckZone = new CheckZone();
local4._position = param1;
local4._tank = null;
local4._radiusSqr = param2 * param2;
local4._checkRaycast = param3;
return local4;
}
public static function createDynamic(param1:Tank, param2:Number, param3:Boolean) : CheckZone {
var local4:CheckZone = new CheckZone();
local4._position = null;
local4._tank = param1;
local4._radiusSqr = param2 * param2;
local4._checkRaycast = param3;
return local4;
}
public function get position() : Vector3 {
if(this._position == null) {
return this._tank.getBody().state.position;
}
return this._position;
}
public function get radiusSqr() : Number {
return this._radiusSqr;
}
public function get checkRaycast() : Boolean {
return this._checkRaycast;
}
public function get tank() : Tank {
return this._tank;
}
}
}
|
package alternativa.tanks.models.battle.commonflag {
import alternativa.engine3d.core.Object3D;
import alternativa.math.Quaternion;
import alternativa.math.Vector3;
import alternativa.physics.PhysicsMaterial;
import alternativa.physics.collision.primitives.CollisionBox;
import alternativa.tanks.battle.BattleService;
import alternativa.tanks.battle.Trigger;
import alternativa.tanks.battle.hidablegraphicobjects.HidableGraphicObject;
import alternativa.tanks.battle.scene3d.Renderer;
import alternativa.tanks.engine3d.AnimatedSprite3D;
import alternativa.tanks.engine3d.TextureAnimation;
import alternativa.tanks.models.battle.gui.markers.PointIndicatorStateProvider;
import alternativa.tanks.physics.CollisionGroup;
import alternativa.tanks.utils.GraphicsUtils;
import alternativa.utils.TextureMaterialRegistry;
import flash.display.BitmapData;
import platform.client.fp10.core.resource.types.TextureResource;
import projects.tanks.client.battlefield.models.battle.pointbased.flag.FlagState;
import projects.tanks.client.battlefield.types.Vector3d;
import projects.tanks.client.battleservice.model.battle.team.BattleTeam;
public class Flag extends CommonFlag implements HidableGraphicObject, Trigger, Renderer, PointIndicatorStateProvider {
[Inject]
public static var materialRegistry:TextureMaterialRegistry;
[Inject]
public static var battleService:BattleService;
private static const FLAG_ACCENDING:Number = 80;
protected static const SKIN_HEIGHT:int = 400;
private static const SKIN_BASE_SIZE:int = 95;
private static const FLAG_FRAME_WIDTH:int = 128;
private static const FLAG_FRAME_HEIGHT:int = 256;
private static const FRAME_INTERVAL:int = 1000;
private static const BASE_Z_AMPLITUDE:Number = 20;
private static const BASE_Z_FREQUENCY:Number = 0.001;
private static const FLAG_INDICATOR_ASCENDING:Number = 180;
private var skin:AnimatedSprite3D;
private var startTime:int;
private var _hideIndicatorOnBase:Boolean;
public function Flag(param1:int, param2:Vector3d, param3:BattleTeam, param4:TextureResource, param5:Boolean = false) {
super(param1,param3,createBasePosition(param2));
this._hideIndicatorOnBase = param5;
var local6:BitmapData = param4.data;
var local7:TextureAnimation = GraphicsUtils.getTextureAnimation(materialRegistry,local6,FLAG_FRAME_WIDTH,local6.height,0,false);
skinObject = this.createSkin(FLAG_FRAME_WIDTH,FLAG_FRAME_HEIGHT,local7);
this.skin = AnimatedSprite3D(skinObject);
collisionPrimitive = new CollisionBox(new Vector3(0.5 * SKIN_BASE_SIZE,0.5 * SKIN_BASE_SIZE,0.5 * SKIN_HEIGHT),CollisionGroup.TANK,PhysicsMaterial.DEFAULT_MATERIAL);
setPosition(this.basePosition);
this.startTime = FRAME_INTERVAL * Math.random();
}
private static function createBasePosition(param1:Vector3d) : Vector3 {
var local2:Vector3 = Vector3.fromVector3d(param1);
local2.z += FLAG_ACCENDING;
return local2;
}
override protected function renderImpl(param1:int, param2:int, param3:FlagStatus) : void {
var local4:Number = NaN;
this.skin.setFrameIndex(int((param1 - this.startTime) / FRAME_INTERVAL));
if(state == FlagState.AT_BASE) {
moveObjects(param3.position);
local4 = basePosition.z + BASE_Z_AMPLITUDE * Math.sin(BASE_Z_FREQUENCY * param1);
this.skin.z = local4;
lightSource.z = local4 + 0.75 * SKIN_HEIGHT;
} else {
moveObjects(param3.position);
}
}
private function createSkin(param1:int, param2:int, param3:TextureAnimation) : Object3D {
var local4:Number = param1 * SKIN_HEIGHT / param2;
this.skin = new AnimatedSprite3D(local4,SKIN_HEIGHT);
this.skin.softAttenuation = 10;
this.skin.setAnimationData(param3);
this.skin.setFrameIndex(0);
this.skin.originY = 1;
param3.material.resolution = 1;
return this.skin;
}
override public function positionChanged(param1:Vector3, param2:Quaternion) : void {
if(_state == FlagState.DROPPED || _state == FlagState.AT_BASE) {
collisionPrimitive.transform.m03 = param1.x;
collisionPrimitive.transform.m13 = param1.y;
collisionPrimitive.transform.m23 = param1.z + 0.5 * skinHeight;
collisionPrimitive.calculateAABB();
}
lightSource.x = param1.x;
lightSource.y = param1.y;
lightSource.z = param1.z + 0.75 * skinHeight;
}
public function isIndicatorActive(param1:Vector3 = null) : Boolean {
if(this._hideIndicatorOnBase) {
return state != FlagState.AT_BASE && (state != FlagState.CARRIED || !isLocalCarrier);
}
return state != FlagState.CARRIED || !isLocalCarrier;
}
public function zOffset() : Number {
return FLAG_INDICATOR_ASCENDING;
}
public function set hideIndicatorOnBase(param1:Boolean) : void {
this._hideIndicatorOnBase = param1;
}
}
}
|
package alternativa.gfx.agal
{
public class SamplerRepeat extends SamplerOption
{
private static const SAMPLER_REPEAT_SHIFT:uint = 20;
public static const CLAMP:SamplerRepeat = new SamplerRepeat(0);
public static const REPEAT:SamplerRepeat = new SamplerRepeat(1);
public static const WRAP:SamplerRepeat = REPEAT;
public function SamplerRepeat(param1:uint)
{
super(param1,SAMPLER_REPEAT_SHIFT);
}
}
}
|
package alternativa.tanks.services.battlegui {
import flash.events.Event;
public class BattleGUIServiceEvent extends Event {
public static const ON_CHANGE_POSITION_DEFAULT_LAYOUT:String = "BattleGUIServiceEvent.ON_CHANGE_POSITION_DEFAULT_LAYOUT";
public function BattleGUIServiceEvent(param1:String) {
super(param1);
}
}
}
|
package alternativa.engine3d.core {
import alternativa.gfx.agal.VertexShader;
public class ShadowCasterVertexShader extends VertexShader {
public function ShadowCasterVertexShader() {
super();
dp4(vt0.x,va0,vc[0]);
dp4(vt0.y,va0,vc[1]);
dp4(vt0.zw,va0,vc[2]);
mul(vt0.xy,vt0,vc[3]);
add(vt0.xy,vt0,vc[4]);
mov(op.xyz,vt0);
mov(op.w,vc[3]);
mov(v0,vt0);
}
}
}
|
package scpacker.test
{
public class UpdateRankPrize
{
private static var crystalls:Array = [0,100,200,300,500,1000,1500,2000,3000,4000,5000,6000,7000,8000,9000,10000,11000,12000,13000,14000,15000,16000,17000,18000,19000,20000,30000,40000,50000,60000];
public function UpdateRankPrize()
{
super();
}
public static function getCount(rang:int) : int
{
return crystalls[rang - 1];
}
}
}
|
package projects.tanks.client.chat.models.news.showing {
import alternativa.osgi.OSGi;
import alternativa.protocol.IProtocol;
import alternativa.protocol.OptionalMap;
import alternativa.protocol.ProtocolBuffer;
import flash.utils.ByteArray;
import platform.client.fp10.core.model.IModel;
public class NewsShowingModelServer {
private var protocol:IProtocol;
private var protocolBuffer:ProtocolBuffer;
private var model:IModel;
public function NewsShowingModelServer(param1:IModel) {
super();
this.model = param1;
var local2:ByteArray = new ByteArray();
this.protocol = IProtocol(OSGi.getInstance().getService(IProtocol));
this.protocolBuffer = new ProtocolBuffer(local2,local2,new OptionalMap());
}
}
}
|
package alternativa.tanks.gui.friends.list {
import alternativa.tanks.gui.friends.IFriendsListState;
import alternativa.tanks.gui.friends.list.dataprovider.FriendsDataProvider;
import alternativa.tanks.gui.friends.list.renderer.ClanMembersListRenderer;
import alternativa.tanks.gui.friends.list.renderer.HeaderAcceptedList;
import alternativa.tanks.service.clan.ClanFriendsService;
import alternativa.tanks.service.clan.ClanMembersListEvent;
import alternativa.types.Long;
import fl.controls.List;
import flash.display.Sprite;
import flash.utils.Dictionary;
import projects.tanks.clients.fp10.libraries.tanksservices.model.notifier.battle.BattleLinkData;
import projects.tanks.clients.fp10.libraries.tanksservices.model.notifier.online.ClientOnlineNotifierData;
import projects.tanks.clients.fp10.libraries.tanksservices.service.battle.BattleInfoServiceEvent;
import projects.tanks.clients.fp10.libraries.tanksservices.service.battle.IBattleInfoService;
import projects.tanks.clients.fp10.libraries.tanksservices.service.friend.battleinvite.BattleInviteServiceEvent;
import projects.tanks.clients.fp10.libraries.tanksservices.service.friend.battleinvite.IBattleInviteService;
import projects.tanks.clients.fp10.libraries.tanksservices.service.notifier.battle.IBattleNotifierService;
import projects.tanks.clients.fp10.libraries.tanksservices.service.notifier.battle.LeaveBattleNotifierServiceEvent;
import projects.tanks.clients.fp10.libraries.tanksservices.service.notifier.battle.SetBattleNotifierServiceEvent;
import projects.tanks.clients.fp10.libraries.tanksservices.service.notifier.online.IOnlineNotifierService;
import projects.tanks.clients.fp10.libraries.tanksservices.service.notifier.online.OnlineNotifierServiceEvent;
import projects.tanks.clients.fp10.libraries.tanksservices.service.user.IUserInfoService;
import projects.tanks.clients.fp10.libraries.tanksservices.service.userproperties.IUserPropertiesService;
import services.contextmenu.ContextMenuServiceEvent;
import services.contextmenu.IContextMenuService;
import utils.ScrollStyleUtils;
public class ClanMembersList extends Sprite implements IFriendsListState {
[Inject]
public static var userInfoService:IUserInfoService;
[Inject]
public static var contextMenuService:IContextMenuService;
[Inject]
public static var onlineNotifierService:IOnlineNotifierService;
[Inject]
public static var battleNotifierService:IBattleNotifierService;
[Inject]
public static var battleInfoService:IBattleInfoService;
[Inject]
public static var battleInviteService:IBattleInviteService;
[Inject]
public static var clanFriendsService:ClanFriendsService;
[Inject]
public static var userPropertiesService:IUserPropertiesService;
public static var scrollOn:Boolean;
private var _header:HeaderAcceptedList;
protected var _dataProvider:FriendsDataProvider;
protected var _list:List;
protected var _width:Number;
protected var _height:Number;
protected var _viewed:Dictionary;
public function ClanMembersList() {
super();
this.init(ClanMembersListRenderer);
this._dataProvider.getItemAtHandler = this.markAsViewed;
this._header = new HeaderAcceptedList();
addChild(this._header);
}
public function initList() : void {
clanFriendsService.addEventListener(ClanMembersListEvent.ACCEPTED_USER,this.onClanMemberAccepted);
clanFriendsService.addEventListener(ClanMembersListEvent.REMOVE_USER,this.onClanMemberRemoved);
contextMenuService.addEventListener(ContextMenuServiceEvent.REMOVE_FROM_FRIENDS,this.onRemoveFromFriends);
onlineNotifierService.addEventListener(OnlineNotifierServiceEvent.SET_ONLINE,this.onSetOnline);
battleNotifierService.addEventListener(SetBattleNotifierServiceEvent.SET_BATTLE,this.onSetBattle);
battleNotifierService.addEventListener(LeaveBattleNotifierServiceEvent.LEAVE,this.onLeaveBattle);
battleInfoService.addEventListener(BattleInfoServiceEvent.SELECTION_BATTLE,this.onSelectBattleInfo);
battleInfoService.addEventListener(BattleInfoServiceEvent.RESET_SELECTION_BATTLE,this.onResetSelectBattleInfo);
battleInviteService.addEventListener(BattleInviteServiceEvent.REMOVE_INVITE,this.onRemoveInvite);
this._dataProvider.sortOn([FriendsDataProvider.IS_NEW,FriendsDataProvider.ONLINE,FriendsDataProvider.IS_BATTLE,FriendsDataProvider.UID],[Array.NUMERIC | Array.DESCENDING,Array.NUMERIC | Array.DESCENDING,Array.NUMERIC | Array.DESCENDING,Array.CASEINSENSITIVE]);
this.fillMembersList();
this._list.scrollToIndex(0);
this.resize(this._width,this._height);
}
private function onClanMemberAccepted(param1:ClanMembersListEvent) : void {
this._dataProvider.addUser(param1.userId);
this.resize(this._width,this._height);
}
private function onClanMemberRemoved(param1:ClanMembersListEvent) : void {
if(this._dataProvider.getItemIndexByProperty("id",param1.userId,true) != -1) {
this._dataProvider.removeUser(param1.userId);
this.resize(this._width,this._height);
}
}
private function onRemoveFromFriends(param1:ContextMenuServiceEvent) : void {
this._dataProvider.removeUser(param1.userId);
this.resize(this._width,this._height);
}
private function onSetOnline(param1:OnlineNotifierServiceEvent) : void {
var local6:int = 0;
var local2:Boolean = false;
var local3:Vector.<ClientOnlineNotifierData> = param1.users;
var local4:int = int(local3.length);
var local5:int = 0;
while(local5 < local4) {
local6 = this._dataProvider.setOnlineUser(local3[local5],false);
local2 ||= local6 != -1;
local5++;
}
if(local2) {
this._dataProvider.reSort();
}
}
private function onSetBattle(param1:SetBattleNotifierServiceEvent) : void {
var local6:int = 0;
var local2:Boolean = false;
var local3:Vector.<BattleLinkData> = param1.users;
var local4:int = int(local3.length);
var local5:int = 0;
while(local5 < local4) {
local6 = this._dataProvider.setBattleUser(local3[local5],false);
local2 ||= local6 != -1;
local5++;
}
if(local2 > 0) {
this._dataProvider.reSort();
}
}
private function onLeaveBattle(param1:LeaveBattleNotifierServiceEvent) : void {
this._dataProvider.clearBattleUser(param1.userId);
}
private function onResetSelectBattleInfo(param1:BattleInfoServiceEvent) : void {
this._dataProvider.updatePropertyAvailableInvite();
}
private function onSelectBattleInfo(param1:BattleInfoServiceEvent) : void {
this._dataProvider.updatePropertyAvailableInvite();
}
private function onRemoveInvite(param1:BattleInviteServiceEvent) : void {
this._dataProvider.updatePropertyAvailableInviteById(param1.userId);
}
public function resize(param1:Number, param2:Number) : void {
this._width = param1;
this._height = param2;
this._header.width = this._width;
this._list.y = 20;
scrollOn = this._list.verticalScrollBar.visible;
this._list.width = scrollOn ? this._width + 6 : this._width;
this._list.height = this._height - 20;
}
public function hide() : void {
clanFriendsService.removeEventListener(ClanMembersListEvent.ACCEPTED_USER,this.onClanMemberAccepted);
clanFriendsService.removeEventListener(ClanMembersListEvent.REMOVE_USER,this.onClanMemberRemoved);
contextMenuService.removeEventListener(ContextMenuServiceEvent.REMOVE_FROM_FRIENDS,this.onRemoveFromFriends);
onlineNotifierService.removeEventListener(OnlineNotifierServiceEvent.SET_ONLINE,this.onSetOnline);
battleNotifierService.removeEventListener(SetBattleNotifierServiceEvent.SET_BATTLE,this.onSetBattle);
battleNotifierService.removeEventListener(LeaveBattleNotifierServiceEvent.LEAVE,this.onLeaveBattle);
battleInfoService.removeEventListener(BattleInfoServiceEvent.SELECTION_BATTLE,this.onSelectBattleInfo);
battleInfoService.removeEventListener(BattleInfoServiceEvent.RESET_SELECTION_BATTLE,this.onResetSelectBattleInfo);
battleInviteService.removeEventListener(BattleInviteServiceEvent.REMOVE_INVITE,this.onRemoveInvite);
if(parent != null && parent.contains(this)) {
parent.removeChild(this);
this._dataProvider.removeAll();
}
}
public function filter(param1:String, param2:String) : void {
this.filterByProperty(param1,param2);
this.resize(this._width,this._height);
}
public function resetFilter() : void {
this._dataProvider.resetFilter();
this.resize(this._width,this._height);
}
private function init(param1:Object) : void {
this._viewed = new Dictionary();
this._list = new List();
this._list.rowHeight = 20;
this._list.setStyle("cellRenderer",param1);
this._list.focusEnabled = true;
this._list.selectable = false;
ScrollStyleUtils.setGreenStyle(this._list);
this._dataProvider = new FriendsDataProvider();
this._list.dataProvider = this._dataProvider;
addChild(this._list);
ScrollStyleUtils.setGreenStyle(this._list);
}
private function isViewed(param1:Object) : Boolean {
return param1 in this._viewed;
}
private function setAsViewed(param1:Object) : void {
this._viewed[param1] = true;
}
private function fillMembersList() : void {
var local1:Long = null;
this._dataProvider.removeAll();
this._dataProvider.resetFilter(false);
for each(local1 in clanFriendsService.clanMembers) {
if(local1 != userPropertiesService.userId) {
this._dataProvider.addUser(local1,false);
}
}
this._dataProvider.refresh();
}
private function filterByProperty(param1:String, param2:String) : void {
this._dataProvider.setFilter(param1,param2);
this.resize(this._width,this._height);
}
private function markAsViewed(param1:Object) : void {
if(!this.isViewed(param1) && Boolean(param1.isNew)) {
this.setAsViewed(param1);
}
}
}
}
|
package projects.tanks.client.garage.models.garage.present {
import alternativa.osgi.OSGi;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.types.Long;
import platform.client.fp10.core.model.IModel;
import platform.client.fp10.core.model.impl.Model;
public class PresentGivenModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:PresentGivenModelServer;
private var client:IPresentGivenModelBase = IPresentGivenModelBase(this);
private var modelId:Long = Long.getLong(1891481944,-1293130596);
public function PresentGivenModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new PresentGivenModelServer(IModel(this));
}
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 projects.tanks.client.entrance.model.entrance.clienthalt {
public interface IServerHaltEntranceModelBase {
function serverHalt() : void;
}
}
|
package projects.tanks.client.panel.model.shop.notification {
public interface IShopNotifierModelBase {
function notifyDiscountsInShop() : void;
function notifyNewItemsInShop() : void;
}
}
|
package _codec.projects.tanks.client.panel.model.shop.renameshopitem {
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import projects.tanks.client.panel.model.shop.renameshopitem.RenameShopItemCC;
public class VectorCodecRenameShopItemCCLevel1 implements ICodec {
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecRenameShopItemCCLevel1(param1:Boolean) {
super();
this.optionalElement = param1;
}
public function init(param1:IProtocol) : void {
this.elementCodec = param1.getCodec(new TypeCodecInfo(RenameShopItemCC,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.<RenameShopItemCC> = new Vector.<RenameShopItemCC>(local2,true);
var local4:int = 0;
while(local4 < local2) {
local3[local4] = RenameShopItemCC(this.elementCodec.decode(param1));
local4++;
}
return local3;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
var local4:RenameShopItemCC = null;
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:Vector.<RenameShopItemCC> = Vector.<RenameShopItemCC>(param2);
var local5:int = int(local3.length);
LengthCodecHelper.encodeLength(param1,local5);
var local6:int = 0;
while(local6 < local5) {
this.elementCodec.encode(param1,local3[local6]);
local6++;
}
}
}
}
|
package alternativa.tanks.model.payment.modes.qiwi {
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.type.IGameObject;
import projects.tanks.client.panel.model.payment.modes.qiwi.CountryPhoneInfo;
public class QiwiPaymentEvents implements QiwiPayment {
private var object:IGameObject;
private var impl:Vector.<Object>;
public function QiwiPaymentEvents(param1:IGameObject, param2:Vector.<Object>) {
super();
this.object = param1;
this.impl = param2;
}
public function getPaymentUrlAsync(param1:String) : void {
var i:int = 0;
var m:QiwiPayment = null;
var phone:String = param1;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = QiwiPayment(this.impl[i]);
m.getPaymentUrlAsync(phone);
i++;
}
}
finally {
Model.popObject();
}
}
public function getCountryPhoneInfo() : Vector.<CountryPhoneInfo> {
var result:Vector.<CountryPhoneInfo> = null;
var i:int = 0;
var m:QiwiPayment = null;
try {
Model.object = this.object;
i = 0;
while(i < this.impl.length) {
m = QiwiPayment(this.impl[i]);
result = m.getCountryPhoneInfo();
i++;
}
}
finally {
Model.popObject();
}
return result;
}
}
}
|
package alternativa.tanks.models.sfx.shoot.ricochet
{
import alternativa.object.ClientObject;
public interface IRicochetSFXModel
{
function getSfxData(param1:ClientObject) : RicochetSFXData;
}
}
|
package alternativa.osgi.service.clientlog {
import alternativa.osgi.service.logging.LogService;
public class DeprecatedClientLogWrapper implements IClientLogBase {
private var logService:LogService;
public function DeprecatedClientLogWrapper(param1:LogService) {
super();
this.logService = param1;
}
public function log(param1:String, param2:String, ... rest) : void {
this.logService.getLogger(param1).info(param2,rest);
}
}
}
|
package projects.tanks.client.clans.user.accepted {
import alternativa.types.Long;
public interface IClanUserAcceptedModelBase {
function onAdding(param1:Long) : void;
function onRemoved(param1:Long) : void;
}
}
|
package platform.core.general.resource.types.imageframe {
public class ResourceImageFrameParams {
private var _fps:Number;
private var _frameHeight:int;
private var _frameWidth:int;
private var _imageHeight:int;
private var _imageWidth:int;
private var _numFrames:int;
public function ResourceImageFrameParams(param1:Number = 0, param2:int = 0, param3:int = 0, param4:int = 0, param5:int = 0, param6:int = 0) {
super();
this._fps = param1;
this._frameHeight = param2;
this._frameWidth = param3;
this._imageHeight = param4;
this._imageWidth = param5;
this._numFrames = param6;
}
public function get fps() : Number {
return this._fps;
}
public function set fps(param1:Number) : void {
this._fps = param1;
}
public function get frameHeight() : int {
return this._frameHeight;
}
public function set frameHeight(param1:int) : void {
this._frameHeight = param1;
}
public function get frameWidth() : int {
return this._frameWidth;
}
public function set frameWidth(param1:int) : void {
this._frameWidth = param1;
}
public function get imageHeight() : int {
return this._imageHeight;
}
public function set imageHeight(param1:int) : void {
this._imageHeight = param1;
}
public function get imageWidth() : int {
return this._imageWidth;
}
public function set imageWidth(param1:int) : void {
this._imageWidth = param1;
}
public function get numFrames() : int {
return this._numFrames;
}
public function set numFrames(param1:int) : void {
this._numFrames = param1;
}
public function toString() : String {
var local1:String = "ResourceImageFrameParams [";
local1 += "fps = " + this.fps + " ";
local1 += "frameHeight = " + this.frameHeight + " ";
local1 += "frameWidth = " + this.frameWidth + " ";
local1 += "imageHeight = " + this.imageHeight + " ";
local1 += "imageWidth = " + this.imageWidth + " ";
local1 += "numFrames = " + this.numFrames + " ";
return local1 + "]";
}
}
}
|
package alternativa.tanks.models.service {
import alternativa.tanks.gui.clanmanagement.ClanManagementPanel;
import alternativa.tanks.gui.notinclan.NotInClanPanel;
import alternativa.tanks.models.panel.clanpanel.IClanPanelModel;
import alternativa.types.Long;
import flash.events.IEventDispatcher;
import platform.client.fp10.core.type.IGameObject;
import projects.tanks.client.clans.clan.clanflag.ClanFlag;
public interface ClanService extends IEventDispatcher {
function get clanMembers() : Vector.<Long>;
function set clanMembers(param1:Vector.<Long>) : void;
function get name() : String;
function set name(param1:String) : void;
function get tag() : String;
function set tag(param1:String) : void;
function get creatorId() : Long;
function set creatorId(param1:Long) : void;
function get creationDate() : String;
function set creationDate(param1:String) : void;
function get clanPanelModel() : IClanPanelModel;
function set clanPanelModel(param1:IClanPanelModel) : void;
function updateClanInfo(param1:String, param2:int, param3:ClanFlag, param4:Boolean) : void;
function get clanObject() : IGameObject;
function set clanObject(param1:IGameObject) : void;
function maxMembers() : void;
function objectUnloaded() : void;
function get clanManagementPanel() : ClanManagementPanel;
function get membersCount() : int;
function get notInClanPanel() : NotInClanPanel;
function set notInClanPanel(param1:NotInClanPanel) : void;
function get isSelf() : Boolean;
function set isSelf(param1:Boolean) : void;
function unloadMembers() : void;
function get isBlocked() : Boolean;
function set isBlocked(param1:Boolean) : void;
function set minRankForCreateClan(param1:int) : void;
function get minRankForCreateClan() : int;
function get minRankForRequest() : int;
function set minRankForRequest(param1:int) : void;
function get requestsEnabled() : Boolean;
function set requestsEnabled(param1:Boolean) : void;
function get maxCharactersDescription() : int;
function set maxCharactersDescription(param1:int) : void;
function clanBlock(param1:String) : void;
}
}
|
package com.alternativaplatform.client.models.core.users.model.timechecker
{
public interface ITimeCheckerModelBase
{
}
}
|
package controls.buttons.skins {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/controls.buttons.skins.GoldBigButtonSkin_rightDownClass.png")]
public class GoldBigButtonSkin_rightDownClass extends BitmapAsset {
public function GoldBigButtonSkin_rightDownClass() {
super();
}
}
}
|
package alternativa.tanks.models.dom.hud
{
import alternativa.math.Vector3;
import alternativa.tanks.models.dom.Point;
import alternativa.tanks.models.dom.sfx.PointState;
import flash.display.Bitmap;
import flash.display.DisplayObject;
import flash.display.PixelSnapping;
import flash.display.Sprite;
import utils.SectorMask;
public class KeyPointMarker extends Sprite
{
private var point:Point;
private var imageBlue:Bitmap;
private var imageRed:Bitmap;
private var sectorMask:SectorMask;
private var score:Number = 0;
private var container:Sprite;
public function KeyPointMarker(point:Point)
{
super();
this.point = point;
this.container = new Sprite();
this.createImages();
}
private static function createMarkerBitmap(param1:PointState) : Bitmap
{
return new Bitmap(MarkerBitmaps.getMarkerBitmapData(param1),PixelSnapping.AUTO,true);
}
private function createImages() : void
{
this.imageBlue = createMarkerBitmap(PointState.BLUE);
this.imageRed = createMarkerBitmap(PointState.RED);
addChild(createMarkerBitmap(PointState.NEUTRAL));
addChild(this.container);
this.sectorMask = new SectorMask(this.imageBlue.width);
this.container.addChild(this.sectorMask);
addChild(new Bitmap(MarkerBitmaps.getLetterImage(this.point.id == 0 ? "A" : (this.point.id == 1 ? "B" : (this.point.id == 2 ? "C" : (this.point.id == 3 ? "D" : (this.point.id == 4 ? "E" : (this.point.id == 5 ? "F" : "G"))))))));
this.paintItGray();
this.setScore(45);
}
public function update() : void
{
this.setScore(this.point.clientProgress);
}
private function setScore(param1:Number) : void
{
var _loc2_:Number = NaN;
if(param1 < -100)
{
param1 = -100;
}
else if(param1 > 100)
{
param1 = 100;
}
if(this.score != param1)
{
if(param1 == 0)
{
this.paintItGray();
}
else
{
_loc2_ = Math.abs(param1) / 100;
this.sectorMask.setProgress(1 - _loc2_,1);
if(param1 < 0)
{
this.paintItRed();
}
else if(param1 > 0)
{
this.paintItBlue();
}
}
this.score = param1;
}
}
public function readPosition3D(param1:Vector3) : void
{
this.point.readPos(param1);
}
private function paintItGray() : void
{
this.container.visible = false;
}
private function paintItRed() : void
{
this.container.visible = true;
this.swapObjects(this.imageBlue,this.imageRed);
this.container.mask = this.sectorMask;
}
private function paintItBlue() : void
{
this.container.visible = true;
this.swapObjects(this.imageRed,this.imageBlue);
this.container.mask = this.sectorMask;
}
private function swapObjects(param1:DisplayObject, param2:DisplayObject) : void
{
if(param2.parent == null)
{
if(param1.parent != null)
{
this.container.removeChild(param1);
}
this.container.addChild(param2);
}
}
}
}
|
package alternativa.tanks.models.battle.commonflag {
import alternativa.engine3d.core.Object3D;
import alternativa.engine3d.lights.OmniLight;
import alternativa.math.Quaternion;
import alternativa.math.Vector3;
import alternativa.physics.Body;
import alternativa.physics.ShapeContact;
import alternativa.physics.collision.CollisionDetector;
import alternativa.physics.collision.CollisionShape;
import alternativa.physics.collision.types.RayHit;
import alternativa.tanks.battle.BattleRunner;
import alternativa.tanks.battle.BattleService;
import alternativa.tanks.battle.PhysicsController;
import alternativa.tanks.battle.PhysicsInterpolator;
import alternativa.tanks.battle.Trigger;
import alternativa.tanks.battle.hidablegraphicobjects.HidableGraphicObject;
import alternativa.tanks.battle.objects.tank.Tank;
import alternativa.tanks.battle.scene3d.BattleScene3D;
import alternativa.tanks.battle.scene3d.Renderer;
import alternativa.tanks.models.teamlight.ModeLight;
import alternativa.tanks.models.teamlight.TeamLightColor;
import alternativa.tanks.physics.CollisionGroup;
import alternativa.tanks.services.lightingeffects.ILightingEffectsService;
import alternativa.types.Long;
import flash.utils.getTimer;
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.type.IGameObject;
import projects.tanks.client.battlefield.models.battle.pointbased.flag.ClientFlagFlyingData;
import projects.tanks.client.battlefield.models.battle.pointbased.flag.FlagState;
import projects.tanks.client.battleservice.BattleMode;
import projects.tanks.client.battleservice.model.battle.team.BattleTeam;
public class CommonFlag implements HidableGraphicObject, Trigger, Renderer, PhysicsController, PhysicsInterpolator {
[Inject]
public static var lightingEffectsService:ILightingEffectsService;
[Inject]
public static var battleService:BattleService;
private static const contacts:Vector.<ShapeContact> = new Vector.<ShapeContact>();
private static const rayOrigin:Vector3 = new Vector3();
private static const rayHit:RayHit = new RayHit();
protected static const TMP_POSITION:Vector3 = new Vector3();
protected static const TMP_ROTATION:Vector3 = new Vector3();
protected static const TMP_ROTATION_Q:Quaternion = new Quaternion();
private static const rayDirection:Vector3 = new Vector3();
protected static const NO_POSITION:Vector3 = new Vector3(NaN,NaN,NaN);
private static const DEFAULT_ROTATION:Quaternion = new Quaternion();
private static const TOUCH_TIMEOUT_MS:int = 100;
public static const MARKER_HIDE_DISTANCE:Number = 3500;
public var teamType:BattleTeam;
public var collisionPrimitive:CollisionShape;
private var _id:int;
private var _carrier:Tank;
private var _carrierId:Long;
protected var _state:FlagState = FlagState.AT_BASE;
protected var basePosition:Vector3;
protected var _alphaCoefficient:Number = 1;
protected var isLocalCarrier:Boolean;
private var collisionDetector:CollisionDetector;
private var triggerCallback:ICommonFlagModeModel;
protected var lightSource:OmniLight;
protected var flyingData:FlagFlyingData = new FlagFlyingData();
private var oldStatus:FlagStatus = new FlagStatus();
private var newStatus:FlagStatus = new FlagStatus();
protected var interpolatedStatus:FlagStatus = new FlagStatus();
protected var skinObject:Object3D;
protected var skinHeight:Number = 400;
protected var mountPointOffsetZ:Number = -50;
public var ballTouchedFunction:Function;
private var battleObject:IGameObject;
private var lastTimeTouched:* = 0;
private var vec:Vector3 = new Vector3();
public function CommonFlag(param1:int, param2:BattleTeam, param3:Vector3) {
super();
var local4:BattleRunner = battleService.getBattleRunner();
this._id = param1;
this.collisionDetector = local4.getCollisionDetector();
this.teamType = param2;
this.basePosition = param3;
this.skinHeight = this.skinHeight;
this.createLight(param2);
local4.addPhysicsController(this);
local4.addPhysicsInterpolator(this);
this.battleObject = Model.object;
}
private function createLight(param1:BattleTeam) : void {
var local2:ModeLight = lightingEffectsService.getLightForMode(BattleMode.CTF);
var local3:TeamLightColor = local2.getLightForTeam(param1);
this.lightSource = new OmniLight(local3.getColor(),local2.getAttenuationBegin(),local2.getAttenuationEnd());
this.lightSource.intensity = local3.getIntensity();
}
public function registerTouch() : Boolean {
var local1:int = getTimer();
var local2:Boolean = local1 - this.lastTimeTouched > TOUCH_TIMEOUT_MS;
if(local2) {
this.lastTimeTouched = local1;
}
return local2;
}
public function setAlphaMultiplier(param1:Number) : void {
this._alphaCoefficient = param1 < 0.2 ? 0.2 : param1;
this.setSkinAlpha(this.isLocalCarrier ? 0.5 : 1);
}
protected function setSkinAlpha(param1:Number) : void {
this.setAlpha(this._state == FlagState.CARRIED ? param1 : this._alphaCoefficient);
}
public function get id() : int {
return this._id;
}
public function setAlpha(param1:Number) : void {
this.skinObject.alpha = param1;
}
public function readPosition(param1:Vector3) : void {
param1.x = this.skinObject.x;
param1.y = this.skinObject.y;
param1.z = this.skinObject.z;
}
public function checkTrigger(param1:Body) : void {
var local3:CollisionShape = null;
var local4:ShapeContact = null;
var local5:int = 0;
if(this.state == FlagState.CARRIED || this.state == FlagState.EXILED) {
return;
}
var local2:int = 0;
while(true) {
if(local2 >= param1.numCollisionShapes) {
return;
}
local3 = param1.collisionShapes[local2];
this.collisionDetector.getContacts(local3,this.collisionPrimitive,contacts);
if(contacts.length > 0) {
local4 = contacts[0];
rayOrigin.copy(local4.position);
rayDirection.x = this.collisionPrimitive.transform.m03 - rayOrigin.x;
rayDirection.y = this.collisionPrimitive.transform.m13 - rayOrigin.y;
rayDirection.z = this.collisionPrimitive.transform.m23 - rayOrigin.z;
if(!this.collisionDetector.raycastStatic(rayOrigin,rayDirection,CollisionGroup.STATIC,1,null,rayHit)) {
break;
}
rayOrigin.x = local3.transform.m03;
rayOrigin.y = local3.transform.m13;
rayOrigin.z = local3.transform.m23;
rayDirection.x = this.collisionPrimitive.transform.m03 - rayOrigin.x;
rayDirection.y = this.collisionPrimitive.transform.m13 - rayOrigin.y;
rayDirection.z = this.collisionPrimitive.aabb.minZ - rayOrigin.z + 1;
if(!this.collisionDetector.raycastStatic(rayOrigin,rayDirection,CollisionGroup.STATIC,1,null,rayHit)) {
break;
}
}
local2++;
}
local5 = 0;
while(local5 < contacts.length) {
local4 = contacts[local5];
local4.dispose();
local5++;
}
contacts.length = 0;
this.triggerCallback.onFlagTouch(this);
}
public function render(param1:int, param2:int) : void {
if(this._carrier != null) {
this._carrier.getSkin().readGlobalFlagMountPoint(TMP_POSITION,TMP_ROTATION);
TMP_POSITION.z += this.mountPointOffsetZ;
TMP_ROTATION_Q.setFromEulerAngles(TMP_ROTATION);
this.setPositionAndRotation(TMP_POSITION,TMP_ROTATION_Q);
}
this.renderImpl(param1,param2,this.interpolatedStatus);
}
protected function renderImpl(param1:int, param2:int, param3:FlagStatus) : void {
}
public function get carrier() : Tank {
return this._carrier;
}
public function get carrierId() : Long {
return this._carrierId;
}
final public function setPositionAndRotation(param1:Vector3, param2:Quaternion) : * {
this.oldStatus.apply(param1,param2);
this.newStatus.apply(param1,param2);
this.interpolatedStatus.apply(param1,param2);
this.positionChanged(param1,param2);
}
final public function setPosition(param1:Vector3) : void {
this.oldStatus.applyPos(param1);
this.newStatus.applyPos(param1);
this.interpolatedStatus.applyPos(param1);
this.positionChanged(param1,DEFAULT_ROTATION);
}
public function positionChanged(param1:Vector3, param2:Quaternion) : void {
}
public function moveObjects(param1:Vector3) : * {
this.skinObject.x = param1.x;
this.skinObject.y = param1.y;
this.skinObject.z = param1.z;
this.collisionPrimitive.transform.m03 = param1.x;
this.collisionPrimitive.transform.m13 = param1.y;
this.collisionPrimitive.transform.m23 = param1.z + 0.5 * this.skinHeight;
this.collisionPrimitive.calculateAABB();
this.lightSource.x = param1.x;
this.lightSource.y = param1.y;
this.lightSource.z = param1.z;
}
public function addToScene() : void {
var local1:BattleScene3D = battleService.getBattleScene3D();
local1.addObject(this.skinObject);
local1.addObject(this.lightSource);
}
public function get state() : FlagState {
return this._state;
}
public function setLocalCarrier(param1:Long, param2:Tank) : void {
this.isLocalCarrier = true;
this.setCarrier(param1,param2,0.5);
}
public function setRemoteCarrier(param1:Long, param2:Tank) : void {
this.isLocalCarrier = false;
this.setCarrier(param1,param2,1);
}
private function setCarrier(param1:Long, param2:Tank, param3:Number) : void {
this._carrierId = param1;
this._carrier = param2;
this._state = FlagState.CARRIED;
if(param2 != null) {
this.show();
this.setSkinAlpha(param3);
} else {
this.hide();
}
}
public function returnToBase() : void {
if(this.basePosition == NO_POSITION) {
this.reset(FlagState.EXILED);
this.hide();
} else {
this.reset(FlagState.AT_BASE);
this.setPositionAndRotation(this.basePosition,DEFAULT_ROTATION);
this.show();
}
}
public function dropAt(param1:Vector3) : void {
this.reset(FlagState.DROPPED);
this.setPositionAndRotation(param1,DEFAULT_ROTATION);
}
public function dispose() : void {
var local1:BattleScene3D = battleService.getBattleScene3D();
local1.removeObject(this.skinObject);
local1.removeObject(this.lightSource);
var local2:BattleRunner = battleService.getBattleRunner();
local2.removePhysicsController(this);
local2.removePhysicsInterpolator(this);
this.battleObject = null;
}
protected function reset(param1:FlagState) : void {
this._state = param1;
this._carrierId = null;
this._carrier = null;
this.setSkinAlpha(1);
}
public function setTriggerCallback(param1:ICommonFlagModeModel) : void {
this.triggerCallback = param1;
}
public function dropFlying(param1:ClientFlagFlyingData, param2:FlagState) : void {
this.reset(param2);
this.flyingData.init(param1);
this.setPositionAndRotation(this.flyingData.currentPosition,DEFAULT_ROTATION);
if(this.flyingData.isFlying && this._state == FlagState.DROPPED) {
this.initFalling();
}
this.show();
}
protected function show() : void {
this.skinObject.visible = true;
this.lightSource.visible = true;
}
protected function hide() : void {
this.skinObject.visible = false;
this.lightSource.visible = false;
}
protected function initFalling() : void {
}
public function stopFalling() : void {
this.flyingData.isFlying = false;
this._state = FlagState.DROPPED;
}
public function runBeforePhysicsUpdate(param1:Number) : void {
if(this.flyingData.isFlying) {
this.oldStatus.copy(this.newStatus);
this.flyingData.update(param1);
this.newStatus.apply(this.flyingData.currentPosition,this.flyingData.currentOrientation);
this.positionChanged(this.flyingData.currentPosition,this.flyingData.currentOrientation);
if(!this.flyingData.isFlying && !this.flyingData.isKilled) {
this.stopFalling();
this.setPosition(this.flyingData.getFinalPosition());
}
}
}
private function disablePickup() : void {
battleService.getBattleRunner().removeTrigger(this);
}
public function interpolatePhysicsState(param1:Number, param2:int) : void {
if(this.flyingData.isFlying) {
this.interpolatedStatus.interpolate(this.oldStatus,this.newStatus,param1);
} else {
this.interpolatedStatus.copy(this.newStatus);
}
}
public function getIndicatorPosition() : Vector3 {
return this.flyingData.isFlying && this._state == FlagState.DROPPED ? this.flyingData.getFinalPosition() : this.newStatus.position;
}
public function isFlying() : Boolean {
return this.flyingData.isFlying;
}
}
}
|
package alternativa.tanks.display.usertitle {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/alternativa.tanks.display.usertitle.ProgressBarSkin_hpRightBlueCls.png")]
public class ProgressBarSkin_hpRightBlueCls extends BitmapAsset {
public function ProgressBarSkin_hpRightBlueCls() {
super();
}
}
}
|
package projects.tanks.client.panel.model.shop.enable.paymode {
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 RestrictionByPayModeModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:RestrictionByPayModeModelServer;
private var client:IRestrictionByPayModeModelBase = IRestrictionByPayModeModelBase(this);
private var modelId:Long = Long.getLong(2061464659,240727734);
public function RestrictionByPayModeModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new RestrictionByPayModeModelServer(IModel(this));
var local1:ModelRegistry = ModelRegistry(OSGi.getInstance().getService(ModelRegistry));
local1.registerModelConstructorCodec(this.modelId,this._protocol.getCodec(new TypeCodecInfo(RestrictionByPayModeCC,false)));
}
protected function getInitParam() : RestrictionByPayModeCC {
return RestrictionByPayModeCC(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 assets.button {
import flash.display.BitmapData;
[Embed(source="/_assets/assets.button.bigbutton_UP_RIGHT.png")]
public dynamic class bigbutton_UP_RIGHT extends BitmapData {
public function bigbutton_UP_RIGHT(param1:int = 7, param2:int = 50) {
super(param1,param2);
}
}
}
|
package alternativa.tanks.models.sfx.colortransform
{
import com.alternativaplatform.projects.tanks.client.warfare.models.colortransform.struct.ColorTransformStruct;
public class ColorTransformEntry
{
public var t:Number;
public var redMultiplier:Number;
public var greenMultiplier:Number;
public var blueMultiplier:Number;
public var alphaMultiplier:Number;
public var redOffset:int;
public var greenOffset:int;
public var blueOffset:int;
public var alphaOffset:int;
public function ColorTransformEntry(cts:ColorTransformStruct)
{
super();
this.t = cts.t;
this.redMultiplier = cts.redMultiplier;
this.greenMultiplier = cts.greenMultiplier;
this.blueMultiplier = cts.blueMultiplier;
this.alphaMultiplier = cts.alphaMultiplier;
this.redOffset = cts.redOffset;
this.greenOffset = cts.greenOffset;
this.blueOffset = cts.blueOffset;
this.alphaOffset = cts.alphaOffset;
}
}
}
|
package alternativa.tanks.gui.panel {
import alternativa.osgi.service.locale.ILocaleService;
import alternativa.tanks.gui.panel.buttons.ClanButton;
import alternativa.tanks.gui.panel.buttons.FriendsButton;
import alternativa.tanks.gui.panel.buttons.MainPanelFullscreenButton;
import alternativa.tanks.gui.panel.buttons.QuestsButton;
import alternativa.tanks.gui.panel.buttons.ShopBarButton;
import alternativa.tanks.service.clan.ClanPanelNotificationService;
import controls.base.MainPanelBattlesButtonBase;
import controls.base.MainPanelGarageButtonBase;
import controls.panel.BaseButton;
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.MouseEvent;
import forms.*;
import forms.events.MainButtonBarEvents;
import projects.tanks.clients.fp10.libraries.TanksLocale;
import projects.tanks.clients.fp10.libraries.tanksservices.service.fullscreen.FullscreenService;
import projects.tanks.clients.fp10.libraries.tanksservices.service.userproperties.IUserPropertiesService;
import services.buttonbar.IButtonBarService;
public class ButtonBar extends Sprite {
[Inject]
public static var localeService:ILocaleService;
[Inject]
public static var buttonBarService:IButtonBarService;
[Inject]
public static var fullscreenService:FullscreenService;
[Inject]
public static var userPropertiesService:IUserPropertiesService;
[Inject]
public static var clanPanelNotificationService:ClanPanelNotificationService;
private static const SECTION_BUTTON_GAP:int = 8;
public var battlesButton:MainPanelBattlesButtonBase = new MainPanelBattlesButtonBase();
public var garageButton:MainPanelGarageButtonBase = new MainPanelGarageButtonBase();
public var clanButton:ClanButton = new ClanButton();
public var settingsButton:MainPanelConfigButton = new MainPanelConfigButton();
public var closeButton:CloseOrBackButton = new CloseOrBackButton();
public var fullScreenButton:MainPanelFullscreenButton = new MainPanelFullscreenButton();
private var soundButton:MainPanelSoundButton = new MainPanelSoundButton();
private var helpButton:MainPanelHelpButton = new MainPanelHelpButton();
private var shopButton:ShopBarButton = new ShopBarButton();
private var questsButton:QuestsButton = new QuestsButton();
private var friendsButton:FriendsButton = new FriendsButton();
private var _soundOn:Boolean = true;
private var soundIcon:MovieClip;
public function ButtonBar() {
super();
addChild(this.shopButton);
addChild(this.battlesButton);
addChild(this.garageButton);
addChild(this.clanButton);
addChild(this.questsButton);
addChild(this.friendsButton);
addChild(this.settingsButton);
addChild(this.closeButton);
addChild(this.soundButton);
addChild(this.fullScreenButton);
addChild(this.helpButton);
this.shopButton.type = 1;
this.shopButton.label = localeService.getText(TanksLocale.TEXT_MAIN_PANEL_BUTTON_SHOP);
this.shopButton.addEventListener(MouseEvent.CLICK,this.listClick);
this.battlesButton.type = 2;
this.battlesButton.label = localeService.getText(TanksLocale.TEXT_MAIN_PANEL_BUTTON_BATTLES);
this.battlesButton.enable = false;
this.battlesButton.addEventListener(MouseEvent.CLICK,this.listClick);
this.garageButton.type = 3;
this.garageButton.label = localeService.getText(TanksLocale.TEXT_MAIN_PANEL_BUTTON_GARAGE);
this.garageButton.addEventListener(MouseEvent.CLICK,this.listClick);
this.clanButton.type = 11;
this.clanButton.label = localeService.getText(TanksLocale.TEXT_CLAN);
this.clanButton.addEventListener(MouseEvent.CLICK,this.listClick);
this.clanButton.visible = clanPanelNotificationService.clanButtonVisible;
this.questsButton.type = 10;
this.questsButton.addEventListener(MouseEvent.CLICK,this.listClick);
this.friendsButton.type = 8;
this.friendsButton.addEventListener(MouseEvent.CLICK,this.listClick);
this.settingsButton.type = 4;
this.settingsButton.addEventListener(MouseEvent.CLICK,this.listClick);
this.soundButton.type = 5;
this.soundButton.addEventListener(MouseEvent.CLICK,this.listClick);
this.soundIcon = this.soundButton.getChildByName("icon") as MovieClip;
this.fullScreenButton.type = 9;
this.fullScreenButton.addEventListener(MouseEvent.CLICK,this.listClick);
this.helpButton.type = 6;
this.helpButton.addEventListener(MouseEvent.CLICK,this.listClick);
this.closeButton.addEventListener(MouseEvent.CLICK,this.listClick);
this.draw();
}
public function draw() : void {
this.questsButton.visible = userPropertiesService.isQuestsAvailableByRank();
this.battlesButton.x = this.shopButton.x + this.shopButton.width + 1;
this.garageButton.x = this.battlesButton.x + this.battlesButton.width;
this.clanButton.x = this.garageButton.x + this.garageButton.width;
var local1:Number = SECTION_BUTTON_GAP;
if(this.clanButton.visible) {
local1 += this.clanButton.x + this.clanButton.width;
} else {
local1 += this.garageButton.x + this.garageButton.width;
}
this.questsButton.x = local1;
this.friendsButton.x = this.questsButton.x + (this.questsButton.visible ? this.questsButton.width : 0);
this.settingsButton.x = this.friendsButton.x + this.friendsButton.width;
this.soundButton.x = this.settingsButton.x + this.settingsButton.width;
this.fullScreenButton.x = this.soundButton.x + this.soundButton.width;
this.helpButton.x = this.fullScreenButton.x + this.fullScreenButton.width;
this.closeButton.x = this.helpButton.x + this.helpButton.width + 6;
this.soundIcon.gotoAndStop(this.soundOn ? 1 : 2);
}
public function hidePaymentButton() : void {
this.shopButton.width = 0;
this.shopButton.visible = false;
this.draw();
MainPanel(parent).resize();
}
public function hideClanButton() : void {
this.clanButton.visible = false;
this.draw();
MainPanel(parent).resize();
}
public function showClanButton() : void {
this.clanButton.visible = true;
this.draw();
MainPanel(parent).resize();
}
public function set soundOn(param1:Boolean) : void {
this._soundOn = param1;
this.draw();
}
public function get soundOn() : Boolean {
return this._soundOn;
}
private function listClick(param1:MouseEvent) : void {
var local2:Object = param1.currentTarget;
if(Boolean(local2.enable) || local2 is BaseButton && local2.selected) {
dispatchEvent(new MainButtonBarEvents(local2.type));
buttonBarService.change(local2.type);
}
if(local2 == this.soundButton) {
this.soundOn = !this.soundOn;
}
}
}
}
|
package alternativa.tanks.model.quest.challenge.gui {
import alternativa.osgi.service.locale.ILocaleService;
import alternativa.tanks.model.challenge.battlepass.notifier.BattlePassPurchaseService;
import alternativa.tanks.model.quest.challenge.stars.StarsInfoService;
import alternativa.tanks.model.quest.common.MissionsWindowsService;
import controls.Label;
import controls.TankWindowInner;
import controls.buttons.h30px.H30ButtonSkin;
import controls.buttons.h30px.OrangeMediumButton;
import controls.timer.CountDownTimer;
import controls.timer.CountDownTimerWithIcon;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;
import flash.events.MouseEvent;
import platform.client.fp10.core.resource.BatchResourceLoader;
import platform.client.fp10.core.resource.Resource;
import platform.client.fp10.core.resource.types.ImageResource;
import platform.clients.fp10.libraries.alternativapartners.service.IPartnerService;
import projects.tanks.client.commons.types.ShopCategoryEnum;
import projects.tanks.client.panel.model.challenge.rewarding.Tier;
import projects.tanks.client.panel.model.challenge.rewarding.TierItem;
import projects.tanks.clients.flash.commons.models.challenge.ChallengeInfoService;
import projects.tanks.clients.flash.commons.models.challenge.shopitems.ChallengeShopItems;
import projects.tanks.clients.flash.commons.services.payment.PaymentDisplayService;
import projects.tanks.clients.fp10.libraries.TanksLocale;
import projects.tanks.clients.fp10.libraries.tanksservices.service.user.IUserInfoService;
public class ChallengesView extends Sprite {
[Inject]
public static var challengeInfoService:ChallengeInfoService;
[Inject]
public static var challengeShopItems:ChallengeShopItems;
[Inject]
public static var starsInfoService:StarsInfoService;
[Inject]
public static var battlePassPurchaseService:BattlePassPurchaseService;
[Inject]
public static var paymentDisplayService:PaymentDisplayService;
[Inject]
public static var localeService:ILocaleService;
[Inject]
public static var userInfoService:IUserInfoService;
[Inject]
public static var missionsWindowService:MissionsWindowsService;
[Inject]
public static var partnerService:IPartnerService;
private static const goldenStarClass:Class = ChallengesView_goldenStarClass;
private static const goldenStarBitmapData:BitmapData = new goldenStarClass().bitmapData;
private static const silverStarClass:Class = ChallengesView_silverStarClass;
private static const silverStarBitmapData:BitmapData = new silverStarClass().bitmapData;
private static const goldenStarBgClass:Class = ChallengesView_goldenStarBgClass;
private static const goldenStarBgBitmapData:BitmapData = new goldenStarBgClass().bitmapData;
private static const silverStarBgClass:Class = ChallengesView_silverStarBgClass;
private static const silverStarBgBitmapData:BitmapData = new silverStarBgClass().bitmapData;
private static var GAP:int = 3;
private static var TIER_LIST_WIDTH:int = 724;
private static var TIER_LIST_HEIGHT:int = 335;
private static var DESCRIPTION_LABEL_WIDTH:int = 520;
private static var BUY_BUTTON_WIDTH:int = 180;
private var tierView:TierNumberView = new TierNumberView();
private var progressView:ChallengesProgressView = new ChallengesProgressView();
private var tierList:TierList = new TierList();
private var buyButton:OrangeMediumButton = new OrangeMediumButton();
private var timer:CountDownTimer = new CountDownTimer();
private var descriptionLabel:Label = new Label();
private var tiersInfo:Vector.<Tier>;
private var showBuyButton:Boolean;
public function ChallengesView() {
super();
this.initTierLabel();
this.initStarLabels();
this.initProgressBar();
this.initTimerLabel();
this.initTiersList();
this.initBuyButton();
this.initDescriptionLabel();
this.showBuyButton = !partnerService.isRunningInsidePartnerEnvironment() || !partnerService.hasPaymentAction();
this.initView();
}
public function refreshTierListView() : void {
this.initResourcesLoading();
}
private function initResourcesLoading() : void {
var tier:Tier = null;
var freeItem:TierItem = null;
var battlePassItem:TierItem = null;
var resources:Vector.<Resource> = new Vector.<Resource>();
for each(tier in this.tiersInfo) {
freeItem = tier.freeItem;
if(freeItem != null) {
this.addToLoad(freeItem.preview,resources);
}
battlePassItem = tier.battlePassItem;
if(battlePassItem != null) {
this.addToLoad(battlePassItem.preview,resources);
}
}
if(resources.length > 0) {
new BatchResourceLoader(function():void {
refresh();
}).load(resources);
} else {
this.refresh();
}
}
public function setTiersInfo(param1:Vector.<Tier>) : void {
this.tiersInfo = param1;
}
private function refresh() : void {
var local1:int = int(starsInfoService.getStars());
if(this.tiersInfo == null || this.tiersInfo.length == 0) {
return;
}
var local2:int = this.getCurrentTierIndex(local1);
var local3:int = this.tiersInfo[local2].stars;
var local4:int = local2 == 0 ? 0 : this.tiersInfo[local2 - 1].stars;
var local5:int = local1 >= local3 ? 100 : int((local1 - local4) * 100 / (local3 - local4));
this.tierView.level = local2 + 1;
this.tierList.setTiers(this.tiersInfo,local2,local5);
this.progressView.setProgress(local5,local1,local3);
if(this.showBuyButton) {
this.updateBuyButton(local5 == 100);
}
}
public function getUserTierIndex(param1:int) : int {
var local2:int = 0;
while(local2 < this.tiersInfo.length - 1) {
if(this.tiersInfo[local2].stars >= param1) {
return local2 + 1;
}
local2++;
}
return this.tiersInfo.length;
}
private function getCurrentTierIndex(param1:int) : int {
var local2:int = 0;
while(local2 < this.tiersInfo.length - 1) {
if(this.tiersInfo[local2].stars > param1) {
return local2;
}
local2++;
}
return this.tiersInfo.length - 1;
}
private function addToLoad(param1:ImageResource, param2:Vector.<Resource>) : void {
if(param1.isLazy && !param1.isLoaded && param2.indexOf(param1) < 0) {
param2.push(param1);
}
}
private function initTiersList() : void {
this.tierList.x = this.progressView.x;
this.tierList.y = this.progressView.y + this.progressView.height + 8;
this.tierList.width = TIER_LIST_WIDTH;
this.tierList.height = TIER_LIST_HEIGHT;
addChild(this.tierList);
}
private function initBuyButton() : void {
this.buyButton.labelSize = H30ButtonSkin.DEFAULT_LABEL_SIZE;
this.buyButton.labelHeight = H30ButtonSkin.DEFAULT_LABEL_HEIGHT;
this.buyButton.labelPositionY = H30ButtonSkin.DEFAULT_LABEL_Y - 2;
this.buyButton.width = BUY_BUTTON_WIDTH;
this.buyButton.y = 378;
this.buyButton.visible = false;
this.buyButton.buttonMode = true;
this.buyButton.useHandCursor = true;
addChild(this.buyButton);
}
private function updateBuyButton(param1:Boolean) : void {
var local2:Boolean = Boolean(battlePassPurchaseService.isPurchased());
var local3:Boolean = Boolean(userInfoService.hasPremium(userInfoService.getCurrentUserId()));
if(!local2) {
this.buyButton.label = localeService.getText(TanksLocale.TEXT_CHALLENGE_BUY_BATTLE_PASS);
this.buyButton.visible = true;
this.descriptionLabel.text = localeService.getText(TanksLocale.TEXT_CHALLENGE_BUY_BATTLE_PASS_TIP);
this.alignDescriptionLabel();
return;
}
if(param1) {
this.buyButton.visible = false;
this.descriptionLabel.text = localeService.getText(TanksLocale.TEXT_CHALLENGE_FINISH);
this.alignDescriptionLabel();
return;
}
if(!local3) {
this.buyButton.label = localeService.getText(TanksLocale.TEXT_CHALLENGE_BUY_PREMIUM);
this.buyButton.visible = true;
this.descriptionLabel.text = localeService.getText(TanksLocale.TEXT_CHALLENGE_BUY_PREMIUM_TIP);
this.alignDescriptionLabel();
return;
}
this.buyButton.visible = true;
this.buyButton.label = localeService.getText(TanksLocale.TEXT_CHALLENGE_BUY_STARS);
this.descriptionLabel.text = localeService.getText(TanksLocale.TEXT_CHALLENGE_BUY_STARS_TIP);
this.alignDescriptionLabel();
}
private function alignDescriptionLabel() : void {
this.descriptionLabel.x = this.buyButton.visible ? this.buyButton.width + GAP * 2 : this.buyButton.x;
}
private function initDescriptionLabel() : void {
this.descriptionLabel.width = DESCRIPTION_LABEL_WIDTH;
this.descriptionLabel.y = this.buyButton.y + GAP;
this.descriptionLabel.visible = true;
addChild(this.descriptionLabel);
}
public function initView() : void {
this.buyButton.addEventListener(MouseEvent.CLICK,this.onBuyButtonClick);
}
private function onBuyButtonClick(param1:MouseEvent) : void {
var local2:Boolean = Boolean(battlePassPurchaseService.isPurchased());
var local3:Boolean = Boolean(userInfoService.hasPremium(userInfoService.getCurrentUserId()));
if(!local2 && challengeShopItems.battlePass != null) {
paymentDisplayService.openPaymentForShopItem(challengeShopItems.battlePass);
} else if(!local3) {
paymentDisplayService.openPaymentAt(ShopCategoryEnum.PREMIUM);
} else {
paymentDisplayService.openPaymentForShopItem(challengeShopItems.starsBundle);
}
}
private function initTierLabel() : void {
addChild(this.tierView);
}
private function initStarLabels() : void {
var local1:Bitmap = new Bitmap(silverStarBgBitmapData);
local1.y = this.tierView.height + GAP;
var local2:Bitmap = new Bitmap(silverStarBitmapData);
local2.y = local1.y + (local1.height - local2.height) / 2;
local2.x = (local1.width - local2.width) / 2;
addChild(local1);
addChild(local2);
var local3:Bitmap = new Bitmap(goldenStarBgBitmapData);
local3.y = local1.y + local1.height + GAP;
var local4:Bitmap = new Bitmap(goldenStarBitmapData);
local4.y = local3.y + (local3.height - local4.height) / 2;
local4.x = (local3.width - local4.width) / 2;
addChild(local3);
addChild(local4);
}
private function initProgressBar() : void {
this.progressView.x = this.tierView.width + 7;
this.progressView.y = 1;
addChild(this.progressView);
}
private function initTimerLabel() : void {
var local1:TankWindowInner = new TankWindowInner(131,25);
local1.x = this.progressView.x + this.progressView.width + 8;
var local2:CountDownTimerWithIcon = new CountDownTimerWithIcon(false);
local2.start(this.timer);
local2.x = 10;
local2.y = 5;
local1.addChild(local2);
addChild(local1);
this.timer.stop();
this.timer.start(challengeInfoService.getEndTime());
}
public function clear() : void {
if(this.timer != null) {
this.timer.destroy();
this.timer = null;
}
this.tierList.destroy();
this.buyButton.removeEventListener(MouseEvent.CLICK,this.onBuyButtonClick);
}
}
}
|
package projects.tanks.client.panel.model.garage.rankupsupplybonus {
import alternativa.osgi.OSGi;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.CollectionCodecInfo;
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 RankUpSupplyBonusModelBase extends Model {
private var _protocol:IProtocol = IProtocol(OSGi.getInstance().getService(IProtocol));
protected var server:RankUpSupplyBonusModelServer;
private var client:IRankUpSupplyBonusModelBase = IRankUpSupplyBonusModelBase(this);
private var modelId:Long = Long.getLong(1175442844,-1652512683);
private var _showRankUpSupplyBonusAlertsId:Long = Long.getLong(1864278356,1633403965);
private var _showRankUpSupplyBonusAlerts_bonusesCodec:ICodec;
public function RankUpSupplyBonusModelBase() {
super();
this.initCodecs();
}
protected function initCodecs() : void {
this.server = new RankUpSupplyBonusModelServer(IModel(this));
this._showRankUpSupplyBonusAlerts_bonusesCodec = this._protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(RankUpSupplyBonusInfo,false),false,1));
}
override public function invoke(param1:Long, param2:ProtocolBuffer) : void {
switch(param1) {
case this._showRankUpSupplyBonusAlertsId:
this.client.showRankUpSupplyBonusAlerts(this._showRankUpSupplyBonusAlerts_bonusesCodec.decode(param2) as Vector.<RankUpSupplyBonusInfo>);
}
}
override public function get id() : Long {
return this.modelId;
}
}
}
|
package alternativa.tanks.view {
import alternativa.osgi.service.locale.ILocaleService;
import alternativa.tanks.view.forms.primivites.Alert;
import controls.DefaultButton;
import controls.TankWindow;
import flash.display.Bitmap;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.KeyboardEvent;
import flash.events.MouseEvent;
import flash.ui.Keyboard;
import org.robotlegs.core.IInjector;
import projects.tanks.clients.flash.commons.models.captcha.CaptchaSection;
import projects.tanks.clients.flash.commons.models.captcha.RefreshCaptchaClickedEvent;
import projects.tanks.clients.fp10.libraries.TanksLocale;
public class StandAloneCaptchaForm extends Sprite {
[Inject]
public var localeService:ILocaleService;
[Inject]
public var injector:IInjector;
private var captchaSection:CaptchaSection;
public var playButton:DefaultButton;
private var _border:int = 25;
private var _margin:int = 20;
public function StandAloneCaptchaForm() {
super();
}
[PostConstruct]
public function postConstruct() : void {
var bg:TankWindow = new TankWindow(325,200);
addChild(bg);
this.captchaSection = this.injector.instantiate(CaptchaSection);
this.captchaSection.x = this._border;
this.captchaSection.y = this._border;
addChild(this.captchaSection);
this.playButton = new DefaultButton();
this.playButton.label = this.localeService.getText(TanksLocale.TEXT_CAPTCHA_PROCEED_BUTTON);
this.playButton.y = this.captchaSection.y + this.captchaSection.height + this._margin;
this.playButton.x = bg.width - this._border - this.playButton.width;
bg.height = this._border + this.playButton.y + this.playButton.height;
addChild(this.playButton);
this.captchaSection.refreshButton.addEventListener(MouseEvent.CLICK,function():void {
dispatchEvent(new RefreshCaptchaClickedEvent());
});
addEventListener(Event.ADDED_TO_STAGE,function(param1:Event):void {
var e:Event = param1;
captchaSection.captchaAnswer.addEventListener(KeyboardEvent.KEY_DOWN,onPlayClickedKey);
stage.focus = captchaSection.captchaAnswer.textField;
addEventListener(Event.REMOVED_FROM_STAGE,function():void {
stage.removeEventListener(Event.RESIZE,onResize);
captchaSection.captchaAnswer.removeEventListener(KeyboardEvent.KEY_DOWN,onPlayClickedKey);
});
stage.addEventListener(Event.RESIZE,onResize);
onResize();
});
}
private function onResize(param1:Event = null) : void {
this.x = int((stage.stageWidth - this.width) / 2);
this.y = int((stage.stageHeight - this.height) / 2);
}
private function onPlayClickedKey(param1:KeyboardEvent) : void {
if(param1.keyCode == Keyboard.ENTER) {
this.playButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
}
}
public function get captchaAnswer() : String {
return this.captchaSection.captchaAnswer.value;
}
public function showCaptcha(param1:Bitmap) : void {
this.captchaSection.captcha = param1;
}
public function captchaFailed() : void {
this.showErrorWindow(Alert.CAPTCHA_INCORRECT);
this.captchaSection.captchaAnswer.clear();
}
private function showErrorWindow(param1:int) : void {
var local2:Alert = new Alert(param1);
parent.addChild(local2);
stage.focus = local2.closeButton;
}
public function set captchaAnswer(param1:String) : void {
this.captchaSection.captchaAnswer.textField.text = param1;
}
}
}
|
package alternativa.tanks.model.payment.shop.specialkit {
import projects.tanks.client.panel.model.shop.specialkit.SpecialKitPackageCC;
[ModelInterface]
public interface SpecialKitPackage {
function getCrystalsAmount() : int;
function getPremiumDurationInDays() : int;
function getEverySupplyAmount() : int;
function getGoldAmount() : int;
function hasAdditionalItem() : Boolean;
function getItemsCount() : int;
function getPackageData() : SpecialKitPackageCC;
}
}
|
package alternativa.tanks.models.weapon.weakening {
public class WeaponWeakeningData {
public var maximumDamageRadius:Number;
public var minimumDamagePercent:Number;
public var minimumDamageRadius:Number;
public function WeaponWeakeningData() {
super();
}
}
}
|
package alternativa.tanks.models.dom.hud
{
import mx.core.BitmapAsset;
[ExcludeClass]
public class MarkerBitmaps_redMarkerClass extends BitmapAsset
{
public function MarkerBitmaps_redMarkerClass()
{
super();
}
}
}
|
package projects.tanks.client.battleselect.types
{
public class MapClient
{
public var previewId:String;
public var id:String;
public var name:String;
public var gameName:String;
public var maxPeople:int;
public var maxRank:int;
public var minRank:int;
public var themeName:String;
public var ctf:Boolean;
public var tdm:Boolean;
public var dom:Boolean;
public var hr:Boolean;
public function MapClient()
{
super();
}
}
}
|
package alternativa.physics.collision.primitives
{
import alternativa.math.Vector3;
import alternativa.physics.collision.CollisionPrimitive;
import alternativa.physics.collision.types.BoundBox;
public class CollisionTriangle extends CollisionPrimitive
{
public var v0:Vector3;
public var v1:Vector3;
public var v2:Vector3;
public var e0:Vector3;
public var e1:Vector3;
public var e2:Vector3;
public function CollisionTriangle(v0:Vector3, v1:Vector3, v2:Vector3, collisionGroup:int)
{
this.v0 = new Vector3();
this.v1 = new Vector3();
this.v2 = new Vector3();
this.e0 = new Vector3();
this.e1 = new Vector3();
this.e2 = new Vector3();
super(TRIANGLE,collisionGroup);
this.initVertices(v0,v1,v2);
}
override public function calculateAABB() : BoundBox
{
var a:Number = NaN;
var b:Number = NaN;
var eps_c:Number = 0.005 * transform.c;
var eps_g:Number = 0.005 * transform.g;
var eps_k:Number = 0.005 * transform.k;
a = this.v0.x * transform.a + this.v0.y * transform.b;
aabb.minX = aabb.maxX = a + eps_c;
b = a - eps_c;
if(b > aabb.maxX)
{
aabb.maxX = b;
}
else if(b < aabb.minX)
{
aabb.minX = b;
}
a = this.v0.x * transform.e + this.v0.y * transform.f;
aabb.minY = aabb.maxY = a + eps_g;
b = a - eps_g;
if(b > aabb.maxY)
{
aabb.maxY = b;
}
else if(b < aabb.minY)
{
aabb.minY = b;
}
a = this.v0.x * transform.i + this.v0.y * transform.j;
aabb.minZ = aabb.maxZ = a + eps_k;
b = a - eps_k;
if(b > aabb.maxZ)
{
aabb.maxZ = b;
}
else if(b < aabb.minZ)
{
aabb.minZ = b;
}
a = this.v1.x * transform.a + this.v1.y * transform.b;
b = a + eps_c;
if(b > aabb.maxX)
{
aabb.maxX = b;
}
else if(b < aabb.minX)
{
aabb.minX = b;
}
b = a - eps_c;
if(b > aabb.maxX)
{
aabb.maxX = b;
}
else if(b < aabb.minX)
{
aabb.minX = b;
}
a = this.v1.x * transform.e + this.v1.y * transform.f;
b = a + eps_g;
if(b > aabb.maxY)
{
aabb.maxY = b;
}
else if(b < aabb.minY)
{
aabb.minY = b;
}
b = a - eps_g;
if(b > aabb.maxY)
{
aabb.maxY = b;
}
else if(b < aabb.minY)
{
aabb.minY = b;
}
a = this.v1.x * transform.i + this.v1.y * transform.j;
b = a + eps_k;
if(b > aabb.maxZ)
{
aabb.maxZ = b;
}
else if(b < aabb.minZ)
{
aabb.minZ = b;
}
b = a - eps_k;
if(b > aabb.maxZ)
{
aabb.maxZ = b;
}
else if(b < aabb.minZ)
{
aabb.minZ = b;
}
a = this.v2.x * transform.a + this.v2.y * transform.b;
b = a + eps_c;
if(b > aabb.maxX)
{
aabb.maxX = b;
}
else if(b < aabb.minX)
{
aabb.minX = b;
}
b = a - eps_c;
if(b > aabb.maxX)
{
aabb.maxX = b;
}
else if(b < aabb.minX)
{
aabb.minX = b;
}
a = this.v2.x * transform.e + this.v2.y * transform.f;
b = a + eps_g;
if(b > aabb.maxY)
{
aabb.maxY = b;
}
else if(b < aabb.minY)
{
aabb.minY = b;
}
b = a - eps_g;
if(b > aabb.maxY)
{
aabb.maxY = b;
}
else if(b < aabb.minY)
{
aabb.minY = b;
}
a = this.v2.x * transform.i + this.v2.y * transform.j;
b = a + eps_k;
if(b > aabb.maxZ)
{
aabb.maxZ = b;
}
else if(b < aabb.minZ)
{
aabb.minZ = b;
}
b = a - eps_k;
if(b > aabb.maxZ)
{
aabb.maxZ = b;
}
else if(b < aabb.minZ)
{
aabb.minZ = b;
}
aabb.minX += transform.d;
aabb.maxX += transform.d;
aabb.minY += transform.h;
aabb.maxY += transform.h;
aabb.minZ += transform.l;
aabb.maxZ += transform.l;
return aabb;
}
override public function getRayIntersection(origin:Vector3, vector:Vector3, epsilon:Number, normal:Vector3) : Number
{
var vz:Number = vector.x * transform.c + vector.y * transform.g + vector.z * transform.k;
if(vz < epsilon && vz > -epsilon)
{
return -1;
}
var tx:Number = origin.x - transform.d;
var ty:Number = origin.y - transform.h;
var tz:Number = origin.z - transform.l;
var oz:Number = tx * transform.c + ty * transform.g + tz * transform.k;
var t:Number = -oz / vz;
if(t < 0)
{
return -1;
}
var ox:Number = tx * transform.a + ty * transform.e + tz * transform.i;
var oy:Number = tx * transform.b + ty * transform.f + tz * transform.j;
tx = ox + t * (vector.x * transform.a + vector.y * transform.e + vector.z * transform.i);
ty = oy + t * (vector.x * transform.b + vector.y * transform.f + vector.z * transform.j);
tz = oz + t * vz;
if(this.e0.x * (ty - this.v0.y) - this.e0.y * (tx - this.v0.x) < 0 || this.e1.x * (ty - this.v1.y) - this.e1.y * (tx - this.v1.x) < 0 || this.e2.x * (ty - this.v2.y) - this.e2.y * (tx - this.v2.x) < 0)
{
return -1;
}
normal.x = transform.c;
normal.y = transform.g;
normal.z = transform.k;
return t;
}
override public function copyFrom(source:CollisionPrimitive) : CollisionPrimitive
{
super.copyFrom(source);
var tri:CollisionTriangle = source as CollisionTriangle;
if(tri != null)
{
this.v0.vCopy(tri.v0);
this.v1.vCopy(tri.v1);
this.v2.vCopy(tri.v2);
this.e0.vCopy(tri.e0);
this.e1.vCopy(tri.e1);
this.e2.vCopy(tri.e2);
}
return this;
}
override public function toString() : String
{
return "[CollisionTriangle v0=" + this.v0 + ", v1=" + this.v1 + ", v2=" + this.v2 + "]";
}
override protected function createPrimitive() : CollisionPrimitive
{
return new CollisionTriangle(this.v0,this.v1,this.v2,collisionGroup);
}
private function initVertices(v0:Vector3, v1:Vector3, v2:Vector3) : void
{
this.v0.vCopy(v0);
this.v1.vCopy(v1);
this.v2.vCopy(v2);
this.e0.vDiff(v1,v0);
this.e0.vNormalize();
this.e1.vDiff(v2,v1);
this.e1.vNormalize();
this.e2.vDiff(v0,v2);
this.e2.vNormalize();
}
override public function destroy() : *
{
this.v0 = null;
this.v1 = null;
this.v2 = null;
this.e0 = null;
this.e1 = null;
this.e2 = null;
localTransform = null;
transform = null;
}
}
}
|
package alternativa.tanks.model.payment.shop.specialkit {
import platform.client.fp10.core.model.impl.Model;
import platform.client.fp10.core.type.IGameObject;
public class SinglePayModeAdapt implements SinglePayMode {
private var object:IGameObject;
private var impl:SinglePayMode;
public function SinglePayModeAdapt(param1:IGameObject, param2:SinglePayMode) {
super();
this.object = param1;
this.impl = param2;
}
public function getPayMode() : IGameObject {
var result:IGameObject = null;
try {
Model.object = this.object;
result = this.impl.getPayMode();
}
finally {
Model.popObject();
}
return result;
}
}
}
|
package projects.tanks.client.garage.models.item.availabledevices {
import platform.client.fp10.core.type.IGameObject;
public interface IAvailableDevicesModelBase {
function devicesLoaded(param1:Vector.<IGameObject>, param2:IGameObject) : void;
}
}
|
package forms.ranks {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/forms.ranks.PremiumRankBitmaps_bitmapSmallRank29.png")]
public class PremiumRankBitmaps_bitmapSmallRank29 extends BitmapAsset {
public function PremiumRankBitmaps_bitmapSmallRank29() {
super();
}
}
}
|
package alternativa.tanks.models.tank.configuration {
import platform.client.fp10.core.type.IGameObject;
[ModelInterface]
public interface TankConfiguration {
function getHullObject() : IGameObject;
function getWeaponObject() : IGameObject;
function getColoringObject() : IGameObject;
function hasDrone() : Boolean;
function getDrone() : IGameObject;
}
}
|
package alternativa.tanks.models.tank {
import alternativa.math.Vector3;
import alternativa.tanks.battle.BattleService;
import alternativa.tanks.services.battlereadiness.BattleReadinessService;
import projects.tanks.client.battlefield.types.Vector3d;
public class SpawnCameraConfigurator {
[Inject]
public static var battleService:BattleService;
[Inject]
public static var battleReadinessService:BattleReadinessService;
private var firstSpawn:Boolean = true;
public function SpawnCameraConfigurator(param1:Boolean) {
super();
this.firstSpawn = param1;
}
public function setupCamera(param1:Vector3d, param2:Vector3d) : void {
var local3:Vector3 = new Vector3(param1.x,param1.y,param1.z);
var local4:Vector3 = new Vector3(-Math.sin(param2.z),Math.cos(param2.z),0);
if(this.firstSpawn) {
this.firstSpawn = false;
battleService.activateFollowCamera();
battleService.setFollowCameraState(local3,local4);
battleService.lockFollowCamera();
battleReadinessService.unlockUser();
} else {
battleService.activateFlyCamera(local3,local4);
}
}
}
}
|
package _codec.projects.tanks.client.battlefield.models.ultimate.effects.titan.generator {
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.codec.OptionalCodecDecorator;
import alternativa.protocol.impl.LengthCodecHelper;
import alternativa.protocol.info.TypeCodecInfo;
import projects.tanks.client.battlefield.models.ultimate.effects.titan.generator.TitanUltimateGeneratorCC;
public class VectorCodecTitanUltimateGeneratorCCLevel1 implements ICodec {
private var elementCodec:ICodec;
private var optionalElement:Boolean;
public function VectorCodecTitanUltimateGeneratorCCLevel1(param1:Boolean) {
super();
this.optionalElement = param1;
}
public function init(param1:IProtocol) : void {
this.elementCodec = param1.getCodec(new TypeCodecInfo(TitanUltimateGeneratorCC,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.<TitanUltimateGeneratorCC> = new Vector.<TitanUltimateGeneratorCC>(local2,true);
var local4:int = 0;
while(local4 < local2) {
local3[local4] = TitanUltimateGeneratorCC(this.elementCodec.decode(param1));
local4++;
}
return local3;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
var local4:TitanUltimateGeneratorCC = null;
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:Vector.<TitanUltimateGeneratorCC> = Vector.<TitanUltimateGeneratorCC>(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 forms {
import mx.core.BitmapAsset;
[ExcludeClass]
[Embed(source="/_assets/forms.CloseOrBackButton_backButtonClass.png")]
public class CloseOrBackButton_backButtonClass extends BitmapAsset {
public function CloseOrBackButton_backButtonClass() {
super();
}
}
}
|
package alternativa.tanks.models.tank.armor.chassis.tracked {
import projects.tanks.client.battlefield.models.tankparts.armor.chassis.tracked.ITrackedChassisModelBase;
import projects.tanks.client.battlefield.models.tankparts.armor.chassis.tracked.TrackedChassisModelBase;
[ModelInfo]
public class TrackedChassisModel extends TrackedChassisModelBase implements ITrackedChassisModelBase, ITrackedChassis {
public function TrackedChassisModel() {
super();
}
public function getDamping() : Number {
return getInitParam().damping;
}
}
}
|
package _codec.projects.tanks.client.battlefield.models.ultimate.effects.titan.generator {
import alternativa.osgi.OSGi;
import alternativa.osgi.service.clientlog.IClientLog;
import alternativa.protocol.ICodec;
import alternativa.protocol.IProtocol;
import alternativa.protocol.ProtocolBuffer;
import alternativa.protocol.info.CollectionCodecInfo;
import alternativa.protocol.info.EnumCodecInfo;
import alternativa.protocol.info.TypeCodecInfo;
import alternativa.types.Float;
import alternativa.types.Long;
import platform.client.fp10.core.resource.types.MultiframeTextureResource;
import platform.client.fp10.core.resource.types.SoundResource;
import platform.client.fp10.core.resource.types.TextureResource;
import projects.tanks.client.battlefield.models.ultimate.effects.titan.generator.TitanUltimateGeneratorCC;
import projects.tanks.client.battleservice.model.battle.team.BattleTeam;
import projects.tanks.clients.flash.resources.resource.Tanks3DSResource;
public class CodecTitanUltimateGeneratorCC implements ICodec {
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
private var codec_blueCell:ICodec;
private var codec_blueRay:ICodec;
private var codec_blueRayTip:ICodec;
private var codec_blueSimpleShield:ICodec;
private var codec_blueSphere:ICodec;
private var codec_cell:ICodec;
private var codec_coveredTanksIds:ICodec;
private var codec_generatorActivationSound:ICodec;
private var codec_generatorDeactivationSound:ICodec;
private var codec_generatorLoopSound:ICodec;
private var codec_generatorTeam:ICodec;
private var codec_geosphere:ICodec;
private var codec_ray:ICodec;
private var codec_rayTip:ICodec;
private var codec_redCell:ICodec;
private var codec_redRay:ICodec;
private var codec_redRayTip:ICodec;
private var codec_redSimpleShield:ICodec;
private var codec_redSphere:ICodec;
private var codec_shieldOffSound:ICodec;
private var codec_shieldOnSound:ICodec;
private var codec_simpleShield:ICodec;
private var codec_sphere:ICodec;
private var codec_zoneRadiusFakeReducing:ICodec;
public function CodecTitanUltimateGeneratorCC() {
super();
}
public function init(param1:IProtocol) : void {
this.codec_blueCell = param1.getCodec(new TypeCodecInfo(TextureResource,true));
this.codec_blueRay = param1.getCodec(new TypeCodecInfo(TextureResource,false));
this.codec_blueRayTip = param1.getCodec(new TypeCodecInfo(TextureResource,false));
this.codec_blueSimpleShield = param1.getCodec(new TypeCodecInfo(TextureResource,true));
this.codec_blueSphere = param1.getCodec(new TypeCodecInfo(MultiframeTextureResource,false));
this.codec_cell = param1.getCodec(new TypeCodecInfo(TextureResource,true));
this.codec_coveredTanksIds = param1.getCodec(new CollectionCodecInfo(new TypeCodecInfo(Long,false),false,1));
this.codec_generatorActivationSound = param1.getCodec(new TypeCodecInfo(SoundResource,false));
this.codec_generatorDeactivationSound = param1.getCodec(new TypeCodecInfo(SoundResource,false));
this.codec_generatorLoopSound = param1.getCodec(new TypeCodecInfo(SoundResource,false));
this.codec_generatorTeam = param1.getCodec(new EnumCodecInfo(BattleTeam,false));
this.codec_geosphere = param1.getCodec(new TypeCodecInfo(Tanks3DSResource,true));
this.codec_ray = param1.getCodec(new TypeCodecInfo(TextureResource,false));
this.codec_rayTip = param1.getCodec(new TypeCodecInfo(TextureResource,false));
this.codec_redCell = param1.getCodec(new TypeCodecInfo(TextureResource,true));
this.codec_redRay = param1.getCodec(new TypeCodecInfo(TextureResource,false));
this.codec_redRayTip = param1.getCodec(new TypeCodecInfo(TextureResource,false));
this.codec_redSimpleShield = param1.getCodec(new TypeCodecInfo(TextureResource,true));
this.codec_redSphere = param1.getCodec(new TypeCodecInfo(MultiframeTextureResource,false));
this.codec_shieldOffSound = param1.getCodec(new TypeCodecInfo(SoundResource,false));
this.codec_shieldOnSound = param1.getCodec(new TypeCodecInfo(SoundResource,false));
this.codec_simpleShield = param1.getCodec(new TypeCodecInfo(TextureResource,true));
this.codec_sphere = param1.getCodec(new TypeCodecInfo(MultiframeTextureResource,false));
this.codec_zoneRadiusFakeReducing = param1.getCodec(new TypeCodecInfo(Float,false));
}
public function decode(param1:ProtocolBuffer) : Object {
var local2:TitanUltimateGeneratorCC = new TitanUltimateGeneratorCC();
local2.blueCell = this.codec_blueCell.decode(param1) as TextureResource;
local2.blueRay = this.codec_blueRay.decode(param1) as TextureResource;
local2.blueRayTip = this.codec_blueRayTip.decode(param1) as TextureResource;
local2.blueSimpleShield = this.codec_blueSimpleShield.decode(param1) as TextureResource;
local2.blueSphere = this.codec_blueSphere.decode(param1) as MultiframeTextureResource;
local2.cell = this.codec_cell.decode(param1) as TextureResource;
local2.coveredTanksIds = this.codec_coveredTanksIds.decode(param1) as Vector.<Long>;
local2.generatorActivationSound = this.codec_generatorActivationSound.decode(param1) as SoundResource;
local2.generatorDeactivationSound = this.codec_generatorDeactivationSound.decode(param1) as SoundResource;
local2.generatorLoopSound = this.codec_generatorLoopSound.decode(param1) as SoundResource;
local2.generatorTeam = this.codec_generatorTeam.decode(param1) as BattleTeam;
local2.geosphere = this.codec_geosphere.decode(param1) as Tanks3DSResource;
local2.ray = this.codec_ray.decode(param1) as TextureResource;
local2.rayTip = this.codec_rayTip.decode(param1) as TextureResource;
local2.redCell = this.codec_redCell.decode(param1) as TextureResource;
local2.redRay = this.codec_redRay.decode(param1) as TextureResource;
local2.redRayTip = this.codec_redRayTip.decode(param1) as TextureResource;
local2.redSimpleShield = this.codec_redSimpleShield.decode(param1) as TextureResource;
local2.redSphere = this.codec_redSphere.decode(param1) as MultiframeTextureResource;
local2.shieldOffSound = this.codec_shieldOffSound.decode(param1) as SoundResource;
local2.shieldOnSound = this.codec_shieldOnSound.decode(param1) as SoundResource;
local2.simpleShield = this.codec_simpleShield.decode(param1) as TextureResource;
local2.sphere = this.codec_sphere.decode(param1) as MultiframeTextureResource;
local2.zoneRadiusFakeReducing = this.codec_zoneRadiusFakeReducing.decode(param1) as Number;
return local2;
}
public function encode(param1:ProtocolBuffer, param2:Object) : void {
if(param2 == null) {
throw new Error("Object is null. Use @ProtocolOptional annotation.");
}
var local3:TitanUltimateGeneratorCC = TitanUltimateGeneratorCC(param2);
this.codec_blueCell.encode(param1,local3.blueCell);
this.codec_blueRay.encode(param1,local3.blueRay);
this.codec_blueRayTip.encode(param1,local3.blueRayTip);
this.codec_blueSimpleShield.encode(param1,local3.blueSimpleShield);
this.codec_blueSphere.encode(param1,local3.blueSphere);
this.codec_cell.encode(param1,local3.cell);
this.codec_coveredTanksIds.encode(param1,local3.coveredTanksIds);
this.codec_generatorActivationSound.encode(param1,local3.generatorActivationSound);
this.codec_generatorDeactivationSound.encode(param1,local3.generatorDeactivationSound);
this.codec_generatorLoopSound.encode(param1,local3.generatorLoopSound);
this.codec_generatorTeam.encode(param1,local3.generatorTeam);
this.codec_geosphere.encode(param1,local3.geosphere);
this.codec_ray.encode(param1,local3.ray);
this.codec_rayTip.encode(param1,local3.rayTip);
this.codec_redCell.encode(param1,local3.redCell);
this.codec_redRay.encode(param1,local3.redRay);
this.codec_redRayTip.encode(param1,local3.redRayTip);
this.codec_redSimpleShield.encode(param1,local3.redSimpleShield);
this.codec_redSphere.encode(param1,local3.redSphere);
this.codec_shieldOffSound.encode(param1,local3.shieldOffSound);
this.codec_shieldOnSound.encode(param1,local3.shieldOnSound);
this.codec_simpleShield.encode(param1,local3.simpleShield);
this.codec_sphere.encode(param1,local3.sphere);
this.codec_zoneRadiusFakeReducing.encode(param1,local3.zoneRadiusFakeReducing);
}
}
}
|
package alternativa.tanks.models.battle.battlefield {
public class CommonTargetEvaluatorConst {
public static const MAX_PRIORITY:Number = 1000;
public static const DISTANCE_WEIGHT:Number = 0.65;
public function CommonTargetEvaluatorConst() {
super();
}
}
}
|
package alternativa.tanks.gui.notinclan.clanslist {
import alternativa.osgi.service.locale.ILocaleService;
import alternativa.tanks.gui.clanmanagement.clanmemberlist.list.ClanMembersHeaderItem;
import alternativa.tanks.gui.notinclan.ClanListDialog;
import alternativa.tanks.gui.notinclan.dialogs.ClanDialog;
import base.DiscreteSprite;
import flash.text.TextFormatAlign;
import projects.tanks.clients.fp10.libraries.TanksLocale;
public class ClansListHeader extends DiscreteSprite {
[Inject]
public static var localeService:ILocaleService;
private static var HEADERS:Vector.<String>;
public static var tabs:Vector.<Number> = Vector.<Number>([0.25,0.1,0.25,0.18,0.22]);
private static var gap:Number = 2;
public function ClansListHeader() {
var local1:ClanMembersHeaderItem = null;
super();
HEADERS = Vector.<String>([localeService.getText(TanksLocale.TEXT_CLAN_USER_CLAN_NAME),localeService.getText(TanksLocale.TEXT_CLAN_USER_CLAN_TAG),localeService.getText(TanksLocale.TEXT_CLAN_FOUNDER),localeService.getText(TanksLocale.TEXT_CLAN_USER_CLAN_NUMBER_MEMBERS),localeService.getText(TanksLocale.TEXT_CLAN_USER_CREATION_DATE)]);
var local2:int = int(HEADERS.length);
var local3:int = 0;
while(local3 < local2) {
local1 = new ClanMembersHeaderItem(TextFormatAlign.LEFT);
local1.label = HEADERS[local3];
local1.height = 18;
local1.y = 1;
addChild(local1);
local3++;
}
this.resize(ClanListDialog.WIDTH - 2 * ClanDialog.MARGIN);
}
override public function set width(param1:Number) : void {
this.resize(param1);
}
protected function resize(param1:Number) : void {
var local2:ClanMembersHeaderItem = null;
var local3:int = int(HEADERS.length);
var local4:Number = gap - 1;
var local5:int = 0;
while(local5 < local3) {
local2 = getChildAt(local5) as ClanMembersHeaderItem;
local2.width = tabs[local5] * (param1 + 2 - gap * (tabs.length + 1));
local2.x = local4;
local2.y = 1;
if(local5 != local3 - 1) {
local4 += local2.width + gap;
}
local5++;
}
getChildAt(numChildren - 1).width = param1 + 3 - local4 - 2 * gap;
}
}
}
|
package alternativa.tanks.gui.itemslist {
import alternativa.tanks.model.garage.resistance.ResistancesIconsUtils;
import assets.Diamond;
import assets.icons.GarageItemBackground;
import assets.icons.IconGarageMod;
import assets.icons.InputCheckIcon;
import base.DiscreteSprite;
import controls.Money;
import controls.base.LabelBase;
import controls.labels.CountDownTimerLabel;
import controls.saleicons.SaleIcons;
import controls.timer.CountDownTimer;
import controls.timer.CountDownTimerOnCompleteBefore;
import fl.controls.LabelButton;
import fl.controls.ScrollBar;
import fl.controls.ScrollBarDirection;
import fl.controls.TileList;
import fl.data.DataProvider;
import fl.events.ListEvent;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.DisplayObject;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.geom.Rectangle;
import flash.system.Capabilities;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormatAlign;
import flash.utils.getTimer;
import forms.events.PartsListEvent;
import forms.premium.PremiumItemLock;
import forms.ranks.BigRankIcon;
import forms.ranks.RankIcon;
import forms.registration.CallsignIconStates;
import platform.client.fp10.core.resource.IResourceLoadingListener;
import platform.client.fp10.core.resource.Resource;
import platform.client.fp10.core.resource.types.ImageResource;
import platform.client.fp10.core.type.IGameObject;
import projects.tanks.client.commons.types.ItemCategoryEnum;
import projects.tanks.client.commons.types.ItemGarageProperty;
import projects.tanks.clients.fp10.libraries.tanksservices.utils.disposeBitmapsData;
import projects.tanks.clients.fp10.libraries.tanksservices.utils.removeDisplayObject;
import utils.ScrollStyleUtils;
public class PartsList extends Sprite implements IResourceLoadingListener, CountDownTimerOnCompleteBefore {
private static const labelRed:Bitmap = SaleIcons.createSaleRedLabelInstance();
private static const MIN_POSIBLE_SPEED:Number = 70;
private static const MAX_DELTA_FOR_SELECT:Number = 7;
private static const ADDITIONAL_SCROLL_AREA_HEIGHT:Number = 3;
private static const PREMIUM_ITEM_LOCK_X:int = 118;
private static const PREMIUM_ITEM_LOCK_Y:int = 58;
private var list:TileList;
private var dp:DataProvider;
private var typeSort:Array = [ItemCategoryEnum.WEAPON,ItemCategoryEnum.ARMOR,ItemCategoryEnum.PAINT,ItemCategoryEnum.PLUGIN,ItemCategoryEnum.INVENTORY,ItemCategoryEnum.KIT];
private var _selectedItem:IGameObject = null;
private var previousPositionX:Number;
private var currrentPositionX:Number;
private var sumDragWay:Number;
private var lastItemIndex:int;
private var previousTime:int;
private var currentTime:int;
private var scrollSpeed:Number = 0;
private var bitmapsData:Array;
private var _width:int;
private var _height:int;
public function PartsList() {
super();
this.bitmapsData = [];
this.dp = new DataProvider();
this.list = new TileList();
this.list.dataProvider = this.dp;
this.list.rowCount = 1;
this.list.rowHeight = 130;
this.list.columnWidth = 203;
this.list.setStyle("cellRenderer",PartsListRenderer);
this.list.direction = ScrollBarDirection.HORIZONTAL;
this.list.focusEnabled = false;
this.list.horizontalScrollBar.focusEnabled = false;
addChild(this.list);
addEventListener(Event.ADDED_TO_STAGE,this.addListners);
addEventListener(Event.REMOVED_FROM_STAGE,this.removeListners);
ScrollStyleUtils.setGreenStyle(this.list);
}
public function get selectedItem() : IGameObject {
return this._selectedItem;
}
override public function set width(param1:Number) : void {
this._width = Math.ceil(param1);
this.list.width = this._width;
}
override public function get width() : Number {
return this._width;
}
override public function set height(param1:Number) : void {
this._height = Math.ceil(param1);
this.list.height = this._height;
}
override public function get height() : Number {
return this._height;
}
public function get columnWidth() : int {
return Math.ceil(this.list.columnWidth);
}
private function updateScrollOnEnterFrame(param1:Event) : void {
var local4:Sprite = null;
var local5:Sprite = null;
var local2:ScrollBar = this.list.horizontalScrollBar;
var local3:int = 0;
while(local3 < local2.numChildren) {
local4 = Sprite(local2.getChildAt(local3));
if(local4.hitArea != null) {
local5 = local4.hitArea;
local5.graphics.clear();
} else {
local5 = new Sprite();
local5.mouseEnabled = false;
local4.hitArea = local5;
this.list.addChild(local5);
}
local5.graphics.beginFill(0,0);
if(local4 is LabelButton) {
local5.graphics.drawRect(local4.y - 14,local2.y - ADDITIONAL_SCROLL_AREA_HEIGHT,local4.height + 28,local4.width + ADDITIONAL_SCROLL_AREA_HEIGHT);
} else {
local5.graphics.drawRect(local4.y,local2.y - ADDITIONAL_SCROLL_AREA_HEIGHT,local4.height,local4.width + ADDITIONAL_SCROLL_AREA_HEIGHT);
}
local5.graphics.endFill();
local3++;
}
}
private function onMouseDown(param1:MouseEvent) : void {
this.scrollSpeed = 0;
var local2:Rectangle = this.list.horizontalScrollBar.getBounds(stage);
local2.top -= ADDITIONAL_SCROLL_AREA_HEIGHT;
if(!local2.contains(param1.stageX,param1.stageY)) {
this.sumDragWay = 0;
this.previousPositionX = this.currrentPositionX = param1.stageX;
this.currentTime = this.previousTime = getTimer();
this.lastItemIndex = this.list.selectedIndex;
stage.addEventListener(MouseEvent.MOUSE_UP,this.onMouseUp);
stage.addEventListener(MouseEvent.MOUSE_MOVE,this.onMouseMove);
}
}
private function onMouseMove(param1:MouseEvent) : void {
this.previousPositionX = this.currrentPositionX;
this.currrentPositionX = param1.stageX;
this.previousTime = this.currentTime;
this.currentTime = getTimer();
var local2:Number = this.currrentPositionX - this.previousPositionX;
this.sumDragWay += Math.abs(local2);
if(this.sumDragWay > MAX_DELTA_FOR_SELECT) {
this.list.horizontalScrollPosition -= local2;
}
param1.updateAfterEvent();
}
private function onMouseUp(param1:MouseEvent) : void {
stage.removeEventListener(MouseEvent.MOUSE_MOVE,this.onMouseMove);
stage.removeEventListener(MouseEvent.MOUSE_UP,this.onMouseUp);
var local2:Number = (getTimer() - this.previousTime) / 1000;
if(local2 == 0) {
local2 = 0.1;
}
var local3:Number = param1.stageX - this.previousPositionX;
this.scrollSpeed = local3 / local2;
this.previousTime = this.currentTime;
this.currentTime = getTimer();
addEventListener(Event.ENTER_FRAME,this.onEnterFrame);
}
private function onEnterFrame(param1:Event) : void {
this.previousTime = this.currentTime;
this.currentTime = getTimer();
var local2:Number = (this.currentTime - this.previousTime) / 1000;
this.list.horizontalScrollPosition -= this.scrollSpeed * local2;
var local3:Number = this.list.horizontalScrollPosition;
var local4:Number = this.list.maxHorizontalScrollPosition;
if(Math.abs(this.scrollSpeed) > MIN_POSIBLE_SPEED && 0 < local3 && local3 < local4) {
this.scrollSpeed *= Math.exp(-1.5 * local2);
} else {
this.scrollSpeed = 0;
removeEventListener(Event.ENTER_FRAME,this.onEnterFrame);
}
}
private function selectItem(param1:ListEvent) : void {
var local2:Object = null;
if(this.sumDragWay < MAX_DELTA_FOR_SELECT) {
local2 = param1.item;
this.scrollSpeed = 0;
if(this._selectedItem != local2.dat.id) {
this._selectedItem = local2.dat.id;
this.list.selectedItem = local2;
this.list.scrollToSelected();
dispatchEvent(new PartsListEvent(PartsListEvent.SELECT_PARTS_LIST_ITEM));
}
dispatchEvent(new PartsListEvent(PartsListEvent.ITEM_CLICK));
} else {
this.list.addEventListener(Event.CHANGE,this.onChangeItem);
}
}
private function onChangeItem(param1:Event) : void {
this.list.selectedIndex = this.lastItemIndex;
this.list.removeEventListener(Event.CHANGE,this.onChangeItem);
}
public function addItem(param1:IGameObject, param2:String, param3:ItemCategoryEnum, param4:int, param5:int, param6:int, param7:Boolean, param8:Boolean, param9:int, param10:ImageResource, param11:int = 0, param12:CountDownTimer = null, param13:int = -1, param14:CountDownTimer = null, param15:Vector.<ItemGarageProperty> = null, param16:Boolean = false) : void {
var local18:DisplayObject = null;
var local19:DisplayObject = null;
var local17:Object = {};
local17.id = param1;
local17.name = param2;
local17.type = param3;
local17.typeSort = this.typeSort[param3];
local17.mod = param13;
local17.crystalPrice = param5;
local17.rank = param6 == 0 && !param7 ? -1 : param6;
local17.showLockPremium = param7;
local17.installed = false;
local17.garageElement = param8;
local17.count = param9;
local17.preview = param10;
local17.sort = param4;
local17.discount = param11;
local17.timer = param12;
local17.timerDiscount = param14;
local17.resistances = param15;
local17.isUpgradingInAvailableItemsAlert = param16;
if(param12 != null && param16) {
local17.timer.addListener(CountDownTimerOnCompleteBefore,this);
}
local18 = this.myIcon(local17,false);
local19 = this.myIcon(local17,true);
this.dp.addItem({
"iconNormal":local18,
"iconSelected":local19,
"dat":local17,
"rank":local17.rank,
"type":param3,
"typesort":local17.typeSort,
"sort":param4
});
this.dp.sortOn(["rank","sort"],[Array.NUMERIC,Array.NUMERIC]);
}
private function update(param1:IGameObject, param2:String, param3:* = null, param4:Boolean = true) : void {
var local5:int = this.indexById(param1);
this.updateByIndex(local5,param2,param3,param4);
}
private function updateByIndex(param1:int, param2:String, param3:*, param4:Boolean) : void {
var local7:DisplayObject = null;
var local8:DisplayObject = null;
var local5:Object = this.dp.getItemAt(param1);
var local6:Object = local5.dat;
local6[param2] = param3;
if(param4) {
local7 = this.myIcon(local6,false);
local8 = this.myIcon(local6,true);
local5.dat = local6;
local5.iconNormal = local7;
local5.iconSelected = local8;
this.dp.replaceItemAt(local5,param1);
this.dp.sortOn(["rank","sort"],[Array.NUMERIC,Array.NUMERIC]);
this.dp.invalidateItemAt(param1);
}
}
public function mount(param1:IGameObject) : void {
this.update(param1,"installed",true);
}
public function unmount(param1:IGameObject) : void {
this.update(param1,"installed",false);
}
public function updateCount(param1:IGameObject, param2:int) : void {
this.update(param1,"count",param2);
}
public function updateDiscountWithTimer(param1:IGameObject, param2:int, param3:CountDownTimer) : void {
this.update(param1,"discount",param2,false);
this.update(param1,"timerDiscount",param3);
}
public function updateDiscountAndCost(param1:IGameObject, param2:int, param3:CountDownTimer, param4:int) : void {
this.update(param1,"discount",param2,false);
this.update(param1,"timerDiscount",param3,false);
this.updateCost(param1,param4);
}
public function updatePreview(param1:ImageResource) : void {
var local2:Object = null;
var local3:int = 0;
while(local3 < this.dp.length) {
local2 = this.dp.getItemAt(local3);
if((local2.dat.preview as ImageResource).id == param1.id) {
this.update(local2.dat.id,"preview",param1 as ImageResource);
}
local3++;
}
}
public function deleteItem(param1:IGameObject) : void {
var local2:int = this.indexById(param1);
var local3:Object = this.dp.getItemAt(local2);
if(this.list.selectedIndex == local2) {
this._selectedItem = null;
this.list.selectedItem = null;
}
this.dp.removeItem(local3);
}
public function select(param1:IGameObject) : void {
var local2:int = 0;
this.scrollSpeed = 0;
if(this._selectedItem != param1) {
local2 = this.indexById(param1);
this.list.selectedIndex = local2;
this._selectedItem = param1;
dispatchEvent(new PartsListEvent(PartsListEvent.SELECT_PARTS_LIST_ITEM));
}
}
public function selectByIndex(param1:uint) : void {
var local2:Object = null;
this.scrollSpeed = 0;
if(this.list.selectedIndex != param1) {
local2 = (this.dp.getItemAt(param1) as Object).dat;
this.list.selectedIndex = param1;
this._selectedItem = local2.id;
dispatchEvent(new PartsListEvent(PartsListEvent.SELECT_PARTS_LIST_ITEM));
}
}
public function scrollTo(param1:IGameObject) : void {
this.scrollSpeed = 0;
var local2:int = this.indexById(param1);
this.list.scrollToIndex(local2);
}
public function unselect() : void {
this._selectedItem = null;
this.list.selectedItem = null;
}
private function myIcon(param1:Object, param2:Boolean) : DisplayObject {
var local5:BitmapData = null;
var local9:GarageItemBackground = null;
var local10:String = null;
var local14:Bitmap = null;
var local15:IconGarageMod = null;
var local16:CountDownTimer = null;
var local17:CountDownTimerLabel = null;
var local3:Sprite = new DiscreteSprite();
var local4:Sprite = new DiscreteSprite();
var local6:LabelBase = new LabelBase();
var local7:LabelBase = new LabelBase();
var local8:LabelBase = new LabelBase();
var local11:Diamond = new Diamond();
var local12:InputCheckIcon = new InputCheckIcon();
if((param1.preview as ImageResource).data == null) {
local4.addChild(local12);
local12.gotoAndStop(CallsignIconStates.CALLSIGN_ICON_STATE_PROGRESS);
local12.x = 200 - local12.width >> 1;
local12.y = 130 - local12.height >> 1;
(param1.preview as ImageResource).addLazyListener(this);
} else {
local14 = new Bitmap((param1.preview as ImageResource).data);
if(param1.resistances != null) {
local14.x = 200 - local14.width >> 1;
local14.y = 14 + (130 - local14.height) >> 1;
local4.addChild(local14);
ResistancesIconsUtils.addResistanceIcons(local14,Vector.<ItemGarageProperty>(param1.resistances));
} else {
local14.x = 19;
local14.y = 18;
local4.addChild(local14);
}
}
if(param1.rank > 0 || Boolean(param1.showLockPremium)) {
if(param1.type != ItemCategoryEnum.PLUGIN) {
this.addLockItem(param1,local4);
}
local10 = "OFF";
param1.installed = false;
local8.color = local7.color = local6.color = 12632256;
} else {
local8.color = local7.color = local6.color = 5898034;
if(Boolean(param1.garageElement) && param1.mod != -1) {
local15 = new IconGarageMod(param1.mod);
local4.addChild(local15);
local15.x = 159;
local15.y = 7;
}
switch(param1.type) {
case ItemCategoryEnum.WEAPON:
if(Boolean(param1.garageElement) && Boolean(param1.installed)) {
local6.color = 8693863;
}
local10 = "GUN";
break;
case ItemCategoryEnum.ARMOR:
if(Boolean(param1.garageElement) && Boolean(param1.installed)) {
local6.color = 9411748;
}
local10 = "SHIELD";
break;
case ItemCategoryEnum.PAINT:
local10 = "COLOR";
if(Boolean(param1.installed)) {
local6.color = 11049390;
}
break;
case ItemCategoryEnum.INVENTORY:
local10 = "ENGINE";
param1.installed = false;
local4.addChild(local8);
local8.x = 15;
local8.y = 100;
local8.autoSize = TextFieldAutoSize.NONE;
local8.size = 16;
local8.align = TextFormatAlign.LEFT;
local8.width = 100;
local8.height = 25;
local8.text = param1.count == 0 ? " " : "×" + String(param1.count);
break;
default:
local10 = "PLUGIN";
}
}
local10 += (Boolean(param1.installed) ? "_INSTALLED" : "_NORMAL") + (param2 ? "_SELECTED" : "");
local9 = new GarageItemBackground(GarageItemBackground.idByName(local10));
local6.text = param1.name;
if(!param1.garageElement || param1.type == ItemCategoryEnum.INVENTORY) {
if(param1.crystalPrice > 0) {
local7.text = Money.numToString(param1.crystalPrice,false);
local7.x = 181 - local7.textWidth;
local7.y = 2;
local4.addChild(local11);
local4.addChild(local7);
local11.x = 186;
local11.y = 6;
}
}
local6.y = 2;
local6.x = 3;
local4.addChildAt(local9,0);
local4.addChild(local6);
var local13:LabelBase = new LabelBase();
if(param1.discount > 0 && (param1.rank <= 0 || param1.garageElement)) {
labelRed.y = local9.height - labelRed.height - 8;
labelRed.x = local9.width - labelRed.width - 2;
local4.addChild(labelRed);
local13.color = 16777215;
local13.align = TextFormatAlign.CENTER;
local13.text = "-" + String(param1.discount) + "%";
local13.size = 13;
local13.x = int(labelRed.x + labelRed.width / 2 - local13.textWidth / 2);
local13.y = labelRed.y + 6;
local4.addChild(local13);
if(param1.timerDiscount != null) {
local16 = param1.timerDiscount;
if(local16.getEndTime() > getTimer()) {
local17 = new CountDownTimerLabel();
local17.color = 15258050;
local17.start(param1.timerDiscount);
local17.y = labelRed.y + 18;
local17.autoSize = TextFieldAutoSize.NONE;
local17.align = TextFormatAlign.CENTER;
local17.width = labelRed.width - 8;
local17.x = int(labelRed.x + labelRed.width / 2 - local17.width / 2);
local3.addChild(local17);
} else {
param1.timerDiscount = null;
local13.y += 5;
}
} else {
local13.y += 5;
}
}
local5 = new BitmapData(local4.width,local4.height,true,0);
this.bitmapsData.push(local5);
local5.draw(local4);
local3.addChildAt(new Bitmap(local5),0);
if(param1.timer != null) {
if(Boolean(param1.isUpgradingInAvailableItemsAlert)) {
local17 = new CountDownTimerLabel();
local17.start(param1.timer);
local17.y = local9.height - local17.textHeight - 7;
local17.width = local9.width - 7;
local17.autoSize = TextFieldAutoSize.NONE;
local17.align = TextFormatAlign.RIGHT;
local17.x = 0;
local3.addChild(local17);
}
}
return local3;
}
private function addLockItem(param1:Object, param2:Sprite) : void {
if(param1.rank > 0) {
param2.addChild(this.createRankIcon(param1));
} else {
param2.addChild(this.createPremiumIcon());
}
}
private function createRankIcon(param1:Object) : RankIcon {
var local2:RankIcon = new BigRankIcon();
if(Boolean(param1.showLockPremium)) {
local2.setPremium(param1.rank);
local2.x = PREMIUM_ITEM_LOCK_X;
local2.y = PREMIUM_ITEM_LOCK_Y;
} else {
local2.setDefaultAccount(param1.rank);
local2.x = 135;
local2.y = 65;
}
return local2;
}
private function createPremiumIcon() : Bitmap {
var local1:Bitmap = PremiumItemLock.createInstance();
local1.x = PREMIUM_ITEM_LOCK_X;
local1.y = PREMIUM_ITEM_LOCK_Y;
return local1;
}
public function indexById(param1:IGameObject) : int {
var local2:Object = null;
var local3:int = 0;
while(local3 < this.dp.length) {
local2 = this.dp.getItemAt(local3);
if(local2.dat.id == param1) {
return local3;
}
local3++;
}
return -1;
}
public function updateCost(param1:IGameObject, param2:int) : void {
this.update(param1,"crystalPrice",param2);
}
public function updateShowLockPremium(param1:IGameObject, param2:Boolean) : void {
this.update(param1,"showLockPremium",param2);
}
public function removeDiscountItem(param1:IGameObject) : void {
this.update(param1,"saleImage",null);
}
public function getItemAt(param1:int) : IGameObject {
return this.dp.getItemAt(param1).dat.id;
}
public function itemsCount() : int {
return this.dp.length;
}
private function scrollList(param1:MouseEvent) : void {
this.scrollSpeed = 0;
this.list.horizontalScrollPosition -= param1.delta * (Boolean(Capabilities.os.search("Linux") != -1) ? 50 : 10);
}
public function onResourceLoadingComplete(param1:Resource) : void {
this.updatePreview(param1 as ImageResource);
}
private function addListners(param1:Event) : void {
this.list.horizontalScrollBar.addEventListener(Event.ENTER_FRAME,this.updateScrollOnEnterFrame);
this.list.addEventListener(ListEvent.ITEM_CLICK,this.selectItem);
addEventListener(MouseEvent.MOUSE_WHEEL,this.scrollList);
addEventListener(MouseEvent.MOUSE_DOWN,this.onMouseDown);
}
private function removeListners(param1:Event) : void {
this.list.horizontalScrollBar.removeEventListener(Event.ENTER_FRAME,this.updateScrollOnEnterFrame);
this.list.removeEventListener(ListEvent.ITEM_CLICK,this.selectItem);
removeEventListener(Event.ENTER_FRAME,this.onEnterFrame);
removeEventListener(MouseEvent.MOUSE_WHEEL,this.scrollList);
removeEventListener(MouseEvent.MOUSE_DOWN,this.onMouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP,this.onMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE,this.onMouseMove);
}
public function onResourceLoadingError(param1:Resource, param2:String) : void {
}
public function onResourceLoadingFatalError(param1:Resource, param2:String) : void {
}
public function onResourceLoadingProgress(param1:Resource, param2:int) : void {
}
public function onResourceLoadingStart(param1:Resource) : void {
}
public function onCompleteBefore(param1:CountDownTimer, param2:Boolean) : void {
var local4:Object = null;
var local3:int = 0;
while(local3 < this.dp.length) {
local4 = this.dp.getItemAt(local3).dat;
if(local4.timer == param1) {
this.updateByIndex(local3,"timer",null,false);
}
local3++;
}
}
public function destroy() : void {
disposeBitmapsData(this.bitmapsData);
this.bitmapsData = null;
removeDisplayObject(this.list);
this.removePreviewLazyListeners();
this.removeAllElements();
this.list.removeAll();
this.list = null;
this.dp = null;
}
private function removeAllElements() : void {
var local2:Object = null;
var local3:CountDownTimer = null;
var local1:int = 0;
while(local1 < this.dp.length) {
local2 = this.dp.getItemAt(local1).dat;
if(local2.timer != null) {
local3 = local2.timer;
local3.removeListener(CountDownTimerOnCompleteBefore,this);
}
local1++;
}
this.dp.removeAll();
}
private function removePreviewLazyListeners() : void {
var local1:Object = null;
var local2:ImageResource = null;
var local3:int = 0;
while(local3 < this.dp.length) {
local1 = this.dp.getItemAt(local3);
local2 = local1.dat.preview as ImageResource;
local2.removeLazyListener(this);
local3++;
}
}
}
}
|
package alternativa.tanks.gui.shop.shopitems.item.details {
import alternativa.tanks.gui.shop.components.item.GridItemBase;
import platform.client.fp10.core.type.IGameObject;
public class ShopItemDetails extends GridItemBase {
protected var shopItemObject:IGameObject;
public function ShopItemDetails(param1:IGameObject) {
super();
this.shopItemObject = param1;
mouseEnabled = false;
}
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.