Last active
December 26, 2020 18:28
-
-
Save saqada/895b9dc5d026dfb06a87c52c2523fed7 to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($hx_exports, $global) { "use strict"; var $hx_script = (function (exports, global) { // Generated by Haxe 3.4.7 | |
(function ($hx_exports, $global) { "use strict"; | |
$hx_exports["epicwar"] = $hx_exports["epicwar"] || {}; | |
$hx_exports["epicwar"]["haxe"] = $hx_exports["epicwar"]["haxe"] || {}; | |
$hx_exports["epicwar"]["haxe"]["battle"] = $hx_exports["epicwar"]["haxe"]["battle"] || {}; | |
$hx_exports["epicwar"]["haxe"]["battle"]["result"] = $hx_exports["epicwar"]["haxe"]["battle"]["result"] || {}; | |
;$hx_exports["epicwar"]["haxe"]["battle"]["configs"] = $hx_exports["epicwar"]["haxe"]["battle"]["configs"] || {}; | |
$hx_exports["lime"] = $hx_exports["lime"] || {}; | |
var $hxClasses = {},$estr = function() { return js_Boot.__string_rec(this,''); }; | |
function $extend(from, fields) { | |
function Inherit() {} Inherit.prototype = from; var proto = new Inherit(); | |
for (var name in fields) proto[name] = fields[name]; | |
if( fields.toString !== Object.prototype.toString ) proto.toString = fields.toString; | |
return proto; | |
} | |
var lime_app_IModule = function() { }; | |
$hxClasses["lime.app.IModule"] = lime_app_IModule; | |
lime_app_IModule.__name__ = ["lime","app","IModule"]; | |
lime_app_IModule.prototype = { | |
__registerLimeModule: null | |
,__unregisterLimeModule: null | |
,__class__: lime_app_IModule | |
}; | |
var lime_app_Module = function() { | |
this.onExit = new lime_app__$Event_$Int_$Void(); | |
}; | |
$hxClasses["lime.app.Module"] = lime_app_Module; | |
lime_app_Module.__name__ = ["lime","app","Module"]; | |
lime_app_Module.__interfaces__ = [lime_app_IModule]; | |
lime_app_Module.prototype = { | |
onExit: null | |
,__registerLimeModule: function(application) { | |
} | |
,__unregisterLimeModule: function(application) { | |
} | |
,__class__: lime_app_Module | |
}; | |
var lime__$internal_backend_html5_HTML5Application = function(parent) { | |
this.gameDeviceCache = new haxe_ds_IntMap(); | |
this.parent = parent; | |
this.currentUpdate = 0; | |
this.lastUpdate = 0; | |
this.nextUpdate = 0; | |
this.framePeriod = -1; | |
lime_media_AudioManager.init(); | |
this.accelerometer = lime_system_Sensor.registerSensor(lime_system_SensorType.ACCELEROMETER,0); | |
}; | |
$hxClasses["lime._internal.backend.html5.HTML5Application"] = lime__$internal_backend_html5_HTML5Application; | |
lime__$internal_backend_html5_HTML5Application.__name__ = ["lime","_internal","backend","html5","HTML5Application"]; | |
lime__$internal_backend_html5_HTML5Application.prototype = { | |
gameDeviceCache: null | |
,accelerometer: null | |
,currentUpdate: null | |
,deltaTime: null | |
,framePeriod: null | |
,lastUpdate: null | |
,nextUpdate: null | |
,parent: null | |
,convertKeyCode: function(keyCode) { | |
if(keyCode >= 65 && keyCode <= 90) { | |
return keyCode + 32; | |
} | |
switch(keyCode) { | |
case 12: | |
return 1073741980; | |
case 16: | |
return 1073742049; | |
case 17: | |
return 1073742048; | |
case 18: | |
return 1073742050; | |
case 19: | |
return 1073741896; | |
case 20: | |
return 1073741881; | |
case 33: | |
return 1073741899; | |
case 34: | |
return 1073741902; | |
case 35: | |
return 1073741901; | |
case 36: | |
return 1073741898; | |
case 37: | |
return 1073741904; | |
case 38: | |
return 1073741906; | |
case 39: | |
return 1073741903; | |
case 40: | |
return 1073741905; | |
case 41: | |
return 1073741943; | |
case 43: | |
return 1073741940; | |
case 44: | |
return 1073741894; | |
case 45: | |
return 1073741897; | |
case 46: | |
return 127; | |
case 91: | |
return 1073742051; | |
case 92: | |
return 1073742055; | |
case 93: | |
return 1073742055; | |
case 95: | |
return 1073742106; | |
case 96: | |
return 1073741922; | |
case 97: | |
return 1073741913; | |
case 98: | |
return 1073741914; | |
case 99: | |
return 1073741915; | |
case 100: | |
return 1073741916; | |
case 101: | |
return 1073741917; | |
case 102: | |
return 1073741918; | |
case 103: | |
return 1073741919; | |
case 104: | |
return 1073741920; | |
case 105: | |
return 1073741921; | |
case 106: | |
return 1073741909; | |
case 107: | |
return 1073741911; | |
case 108: | |
return 1073741923; | |
case 109: | |
return 1073741910; | |
case 110: | |
return 1073741923; | |
case 111: | |
return 1073741908; | |
case 112: | |
return 1073741882; | |
case 113: | |
return 1073741883; | |
case 114: | |
return 1073741884; | |
case 115: | |
return 1073741885; | |
case 116: | |
return 1073741886; | |
case 117: | |
return 1073741887; | |
case 118: | |
return 1073741888; | |
case 119: | |
return 1073741889; | |
case 120: | |
return 1073741890; | |
case 121: | |
return 1073741891; | |
case 122: | |
return 1073741892; | |
case 123: | |
return 1073741893; | |
case 124: | |
return 1073741928; | |
case 125: | |
return 1073741929; | |
case 126: | |
return 1073741930; | |
case 127: | |
return 1073741931; | |
case 128: | |
return 1073741932; | |
case 129: | |
return 1073741933; | |
case 130: | |
return 1073741934; | |
case 131: | |
return 1073741935; | |
case 132: | |
return 1073741936; | |
case 133: | |
return 1073741937; | |
case 134: | |
return 1073741938; | |
case 135: | |
return 1073741939; | |
case 144: | |
return 1073741907; | |
case 145: | |
return 1073741895; | |
case 160: | |
return 94; | |
case 161: | |
return 33; | |
case 163: | |
return 35; | |
case 164: | |
return 36; | |
case 166: | |
return 1073742094; | |
case 167: | |
return 1073742095; | |
case 168: | |
return 1073742097; | |
case 169: | |
return 41; | |
case 170: | |
return 42; | |
case 171: | |
return 96; | |
case 172: | |
return 1073741898; | |
case 173: | |
return 45; | |
case 174: | |
return 1073741953; | |
case 175: | |
return 1073741952; | |
case 176: | |
return 1073742082; | |
case 177: | |
return 1073742083; | |
case 178: | |
return 1073742084; | |
case 179: | |
return 1073742085; | |
case 180: | |
return 1073742089; | |
case 181: | |
return 1073742086; | |
case 182: | |
return 1073741953; | |
case 183: | |
return 1073741952; | |
case 186: | |
return 59; | |
case 187: | |
return 61; | |
case 188: | |
return 44; | |
case 189: | |
return 45; | |
case 190: | |
return 46; | |
case 191: | |
return 47; | |
case 192: | |
return 96; | |
case 193: | |
return 63; | |
case 194: | |
return 1073741923; | |
case 219: | |
return 91; | |
case 220: | |
return 92; | |
case 221: | |
return 93; | |
case 222: | |
return 39; | |
case 223: | |
return 96; | |
case 224: | |
return 1073742051; | |
case 226: | |
return 92; | |
} | |
return keyCode; | |
} | |
,exec: function() { | |
window.addEventListener("keydown",$bind(this,this.handleKeyEvent),false); | |
window.addEventListener("keyup",$bind(this,this.handleKeyEvent),false); | |
window.addEventListener("focus",$bind(this,this.handleWindowEvent),false); | |
window.addEventListener("blur",$bind(this,this.handleWindowEvent),false); | |
window.addEventListener("resize",$bind(this,this.handleWindowEvent),false); | |
window.addEventListener("beforeunload",$bind(this,this.handleWindowEvent),false); | |
window.addEventListener("devicemotion",$bind(this,this.handleSensorEvent),false); | |
if (!CanvasRenderingContext2D.prototype.isPointInStroke) { | |
CanvasRenderingContext2D.prototype.isPointInStroke = function (path, x, y) { | |
return false; | |
}; | |
} | |
if (!CanvasRenderingContext2D.prototype.isPointInPath) { | |
CanvasRenderingContext2D.prototype.isPointInPath = function (path, x, y) { | |
return false; | |
}; | |
} | |
if ('performance' in window == false) { | |
window.performance = {}; | |
} | |
if ('now' in window.performance == false) { | |
var offset = Date.now(); | |
if (performance.timing && performance.timing.navigationStart) { | |
offset = performance.timing.navigationStart | |
} | |
window.performance.now = function now() { | |
return Date.now() - offset; | |
} | |
} | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; | |
for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { | |
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; | |
window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame']; | |
} | |
if (!window.requestAnimationFrame) | |
window.requestAnimationFrame = function(callback, element) { | |
var currTime = new Date().getTime(); | |
var timeToCall = Math.max(0, 16 - (currTime - lastTime)); | |
var id = window.setTimeout(function() { callback(currTime + timeToCall); }, | |
timeToCall); | |
lastTime = currTime + timeToCall; | |
return id; | |
}; | |
if (!window.cancelAnimationFrame) | |
window.cancelAnimationFrame = function(id) { | |
clearTimeout(id); | |
}; | |
window.requestAnimFrame = window.requestAnimationFrame; | |
; | |
this.lastUpdate = new Date().getTime(); | |
this.handleApplicationEvent(); | |
return 0; | |
} | |
,exit: function() { | |
} | |
,handleApplicationEvent: function(__) { | |
var _g = 0; | |
var _g1 = this.parent.__windows; | |
while(_g < _g1.length) { | |
var $window = _g1[_g]; | |
++_g; | |
$window.__backend.updateSize(); | |
} | |
this.updateGameDevices(); | |
this.currentUpdate = new Date().getTime(); | |
if(this.currentUpdate >= this.nextUpdate) { | |
this.deltaTime = this.currentUpdate - this.lastUpdate; | |
var _g2 = 0; | |
var _g11 = this.parent.__windows; | |
while(_g2 < _g11.length) { | |
var window1 = _g11[_g2]; | |
++_g2; | |
this.parent.onUpdate.dispatch(this.deltaTime | 0); | |
if(window1.context != null) { | |
window1.onRender.dispatch(window1.context); | |
} | |
} | |
if(this.framePeriod < 0) { | |
this.nextUpdate = this.currentUpdate; | |
} else { | |
this.nextUpdate = this.currentUpdate - this.currentUpdate % this.framePeriod + this.framePeriod; | |
} | |
this.lastUpdate = this.currentUpdate; | |
} | |
window.requestAnimationFrame($bind(this,this.handleApplicationEvent)); | |
} | |
,handleKeyEvent: function(event) { | |
if(this.parent.__window != null) { | |
var keyCode = this.convertKeyCode(event.keyCode != null ? event.keyCode : event.which); | |
var modifier = (event.shiftKey ? 3 : 0) | (event.ctrlKey ? 192 : 0) | (event.altKey ? 768 : 0) | (event.metaKey ? 3072 : 0); | |
if(event.type == "keydown") { | |
this.parent.__window.onKeyDown.dispatch(keyCode,modifier); | |
if(this.parent.__window.onKeyDown.canceled && event.cancelable) { | |
event.preventDefault(); | |
} | |
} else { | |
this.parent.__window.onKeyUp.dispatch(keyCode,modifier); | |
if(this.parent.__window.onKeyUp.canceled && event.cancelable) { | |
event.preventDefault(); | |
} | |
} | |
} | |
} | |
,handleSensorEvent: function(event) { | |
this.accelerometer.onUpdate.dispatch(event.accelerationIncludingGravity.x,event.accelerationIncludingGravity.y,event.accelerationIncludingGravity.z); | |
} | |
,handleWindowEvent: function(event) { | |
if(this.parent.__window != null) { | |
var _g = event.type; | |
switch(_g) { | |
case "beforeunload": | |
break; | |
case "blur": | |
this.parent.__window.onFocusOut.dispatch(); | |
this.parent.__window.onDeactivate.dispatch(); | |
break; | |
case "focus": | |
this.parent.__window.onFocusIn.dispatch(); | |
this.parent.__window.onActivate.dispatch(); | |
break; | |
case "resize": | |
this.parent.__window.__backend.handleResizeEvent(event); | |
break; | |
} | |
} | |
} | |
,updateGameDevices: function() { | |
var devices = lime_ui_Joystick.__getDeviceData(); | |
if(devices == null) { | |
return; | |
} | |
var id; | |
var gamepad; | |
var joystick; | |
var data; | |
var cache; | |
var _g1 = 0; | |
var _g = devices.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
id = i; | |
data = devices[id]; | |
if(data == null) { | |
continue; | |
} | |
if(!this.gameDeviceCache.h.hasOwnProperty(id)) { | |
cache = new lime__$internal_backend_html5_GameDeviceData(); | |
cache.id = id; | |
cache.connected = data.connected; | |
var _g3 = 0; | |
var _g2 = data.buttons.length; | |
while(_g3 < _g2) { | |
var i1 = _g3++; | |
cache.buttons.push(data.buttons[i1].value); | |
} | |
var _g31 = 0; | |
var _g21 = data.axes.length; | |
while(_g31 < _g21) { | |
var i2 = _g31++; | |
cache.axes.push(data.axes[i2]); | |
} | |
if(data.mapping == "standard") { | |
cache.isGamepad = true; | |
} | |
this.gameDeviceCache.h[id] = cache; | |
if(data.connected) { | |
lime_ui_Joystick.__connect(id); | |
if(cache.isGamepad) { | |
lime_ui_Gamepad.__connect(id); | |
} | |
} | |
} | |
cache = this.gameDeviceCache.h[id]; | |
joystick = lime_ui_Joystick.devices.h[id]; | |
gamepad = lime_ui_Gamepad.devices.h[id]; | |
if(data.connected) { | |
var button; | |
var value; | |
var _g32 = 0; | |
var _g22 = data.buttons.length; | |
while(_g32 < _g22) { | |
var i3 = _g32++; | |
value = data.buttons[i3].value; | |
if(value != cache.buttons[i3]) { | |
if(i3 == 6) { | |
joystick.onAxisMove.dispatch(data.axes.length,value); | |
if(gamepad != null) { | |
gamepad.onAxisMove.dispatch(4,value); | |
} | |
} else if(i3 == 7) { | |
joystick.onAxisMove.dispatch(data.axes.length + 1,value); | |
if(gamepad != null) { | |
gamepad.onAxisMove.dispatch(5,value); | |
} | |
} else { | |
if(value > 0) { | |
joystick.onButtonDown.dispatch(i3); | |
} else { | |
joystick.onButtonUp.dispatch(i3); | |
} | |
if(gamepad != null) { | |
switch(i3) { | |
case 0: | |
button = 0; | |
break; | |
case 1: | |
button = 1; | |
break; | |
case 2: | |
button = 2; | |
break; | |
case 3: | |
button = 3; | |
break; | |
case 4: | |
button = 9; | |
break; | |
case 5: | |
button = 10; | |
break; | |
case 8: | |
button = 4; | |
break; | |
case 9: | |
button = 6; | |
break; | |
case 10: | |
button = 7; | |
break; | |
case 11: | |
button = 8; | |
break; | |
case 12: | |
button = 11; | |
break; | |
case 13: | |
button = 12; | |
break; | |
case 14: | |
button = 13; | |
break; | |
case 15: | |
button = 14; | |
break; | |
case 16: | |
button = 5; | |
break; | |
default: | |
continue; | |
} | |
if(value > 0) { | |
gamepad.onButtonDown.dispatch(button); | |
} else { | |
gamepad.onButtonUp.dispatch(button); | |
} | |
} | |
} | |
cache.buttons[i3] = value; | |
} | |
} | |
var _g33 = 0; | |
var _g23 = data.axes.length; | |
while(_g33 < _g23) { | |
var i4 = _g33++; | |
if(data.axes[i4] != cache.axes[i4]) { | |
joystick.onAxisMove.dispatch(i4,data.axes[i4]); | |
if(gamepad != null) { | |
gamepad.onAxisMove.dispatch(i4,data.axes[i4]); | |
} | |
cache.axes[i4] = data.axes[i4]; | |
} | |
} | |
} else if(cache.connected) { | |
cache.connected = false; | |
lime_ui_Joystick.__disconnect(id); | |
lime_ui_Gamepad.__disconnect(id); | |
} | |
} | |
} | |
,__class__: lime__$internal_backend_html5_HTML5Application | |
}; | |
var lime_app_Application = function() { | |
this.onCreateWindow = new lime_app__$Event_$lime_$ui_$Window_$Void(); | |
this.onUpdate = new lime_app__$Event_$Int_$Void(); | |
lime_app_Module.call(this); | |
if(lime_app_Application.current == null) { | |
lime_app_Application.current = this; | |
} | |
this.meta = new haxe_ds_StringMap(); | |
this.modules = []; | |
this.__windowByID = new haxe_ds_IntMap(); | |
this.__windows = []; | |
this.__backend = new lime__$internal_backend_html5_HTML5Application(this); | |
this.__registerLimeModule(this); | |
this.__preloader = new lime_utils_Preloader(); | |
this.__preloader.onProgress.add($bind(this,this.onPreloadProgress)); | |
this.__preloader.onComplete.add($bind(this,this.onPreloadComplete)); | |
}; | |
$hxClasses["lime.app.Application"] = lime_app_Application; | |
lime_app_Application.__name__ = ["lime","app","Application"]; | |
lime_app_Application.current = null; | |
lime_app_Application.__super__ = lime_app_Module; | |
lime_app_Application.prototype = $extend(lime_app_Module.prototype,{ | |
meta: null | |
,modules: null | |
,onUpdate: null | |
,onCreateWindow: null | |
,preloader: null | |
,window: null | |
,windows: null | |
,__backend: null | |
,__preloader: null | |
,__window: null | |
,__windowByID: null | |
,__windows: null | |
,addModule: function(module) { | |
module.__registerLimeModule(this); | |
this.modules.push(module); | |
} | |
,createWindow: function(attributes) { | |
var $window = this.__createWindow(attributes); | |
this.__addWindow($window); | |
return $window; | |
} | |
,exec: function() { | |
lime_app_Application.current = this; | |
return this.__backend.exec(); | |
} | |
,onGamepadAxisMove: function(gamepad,axis,value) { | |
} | |
,onGamepadButtonDown: function(gamepad,button) { | |
} | |
,onGamepadButtonUp: function(gamepad,button) { | |
} | |
,onGamepadConnect: function(gamepad) { | |
} | |
,onGamepadDisconnect: function(gamepad) { | |
} | |
,onJoystickAxisMove: function(joystick,axis,value) { | |
} | |
,onJoystickButtonDown: function(joystick,button) { | |
} | |
,onJoystickButtonUp: function(joystick,button) { | |
} | |
,onJoystickConnect: function(joystick) { | |
} | |
,onJoystickDisconnect: function(joystick) { | |
} | |
,onJoystickHatMove: function(joystick,hat,position) { | |
} | |
,onJoystickTrackballMove: function(joystick,trackball,x,y) { | |
} | |
,onKeyDown: function(keyCode,modifier) { | |
} | |
,onKeyUp: function(keyCode,modifier) { | |
} | |
,onModuleExit: function(code) { | |
} | |
,onMouseDown: function(x,y,button) { | |
} | |
,onMouseMove: function(x,y) { | |
} | |
,onMouseMoveRelative: function(x,y) { | |
} | |
,onMouseUp: function(x,y,button) { | |
} | |
,onMouseWheel: function(deltaX,deltaY,deltaMode) { | |
} | |
,onPreloadComplete: function() { | |
} | |
,onPreloadProgress: function(loaded,total) { | |
} | |
,onRenderContextLost: function() { | |
} | |
,onRenderContextRestored: function(context) { | |
} | |
,onTextEdit: function(text,start,length) { | |
} | |
,onTextInput: function(text) { | |
} | |
,onTouchCancel: function(touch) { | |
} | |
,onTouchEnd: function(touch) { | |
} | |
,onTouchMove: function(touch) { | |
} | |
,onTouchStart: function(touch) { | |
} | |
,onWindowActivate: function() { | |
} | |
,onWindowClose: function() { | |
} | |
,onWindowCreate: function() { | |
} | |
,onWindowDeactivate: function() { | |
} | |
,onWindowDropFile: function(file) { | |
} | |
,onWindowEnter: function() { | |
} | |
,onWindowExpose: function() { | |
} | |
,onWindowFocusIn: function() { | |
} | |
,onWindowFocusOut: function() { | |
} | |
,onWindowFullscreen: function() { | |
} | |
,onWindowLeave: function() { | |
} | |
,onWindowMove: function(x,y) { | |
} | |
,onWindowMinimize: function() { | |
} | |
,onWindowResize: function(width,height) { | |
} | |
,onWindowRestore: function() { | |
} | |
,removeModule: function(module) { | |
if(module != null) { | |
module.__unregisterLimeModule(this); | |
HxOverrides.remove(this.modules,module); | |
} | |
} | |
,render: function(context) { | |
} | |
,update: function(deltaTime) { | |
} | |
,__addWindow: function(window) { | |
if(window != null) { | |
this.__windows.push(window); | |
this.__windowByID.h[window.id] = window; | |
var f = $bind(this,this.__onWindowClose); | |
var a1 = window; | |
var tmp = function() { | |
f(a1); | |
}; | |
window.onClose.add(tmp,false,-10000); | |
if(this.__window == null) { | |
this.__window = window; | |
window.onActivate.add($bind(this,this.onWindowActivate)); | |
window.onRenderContextLost.add($bind(this,this.onRenderContextLost)); | |
window.onRenderContextRestored.add($bind(this,this.onRenderContextRestored)); | |
window.onDeactivate.add($bind(this,this.onWindowDeactivate)); | |
window.onDropFile.add($bind(this,this.onWindowDropFile)); | |
window.onEnter.add($bind(this,this.onWindowEnter)); | |
window.onExpose.add($bind(this,this.onWindowExpose)); | |
window.onFocusIn.add($bind(this,this.onWindowFocusIn)); | |
window.onFocusOut.add($bind(this,this.onWindowFocusOut)); | |
window.onFullscreen.add($bind(this,this.onWindowFullscreen)); | |
window.onKeyDown.add($bind(this,this.onKeyDown)); | |
window.onKeyUp.add($bind(this,this.onKeyUp)); | |
window.onLeave.add($bind(this,this.onWindowLeave)); | |
window.onMinimize.add($bind(this,this.onWindowMinimize)); | |
window.onMouseDown.add($bind(this,this.onMouseDown)); | |
window.onMouseMove.add($bind(this,this.onMouseMove)); | |
window.onMouseMoveRelative.add($bind(this,this.onMouseMoveRelative)); | |
window.onMouseUp.add($bind(this,this.onMouseUp)); | |
window.onMouseWheel.add($bind(this,this.onMouseWheel)); | |
window.onMove.add($bind(this,this.onWindowMove)); | |
window.onRender.add($bind(this,this.render)); | |
window.onResize.add($bind(this,this.onWindowResize)); | |
window.onRestore.add($bind(this,this.onWindowRestore)); | |
window.onTextEdit.add($bind(this,this.onTextEdit)); | |
window.onTextInput.add($bind(this,this.onTextInput)); | |
this.onWindowCreate(); | |
} | |
this.onCreateWindow.dispatch(window); | |
} | |
} | |
,__createWindow: function(attributes) { | |
var $window = new lime_ui_Window(this,attributes); | |
if($window.id == -1) { | |
return null; | |
} | |
return $window; | |
} | |
,__registerLimeModule: function(application) { | |
application.onUpdate.add($bind(this,this.update)); | |
application.onExit.add($bind(this,this.onModuleExit),false,0); | |
application.onExit.add($bind(this,this.__onModuleExit),false,0); | |
var gamepad = lime_ui_Gamepad.devices.iterator(); | |
while(gamepad.hasNext()) { | |
var gamepad1 = gamepad.next(); | |
this.__onGamepadConnect(gamepad1); | |
} | |
lime_ui_Gamepad.onConnect.add($bind(this,this.__onGamepadConnect)); | |
var joystick = lime_ui_Joystick.devices.iterator(); | |
while(joystick.hasNext()) { | |
var joystick1 = joystick.next(); | |
this.__onJoystickConnect(joystick1); | |
} | |
lime_ui_Joystick.onConnect.add($bind(this,this.__onJoystickConnect)); | |
lime_ui_Touch.onCancel.add($bind(this,this.onTouchCancel)); | |
lime_ui_Touch.onStart.add($bind(this,this.onTouchStart)); | |
lime_ui_Touch.onMove.add($bind(this,this.onTouchMove)); | |
lime_ui_Touch.onEnd.add($bind(this,this.onTouchEnd)); | |
} | |
,__removeWindow: function(window) { | |
if(window != null && this.__windowByID.h.hasOwnProperty(window.id)) { | |
if(this.__window == window) { | |
this.__window = null; | |
} | |
HxOverrides.remove(this.__windows,window); | |
this.__windowByID.remove(window.id); | |
window.close(); | |
if(this.__windows.length == 0) { | |
lime_system_System.exit(0); | |
} | |
} | |
} | |
,__onGamepadConnect: function(gamepad) { | |
this.onGamepadConnect(gamepad); | |
var f = $bind(this,this.onGamepadAxisMove); | |
var a1 = gamepad; | |
var tmp = function(a2,a3) { | |
f(a1,a2,a3); | |
}; | |
gamepad.onAxisMove.add(tmp); | |
var f1 = $bind(this,this.onGamepadButtonDown); | |
var a11 = gamepad; | |
var tmp1 = function(a21) { | |
f1(a11,a21); | |
}; | |
gamepad.onButtonDown.add(tmp1); | |
var f2 = $bind(this,this.onGamepadButtonUp); | |
var a12 = gamepad; | |
var tmp2 = function(a22) { | |
f2(a12,a22); | |
}; | |
gamepad.onButtonUp.add(tmp2); | |
var f3 = $bind(this,this.onGamepadDisconnect); | |
var a13 = gamepad; | |
var tmp3 = function() { | |
f3(a13); | |
}; | |
gamepad.onDisconnect.add(tmp3); | |
} | |
,__onJoystickConnect: function(joystick) { | |
this.onJoystickConnect(joystick); | |
var f = $bind(this,this.onJoystickAxisMove); | |
var a1 = joystick; | |
var tmp = function(a2,a3) { | |
f(a1,a2,a3); | |
}; | |
joystick.onAxisMove.add(tmp); | |
var f1 = $bind(this,this.onJoystickButtonDown); | |
var a11 = joystick; | |
var tmp1 = function(a21) { | |
f1(a11,a21); | |
}; | |
joystick.onButtonDown.add(tmp1); | |
var f2 = $bind(this,this.onJoystickButtonUp); | |
var a12 = joystick; | |
var tmp2 = function(a22) { | |
f2(a12,a22); | |
}; | |
joystick.onButtonUp.add(tmp2); | |
var f3 = $bind(this,this.onJoystickDisconnect); | |
var a13 = joystick; | |
var tmp3 = function() { | |
f3(a13); | |
}; | |
joystick.onDisconnect.add(tmp3); | |
var f4 = $bind(this,this.onJoystickHatMove); | |
var a14 = joystick; | |
var tmp4 = function(a23,a31) { | |
f4(a14,a23,a31); | |
}; | |
joystick.onHatMove.add(tmp4); | |
var f5 = $bind(this,this.onJoystickTrackballMove); | |
var a15 = joystick; | |
var tmp5 = function(a24,x,y) { | |
f5(a15,a24,x,y); | |
}; | |
joystick.onTrackballMove.add(tmp5); | |
} | |
,__onModuleExit: function(code) { | |
this.__backend.exit(); | |
} | |
,__onWindowClose: function(window) { | |
if(this.__window == window) { | |
this.onWindowClose(); | |
} | |
this.__removeWindow(window); | |
} | |
,__unregisterLimeModule: function(application) { | |
application.onUpdate.remove($bind(this,this.update)); | |
application.onExit.remove($bind(this,this.__onModuleExit)); | |
application.onExit.remove($bind(this,this.onModuleExit)); | |
lime_ui_Gamepad.onConnect.remove($bind(this,this.__onGamepadConnect)); | |
lime_ui_Joystick.onConnect.remove($bind(this,this.__onJoystickConnect)); | |
lime_ui_Touch.onCancel.remove($bind(this,this.onTouchCancel)); | |
lime_ui_Touch.onStart.remove($bind(this,this.onTouchStart)); | |
lime_ui_Touch.onMove.remove($bind(this,this.onTouchMove)); | |
lime_ui_Touch.onEnd.remove($bind(this,this.onTouchEnd)); | |
this.onModuleExit(0); | |
} | |
,get_preloader: function() { | |
return this.__preloader; | |
} | |
,get_window: function() { | |
return this.__window; | |
} | |
,get_windows: function() { | |
return this.__windows; | |
} | |
,__class__: lime_app_Application | |
,__properties__: {get_windows:"get_windows",get_window:"get_window",get_preloader:"get_preloader"} | |
}); | |
var ApplicationMain = function() { }; | |
$hxClasses["ApplicationMain"] = ApplicationMain; | |
ApplicationMain.__name__ = ["ApplicationMain"]; | |
ApplicationMain.main = function() { | |
lime_system_System.__registerEntryPoint("Start",ApplicationMain.create); | |
}; | |
ApplicationMain.create = function(config) { | |
var app = new openfl_display_Application(); | |
ManifestResources.init(config); | |
var _this = app.meta; | |
if(__map_reserved["build"] != null) { | |
_this.setReserved("build","9111"); | |
} else { | |
_this.h["build"] = "9111"; | |
} | |
var _this1 = app.meta; | |
if(__map_reserved["company"] != null) { | |
_this1.setReserved("company","nx"); | |
} else { | |
_this1.h["company"] = "nx"; | |
} | |
var _this2 = app.meta; | |
if(__map_reserved["file"] != null) { | |
_this2.setReserved("file","Start"); | |
} else { | |
_this2.h["file"] = "Start"; | |
} | |
var _this3 = app.meta; | |
if(__map_reserved["name"] != null) { | |
_this3.setReserved("name","tr"); | |
} else { | |
_this3.h["name"] = "tr"; | |
} | |
var _this4 = app.meta; | |
if(__map_reserved["packageName"] != null) { | |
_this4.setReserved("packageName","tr"); | |
} else { | |
_this4.h["packageName"] = "tr"; | |
} | |
var _this5 = app.meta; | |
if(__map_reserved["version"] != null) { | |
_this5.setReserved("version","1.0.0"); | |
} else { | |
_this5.h["version"] = "1.0.0"; | |
} | |
var attributes = { allowHighDPI : false, alwaysOnTop : false, borderless : false, element : null, frameRate : 30, height : 0, hidden : false, maximized : false, minimized : false, parameters : { }, resizable : true, title : "tr", width : 0, x : null, y : null}; | |
attributes.context = { antialiasing : 0, background : 0, colorDepth : 32, depth : true, hardware : true, stencil : true, type : null, vsync : false}; | |
if(app.__window == null) { | |
if(config != null) { | |
var _g = 0; | |
var _g1 = Reflect.fields(config); | |
while(_g < _g1.length) { | |
var field = _g1[_g]; | |
++_g; | |
if(Object.prototype.hasOwnProperty.call(attributes,field)) { | |
attributes[field] = Reflect.field(config,field); | |
} else if(Object.prototype.hasOwnProperty.call(attributes.context,field)) { | |
attributes.context[field] = Reflect.field(config,field); | |
} | |
} | |
} | |
} | |
app.createWindow(attributes); | |
var preloader = new openfl_display_Preloader(new openfl_display_DefaultPreloader()); | |
app.__preloader.onProgress.add(function(loaded,total) { | |
preloader.update(loaded,total); | |
}); | |
app.__preloader.onComplete.add(function() { | |
preloader.start(); | |
}); | |
var a1 = (js_Boot.__cast(app.__window , openfl_display_Window)).stage; | |
var tmp = function() { | |
ApplicationMain.start(a1); | |
}; | |
preloader.onComplete.add(tmp); | |
var _g2 = 0; | |
var _g11 = ManifestResources.preloadLibraries; | |
while(_g2 < _g11.length) { | |
var library = _g11[_g2]; | |
++_g2; | |
app.__preloader.addLibrary(library); | |
} | |
var _g3 = 0; | |
var _g12 = ManifestResources.preloadLibraryNames; | |
while(_g3 < _g12.length) { | |
var name = _g12[_g3]; | |
++_g3; | |
app.__preloader.addLibraryName(name); | |
} | |
app.__preloader.load(); | |
var result = app.exec(); | |
}; | |
ApplicationMain.start = function(stage) { | |
try { | |
var current = stage.getChildAt(0); | |
if(current == null || !js_Boot.__instanceof(current,openfl_display_DisplayObjectContainer)) { | |
current = new openfl_display_MovieClip(); | |
stage.addChild(current); | |
} | |
new DocumentClass(current); | |
stage.dispatchEvent(new openfl_events_Event("resize",false,false)); | |
if(stage.window.__fullscreen) { | |
stage.dispatchEvent(new openfl_events_FullScreenEvent("fullScreen",false,false,true,true)); | |
} | |
} catch( e ) { | |
haxe_CallStack.lastException = e; | |
if (e instanceof js__$Boot_HaxeError) e = e.val; | |
stage.__handleError(e); | |
} | |
}; | |
var openfl_events_IEventDispatcher = function() { }; | |
$hxClasses["openfl.events.IEventDispatcher"] = openfl_events_IEventDispatcher; | |
openfl_events_IEventDispatcher.__name__ = ["openfl","events","IEventDispatcher"]; | |
openfl_events_IEventDispatcher.prototype = { | |
addEventListener: null | |
,dispatchEvent: null | |
,hasEventListener: null | |
,removeEventListener: null | |
,willTrigger: null | |
,__class__: openfl_events_IEventDispatcher | |
}; | |
var openfl_events_EventDispatcher = function(target) { | |
if(target != null) { | |
this.__targetDispatcher = target; | |
} | |
}; | |
$hxClasses["openfl.events.EventDispatcher"] = openfl_events_EventDispatcher; | |
openfl_events_EventDispatcher.__name__ = ["openfl","events","EventDispatcher"]; | |
openfl_events_EventDispatcher.__interfaces__ = [openfl_events_IEventDispatcher]; | |
openfl_events_EventDispatcher.prototype = { | |
__eventMap: null | |
,__iterators: null | |
,__targetDispatcher: null | |
,addEventListener: function(type,listener,useCapture,priority,useWeakReference) { | |
if(useWeakReference == null) { | |
useWeakReference = false; | |
} | |
if(priority == null) { | |
priority = 0; | |
} | |
if(useCapture == null) { | |
useCapture = false; | |
} | |
if(listener == null) { | |
return; | |
} | |
if(this.__eventMap == null) { | |
this.__eventMap = new haxe_ds_StringMap(); | |
this.__iterators = new haxe_ds_StringMap(); | |
} | |
var _this = this.__eventMap; | |
if(!(__map_reserved[type] != null ? _this.existsReserved(type) : _this.h.hasOwnProperty(type))) { | |
var list = []; | |
list.push(new openfl_events__$EventDispatcher_Listener(listener,useCapture,priority)); | |
var iterator = new openfl_events__$EventDispatcher_DispatchIterator(list); | |
var _this1 = this.__eventMap; | |
if(__map_reserved[type] != null) { | |
_this1.setReserved(type,list); | |
} else { | |
_this1.h[type] = list; | |
} | |
var _this2 = this.__iterators; | |
var value = [iterator]; | |
if(__map_reserved[type] != null) { | |
_this2.setReserved(type,value); | |
} else { | |
_this2.h[type] = value; | |
} | |
} else { | |
var _this3 = this.__eventMap; | |
var list1 = __map_reserved[type] != null ? _this3.getReserved(type) : _this3.h[type]; | |
var _g1 = 0; | |
var _g = list1.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
if(list1[i].match(listener,useCapture)) { | |
return; | |
} | |
} | |
var _this4 = this.__iterators; | |
var iterators = __map_reserved[type] != null ? _this4.getReserved(type) : _this4.h[type]; | |
var _g2 = 0; | |
while(_g2 < iterators.length) { | |
var iterator1 = iterators[_g2]; | |
++_g2; | |
if(iterator1.active) { | |
iterator1.copy(); | |
} | |
} | |
this.__addListenerByPriority(list1,new openfl_events__$EventDispatcher_Listener(listener,useCapture,priority)); | |
} | |
} | |
,dispatchEvent: function(event) { | |
if(this.__targetDispatcher != null) { | |
event.target = this.__targetDispatcher; | |
} else { | |
event.target = this; | |
} | |
return this.__dispatchEvent(event); | |
} | |
,hasEventListener: function(type) { | |
if(this.__eventMap == null) { | |
return false; | |
} | |
var _this = this.__eventMap; | |
if(__map_reserved[type] != null) { | |
return _this.existsReserved(type); | |
} else { | |
return _this.h.hasOwnProperty(type); | |
} | |
} | |
,removeEventListener: function(type,listener,useCapture) { | |
if(useCapture == null) { | |
useCapture = false; | |
} | |
if(this.__eventMap == null || listener == null) { | |
return; | |
} | |
var _this = this.__eventMap; | |
var list = __map_reserved[type] != null ? _this.getReserved(type) : _this.h[type]; | |
if(list == null) { | |
return; | |
} | |
var _this1 = this.__iterators; | |
var iterators = __map_reserved[type] != null ? _this1.getReserved(type) : _this1.h[type]; | |
var _g1 = 0; | |
var _g = list.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
if(list[i].match(listener,useCapture)) { | |
var _g2 = 0; | |
while(_g2 < iterators.length) { | |
var iterator = iterators[_g2]; | |
++_g2; | |
iterator.remove(list[i],i); | |
} | |
list.splice(i,1); | |
break; | |
} | |
} | |
if(list.length == 0) { | |
this.__eventMap.remove(type); | |
this.__iterators.remove(type); | |
} | |
var _this2 = this.__eventMap; | |
if(!new haxe_ds__$StringMap_StringMapIterator(_this2,_this2.arrayKeys()).hasNext()) { | |
this.__eventMap = null; | |
this.__iterators = null; | |
} | |
} | |
,toString: function() { | |
var full = Type.getClassName(js_Boot.getClass(this)); | |
var $short = full.split(".").pop(); | |
return "[object " + $short + "]"; | |
} | |
,willTrigger: function(type) { | |
return this.hasEventListener(type); | |
} | |
,__dispatchEvent: function(event) { | |
if(this.__eventMap == null || event == null) { | |
return true; | |
} | |
var type = event.type; | |
var _this = this.__eventMap; | |
var list = __map_reserved[type] != null ? _this.getReserved(type) : _this.h[type]; | |
if(list == null) { | |
return true; | |
} | |
if(event.target == null) { | |
if(this.__targetDispatcher != null) { | |
event.target = this.__targetDispatcher; | |
} else { | |
event.target = this; | |
} | |
} | |
event.currentTarget = this; | |
var capture = event.eventPhase == 1; | |
var _this1 = this.__iterators; | |
var iterators = __map_reserved[type] != null ? _this1.getReserved(type) : _this1.h[type]; | |
var iterator = iterators[0]; | |
if(iterator.active) { | |
iterator = new openfl_events__$EventDispatcher_DispatchIterator(list); | |
iterators.push(iterator); | |
} | |
iterator.start(); | |
var listener = iterator; | |
while(listener.hasNext()) { | |
var listener1 = listener.next(); | |
if(listener1 == null) { | |
continue; | |
} | |
if(listener1.useCapture == capture) { | |
listener1.callback(event); | |
if(event.__isCanceledNow) { | |
break; | |
} | |
} | |
} | |
iterator.stop(); | |
if(iterator != iterators[0]) { | |
HxOverrides.remove(iterators,iterator); | |
} else { | |
iterator.reset(list); | |
} | |
return !event.isDefaultPrevented(); | |
} | |
,__removeAllListeners: function() { | |
this.__eventMap = null; | |
this.__iterators = null; | |
} | |
,__addListenerByPriority: function(list,listener) { | |
var numElements = list.length; | |
var addAtPosition = numElements; | |
var _g1 = 0; | |
var _g = numElements; | |
while(_g1 < _g) { | |
var i = _g1++; | |
if(list[i].priority < listener.priority) { | |
addAtPosition = i; | |
break; | |
} | |
} | |
list.splice(addAtPosition,0,listener); | |
} | |
,__class__: openfl_events_EventDispatcher | |
}; | |
var openfl_display_IBitmapDrawable = function() { }; | |
$hxClasses["openfl.display.IBitmapDrawable"] = openfl_display_IBitmapDrawable; | |
openfl_display_IBitmapDrawable.__name__ = ["openfl","display","IBitmapDrawable"]; | |
openfl_display_IBitmapDrawable.prototype = { | |
__blendMode: null | |
,__isMask: null | |
,__renderable: null | |
,__renderTransform: null | |
,__transform: null | |
,__worldAlpha: null | |
,__worldColorTransform: null | |
,__worldTransform: null | |
,__getBounds: null | |
,__renderCairo: null | |
,__renderCairoMask: null | |
,__renderCanvas: null | |
,__renderCanvasMask: null | |
,__renderDOM: null | |
,__renderGL: null | |
,__renderGLMask: null | |
,__update: null | |
,__updateTransforms: null | |
,__mask: null | |
,__scrollRect: null | |
,__class__: openfl_display_IBitmapDrawable | |
}; | |
var openfl__$internal_renderer_PotPool = function(lifetime) { | |
this.__topSize = 0; | |
this.__size = 0; | |
this.__timeNow = 1; | |
this.__bitmapData = new haxe_ds_IntMap(); | |
this.__lastUsed = new haxe_ds_ObjectMap(); | |
this.__lifetime = lifetime; | |
}; | |
$hxClasses["openfl._internal.renderer.PotPool"] = openfl__$internal_renderer_PotPool; | |
openfl__$internal_renderer_PotPool.__name__ = ["openfl","_internal","renderer","PotPool"]; | |
openfl__$internal_renderer_PotPool.prototype = { | |
__bitmapData: null | |
,__lastUsed: null | |
,__lifetime: null | |
,__timeNow: null | |
,__size: null | |
,__topSize: null | |
,incTime: function() { | |
this.__timeNow++; | |
this.cleanup(); | |
} | |
,get: function(width,height,context) { | |
var pw = this.pot(width); | |
var ph = this.pot(height); | |
var heightMap = this.__bitmapData.h[pw]; | |
if(heightMap == null) { | |
var this1 = this.__bitmapData; | |
var v = new haxe_ds_IntMap(); | |
this1.h[pw] = v; | |
heightMap = v; | |
} | |
var pool = heightMap.h[ph]; | |
if(pool == null) { | |
var v1 = []; | |
heightMap.h[ph] = v1; | |
pool = v1; | |
} | |
var bd = null; | |
if(pool.length > 0) { | |
bd = pool.pop(); | |
this.__lastUsed.remove(bd); | |
this.__size -= pw * ph * 4; | |
bd.fillRect(bd.rect,0); | |
} else { | |
if(context != null) { | |
bd = openfl_display_BitmapData.fromTexture(context.createRectangleTexture(pw,ph,1,true)); | |
bd.fillRect(bd.rect,0); | |
} else { | |
bd = new openfl_display_BitmapData(pw,ph,true,0); | |
} | |
bd.pool = this; | |
} | |
return bd; | |
} | |
,cleanup: function() { | |
var s0 = this.__size; | |
var left = 0; | |
var hh = this.__bitmapData.iterator(); | |
while(hh.hasNext()) { | |
var hh1 = hh.next(); | |
var pool = hh1.iterator(); | |
while(pool.hasNext()) { | |
var pool1 = pool.next(); | |
var l = pool1.length; | |
while(l > 0) { | |
var bd = pool1[0]; | |
var dt = this.__timeNow - this.__lastUsed.h[bd.__id__]; | |
if(dt > this.__lifetime) { | |
pool1.shift(); | |
this.__size -= bd.width * bd.height * 4; | |
this.__lastUsed.remove(bd); | |
bd.dispose(); | |
--l; | |
} else { | |
left += l; | |
break; | |
} | |
} | |
} | |
} | |
} | |
,put: function(bitmapData) { | |
var pw = bitmapData.width; | |
var ph = bitmapData.height; | |
if(bitmapData.pool != this) { | |
throw new js__$Boot_HaxeError("wrong pool for bd."); | |
} | |
if(this.__lastUsed.h[bitmapData.__id__] != null) { | |
throw new js__$Boot_HaxeError("bd already pooled"); | |
} | |
var heightMap = this.__bitmapData.h[pw]; | |
if(heightMap == null) { | |
var this1 = this.__bitmapData; | |
var v = new haxe_ds_IntMap(); | |
this1.h[pw] = v; | |
heightMap = v; | |
} | |
var pool = heightMap.h[ph]; | |
if(pool == null) { | |
var v1 = []; | |
heightMap.h[ph] = v1; | |
pool = v1; | |
} | |
pool.push(bitmapData); | |
var v2 = this.__timeNow; | |
this.__lastUsed.set(bitmapData,v2); | |
this.__size += pw * ph * 4; | |
if(this.__size > this.__topSize) { | |
this.__topSize = this.__size; | |
} | |
} | |
,pot: function(v) { | |
var ret = 1; | |
while(ret < v) ret <<= 1; | |
return ret; | |
} | |
,__class__: openfl__$internal_renderer_PotPool | |
}; | |
var openfl__$Vector_Vector_$Impl_$ = {}; | |
$hxClasses["openfl._Vector.Vector_Impl_"] = openfl__$Vector_Vector_$Impl_$; | |
openfl__$Vector_Vector_$Impl_$.__name__ = ["openfl","_Vector","Vector_Impl_"]; | |
openfl__$Vector_Vector_$Impl_$.__properties__ = {set_length:"set_length",get_length:"get_length",set_fixed:"set_fixed",get_fixed:"get_fixed"}; | |
openfl__$Vector_Vector_$Impl_$.ofArray_Int = function(array) { | |
var vector = openfl__$Vector_Vector_$Impl_$.toIntVector(null); | |
var _g1 = 0; | |
var _g = array.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
vector.set(i,array[i]); | |
} | |
return vector; | |
}; | |
openfl__$Vector_Vector_$Impl_$.ofArray_UInt = function(array) { | |
var vector = openfl__$Vector_Vector_$Impl_$.toIntVector(null); | |
var _g1 = 0; | |
var _g = array.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
vector.set(i,array[i]); | |
} | |
return vector; | |
}; | |
openfl__$Vector_Vector_$Impl_$.ofArray_Float = function(array) { | |
var vector = openfl__$Vector_Vector_$Impl_$.toFloatVector(null); | |
var _g1 = 0; | |
var _g = array.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
vector.set(i,array[i]); | |
} | |
return vector; | |
}; | |
openfl__$Vector_Vector_$Impl_$.ofArray_String = function(array) { | |
var vector = openfl__$Vector_Vector_$Impl_$.toObjectVector(null); | |
var _g1 = 0; | |
var _g = array.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
vector.set(i,array[i]); | |
} | |
return vector; | |
}; | |
openfl__$Vector_Vector_$Impl_$.concat = function(this1,vec) { | |
return this1.concat(vec); | |
}; | |
openfl__$Vector_Vector_$Impl_$.copy = function(this1) { | |
return this1.copy(); | |
}; | |
openfl__$Vector_Vector_$Impl_$.filter = function(this1,callback) { | |
return this1.filter(callback); | |
}; | |
openfl__$Vector_Vector_$Impl_$.get = function(this1,index) { | |
return this1.get(index); | |
}; | |
openfl__$Vector_Vector_$Impl_$.indexOf = function(this1,searchElement,fromIndex) { | |
if(fromIndex == null) { | |
fromIndex = 0; | |
} | |
return this1.indexOf(searchElement,fromIndex); | |
}; | |
openfl__$Vector_Vector_$Impl_$.insertAt = function(this1,index,element) { | |
this1.insertAt(index,element); | |
}; | |
openfl__$Vector_Vector_$Impl_$.iterator = function(this1) { | |
return this1.iterator(); | |
}; | |
openfl__$Vector_Vector_$Impl_$.join = function(this1,sep) { | |
if(sep == null) { | |
sep = ","; | |
} | |
return this1.join(sep); | |
}; | |
openfl__$Vector_Vector_$Impl_$.lastIndexOf = function(this1,searchElement,fromIndex) { | |
return this1.lastIndexOf(searchElement,fromIndex); | |
}; | |
openfl__$Vector_Vector_$Impl_$.pop = function(this1) { | |
return this1.pop(); | |
}; | |
openfl__$Vector_Vector_$Impl_$.push = function(this1,value) { | |
return this1.push(value); | |
}; | |
openfl__$Vector_Vector_$Impl_$.removeAt = function(this1,index) { | |
return this1.removeAt(index); | |
}; | |
openfl__$Vector_Vector_$Impl_$.reverse = function(this1) { | |
return this1.reverse(); | |
}; | |
openfl__$Vector_Vector_$Impl_$.set = function(this1,index,value) { | |
return this1.set(index,value); | |
}; | |
openfl__$Vector_Vector_$Impl_$.shift = function(this1) { | |
return this1.shift(); | |
}; | |
openfl__$Vector_Vector_$Impl_$.slice = function(this1,startIndex,endIndex) { | |
if(startIndex == null) { | |
startIndex = 0; | |
} | |
return this1.slice(startIndex,endIndex); | |
}; | |
openfl__$Vector_Vector_$Impl_$.sort = function(this1,sortBehavior) { | |
this1.sort(sortBehavior); | |
}; | |
openfl__$Vector_Vector_$Impl_$.splice = function(this1,startIndex,deleteCount) { | |
return this1.splice(startIndex,deleteCount); | |
}; | |
openfl__$Vector_Vector_$Impl_$.toString = function(this1) { | |
if(this1 != null) { | |
return this1.toString(); | |
} else { | |
return null; | |
} | |
}; | |
openfl__$Vector_Vector_$Impl_$.unshift = function(this1,value) { | |
this1.unshift(value); | |
}; | |
openfl__$Vector_Vector_$Impl_$.convert = function(vec) { | |
return vec; | |
}; | |
openfl__$Vector_Vector_$Impl_$.toBoolVector = function(t,length,fixed,array) { | |
return new openfl__$Vector_BoolVector(length,fixed,array); | |
}; | |
openfl__$Vector_Vector_$Impl_$.toIntVector = function(t,length,fixed,array) { | |
return new openfl__$Vector_IntVector(length,fixed,array); | |
}; | |
openfl__$Vector_Vector_$Impl_$.toFloatVector = function(t,length,fixed,array) { | |
return new openfl__$Vector_FloatVector(length,fixed,array,true); | |
}; | |
openfl__$Vector_Vector_$Impl_$.toFunctionVector = function(t,length,fixed,array) { | |
return new openfl__$Vector_FunctionVector(length,fixed,array); | |
}; | |
openfl__$Vector_Vector_$Impl_$.toObjectVector = function(t,length,fixed,array) { | |
return new openfl__$Vector_ObjectVector(length,fixed,array,true); | |
}; | |
openfl__$Vector_Vector_$Impl_$.toNullVector = function(t,length,fixed,array) { | |
return new openfl__$Vector_ObjectVector(length,fixed,array,true); | |
}; | |
openfl__$Vector_Vector_$Impl_$.fromBoolVector = function(vector) { | |
return vector; | |
}; | |
openfl__$Vector_Vector_$Impl_$.fromIntVector = function(vector) { | |
return vector; | |
}; | |
openfl__$Vector_Vector_$Impl_$.fromFloatVector = function(vector) { | |
return vector; | |
}; | |
openfl__$Vector_Vector_$Impl_$.fromFunctionVector = function(vector) { | |
return vector; | |
}; | |
openfl__$Vector_Vector_$Impl_$.fromObjectVector = function(vector) { | |
return vector; | |
}; | |
openfl__$Vector_Vector_$Impl_$.get_fixed = function(this1) { | |
return this1.fixed; | |
}; | |
openfl__$Vector_Vector_$Impl_$.set_fixed = function(this1,value) { | |
return this1.fixed = value; | |
}; | |
openfl__$Vector_Vector_$Impl_$.get_length = function(this1) { | |
return this1.get_length(); | |
}; | |
openfl__$Vector_Vector_$Impl_$.set_length = function(this1,value) { | |
return this1.set_length(value); | |
}; | |
var lime_utils_ObjectPool = function(create,clean,size) { | |
this.__pool = new haxe_ds_ObjectMap(); | |
this.activeObjects = 0; | |
this.inactiveObjects = 0; | |
this.__inactiveObject0 = null; | |
this.__inactiveObject1 = null; | |
this.__inactiveObjectList = new List(); | |
if(create != null) { | |
this.create = create; | |
} | |
if(clean != null) { | |
this.clean = clean; | |
} | |
if(size != null) { | |
this.set_size(size); | |
} | |
}; | |
$hxClasses["lime.utils.ObjectPool"] = lime_utils_ObjectPool; | |
lime_utils_ObjectPool.__name__ = ["lime","utils","ObjectPool"]; | |
lime_utils_ObjectPool.prototype = { | |
activeObjects: null | |
,inactiveObjects: null | |
,__inactiveObject0: null | |
,__inactiveObject1: null | |
,__inactiveObjectList: null | |
,__pool: null | |
,__size: null | |
,add: function(object) { | |
if(!this.__pool.exists(object)) { | |
this.__pool.set(object,false); | |
this.clean(object); | |
if(this.__inactiveObject0 == null) { | |
this.__inactiveObject0 = object; | |
} else if(this.__inactiveObject1 == null) { | |
this.__inactiveObject1 = object; | |
} else { | |
this.__inactiveObjectList.add(object); | |
} | |
this.inactiveObjects++; | |
} | |
} | |
,clean: function(object) { | |
} | |
,clear: function() { | |
this.__pool = new haxe_ds_ObjectMap(); | |
this.activeObjects = 0; | |
this.inactiveObjects = 0; | |
this.__inactiveObject0 = null; | |
this.__inactiveObject1 = null; | |
this.__inactiveObjectList.clear(); | |
} | |
,create: function() { | |
return null; | |
} | |
,get: function() { | |
var object = null; | |
if(this.inactiveObjects > 0) { | |
var object1 = null; | |
if(this.__inactiveObject0 != null) { | |
object1 = this.__inactiveObject0; | |
this.__inactiveObject0 = null; | |
} else if(this.__inactiveObject1 != null) { | |
object1 = this.__inactiveObject1; | |
this.__inactiveObject1 = null; | |
} else { | |
object1 = this.__inactiveObjectList.pop(); | |
if(this.__inactiveObjectList.length > 0) { | |
this.__inactiveObject0 = this.__inactiveObjectList.pop(); | |
} | |
if(this.__inactiveObjectList.length > 0) { | |
this.__inactiveObject1 = this.__inactiveObjectList.pop(); | |
} | |
} | |
this.inactiveObjects--; | |
this.activeObjects++; | |
object = object1; | |
} else if(this.__size == null || this.activeObjects < this.__size) { | |
object = this.create(); | |
if(object != null) { | |
this.__pool.set(object,true); | |
this.activeObjects++; | |
} | |
} | |
return object; | |
} | |
,release: function(object) { | |
this.activeObjects--; | |
if(this.__size == null || this.activeObjects + this.inactiveObjects < this.__size) { | |
this.clean(object); | |
if(this.__inactiveObject0 == null) { | |
this.__inactiveObject0 = object; | |
} else if(this.__inactiveObject1 == null) { | |
this.__inactiveObject1 = object; | |
} else { | |
this.__inactiveObjectList.add(object); | |
} | |
this.inactiveObjects++; | |
} else { | |
this.__pool.remove(object); | |
} | |
} | |
,remove: function(object) { | |
if(this.__pool.exists(object)) { | |
this.__pool.remove(object); | |
if(this.__inactiveObject0 == object) { | |
this.__inactiveObject0 = null; | |
this.inactiveObjects--; | |
} else if(this.__inactiveObject1 == object) { | |
this.__inactiveObject1 = null; | |
this.inactiveObjects--; | |
} else if(this.__inactiveObjectList.remove(object)) { | |
this.inactiveObjects--; | |
} else { | |
this.activeObjects--; | |
} | |
} | |
} | |
,__addInactive: function(object) { | |
if(this.__inactiveObject0 == null) { | |
this.__inactiveObject0 = object; | |
} else if(this.__inactiveObject1 == null) { | |
this.__inactiveObject1 = object; | |
} else { | |
this.__inactiveObjectList.add(object); | |
} | |
this.inactiveObjects++; | |
} | |
,__getInactive: function() { | |
var object = null; | |
if(this.__inactiveObject0 != null) { | |
object = this.__inactiveObject0; | |
this.__inactiveObject0 = null; | |
} else if(this.__inactiveObject1 != null) { | |
object = this.__inactiveObject1; | |
this.__inactiveObject1 = null; | |
} else { | |
object = this.__inactiveObjectList.pop(); | |
if(this.__inactiveObjectList.length > 0) { | |
this.__inactiveObject0 = this.__inactiveObjectList.pop(); | |
} | |
if(this.__inactiveObjectList.length > 0) { | |
this.__inactiveObject1 = this.__inactiveObjectList.pop(); | |
} | |
} | |
this.inactiveObjects--; | |
this.activeObjects++; | |
return object; | |
} | |
,__removeInactive: function(count) { | |
if(count <= 0 || this.inactiveObjects == 0) { | |
return; | |
} | |
if(this.__inactiveObject0 != null) { | |
this.__pool.remove(this.__inactiveObject0); | |
this.__inactiveObject0 = null; | |
this.inactiveObjects--; | |
--count; | |
} | |
if(count == 0 || this.inactiveObjects == 0) { | |
return; | |
} | |
if(this.__inactiveObject1 != null) { | |
this.__pool.remove(this.__inactiveObject1); | |
this.__inactiveObject1 = null; | |
this.inactiveObjects--; | |
--count; | |
} | |
if(count == 0 || this.inactiveObjects == 0) { | |
return; | |
} | |
var _g_head = this.__inactiveObjectList.h; | |
while(_g_head != null) { | |
var val = _g_head.item; | |
_g_head = _g_head.next; | |
var object = val; | |
this.__pool.remove(object); | |
this.__inactiveObjectList.remove(object); | |
this.inactiveObjects--; | |
--count; | |
if(count == 0 || this.inactiveObjects == 0) { | |
return; | |
} | |
} | |
} | |
,get_size: function() { | |
return this.__size; | |
} | |
,set_size: function(value) { | |
if(value == null) { | |
this.__size = null; | |
} else { | |
var current = this.inactiveObjects + this.activeObjects; | |
this.__size = value; | |
if(current > value) { | |
this.__removeInactive(current - value); | |
} else if(value > current) { | |
var object; | |
var _g1 = 0; | |
var _g = value - current; | |
while(_g1 < _g) { | |
var i = _g1++; | |
object = this.create(); | |
if(object != null) { | |
this.__pool.set(object,false); | |
this.__inactiveObjectList.add(object); | |
this.inactiveObjects++; | |
} else { | |
break; | |
} | |
} | |
} | |
} | |
return value; | |
} | |
,__class__: lime_utils_ObjectPool | |
,__properties__: {set_size:"set_size",get_size:"get_size"} | |
}; | |
var haxe_IMap = function() { }; | |
$hxClasses["haxe.IMap"] = haxe_IMap; | |
haxe_IMap.__name__ = ["haxe","IMap"]; | |
haxe_IMap.prototype = { | |
get: null | |
,set: null | |
,exists: null | |
,remove: null | |
,keys: null | |
,iterator: null | |
,__class__: haxe_IMap | |
}; | |
var haxe_ds_ObjectMap = function() { | |
this.h = { __keys__ : { }}; | |
}; | |
$hxClasses["haxe.ds.ObjectMap"] = haxe_ds_ObjectMap; | |
haxe_ds_ObjectMap.__name__ = ["haxe","ds","ObjectMap"]; | |
haxe_ds_ObjectMap.__interfaces__ = [haxe_IMap]; | |
haxe_ds_ObjectMap.assignId = function(obj) { | |
return obj.__id__ = ++haxe_ds_ObjectMap.count; | |
}; | |
haxe_ds_ObjectMap.getId = function(obj) { | |
return obj.__id__; | |
}; | |
haxe_ds_ObjectMap.prototype = { | |
h: null | |
,set: function(key,value) { | |
var id = key.__id__ || (key.__id__ = ++haxe_ds_ObjectMap.count); | |
this.h[id] = value; | |
this.h.__keys__[id] = key; | |
} | |
,get: function(key) { | |
return this.h[key.__id__]; | |
} | |
,exists: function(key) { | |
return this.h.__keys__[key.__id__] != null; | |
} | |
,remove: function(key) { | |
var id = key.__id__; | |
if(this.h.__keys__[id] == null) { | |
return false; | |
} | |
delete(this.h[id]); | |
delete(this.h.__keys__[id]); | |
return true; | |
} | |
,keys: function() { | |
var a = []; | |
for( var key in this.h.__keys__ ) { | |
if(this.h.hasOwnProperty(key)) { | |
a.push(this.h.__keys__[key]); | |
} | |
} | |
return HxOverrides.iter(a); | |
} | |
,iterator: function() { | |
return { ref : this.h, it : this.keys(), hasNext : function() { | |
return this.it.hasNext(); | |
}, next : function() { | |
var i = this.it.next(); | |
return this.ref[i.__id__]; | |
}}; | |
} | |
,toString: function() { | |
var s_b = ""; | |
s_b += "{"; | |
var it = this.keys(); | |
var i = it; | |
while(i.hasNext()) { | |
var i1 = i.next(); | |
s_b += Std.string(Std.string(i1)); | |
s_b += " => "; | |
s_b += Std.string(Std.string(this.h[i1.__id__])); | |
if(it.hasNext()) { | |
s_b += ", "; | |
} | |
} | |
s_b += "}"; | |
return s_b; | |
} | |
,__class__: haxe_ds_ObjectMap | |
}; | |
var List = function() { | |
this.length = 0; | |
}; | |
$hxClasses["List"] = List; | |
List.__name__ = ["List"]; | |
List.prototype = { | |
h: null | |
,q: null | |
,length: null | |
,add: function(item) { | |
var x = new _$List_ListNode(item,null); | |
if(this.h == null) { | |
this.h = x; | |
} else { | |
this.q.next = x; | |
} | |
this.q = x; | |
this.length++; | |
} | |
,push: function(item) { | |
var x = new _$List_ListNode(item,this.h); | |
this.h = x; | |
if(this.q == null) { | |
this.q = x; | |
} | |
this.length++; | |
} | |
,pop: function() { | |
if(this.h == null) { | |
return null; | |
} | |
var x = this.h.item; | |
this.h = this.h.next; | |
if(this.h == null) { | |
this.q = null; | |
} | |
this.length--; | |
return x; | |
} | |
,clear: function() { | |
this.h = null; | |
this.q = null; | |
this.length = 0; | |
} | |
,remove: function(v) { | |
var prev = null; | |
var l = this.h; | |
while(l != null) { | |
if(l.item == v) { | |
if(prev == null) { | |
this.h = l.next; | |
} else { | |
prev.next = l.next; | |
} | |
if(this.q == l) { | |
this.q = prev; | |
} | |
this.length--; | |
return true; | |
} | |
prev = l; | |
l = l.next; | |
} | |
return false; | |
} | |
,iterator: function() { | |
return new _$List_ListIterator(this.h); | |
} | |
,toString: function() { | |
var s_b = ""; | |
var first = true; | |
var l = this.h; | |
s_b += "{"; | |
while(l != null) { | |
if(first) { | |
first = false; | |
} else { | |
s_b += ", "; | |
} | |
s_b += Std.string(Std.string(l.item)); | |
l = l.next; | |
} | |
s_b += "}"; | |
return s_b; | |
} | |
,__class__: List | |
}; | |
var openfl_display_DisplayObject = function() { | |
this.sy = 1; | |
this.sx = 1; | |
openfl_events_EventDispatcher.call(this); | |
this.__serial = openfl_display_DisplayObject.__serials++; | |
this.__alpha = 1; | |
this.__blendMode = 10; | |
this.__cacheAsBitmap = false; | |
this.__transform = new openfl_geom_Matrix(); | |
this.__visible = true; | |
this.__rotation = 0; | |
this.__rotationSine = 0; | |
this.__rotationCosine = 1; | |
this.__scaleX = 1; | |
this.__scaleY = 1; | |
this.__worldAlpha = 1; | |
this.__worldBlendMode = 10; | |
this.__worldTransform = new openfl_geom_Matrix(); | |
this.__worldColorTransform = new openfl_geom_ColorTransform(); | |
this.__renderTransform = new openfl_geom_Matrix(); | |
this.__worldVisible = true; | |
this.set_name("instance" + ++openfl_display_DisplayObject.__instanceCount); | |
if(openfl_display_DisplayObject.__initStage != null) { | |
this.stage = openfl_display_DisplayObject.__initStage; | |
openfl_display_DisplayObject.__initStage = null; | |
this.stage.addChild(this); | |
} | |
}; | |
$hxClasses["openfl.display.DisplayObject"] = openfl_display_DisplayObject; | |
openfl_display_DisplayObject.__name__ = ["openfl","display","DisplayObject"]; | |
openfl_display_DisplayObject.__interfaces__ = [openfl_display_IBitmapDrawable]; | |
openfl_display_DisplayObject.__initStage = null; | |
openfl_display_DisplayObject.enableFiltersFn = null; | |
openfl_display_DisplayObject.updateBitmapDataPools = function() { | |
openfl_display_DisplayObject.__hwpool.incTime(); | |
openfl_display_DisplayObject.__swpool.incTime(); | |
}; | |
openfl_display_DisplayObject.__supportDOM = null; | |
openfl_display_DisplayObject.__calculateAbsoluteTransform = function(local,parentTransform,target) { | |
target.a = local.a * parentTransform.a + local.b * parentTransform.c; | |
target.b = local.a * parentTransform.b + local.b * parentTransform.d; | |
target.c = local.c * parentTransform.a + local.d * parentTransform.c; | |
target.d = local.c * parentTransform.b + local.d * parentTransform.d; | |
target.tx = local.tx * parentTransform.a + local.ty * parentTransform.c + parentTransform.tx; | |
target.ty = local.tx * parentTransform.b + local.ty * parentTransform.d + parentTransform.ty; | |
}; | |
openfl_display_DisplayObject.__super__ = openfl_events_EventDispatcher; | |
openfl_display_DisplayObject.prototype = $extend(openfl_events_EventDispatcher.prototype,{ | |
sx: null | |
,sy: null | |
,__useFilters: null | |
,__toPool: function(bd) { | |
if(bd != null) { | |
bd.pool.put(bd); | |
} | |
} | |
,__bmpToPool: function(bmp) { | |
bmp.set_bitmapData(null); | |
openfl_display_DisplayObject.__bmpPool.push(bmp); | |
} | |
,__bmpFromPool: function() { | |
if(openfl_display_DisplayObject.__bmpPool.length > 0) { | |
return openfl_display_DisplayObject.__bmpPool.pop(); | |
} else { | |
return new openfl_display_Bitmap(); | |
} | |
} | |
,__serial: null | |
,opaqueBackground: null | |
,parent: null | |
,stage: null | |
,__fsi: null | |
,__alpha: null | |
,__blendMode: null | |
,__cacheAsBitmap: null | |
,__cacheAsBitmapMatrix: null | |
,__cacheBitmap: null | |
,__cacheBitmapBackground: null | |
,__cacheBitmapColorTransform: null | |
,__cacheBitmapMatrix: null | |
,__cacheBitmapRenderer: null | |
,__cairo: null | |
,__children: null | |
,__customRenderClear: null | |
,__customRenderEvent: null | |
,__filters: null | |
,__graphics: null | |
,__interactive: null | |
,__isCacheBitmapRender: null | |
,__isMask: null | |
,__loaderInfo: null | |
,__mask: null | |
,__maskTarget: null | |
,__name: null | |
,__objectTransform: null | |
,__renderable: null | |
,__renderDirty: null | |
,__renderParent: null | |
,__renderTransform: null | |
,__renderTransformCache: null | |
,__renderTransformChanged: null | |
,__rotation: null | |
,__rotationCosine: null | |
,__rotationSine: null | |
,__scale9Grid: null | |
,__scaleX: null | |
,__scaleY: null | |
,__scrollRect: null | |
,__shader: null | |
,__tempPoint: null | |
,__transform: null | |
,__transformDirty: null | |
,__visible: null | |
,__worldAlpha: null | |
,__worldAlphaChanged: null | |
,__worldBlendMode: null | |
,__worldClip: null | |
,__worldClipChanged: null | |
,__worldColorTransform: null | |
,__worldShader: null | |
,__worldScale9Grid: null | |
,__worldTransform: null | |
,__worldVisible: null | |
,__worldVisibleChanged: null | |
,__worldTransformInvalid: null | |
,__worldZ: null | |
,__canvas: null | |
,__context: null | |
,__style: null | |
,__enterFrameListeners: null | |
,cloneFromSymbol: function() { | |
throw new js__$Boot_HaxeError("override me"); | |
} | |
,addEventListener: function(type,listener,useCapture,priority,useWeakReference) { | |
if(useWeakReference == null) { | |
useWeakReference = false; | |
} | |
if(priority == null) { | |
priority = 0; | |
} | |
if(useCapture == null) { | |
useCapture = false; | |
} | |
switch(type) { | |
case "activate":case "deactivate":case "enterFrame":case "exitFrame":case "frameConstructed":case "render": | |
if(!openfl_display_DisplayObject.__broadcastEvents.exists(type)) { | |
openfl_display_DisplayObject.__broadcastEvents.set(type,[]); | |
} | |
var dispatchers = openfl_display_DisplayObject.__broadcastEvents.get(type); | |
if(dispatchers.indexOf(this) == -1) { | |
dispatchers.push(this); | |
} | |
break; | |
case "clearDOM":case "renderCairo":case "renderCanvas":case "renderDOM":case "renderOpenGL": | |
if(this.__customRenderEvent == null) { | |
this.__customRenderEvent = new openfl_events_RenderEvent(null); | |
this.__customRenderEvent.objectColorTransform = new openfl_geom_ColorTransform(); | |
this.__customRenderEvent.objectMatrix = new openfl_geom_Matrix(); | |
this.__customRenderClear = true; | |
} | |
break; | |
default: | |
} | |
openfl_events_EventDispatcher.prototype.addEventListener.call(this,type,listener,useCapture,priority,useWeakReference); | |
} | |
,dispatchEvent: function(event) { | |
if(js_Boot.__instanceof(event,openfl_events_MouseEvent)) { | |
var mouseEvent = event; | |
var _this = this.__getRenderTransform(); | |
mouseEvent.stageX = mouseEvent.localX * _this.a + mouseEvent.localY * _this.c + _this.tx; | |
var _this1 = this.__getRenderTransform(); | |
mouseEvent.stageY = mouseEvent.localX * _this1.b + mouseEvent.localY * _this1.d + _this1.ty; | |
} else if(js_Boot.__instanceof(event,openfl_events_TouchEvent)) { | |
var touchEvent = event; | |
var _this2 = this.__getRenderTransform(); | |
touchEvent.stageX = touchEvent.localX * _this2.a + touchEvent.localY * _this2.c + _this2.tx; | |
var _this3 = this.__getRenderTransform(); | |
touchEvent.stageY = touchEvent.localX * _this3.b + touchEvent.localY * _this3.d + _this3.ty; | |
} | |
event.target = this; | |
return this.__dispatchWithCapture(event); | |
} | |
,getBounds: function(targetCoordinateSpace) { | |
var matrix = openfl_geom_Matrix.__pool.get(); | |
if(targetCoordinateSpace != null && targetCoordinateSpace != this) { | |
matrix.copyFrom(this.__getWorldTransform()); | |
var targetMatrix = openfl_geom_Matrix.__pool.get(); | |
targetMatrix.copyFrom(targetCoordinateSpace.__getWorldTransform()); | |
targetMatrix.invert(); | |
matrix.concat(targetMatrix); | |
openfl_geom_Matrix.__pool.release(targetMatrix); | |
} else { | |
matrix.identity(); | |
} | |
var bounds = new openfl_geom_Rectangle(); | |
this.__getBounds(bounds,matrix); | |
openfl_geom_Matrix.__pool.release(matrix); | |
return bounds; | |
} | |
,getVisibleBounds: function(targetCoordinateSpace) { | |
var matrix = openfl_geom_Matrix.__pool.get(); | |
if(targetCoordinateSpace != null && targetCoordinateSpace != this) { | |
matrix.copyFrom(this.__getWorldTransform()); | |
var targetMatrix = openfl_geom_Matrix.__pool.get(); | |
targetMatrix.copyFrom(targetCoordinateSpace.__getWorldTransform()); | |
targetMatrix.invert(); | |
matrix.concat(targetMatrix); | |
openfl_geom_Matrix.__pool.release(targetMatrix); | |
} else { | |
matrix.identity(); | |
} | |
var bounds = new openfl_geom_Rectangle(); | |
this.__getVisibleBounds(bounds,matrix); | |
openfl_geom_Matrix.__pool.release(matrix); | |
return bounds; | |
} | |
,getRect: function(targetCoordinateSpace) { | |
return this.getBounds(targetCoordinateSpace); | |
} | |
,globalToLocal: function(pos) { | |
return this.__globalToLocal(pos,new openfl_geom_Point()); | |
} | |
,hitTestObject: function(obj) { | |
if(obj != null && obj.parent != null && this.parent != null) { | |
var currentBounds = this.getBounds(this); | |
var targetBounds = obj.getBounds(this); | |
return currentBounds.intersects(targetBounds); | |
} | |
return false; | |
} | |
,hitTestPoint: function(x,y,shapeFlag) { | |
if(shapeFlag == null) { | |
shapeFlag = false; | |
} | |
if(this.stage != null) { | |
return this.__hitTest(x,y,shapeFlag,null,false,this); | |
} else { | |
return false; | |
} | |
} | |
,invalidate: function() { | |
if(!this.__renderDirty) { | |
this.__renderDirty = true; | |
this.__setParentRenderDirty(); | |
} | |
} | |
,localToGlobal: function(point) { | |
return this.__getRenderTransform().transformPoint(point); | |
} | |
,removeEventListener: function(type,listener,useCapture) { | |
if(useCapture == null) { | |
useCapture = false; | |
} | |
openfl_events_EventDispatcher.prototype.removeEventListener.call(this,type,listener,useCapture); | |
switch(type) { | |
case "activate":case "deactivate":case "enterFrame":case "exitFrame":case "frameConstructed":case "render": | |
if(!this.hasEventListener(type)) { | |
if(openfl_display_DisplayObject.__broadcastEvents.exists(type)) { | |
HxOverrides.remove(openfl_display_DisplayObject.__broadcastEvents.get(type),this); | |
} | |
} | |
break; | |
case "clearDOM":case "renderCairo":case "renderCanvas":case "renderDOM":case "renderOpenGL": | |
if(!this.hasEventListener("clearDOM") && !this.hasEventListener("renderCairo") && !this.hasEventListener("renderCanvas") && !this.hasEventListener("renderDOM") && !this.hasEventListener("renderOpenGL")) { | |
this.__customRenderEvent = null; | |
} | |
break; | |
default: | |
} | |
} | |
,__cleanup: function() { | |
this.__cairo = null; | |
this.__canvas = null; | |
this.__context = null; | |
if(this.__graphics != null) { | |
this.__graphics.__cleanup(); | |
} | |
if(this.__cacheBitmap != null) { | |
this.__toPool(this.__cacheBitmap.__bitmapData); | |
this.__bmpToPool(this.__cacheBitmap); | |
this.__cacheBitmap = null; | |
} | |
} | |
,__dispatch: function(event) { | |
if(this.__eventMap != null && this.hasEventListener(event.type)) { | |
var result = openfl_events_EventDispatcher.prototype.__dispatchEvent.call(this,event); | |
if(event.__isCanceled) { | |
return true; | |
} | |
return result; | |
} | |
return true; | |
} | |
,__dispatchChildren: function(event) { | |
} | |
,__dispatchEvent: function(event) { | |
var parent = event.bubbles ? this.parent : null; | |
var result = openfl_events_EventDispatcher.prototype.__dispatchEvent.call(this,event); | |
if(event.__isCanceled) { | |
return true; | |
} | |
if(parent != null && parent != this) { | |
event.eventPhase = 3; | |
if(event.target == null) { | |
event.target = this; | |
} | |
parent.__dispatchEvent(event); | |
} | |
return result; | |
} | |
,__dispatchWithCapture: function(event) { | |
if(event.target == null) { | |
event.target = this; | |
} | |
if(this.parent != null) { | |
event.eventPhase = 1; | |
if(this.parent == this.stage) { | |
this.parent.__dispatch(event); | |
} else { | |
var stack = openfl_display_DisplayObject.__tempStack.get(); | |
var parent = this.parent; | |
var i = 0; | |
while(parent != null) { | |
stack.set(i,parent); | |
parent = parent.parent; | |
++i; | |
} | |
var _g1 = 0; | |
var _g = i; | |
while(_g1 < _g) { | |
var j = _g1++; | |
stack.get(i - j - 1).__dispatch(event); | |
} | |
openfl_display_DisplayObject.__tempStack.release(stack); | |
} | |
} | |
event.eventPhase = 2; | |
return this.__dispatchEvent(event); | |
} | |
,__initFrame: function() { | |
} | |
,__enterFrame: function(deltaTime) { | |
} | |
,__getVisibleBounds: function(rect,matrix) { | |
if(!this.__visible || this.__alpha == 0) { | |
return; | |
} | |
if(this.__graphics != null) { | |
this.__graphics.__getBounds(rect,matrix); | |
} | |
} | |
,__getBounds: function(rect,matrix) { | |
if(this.__graphics != null) { | |
this.__graphics.__getBounds(rect,matrix); | |
} | |
} | |
,__getCursor: function() { | |
return null; | |
} | |
,__getFilterBounds: function(rect,matrix) { | |
this.__getRenderBounds(rect,matrix); | |
if(this.__filters != null) { | |
var extension = openfl_geom_Rectangle.__pool.get(); | |
var _g = 0; | |
var _g1 = this.__filters; | |
while(_g < _g1.length) { | |
var filter = _g1[_g]; | |
++_g; | |
extension.__expand(-filter.__leftExtension,-filter.__topExtension,filter.__leftExtension + filter.__rightExtension,filter.__topExtension + filter.__bottomExtension); | |
} | |
rect.width += extension.width; | |
rect.height += extension.height; | |
rect.x += extension.x; | |
rect.y += extension.y; | |
openfl_geom_Rectangle.__pool.release(extension); | |
} | |
} | |
,__getInteractive: function(stack) { | |
return false; | |
} | |
,__getLocalBounds: function(rect) { | |
this.__getBounds(rect,this.__transform); | |
rect.x -= this.__transform.tx; | |
rect.y -= this.__transform.ty; | |
} | |
,__getRenderBounds: function(rect,matrix) { | |
if(this.__scrollRect == null) { | |
this.__getBounds(rect,matrix); | |
} else { | |
var r = openfl_geom_Rectangle.__pool.get(); | |
r.copyFrom(this.__scrollRect); | |
r.__transform(r,matrix); | |
rect.__expand(r.x,r.y,r.width,r.height); | |
openfl_geom_Rectangle.__pool.release(r); | |
} | |
} | |
,__getRenderTransform: function() { | |
this.__getWorldTransform(); | |
return this.__renderTransform; | |
} | |
,__getWorldTransform: function() { | |
var transformDirty = this.__transformDirty || this.__worldTransformInvalid; | |
if(transformDirty) { | |
var list = []; | |
var current = this; | |
if(this.parent == null) { | |
this.__update(true,false); | |
} else { | |
while(current != this.stage) { | |
list.push(current); | |
current = current.parent; | |
if(current == null) { | |
break; | |
} | |
} | |
} | |
var i = list.length; | |
while(--i >= 0) { | |
current = list[i]; | |
current.__update(true,false); | |
} | |
} | |
return this.__worldTransform; | |
} | |
,__globalToLocal: function(global,local) { | |
this.__getRenderTransform(); | |
if(global == local) { | |
var _this = this.__renderTransform; | |
var norm = _this.a * _this.d - _this.b * _this.c; | |
if(norm == 0) { | |
global.x = -_this.tx; | |
global.y = -_this.ty; | |
} else { | |
var px = 1.0 / norm * (_this.c * (_this.ty - global.y) + _this.d * (global.x - _this.tx)); | |
global.y = 1.0 / norm * (_this.a * (global.y - _this.ty) + _this.b * (_this.tx - global.x)); | |
global.x = px; | |
} | |
} else { | |
var _this1 = this.__renderTransform; | |
var norm1 = _this1.a * _this1.d - _this1.b * _this1.c; | |
local.x = norm1 == 0 ? -_this1.tx : 1.0 / norm1 * (_this1.c * (_this1.ty - global.y) + _this1.d * (global.x - _this1.tx)); | |
var _this2 = this.__renderTransform; | |
var norm2 = _this2.a * _this2.d - _this2.b * _this2.c; | |
local.y = norm2 == 0 ? -_this2.ty : 1.0 / norm2 * (_this2.a * (global.y - _this2.ty) + _this2.b * (_this2.tx - global.x)); | |
} | |
return local; | |
} | |
,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) { | |
if(this.__graphics != null) { | |
if(!hitObject.__visible || this.__isMask) { | |
return false; | |
} | |
if(this.get_mask() != null && !this.get_mask().__hitTestMask(x,y)) { | |
return false; | |
} | |
if(this.__graphics.__hitTest(x,y,shapeFlag,this.__getRenderTransform())) { | |
if(stack != null && !interactiveOnly) { | |
stack.push(hitObject); | |
} | |
return true; | |
} | |
} | |
return false; | |
} | |
,__hitTestMask: function(x,y) { | |
if(this.__graphics != null) { | |
if(this.__graphics.__hitTest(x,y,true,this.__getRenderTransform())) { | |
return true; | |
} | |
} | |
return false; | |
} | |
,__readGraphicsData: function(graphicsData,recurse) { | |
if(this.__graphics != null) { | |
this.__graphics.__readGraphicsData(graphicsData); | |
} | |
} | |
,__renderCairo: function(renderer) { | |
} | |
,__renderCairoMask: function(renderer) { | |
} | |
,__renderCanvas: function(renderer) { | |
if(this.get_mask() == null || this.get_mask().get_width() > 0 && this.get_mask().get_height() > 0) { | |
this.__updateCacheBitmap(renderer,false); | |
if(this.__cacheBitmap != null && !this.__isCacheBitmapRender) { | |
var bitmap = this.__cacheBitmap; | |
if(!(!bitmap.__renderable)) { | |
var alpha = renderer.__getAlpha(bitmap.__worldAlpha); | |
if(alpha > 0 && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) { | |
var context = renderer.context; | |
renderer.__setBlendMode(bitmap.__worldBlendMode); | |
renderer.__pushMaskObject(bitmap,false); | |
lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(bitmap.__bitmapData.image); | |
context.globalAlpha = alpha; | |
var scrollRect = bitmap.__scrollRect; | |
renderer.setTransform(bitmap.__renderTransform,context); | |
if(!renderer.__allowSmoothing || !bitmap.smoothing) { | |
context.imageSmoothingEnabled = false; | |
} | |
if(scrollRect == null) { | |
context.drawImage(bitmap.__bitmapData.image.get_src(),0,0,bitmap.__bitmapData.image.width,bitmap.__bitmapData.image.height); | |
} else { | |
context.drawImage(bitmap.__bitmapData.image.get_src(),scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height); | |
} | |
if(!renderer.__allowSmoothing || !bitmap.smoothing) { | |
context.imageSmoothingEnabled = true; | |
} | |
renderer.__popMaskObject(bitmap,false); | |
} | |
} | |
} else if(!(this.opaqueBackground == null && this.__graphics == null)) { | |
if(!(!this.__renderable)) { | |
var alpha1 = renderer.__getAlpha(this.__worldAlpha); | |
if(!(alpha1 <= 0)) { | |
if(this.opaqueBackground != null && !this.__isCacheBitmapRender && this.get_width() > 0 && this.get_height() > 0) { | |
renderer.__setBlendMode(this.__worldBlendMode); | |
renderer.__pushMaskObject(this); | |
var context1 = renderer.context; | |
renderer.setTransform(this.__renderTransform,context1); | |
var color = this.opaqueBackground; | |
context1.fillStyle = "rgb(" + (color >>> 16 & 255) + "," + (color >>> 8 & 255) + "," + (color & 255) + ")"; | |
context1.fillRect(0,0,this.get_width(),this.get_height()); | |
renderer.__popMaskObject(this); | |
} | |
if(this.__graphics != null) { | |
if(!(!this.__renderable)) { | |
var alpha2 = renderer.__getAlpha(this.__worldAlpha); | |
if(!(alpha2 <= 0)) { | |
var graphics = this.__graphics; | |
if(graphics != null) { | |
graphics.__update(renderer.__worldTransform); | |
if(graphics.__softwareDirty) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.hitTesting = false; | |
openfl__$internal_renderer_canvas_CanvasGraphics.graphics = graphics; | |
openfl__$internal_renderer_canvas_CanvasGraphics.allowSmoothing = renderer.__allowSmoothing; | |
openfl__$internal_renderer_canvas_CanvasGraphics.worldAlpha = renderer.__getAlpha(graphics.__owner.__worldAlpha); | |
openfl__$internal_renderer_canvas_CanvasGraphics.bounds = graphics.__bounds; | |
var width = graphics.__width; | |
var height = graphics.__height; | |
if(!graphics.__visible || graphics.__commands.get_length() == 0 || openfl__$internal_renderer_canvas_CanvasGraphics.bounds == null || width < 1 || height < 1) { | |
graphics.__canvas = null; | |
graphics.__context = null; | |
if(graphics.__bitmap != null) { | |
graphics.__bitmap.dispose(); | |
graphics.__bitmap = null; | |
} | |
} else { | |
if(graphics.__canvas == null) { | |
graphics.__canvas = window.document.createElement("canvas"); | |
graphics.__context = graphics.__canvas.getContext("2d"); | |
} | |
openfl__$internal_renderer_canvas_CanvasGraphics.context = graphics.__context; | |
var transform = graphics.__renderTransform; | |
var canvas = graphics.__canvas; | |
var scale = renderer.pixelRatio; | |
var scaledWidth = width * scale | 0; | |
var scaledHeight = height * scale | 0; | |
renderer.__setBlendModeContext(openfl__$internal_renderer_canvas_CanvasGraphics.context,10); | |
if(renderer.__isDOM) { | |
if(canvas.width == scaledWidth && canvas.height == scaledHeight) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.context.clearRect(0,0,scaledWidth,scaledHeight); | |
} else { | |
canvas.width = scaledWidth; | |
canvas.height = scaledHeight; | |
canvas.style.width = width + "px"; | |
canvas.style.height = height + "px"; | |
} | |
var transform1 = graphics.__renderTransform; | |
openfl__$internal_renderer_canvas_CanvasGraphics.context.setTransform(transform1.a * scale,transform1.b * scale,transform1.c * scale,transform1.d * scale,transform1.tx * scale,transform1.ty * scale); | |
} else { | |
if(canvas.width == scaledWidth && canvas.height == scaledHeight) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.context.closePath(); | |
openfl__$internal_renderer_canvas_CanvasGraphics.context.setTransform(1,0,0,1,0,0); | |
openfl__$internal_renderer_canvas_CanvasGraphics.context.clearRect(0,0,scaledWidth,scaledHeight); | |
} else { | |
canvas.width = width; | |
canvas.height = height; | |
} | |
openfl__$internal_renderer_canvas_CanvasGraphics.context.setTransform(transform.a,transform.b,transform.c,transform.d,transform.tx,transform.ty); | |
} | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.clear(); | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.clear(); | |
openfl__$internal_renderer_canvas_CanvasGraphics.hasFill = false; | |
openfl__$internal_renderer_canvas_CanvasGraphics.hasStroke = false; | |
openfl__$internal_renderer_canvas_CanvasGraphics.bitmapFill = null; | |
openfl__$internal_renderer_canvas_CanvasGraphics.bitmapRepeat = false; | |
var hasLineStyle = false; | |
var initStrokeX = 0.0; | |
var initStrokeY = 0.0; | |
openfl__$internal_renderer_canvas_CanvasGraphics.windingRule = "evenodd"; | |
var data = new openfl__$internal_renderer_DrawCommandReader(graphics.__commands); | |
var _g = 0; | |
var _g1 = graphics.__commands.types; | |
while(_g < _g1.length) { | |
var type = _g1[_g]; | |
++_g; | |
switch(type[1]) { | |
case 0:case 1:case 2:case 3: | |
openfl__$internal_renderer_canvas_CanvasGraphics.endFill(); | |
openfl__$internal_renderer_canvas_CanvasGraphics.endStroke(); | |
if(type == openfl__$internal_renderer_DrawCommandType.BEGIN_BITMAP_FILL) { | |
var _g2 = data.prev; | |
switch(_g2[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.BEGIN_BITMAP_FILL; | |
var this1 = data; | |
var c = this1; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.beginBitmapFill(c.buffer.o[c.oPos],c.buffer.o[c.oPos + 1],c.buffer.b[c.bPos],c.buffer.b[c.bPos + 1]); | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.beginBitmapFill(c.buffer.o[c.oPos],c.buffer.o[c.oPos + 1],c.buffer.b[c.bPos],c.buffer.b[c.bPos + 1]); | |
} else if(type == openfl__$internal_renderer_DrawCommandType.BEGIN_GRADIENT_FILL) { | |
var _g3 = data.prev; | |
switch(_g3[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.BEGIN_GRADIENT_FILL; | |
var this2 = data; | |
var c1 = this2; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.beginGradientFill(c1.buffer.o[c1.oPos],c1.buffer.ii[c1.iiPos],c1.buffer.ff[c1.ffPos],c1.buffer.ii[c1.iiPos + 1],c1.buffer.o[c1.oPos + 1],c1.buffer.o[c1.oPos + 2],c1.buffer.o[c1.oPos + 3],c1.buffer.f[c1.fPos]); | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.beginGradientFill(c1.buffer.o[c1.oPos],c1.buffer.ii[c1.iiPos],c1.buffer.ff[c1.ffPos],c1.buffer.ii[c1.iiPos + 1],c1.buffer.o[c1.oPos + 1],c1.buffer.o[c1.oPos + 2],c1.buffer.o[c1.oPos + 3],c1.buffer.f[c1.fPos]); | |
} else if(type == openfl__$internal_renderer_DrawCommandType.BEGIN_SHADER_FILL) { | |
var _g4 = data.prev; | |
switch(_g4[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.BEGIN_SHADER_FILL; | |
var this3 = data; | |
var c2 = this3; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.beginShaderFill(c2.buffer.o[c2.oPos]); | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.beginShaderFill(c2.buffer.o[c2.oPos]); | |
} else { | |
var _g5 = data.prev; | |
switch(_g5[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.BEGIN_FILL; | |
var this4 = data; | |
var c3 = this4; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.beginFill(c3.buffer.i[c3.iPos],c3.buffer.f[c3.fPos]); | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.beginFill(c3.buffer.i[c3.iPos],c3.buffer.f[c3.fPos]); | |
} | |
break; | |
case 4: | |
var _g6 = data.prev; | |
switch(_g6[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.CUBIC_CURVE_TO; | |
var this5 = data; | |
var c4 = this5; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.cubicCurveTo(c4.buffer.f[c4.fPos],c4.buffer.f[c4.fPos + 1],c4.buffer.f[c4.fPos + 2],c4.buffer.f[c4.fPos + 3],c4.buffer.f[c4.fPos + 4],c4.buffer.f[c4.fPos + 5]); | |
if(hasLineStyle) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.cubicCurveTo(c4.buffer.f[c4.fPos],c4.buffer.f[c4.fPos + 1],c4.buffer.f[c4.fPos + 2],c4.buffer.f[c4.fPos + 3],c4.buffer.f[c4.fPos + 4],c4.buffer.f[c4.fPos + 5]); | |
} else { | |
initStrokeX = c4.buffer.f[c4.fPos + 4]; | |
initStrokeY = c4.buffer.f[c4.fPos + 5]; | |
} | |
break; | |
case 5: | |
var _g7 = data.prev; | |
switch(_g7[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.CURVE_TO; | |
var this6 = data; | |
var c5 = this6; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.curveTo(c5.buffer.f[c5.fPos],c5.buffer.f[c5.fPos + 1],c5.buffer.f[c5.fPos + 2],c5.buffer.f[c5.fPos + 3]); | |
if(hasLineStyle) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.curveTo(c5.buffer.f[c5.fPos],c5.buffer.f[c5.fPos + 1],c5.buffer.f[c5.fPos + 2],c5.buffer.f[c5.fPos + 3]); | |
} else { | |
initStrokeX = c5.buffer.f[c5.fPos + 2]; | |
initStrokeY = c5.buffer.f[c5.fPos + 3]; | |
} | |
break; | |
case 6: | |
var _g8 = data.prev; | |
switch(_g8[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.DRAW_CIRCLE; | |
var this7 = data; | |
var c6 = this7; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.drawCircle(c6.buffer.f[c6.fPos],c6.buffer.f[c6.fPos + 1],c6.buffer.f[c6.fPos + 2]); | |
if(hasLineStyle) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.drawCircle(c6.buffer.f[c6.fPos],c6.buffer.f[c6.fPos + 1],c6.buffer.f[c6.fPos + 2]); | |
} | |
break; | |
case 7: | |
var _g9 = data.prev; | |
switch(_g9[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.DRAW_ELLIPSE; | |
var this8 = data; | |
var c7 = this8; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.drawEllipse(c7.buffer.f[c7.fPos],c7.buffer.f[c7.fPos + 1],c7.buffer.f[c7.fPos + 2],c7.buffer.f[c7.fPos + 3]); | |
if(hasLineStyle) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.drawEllipse(c7.buffer.f[c7.fPos],c7.buffer.f[c7.fPos + 1],c7.buffer.f[c7.fPos + 2],c7.buffer.f[c7.fPos + 3]); | |
} | |
break; | |
case 8: | |
var _g10 = data.prev; | |
switch(_g10[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.DRAW_QUADS; | |
var this9 = data; | |
var c8 = this9; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.drawQuads(c8.buffer.o[c8.oPos],c8.buffer.o[c8.oPos + 1],c8.buffer.o[c8.oPos + 2]); | |
break; | |
case 9: | |
var _g11 = data.prev; | |
switch(_g11[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.DRAW_RECT; | |
var this10 = data; | |
var c9 = this10; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.drawRect(c9.buffer.f[c9.fPos],c9.buffer.f[c9.fPos + 1],c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 3]); | |
if(hasLineStyle) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.drawRect(c9.buffer.f[c9.fPos],c9.buffer.f[c9.fPos + 1],c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 3]); | |
} | |
break; | |
case 10: | |
var _g12 = data.prev; | |
switch(_g12[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.DRAW_ROUND_RECT; | |
var this11 = data; | |
var c10 = this11; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.drawRoundRect(c10.buffer.f[c10.fPos],c10.buffer.f[c10.fPos + 1],c10.buffer.f[c10.fPos + 2],c10.buffer.f[c10.fPos + 3],c10.buffer.f[c10.fPos + 4],c10.buffer.o[c10.oPos]); | |
if(hasLineStyle) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.drawRoundRect(c10.buffer.f[c10.fPos],c10.buffer.f[c10.fPos + 1],c10.buffer.f[c10.fPos + 2],c10.buffer.f[c10.fPos + 3],c10.buffer.f[c10.fPos + 4],c10.buffer.o[c10.oPos]); | |
} | |
break; | |
case 12: | |
var _g13 = data.prev; | |
switch(_g13[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.DRAW_TRIANGLES; | |
var this12 = data; | |
var c11 = this12; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.drawTriangles(c11.buffer.o[c11.oPos],c11.buffer.o[c11.oPos + 1],c11.buffer.o[c11.oPos + 2],c11.buffer.o[c11.oPos + 3]); | |
break; | |
case 13: | |
var _g14 = data.prev; | |
switch(_g14[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.END_FILL; | |
var this13 = data; | |
openfl__$internal_renderer_canvas_CanvasGraphics.endFill(); | |
openfl__$internal_renderer_canvas_CanvasGraphics.endStroke(); | |
openfl__$internal_renderer_canvas_CanvasGraphics.hasFill = false; | |
hasLineStyle = false; | |
openfl__$internal_renderer_canvas_CanvasGraphics.bitmapFill = null; | |
initStrokeX = 0; | |
initStrokeY = 0; | |
break; | |
case 14: | |
var _g15 = data.prev; | |
switch(_g15[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.LINE_BITMAP_STYLE; | |
var this14 = data; | |
var c12 = this14; | |
if(!hasLineStyle && (initStrokeX != 0 || initStrokeY != 0)) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.moveTo(initStrokeX,initStrokeY); | |
initStrokeX = 0; | |
initStrokeY = 0; | |
} | |
hasLineStyle = true; | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.lineBitmapStyle(c12.buffer.o[c12.oPos],c12.buffer.o[c12.oPos + 1],c12.buffer.b[c12.bPos],c12.buffer.b[c12.bPos + 1]); | |
break; | |
case 15: | |
var _g16 = data.prev; | |
switch(_g16[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.LINE_GRADIENT_STYLE; | |
var this15 = data; | |
var c13 = this15; | |
if(!hasLineStyle && (initStrokeX != 0 || initStrokeY != 0)) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.moveTo(initStrokeX,initStrokeY); | |
initStrokeX = 0; | |
initStrokeY = 0; | |
} | |
hasLineStyle = true; | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.lineGradientStyle(c13.buffer.o[c13.oPos],c13.buffer.ii[c13.iiPos],c13.buffer.ff[c13.ffPos],c13.buffer.ii[c13.iiPos + 1],c13.buffer.o[c13.oPos + 1],c13.buffer.o[c13.oPos + 2],c13.buffer.o[c13.oPos + 3],c13.buffer.f[c13.fPos]); | |
break; | |
case 16: | |
var _g17 = data.prev; | |
switch(_g17[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.LINE_STYLE; | |
var this16 = data; | |
var c14 = this16; | |
if(!hasLineStyle && c14.buffer.o[c14.oPos] != null) { | |
if(initStrokeX != 0 || initStrokeY != 0) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.moveTo(initStrokeX,initStrokeY); | |
initStrokeX = 0; | |
initStrokeY = 0; | |
} | |
} | |
hasLineStyle = c14.buffer.o[c14.oPos] != null; | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.lineStyle(c14.buffer.o[c14.oPos],c14.buffer.i[c14.iPos],c14.buffer.f[c14.fPos],c14.buffer.b[c14.bPos],c14.buffer.o[c14.oPos + 1],c14.buffer.o[c14.oPos + 2],c14.buffer.o[c14.oPos + 3],c14.buffer.f[c14.fPos + 1]); | |
break; | |
case 17: | |
var _g18 = data.prev; | |
switch(_g18[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.LINE_TO; | |
var this17 = data; | |
var c15 = this17; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.lineTo(c15.buffer.f[c15.fPos],c15.buffer.f[c15.fPos + 1]); | |
if(hasLineStyle) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.lineTo(c15.buffer.f[c15.fPos],c15.buffer.f[c15.fPos + 1]); | |
} else { | |
initStrokeX = c15.buffer.f[c15.fPos]; | |
initStrokeY = c15.buffer.f[c15.fPos + 1]; | |
} | |
break; | |
case 18: | |
var _g19 = data.prev; | |
switch(_g19[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.MOVE_TO; | |
var this18 = data; | |
var c16 = this18; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.moveTo(c16.buffer.f[c16.fPos],c16.buffer.f[c16.fPos + 1]); | |
if(hasLineStyle) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.moveTo(c16.buffer.f[c16.fPos],c16.buffer.f[c16.fPos + 1]); | |
} else { | |
initStrokeX = c16.buffer.f[c16.fPos]; | |
initStrokeY = c16.buffer.f[c16.fPos + 1]; | |
} | |
break; | |
case 19: | |
var _g20 = data.prev; | |
switch(_g20[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.OVERRIDE_BLEND_MODE; | |
var this19 = data; | |
var c17 = this19; | |
renderer.__setBlendModeContext(openfl__$internal_renderer_canvas_CanvasGraphics.context,c17.buffer.o[c17.oPos]); | |
break; | |
case 21: | |
var _g21 = data.prev; | |
switch(_g21[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.WINDING_EVEN_ODD; | |
var this20 = data; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.windingEvenOdd(); | |
openfl__$internal_renderer_canvas_CanvasGraphics.windingRule = "evenodd"; | |
break; | |
case 22: | |
var _g22 = data.prev; | |
switch(_g22[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.WINDING_NON_ZERO; | |
var this21 = data; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.windingNonZero(); | |
openfl__$internal_renderer_canvas_CanvasGraphics.windingRule = "nonzero"; | |
break; | |
default: | |
var _g23 = data.prev; | |
switch(_g23[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = type; | |
} | |
} | |
if(openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.get_length() > 0) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.endFill(); | |
} | |
if(openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.get_length() > 0) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.endStroke(); | |
} | |
data.destroy(); | |
graphics.__bitmap = openfl_display_BitmapData.fromCanvas(graphics.__canvas); | |
} | |
graphics.__softwareDirty = false; | |
graphics.set___dirty(false); | |
} | |
var width1 = graphics.__width; | |
var height1 = graphics.__height; | |
var canvas1 = graphics.__canvas; | |
if(canvas1 != null && graphics.__visible && width1 >= 1 && height1 >= 1) { | |
var transform2 = graphics.__worldTransform; | |
var context2 = renderer.context; | |
var scrollRect1 = this.__scrollRect; | |
var scale9Grid = this.__worldScale9Grid; | |
if(scrollRect1 == null || scrollRect1.width > 0 && scrollRect1.height > 0) { | |
renderer.__setBlendMode(this.__worldBlendMode); | |
renderer.__pushMaskObject(this); | |
context2.globalAlpha = alpha2; | |
if(scale9Grid != null && transform2.b == 0 && transform2.c == 0) { | |
context2.setTransform(1,0,0,1,transform2.tx,transform2.ty); | |
var bounds = graphics.__bounds; | |
var scaleX = graphics.__renderTransform.a; | |
var scaleY = graphics.__renderTransform.d; | |
var renderScaleX = transform2.a; | |
var renderScaleY = transform2.d; | |
var left = Math.max(1,Math.round(scale9Grid.x * scaleX)); | |
var top = Math.round(scale9Grid.y * scaleY); | |
var right = Math.max(1,Math.round((bounds.get_right() - scale9Grid.get_right()) * scaleX)); | |
var bottom = Math.round((bounds.get_bottom() - scale9Grid.get_bottom()) * scaleY); | |
var centerWidth = Math.round(scale9Grid.width * scaleX); | |
var centerHeight = Math.round(scale9Grid.height * scaleY); | |
var renderLeft = Math.round(scale9Grid.x * renderScaleX); | |
var renderTop = Math.round(scale9Grid.y * renderScaleY); | |
var renderRight = Math.round((bounds.get_right() - scale9Grid.get_right()) * renderScaleX); | |
var renderBottom = Math.round((bounds.get_bottom() - scale9Grid.get_bottom()) * renderScaleY); | |
var renderCenterWidth = Math.round(width1 * renderScaleX) - renderLeft - renderRight; | |
var renderCenterHeight = Math.round(height1 * renderScaleY) - renderTop - renderBottom; | |
renderer.applySmoothing(context2,false); | |
if(centerWidth != 0 && centerHeight != 0) { | |
context2.drawImage(canvas1,0,0,left,top,0,0,renderLeft,renderTop); | |
context2.drawImage(canvas1,left,0,centerWidth,top,renderLeft,0,renderCenterWidth,renderTop); | |
context2.drawImage(canvas1,left + centerWidth,0,right,top,renderLeft + renderCenterWidth,0,renderRight,renderTop); | |
context2.drawImage(canvas1,0,top,left,centerHeight,0,renderTop,renderLeft,renderCenterHeight); | |
context2.drawImage(canvas1,left,top,centerWidth,centerHeight,renderLeft,renderTop,renderCenterWidth,renderCenterHeight); | |
context2.drawImage(canvas1,left + centerWidth,top,right,centerHeight,renderLeft + renderCenterWidth,renderTop,renderRight,renderCenterHeight); | |
context2.drawImage(canvas1,0,top + centerHeight,left,bottom,0,renderTop + renderCenterHeight,renderLeft,renderBottom); | |
context2.drawImage(canvas1,left,top + centerHeight,centerWidth,bottom,renderLeft,renderTop + renderCenterHeight,renderCenterWidth,renderBottom); | |
context2.drawImage(canvas1,left + centerWidth,top + centerHeight,right,bottom,renderLeft + renderCenterWidth,renderTop + renderCenterHeight,renderRight,renderBottom); | |
} else if(centerWidth == 0 && centerHeight != 0) { | |
var renderWidth = renderLeft + renderCenterWidth + renderRight; | |
context2.drawImage(canvas1,0,0,width1,top,0,0,renderWidth,renderTop); | |
context2.drawImage(canvas1,0,top,width1,centerHeight,0,renderTop,renderWidth,renderCenterHeight); | |
context2.drawImage(canvas1,0,top + centerHeight,width1,bottom,0,renderTop + renderCenterHeight,renderWidth,renderBottom); | |
} else if(centerHeight == 0 && centerWidth != 0) { | |
var renderHeight = renderTop + renderCenterHeight + renderBottom; | |
context2.drawImage(canvas1,0,0,left,height1,0,0,renderLeft,renderHeight); | |
context2.drawImage(canvas1,left,0,centerWidth,height1,renderLeft,0,renderCenterWidth,renderHeight); | |
context2.drawImage(canvas1,left + centerWidth,0,right,height1,renderLeft + renderCenterWidth,0,renderRight,renderHeight); | |
} | |
} else { | |
renderer.setTransform(transform2,context2); | |
if(renderer.__isDOM) { | |
var reverseScale = 1 / renderer.pixelRatio; | |
context2.scale(reverseScale,reverseScale); | |
} | |
context2.drawImage(canvas1,0,0,width1,height1); | |
} | |
renderer.__popMaskObject(this); | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
this.__renderEvent(renderer); | |
} | |
,__renderCanvasMask: function(renderer) { | |
if(this.__graphics != null) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.renderMask(this.__graphics,renderer); | |
} | |
} | |
,__renderDOM: function(renderer) { | |
this.__updateCacheBitmap(renderer,false); | |
if(this.__cacheBitmap != null && !this.__isCacheBitmapRender) { | |
this.__renderDOMClear(renderer); | |
this.__cacheBitmap.stage = this.stage; | |
var bitmap = this.__cacheBitmap; | |
if(bitmap.stage != null && bitmap.__worldVisible && bitmap.__renderable && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) { | |
renderer.__pushMaskObject(bitmap); | |
if(bitmap.__bitmapData.image.buffer.__srcImage != null) { | |
openfl__$internal_renderer_dom_DOMBitmap.renderImage(bitmap,renderer); | |
} else { | |
openfl__$internal_renderer_dom_DOMBitmap.renderCanvas(bitmap,renderer); | |
} | |
renderer.__popMaskObject(bitmap); | |
} else { | |
openfl__$internal_renderer_dom_DOMBitmap.clear(bitmap,renderer); | |
} | |
} else { | |
var tmp = this.opaqueBackground != null && !this.__isCacheBitmapRender && this.get_width() > 0 && this.get_height() > 0; | |
var graphics = this.__graphics; | |
if(this.stage != null && this.__worldVisible && this.__renderable && graphics != null) { | |
var renderer1 = renderer.__canvasRenderer; | |
graphics.__update(renderer1.__worldTransform); | |
if(graphics.__softwareDirty) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.hitTesting = false; | |
openfl__$internal_renderer_canvas_CanvasGraphics.graphics = graphics; | |
openfl__$internal_renderer_canvas_CanvasGraphics.allowSmoothing = renderer1.__allowSmoothing; | |
openfl__$internal_renderer_canvas_CanvasGraphics.worldAlpha = renderer1.__getAlpha(graphics.__owner.__worldAlpha); | |
openfl__$internal_renderer_canvas_CanvasGraphics.bounds = graphics.__bounds; | |
var width = graphics.__width; | |
var height = graphics.__height; | |
if(!graphics.__visible || graphics.__commands.get_length() == 0 || openfl__$internal_renderer_canvas_CanvasGraphics.bounds == null || width < 1 || height < 1) { | |
graphics.__canvas = null; | |
graphics.__context = null; | |
if(graphics.__bitmap != null) { | |
graphics.__bitmap.dispose(); | |
graphics.__bitmap = null; | |
} | |
} else { | |
if(graphics.__canvas == null) { | |
graphics.__canvas = window.document.createElement("canvas"); | |
graphics.__context = graphics.__canvas.getContext("2d"); | |
} | |
openfl__$internal_renderer_canvas_CanvasGraphics.context = graphics.__context; | |
var transform = graphics.__renderTransform; | |
var canvas = graphics.__canvas; | |
var scale = renderer1.pixelRatio; | |
var scaledWidth = width * scale | 0; | |
var scaledHeight = height * scale | 0; | |
renderer1.__setBlendModeContext(openfl__$internal_renderer_canvas_CanvasGraphics.context,10); | |
if(renderer1.__isDOM) { | |
if(canvas.width == scaledWidth && canvas.height == scaledHeight) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.context.clearRect(0,0,scaledWidth,scaledHeight); | |
} else { | |
canvas.width = scaledWidth; | |
canvas.height = scaledHeight; | |
canvas.style.width = width + "px"; | |
canvas.style.height = height + "px"; | |
} | |
var transform1 = graphics.__renderTransform; | |
openfl__$internal_renderer_canvas_CanvasGraphics.context.setTransform(transform1.a * scale,transform1.b * scale,transform1.c * scale,transform1.d * scale,transform1.tx * scale,transform1.ty * scale); | |
} else { | |
if(canvas.width == scaledWidth && canvas.height == scaledHeight) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.context.closePath(); | |
openfl__$internal_renderer_canvas_CanvasGraphics.context.setTransform(1,0,0,1,0,0); | |
openfl__$internal_renderer_canvas_CanvasGraphics.context.clearRect(0,0,scaledWidth,scaledHeight); | |
} else { | |
canvas.width = width; | |
canvas.height = height; | |
} | |
openfl__$internal_renderer_canvas_CanvasGraphics.context.setTransform(transform.a,transform.b,transform.c,transform.d,transform.tx,transform.ty); | |
} | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.clear(); | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.clear(); | |
openfl__$internal_renderer_canvas_CanvasGraphics.hasFill = false; | |
openfl__$internal_renderer_canvas_CanvasGraphics.hasStroke = false; | |
openfl__$internal_renderer_canvas_CanvasGraphics.bitmapFill = null; | |
openfl__$internal_renderer_canvas_CanvasGraphics.bitmapRepeat = false; | |
var hasLineStyle = false; | |
var initStrokeX = 0.0; | |
var initStrokeY = 0.0; | |
openfl__$internal_renderer_canvas_CanvasGraphics.windingRule = "evenodd"; | |
var data = new openfl__$internal_renderer_DrawCommandReader(graphics.__commands); | |
var _g = 0; | |
var _g1 = graphics.__commands.types; | |
while(_g < _g1.length) { | |
var type = _g1[_g]; | |
++_g; | |
switch(type[1]) { | |
case 0:case 1:case 2:case 3: | |
openfl__$internal_renderer_canvas_CanvasGraphics.endFill(); | |
openfl__$internal_renderer_canvas_CanvasGraphics.endStroke(); | |
if(type == openfl__$internal_renderer_DrawCommandType.BEGIN_BITMAP_FILL) { | |
var _g2 = data.prev; | |
switch(_g2[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.BEGIN_BITMAP_FILL; | |
var this1 = data; | |
var c = this1; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.beginBitmapFill(c.buffer.o[c.oPos],c.buffer.o[c.oPos + 1],c.buffer.b[c.bPos],c.buffer.b[c.bPos + 1]); | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.beginBitmapFill(c.buffer.o[c.oPos],c.buffer.o[c.oPos + 1],c.buffer.b[c.bPos],c.buffer.b[c.bPos + 1]); | |
} else if(type == openfl__$internal_renderer_DrawCommandType.BEGIN_GRADIENT_FILL) { | |
var _g3 = data.prev; | |
switch(_g3[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.BEGIN_GRADIENT_FILL; | |
var this2 = data; | |
var c1 = this2; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.beginGradientFill(c1.buffer.o[c1.oPos],c1.buffer.ii[c1.iiPos],c1.buffer.ff[c1.ffPos],c1.buffer.ii[c1.iiPos + 1],c1.buffer.o[c1.oPos + 1],c1.buffer.o[c1.oPos + 2],c1.buffer.o[c1.oPos + 3],c1.buffer.f[c1.fPos]); | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.beginGradientFill(c1.buffer.o[c1.oPos],c1.buffer.ii[c1.iiPos],c1.buffer.ff[c1.ffPos],c1.buffer.ii[c1.iiPos + 1],c1.buffer.o[c1.oPos + 1],c1.buffer.o[c1.oPos + 2],c1.buffer.o[c1.oPos + 3],c1.buffer.f[c1.fPos]); | |
} else if(type == openfl__$internal_renderer_DrawCommandType.BEGIN_SHADER_FILL) { | |
var _g4 = data.prev; | |
switch(_g4[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.BEGIN_SHADER_FILL; | |
var this3 = data; | |
var c2 = this3; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.beginShaderFill(c2.buffer.o[c2.oPos]); | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.beginShaderFill(c2.buffer.o[c2.oPos]); | |
} else { | |
var _g5 = data.prev; | |
switch(_g5[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.BEGIN_FILL; | |
var this4 = data; | |
var c3 = this4; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.beginFill(c3.buffer.i[c3.iPos],c3.buffer.f[c3.fPos]); | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.beginFill(c3.buffer.i[c3.iPos],c3.buffer.f[c3.fPos]); | |
} | |
break; | |
case 4: | |
var _g6 = data.prev; | |
switch(_g6[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.CUBIC_CURVE_TO; | |
var this5 = data; | |
var c4 = this5; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.cubicCurveTo(c4.buffer.f[c4.fPos],c4.buffer.f[c4.fPos + 1],c4.buffer.f[c4.fPos + 2],c4.buffer.f[c4.fPos + 3],c4.buffer.f[c4.fPos + 4],c4.buffer.f[c4.fPos + 5]); | |
if(hasLineStyle) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.cubicCurveTo(c4.buffer.f[c4.fPos],c4.buffer.f[c4.fPos + 1],c4.buffer.f[c4.fPos + 2],c4.buffer.f[c4.fPos + 3],c4.buffer.f[c4.fPos + 4],c4.buffer.f[c4.fPos + 5]); | |
} else { | |
initStrokeX = c4.buffer.f[c4.fPos + 4]; | |
initStrokeY = c4.buffer.f[c4.fPos + 5]; | |
} | |
break; | |
case 5: | |
var _g7 = data.prev; | |
switch(_g7[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.CURVE_TO; | |
var this6 = data; | |
var c5 = this6; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.curveTo(c5.buffer.f[c5.fPos],c5.buffer.f[c5.fPos + 1],c5.buffer.f[c5.fPos + 2],c5.buffer.f[c5.fPos + 3]); | |
if(hasLineStyle) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.curveTo(c5.buffer.f[c5.fPos],c5.buffer.f[c5.fPos + 1],c5.buffer.f[c5.fPos + 2],c5.buffer.f[c5.fPos + 3]); | |
} else { | |
initStrokeX = c5.buffer.f[c5.fPos + 2]; | |
initStrokeY = c5.buffer.f[c5.fPos + 3]; | |
} | |
break; | |
case 6: | |
var _g8 = data.prev; | |
switch(_g8[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.DRAW_CIRCLE; | |
var this7 = data; | |
var c6 = this7; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.drawCircle(c6.buffer.f[c6.fPos],c6.buffer.f[c6.fPos + 1],c6.buffer.f[c6.fPos + 2]); | |
if(hasLineStyle) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.drawCircle(c6.buffer.f[c6.fPos],c6.buffer.f[c6.fPos + 1],c6.buffer.f[c6.fPos + 2]); | |
} | |
break; | |
case 7: | |
var _g9 = data.prev; | |
switch(_g9[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.DRAW_ELLIPSE; | |
var this8 = data; | |
var c7 = this8; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.drawEllipse(c7.buffer.f[c7.fPos],c7.buffer.f[c7.fPos + 1],c7.buffer.f[c7.fPos + 2],c7.buffer.f[c7.fPos + 3]); | |
if(hasLineStyle) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.drawEllipse(c7.buffer.f[c7.fPos],c7.buffer.f[c7.fPos + 1],c7.buffer.f[c7.fPos + 2],c7.buffer.f[c7.fPos + 3]); | |
} | |
break; | |
case 8: | |
var _g10 = data.prev; | |
switch(_g10[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.DRAW_QUADS; | |
var this9 = data; | |
var c8 = this9; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.drawQuads(c8.buffer.o[c8.oPos],c8.buffer.o[c8.oPos + 1],c8.buffer.o[c8.oPos + 2]); | |
break; | |
case 9: | |
var _g11 = data.prev; | |
switch(_g11[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.DRAW_RECT; | |
var this10 = data; | |
var c9 = this10; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.drawRect(c9.buffer.f[c9.fPos],c9.buffer.f[c9.fPos + 1],c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 3]); | |
if(hasLineStyle) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.drawRect(c9.buffer.f[c9.fPos],c9.buffer.f[c9.fPos + 1],c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 3]); | |
} | |
break; | |
case 10: | |
var _g12 = data.prev; | |
switch(_g12[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.DRAW_ROUND_RECT; | |
var this11 = data; | |
var c10 = this11; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.drawRoundRect(c10.buffer.f[c10.fPos],c10.buffer.f[c10.fPos + 1],c10.buffer.f[c10.fPos + 2],c10.buffer.f[c10.fPos + 3],c10.buffer.f[c10.fPos + 4],c10.buffer.o[c10.oPos]); | |
if(hasLineStyle) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.drawRoundRect(c10.buffer.f[c10.fPos],c10.buffer.f[c10.fPos + 1],c10.buffer.f[c10.fPos + 2],c10.buffer.f[c10.fPos + 3],c10.buffer.f[c10.fPos + 4],c10.buffer.o[c10.oPos]); | |
} | |
break; | |
case 12: | |
var _g13 = data.prev; | |
switch(_g13[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.DRAW_TRIANGLES; | |
var this12 = data; | |
var c11 = this12; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.drawTriangles(c11.buffer.o[c11.oPos],c11.buffer.o[c11.oPos + 1],c11.buffer.o[c11.oPos + 2],c11.buffer.o[c11.oPos + 3]); | |
break; | |
case 13: | |
var _g14 = data.prev; | |
switch(_g14[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.END_FILL; | |
var this13 = data; | |
openfl__$internal_renderer_canvas_CanvasGraphics.endFill(); | |
openfl__$internal_renderer_canvas_CanvasGraphics.endStroke(); | |
openfl__$internal_renderer_canvas_CanvasGraphics.hasFill = false; | |
hasLineStyle = false; | |
openfl__$internal_renderer_canvas_CanvasGraphics.bitmapFill = null; | |
initStrokeX = 0; | |
initStrokeY = 0; | |
break; | |
case 14: | |
var _g15 = data.prev; | |
switch(_g15[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.LINE_BITMAP_STYLE; | |
var this14 = data; | |
var c12 = this14; | |
if(!hasLineStyle && (initStrokeX != 0 || initStrokeY != 0)) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.moveTo(initStrokeX,initStrokeY); | |
initStrokeX = 0; | |
initStrokeY = 0; | |
} | |
hasLineStyle = true; | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.lineBitmapStyle(c12.buffer.o[c12.oPos],c12.buffer.o[c12.oPos + 1],c12.buffer.b[c12.bPos],c12.buffer.b[c12.bPos + 1]); | |
break; | |
case 15: | |
var _g16 = data.prev; | |
switch(_g16[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.LINE_GRADIENT_STYLE; | |
var this15 = data; | |
var c13 = this15; | |
if(!hasLineStyle && (initStrokeX != 0 || initStrokeY != 0)) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.moveTo(initStrokeX,initStrokeY); | |
initStrokeX = 0; | |
initStrokeY = 0; | |
} | |
hasLineStyle = true; | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.lineGradientStyle(c13.buffer.o[c13.oPos],c13.buffer.ii[c13.iiPos],c13.buffer.ff[c13.ffPos],c13.buffer.ii[c13.iiPos + 1],c13.buffer.o[c13.oPos + 1],c13.buffer.o[c13.oPos + 2],c13.buffer.o[c13.oPos + 3],c13.buffer.f[c13.fPos]); | |
break; | |
case 16: | |
var _g17 = data.prev; | |
switch(_g17[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.LINE_STYLE; | |
var this16 = data; | |
var c14 = this16; | |
if(!hasLineStyle && c14.buffer.o[c14.oPos] != null) { | |
if(initStrokeX != 0 || initStrokeY != 0) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.moveTo(initStrokeX,initStrokeY); | |
initStrokeX = 0; | |
initStrokeY = 0; | |
} | |
} | |
hasLineStyle = c14.buffer.o[c14.oPos] != null; | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.lineStyle(c14.buffer.o[c14.oPos],c14.buffer.i[c14.iPos],c14.buffer.f[c14.fPos],c14.buffer.b[c14.bPos],c14.buffer.o[c14.oPos + 1],c14.buffer.o[c14.oPos + 2],c14.buffer.o[c14.oPos + 3],c14.buffer.f[c14.fPos + 1]); | |
break; | |
case 17: | |
var _g18 = data.prev; | |
switch(_g18[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.LINE_TO; | |
var this17 = data; | |
var c15 = this17; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.lineTo(c15.buffer.f[c15.fPos],c15.buffer.f[c15.fPos + 1]); | |
if(hasLineStyle) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.lineTo(c15.buffer.f[c15.fPos],c15.buffer.f[c15.fPos + 1]); | |
} else { | |
initStrokeX = c15.buffer.f[c15.fPos]; | |
initStrokeY = c15.buffer.f[c15.fPos + 1]; | |
} | |
break; | |
case 18: | |
var _g19 = data.prev; | |
switch(_g19[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.MOVE_TO; | |
var this18 = data; | |
var c16 = this18; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.moveTo(c16.buffer.f[c16.fPos],c16.buffer.f[c16.fPos + 1]); | |
if(hasLineStyle) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.moveTo(c16.buffer.f[c16.fPos],c16.buffer.f[c16.fPos + 1]); | |
} else { | |
initStrokeX = c16.buffer.f[c16.fPos]; | |
initStrokeY = c16.buffer.f[c16.fPos + 1]; | |
} | |
break; | |
case 19: | |
var _g20 = data.prev; | |
switch(_g20[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.OVERRIDE_BLEND_MODE; | |
var this19 = data; | |
var c17 = this19; | |
renderer1.__setBlendModeContext(openfl__$internal_renderer_canvas_CanvasGraphics.context,c17.buffer.o[c17.oPos]); | |
break; | |
case 21: | |
var _g21 = data.prev; | |
switch(_g21[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.WINDING_EVEN_ODD; | |
var this20 = data; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.windingEvenOdd(); | |
openfl__$internal_renderer_canvas_CanvasGraphics.windingRule = "evenodd"; | |
break; | |
case 22: | |
var _g22 = data.prev; | |
switch(_g22[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = openfl__$internal_renderer_DrawCommandType.WINDING_NON_ZERO; | |
var this21 = data; | |
openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.windingNonZero(); | |
openfl__$internal_renderer_canvas_CanvasGraphics.windingRule = "nonzero"; | |
break; | |
default: | |
var _g23 = data.prev; | |
switch(_g23[1]) { | |
case 0: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 1: | |
data.iPos += 1; | |
data.fPos += 1; | |
break; | |
case 2: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 3: | |
data.oPos += 1; | |
break; | |
case 4: | |
data.fPos += 6; | |
break; | |
case 5: | |
data.fPos += 4; | |
break; | |
case 6: | |
data.fPos += 3; | |
break; | |
case 7: | |
data.fPos += 4; | |
break; | |
case 8: | |
data.oPos += 3; | |
break; | |
case 9: | |
data.fPos += 4; | |
break; | |
case 10: | |
data.fPos += 5; | |
data.oPos += 1; | |
break; | |
case 12: | |
data.oPos += 4; | |
break; | |
case 13: | |
break; | |
case 14: | |
data.oPos += 2; | |
data.bPos += 2; | |
break; | |
case 15: | |
data.oPos += 4; | |
data.iiPos += 2; | |
data.ffPos += 1; | |
data.fPos += 1; | |
break; | |
case 16: | |
data.oPos += 4; | |
data.iPos += 1; | |
data.fPos += 2; | |
data.bPos += 1; | |
break; | |
case 17: | |
data.fPos += 2; | |
break; | |
case 18: | |
data.fPos += 2; | |
break; | |
case 19: | |
data.oPos += 1; | |
break; | |
case 20: | |
data.oPos += 1; | |
break; | |
case 21:case 22: | |
break; | |
default: | |
} | |
data.prev = type; | |
} | |
} | |
if(openfl__$internal_renderer_canvas_CanvasGraphics.fillCommands.get_length() > 0) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.endFill(); | |
} | |
if(openfl__$internal_renderer_canvas_CanvasGraphics.strokeCommands.get_length() > 0) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.endStroke(); | |
} | |
data.destroy(); | |
graphics.__bitmap = openfl_display_BitmapData.fromCanvas(graphics.__canvas); | |
} | |
graphics.__softwareDirty = false; | |
graphics.set___dirty(false); | |
} | |
if(graphics.__softwareDirty || this.__worldAlphaChanged || this.__canvas != graphics.__canvas) { | |
if(graphics.__canvas != null) { | |
if(this.__canvas != graphics.__canvas) { | |
if(this.__canvas != null) { | |
renderer.element.removeChild(this.__canvas); | |
} | |
this.__canvas = graphics.__canvas; | |
this.__context = graphics.__context; | |
renderer.__initializeElement(this,this.__canvas); | |
} | |
} else { | |
openfl__$internal_renderer_dom_DOMShape.clear(this,renderer); | |
} | |
} | |
if(this.__canvas != null) { | |
renderer.__pushMaskObject(this); | |
var cacheTransform = this.__renderTransform; | |
this.__renderTransform = graphics.__worldTransform; | |
if(graphics.__transformDirty) { | |
graphics.__transformDirty = false; | |
this.__renderTransformChanged = true; | |
} | |
renderer.__updateClip(this); | |
renderer.__applyStyle(this,true,true,true); | |
this.__renderTransform = cacheTransform; | |
renderer.__popMaskObject(this); | |
} | |
} else { | |
openfl__$internal_renderer_dom_DOMShape.clear(this,renderer); | |
} | |
} | |
this.__renderEvent(renderer); | |
} | |
,__renderDOMClear: function(renderer) { | |
openfl__$internal_renderer_dom_DOMDisplayObject.clear(this,renderer); | |
} | |
,__renderEvent: function(renderer) { | |
if(this.__customRenderEvent != null && this.__renderable) { | |
this.__customRenderEvent.allowSmoothing = renderer.__allowSmoothing; | |
this.__customRenderEvent.objectMatrix.copyFrom(this.__renderTransform); | |
this.__customRenderEvent.objectColorTransform.__copyFrom(this.__worldColorTransform); | |
this.__customRenderEvent.renderer = renderer; | |
var _g = renderer.__type; | |
switch(_g) { | |
case "cairo": | |
this.__customRenderEvent.type = "renderCairo"; | |
break; | |
case "canvas": | |
this.__customRenderEvent.type = "renderCanvas"; | |
break; | |
case "dom": | |
if(this.stage != null && this.__worldVisible) { | |
this.__customRenderEvent.type = "renderDOM"; | |
} else { | |
this.__customRenderEvent.type = "clearDOM"; | |
} | |
break; | |
case "opengl": | |
if(!renderer.__cleared) { | |
renderer.__clear(); | |
} | |
var renderer1 = renderer; | |
renderer1.setShader(this.__worldShader); | |
renderer1.__context3D.__flushGL(); | |
this.__customRenderEvent.type = "renderOpenGL"; | |
break; | |
default: | |
return; | |
} | |
renderer.__setBlendMode(this.__worldBlendMode); | |
renderer.__pushMaskObject(this); | |
this.dispatchEvent(this.__customRenderEvent); | |
renderer.__popMaskObject(this); | |
if(renderer.__type == "opengl") { | |
var renderer2 = renderer; | |
renderer2.setViewport(); | |
} | |
} | |
} | |
,__renderGL: function(renderer) { | |
if(openfl_display_DisplayObject.testMode) { | |
return; | |
} | |
this.__updateCacheBitmap(renderer,false); | |
if(this.__cacheBitmap != null && !this.__isCacheBitmapRender) { | |
openfl__$internal_renderer_context3D_Context3DBitmap.render(this.__cacheBitmap,renderer); | |
} else if(!(this.opaqueBackground == null && this.__graphics == null)) { | |
if(!(!this.__renderable || this.__worldAlpha <= 0)) { | |
if(this.opaqueBackground != null && !this.__isCacheBitmapRender && this.get_width() > 0 && this.get_height() > 0) { | |
renderer.__setBlendMode(this.__worldBlendMode); | |
renderer.__pushMaskObject(this); | |
var context = renderer.__context3D; | |
var rect = openfl_geom_Rectangle.__pool.get(); | |
rect.setTo(0,0,this.get_width(),this.get_height()); | |
renderer.__pushMaskRect(rect,this.__renderTransform); | |
var color = this.opaqueBackground; | |
context.clear((color >>> 16 & 255) / 255,(color >>> 8 & 255) / 255,(color & 255) / 255,1,0,0,1); | |
renderer.__popMaskRect(); | |
renderer.__popMaskObject(this); | |
openfl_geom_Rectangle.__pool.release(rect); | |
} | |
if(this.__graphics != null) { | |
openfl__$internal_renderer_context3D_Context3DShape.render(this,renderer); | |
} | |
} | |
} | |
this.__renderEvent(renderer); | |
} | |
,__renderGLMask: function(renderer) { | |
if(this.__graphics != null) { | |
openfl__$internal_renderer_context3D_Context3DShape.renderMask(this,renderer); | |
} | |
} | |
,__setParentRenderDirty: function() { | |
var renderParent = this.__renderParent != null ? this.__renderParent : this.parent; | |
if(renderParent != null && !renderParent.__renderDirty) { | |
renderParent.__renderDirty = true; | |
renderParent.__setParentRenderDirty(); | |
} | |
} | |
,__setRenderDirty: function() { | |
if(!this.__renderDirty) { | |
this.__renderDirty = true; | |
this.__setParentRenderDirty(); | |
} | |
} | |
,__setStageReference: function(stage) { | |
this.stage = stage; | |
} | |
,__setTransformDirty: function() { | |
if(!this.__transformDirty) { | |
this.__transformDirty = true; | |
this.__setWorldTransformInvalid(); | |
this.__setParentRenderDirty(); | |
} | |
} | |
,__setWorldTransformInvalid: function() { | |
this.__worldTransformInvalid = true; | |
} | |
,__shouldCacheHardware: function(value) { | |
if(value == true || this.__filters != null) { | |
return true; | |
} | |
if(value == false || this.__graphics != null && !openfl__$internal_renderer_context3D_Context3DGraphics.isCompatible(this.__graphics)) { | |
return false; | |
} | |
return null; | |
} | |
,__stopAllMovieClips: function() { | |
} | |
,__update: function(transformOnly,updateChildren) { | |
if(!this.__renderDirty && !this.__worldTransformInvalid) { | |
return; | |
} | |
var renderParent = this.__renderParent != null ? this.__renderParent : this.parent; | |
if(this.__isMask && renderParent == null) { | |
renderParent = this.__maskTarget; | |
} | |
this.__renderable = this.__visible && this.__scaleX != 0 && this.__scaleY != 0 && !this.__isMask && (renderParent == null || !renderParent.__isMask); | |
this.__updateTransforms(); | |
this.__transformDirty = false; | |
if(!transformOnly) { | |
this.__worldTransformInvalid = false; | |
if(openfl_display_DisplayObject.__supportDOM) { | |
this.__renderTransformChanged = !this.__renderTransform.equals(this.__renderTransformCache); | |
if(this.__renderTransformCache == null) { | |
this.__renderTransformCache = this.__renderTransform.clone(); | |
} else { | |
this.__renderTransformCache.copyFrom(this.__renderTransform); | |
} | |
} | |
if(renderParent != null) { | |
if(openfl_display_DisplayObject.__supportDOM) { | |
var worldVisible = renderParent.__worldVisible && this.__visible; | |
this.__worldVisibleChanged = this.__worldVisible != worldVisible; | |
this.__worldVisible = worldVisible; | |
var worldAlpha = this.get_alpha() * renderParent.__worldAlpha; | |
this.__worldAlphaChanged = this.__worldAlpha != worldAlpha; | |
this.__worldAlpha = worldAlpha; | |
} else { | |
this.__worldAlpha = this.get_alpha() * renderParent.__worldAlpha; | |
} | |
if(this.__objectTransform != null) { | |
this.__worldColorTransform.__copyFrom(this.__objectTransform.get_colorTransform()); | |
this.__worldColorTransform.__combine(renderParent.__worldColorTransform); | |
} else { | |
this.__worldColorTransform.__copyFrom(renderParent.__worldColorTransform); | |
} | |
if(this.__blendMode == null || this.__blendMode == 10) { | |
this.__worldBlendMode = renderParent.__worldBlendMode; | |
} else { | |
this.__worldBlendMode = this.__blendMode; | |
} | |
if(this.__shader == null) { | |
this.__worldShader = renderParent.__shader; | |
} else { | |
this.__worldShader = this.__shader; | |
} | |
if(this.__scale9Grid == null) { | |
this.__worldScale9Grid = renderParent.__scale9Grid; | |
} else { | |
this.__worldScale9Grid = this.__scale9Grid; | |
} | |
} else { | |
this.__worldAlpha = this.get_alpha(); | |
if(openfl_display_DisplayObject.__supportDOM) { | |
this.__worldVisibleChanged = this.__worldVisible != this.__visible; | |
this.__worldVisible = this.__visible; | |
this.__worldAlphaChanged = this.__worldAlpha != this.get_alpha(); | |
} | |
if(this.__objectTransform != null) { | |
this.__worldColorTransform.__copyFrom(this.__objectTransform.get_colorTransform()); | |
} else { | |
this.__worldColorTransform.__identity(); | |
} | |
this.__worldBlendMode = this.__blendMode; | |
this.__worldShader = this.__shader; | |
this.__worldScale9Grid = this.__scale9Grid; | |
} | |
} | |
if(updateChildren && this.get_mask() != null) { | |
this.get_mask().__update(transformOnly,true); | |
} | |
} | |
,__updateCacheBitmap: function(renderer,force) { | |
if(this.__isCacheBitmapRender) { | |
return false; | |
} | |
var colorTransform = null; | |
if(this.get_cacheAsBitmap() || renderer.__type != "opengl") { | |
colorTransform = openfl_geom_ColorTransform.__pool.get(); | |
colorTransform.__copyFrom(this.__worldColorTransform); | |
if(renderer.__worldColorTransform != null) { | |
colorTransform.__combine(renderer.__worldColorTransform); | |
} | |
} | |
var updated = false; | |
if(this.get_cacheAsBitmap() || renderer.__type != "opengl" && !colorTransform.__isDefault(true)) { | |
var rect = null; | |
var useFilters = openfl_display_DisplayObject.enableFiltersFn != null ? openfl_display_DisplayObject.enableFiltersFn() : true; | |
var needRender = this.__cacheBitmap == null || this.__renderDirty && (force || this.__children != null && this.__children.length > 0) || this.opaqueBackground != this.__cacheBitmapBackground || useFilters != this.__useFilters; | |
var softwareDirty = needRender || this.__graphics != null && this.__graphics.__softwareDirty || !this.__cacheBitmapColorTransform.__equals(colorTransform,true); | |
var hardwareDirty = needRender || this.__graphics != null && this.__graphics.__hardwareDirty; | |
var renderType = renderer.__type; | |
if(softwareDirty || hardwareDirty) { | |
if(softwareDirty && (renderType == "canvas" || renderType == "cairo")) { | |
needRender = true; | |
} | |
if(hardwareDirty && renderType == "opengl") { | |
needRender = true; | |
} | |
} | |
var updateTransform = needRender || !this.__cacheBitmap.__worldTransform.equals(this.__worldTransform); | |
this.__useFilters = useFilters; | |
var hasFilters = this.__filters != null && useFilters; | |
if(hasFilters && !needRender) { | |
var _g = 0; | |
var _g1 = this.__filters; | |
while(_g < _g1.length) { | |
var filter = _g1[_g]; | |
++_g; | |
if(filter.__renderDirty) { | |
needRender = true; | |
break; | |
} | |
} | |
} | |
if(this.__cacheBitmapMatrix == null) { | |
this.__cacheBitmapMatrix = new openfl_geom_Matrix(); | |
} | |
var bitmapMatrix = this.__cacheAsBitmapMatrix != null ? this.__cacheAsBitmapMatrix : this.__renderTransform; | |
if(!needRender && (bitmapMatrix.a != this.__cacheBitmapMatrix.a || bitmapMatrix.b != this.__cacheBitmapMatrix.b || bitmapMatrix.c != this.__cacheBitmapMatrix.c || bitmapMatrix.d != this.__cacheBitmapMatrix.d)) { | |
needRender = true; | |
} | |
if(!needRender && renderer.__type != "opengl" && this.__cacheBitmap != null && this.__cacheBitmap.get_bitmapData().image != null && this.__cacheBitmap.get_bitmapData().image.version < this.__cacheBitmap.get_bitmapData().__textureVersion) { | |
needRender = true; | |
} | |
this.__cacheBitmapMatrix.copyFrom(bitmapMatrix); | |
this.__cacheBitmapMatrix.tx = 0; | |
this.__cacheBitmapMatrix.ty = 0; | |
var bitmapWidth = 0; | |
var bitmapHeight = 0; | |
var filterWidth = 0; | |
var filterHeight = 0; | |
var offsetX = 0.; | |
var offsetY = 0.; | |
if(updateTransform || needRender) { | |
rect = openfl_geom_Rectangle.__pool.get(); | |
this.__getFilterBounds(rect,this.__cacheBitmapMatrix); | |
filterWidth = Math.ceil(rect.width); | |
filterHeight = Math.ceil(rect.height); | |
if(rect.x > 0) { | |
offsetX = Math.ceil(rect.x); | |
} else { | |
offsetX = Math.floor(rect.x); | |
} | |
if(rect.y > 0) { | |
offsetY = Math.ceil(rect.y); | |
} else { | |
offsetY = Math.floor(rect.y); | |
} | |
bitmapWidth = filterWidth; | |
bitmapHeight = filterHeight; | |
openfl_geom_Rectangle.__pool.release(rect); | |
rect = null; | |
} | |
if(needRender) { | |
updateTransform = true; | |
this.__cacheBitmapBackground = this.opaqueBackground; | |
if(filterWidth >= 0.5 && filterHeight >= 0.5) { | |
if(this.__cacheBitmap != null) { | |
this.__toPool(this.__cacheBitmap.__bitmapData); | |
} else { | |
this.__cacheBitmap = this.__bmpFromPool(); | |
this.__cacheBitmapRenderer = null; | |
} | |
} else { | |
openfl_geom_ColorTransform.__pool.release(colorTransform); | |
if(this.__cacheBitmap != null) { | |
this.__toPool(this.__cacheBitmap.__bitmapData); | |
this.__bmpToPool(this.__cacheBitmap); | |
this.__cacheBitmap = null; | |
} | |
this.__cacheBitmapRenderer = null; | |
return true; | |
} | |
} | |
if(updateTransform || needRender) { | |
this.__cacheBitmap.__worldTransform.copyFrom(this.__worldTransform); | |
if(bitmapMatrix == this.__renderTransform) { | |
this.__cacheBitmap.__renderTransform.identity(); | |
this.__cacheBitmap.__renderTransform.tx = this.__renderTransform.tx + offsetX; | |
this.__cacheBitmap.__renderTransform.ty = this.__renderTransform.ty + offsetY; | |
} else { | |
this.__cacheBitmap.__renderTransform.copyFrom(this.__cacheBitmapMatrix); | |
this.__cacheBitmap.__renderTransform.invert(); | |
this.__cacheBitmap.__renderTransform.concat(this.__renderTransform); | |
this.__cacheBitmap.__renderTransform.tx += offsetX; | |
this.__cacheBitmap.__renderTransform.ty += offsetY; | |
} | |
} | |
this.__cacheBitmap.smoothing = renderer.__allowSmoothing; | |
this.__cacheBitmap.__renderable = this.__renderable; | |
this.__cacheBitmap.__worldAlpha = this.__worldAlpha; | |
this.__cacheBitmap.__worldColorTransform = this.__worldColorTransform; | |
this.__cacheBitmap.__worldBlendMode = this.__worldBlendMode; | |
this.__cacheBitmap.__worldShader = this.__worldShader; | |
this.__cacheBitmap.set_mask(this.__mask); | |
if(needRender) { | |
var isGL = renderType == "opengl"; | |
var glContext = null; | |
if(isGL) { | |
glContext = (js_Boot.__cast(renderer , openfl_display_OpenGLRenderer)).__context3D; | |
} | |
var cacheBitmapData = (isGL ? openfl_display_DisplayObject.__hwpool : openfl_display_DisplayObject.__swpool).get(bitmapWidth,bitmapHeight,glContext); | |
if(this.__cacheBitmapRenderer == null || renderType != this.__cacheBitmapRenderer.__type) { | |
if(renderType == "opengl") { | |
this.__cacheBitmapRenderer = new openfl_display_OpenGLRenderer(glContext,cacheBitmapData); | |
} else { | |
lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(cacheBitmapData.image); | |
this.__cacheBitmapRenderer = new openfl_display_CanvasRenderer(cacheBitmapData.image.buffer.__srcContext); | |
} | |
this.__cacheBitmapRenderer.__worldTransform = new openfl_geom_Matrix(); | |
this.__cacheBitmapRenderer.__worldColorTransform = new openfl_geom_ColorTransform(); | |
} | |
if(this.__cacheBitmapColorTransform == null) { | |
this.__cacheBitmapColorTransform = new openfl_geom_ColorTransform(); | |
} | |
this.__cacheBitmapRenderer.__stage = this.stage; | |
this.__cacheBitmapRenderer.__allowSmoothing = renderer.__allowSmoothing; | |
this.__cacheBitmapRenderer.__setBlendMode(10); | |
var fixAlpha = this.__worldAlpha <= 0; | |
if(fixAlpha) { | |
this.__updateWorldAlpha(1); | |
this.__cacheBitmapRenderer.__worldAlpha = 1; | |
} else { | |
this.__cacheBitmapRenderer.__worldAlpha = 1 / this.__worldAlpha; | |
} | |
this.__cacheBitmapRenderer.__worldTransform.copyFrom(this.__renderTransform); | |
this.__cacheBitmapRenderer.__worldTransform.invert(); | |
this.__cacheBitmapRenderer.__worldTransform.concat(this.__cacheBitmapMatrix); | |
this.__cacheBitmapRenderer.__worldTransform.tx -= offsetX; | |
this.__cacheBitmapRenderer.__worldTransform.ty -= offsetY; | |
this.__cacheBitmapRenderer.__worldColorTransform.__copyFrom(colorTransform); | |
this.__cacheBitmapRenderer.__worldColorTransform.__invert(); | |
this.__isCacheBitmapRender = true; | |
if(this.__cacheBitmapRenderer.__type == "opengl") { | |
var parentRenderer = renderer; | |
var childRenderer = this.__cacheBitmapRenderer; | |
var context = childRenderer.__context3D; | |
var cacheRTT = context.__state.renderToTexture; | |
var cacheRTTDepthStencil = context.__state.renderToTextureDepthStencil; | |
var cacheRTTAntiAlias = context.__state.renderToTextureAntiAlias; | |
var cacheRTTSurfaceSelector = context.__state.renderToTextureSurfaceSelector; | |
var cacheBlendMode = parentRenderer.__blendMode; | |
parentRenderer.__suspendClipAndMask(); | |
childRenderer.__copyShader(parentRenderer); | |
cacheBitmapData.__setUVRect(context,0,0,filterWidth,filterHeight); | |
childRenderer.__setRenderTarget(cacheBitmapData); | |
if(cacheBitmapData.image != null) { | |
cacheBitmapData.__textureVersion = cacheBitmapData.image.version + 1; | |
} | |
cacheBitmapData.__drawGL(this,childRenderer); | |
if(hasFilters) { | |
var needCopyOfOriginal = false; | |
var _g2 = 0; | |
var _g11 = this.__filters; | |
while(_g2 < _g11.length) { | |
var filter1 = _g11[_g2]; | |
++_g2; | |
if(filter1.__preserveObject) { | |
needCopyOfOriginal = true; | |
} | |
} | |
var bitmap = cacheBitmapData; | |
var bitmap2 = null; | |
var bitmap3 = null; | |
bitmap2 = openfl_display_DisplayObject.__hwpool.get(bitmapWidth,bitmapHeight,glContext); | |
bitmap2.__setUVRect(context,0,0,filterWidth,filterHeight); | |
if(bitmap2.image != null) { | |
bitmap2.__textureVersion = bitmap2.image.version + 1; | |
} | |
if(needCopyOfOriginal) { | |
bitmap3 = openfl_display_DisplayObject.__hwpool.get(bitmapWidth,bitmapHeight,glContext); | |
bitmap3.__setUVRect(context,0,0,filterWidth,filterHeight); | |
if(bitmap3.image != null) { | |
bitmap3.__textureVersion = bitmap3.image.version + 1; | |
} | |
} | |
childRenderer.__setBlendMode(10); | |
childRenderer.__worldAlpha = 1; | |
if(fixAlpha) { | |
this.__updateWorldAlpha(0); | |
fixAlpha = false; | |
} | |
childRenderer.__worldTransform.identity(); | |
childRenderer.__worldColorTransform.__identity(); | |
var shader; | |
var cacheBitmap; | |
var _g3 = 0; | |
var _g12 = this.__filters; | |
while(_g3 < _g12.length) { | |
var filter2 = _g12[_g3]; | |
++_g3; | |
if(filter2.__preserveObject) { | |
childRenderer.__setRenderTarget(bitmap3); | |
childRenderer.__renderFilterPass(bitmap,childRenderer.__defaultDisplayShader,filter2.__smooth); | |
} | |
var _g31 = 0; | |
var _g21 = filter2.__numShaderPasses; | |
while(_g31 < _g21) { | |
var i = _g31++; | |
shader = filter2.__initShader(childRenderer,i,filter2.__preserveObject ? bitmap3 : null); | |
childRenderer.__setBlendMode(filter2.__shaderBlendMode); | |
childRenderer.__setRenderTarget(bitmap2); | |
childRenderer.__renderFilterPass(bitmap,shader,filter2.__smooth); | |
cacheBitmap = bitmap; | |
bitmap = bitmap2; | |
bitmap2 = cacheBitmap; | |
} | |
filter2.__renderDirty = false; | |
} | |
cacheBitmapData = bitmap; | |
if(cacheBitmapData != bitmap2) { | |
this.__toPool(bitmap2); | |
} | |
this.__toPool(bitmap3); | |
} | |
this.__cacheBitmap.__bitmapData = cacheBitmapData; | |
parentRenderer.__blendMode = childRenderer.__blendMode; | |
parentRenderer.__setBlendMode(cacheBlendMode); | |
parentRenderer.__copyShader(childRenderer); | |
if(cacheRTT != null) { | |
context.setRenderToTexture(cacheRTT,cacheRTTDepthStencil,cacheRTTAntiAlias,cacheRTTSurfaceSelector); | |
} else { | |
context.setRenderToBackBuffer(); | |
} | |
parentRenderer.__resumeClipAndMask(childRenderer); | |
parentRenderer.setViewport(); | |
this.__cacheBitmapColorTransform.__copyFrom(colorTransform); | |
} else { | |
cacheBitmapData.__drawCanvas(this,this.__cacheBitmapRenderer); | |
if(fixAlpha) { | |
this.__updateWorldAlpha(0); | |
fixAlpha = false; | |
} | |
if(hasFilters) { | |
var needSecondBitmapData = false; | |
var needCopyOfOriginal1 = false; | |
var _g4 = 0; | |
var _g13 = this.__filters; | |
while(_g4 < _g13.length) { | |
var filter3 = _g13[_g4]; | |
++_g4; | |
if(filter3.__needSecondBitmapData) { | |
needSecondBitmapData = true; | |
} | |
if(filter3.__preserveObject) { | |
needCopyOfOriginal1 = true; | |
} | |
} | |
var bitmap1 = cacheBitmapData; | |
var bitmap21 = null; | |
var bitmap31 = null; | |
if(needSecondBitmapData) { | |
bitmap21 = openfl_display_DisplayObject.__swpool.get(bitmapWidth,bitmapHeight); | |
} else { | |
bitmap21 = bitmap1; | |
} | |
if(needCopyOfOriginal1) { | |
bitmap31 = openfl_display_DisplayObject.__swpool.get(bitmapWidth,bitmapHeight); | |
} | |
if(this.__tempPoint == null) { | |
this.__tempPoint = new openfl_geom_Point(); | |
} | |
var destPoint = this.__tempPoint; | |
var cacheBitmap1; | |
var lastBitmap; | |
var _g5 = 0; | |
var _g14 = this.__filters; | |
while(_g5 < _g14.length) { | |
var filter4 = _g14[_g5]; | |
++_g5; | |
if(filter4.__preserveObject) { | |
bitmap31.copyPixels(bitmap1,bitmap1.rect,destPoint); | |
} | |
lastBitmap = filter4.__applyFilter(bitmap21,bitmap1,bitmap1.rect,destPoint); | |
if(filter4.__preserveObject) { | |
lastBitmap.draw(bitmap31,null,this.__objectTransform != null ? this.__objectTransform.get_colorTransform() : null); | |
} | |
filter4.__renderDirty = false; | |
if(needSecondBitmapData && lastBitmap == bitmap21) { | |
cacheBitmap1 = bitmap1; | |
bitmap1 = bitmap21; | |
bitmap21 = cacheBitmap1; | |
} | |
} | |
if(cacheBitmapData != bitmap1) { | |
cacheBitmapData = bitmap1; | |
} | |
if(cacheBitmapData != bitmap21) { | |
this.__toPool(bitmap21); | |
} | |
this.__toPool(bitmap31); | |
} | |
this.__cacheBitmap.__bitmapData = cacheBitmapData; | |
this.__cacheBitmapRenderer = null; | |
this.__cacheBitmap.__imageVersion = cacheBitmapData.__textureVersion; | |
this.__cacheBitmapColorTransform.__copyFrom(colorTransform); | |
if(!this.__cacheBitmapColorTransform.__isDefault(true)) { | |
this.__cacheBitmapColorTransform.alphaMultiplier = 1; | |
cacheBitmapData.colorTransform(cacheBitmapData.rect,this.__cacheBitmapColorTransform); | |
} | |
} | |
this.__isCacheBitmapRender = false; | |
} | |
updated = updateTransform; | |
} else if(this.__cacheBitmap != null) { | |
if(renderer.__type == "dom") { | |
this.__cacheBitmap.__renderDOMClear(renderer); | |
} | |
this.__toPool(this.__cacheBitmap.__bitmapData); | |
this.__bmpToPool(this.__cacheBitmap); | |
this.__cacheBitmap = null; | |
this.__cacheBitmapColorTransform = null; | |
this.__cacheBitmapRenderer = null; | |
updated = true; | |
} | |
if(colorTransform != null) { | |
openfl_geom_ColorTransform.__pool.release(colorTransform); | |
} | |
return updated; | |
} | |
,__updateWorldAlpha: function(v) { | |
this.__worldAlpha = v; | |
} | |
,__updateTransforms: function(overrideTransform) { | |
var overrided = overrideTransform != null; | |
var local = overrided ? overrideTransform : this.__transform; | |
if(this.__worldTransform == null) { | |
this.__worldTransform = new openfl_geom_Matrix(); | |
} | |
if(this.__renderTransform == null) { | |
this.__renderTransform = new openfl_geom_Matrix(); | |
} | |
var renderParent = this.__renderParent != null ? this.__renderParent : this.parent; | |
if(!overrided && this.parent != null) { | |
var parentTransform = this.parent.__worldTransform; | |
var target = this.__worldTransform; | |
target.a = local.a * parentTransform.a + local.b * parentTransform.c; | |
target.b = local.a * parentTransform.b + local.b * parentTransform.d; | |
target.c = local.c * parentTransform.a + local.d * parentTransform.c; | |
target.d = local.c * parentTransform.b + local.d * parentTransform.d; | |
target.tx = local.tx * parentTransform.a + local.ty * parentTransform.c + parentTransform.tx; | |
target.ty = local.tx * parentTransform.b + local.ty * parentTransform.d + parentTransform.ty; | |
} else { | |
this.__worldTransform.copyFrom(local); | |
} | |
if(!overrided && renderParent != null) { | |
var parentTransform1 = renderParent.__renderTransform; | |
var target1 = this.__renderTransform; | |
target1.a = local.a * parentTransform1.a + local.b * parentTransform1.c; | |
target1.b = local.a * parentTransform1.b + local.b * parentTransform1.d; | |
target1.c = local.c * parentTransform1.a + local.d * parentTransform1.c; | |
target1.d = local.c * parentTransform1.b + local.d * parentTransform1.d; | |
target1.tx = local.tx * parentTransform1.a + local.ty * parentTransform1.c + parentTransform1.tx; | |
target1.ty = local.tx * parentTransform1.b + local.ty * parentTransform1.d + parentTransform1.ty; | |
} else { | |
this.__renderTransform.copyFrom(local); | |
} | |
if(this.__scrollRect != null) { | |
var _this = this.__renderTransform; | |
var px = -this.__scrollRect.x; | |
var py = -this.__scrollRect.y; | |
_this.tx = px * _this.a + py * _this.c + _this.tx; | |
_this.ty = px * _this.b + py * _this.d + _this.ty; | |
} | |
} | |
,__checkAnim: function() { | |
if(this.__fsi != null && this.__fsi.state == 1 && openfl_display_DisplayObject.__timelineOwner == null) { | |
this.__fsi.state = 2; | |
} | |
} | |
,get_alpha: function() { | |
return this.__alpha; | |
} | |
,set_alpha: function(value) { | |
this.__checkAnim(); | |
if(value > 1.0) { | |
value = 1.0; | |
} | |
if(value < 0.0) { | |
value = 0.0; | |
} | |
if(value != this.__alpha) { | |
if(!this.get_cacheAsBitmap()) { | |
this.__setWorldTransformInvalid(); | |
if(!this.__renderDirty) { | |
this.__renderDirty = true; | |
this.__setParentRenderDirty(); | |
} | |
} else { | |
this.__worldTransformInvalid = true; | |
this.__setParentRenderDirty(); | |
} | |
} | |
return this.__alpha = value; | |
} | |
,get_blendMode: function() { | |
return this.__blendMode; | |
} | |
,set_blendMode: function(value) { | |
this.__checkAnim(); | |
if(value == null) { | |
value = 10; | |
} | |
if(value != this.__blendMode) { | |
if(!this.get_cacheAsBitmap()) { | |
this.__setWorldTransformInvalid(); | |
if(!this.__renderDirty) { | |
this.__renderDirty = true; | |
this.__setParentRenderDirty(); | |
} | |
} else { | |
this.__worldTransformInvalid = true; | |
this.__setParentRenderDirty(); | |
} | |
} | |
return this.__blendMode = value; | |
} | |
,get_cacheAsBitmap: function() { | |
if(this.__filters == null) { | |
return this.__cacheAsBitmap; | |
} else { | |
return true; | |
} | |
} | |
,set_cacheAsBitmap: function(value) { | |
this.__checkAnim(); | |
if(value != this.__cacheAsBitmap) { | |
if(!this.__renderDirty) { | |
this.__renderDirty = true; | |
this.__setParentRenderDirty(); | |
} | |
} | |
return this.__cacheAsBitmap = value; | |
} | |
,get_cacheAsBitmapMatrix: function() { | |
return this.__cacheAsBitmapMatrix; | |
} | |
,set_cacheAsBitmapMatrix: function(value) { | |
this.__checkAnim(); | |
if(!this.__renderDirty) { | |
this.__renderDirty = true; | |
this.__setParentRenderDirty(); | |
} | |
return this.__cacheAsBitmapMatrix = value != null ? value.clone() : value; | |
} | |
,get_filters: function() { | |
if(this.__filters == null) { | |
return []; | |
} else { | |
return this.__filters.slice(); | |
} | |
} | |
,set_filters: function(value) { | |
this.__checkAnim(); | |
if(value != null && value.length > 0) { | |
this.__filters = value; | |
if(!this.__renderDirty) { | |
this.__renderDirty = true; | |
this.__setParentRenderDirty(); | |
} | |
} else if(this.__filters != null) { | |
this.__filters = null; | |
if(!this.__renderDirty) { | |
this.__renderDirty = true; | |
this.__setParentRenderDirty(); | |
} | |
} | |
return value; | |
} | |
,get_height: function() { | |
var rect = openfl_geom_Rectangle.__pool.get(); | |
this.__getLocalBounds(rect); | |
var height = rect.height; | |
openfl_geom_Rectangle.__pool.release(rect); | |
return height; | |
} | |
,set_height: function(value) { | |
this.__checkAnim(); | |
var rect = openfl_geom_Rectangle.__pool.get(); | |
var matrix = openfl_geom_Matrix.__pool.get(); | |
matrix.identity(); | |
this.__getBounds(rect,matrix); | |
if(value != rect.height) { | |
this.set_scaleY(value / rect.height); | |
} else { | |
this.set_scaleY(1); | |
} | |
openfl_geom_Rectangle.__pool.release(rect); | |
openfl_geom_Matrix.__pool.release(matrix); | |
return value; | |
} | |
,get_loaderInfo: function() { | |
if(this.stage != null) { | |
return openfl__$internal_Lib.current.__loaderInfo; | |
} | |
return null; | |
} | |
,get_mask: function() { | |
return this.__mask; | |
} | |
,set_mask: function(value) { | |
this.__checkAnim(); | |
if(value == this.__mask) { | |
return value; | |
} | |
if(value != this.__mask) { | |
this.__setTransformDirty(); | |
if(!this.__renderDirty) { | |
this.__renderDirty = true; | |
this.__setParentRenderDirty(); | |
} | |
} | |
if(this.__mask != null) { | |
this.__mask.__isMask = false; | |
this.__mask.__maskTarget = null; | |
this.__mask.__setTransformDirty(); | |
var _this = this.__mask; | |
if(!_this.__renderDirty) { | |
_this.__renderDirty = true; | |
_this.__setParentRenderDirty(); | |
} | |
} | |
if(value != null) { | |
value.__isMask = true; | |
value.__maskTarget = this; | |
value.__setWorldTransformInvalid(); | |
} | |
if(this.__cacheBitmap != null && this.__cacheBitmap.get_mask() != value) { | |
this.__cacheBitmap.set_mask(value); | |
} | |
return this.__mask = value; | |
} | |
,get_mouseX: function() { | |
var mouseX = this.stage != null ? this.stage.__mouseX : openfl__$internal_Lib.current.stage.__mouseX; | |
var mouseY = this.stage != null ? this.stage.__mouseY : openfl__$internal_Lib.current.stage.__mouseY; | |
var _this = this.__getRenderTransform(); | |
var norm = _this.a * _this.d - _this.b * _this.c; | |
if(norm == 0) { | |
return -_this.tx; | |
} else { | |
return 1.0 / norm * (_this.c * (_this.ty - mouseY) + _this.d * (mouseX - _this.tx)); | |
} | |
} | |
,get_mouseY: function() { | |
var mouseX = this.stage != null ? this.stage.__mouseX : openfl__$internal_Lib.current.stage.__mouseX; | |
var mouseY = this.stage != null ? this.stage.__mouseY : openfl__$internal_Lib.current.stage.__mouseY; | |
var _this = this.__getRenderTransform(); | |
var norm = _this.a * _this.d - _this.b * _this.c; | |
if(norm == 0) { | |
return -_this.ty; | |
} else { | |
return 1.0 / norm * (_this.a * (mouseY - _this.ty) + _this.b * (_this.tx - mouseX)); | |
} | |
} | |
,get_name: function() { | |
return this.__name; | |
} | |
,set_name: function(value) { | |
return this.__name = value; | |
} | |
,get_root: function() { | |
if(this.stage != null) { | |
return openfl__$internal_Lib.current; | |
} | |
return null; | |
} | |
,get_rotation: function() { | |
return this.__rotation; | |
} | |
,set_rotation: function(value) { | |
this.__checkAnim(); | |
if(value != this.__rotation) { | |
this.__rotation = value; | |
var radians = this.__rotation * (Math.PI / 180); | |
this.__rotationSine = Math.sin(radians); | |
this.__rotationCosine = Math.cos(radians); | |
this.__transform.a = this.__rotationCosine * this.__scaleX; | |
this.__transform.b = this.__rotationSine * this.__scaleX; | |
this.__transform.c = -this.__rotationSine * this.__scaleY; | |
this.__transform.d = this.__rotationCosine * this.__scaleY; | |
this.__setTransformDirty(); | |
} | |
return value; | |
} | |
,get_scale9Grid: function() { | |
if(this.__scale9Grid == null) { | |
return null; | |
} | |
return this.__scale9Grid.clone(); | |
} | |
,set_scale9Grid: function(value) { | |
this.__checkAnim(); | |
if(value == null && this.__scale9Grid == null) { | |
return value; | |
} | |
if(value != null && this.__scale9Grid != null && this.__scale9Grid.equals(value)) { | |
return value; | |
} | |
if(value != null) { | |
if(this.__scale9Grid == null) { | |
this.__scale9Grid = new openfl_geom_Rectangle(); | |
} | |
this.__scale9Grid.copyFrom(value); | |
} else { | |
this.__scale9Grid = null; | |
} | |
if(!this.__renderDirty) { | |
this.__renderDirty = true; | |
this.__setParentRenderDirty(); | |
} | |
return value; | |
} | |
,get_scaleX: function() { | |
return this.__scaleX; | |
} | |
,set_scaleX: function(value) { | |
this.__checkAnim(); | |
if(value != this.__scaleX) { | |
this.__scaleX = value; | |
if(this.__transform.b == 0) { | |
if(value != this.__transform.a) { | |
this.__setTransformDirty(); | |
} | |
this.__transform.a = value; | |
} else { | |
var a = this.__rotationCosine * value; | |
var b = this.__rotationSine * value; | |
if(this.__transform.a != a || this.__transform.b != b) { | |
this.__setTransformDirty(); | |
} | |
this.__transform.a = a; | |
this.__transform.b = b; | |
} | |
} | |
return value; | |
} | |
,get_scaleY: function() { | |
return this.__scaleY; | |
} | |
,set_scaleY: function(value) { | |
this.__checkAnim(); | |
if(value != this.__scaleY) { | |
this.__scaleY = value; | |
if(this.__transform.c == 0) { | |
if(value != this.__transform.d) { | |
this.__setTransformDirty(); | |
} | |
this.__transform.d = value; | |
} else { | |
var c = -this.__rotationSine * value; | |
var d = this.__rotationCosine * value; | |
if(this.__transform.d != d || this.__transform.c != c) { | |
this.__setTransformDirty(); | |
} | |
this.__transform.c = c; | |
this.__transform.d = d; | |
} | |
} | |
return value; | |
} | |
,get_scrollRect: function() { | |
if(this.__scrollRect == null) { | |
return null; | |
} | |
return this.__scrollRect.clone(); | |
} | |
,set_scrollRect: function(value) { | |
this.__checkAnim(); | |
if(value == null && this.__scrollRect == null) { | |
return value; | |
} | |
if(value != null && this.__scrollRect != null && this.__scrollRect.equals(value)) { | |
return value; | |
} | |
if(value != null) { | |
if(this.__scrollRect == null) { | |
this.__scrollRect = new openfl_geom_Rectangle(); | |
} | |
this.__scrollRect.copyFrom(value); | |
} else { | |
this.__scrollRect = null; | |
} | |
this.__setTransformDirty(); | |
if(openfl_display_DisplayObject.__supportDOM) { | |
if(!this.__renderDirty) { | |
this.__renderDirty = true; | |
this.__setParentRenderDirty(); | |
} | |
} | |
return value; | |
} | |
,get_shader: function() { | |
return this.__shader; | |
} | |
,set_shader: function(value) { | |
this.__checkAnim(); | |
this.__shader = value; | |
if(!this.__renderDirty) { | |
this.__renderDirty = true; | |
this.__setParentRenderDirty(); | |
} | |
return value; | |
} | |
,get_transform: function() { | |
if(this.__objectTransform == null) { | |
this.__objectTransform = new openfl_geom_Transform(this); | |
} | |
return this.__objectTransform; | |
} | |
,set_transform: function(value) { | |
this.__checkAnim(); | |
if(value == null) { | |
throw new js__$Boot_HaxeError(new openfl_errors_TypeError("Parameter transform must be non-null.")); | |
} | |
if(this.__objectTransform == null) { | |
this.__objectTransform = new openfl_geom_Transform(this); | |
} | |
this.__setTransformDirty(); | |
this.__objectTransform.set_matrix(value.get_matrix()); | |
if(!this.__objectTransform.get_colorTransform().__equals(value.get_colorTransform(),true) || !this.get_cacheAsBitmap() && this.__objectTransform.get_colorTransform().alphaMultiplier != value.get_colorTransform().alphaMultiplier) { | |
this.__objectTransform.get_colorTransform().__copyFrom(value.get_colorTransform()); | |
if(!this.__renderDirty) { | |
this.__renderDirty = true; | |
this.__setParentRenderDirty(); | |
} | |
} | |
return this.__objectTransform; | |
} | |
,get_visible: function() { | |
return this.__visible; | |
} | |
,set_visible: function(value) { | |
if(value != this.__visible) { | |
if(!this.__renderDirty) { | |
this.__renderDirty = true; | |
this.__setParentRenderDirty(); | |
} | |
} | |
return this.__visible = value; | |
} | |
,get_width: function() { | |
var rect = openfl_geom_Rectangle.__pool.get(); | |
this.__getLocalBounds(rect); | |
var width = rect.width; | |
openfl_geom_Rectangle.__pool.release(rect); | |
return width; | |
} | |
,set_width: function(value) { | |
this.__checkAnim(); | |
var rect = openfl_geom_Rectangle.__pool.get(); | |
var matrix = openfl_geom_Matrix.__pool.get(); | |
matrix.identity(); | |
this.__getBounds(rect,matrix); | |
if(value != rect.width) { | |
this.set_scaleX(value / rect.width); | |
} else { | |
this.set_scaleX(1); | |
} | |
openfl_geom_Rectangle.__pool.release(rect); | |
openfl_geom_Matrix.__pool.release(matrix); | |
return value; | |
} | |
,get_x: function() { | |
return this.__transform.tx; | |
} | |
,set_x: function(value) { | |
this.__checkAnim(); | |
if(value != this.__transform.tx) { | |
this.__setTransformDirty(); | |
} | |
return this.__transform.tx = value; | |
} | |
,get_y: function() { | |
return this.__transform.ty; | |
} | |
,set_y: function(value) { | |
this.__checkAnim(); | |
if(value != this.__transform.ty) { | |
this.__setTransformDirty(); | |
} | |
return this.__transform.ty = value; | |
} | |
,__class__: openfl_display_DisplayObject | |
,__properties__: {set_y:"set_y",get_y:"get_y",set_x:"set_x",get_x:"get_x",set_width:"set_width",get_width:"get_width",set_visible:"set_visible",get_visible:"get_visible",set_transform:"set_transform",get_transform:"get_transform",set_shader:"set_shader",get_shader:"get_shader",set_scrollRect:"set_scrollRect",get_scrollRect:"get_scrollRect",set_scaleY:"set_scaleY",get_scaleY:"get_scaleY",set_scaleX:"set_scaleX",get_scaleX:"get_scaleX",set_scale9Grid:"set_scale9Grid",get_scale9Grid:"get_scale9Grid",set_rotation:"set_rotation",get_rotation:"get_rotation",get_root:"get_root",set_name:"set_name",get_name:"get_name",get_mouseY:"get_mouseY",get_mouseX:"get_mouseX",set_mask:"set_mask",get_mask:"get_mask",get_loaderInfo:"get_loaderInfo",set_height:"set_height",get_height:"get_height",set_filters:"set_filters",get_filters:"get_filters",set_cacheAsBitmapMatrix:"set_cacheAsBitmapMatrix",get_cacheAsBitmapMatrix:"get_cacheAsBitmapMatrix",set_cacheAsBitmap:"set_cacheAsBitmap",get_cacheAsBitmap:"get_cacheAsBitmap",set_blendMode:"set_blendMode",get_blendMode:"get_blendMode",set_alpha:"set_alpha",get_alpha:"get_alpha"} | |
}); | |
var openfl_display_InteractiveObject = function() { | |
openfl_display_DisplayObject.call(this); | |
this.doubleClickEnabled = false; | |
this.mouseEnabled = true; | |
this.needsSoftKeyboard = false; | |
this.__tabEnabled = null; | |
this.__tabIndex = -1; | |
}; | |
$hxClasses["openfl.display.InteractiveObject"] = openfl_display_InteractiveObject; | |
openfl_display_InteractiveObject.__name__ = ["openfl","display","InteractiveObject"]; | |
openfl_display_InteractiveObject.__super__ = openfl_display_DisplayObject; | |
openfl_display_InteractiveObject.prototype = $extend(openfl_display_DisplayObject.prototype,{ | |
doubleClickEnabled: null | |
,focusRect: null | |
,mouseEnabled: null | |
,needsSoftKeyboard: null | |
,softKeyboardInputAreaOfInterest: null | |
,__tabEnabled: null | |
,__tabIndex: null | |
,requestSoftKeyboard: function() { | |
openfl__$internal_Lib.notImplemented({ fileName : "InteractiveObject.hx", lineNumber : 1251, className : "openfl.display.InteractiveObject", methodName : "requestSoftKeyboard"}); | |
return false; | |
} | |
,__allowMouseFocus: function() { | |
return this.get_tabEnabled(); | |
} | |
,__getInteractive: function(stack) { | |
if(stack != null) { | |
stack.push(this); | |
if(this.parent != null) { | |
this.parent.__getInteractive(stack); | |
} | |
} | |
return true; | |
} | |
,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) { | |
if(!hitObject.get_visible() || this.__isMask || interactiveOnly && !this.mouseEnabled) { | |
return false; | |
} | |
return openfl_display_DisplayObject.prototype.__hitTest.call(this,x,y,shapeFlag,stack,interactiveOnly,hitObject); | |
} | |
,__tabTest: function(stack) { | |
if(this.get_tabEnabled()) { | |
stack.push(this); | |
} | |
} | |
,get_tabEnabled: function() { | |
if(this.__tabEnabled == true) { | |
return true; | |
} else { | |
return false; | |
} | |
} | |
,set_tabEnabled: function(value) { | |
if(this.__tabEnabled != value) { | |
this.__tabEnabled = value; | |
this.dispatchEvent(new openfl_events_Event("tabEnabledChange",true,false)); | |
} | |
return this.__tabEnabled; | |
} | |
,get_tabIndex: function() { | |
return this.__tabIndex; | |
} | |
,set_tabIndex: function(value) { | |
if(this.__tabIndex != value) { | |
if(value < -1) { | |
throw new js__$Boot_HaxeError(new openfl_errors_RangeError("Parameter tabIndex must be a non-negative number; got " + value)); | |
} | |
this.__tabIndex = value; | |
this.dispatchEvent(new openfl_events_Event("tabIndexChange",true,false)); | |
} | |
return this.__tabIndex; | |
} | |
,__class__: openfl_display_InteractiveObject | |
,__properties__: $extend(openfl_display_DisplayObject.prototype.__properties__,{set_tabIndex:"set_tabIndex",get_tabIndex:"get_tabIndex",set_tabEnabled:"set_tabEnabled",get_tabEnabled:"get_tabEnabled"}) | |
}); | |
var openfl_display_DisplayObjectContainer = function() { | |
openfl_display_InteractiveObject.call(this); | |
this.mouseChildren = true; | |
this.__tabChildren = true; | |
this.__children = []; | |
this.__removedChildren = openfl__$Vector_Vector_$Impl_$.toObjectVector(null); | |
}; | |
$hxClasses["openfl.display.DisplayObjectContainer"] = openfl_display_DisplayObjectContainer; | |
openfl_display_DisplayObjectContainer.__name__ = ["openfl","display","DisplayObjectContainer"]; | |
openfl_display_DisplayObjectContainer.__super__ = openfl_display_InteractiveObject; | |
openfl_display_DisplayObjectContainer.prototype = $extend(openfl_display_InteractiveObject.prototype,{ | |
mouseChildren: null | |
,__removedChildren: null | |
,__tabChildren: null | |
,__childrenDirty: null | |
,addChild: function(child) { | |
return this.addChildAt(child,this.get_numChildren()); | |
} | |
,addChildAt: function(child,index) { | |
if(child == null) { | |
var error = new openfl_errors_TypeError("Error #2007: Parameter child must be non-null."); | |
error.errorID = 2007; | |
throw new js__$Boot_HaxeError(error); | |
} else if(child.stage == child) { | |
var error1 = new openfl_errors_ArgumentError("Error #3783: A Stage object cannot be added as the child of another object."); | |
error1.errorID = 3783; | |
throw new js__$Boot_HaxeError(error1); | |
} | |
if(index > this.__children.length || index < 0) { | |
throw new js__$Boot_HaxeError("Invalid index position " + index); | |
} | |
var fsi = child.__fsi; | |
if(fsi != null) { | |
if(openfl_display_DisplayObject.__timelineOwner != this) { | |
fsi.state = 3; | |
fsi.displayObject = null; | |
child.__fsi = null; | |
} | |
} | |
if(child.parent == this) { | |
if(this.__children[index] != child) { | |
HxOverrides.remove(this.__children,child); | |
this.__children.splice(index,0,child); | |
if(!this.__renderDirty) { | |
this.__renderDirty = true; | |
this.__setParentRenderDirty(); | |
} | |
} | |
} else { | |
if(child.parent != null) { | |
child.parent.removeChild(child); | |
} | |
this.__children.splice(index,0,child); | |
this.__updateEnterFrameListeners(child.__enterFrameListeners); | |
child.parent = this; | |
var addedToStage = this.stage != null && child.stage == null; | |
if(addedToStage) { | |
this.__setStageReference(this.stage); | |
} | |
child.__setTransformDirty(); | |
if(!child.__renderDirty) { | |
child.__renderDirty = true; | |
child.__setParentRenderDirty(); | |
} | |
if(!this.__renderDirty) { | |
this.__renderDirty = true; | |
this.__setParentRenderDirty(); | |
} | |
var event = openfl_events_Event.__pool.get(); | |
event.type = "added"; | |
event.bubbles = true; | |
event.target = child; | |
child.__dispatchWithCapture(event); | |
openfl_events_Event.__pool.release(event); | |
if(addedToStage) { | |
event = new openfl_events_Event("addedToStage",false,false); | |
child.__dispatchWithCapture(event); | |
child.__dispatchChildren(event); | |
} | |
} | |
return child; | |
} | |
,areInaccessibleObjectsUnderPoint: function(point) { | |
return false; | |
} | |
,contains: function(child) { | |
while(child != this && child != null) child = child.parent; | |
return child == this; | |
} | |
,getChildAt: function(index) { | |
if(index >= 0 && index < this.__children.length) { | |
return this.__children[index]; | |
} | |
return null; | |
} | |
,getChildByName: function(name) { | |
var _g = 0; | |
var _g1 = this.__children; | |
while(_g < _g1.length) { | |
var child = _g1[_g]; | |
++_g; | |
if(child.get_name() == name) { | |
return child; | |
} | |
} | |
return null; | |
} | |
,getChildIndex: function(child) { | |
var _g1 = 0; | |
var _g = this.__children.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
if(this.__children[i] == child) { | |
return i; | |
} | |
} | |
return -1; | |
} | |
,getObjectsUnderPoint: function(point) { | |
var stack = []; | |
this.__hitTest(point.x,point.y,false,stack,false,this); | |
stack.reverse(); | |
return stack; | |
} | |
,__updateEnterFrameListeners: function(delta) { | |
this.__enterFrameListeners += delta; | |
if(this.parent != null) { | |
this.parent.__updateEnterFrameListeners(delta); | |
} | |
} | |
,removeChild: function(child) { | |
if(child != null && child.parent == this) { | |
var fsi = child.__fsi; | |
if(fsi != null) { | |
if(openfl_display_DisplayObject.__timelineOwner != this) { | |
fsi.state = 3; | |
fsi.displayObject = null; | |
child.__fsi = null; | |
} | |
} | |
child.__setTransformDirty(); | |
if(!child.__renderDirty) { | |
child.__renderDirty = true; | |
child.__setParentRenderDirty(); | |
} | |
if(!this.__renderDirty) { | |
this.__renderDirty = true; | |
this.__setParentRenderDirty(); | |
} | |
var event = new openfl_events_Event("removed",true); | |
child.__dispatchWithCapture(event); | |
if(this.stage != null) { | |
if(child.stage != null && this.stage.get_focus() == child) { | |
this.stage.set_focus(null); | |
} | |
var event1 = new openfl_events_Event("removedFromStage",false,false); | |
child.__dispatchWithCapture(event1); | |
child.__dispatchChildren(event1); | |
child.__setStageReference(null); | |
} | |
child.parent = null; | |
HxOverrides.remove(this.__children,child); | |
this.__updateEnterFrameListeners(-child.__enterFrameListeners); | |
this.__removedChildren.push(child); | |
child.__setTransformDirty(); | |
} | |
return child; | |
} | |
,removeChildAt: function(index) { | |
if(index >= 0 && index < this.__children.length) { | |
return this.removeChild(this.__children[index]); | |
} | |
return null; | |
} | |
,removeChildren: function(beginIndex,endIndex) { | |
if(endIndex == null) { | |
endIndex = 2147483647; | |
} | |
if(beginIndex == null) { | |
beginIndex = 0; | |
} | |
if(endIndex == 2147483647) { | |
endIndex = this.__children.length - 1; | |
if(endIndex < 0) { | |
return; | |
} | |
} | |
if(beginIndex > this.__children.length - 1) { | |
return; | |
} else if(endIndex < beginIndex || beginIndex < 0 || endIndex > this.__children.length) { | |
throw new js__$Boot_HaxeError(new openfl_errors_RangeError("The supplied index is out of bounds.")); | |
} | |
var numRemovals = endIndex - beginIndex; | |
while(numRemovals >= 0) { | |
this.removeChildAt(beginIndex); | |
--numRemovals; | |
} | |
} | |
,resolve: function(fieldName) { | |
if(this.__children == null) { | |
return null; | |
} | |
var _g = 0; | |
var _g1 = this.__children; | |
while(_g < _g1.length) { | |
var child = _g1[_g]; | |
++_g; | |
if(child.get_name() == fieldName) { | |
return child; | |
} | |
} | |
return null; | |
} | |
,setChildIndex: function(child,index) { | |
if(index >= 0 && index <= this.__children.length && child.parent == this) { | |
HxOverrides.remove(this.__children,child); | |
this.__children.splice(index,0,child); | |
} | |
} | |
,stopAllMovieClips: function() { | |
this.__stopAllMovieClips(); | |
} | |
,swapChildren: function(child1,child2) { | |
if(child1.parent == this && child2.parent == this) { | |
var index1 = this.__children.indexOf(child1); | |
var index2 = this.__children.indexOf(child2); | |
this.__children[index1] = child2; | |
this.__children[index2] = child1; | |
if(!this.__renderDirty) { | |
this.__renderDirty = true; | |
this.__setParentRenderDirty(); | |
} | |
} | |
} | |
,swapChildrenAt: function(index1,index2) { | |
var swap = this.__children[index1]; | |
this.__children[index1] = this.__children[index2]; | |
this.__children[index2] = swap; | |
swap = null; | |
if(!this.__renderDirty) { | |
this.__renderDirty = true; | |
this.__setParentRenderDirty(); | |
} | |
} | |
,__cleanup: function() { | |
openfl_display_InteractiveObject.prototype.__cleanup.call(this); | |
var _g = 0; | |
var _g1 = this.__children; | |
while(_g < _g1.length) { | |
var child = _g1[_g]; | |
++_g; | |
child.__cleanup(); | |
} | |
var _g2 = 0; | |
var _g11 = this.__removedChildren; | |
while(_g2 < _g11.get_length()) { | |
var orphan = _g11.get(_g2); | |
++_g2; | |
if(orphan.stage == null) { | |
orphan.__cleanup(); | |
} | |
} | |
this.__removedChildren.set_length(0); | |
} | |
,__cleanupRemovedChildren: function() { | |
var _g = 0; | |
var _g1 = this.__removedChildren; | |
while(_g < _g1.get_length()) { | |
var orphan = _g1.get(_g); | |
++_g; | |
if(orphan.stage == null) { | |
orphan.__cleanup(); | |
} | |
} | |
this.__removedChildren.set_length(0); | |
} | |
,__dispatchChildren: function(event) { | |
if(this.__children != null) { | |
var _g = 0; | |
var _g1 = this.__children; | |
while(_g < _g1.length) { | |
var child = _g1[_g]; | |
++_g; | |
event.target = child; | |
if(!child.__dispatchWithCapture(event)) { | |
break; | |
} | |
child.__dispatchChildren(event); | |
} | |
} | |
} | |
,__initFrame: function() { | |
var _g = 0; | |
var _g1 = this.__children; | |
while(_g < _g1.length) { | |
var child = _g1[_g]; | |
++_g; | |
child.__initFrame(); | |
} | |
} | |
,__enterFrame: function(deltaTime) { | |
var _g = 0; | |
var _g1 = this.__children; | |
while(_g < _g1.length) { | |
var child = _g1[_g]; | |
++_g; | |
if(child.__enterFrameListeners > 0) { | |
child.__enterFrame(deltaTime); | |
} | |
} | |
} | |
,__getBounds: function(rect,matrix) { | |
openfl_display_InteractiveObject.prototype.__getBounds.call(this,rect,matrix); | |
if(this.__children.length == 0) { | |
return; | |
} | |
var childWorldTransform = openfl_geom_Matrix.__pool.get(); | |
var _g = 0; | |
var _g1 = this.__children; | |
while(_g < _g1.length) { | |
var child = _g1[_g]; | |
++_g; | |
if(child.__scaleX == 0 || child.__scaleY == 0) { | |
continue; | |
} | |
var local = child.__transform; | |
childWorldTransform.a = local.a * matrix.a + local.b * matrix.c; | |
childWorldTransform.b = local.a * matrix.b + local.b * matrix.d; | |
childWorldTransform.c = local.c * matrix.a + local.d * matrix.c; | |
childWorldTransform.d = local.c * matrix.b + local.d * matrix.d; | |
childWorldTransform.tx = local.tx * matrix.a + local.ty * matrix.c + matrix.tx; | |
childWorldTransform.ty = local.tx * matrix.b + local.ty * matrix.d + matrix.ty; | |
child.__getBounds(rect,childWorldTransform); | |
} | |
openfl_geom_Matrix.__pool.release(childWorldTransform); | |
} | |
,__getVisibleBounds: function(rect,matrix) { | |
if(!this.__visible || this.__alpha == 0) { | |
return; | |
} | |
openfl_display_InteractiveObject.prototype.__getVisibleBounds.call(this,rect,matrix); | |
if(this.__children.length == 0) { | |
return; | |
} | |
var childWorldTransform = openfl_geom_Matrix.__pool.get(); | |
var _g = 0; | |
var _g1 = this.__children; | |
while(_g < _g1.length) { | |
var child = _g1[_g]; | |
++_g; | |
if(child.__scaleX == 0 || child.__scaleY == 0 || child.__isMask) { | |
continue; | |
} | |
var local = child.__transform; | |
childWorldTransform.a = local.a * matrix.a + local.b * matrix.c; | |
childWorldTransform.b = local.a * matrix.b + local.b * matrix.d; | |
childWorldTransform.c = local.c * matrix.a + local.d * matrix.c; | |
childWorldTransform.d = local.c * matrix.b + local.d * matrix.d; | |
childWorldTransform.tx = local.tx * matrix.a + local.ty * matrix.c + matrix.tx; | |
childWorldTransform.ty = local.tx * matrix.b + local.ty * matrix.d + matrix.ty; | |
child.__getVisibleBounds(rect,childWorldTransform); | |
} | |
openfl_geom_Matrix.__pool.release(childWorldTransform); | |
} | |
,__getFilterBounds: function(rect,matrix) { | |
openfl_display_InteractiveObject.prototype.__getFilterBounds.call(this,rect,matrix); | |
if(this.__scrollRect != null) { | |
return; | |
} | |
if(this.__children.length == 0) { | |
return; | |
} | |
var childWorldTransform = openfl_geom_Matrix.__pool.get(); | |
var _g = 0; | |
var _g1 = this.__children; | |
while(_g < _g1.length) { | |
var child = _g1[_g]; | |
++_g; | |
if(child.__scaleX == 0 || child.__scaleY == 0 || child.__isMask) { | |
continue; | |
} | |
var local = child.__transform; | |
childWorldTransform.a = local.a * matrix.a + local.b * matrix.c; | |
childWorldTransform.b = local.a * matrix.b + local.b * matrix.d; | |
childWorldTransform.c = local.c * matrix.a + local.d * matrix.c; | |
childWorldTransform.d = local.c * matrix.b + local.d * matrix.d; | |
childWorldTransform.tx = local.tx * matrix.a + local.ty * matrix.c + matrix.tx; | |
childWorldTransform.ty = local.tx * matrix.b + local.ty * matrix.d + matrix.ty; | |
child.__getFilterBounds(rect,childWorldTransform); | |
} | |
openfl_geom_Matrix.__pool.release(childWorldTransform); | |
} | |
,__getRenderBounds: function(rect,matrix) { | |
if(this.__scrollRect != null) { | |
openfl_display_InteractiveObject.prototype.__getRenderBounds.call(this,rect,matrix); | |
return; | |
} else { | |
openfl_display_InteractiveObject.prototype.__getBounds.call(this,rect,matrix); | |
} | |
if(this.__children.length == 0) { | |
return; | |
} | |
var childWorldTransform = openfl_geom_Matrix.__pool.get(); | |
var _g = 0; | |
var _g1 = this.__children; | |
while(_g < _g1.length) { | |
var child = _g1[_g]; | |
++_g; | |
if(child.__scaleX == 0 || child.__scaleY == 0 || child.__isMask) { | |
continue; | |
} | |
var local = child.__transform; | |
childWorldTransform.a = local.a * matrix.a + local.b * matrix.c; | |
childWorldTransform.b = local.a * matrix.b + local.b * matrix.d; | |
childWorldTransform.c = local.c * matrix.a + local.d * matrix.c; | |
childWorldTransform.d = local.c * matrix.b + local.d * matrix.d; | |
childWorldTransform.tx = local.tx * matrix.a + local.ty * matrix.c + matrix.tx; | |
childWorldTransform.ty = local.tx * matrix.b + local.ty * matrix.d + matrix.ty; | |
child.__getRenderBounds(rect,childWorldTransform); | |
} | |
openfl_geom_Matrix.__pool.release(childWorldTransform); | |
} | |
,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) { | |
if(!hitObject.get_visible() || this.__isMask || interactiveOnly && !this.mouseEnabled && !this.mouseChildren) { | |
return false; | |
} | |
if(this.get_mask() != null && !this.get_mask().__hitTestMask(x,y)) { | |
return false; | |
} | |
if(this.__scrollRect != null) { | |
var point = openfl_geom_Point.__pool.get(); | |
point.setTo(x,y); | |
var _this = this.__getRenderTransform(); | |
var norm = _this.a * _this.d - _this.b * _this.c; | |
if(norm == 0) { | |
point.x = -_this.tx; | |
point.y = -_this.ty; | |
} else { | |
var px = 1.0 / norm * (_this.c * (_this.ty - point.y) + _this.d * (point.x - _this.tx)); | |
point.y = 1.0 / norm * (_this.a * (point.y - _this.ty) + _this.b * (_this.tx - point.x)); | |
point.x = px; | |
} | |
if(!this.__scrollRect.containsPoint(point)) { | |
openfl_geom_Point.__pool.release(point); | |
return false; | |
} | |
openfl_geom_Point.__pool.release(point); | |
} | |
var i = this.__children.length; | |
if(interactiveOnly) { | |
if(stack == null || !this.mouseChildren) { | |
while(--i >= 0) if(this.__children[i].__hitTest(x,y,shapeFlag,null,true,this.__children[i])) { | |
if(stack != null) { | |
stack.push(hitObject); | |
} | |
return true; | |
} | |
} else if(stack != null) { | |
var length = stack.length; | |
var interactive = false; | |
var hitTest = false; | |
while(--i >= 0) { | |
interactive = this.__children[i].__getInteractive(null); | |
if(interactive || this.mouseEnabled && !hitTest) { | |
if(this.__children[i].__hitTest(x,y,shapeFlag,stack,true,this.__children[i])) { | |
hitTest = true; | |
if(interactive && stack.length > length) { | |
break; | |
} | |
} | |
} | |
} | |
if(hitTest) { | |
stack.splice(length,0,hitObject); | |
return true; | |
} | |
} | |
} else { | |
var hitTest1 = false; | |
while(--i >= 0) if(this.__children[i].__hitTest(x,y,shapeFlag,stack,false,this.__children[i])) { | |
hitTest1 = true; | |
if(stack == null) { | |
break; | |
} | |
} | |
return hitTest1; | |
} | |
return false; | |
} | |
,__hitTestMask: function(x,y) { | |
var i = this.__children.length; | |
while(--i >= 0) if(this.__children[i].__hitTestMask(x,y)) { | |
return true; | |
} | |
return false; | |
} | |
,__readGraphicsData: function(graphicsData,recurse) { | |
openfl_display_InteractiveObject.prototype.__readGraphicsData.call(this,graphicsData,recurse); | |
if(recurse) { | |
var _g = 0; | |
var _g1 = this.__children; | |
while(_g < _g1.length) { | |
var child = _g1[_g]; | |
++_g; | |
child.__readGraphicsData(graphicsData,recurse); | |
} | |
} | |
} | |
,__renderCairo: function(renderer) { | |
} | |
,__renderCairoMask: function(renderer) { | |
} | |
,__renderCanvas: function(renderer) { | |
var _g = 0; | |
var _g1 = this.__removedChildren; | |
while(_g < _g1.get_length()) { | |
var orphan = _g1.get(_g); | |
++_g; | |
if(orphan.stage == null) { | |
orphan.__cleanup(); | |
} | |
} | |
this.__removedChildren.set_length(0); | |
if(!this.__renderable || this.__worldAlpha <= 0 || this.get_mask() != null && (this.get_mask().get_width() <= 0 || this.get_mask().get_height() <= 0)) { | |
return; | |
} | |
openfl_display_InteractiveObject.prototype.__renderCanvas.call(this,renderer); | |
if(this.__cacheBitmap != null && !this.__isCacheBitmapRender) { | |
return; | |
} | |
renderer.__pushMaskObject(this); | |
if(renderer.__stage != null) { | |
var _g2 = 0; | |
var _g11 = this.__children; | |
while(_g2 < _g11.length) { | |
var child = _g11[_g2]; | |
++_g2; | |
child.__renderCanvas(renderer); | |
child.__renderDirty = false; | |
} | |
this.__renderDirty = false; | |
} else { | |
var _g3 = 0; | |
var _g12 = this.__children; | |
while(_g3 < _g12.length) { | |
var child1 = _g12[_g3]; | |
++_g3; | |
child1.__renderCanvas(renderer); | |
} | |
} | |
renderer.__popMaskObject(this); | |
} | |
,__renderCanvasMask: function(renderer) { | |
var _g = 0; | |
var _g1 = this.__removedChildren; | |
while(_g < _g1.get_length()) { | |
var orphan = _g1.get(_g); | |
++_g; | |
if(orphan.stage == null) { | |
orphan.__cleanup(); | |
} | |
} | |
this.__removedChildren.set_length(0); | |
if(this.__graphics != null) { | |
openfl__$internal_renderer_canvas_CanvasGraphics.renderMask(this.__graphics,renderer); | |
} | |
var _g2 = 0; | |
var _g11 = this.__children; | |
while(_g2 < _g11.length) { | |
var child = _g11[_g2]; | |
++_g2; | |
child.__renderCanvasMask(renderer); | |
} | |
} | |
,__renderDOM: function(renderer) { | |
var _g = 0; | |
var _g1 = this.__removedChildren; | |
while(_g < _g1.get_length()) { | |
var orphan = _g1.get(_g); | |
++_g; | |
if(orphan.stage == null) { | |
orphan.__renderDOM(renderer); | |
} | |
} | |
var _g2 = 0; | |
var _g11 = this.__removedChildren; | |
while(_g2 < _g11.get_length()) { | |
var orphan1 = _g11.get(_g2); | |
++_g2; | |
if(orphan1.stage == null) { | |
orphan1.__cleanup(); | |
} | |
} | |
this.__removedChildren.set_length(0); | |
openfl_display_InteractiveObject.prototype.__renderDOM.call(this,renderer); | |
if(this.__cacheBitmap != null && !this.__isCacheBitmapRender) { | |
return; | |
} | |
renderer.__pushMaskObject(this); | |
if(renderer.__stage != null) { | |
var _g3 = 0; | |
var _g12 = this.__children; | |
while(_g3 < _g12.length) { | |
var child = _g12[_g3]; | |
++_g3; | |
child.__renderDOM(renderer); | |
child.__renderDirty = false; | |
} | |
this.__renderDirty = false; | |
} else { | |
var _g4 = 0; | |
var _g13 = this.__children; | |
while(_g4 < _g13.length) { | |
var child1 = _g13[_g4]; | |
++_g4; | |
child1.__renderDOM(renderer); | |
} | |
} | |
renderer.__popMaskObject(this); | |
} | |
,__renderDOMClear: function(renderer) { | |
var _g = 0; | |
var _g1 = this.__removedChildren; | |
while(_g < _g1.get_length()) { | |
var orphan = _g1.get(_g); | |
++_g; | |
if(orphan.stage == null) { | |
orphan.__renderDOMClear(renderer); | |
} | |
} | |
var _g2 = 0; | |
var _g11 = this.__removedChildren; | |
while(_g2 < _g11.get_length()) { | |
var orphan1 = _g11.get(_g2); | |
++_g2; | |
if(orphan1.stage == null) { | |
orphan1.__cleanup(); | |
} | |
} | |
this.__removedChildren.set_length(0); | |
var _g3 = 0; | |
var _g12 = this.__children; | |
while(_g3 < _g12.length) { | |
var child = _g12[_g3]; | |
++_g3; | |
child.__renderDOMClear(renderer); | |
} | |
} | |
,__renderGL: function(renderer) { | |
var _g = 0; | |
var _g1 = this.__removedChildren; | |
while(_g < _g1.get_length()) { | |
var orphan = _g1.get(_g); | |
++_g; | |
if(orphan.stage == null) { | |
orphan.__cleanup(); | |
} | |
} | |
this.__removedChildren.set_length(0); | |
if(!this.__renderable || this.__worldAlpha <= 0) { | |
return; | |
} | |
openfl_display_InteractiveObject.prototype.__renderGL.call(this,renderer); | |
if(this.__cacheBitmap != null && !this.__isCacheBitmapRender) { | |
return; | |
} | |
if(this.__children.length > 0) { | |
renderer.__pushMaskObject(this); | |
if(renderer.__stage != null) { | |
var _g2 = 0; | |
var _g11 = this.__children; | |
while(_g2 < _g11.length) { | |
var child = _g11[_g2]; | |
++_g2; | |
child.__renderGL(renderer); | |
child.__renderDirty = false; | |
} | |
this.__renderDirty = false; | |
} else { | |
var _g3 = 0; | |
var _g12 = this.__children; | |
while(_g3 < _g12.length) { | |
var child1 = _g12[_g3]; | |
++_g3; | |
child1.__renderGL(renderer); | |
} | |
} | |
} | |
if(this.__children.length > 0) { | |
renderer.__popMaskObject(this); | |
} | |
} | |
,__renderGLMask: function(renderer) { | |
var _g = 0; | |
var _g1 = this.__removedChildren; | |
while(_g < _g1.get_length()) { | |
var orphan = _g1.get(_g); | |
++_g; | |
if(orphan.stage == null) { | |
orphan.__cleanup(); | |
} | |
} | |
this.__removedChildren.set_length(0); | |
if(this.__graphics != null) { | |
openfl__$internal_renderer_context3D_Context3DShape.renderMask(this,renderer); | |
} | |
var _g2 = 0; | |
var _g11 = this.__children; | |
while(_g2 < _g11.length) { | |
var child = _g11[_g2]; | |
++_g2; | |
child.__renderGLMask(renderer); | |
} | |
} | |
,__setStageReference: function(stage) { | |
openfl_display_InteractiveObject.prototype.__setStageReference.call(this,stage); | |
if(this.__children != null) { | |
var _g = 0; | |
var _g1 = this.__children; | |
while(_g < _g1.length) { | |
var child = _g1[_g]; | |
++_g; | |
child.__setStageReference(stage); | |
} | |
} | |
} | |
,__setWorldTransformInvalid: function() { | |
if(!this.__worldTransformInvalid) { | |
this.__worldTransformInvalid = true; | |
this.__childrenDirty = true; | |
if(this.__children != null) { | |
var _g = 0; | |
var _g1 = this.__children; | |
while(_g < _g1.length) { | |
var child = _g1[_g]; | |
++_g; | |
child.__setWorldTransformInvalid(); | |
} | |
} | |
} | |
} | |
,__shouldCacheHardware: function(value) { | |
if(value == true) { | |
return true; | |
} | |
value = openfl_display_InteractiveObject.prototype.__shouldCacheHardware.call(this,value); | |
if(value == true) { | |
return true; | |
} | |
if(this.__children != null) { | |
var _g = 0; | |
var _g1 = this.__children; | |
while(_g < _g1.length) { | |
var child = _g1[_g]; | |
++_g; | |
value = child.__shouldCacheHardware(value); | |
if(value == true) { | |
return true; | |
} | |
} | |
} | |
return value; | |
} | |
,__stopAllMovieClips: function() { | |
var _g = 0; | |
var _g1 = this.__children; | |
while(_g < _g1.length) { | |
var child = _g1[_g]; | |
++_g; | |
child.__stopAllMovieClips(); | |
} | |
} | |
,__tabTest: function(stack) { | |
openfl_display_InteractiveObject.prototype.__tabTest.call(this,stack); | |
if(!this.get_tabChildren()) { | |
return; | |
} | |
var interactive = false; | |
var interactiveObject = null; | |
var _g = 0; | |
var _g1 = this.__children; | |
while(_g < _g1.length) { | |
var child = _g1[_g]; | |
++_g; | |
interactive = child.__getInteractive(null); | |
if(interactive) { | |
interactiveObject = child; | |
interactiveObject.__tabTest(stack); | |
} | |
} | |
} | |
,__update: function(transformOnly,updateChildren) { | |
if(!this.__renderDirty && !this.__worldTransformInvalid && !this.__childrenDirty) { | |
return; | |
} | |
openfl_display_InteractiveObject.prototype.__update.call(this,transformOnly,updateChildren); | |
if(updateChildren) { | |
var _g = 0; | |
var _g1 = this.__children; | |
while(_g < _g1.length) { | |
var child = _g1[_g]; | |
++_g; | |
child.__update(transformOnly,true); | |
} | |
if(!transformOnly) { | |
this.__childrenDirty = false; | |
} | |
} | |
} | |
,__updateWorldAlpha: function(v) { | |
openfl_display_InteractiveObject.prototype.__updateWorldAlpha.call(this,v); | |
var _g = 0; | |
var _g1 = this.__children; | |
while(_g < _g1.length) { | |
var ch = _g1[_g]; | |
++_g; | |
ch.__updateWorldAlpha(v * ch.__alpha); | |
} | |
} | |
,get_numChildren: function() { | |
return this.__children.length; | |
} | |
,get_tabChildren: function() { | |
return this.__tabChildren; | |
} | |
,set_tabChildren: function(value) { | |
if(this.__tabChildren != value) { | |
this.__tabChildren = value; | |
this.dispatchEvent(new openfl_events_Event("tabChildrenChange",true,false)); | |
} | |
return this.__tabChildren; | |
} | |
,__class__: openfl_display_DisplayObjectContainer | |
,__properties__: $extend(openfl_display_InteractiveObject.prototype.__properties__,{set_tabChildren:"set_tabChildren",get_tabChildren:"get_tabChildren",get_numChildren:"get_numChildren"}) | |
}); | |
var openfl_display_Sprite = function() { | |
openfl_display_DisplayObjectContainer.call(this); | |
this.__buttonMode = false; | |
this.useHandCursor = true; | |
}; | |
$hxClasses["openfl.display.Sprite"] = openfl_display_Sprite; | |
openfl_display_Sprite.__name__ = ["openfl","display","Sprite"]; | |
openfl_display_Sprite.__super__ = openfl_display_DisplayObjectContainer; | |
openfl_display_Sprite.prototype = $extend(openfl_display_DisplayObjectContainer.prototype,{ | |
dropTarget: null | |
,hitArea: null | |
,useHandCursor: null | |
,__buttonMode: null | |
,startDrag: function(lockCenter,bounds) { | |
if(lockCenter == null) { | |
lockCenter = false; | |
} | |
if(this.stage != null) { | |
this.stage.__startDrag(this,lockCenter,bounds); | |
} | |
} | |
,stopDrag: function() { | |
if(this.stage != null) { | |
this.stage.__stopDrag(this); | |
} | |
} | |
,__getCursor: function() { | |
if(this.__buttonMode && this.useHandCursor) { | |
return "button"; | |
} else { | |
return null; | |
} | |
} | |
,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) { | |
if(interactiveOnly && !this.mouseEnabled && !this.mouseChildren) { | |
return false; | |
} | |
if(!hitObject.get_visible() || this.__isMask) { | |
return this.__hitTestHitArea(x,y,shapeFlag,stack,interactiveOnly,hitObject); | |
} | |
if(this.get_mask() != null && !this.get_mask().__hitTestMask(x,y)) { | |
return this.__hitTestHitArea(x,y,shapeFlag,stack,interactiveOnly,hitObject); | |
} | |
if(this.__scrollRect != null) { | |
var point = openfl_geom_Point.__pool.get(); | |
point.setTo(x,y); | |
var _this = this.__getRenderTransform(); | |
var norm = _this.a * _this.d - _this.b * _this.c; | |
if(norm == 0) { | |
point.x = -_this.tx; | |
point.y = -_this.ty; | |
} else { | |
var px = 1.0 / norm * (_this.c * (_this.ty - point.y) + _this.d * (point.x - _this.tx)); | |
point.y = 1.0 / norm * (_this.a * (point.y - _this.ty) + _this.b * (_this.tx - point.x)); | |
point.x = px; | |
} | |
if(!this.__scrollRect.containsPoint(point)) { | |
openfl_geom_Point.__pool.release(point); | |
return this.__hitTestHitArea(x,y,shapeFlag,stack,true,hitObject); | |
} | |
openfl_geom_Point.__pool.release(point); | |
} | |
if(openfl_display_DisplayObjectContainer.prototype.__hitTest.call(this,x,y,shapeFlag,stack,interactiveOnly,hitObject)) { | |
if(stack != null) { | |
return interactiveOnly; | |
} else { | |
return true; | |
} | |
} else if(this.hitArea == null && this.__graphics != null && this.__graphics.__hitTest(x,y,shapeFlag,this.__getRenderTransform())) { | |
if(stack != null && (!interactiveOnly || this.mouseEnabled)) { | |
stack.push(hitObject); | |
} | |
return true; | |
} | |
return this.__hitTestHitArea(x,y,shapeFlag,stack,interactiveOnly,hitObject); | |
} | |
,__hitTestHitArea: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) { | |
if(this.hitArea != null) { | |
if(!this.hitArea.mouseEnabled) { | |
this.hitArea.mouseEnabled = true; | |
var hitTest = this.hitArea.__hitTest(x,y,shapeFlag,null,true,hitObject); | |
this.hitArea.mouseEnabled = false; | |
if(stack != null && hitTest) { | |
stack[stack.length] = hitObject; | |
} | |
return hitTest; | |
} | |
} | |
return false; | |
} | |
,__hitTestMask: function(x,y) { | |
if(openfl_display_DisplayObjectContainer.prototype.__hitTestMask.call(this,x,y)) { | |
return true; | |
} else if(this.__graphics != null && this.__graphics.__hitTest(x,y,true,this.__getRenderTransform())) { | |
return true; | |
} | |
return false; | |
} | |
,get_graphics: function() { | |
if(this.__graphics == null) { | |
this.__graphics = new openfl_display_Graphics(this); | |
} | |
return this.__graphics; | |
} | |
,get_tabEnabled: function() { | |
if(this.__tabEnabled == null) { | |
return this.__buttonMode; | |
} else { | |
return this.__tabEnabled; | |
} | |
} | |
,get_buttonMode: function() { | |
return this.__buttonMode; | |
} | |
,set_buttonMode: function(value) { | |
return this.__buttonMode = value; | |
} | |
,__class__: openfl_display_Sprite | |
,__properties__: $extend(openfl_display_DisplayObjectContainer.prototype.__properties__,{get_graphics:"get_graphics",set_buttonMode:"set_buttonMode",get_buttonMode:"get_buttonMode"}) | |
}); | |
var Start = function() { | |
this.frame = 0; | |
openfl_display_Sprite.call(this); | |
this.stage.set_frameRate(30); | |
this.initEI(); | |
com_progrestar_common_util_FontUtils.start(); | |
lime_utils_AssetLibrary.validatePathFn = lime_utils_AssetManifest.validatePathFn = ($_=com_progrestar_framework_file_$system_FileSystem.pathController,$bind($_,$_.fixVersion)); | |
openfl__$internal_formats_swf_SWFLiteLibrary.getContextFn = function() { | |
return com_progrestar_game_utils_Stage3DListener.context3d; | |
}; | |
openfl_display_DisplayObject.enableFiltersFn = com_progrestar_game_managers_GameQualityManager.enableFilters; | |
com_progrestar_framework_time_Time.init(this); | |
com_progrestar_common_global_Env.start = this; | |
try { | |
openfl_system_Security.allowDomain("*"); | |
openfl_system_Security.allowInsecureDomain("*"); | |
} catch( error ) { | |
haxe_CallStack.lastException = error; | |
if (error instanceof js__$Boot_HaxeError) error = error.val; | |
if( js_Boot.__instanceof(error,openfl_errors_Error) ) { | |
} else throw(error); | |
} | |
com_progrestar_framework_core_utils_DisplayUtils.waitStage(this,$bind(this,this.onStage)); | |
com_progrestar_common_server_UncaughtErrorManager.register(this); | |
}; | |
$hxClasses["Start"] = Start; | |
Start.__name__ = ["Start"]; | |
Start.__super__ = openfl_display_Sprite; | |
Start.prototype = $extend(openfl_display_Sprite.prototype,{ | |
gameLoader: null | |
,frame: null | |
,initEI: function() { | |
var tag = window.document.createElement("div"); | |
var elementId = "flash-app"; | |
tag.id = elementId; | |
window.document.head.appendChild(tag); | |
window.document[elementId] = tag; | |
window[elementId] = tag; | |
openfl_external_ExternalInterface.setListenerElement(tag); | |
} | |
,onStage: function(v) { | |
com_progrestar_common_global_Env.stage = this.stage; | |
if(!this.stage.webGLAvailable()) { | |
throw new js__$Boot_HaxeError(new openfl_errors_Error("WebGL not available")); | |
} | |
this.stage.align = 6; | |
this.stage.set_scaleMode(2); | |
this.stage.set_color(0); | |
var flashVars = this.stage.get_loaderInfo().parameters; | |
if(com_progrestar_common_global_Env.HX_LOCAL) { | |
flashVars = { index_url : "http://localhost:2000/static/index.latest.json.gz", rpc_url : "https://dev-orange.studionx.ru/games/epicwar/master/api/index.php/", ident : "throne", network : "vkontakte", country_code : "RU", interface_lang : "ru", viewer_id : "79523225", api_id : "3391242", auth_key : "ps-sNDrsxjk-1557235423-81.95.140.122-869d8cf4247a00a3b14ee9c11c2f62ae", is_app_user : 1}; | |
} | |
try { | |
com_progrestar_common_global_Env.flashVars2 = flashVars; | |
openfl_system_Security.allowDomain("*"); | |
openfl_system_Security.allowInsecureDomain("*"); | |
} catch( error ) { | |
haxe_CallStack.lastException = error; | |
if (error instanceof js__$Boot_HaxeError) error = error.val; | |
if( js_Boot.__instanceof(error,openfl_errors_Error) ) { | |
var USER_ID = "167142933"; | |
flashVars = { "is_secure" : "0", "preloader_asset" : "preloader/preloader_battle.swf", "ref" : "unknown", "ads_app_id" : "3391242_6cd61f4536e95020ec", "api_settings" : "259", "browser" : "chrome", "referrer" : "unknown", "viewer_id" : USER_ID, "pepperFlash" : "true", "lc_name" : "f8d8e1a3", "viewer_type" : "0", "error_url" : "http://error.progrestar.net/client/", "sid" : "7ad3b11c1242678158b6442e4b5a04436b43a3672fa5deaaf56b7d36e909b59bea4d11b0d445af7b4f3e7", "hash" : "", "index_version" : "1446736342", "country_code" : "RU", "language" : "0", "ident" : "throne", "geoip_city" : "Moscow", "secret" : "e6bf5cbc98", "cb" : "1446736342", "sys_id" : "1", "user_id" : "0", "uid" : USER_ID, "group_id" : "0", "static_url" : "http://orange-test.ln/static/epicwar/casper/", "is_app_user" : "1", "interface_lang" : "ru", "auth_key" : "ps-A8lktjVx-1446736342-217.174.184.93-89cc76df785042c4191e37a4fb8443eb", "preloader" : "http://orange-test.ln/static/epicwar/casper/assets/EpicGame.swf?cb=1446736342", "access_token" : "a8c4bcb19a8006200c9b772d5c77ec87d4aba3a7c717584e76f41179025c5eef2c52034cfe7d089449eb5", "onlineInterval" : "100000", "network" : "vkontakte", "rpc_url" : "http://dev.nexters.com/dev/epicwar/vip/", "test" : "1", "parent_language" : "0", "api_url" : "http://api.vk.com/api.php", "onlineCnt" : "0", "ad_info" : "ElsdCQBaRlRgBw1YFkVUXiN2AFNzBx5pU1BXIgZUJlIEAWcgAUoLQg==", "index_url" : "http://orange-test.ln/static/epicwar/casper/index.json.gz.php", "requestLoadingInfoTimeout" : "3000", "api_id" : "3391242"}; | |
com_progrestar_common_global_Env.flashVars2 = flashVars; | |
} else throw(error); | |
} | |
if(flashVars.index_url) { | |
EpicWarEnv.FILE_INDEXER = StaticExt.fixUrl(Std,flashVars.index_url); | |
com_progrestar_common_global_Env.STATIC_URL = com_progrestar_framework_file_$system_FileSystemUtils.getDirectoryFromPath(EpicWarEnv.FILE_INDEXER) + "/"; | |
com_progrestar_common_global_Env.ASSETS_URL = com_progrestar_common_global_Env.STATIC_URL + "assets/"; | |
com_progrestar_common_global_LangManager.setLang(flashVars.interface_lang); | |
} | |
var over = flashVars.index_override; | |
if(over != null) { | |
var _g = 0; | |
var _g1 = Reflect.fields(over); | |
while(_g < _g1.length) { | |
var f = _g1[_g]; | |
++_g; | |
var this1 = com_progrestar_common_global_Env.indexOverride; | |
var v1 = Reflect.field(over,f); | |
var _this = this1; | |
if(__map_reserved[f] != null) { | |
_this.setReserved(f,v1); | |
} else { | |
_this.h[f] = v1; | |
} | |
} | |
} | |
LoadManager.instance = new LoadManager(this); | |
LoadManager.instance.initFileIndexer(); | |
LoadManager.instance.get_fileIndexLoader().get_successSignal().add($bind(this,this.onIndexLoaded)); | |
} | |
,onIndexLoaded: function(v) { | |
this.addChild(new EpicGame()); | |
} | |
,__class__: Start | |
}); | |
var DocumentClass = function(current) { | |
current.addChild(this); | |
Start.call(this); | |
this.dispatchEvent(new openfl_events_Event("addedToStage",false,false)); | |
}; | |
$hxClasses["DocumentClass"] = DocumentClass; | |
DocumentClass.__name__ = ["DocumentClass"]; | |
DocumentClass.__super__ = Start; | |
DocumentClass.prototype = $extend(Start.prototype,{ | |
__class__: DocumentClass | |
}); | |
var com_progrestar_cas_asset_IAsset = function() { }; | |
$hxClasses["com.progrestar.cas.asset.IAsset"] = com_progrestar_cas_asset_IAsset; | |
com_progrestar_cas_asset_IAsset.__name__ = ["com","progrestar","cas","asset","IAsset"]; | |
com_progrestar_cas_asset_IAsset.prototype = { | |
get_isFailed: null | |
,get_isLoaded: null | |
,get_reference: null | |
,load: null | |
,__class__: com_progrestar_cas_asset_IAsset | |
,__properties__: {get_isFailed:"get_isFailed",get_isLoaded:"get_isLoaded",get_reference:"get_reference"} | |
}; | |
var com_progrestar_cas_asset_ClassBasedAsset = function(fileUrl_,linkName_) { | |
this._classAsset = new com_progrestar_cas_asset_ClassAsset(com_progrestar_framework_file_$system_FileSystemUtils.validateFileName(fileUrl_,".swf"),linkName_); | |
com_progrestar_cas_asset_AssetCollection.register(this); | |
}; | |
$hxClasses["com.progrestar.cas.asset.ClassBasedAsset"] = com_progrestar_cas_asset_ClassBasedAsset; | |
com_progrestar_cas_asset_ClassBasedAsset.__name__ = ["com","progrestar","cas","asset","ClassBasedAsset"]; | |
com_progrestar_cas_asset_ClassBasedAsset.__interfaces__ = [com_progrestar_cas_asset_IAsset]; | |
com_progrestar_cas_asset_ClassBasedAsset.prototype = { | |
_classAsset: null | |
,get_reference: function() { | |
return this.get_classAsset().reference; | |
} | |
,load: function(priority) { | |
if(priority == null) { | |
priority = 0; | |
} | |
this.get_classAsset().load(priority); | |
} | |
,get_isLoaded: function() { | |
return this.get_classAsset().isLoaded; | |
} | |
,get_isFailed: function() { | |
return this.get_classAsset().isFailed; | |
} | |
,get_classAsset: function() { | |
return this._classAsset; | |
} | |
,__class__: com_progrestar_cas_asset_ClassBasedAsset | |
,__properties__: {get_classAsset:"get_classAsset",get_isFailed:"get_isFailed",get_isLoaded:"get_isLoaded",get_reference:"get_reference"} | |
}; | |
var com_progrestar_cas_asset_VisualAsset = function(fileUrl_,linkName_) { | |
com_progrestar_cas_asset_ClassBasedAsset.call(this,fileUrl_,linkName_); | |
}; | |
$hxClasses["com.progrestar.cas.asset.VisualAsset"] = com_progrestar_cas_asset_VisualAsset; | |
com_progrestar_cas_asset_VisualAsset.__name__ = ["com","progrestar","cas","asset","VisualAsset"]; | |
com_progrestar_cas_asset_VisualAsset.st_create = function(link,skin) { | |
if(link == null) { | |
return null; | |
} | |
link = StaticExt.replace(link,null,new EReg("\\{skin\\}","g"),skin); | |
var parts = StaticExt.splitr(link,"@"); | |
return new com_progrestar_cas_asset_VisualAsset(parts[0],parts[1]); | |
}; | |
com_progrestar_cas_asset_VisualAsset.__super__ = com_progrestar_cas_asset_ClassBasedAsset; | |
com_progrestar_cas_asset_VisualAsset.prototype = $extend(com_progrestar_cas_asset_ClassBasedAsset.prototype,{ | |
create: function(onSymbol,priority) { | |
if(priority == null) { | |
priority = 0; | |
} | |
var _gthis = this; | |
var onClassLoaded = function(classInstance) { | |
_gthis.get_classAsset().unsubscribe(onClassLoaded); | |
var instance = classInstance.instantiate(); | |
onSymbol(instance); | |
}; | |
this.get_classAsset().create(onClassLoaded,priority); | |
} | |
,createClass: function(onClass) { | |
this.get_classAsset().create(onClass); | |
} | |
,createTo: function(target,onReady) { | |
var onClassLoaded = function(classInstance) { | |
var instance = StaticExt.kast(Std,classInstance.instantiate(),openfl_display_DisplayObject); | |
target.addChild(instance); | |
if(onReady != null) { | |
onReady(null); | |
} | |
}; | |
this.get_classAsset().create(onClassLoaded); | |
} | |
,createContainer: function(onReady) { | |
var container = new openfl_display_Sprite(); | |
this.createTo(container,onReady); | |
return container; | |
} | |
,createImmediately: function() { | |
if(this.get_classAsset().classLoader != null) { | |
var instance = StaticExt.kast(Std,this.get_classAsset().classLoader.instantiate(),openfl_display_DisplayObject); | |
com_progrestar_framework_core_Assert.notNull(instance); | |
return instance; | |
} | |
return null; | |
} | |
,__class__: com_progrestar_cas_asset_VisualAsset | |
}); | |
var com_progrestar_framework_file_$system_FileSystemUtils = function() { | |
}; | |
$hxClasses["com.progrestar.framework.file_system.FileSystemUtils"] = com_progrestar_framework_file_$system_FileSystemUtils; | |
com_progrestar_framework_file_$system_FileSystemUtils.__name__ = ["com","progrestar","framework","file_system","FileSystemUtils"]; | |
com_progrestar_framework_file_$system_FileSystemUtils.addVersionParam = function(url) { | |
if(url.indexOf("?") >= 0) { | |
url += "&" + "v=js"; | |
} else { | |
url += "?" + "v=js"; | |
} | |
return url; | |
}; | |
com_progrestar_framework_file_$system_FileSystemUtils.validateFileName = function(fileName,defaultExtension) { | |
var extension = com_progrestar_framework_file_$system_FileSystemUtils.getFileExtension(fileName); | |
if(extension == null && defaultExtension != null) { | |
fileName += defaultExtension; | |
} | |
return fileName; | |
}; | |
com_progrestar_framework_file_$system_FileSystemUtils.validateLink = function(clipLink,defaultExtension) { | |
if(clipLink == null) { | |
return null; | |
} | |
var dogIndex = clipLink.indexOf("@"); | |
var clipLinkLength = clipLink.length; | |
var fileName = clipLink; | |
var clipName = null; | |
if(dogIndex >= 0) { | |
fileName = clipLink.substring(0,dogIndex); | |
clipName = clipLink.substring(dogIndex + 1,clipLinkLength); | |
} | |
fileName = com_progrestar_framework_file_$system_FileSystemUtils.validateFileName(fileName,defaultExtension); | |
if(com_progrestar_framework_class_$system_ClassFactory.DEFAULT_PATH != null && clipLink.indexOf(com_progrestar_framework_class_$system_ClassFactory.DEFAULT_PATH) < 0) { | |
fileName = com_progrestar_framework_file_$system_FileSystemUtils.format(com_progrestar_framework_class_$system_ClassFactory.DEFAULT_PATH + fileName); | |
} else { | |
fileName = com_progrestar_framework_file_$system_FileSystemUtils.format(fileName); | |
} | |
if(clipName != null) { | |
return fileName + "@" + clipName; | |
} | |
return fileName; | |
}; | |
com_progrestar_framework_file_$system_FileSystemUtils.getFileExtension = function(filePath) { | |
var extFinish = filePath.indexOf("?"); | |
if(extFinish < 0) { | |
extFinish = 2147483647; | |
} | |
var lastSlash = filePath.lastIndexOf("/",extFinish); | |
var extStart = filePath.lastIndexOf(".",extFinish); | |
if(extStart < lastSlash || extStart == -1) { | |
return null; | |
} | |
var extension = filePath.substring(extStart + 1,extFinish); | |
return extension; | |
}; | |
com_progrestar_framework_file_$system_FileSystemUtils.changeFileExtension = function(filePath,newExtension) { | |
var a = filePath.split("?"); | |
a[0] = haxe_io_Path.withExtension(a[0],newExtension); | |
return a.join("?"); | |
}; | |
com_progrestar_framework_file_$system_FileSystemUtils.format = function(path) { | |
var _this = com_progrestar_framework_file_$system_FileSystemUtils.paths; | |
var result = __map_reserved[path] != null ? _this.getReserved(path) : _this.h[path]; | |
if(result == null) { | |
var str = "/../"; | |
result = StaticExt.replace(path,"\\",null,"/"); | |
while(true) { | |
var finish = result.indexOf(str); | |
if(finish < 0) { | |
break; | |
} | |
var start = result.lastIndexOf("/",finish - 1); | |
result = result.substring(0,start) + result.substring(finish + 3); | |
} | |
var _this1 = com_progrestar_framework_file_$system_FileSystemUtils.paths; | |
if(__map_reserved[path] != null) { | |
_this1.setReserved(path,result); | |
} else { | |
_this1.h[path] = result; | |
} | |
} | |
return result; | |
}; | |
com_progrestar_framework_file_$system_FileSystemUtils.getFileFromPath = function(path) { | |
path = com_progrestar_framework_file_$system_FileSystemUtils.format(path); | |
return path.substring(path.lastIndexOf("/") + 1); | |
}; | |
com_progrestar_framework_file_$system_FileSystemUtils.getDirectoryFromPath = function(path) { | |
path = com_progrestar_framework_file_$system_FileSystemUtils.format(path); | |
return path.substring(0,path.lastIndexOf("/")); | |
}; | |
com_progrestar_framework_file_$system_FileSystemUtils.prototype = { | |
__class__: com_progrestar_framework_file_$system_FileSystemUtils | |
}; | |
var com_progrestar_cas_asset_ClassAsset = function(fileUrl,linkName) { | |
this.classLoaded = new utils_signals_Signal(); | |
this.loading = false; | |
this.reference = new com_progrestar_cas_asset_AssetReference(fileUrl,linkName); | |
}; | |
$hxClasses["com.progrestar.cas.asset.ClassAsset"] = com_progrestar_cas_asset_ClassAsset; | |
com_progrestar_cas_asset_ClassAsset.__name__ = ["com","progrestar","cas","asset","ClassAsset"]; | |
com_progrestar_cas_asset_ClassAsset.prototype = { | |
isFailed: null | |
,isLoaded: null | |
,reference: null | |
,classLoader: null | |
,loading: null | |
,classLoaded: null | |
,load: function(priority) { | |
if(priority == null) { | |
priority = 0; | |
} | |
this.tryStartLoad(priority); | |
} | |
,tryStartLoad: function(priority) { | |
if(this.loading || this.isFailed || this.isLoaded) { | |
return; | |
} | |
this.loading = true; | |
this.classLoader = com_progrestar_framework_class_$system_ClassFactory.getClass(com_progrestar_framework_class_$system_ClassFactory.DEFAULT_PATH + this.reference.get_fileUrl(),this.reference.get_linkName(),null,priority); | |
if(this.classLoader != null) { | |
this.classLoader.get_classLoaded().add($bind(this,this.onClassLoaded)); | |
this.classLoader.get_classFailed().add($bind(this,this.onClassFailed)); | |
if(this.isLoaded || this.isFailed) { | |
this.clearListeners(); | |
} | |
} else { | |
this.onClassFailed(); | |
} | |
} | |
,create: function(onClass,priority) { | |
if(priority == null) { | |
priority = 0; | |
} | |
if(this.isLoaded) { | |
com_progrestar_framework_time_Time.wait(onClass,0.001,this.classLoader); | |
} else { | |
this.classLoaded.add(onClass); | |
this.tryStartLoad(priority); | |
} | |
} | |
,unsubscribe: function(onClass) { | |
this.classLoaded.remove(onClass); | |
} | |
,onClassLoaded: function(value) { | |
this.clearListeners(); | |
this.classLoader = value; | |
this.isLoaded = true; | |
this.loading = false; | |
this.classLoaded.dispatch(value); | |
} | |
,onClassFailed: function(v) { | |
this.clearListeners(); | |
this.classLoader = null; | |
this.isFailed = true; | |
this.loading = false; | |
} | |
,clearListeners: function() { | |
if(this.classLoader != null) { | |
this.classLoader.get_classLoaded().remove($bind(this,this.onClassLoaded)); | |
this.classLoader.get_classFailed().remove($bind(this,this.onClassFailed)); | |
} | |
} | |
,__class__: com_progrestar_cas_asset_ClassAsset | |
}; | |
var com_progrestar_cas_asset_AssetReference = function(fileUrl_,linkName_) { | |
this._fileUrl = fileUrl_; | |
this._fileKey = fileUrl_; | |
this._linkName = linkName_; | |
this.check(); | |
}; | |
$hxClasses["com.progrestar.cas.asset.AssetReference"] = com_progrestar_cas_asset_AssetReference; | |
com_progrestar_cas_asset_AssetReference.__name__ = ["com","progrestar","cas","asset","AssetReference"]; | |
com_progrestar_cas_asset_AssetReference.prototype = { | |
_fileUrl: null | |
,_fileKey: null | |
,_linkName: null | |
,check: function() { | |
com_progrestar_framework_core_Assert.isTrue(com_progrestar_framework_file_$system_FileSystem.checkPath(this.get_fileUrl()),"invalid asset path: \"" + this.get_fileUrl() + "\""); | |
} | |
,get_fileUrl: function() { | |
return this._fileUrl; | |
} | |
,get_fileKey: function() { | |
return this._fileKey; | |
} | |
,get_linkName: function() { | |
return this._linkName; | |
} | |
,toString: function() { | |
return this.get_fileUrl() + "@" + this.get_linkName(); | |
} | |
,__class__: com_progrestar_cas_asset_AssetReference | |
,__properties__: {get_linkName:"get_linkName",get_fileKey:"get_fileKey",get_fileUrl:"get_fileUrl"} | |
}; | |
var utils_ds__$JSMap_JSMap_$Impl_$ = {}; | |
$hxClasses["utils.ds._JSMap.JSMap_Impl_"] = utils_ds__$JSMap_JSMap_$Impl_$; | |
utils_ds__$JSMap_JSMap_$Impl_$.__name__ = ["utils","ds","_JSMap","JSMap_Impl_"]; | |
utils_ds__$JSMap_JSMap_$Impl_$._new = function() { | |
var this1 = new Map(); | |
return this1; | |
}; | |
utils_ds__$JSMap_JSMap_$Impl_$.get = function(this1,k) { | |
return this1.get(k); | |
}; | |
utils_ds__$JSMap_JSMap_$Impl_$.set = function(this1,k,v) { | |
this1.set(k,v); | |
}; | |
utils_ds__$JSMap_JSMap_$Impl_$.exists = function(this1,k) { | |
return this1.has(k); | |
}; | |
utils_ds__$JSMap_JSMap_$Impl_$.remove = function(this1,k) { | |
return this1["delete"](k); | |
}; | |
utils_ds__$JSMap_JSMap_$Impl_$.clear = function(this1) { | |
this1.clear(); | |
}; | |
utils_ds__$JSMap_JSMap_$Impl_$.keys = function(this1) { | |
return new utils_ds_JSIterator(this1.keys()); | |
}; | |
utils_ds__$JSMap_JSMap_$Impl_$.iterator = function(this1) { | |
return new utils_ds_JSIterator(this1.values()); | |
}; | |
utils_ds__$JSMap_JSMap_$Impl_$.hasAny = function(this1) { | |
return this1.size != 0; | |
}; | |
utils_ds__$JSMap_JSMap_$Impl_$.isEmpty = function(this1) { | |
return this1.size == 0; | |
}; | |
utils_ds__$JSMap_JSMap_$Impl_$.size = function(this1) { | |
return this1.size; | |
}; | |
utils_ds__$JSMap_JSMap_$Impl_$.each = function(this1,callback,thisArg) { | |
this1.forEach(callback,thisArg); | |
return; | |
}; | |
utils_ds__$JSMap_JSMap_$Impl_$.toString = function(this1) { | |
return "some JSMap"; | |
}; | |
var com_progrestar_cas_asset_AssetCollection = function() { | |
}; | |
$hxClasses["com.progrestar.cas.asset.AssetCollection"] = com_progrestar_cas_asset_AssetCollection; | |
com_progrestar_cas_asset_AssetCollection.__name__ = ["com","progrestar","cas","asset","AssetCollection"]; | |
com_progrestar_cas_asset_AssetCollection.register = function(item) { | |
var key = item.get_reference().get_fileKey(); | |
var list = null; | |
if(!Object.prototype.hasOwnProperty.call(com_progrestar_cas_asset_AssetCollection.items,key)) { | |
list = []; | |
com_progrestar_cas_asset_AssetCollection.items.set(key,list); | |
} else { | |
list = com_progrestar_cas_asset_AssetCollection.items.get(key); | |
} | |
list.push(item); | |
}; | |
com_progrestar_cas_asset_AssetCollection.getItemsByPath = function(fileKey) { | |
return com_progrestar_cas_asset_AssetCollection.items.get(fileKey); | |
}; | |
com_progrestar_cas_asset_AssetCollection.prototype = { | |
__class__: com_progrestar_cas_asset_AssetCollection | |
}; | |
var com_progrestar_framework_sound_$system_SoundAsset = function(fileUrl_,linkName_) { | |
com_progrestar_cas_asset_ClassBasedAsset.call(this,fileUrl_,linkName_); | |
}; | |
$hxClasses["com.progrestar.framework.sound_system.SoundAsset"] = com_progrestar_framework_sound_$system_SoundAsset; | |
com_progrestar_framework_sound_$system_SoundAsset.__name__ = ["com","progrestar","framework","sound_system","SoundAsset"]; | |
com_progrestar_framework_sound_$system_SoundAsset.__super__ = com_progrestar_cas_asset_ClassBasedAsset; | |
com_progrestar_framework_sound_$system_SoundAsset.prototype = $extend(com_progrestar_cas_asset_ClassBasedAsset.prototype,{ | |
sound: null | |
,createSound: function() { | |
this.sound = StaticExt.kast(Std,this.get_classAsset().classLoader.instantiate(),openfl_media_Sound); | |
} | |
,getData: function() { | |
return this.sound; | |
} | |
,preload: function(callback) { | |
var _gthis = this; | |
if(this.sound == null) { | |
var onClassLoaded = function(classInstance) { | |
_gthis.createSound(); | |
if(callback != null) { | |
callback(null); | |
} | |
}; | |
if(this.get_classAsset() != null) { | |
this.get_classAsset().create(onClassLoaded); | |
} | |
} else if(callback != null) { | |
callback(null); | |
} | |
} | |
,play: function(volume,panning,maxWaitingTime,loop,checkMusicSettings) { | |
if(checkMusicSettings == null) { | |
checkMusicSettings = false; | |
} | |
if(loop == null) { | |
loop = 0; | |
} | |
if(maxWaitingTime == null) { | |
maxWaitingTime = 100; | |
} | |
if(panning == null) { | |
panning = 0; | |
} | |
if(volume == null) { | |
volume = 1; | |
} | |
var _gthis = this; | |
if(checkMusicSettings) { | |
if(!com_progrestar_common_managers_Settings.music.get_value()) { | |
return null; | |
} | |
} else if(!com_progrestar_common_managers_Settings.sound.get_value()) { | |
return null; | |
} | |
if(this.sound != null) { | |
return this.playImmediately(volume,panning,loop); | |
} else { | |
var timeStartLoad = Math.round(new Date().getTime() / 1000 * 1000); | |
var onClassLoaded = function(classInstance) { | |
_gthis.createSound(); | |
if(timeStartLoad + maxWaitingTime >= Math.round(new Date().getTime() / 1000 * 1000)) { | |
_gthis.playImmediately(volume,panning,loop); | |
} | |
}; | |
this.get_classAsset().create(onClassLoaded); | |
} | |
return null; | |
} | |
,playImmediately: function(volume,panning,loop) { | |
if(loop == null) { | |
loop = 0; | |
} | |
if(panning == null) { | |
panning = 0; | |
} | |
if(volume == null) { | |
volume = 1; | |
} | |
if(this.sound != null) { | |
var transform = null; | |
if(volume != 1 || panning != 0) { | |
transform = new openfl_media_SoundTransform(volume,panning); | |
} | |
return this.sound.play(0,loop,transform); | |
} | |
return null; | |
} | |
,__class__: com_progrestar_framework_sound_$system_SoundAsset | |
}); | |
var Assets = function() { | |
}; | |
$hxClasses["Assets"] = Assets; | |
Assets.__name__ = ["Assets"]; | |
Assets.prototype = { | |
__class__: Assets | |
}; | |
var CanvasBlurController = function(_stage) { | |
this.stage = _stage; | |
try { | |
openfl_external_ExternalInterface.addCallback("exportScreenshot",$bind(this,this.exportScreenshot)); | |
} catch( error ) { | |
haxe_CallStack.lastException = error; | |
} | |
}; | |
$hxClasses["CanvasBlurController"] = CanvasBlurController; | |
CanvasBlurController.__name__ = ["CanvasBlurController"]; | |
CanvasBlurController.prototype = { | |
stage: null | |
,exportScreenshot: function() { | |
com_progrestar_game_managers_GameQualityManager.showBackgroundAnimation(true); | |
if(com_genome2d_Genome2D.g2d_instance == null) { | |
com_genome2d_Genome2D.g2d_instantiable = true; | |
new com_genome2d_Genome2D(); | |
com_genome2d_Genome2D.g2d_instantiable = false; | |
} | |
com_genome2d_Genome2D.g2d_instance.g2d_onPostRender.addOnce($bind(this,this.onPostRender)); | |
} | |
,onPostRender: function() { | |
var oldTime = Math.round(new Date().getTime() / 1000 * 1000); | |
var result = null; | |
var tmp; | |
if(com_genome2d_Genome2D.g2d_instance == null) { | |
com_genome2d_Genome2D.g2d_instantiable = true; | |
new com_genome2d_Genome2D(); | |
com_genome2d_Genome2D.g2d_instantiable = false; | |
} | |
if(com_genome2d_Genome2D.g2d_instance.g2d_context != null) { | |
if(com_genome2d_Genome2D.g2d_instance == null) { | |
com_genome2d_Genome2D.g2d_instantiable = true; | |
new com_genome2d_Genome2D(); | |
com_genome2d_Genome2D.g2d_instantiable = false; | |
} | |
tmp = com_genome2d_Genome2D.g2d_instance.g2d_context.getNativeContext() != null; | |
} else { | |
tmp = false; | |
} | |
if(tmp) { | |
var scale = 0.2; | |
if(com_genome2d_Genome2D.g2d_instance == null) { | |
com_genome2d_Genome2D.g2d_instantiable = true; | |
new com_genome2d_Genome2D(); | |
com_genome2d_Genome2D.g2d_instantiable = false; | |
} | |
var nativeContext = com_genome2d_Genome2D.g2d_instance.g2d_context.getNativeContext(); | |
var screenBitmap = StaticExt.kast(Std,nativeContext,openfl_display_BitmapData); | |
var context3D = StaticExt.kast(Std,nativeContext,openfl_display3D_Context3D); | |
if(context3D != null) { | |
screenBitmap = new openfl_display_BitmapData(this.stage.stageWidth * com_progrestar_cas_utils_VisualUtils.getBrowzerZoomFactor(this.stage) | 0,this.stage.stageHeight * com_progrestar_cas_utils_VisualUtils.getBrowzerZoomFactor(this.stage) | 0,false,0); | |
context3D.drawToBitmapData(screenBitmap); | |
} | |
if(screenBitmap == null) { | |
return; | |
} | |
var bData = new openfl_display_BitmapData(this.stage.stageWidth * scale | 0,this.stage.stageHeight * scale | 0,false,0); | |
var matrix = new openfl_geom_Matrix(); | |
matrix.scale(scale,scale); | |
bData.draw(screenBitmap,matrix); | |
bData.draw(this.stage,matrix); | |
var blurFilter = new openfl_filters_BlurFilter(2,2,2); | |
bData.applyFilter(bData,bData.rect,new openfl_geom_Point(0,0),blurFilter); | |
var jpgBytes = bData.encode(bData.rect,new openfl_display_JPEGEncoderOptions(80)); | |
if(jpgBytes != null) { | |
var screenshotBase64 = haxe_crypto_Base64.encode(openfl_utils__$ByteArray_ByteArray_$Impl_$.toBytes(jpgBytes)); | |
if(screenshotBase64 != null) { | |
result = screenshotBase64; | |
} | |
} | |
} | |
openfl_external_ExternalInterface.call("showScreenshot",result); | |
var newTime = Math.round(new Date().getTime() / 1000 * 1000); | |
com_progrestar_framework_core_utils_TraceUtils.consoleLog("draw screen" + Std.string(newTime - oldTime)); | |
com_progrestar_game_managers_GameQualityManager.showBackgroundAnimation(!com_progrestar_common_managers_DialogManager.get_hasOpenedDialog()); | |
} | |
,__class__: CanvasBlurController | |
}; | |
var EReg = function(r,opt) { | |
this.r = new RegExp(r,opt.split("u").join("")); | |
}; | |
$hxClasses["EReg"] = EReg; | |
EReg.__name__ = ["EReg"]; | |
EReg.prototype = { | |
r: null | |
,match: function(s) { | |
if(this.r.global) { | |
this.r.lastIndex = 0; | |
} | |
this.r.m = this.r.exec(s); | |
this.r.s = s; | |
return this.r.m != null; | |
} | |
,matched: function(n) { | |
if(this.r.m != null && n >= 0 && n < this.r.m.length) { | |
return this.r.m[n]; | |
} else { | |
throw new js__$Boot_HaxeError("EReg::matched"); | |
} | |
} | |
,matchedRight: function() { | |
if(this.r.m == null) { | |
throw new js__$Boot_HaxeError("No string matched"); | |
} | |
var sz = this.r.m.index + this.r.m[0].length; | |
return HxOverrides.substr(this.r.s,sz,this.r.s.length - sz); | |
} | |
,matchedPos: function() { | |
if(this.r.m == null) { | |
throw new js__$Boot_HaxeError("No string matched"); | |
} | |
return { pos : this.r.m.index, len : this.r.m[0].length}; | |
} | |
,matchSub: function(s,pos,len) { | |
if(len == null) { | |
len = -1; | |
} | |
if(this.r.global) { | |
this.r.lastIndex = pos; | |
var tmp = this.r; | |
var tmp1 = len < 0 ? s : HxOverrides.substr(s,0,pos + len); | |
this.r.m = tmp.exec(tmp1); | |
var b = this.r.m != null; | |
if(b) { | |
this.r.s = s; | |
} | |
return b; | |
} else { | |
var b1 = this.match(len < 0 ? HxOverrides.substr(s,pos,null) : HxOverrides.substr(s,pos,len)); | |
if(b1) { | |
this.r.s = s; | |
this.r.m.index += pos; | |
} | |
return b1; | |
} | |
} | |
,split: function(s) { | |
var d = "#__delim__#"; | |
return s.replace(this.r,d).split(d); | |
} | |
,map: function(s,f) { | |
var offset = 0; | |
var buf_b = ""; | |
while(true) { | |
if(offset >= s.length) { | |
break; | |
} else if(!this.matchSub(s,offset)) { | |
buf_b += Std.string(HxOverrides.substr(s,offset,null)); | |
break; | |
} | |
var p = this.matchedPos(); | |
buf_b += Std.string(HxOverrides.substr(s,offset,p.pos - offset)); | |
buf_b += Std.string(f(this)); | |
if(p.len == 0) { | |
buf_b += Std.string(HxOverrides.substr(s,p.pos,1)); | |
offset = p.pos + 1; | |
} else { | |
offset = p.pos + p.len; | |
} | |
if(!this.r.global) { | |
break; | |
} | |
} | |
if(!this.r.global && offset > 0 && offset < s.length) { | |
buf_b += Std.string(HxOverrides.substr(s,offset,null)); | |
} | |
return buf_b; | |
} | |
,__class__: EReg | |
}; | |
var EnvSettings = function() { | |
}; | |
$hxClasses["EnvSettings"] = EnvSettings; | |
EnvSettings.__name__ = ["EnvSettings"]; | |
EnvSettings.validateFlashVars = function(flashVars) { | |
if(Reflect.field(flashVars,"app_id") == null && Reflect.field(flashVars,"api_id") != null) { | |
flashVars["app_id"] = Reflect.field(flashVars,"api_id"); | |
} | |
var _g = 0; | |
var _g1 = Reflect.fields(flashVars); | |
while(_g < _g1.length) { | |
var key = _g1[_g]; | |
++_g; | |
return true; | |
} | |
return false; | |
}; | |
EnvSettings.setup = function(flashVars) { | |
com_progrestar_framework_core_utils_TraceUtils.consoleLogA(["flashVars >> ",flashVars]); | |
var localeTest = true; | |
if(EnvSettings.validateFlashVars(flashVars)) { | |
com_progrestar_common_global_Env.flashVars = flashVars; | |
com_progrestar_common_global_Env.SERVER_URL = StaticExt.fixUrl(Std,flashVars.rpc_url); | |
com_progrestar_common_global_Env.NETWORK = flashVars.network; | |
com_progrestar_common_global_Env.URL_LOG_API = StaticExt.fixUrl(Std,flashVars.error_url); | |
localeTest = flashVars.test == "1"; | |
EpicWarEnv.country = flashVars.country_code; | |
EpicWarEnv.gameType = flashVars.ident ? flashVars.ident : "throne"; | |
} | |
com_progrestar_common_global_Env.uiAssetKey = "ui/ui"; | |
com_progrestar_common_global_Env.ticker = com_progrestar_game_utils_GameObjectManager.main; | |
com_progrestar_common_global_Env.testMode = localeTest; | |
lime_utils_Log.level = localeTest ? 5 : 0; | |
var preloaderAsset = "preloader/preloader_splash.swf"; | |
EpicWarEnv.preloader = com_progrestar_common_global_Env.ASSETS_URL + preloaderAsset; | |
EnvSettings.generateReferer(); | |
EnvSettings.generateCustomPreloaderPath(); | |
EnvSettings.generateSessionKey(); | |
EnvSettings.checkSettings(); | |
}; | |
EnvSettings.checkSettings = function() { | |
EnvSettings.check("invalid game type",EpicWarEnv.gameType,["throne"]); | |
EnvSettings.check("invalid network",com_progrestar_common_global_Env.NETWORK,["vkontakte","odnoklassniki","mail","facebook","local"]); | |
}; | |
EnvSettings.check = function(message,value,variants) { | |
if(variants.indexOf(value) < 0) { | |
com_progrestar_common_global_Env.log.loadInfo(message,"FF4040"); | |
com_progrestar_framework_core_Assert.isTrue(false,message); | |
} | |
}; | |
EnvSettings.generateReferer = function() { | |
var result = ""; | |
if(com_progrestar_common_global_Env.flashVars == null) { | |
return; | |
} | |
var _sw0_ = com_progrestar_common_global_Env.NETWORK; | |
switch(_sw0_) { | |
case "facebook": | |
result = Reflect.field(com_progrestar_common_global_Env.flashVars,"fb_source"); | |
break; | |
case "mail": | |
result = ""; | |
break; | |
case "odnoklassniki": | |
var customArgs = Reflect.field(com_progrestar_common_global_Env.flashVars,"custom_args"); | |
if(customArgs != null && customArgs.length > 0) { | |
var temp = StaticExt.splitr(customArgs,"&"); | |
var _g1 = 0; | |
var _g = temp.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
var s = temp[i]; | |
var a = StaticExt.splitr(s,"="); | |
if(a[0] == "referer_type") { | |
result = a[1]; | |
break; | |
} | |
} | |
} | |
break; | |
case "vkontakte": | |
var referrer = Reflect.field(com_progrestar_common_global_Env.flashVars,"referrer"); | |
if(referrer != null && referrer.length > 0 && referrer != "unknown") { | |
result = referrer.substring(referrer.indexOf("_") + 1); | |
} | |
break; | |
} | |
com_progrestar_common_global_Env.referer = result; | |
}; | |
EnvSettings.generateCustomPreloaderPath = function() { | |
var preloaderPic = com_progrestar_common_global_Env.referer; | |
if(preloaderPic != null && preloaderPic.length > 0) { | |
EpicWarEnv.preloaderPic = preloaderPic; | |
} | |
}; | |
EnvSettings.generateSessionKey = function() { | |
var date = new Date(); | |
var unixTimestamp = (Math.floor(date.getTime() / 1000) | 0) & -1; | |
var random = Math.floor(Math.random() * 268435455); | |
var unixTimestampKey = utils_MathUtil.toStringBase(unixTimestamp,36); | |
var randomKey = utils_MathUtil.toStringBase(random,36); | |
com_progrestar_common_global_Env.sessionKey = com_progrestar_common_util_StrPad.strPad(unixTimestampKey,7,"0") + com_progrestar_common_util_StrPad.strPad(randomKey,7,"0"); | |
}; | |
EnvSettings.prototype = { | |
__class__: EnvSettings | |
}; | |
var utils_signals_Signal = function(defaultValue_) { | |
this.needCloneListeners = false; | |
this.listenersSet = utils_ds__$JSMap_JSMap_$Impl_$._new(); | |
this.listeners = []; | |
this.defaultValue = defaultValue_; | |
}; | |
$hxClasses["utils.signals.Signal"] = utils_signals_Signal; | |
utils_signals_Signal.__name__ = ["utils","signals","Signal"]; | |
utils_signals_Signal.prototype = { | |
defaultValue: null | |
,listeners: null | |
,listenersSet: null | |
,needCloneListeners: null | |
,add: function(listener) { | |
this.registerListener(listener,true); | |
} | |
,addOnce: function(listener) { | |
this.registerListener(listener,false); | |
} | |
,get_numListeners: function() { | |
return this.listeners.length; | |
} | |
,registerListener: function(listener,permanent) { | |
if(this.listenersSet.get(listener) == null) { | |
if(this.needCloneListeners) { | |
this.listeners = this.listeners.slice(); | |
this.needCloneListeners = false; | |
} | |
this.listeners[this.listeners.length] = listener; | |
this.listenersSet.set(listener,permanent); | |
} | |
} | |
,remove: function(listener) { | |
if(this.listenersSet.get(listener) != null) { | |
if(this.needCloneListeners) { | |
this.listeners = this.listeners.slice(); | |
this.needCloneListeners = false; | |
} | |
this.listeners.splice(this.listeners.indexOf(listener),1); | |
this.listenersSet["delete"](listener); | |
} | |
} | |
,removeAll: function() { | |
if(this.needCloneListeners) { | |
this.listeners = this.listeners.slice(); | |
this.needCloneListeners = false; | |
} | |
while(this.listeners.length != 0) this.listenersSet["delete"](this.listeners.pop()); | |
} | |
,dispatch: function(value) { | |
this.needCloneListeners = true; | |
var v = value == null ? 0 : 1; | |
switch(v) { | |
case 0: | |
var _g = 0; | |
var _g1 = this.listeners; | |
while(_g < _g1.length) { | |
var listener = _g1[_g]; | |
++_g; | |
if(this.listenersSet.get(listener) != null) { | |
if(this.listenersSet.get(listener) == false) { | |
this.remove(listener); | |
} | |
listener(null); | |
} | |
} | |
break; | |
case 1: | |
var _g2 = 0; | |
var _g11 = this.listeners; | |
while(_g2 < _g11.length) { | |
var listener1 = _g11[_g2]; | |
++_g2; | |
if(this.listenersSet.get(listener1) != null) { | |
if(this.listenersSet.get(listener1) == false) { | |
this.remove(listener1); | |
} | |
listener1(value); | |
} | |
} | |
break; | |
} | |
this.needCloneListeners = false; | |
} | |
,__class__: utils_signals_Signal | |
,__properties__: {get_numListeners:"get_numListeners"} | |
}; | |
var EpicGame = function() { | |
openfl_display_Sprite.call(this); | |
if(openfl_system_Capabilities.playerType != "Desktop") { | |
openfl_system_Security.allowDomain("*"); | |
openfl_system_Security.allowInsecureDomain("*"); | |
} | |
if(!EpicGame._initialized) { | |
com_progrestar_framework_time_Time.wait($bind(this,this.init)); | |
} | |
}; | |
$hxClasses["EpicGame"] = EpicGame; | |
EpicGame.__name__ = ["EpicGame"]; | |
EpicGame.loaderView = null; | |
EpicGame.game = null; | |
EpicGame.__super__ = openfl_display_Sprite; | |
EpicGame.prototype = $extend(openfl_display_Sprite.prototype,{ | |
onFrame: function(e) { | |
EpicGame.onUpdate.dispatch(); | |
com_progrestar_game_utils_TimeUtils.update(); | |
} | |
,init: function(v) { | |
EpicGame._initialized = true; | |
var stage = com_progrestar_common_global_Env.stage; | |
com_progrestar_common_global_Env.testMode = true; | |
com_progrestar_common_global_Env.startTime = Math.round(new Date().getTime() / 1000 * 1000); | |
motion_Actuate.defaultEase = motion_easing_Sine.get_easeInOut(); | |
stage.addEventListener("enterFrame",$bind(this,this.onFrame)); | |
EpicGame.game = new GameController(); | |
EpicGame.game.showed.add($bind(this,this.hideLoader)); | |
stage.addChild(EpicGame.game); | |
this.initFlashVars(stage); | |
stage.align = 6; | |
stage.set_scaleMode(2); | |
stage.set_color(0); | |
stage.addEventListener("resize",$bind(this,this.onResize)); | |
this.initCore(); | |
this.initLoader(); | |
com_progrestar_common_global_Env.log.statistic(".flashCapabilities",{ "version" : openfl_system_Capabilities.get_version(), "screenSize" : Std.string(openfl_system_Capabilities.get_screenResolutionX()) + "x" + Std.string(openfl_system_Capabilities.get_screenResolutionY())}); | |
try { | |
com_progrestar_game_utils_Stage3DListener.init(stage); | |
} catch( error ) { | |
haxe_CallStack.lastException = error; | |
if (error instanceof js__$Boot_HaxeError) error = error.val; | |
if( js_Boot.__instanceof(error,openfl_errors_Error) ) { | |
com_progrestar_common_global_Env.log.loadInfo("critical stage3d error","FF4040"); | |
} else throw(error); | |
} | |
new CanvasBlurController(stage); | |
} | |
,initLoader: function() { | |
LoadManager.instance.initPreLoader(); | |
EpicGame.loaderView = new LoaderView(LoadManager.instance); | |
EpicGame.loaderView.readySignal.add($bind(this,this.onLoaderReady)); | |
this.addChild(EpicGame.loaderView); | |
} | |
,initFlashVars: function(flashVarsHolder) { | |
var disp = StaticExt.kast(Std,flashVarsHolder,openfl_display_DisplayObject); | |
if(disp != null) { | |
var li = disp.get_loaderInfo(); | |
if(li != null) { | |
flashVarsHolder = li.parameters; | |
} | |
} | |
com_progrestar_common_global_Env.flashVars = flashVarsHolder; | |
} | |
,initCore: function() { | |
com_progrestar_cas_sui_SuiLoadSupport.init(); | |
com_progrestar_cas_process_ProcessManager.init(EpicGame.game); | |
com_progrestar_common_server_UncaughtErrorManager.register(this); | |
EnvSettings.setup(com_progrestar_common_global_Env.flashVars2); | |
com_progrestar_game_data_loader_Network.init(); | |
UserExtraSettings.loadInfo(); | |
LoadManager.instance.initGame(); | |
if(com_progrestar_common_global_Env.testMode) { | |
new com_progrestar_common_server_ErrorToConsole(com_progrestar_common_global_Env.log); | |
} | |
new com_progrestar_common_server_ErrorLogSender(com_progrestar_common_global_Env.log); | |
new com_progrestar_common_server_StatisticLogSender(com_progrestar_common_global_Env.log); | |
com_progrestar_framework_performance_PerformanceMonitor.get_instance().init(com_progrestar_game_managers_GameActivityManager.get_instance(),EpicGame.onUpdate); | |
} | |
,onLoaderReady: function(v) { | |
EpicGame.loaderView.readySignal.remove($bind(this,this.onLoaderReady)); | |
var langLoader = new com_progrestar_game_language_LangLoader(com_progrestar_common_global_Env.STATIC_URL + "locale/" + com_progrestar_common_global_LangManager.get_locale() + ".json.gz"); | |
LoadManager.instance.get_tasks().addTask(langLoader,4,[LoadManager.instance.get_fileIndexLoader()]); | |
LoadManager.instance.get_tasks().addTask(LoadManager.instance.get_coreAssetsLoader(),5,[langLoader]); | |
LoadManager.instance.get_tasks().addTask(LoadManager.instance.get_firstAssetsLoader(),80,[LoadManager.instance.get_coreAssetsLoader()]); | |
EpicGame.game.register(LoadManager.instance); | |
new ThroneFonts().register(LoadManager.instance); | |
LoadManager.instance.get_tasks().get_completed().add($bind(this,this.onCompleted)); | |
} | |
,onCompleted: function(v) { | |
LoadManager.instance.get_tasks().get_completed().remove($bind(this,this.onCompleted)); | |
LoadManager.instance.get_tasks().addTask(LoadManager.instance.get_extendsAssetsLoader(),50); | |
} | |
,hideLoader: function(v) { | |
if(EpicGame.loaderView != null) { | |
EpicGame.loaderView.destroy(); | |
this.removeChild(EpicGame.loaderView); | |
EpicGame.loaderView = null; | |
} | |
} | |
,onResize: function(event) { | |
} | |
,__class__: EpicGame | |
}); | |
var EpicGameFactory = function() { | |
}; | |
$hxClasses["EpicGameFactory"] = EpicGameFactory; | |
EpicGameFactory.__name__ = ["EpicGameFactory"]; | |
EpicGameFactory._core = null; | |
EpicGameFactory._info = null; | |
EpicGameFactory.setup = function(core,info) { | |
EpicGameFactory._core = core; | |
EpicGameFactory._info = info; | |
com_progrestar_game_managers_Maintenance.instance.init(Reflect.field(info,"getMaintenance")); | |
com_progrestar_game_data_quest_mail_EmailConfirmManager.init(Reflect.field(info,"mailSubscribeState")); | |
GameSceneFactory.setup(); | |
com_progrestar_game_sound_SoundMusicManager.get_instance().init(); | |
com_progrestar_game_managers_ViewManager.init(); | |
com_progrestar_game_managers_UnitStateManager.init(); | |
com_progrestar_game_config_SettingsStorage.init(Reflect.field(info,"getSettings")); | |
com_progrestar_game_lib_DynamicLib.init(Reflect.field(info,"getDynamicParams")); | |
com_progrestar_game_managers_GameQualityManager.init(); | |
com_progrestar_game_ui_message_policy_PolicyWindow.checkAndShowAndCallback(EpicGameFactory.policyCheckCallback); | |
}; | |
EpicGameFactory.policyCheckCallback = function() { | |
EpicGameFactory.continueSetup(EpicGameFactory._core,EpicGameFactory._info); | |
}; | |
EpicGameFactory.continueSetup = function(core,info) { | |
com_progrestar_game_managers_AccessManager.init(); | |
com_progrestar_game_server_Parser.sync(Reflect.field(info,"getSelfInfo")); | |
com_progrestar_game_server_Parser.sync(Reflect.field(info,"heroesGetList")); | |
com_progrestar_common_social_SocialAdapter.get_instance().setRegisteredFriends(Reflect.field(info,"checkRegisteredUsers")); | |
com_progrestar_game_managers_PlayersManager.get_instance().setRegisteredFriends(Reflect.field(info,"checkRegisteredUsers")); | |
com_progrestar_game_ui_UI.initMouseCursors(); | |
com_progrestar_game_data_promo_action_clover_CloverActionManager.get_instance().init(Reflect.field(info,"cloverGetAll")); | |
com_progrestar_game_data_friends_$mission_$progress_FriendMissionProgressManager.get_instance().init(); | |
com_progrestar_game_data_alliance_manager_daily_$reward_AllianceDailyRewardManager.reward.parse(Reflect.field(info,"alliance_level_dailyGiftProgress")); | |
com_progrestar_game_data_spell_SpellManager.syncSpells(Reflect.field(info,"spellList")); | |
com_progrestar_game_data_spell_SpellManager.syncQueues(Reflect.field(info,"spellProductionQueue")); | |
com_progrestar_game_server_Parser.sync(Reflect.field(info,"boost_getTrapCharges")); | |
com_progrestar_game_server_Parser.sync(Reflect.field(info,"boost_getArmoryQueue")); | |
com_progrestar_game_managers_QuestManager.init(); | |
com_progrestar_game_managers_MissionManager.init(); | |
com_progrestar_game_server_Parser.sync(Reflect.field(info,"getQuests")); | |
com_progrestar_game_server_Parser.sync(Reflect.field(info,"getMissions")); | |
com_progrestar_game_managers_ProtectionManager.get_instance().init(Reflect.field(info,"getProtections")); | |
com_progrestar_game_data_notice_core_NoticeManager.init(Reflect.field(info,"giftGetAvailable")); | |
com_progrestar_game_managers_GiftManager.get_instance().init(Reflect.field(info,"giftGetReceivers")); | |
com_progrestar_game_managers_MegaBonusManager.get_instance().initBonusCrystals(Reflect.field(info,"getBonusCrystals")); | |
com_progrestar_game_managers_MegaBonusManager.get_instance().initInvitedUsers(Reflect.field(info,"getInvitedUsers")); | |
com_progrestar_game_managers_MegaBonusManager.get_instance().initInvitedBy(Reflect.field(info,"getInvitedBy")); | |
com_progrestar_game_data_billing_BillingManager.init(Reflect.field(info,"paymentsCount")); | |
com_progrestar_game_data_billing_BillingManager.initLastPayment(Reflect.field(info,"paymentLast")); | |
com_progrestar_game_data_billing_BillingManager.initStarmoneyData(Reflect.field(info,"registration")); | |
com_progrestar_game_data_billing_BillingManager.initBillings(Reflect.field(info,"getBillings")); | |
com_progrestar_game_managers_SocialManager.init(Reflect.field(info,"invitationGetUsers")); | |
com_progrestar_game_top_$event_rpc_TopEventRPC.syncStateUnderResult(Reflect.field(info,"topEventGet")); | |
TutorialLib.initWithSplit(Reflect.field(info,"tutorialGetData")); | |
com_progrestar_game_managers_social_InviteManager.instance.init(Reflect.field(info,"invitationGetUsers")); | |
com_progrestar_game_data_score_ScoreManager.init(); | |
com_progrestar_game_data_score_stars_StarScoreManager.get_instance().init(); | |
com_progrestar_game_data_promo_action_PromoActionsManager.get_instance().get_service().sync(Reflect.field(info,"getUserEvents")); | |
com_progrestar_game_data_promo_event_PromoEventManager.init(); | |
com_progrestar_game_config_ActionCollect.get_instance().init(); | |
EpicGameFactory.registerKeyActions(com_progrestar_game_config_ActionCollect.get_instance()); | |
var homeWorldData = { }; | |
homeWorldData.buildings = Reflect.field(info,"getBuildings"); | |
homeWorldData.cemetery = Reflect.field(info,"cemeteryGet"); | |
homeWorldData.researchQueue = Reflect.field(info,"getResearchQueue"); | |
homeWorldData.armyQueue = Reflect.field(info,"getArmyQueue"); | |
com_progrestar_game_world_location_HomeFactory.startHome(homeWorldData); | |
com_progrestar_game_top_$event_TopEventManager.init(); | |
com_progrestar_game_citadel_CitadelManager.instance.init(Reflect.field(info,"fairCitadelTournamentReward")); | |
com_progrestar_game_citadel_bonus_CitadelPromoManager.INSTANCE.init(); | |
com_progrestar_game_new_$year_$tree_NewYearTreeManager.get_inst().init(); | |
com_progrestar_game_managers_BuilderManager.get_instance().init(); | |
com_progrestar_game_data_tutorial_core_TutorialStartManager.init(Reflect.field(info,"offerGetAll")); | |
com_progrestar_game_data_alliance_alliance_$help_manager_AllianceHelpManager.instance.init(Reflect.field(info,"alliance_help_getJobs")); | |
com_progrestar_game_data_alliance_alliance_$help_manager_AllianceHelpManager.instance.initHelpers(Reflect.field(info,"alliance_help_getMyHelpers")); | |
com_progrestar_game_data_alliance_alliance_$help_manager_AllianceHelpManager.instance.initTimers(Reflect.field(info,"alliance_help_getTimers")); | |
com_progrestar_game_data_alliance_alliance_$help_manager_AllianceHelpManager.instance.initRequests(Reflect.field(info,"alliance_help_getRequests")); | |
com_progrestar_game_data_alliance_$wars_managers_AllianceWarsManager.instance.init(); | |
com_progrestar_game_data_split_SplitManager.instance.init(Reflect.field(info,"splitGetAll")); | |
com_progrestar_game_data_builder_$day_BuildersEventController.init(); | |
com_progrestar_game_data_research_ResearchManager.init(); | |
com_progrestar_game_server_Parser.sync(Reflect.field(info,"boostGetAll")); | |
com_progrestar_game_server_Parser.sync(Reflect.field(info,"artefactGetList")); | |
com_progrestar_game_server_Parser.sync(Reflect.field(info,"battleStatisticGet")); | |
com_progrestar_game_server_Parser.sync(Reflect.field(info,"crystalGetQueue")); | |
com_progrestar_game_data_alliance_manager_AllianceManager.get_instance().loadSelfAllianceDetailInfo(); | |
com_progrestar_game_data_alliance_AllianceLevelManager.instance.init(); | |
com_progrestar_game_advert_model_AdvertManager.init(); | |
com_progrestar_common_loader_OnDemandAssetLoader.startBackgroundLoading(); | |
com_progrestar_game_managers_social_OnlineManager.get_instance().init(); | |
com_progrestar_game_data_notice_core_NoticeManager.syncAllianceFromData(Reflect.field(info,"allianceGetMessages"),true); | |
com_progrestar_game_data_achievement_AchievementManager.get_instance().sync(Reflect.field(info,"achievementGetList").result); | |
com_progrestar_game_server_RpcManager.get_socketClient().initialize(); | |
com_progrestar_game_utils_input_JsMouseWheelHandler.init(); | |
com_progrestar_game_ui_console_epic_$war_$console_EpicWarConsole.initializeConsoleCommands(); | |
com_progrestar_game_battle_RemoteBattleObserver.inBattleStart(Reflect.field(info,"battle_getActiveDefence")); | |
com_progrestar_game_managers_ad_ChestVideoManager.get_instance().init(); | |
com_progrestar_game_ui_message_send_$mana_$window_SendManaManager.init(Reflect.field(info,"registration")); | |
com_progrestar_game_data_upsale_UpsaleManager.get_self().init(Reflect.field(info,"registration")); | |
com_progrestar_game_managers_HintsManager.init(Reflect.field(info,"registration")); | |
com_progrestar_game_data_vip_VipManager.get_instance().init(Reflect.field(info,"vipGetState")); | |
com_progrestar_game_data_vip_VipManager.get_instance().initUtils(Reflect.field(info,"getSubscriptions")); | |
com_progrestar_game_data_vip_FbBoycottManager.get_instance().init(); | |
com_progrestar_game_data_vip_DwarfSkinPromoManager.get_instance().init(); | |
com_progrestar_game_data_bundle_newbie_NewbieBundleManager.get_instance().init(Reflect.field(info,"bundle_getActive")); | |
com_progrestar_game_data_bundle_big_BundleManager.instance.init(Reflect.field(info,"getBigBundle")); | |
com_progrestar_game_data_reinforcement_ReinforcementManager.get_instance().init(Reflect.field(info,"reinforcementGetReceivers")); | |
com_progrestar_game_data_sale_SaleManager.instance.init(Reflect.field(info,"shopItems")); | |
com_progrestar_game_data_elixir_$sale_ElixirSaleManager.instance.init(); | |
com_progrestar_game_data_promo_action_enchanted_$coins_$for_$everyone_EnchantedCoinsForEveryoneManager.instance.init(); | |
com_progrestar_game_data_home_$presets_managers_HomeMapPresetsManager.instance.init(Reflect.field(info,"village_getAllPresets")); | |
com_progrestar_game_data_global_$wars_GlobalWars.init(); | |
com_progrestar_game_data_global_$wars_leagues_AllianceLeagueManager.instance.init(); | |
com_progrestar_game_pvp_$league_PvpLeagueManager.instance.init(); | |
com_progrestar_game_pvp_$league_PvpLeagueManager.instance.onSeasonInfo(Reflect.field(info,"league_seasonInfo")); | |
com_progrestar_game_pvp_$league_SeasonRatingManager.get_instance().onPrevTopUpdate(Reflect.field(info,"league_previousWinners")); | |
com_progrestar_game_data_notice_ui_NoticeUI.init(); | |
com_progrestar_game_data_notice_core_NoticeManager.syncUser(Reflect.field(info,"getNotices"),false,false); | |
EpicGameFactory.registerLoginWindows(); | |
com_progrestar_game_social_facebookAppEvents_FacebookAppEventManager.get_instance().init(); | |
com_progrestar_game_managers_ad_TrialpayManager.instance.init(); | |
com_progrestar_game_data_billing_BillingManager.initVat(Reflect.field(info,"showVat")); | |
com_progrestar_game_data_replenishment_ReplenishmentManager.MANAGER.init(Reflect.field(info,"getRecoverableUnits")); | |
com_progrestar_game_data_hh_$quest_HHQuestManager.MANAGER.init(Reflect.field(info,"heroesQuest_state")); | |
com_progrestar_game_data_roulette_Roulette.init(); | |
com_progrestar_game_hero_HeroShopManager.init(); | |
com_progrestar_game_data_survey_SurveyManager.get_instance().init(); | |
com_progrestar_game_crusades_CrusadesManager.get_instance().init(); | |
com_progrestar_game_data_national_$flags_NationalFlags.init(Reflect.field(info,"flag_get")); | |
com_progrestar_game_statistics_GoogleAnalytics.setDimensions(); | |
EpicGameFactory.onInitComplete(); | |
com_progrestar_game_data_promo_action_crystal_CrystalActionManager.get_instance().init(); | |
com_progrestar_game_data_tutorial_controller_TutorialTownHallStorage.init(); | |
com_progrestar_game_data_tutorial_controller_TutorialTraps.init(); | |
com_progrestar_game_hero_HeroSkinManager.init(Reflect.field(info,"skin_getSkins")); | |
com_progrestar_game_data_chat_ChatManager.get_instance().init(); | |
com_progrestar_game_managers_GiveawayManager.init(); | |
com_progrestar_game_managers_popup_PopupDialogManager.instance.init(); | |
com_progrestar_game_session_UserActivityController.get_instance().register(core); | |
}; | |
EpicGameFactory.registerKeyActions = function(instance) { | |
instance.addAction(new com_progrestar_game_config_KeyAction(com_progrestar_game_ui_SceneType.ANY,[70],com_progrestar_game_config_KeyAction.SPECIAL_KEYS,($_=com_progrestar_common_managers_Settings.fullScreen,$bind($_,$_.switchValue)))); | |
instance.addAction(new com_progrestar_game_config_KeyAction(com_progrestar_game_ui_SceneType.ANY,[77],com_progrestar_game_config_KeyAction.SPECIAL_KEYS,($_=com_progrestar_common_managers_Settings.music,$bind($_,$_.switchValue)))); | |
instance.addAction(new com_progrestar_game_config_KeyAction(com_progrestar_game_ui_SceneType.ANY,[78],com_progrestar_game_config_KeyAction.SPECIAL_KEYS,($_=com_progrestar_common_managers_Settings.sound,$bind($_,$_.switchValue)))); | |
instance.addAction(new com_progrestar_game_config_KeyAction(com_progrestar_game_ui_SceneType.ANY,[90],com_progrestar_game_config_KeyAction.SPECIAL_KEYS,com_progrestar_game_managers_ViewManager.zoomIn)); | |
instance.addAction(new com_progrestar_game_config_KeyAction(com_progrestar_game_ui_SceneType.ANY,[88],com_progrestar_game_config_KeyAction.SPECIAL_KEYS,com_progrestar_game_managers_ViewManager.zoomOut)); | |
instance.addAction(new com_progrestar_game_config_KeyAction(2,[67],com_progrestar_game_config_KeyAction.SPECIAL_KEYS,com_progrestar_game_ui_UI.showAlliancesWindowCB)); | |
instance.addAction(new com_progrestar_game_config_KeyAction(2,[86],com_progrestar_game_config_KeyAction.SPECIAL_KEYS,com_progrestar_game_ui_UI.showSelfAllianceWindow)); | |
instance.addAction(new com_progrestar_game_config_KeyAction(2,[66],com_progrestar_game_config_KeyAction.SPECIAL_KEYS,com_progrestar_game_ui_UI.showStartPVEWindow)); | |
instance.addAction(new com_progrestar_game_config_KeyAction(2,[83],com_progrestar_game_config_KeyAction.SPECIAL_KEYS,com_progrestar_game_ui_message_ShopWindowFactory.create)); | |
instance.addAction(new com_progrestar_game_config_KeyAction(2,[84],com_progrestar_game_config_KeyAction.SPECIAL_KEYS,com_progrestar_game_ui_UI.showTopWindow)); | |
instance.addAction(new com_progrestar_game_config_KeyAction(2,[76],com_progrestar_game_config_KeyAction.SPECIAL_KEYS,com_progrestar_game_ui_UI.showMailWindow)); | |
instance.addAction(new com_progrestar_game_config_KeyAction(2,[27],com_progrestar_game_config_KeyAction.SPECIAL_KEYS,com_progrestar_common_managers_DialogManager.closeActiveDialog)); | |
if(com_progrestar_common_global_Env.testMode) { | |
instance.addAction(new com_progrestar_game_config_KeyAction(2,[81],com_progrestar_game_config_KeyAction.NO_KEYS,com_progrestar_game_ui_UI.showAchievementsWindow)); | |
instance.addAction(new com_progrestar_game_config_KeyAction(2,[17,87],com_progrestar_game_config_KeyAction.NO_KEYS,com_progrestar_game_ui_message_WhoInvitedYouWindow.createCB)); | |
instance.addAction(new com_progrestar_game_config_KeyAction(2,[48],com_progrestar_game_config_KeyAction.NO_KEYS,($_=com_progrestar_game_citadel_CitadelManager.instance,$bind($_,$_.showRatingWindow)))); | |
} | |
}; | |
EpicGameFactory.registerLoginWindows = function() { | |
com_progrestar_game_managers_popup_PopupDialogManager.instance.registerWindow("PolicyWindow",com_progrestar_game_ui_message_policy_PolicyWindow.checkAndShow); | |
com_progrestar_game_managers_popup_PopupDialogManager.instance.registerWindow("MailWindow",com_progrestar_game_managers_RetargetingManager.showMailBox); | |
com_progrestar_game_managers_popup_PopupDialogManager.instance.registerWindow("NewAchievementWindow",($_=com_progrestar_game_data_achievement_AchievementManager.get_instance(),$bind($_,$_.showBirthDayAchievement))); | |
com_progrestar_game_managers_popup_PopupDialogManager.instance.registerWindow("AllianceHelpInfoWindow",com_progrestar_game_data_alliance_ui_AllianceHelpInfoWindow.createFromLauncher); | |
com_progrestar_game_managers_popup_PopupDialogManager.instance.registerWindow("TopEventMerchantWindow",com_progrestar_game_top_$event_billing_UiTopEventMerchantWindow.createFromLauncher); | |
com_progrestar_game_managers_popup_PopupDialogManager.instance.registerWindow("ElixirSaleWindow",com_progrestar_game_data_elixir_$sale_ui_ElixirSaleWindow.createFromLauncher); | |
if(com_progrestar_common_global_Env.NETWORK == "facebook" && com_progrestar_game_ui_message_send_$mana_$window_SendManaManager.get_showNew()) { | |
com_progrestar_game_managers_popup_PopupDialogManager.instance.registerWindow("SendGiftWindow",com_progrestar_game_ui_message_send_$mana_$window_SendManaWindow.createFromLauncher); | |
} else { | |
com_progrestar_game_managers_popup_PopupDialogManager.instance.registerWindow("SendGiftWindow",com_progrestar_game_ui_message_send_$gift_$window_SendGiftWindow.createFromLauncher); | |
} | |
com_progrestar_game_managers_popup_PopupDialogManager.instance.registerWindow("GlobalWarsNotifyWindow",com_progrestar_game_data_global_$wars_ui_GlobalWarsNotifyWindow.createFromLauncher); | |
if(com_progrestar_common_global_Env.NETWORK != "facebook") { | |
com_progrestar_game_managers_popup_PopupDialogManager.instance.registerWindow("VipExpirationWindow",com_progrestar_game_data_vip_ui_VipExpirationWindow.tryShow); | |
} | |
com_progrestar_game_managers_popup_PopupDialogManager.instance.registerWindow("HintsWindow",com_progrestar_game_ui_message_hints_$window_HintsWindow.createFromLauncher); | |
com_progrestar_game_managers_popup_PopupDialogManager.instance.registerWindow("TopEventPromoWindow",com_progrestar_game_top_$event_ui_UiTopEventPromoWindow.create); | |
com_progrestar_game_managers_popup_PopupDialogManager.instance.registerWindow("GlobalNewsManager",com_progrestar_game_managers_GlobalNewsManager.showNotReadLastNews); | |
com_progrestar_game_managers_popup_PopupDialogManager.instance.registerWindow("CloverFoundWindow",com_progrestar_game_data_promo_action_clover_CloverActionManager.createFromLauncher); | |
com_progrestar_game_managers_popup_PopupDialogManager.instance.registerWindow("CitadelPromoWindow",com_progrestar_game_citadel_bonus_CitadelPromoWindow.create); | |
com_progrestar_game_managers_popup_PopupDialogManager.instance.registerWindow("RouletteWindow",($_=com_progrestar_game_data_roulette_Roulette.ui,$bind($_,$_.showPromo))); | |
com_progrestar_game_managers_popup_PopupDialogManager.instance.registerWindow("BundleWindow",com_progrestar_game_data_bundle_big_ui_BundleWindow.createFromLauncher); | |
com_progrestar_game_managers_popup_PopupDialogManager.instance.registerWindow("NewbieBundleWindow",com_progrestar_game_data_bundle_newbie_ui_NewbieBundleWindow.createFromLauncher); | |
com_progrestar_game_managers_popup_PopupDialogManager.instance.registerWindow("NewbiePromoBillingWindow",com_progrestar_game_ui_UI.showPromoBillingAtStart); | |
com_progrestar_game_managers_popup_PopupDialogManager.instance.registerWindow("EnchantedCoinsWindow",com_progrestar_game_data_promo_action_enchanted_$coins_EnchantedCoinsWindow.createFromLauncher); | |
com_progrestar_game_managers_popup_PopupDialogManager.instance.registerWindow("EnchantedCoinsForEveryoneWindow",com_progrestar_game_data_promo_action_enchanted_$coins_$for_$everyone_EnchantedCoinsForEveryoneWindow.createFromLauncher); | |
com_progrestar_game_managers_popup_PopupDialogManager.instance.registerWindow("WhoInvitedYouWindow",com_progrestar_game_ui_UI.showWhoInvitedYouWindow); | |
com_progrestar_game_managers_popup_PopupDialogManager.instance.registerWindow("SaleMerchantWindow",com_progrestar_game_data_sale_ui_SaleMerchantWindow.createFromLauncher); | |
}; | |
EpicGameFactory.onInitComplete = function(v) { | |
com_progrestar_game_managers_BuildingEventManager.loading = false; | |
var loadTime = Math.round(new Date().getTime() / 1000 * 1000) - com_progrestar_common_global_Env.startTime; | |
var params = { }; | |
params.loadTime = loadTime; | |
com_progrestar_common_global_Env.log.rawStatistic(".user.completeLoading",params); | |
EpicGameFactory.sendCompleteLoading(); | |
}; | |
EpicGameFactory.sendCompleteLoading = function() { | |
var socialUser = com_progrestar_common_social_SocialAdapter.get_instance().getSelfUser(); | |
var userObj = { "id" : socialUser.get_id(), "country" : socialUser.get_country() != null ? socialUser.get_country().get_code() : ""}; | |
if(com_progrestar_common_global_Env.NETWORK == "facebook") { | |
var refs = com_progrestar_common_social_SocialAdapter.get_instance().get_initObject().request_referrers; | |
if(refs != null) { | |
userObj.fbReferrers = refs; | |
} | |
} | |
var referrer = com_progrestar_common_social_SocialAdapter.get_instance().get_initObject().referrer; | |
if(referrer != null) { | |
userObj["referrer"] = referrer; | |
} | |
com_progrestar_game_server_RpcManager.sendCustomRequest("completeLoading",{ "user" : userObj}); | |
}; | |
EpicGameFactory.prototype = { | |
__class__: EpicGameFactory | |
}; | |
var EpicWarEnv = function() { | |
}; | |
$hxClasses["EpicWarEnv"] = EpicWarEnv; | |
EpicWarEnv.__name__ = ["EpicWarEnv"]; | |
EpicWarEnv.gameType = null; | |
EpicWarEnv.hidePreloaderFunc = null; | |
EpicWarEnv.idleTheme = null; | |
EpicWarEnv.battleTheme = null; | |
EpicWarEnv.battleThemeShort = null; | |
EpicWarEnv.globalWarsTheme = null; | |
EpicWarEnv.seaTheme = null; | |
EpicWarEnv.prototype = { | |
__class__: EpicWarEnv | |
}; | |
var Exception = function(message,pos) { | |
this.message = message; | |
var tmp; | |
if(pos == null) { | |
throw new js__$Boot_HaxeError("position cannot be null"); | |
} else { | |
tmp = pos; | |
} | |
this.pos = tmp; | |
this.stack = []; | |
}; | |
$hxClasses["Exception"] = Exception; | |
Exception.__name__ = ["Exception"]; | |
Exception.wrap = function(e,pos) { | |
if(js_Boot.__instanceof(e,Exception)) { | |
return e; | |
} | |
var exceptionStack = haxe_CallStack.exceptionStack(); | |
var exception = new Exception(Std.string(e),pos); | |
if(exceptionStack.length > 0) { | |
exception.stack = exceptionStack; | |
} | |
return exception; | |
}; | |
Exception.processCallStackOnCreation = function(stack) { | |
return stack; | |
}; | |
Exception.prototype = { | |
message: null | |
,pos: null | |
,stack: null | |
,truncateStack: function(pos,count) { | |
if(count == null) { | |
count = 0; | |
} | |
return; | |
} | |
,stringStack: function() { | |
return haxe_CallStack.toString(this.stack); | |
} | |
,toString: function() { | |
var className = Type.getClassName(js_Boot.getClass(this)); | |
var position = this.pos == null ? "unknown position" : this.pos.fileName + ":" + this.pos.lineNumber; | |
var msg = "" + className + ": " + this.message + "\n\tCreated at " + position; | |
msg += StringTools.replace(haxe_CallStack.toString(this.stack),"\n","\n\t"); | |
return msg; | |
} | |
,buildStack: function(stack) { | |
var stack1 = exception_StackTools.truncate(stack,this.pos); | |
return Exception.processCallStackOnCreation(stack1); | |
} | |
,__class__: Exception | |
}; | |
var _$FastXML_NodeAccess = function(x) { | |
this.__x = x; | |
}; | |
$hxClasses["_FastXML.NodeAccess"] = _$FastXML_NodeAccess; | |
_$FastXML_NodeAccess.__name__ = ["_FastXML","NodeAccess"]; | |
_$FastXML_NodeAccess.prototype = { | |
__x: null | |
,resolve: function(name) { | |
var x = this.__x.elementsNamed(name).next(); | |
if(x == null) { | |
var xname; | |
if(this.__x.nodeType == Xml.Document) { | |
xname = "Document"; | |
} else { | |
var _this = this.__x; | |
if(_this.nodeType != Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + _this.nodeType); | |
} | |
xname = _this.nodeName; | |
} | |
throw new js__$Boot_HaxeError(xname + " is missing element " + name); | |
} | |
return new FastXML(x); | |
} | |
,__class__: _$FastXML_NodeAccess | |
}; | |
var _$FastXML_AttribAccess = function(x) { | |
this.__x = x; | |
}; | |
$hxClasses["_FastXML.AttribAccess"] = _$FastXML_AttribAccess; | |
_$FastXML_AttribAccess.__name__ = ["_FastXML","AttribAccess"]; | |
_$FastXML_AttribAccess.prototype = { | |
__x: null | |
,resolve: function(name) { | |
if(this.__x.nodeType == Xml.Document) { | |
throw new js__$Boot_HaxeError("Cannot access document attribute " + name); | |
} | |
var v = this.__x.get(name); | |
if(v == null) { | |
var _this = this.__x; | |
if(_this.nodeType != Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + _this.nodeType); | |
} | |
throw new js__$Boot_HaxeError(_this.nodeName + " is missing attribute " + name); | |
} | |
return v; | |
} | |
,__class__: _$FastXML_AttribAccess | |
}; | |
var _$FastXML_HasAttribAccess = function(x) { | |
this.__x = x; | |
}; | |
$hxClasses["_FastXML.HasAttribAccess"] = _$FastXML_HasAttribAccess; | |
_$FastXML_HasAttribAccess.__name__ = ["_FastXML","HasAttribAccess"]; | |
_$FastXML_HasAttribAccess.prototype = { | |
__x: null | |
,resolve: function(name) { | |
if(this.__x.nodeType == Xml.Document) { | |
throw new js__$Boot_HaxeError("Cannot access document attribute " + name); | |
} | |
return this.__x.exists(name); | |
} | |
,__class__: _$FastXML_HasAttribAccess | |
}; | |
var _$FastXML_HasNodeAccess = function(x) { | |
this.__x = x; | |
}; | |
$hxClasses["_FastXML.HasNodeAccess"] = _$FastXML_HasNodeAccess; | |
_$FastXML_HasNodeAccess.__name__ = ["_FastXML","HasNodeAccess"]; | |
_$FastXML_HasNodeAccess.prototype = { | |
__x: null | |
,resolve: function(name) { | |
return this.__x.elementsNamed(name).hasNext(); | |
} | |
,__class__: _$FastXML_HasNodeAccess | |
}; | |
var _$FastXML_NodeListAccess = function(x) { | |
this.__x = x; | |
}; | |
$hxClasses["_FastXML.NodeListAccess"] = _$FastXML_NodeListAccess; | |
_$FastXML_NodeListAccess.__name__ = ["_FastXML","NodeListAccess"]; | |
_$FastXML_NodeListAccess.prototype = { | |
__x: null | |
,resolve: function(name) { | |
var l = []; | |
var x = this.__x.elementsNamed(name); | |
while(x.hasNext()) { | |
var x1 = x.next(); | |
l.push(new FastXML(x1)); | |
} | |
return new FastXMLList(l); | |
} | |
,__class__: _$FastXML_NodeListAccess | |
}; | |
var FastXML = function(x) { | |
if(x.nodeType != Xml.Document && x.nodeType != Xml.Element) { | |
throw new js__$Boot_HaxeError("Invalid nodeType " + x.nodeType); | |
} | |
this.x = x; | |
this.node = new _$FastXML_NodeAccess(x); | |
this.nodes = new _$FastXML_NodeListAccess(x); | |
this.att = new _$FastXML_AttribAccess(x); | |
this.has = new _$FastXML_HasAttribAccess(x); | |
this.hasNode = new _$FastXML_HasNodeAccess(x); | |
}; | |
$hxClasses["FastXML"] = FastXML; | |
FastXML.__name__ = ["FastXML"]; | |
FastXML.parse = function(s) { | |
var x = Xml.parse(s); | |
if(x.nodeType != Xml.Document && x.nodeType != Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, expected Element or Document but found " + x.nodeType); | |
} | |
return new FastXML(x.children[0]); | |
}; | |
FastXML.filterNodes = function(a,f) { | |
var rv = []; | |
var i = a.iterator(); | |
while(i.hasNext()) { | |
var i1 = i.next(); | |
if(f(i1)) { | |
rv.push(i1); | |
} | |
} | |
return new FastXMLList(rv); | |
}; | |
FastXML.prototype = { | |
x: null | |
,name: null | |
,innerData: null | |
,innerHTML: null | |
,node: null | |
,nodes: null | |
,att: null | |
,has: null | |
,hasNode: null | |
,elements: null | |
,appendChild: function(a) { | |
if(js_Boot.__instanceof(a,Xml)) { | |
this.x.addChild(a); | |
} else { | |
this.x.addChild(Xml.parse(a)); | |
} | |
} | |
,descendants: function(name) { | |
if(name == null) { | |
name = "*"; | |
} | |
var a = []; | |
var e = this.x.elements(); | |
while(e.hasNext()) { | |
var e1 = e.next(); | |
var tmp; | |
if(e1.nodeType != Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + e1.nodeType); | |
} | |
if(e1.nodeName != name) { | |
tmp = name == "*"; | |
} else { | |
tmp = true; | |
} | |
if(tmp) { | |
a.push(new FastXML(e1)); | |
} else { | |
var fx = new FastXML(e1); | |
a = a.concat(fx.descendants(name).getArray()); | |
} | |
} | |
return new FastXMLList(a); | |
} | |
,getAttribute: function(name) { | |
if(this.x.nodeType == Xml.Document) { | |
throw new js__$Boot_HaxeError("Cannot access document attribute " + name); | |
} | |
var v = this.x.get(name); | |
return v; | |
} | |
,get_name: function() { | |
if(this.x.nodeType == Xml.Document) { | |
return "Document"; | |
} else { | |
var _this = this.x; | |
if(_this.nodeType != Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + _this.nodeType); | |
} | |
return _this.nodeName; | |
} | |
} | |
,get_innerData: function() { | |
var _this = this.x; | |
if(_this.nodeType != Xml.Document && _this.nodeType != Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, expected Element or Document but found " + _this.nodeType); | |
} | |
var it = HxOverrides.iter(_this.children); | |
if(!it.hasNext()) { | |
throw new js__$Boot_HaxeError(this.get_name() + " does not have data"); | |
} | |
var v = it.next(); | |
var n = it.next(); | |
if(n != null) { | |
var tmp; | |
if(v.nodeType == Xml.PCData && n.nodeType == Xml.CData) { | |
if(v.nodeType == Xml.Document || v.nodeType == Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, unexpected " + v.nodeType); | |
} | |
tmp = StringTools.trim(v.nodeValue) == ""; | |
} else { | |
tmp = false; | |
} | |
if(tmp) { | |
var n2 = it.next(); | |
var tmp1; | |
if(n2 != null) { | |
var tmp2; | |
if(n2.nodeType == Xml.PCData) { | |
if(n2.nodeType == Xml.Document || n2.nodeType == Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, unexpected " + n2.nodeType); | |
} | |
tmp2 = StringTools.trim(n2.nodeValue) == ""; | |
} else { | |
tmp2 = false; | |
} | |
if(tmp2) { | |
tmp1 = it.next() == null; | |
} else { | |
tmp1 = false; | |
} | |
} else { | |
tmp1 = true; | |
} | |
if(tmp1) { | |
if(n.nodeType == Xml.Document || n.nodeType == Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, unexpected " + n.nodeType); | |
} | |
return n.nodeValue; | |
} | |
} | |
throw new js__$Boot_HaxeError(this.get_name() + " does not only have data"); | |
} | |
if(v.nodeType != Xml.PCData && v.nodeType != Xml.CData) { | |
throw new js__$Boot_HaxeError(this.get_name() + " does not have data"); | |
} | |
if(v.nodeType == Xml.Document || v.nodeType == Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, unexpected " + v.nodeType); | |
} | |
return v.nodeValue; | |
} | |
,get_innerHTML: function() { | |
var s_b = ""; | |
var _this = this.x; | |
if(_this.nodeType != Xml.Document && _this.nodeType != Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, expected Element or Document but found " + _this.nodeType); | |
} | |
var x = HxOverrides.iter(_this.children); | |
while(x.hasNext()) { | |
var x1 = x.next(); | |
s_b += Std.string(haxe_xml_Printer.print(x1)); | |
} | |
return s_b; | |
} | |
,get_elements: function() { | |
var it = this.x.elements(); | |
return { hasNext : $bind(it,it.hasNext), next : function() { | |
var x = it.next(); | |
if(x == null) { | |
return null; | |
} | |
return new FastXML(x); | |
}}; | |
} | |
,length: function() { | |
return 1; | |
} | |
,setAttribute: function(name,value) { | |
if(this.x.nodeType == Xml.Document) { | |
throw new js__$Boot_HaxeError("Cannot access document attribute " + name); | |
} | |
this.x.set(name,value); | |
} | |
,toString: function() { | |
return haxe_xml_Printer.print(this.x); | |
} | |
,__class__: FastXML | |
,__properties__: {get_elements:"get_elements",get_innerHTML:"get_innerHTML",get_innerData:"get_innerData",get_name:"get_name"} | |
}; | |
var FastXMLList = function(a) { | |
this.l = a != null ? a : []; | |
}; | |
$hxClasses["FastXMLList"] = FastXMLList; | |
FastXMLList.__name__ = ["FastXMLList"]; | |
FastXMLList.prototype = { | |
l: null | |
,copy: function() { | |
return new FastXMLList(this.l.slice(0)); | |
} | |
,descendants: function(name) { | |
if(name == null) { | |
name = "*"; | |
} | |
var a = []; | |
var _g = 0; | |
var _g1 = this.l; | |
while(_g < _g1.length) { | |
var fx = _g1[_g]; | |
++_g; | |
var e = fx.x.elements(); | |
while(e.hasNext()) { | |
var e1 = e.next(); | |
var tmp; | |
if(e1.nodeType != Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + e1.nodeType); | |
} | |
if(e1.nodeName != name) { | |
tmp = name == "*"; | |
} else { | |
tmp = true; | |
} | |
if(tmp) { | |
a.push(new FastXML(e1)); | |
} else { | |
var fx2 = new FastXML(e1); | |
a = a.concat(fx2.descendants(name).getArray()); | |
} | |
} | |
} | |
return new FastXMLList(a); | |
} | |
,get: function(i) { | |
return this.l[i]; | |
} | |
,getArray: function() { | |
return this.l; | |
} | |
,iterator: function() { | |
return HxOverrides.iter(this.l); | |
} | |
,length: function() { | |
return this.l.length; | |
} | |
,toString: function() { | |
var s = ""; | |
var first = true; | |
var _g = 0; | |
var _g1 = this.l; | |
while(_g < _g1.length) { | |
var i = _g1[_g]; | |
++_g; | |
if(!first) { | |
s += "\r\n"; | |
} | |
first = false; | |
s += i.toString(); | |
} | |
return s; | |
} | |
,__class__: FastXMLList | |
}; | |
var com_genome2d_proto_GPrototypeHelper = function() { }; | |
$hxClasses["com.genome2d.proto.GPrototypeHelper"] = com_genome2d_proto_GPrototypeHelper; | |
com_genome2d_proto_GPrototypeHelper.__name__ = ["com","genome2d","proto","GPrototypeHelper"]; | |
com_genome2d_proto_GPrototypeHelper.g2d_GComponent = null; | |
com_genome2d_proto_GPrototypeHelper.g2d_GGrid = null; | |
com_genome2d_proto_GPrototypeHelper.g2d_GTexturedQuad = null; | |
com_genome2d_proto_GPrototypeHelper.g2d_GSprite2 = null; | |
com_genome2d_proto_GPrototypeHelper.g2d_GTiledSprite = null; | |
com_genome2d_proto_GPrototypeHelper.g2d_GSlice3Sprite = null; | |
com_genome2d_proto_GPrototypeHelper.g2d_GShape = null; | |
com_genome2d_proto_GPrototypeHelper.g2d_GParticleSystem = null; | |
com_genome2d_proto_GPrototypeHelper.g2d_GCameraController = null; | |
com_genome2d_proto_GPrototypeHelper.g2d_GWater = null; | |
com_genome2d_proto_GPrototypeHelper.g2d_GTexture = null; | |
com_genome2d_proto_GPrototypeHelper.g2d_GNode = null; | |
com_genome2d_proto_GPrototypeHelper.g2d_GUISkin = null; | |
com_genome2d_proto_GPrototypeHelper.g2d_GUIElement = null; | |
com_genome2d_proto_GPrototypeHelper.g2d_GUILayout = null; | |
com_genome2d_proto_GPrototypeHelper.g2d_GUIHorizontalLayout = null; | |
com_genome2d_proto_GPrototypeHelper.g2d_GSprite = null; | |
com_genome2d_proto_GPrototypeHelper.g2d_GAsset = null; | |
com_genome2d_proto_GPrototypeHelper.g2d_GImageAsset = null; | |
com_genome2d_proto_GPrototypeHelper.g2d_GXmlAsset = null; | |
com_genome2d_proto_GPrototypeHelper.g2d_GUIVerticalLayout = null; | |
com_genome2d_proto_GPrototypeHelper.g2d_GFlashObject = null; | |
var GameProject = function() { | |
this.age = 0; | |
this.showed = new utils_signals_Signal(); | |
this._isShowed = false; | |
this.userInfoLoaded = false; | |
this.environmentCreated = false; | |
this.currentTickTime = 0; | |
this.lastTickTime = 0; | |
openfl_display_Sprite.call(this); | |
com_progrestar_common_factory_McFactory.newBlittedPreloader = com_progrestar_common_new_$factory_OldAssetManager.newBlittedPreloader = $bind(this,this.getDefaultPreloader); | |
GameProject._instance = this; | |
this.set_tabEnabled(false); | |
this.set_tabChildren(false); | |
com_progrestar_common_global_Env.main = this; | |
com_progrestar_common_global_Env.zoom = com_progrestar_game_config_ZoomData.zoomValues[com_progrestar_game_config_ZoomData.zoomValues.length - 1]; | |
com_progrestar_cas_process_ProcessManager.init(this); | |
com_progrestar_framework_class_$system_ClassFactory.DEFAULT_PATH = com_progrestar_common_global_Env.ASSETS_URL; | |
com_progrestar_framework_class_$system_DisplayObjectLoader.processors.push(com_progrestar_common_managers_TextManager.applyFontToChildren); | |
com_progrestar_game_ui_UI.init(); | |
com_progrestar_game_ping_PingManager.init(); | |
com_progrestar_common_managers_DialogManager.SKIP_DUPLICATE_CONTROL = false; | |
this.addEventListener("enterFrame",$bind(this,this.onTick)); | |
}; | |
$hxClasses["GameProject"] = GameProject; | |
GameProject.__name__ = ["GameProject"]; | |
GameProject.__properties__ = {get_instance:"get_instance"}; | |
GameProject._instance = null; | |
GameProject.get_instance = function() { | |
if(GameProject._instance == null) { | |
GameProject._instance = new GameProject(); | |
} | |
return GameProject._instance; | |
}; | |
GameProject.__super__ = openfl_display_Sprite; | |
GameProject.prototype = $extend(openfl_display_Sprite.prototype,{ | |
lastTickTime: null | |
,currentTickTime: null | |
,environmentCreated: null | |
,userInfoLoaded: null | |
,_isShowed: null | |
,get_isShowed: function() { | |
return this._isShowed; | |
} | |
,showed: null | |
,switchLog: function() { | |
com_progrestar_common_global_Env.log.get_tables().set_visible(com_progrestar_game_config_DynamicConfig.instance.get_showLog()); | |
} | |
,show: function() { | |
this._isShowed = true; | |
this.showed.dispatch(); | |
} | |
,getDefaultPreloader: function() { | |
var defPreloaderMc = new openfl_display_MovieClip(); | |
defPreloaderMc.set_name("preloader"); | |
return defPreloaderMc; | |
} | |
,age: null | |
,onTick: function(event) { | |
this.age++; | |
this.currentTickTime = Math.round(new Date().getTime() / 1000 * 1000); | |
com_progrestar_common_global_Env.tick = com_progrestar_framework_core_utils_MathUtils.clampf(this.currentTickTime - this.lastTickTime,1,500) | 0; | |
com_progrestar_common_global_Env.counter++; | |
com_progrestar_common_global_Env.time = Math.round(new Date().getTime() / 1000 * 1000); | |
com_progrestar_game_utils_GameObjectManager.tick(com_progrestar_common_global_Env.tick); | |
com_progrestar_common_controllers_Controller.TICK_COUNTER = 0; | |
com_progrestar_common_GameObject.TICK_COUNTER = 0; | |
if(GameProject.tickLayers != null) { | |
var _g = 0; | |
var _g1 = GameProject.tickLayers; | |
while(_g < _g1.length) { | |
var info = _g1[_g]; | |
++_g; | |
var startTick = Math.round(new Date().getTime() / 1000 * 1000); | |
if(info.get_layer().get_visible() != null) { | |
info.get_layer().tick(com_progrestar_common_global_Env.tick); | |
} | |
var finishTick = Math.round(new Date().getTime() / 1000 * 1000); | |
info.counter++; | |
info.time += finishTick - startTick; | |
} | |
} | |
GameProject.TICK_SUMMARY_COUNT = com_progrestar_common_GameObject.TICK_COUNTER; | |
GameProject.FRAME_TIME += com_progrestar_common_global_Env.tick; | |
this.lastTickTime = this.currentTickTime; | |
var totalTickTime = Math.round(new Date().getTime() / 1000 * 1000); | |
GameProject.TICK_TIME += totalTickTime - this.lastTickTime; | |
GameProject.EFF = GameProject.TICK_TIME / GameProject.FRAME_TIME; | |
GameProject.TICK_COUNTER++; | |
} | |
,createEnvironment: function() { | |
this.resize(); | |
com_progrestar_common_global_Env.TILE_SIZE = 32; | |
com_progrestar_common_global_Env.tooltipSlug = "Tooltip"; | |
com_progrestar_game_config_Config.INSTANT_BUILD_ENABLED = false; | |
com_progrestar_common_managers_LayerManager.init(this); | |
com_progrestar_ui_components_toolTip_UiTooltip.setContainer(com_progrestar_common_managers_LayerManager.TOOLTIP_LAYER); | |
com_progrestar_common_managers_LayerManager.TUTORIAL_LAYER.mouseEnabled = com_progrestar_common_managers_LayerManager.TUTORIAL_LAYER.mouseChildren = false; | |
com_progrestar_common_managers_DialogManager.defaultBGClipName = "HideLayer"; | |
com_progrestar_common_managers_DialogManager.init(); | |
this.stage.set_scaleMode(2); | |
this.stage.addEventListener("resize",$bind(this,this.onResize)); | |
this.stage.addEventListener("fullScreen",$bind(this,this.onDisplayMode)); | |
com_progrestar_common_social_SocialAdapter.get_instance().addEventListener("openSocialBox",$bind(this,this.onOpenSocialBox)); | |
if(com_progrestar_common_global_Env.log.get_tables() != null) { | |
this.addChildAt(com_progrestar_common_global_Env.log.get_tables(),this.get_numChildren()); | |
} | |
com_progrestar_framework_core_Ticker.initialize(this.stage); | |
com_progrestar_framework_core_Ticker.get_oneFrame().add($bind(this,this.onOneFrame)); | |
com_progrestar_game_world_GameProcessPriority.init(); | |
GameProject.tickLayers = [new LayerInfo(com_progrestar_common_managers_LayerManager.INTERFACE_LAYER),new LayerInfo(com_progrestar_common_managers_LayerManager.TOP_INTERFACE_LAYER),new LayerInfo(com_progrestar_common_managers_LayerManager.DIALOG_LAYER),new LayerInfo(com_progrestar_common_managers_LayerManager.TOOLTIP_LAYER),new LayerInfo(com_progrestar_common_managers_LayerManager.TUTORIAL_LAYER)]; | |
this.initializeLogger(); | |
this.initializeConsole(); | |
this.environmentCreated = true; | |
return true; | |
} | |
,onOneFrame: function(v) { | |
} | |
,initializeLogger: function() { | |
com_progrestar_common_global_Env.log.get_tables().set_visible(com_progrestar_game_config_DynamicConfig.instance.get_showLog() && com_progrestar_common_global_Env.testMode); | |
com_progrestar_common_managers_LayerManager.CONSOLE_LAYER.addChild(com_progrestar_common_global_Env.log.get_tables()); | |
com_progrestar_common_global_Env.log.get_tables().start(); | |
} | |
,initializeConsole: function() { | |
com_progrestar_framework_console_Console.initialize(this.stage); | |
} | |
,onUserInfoError: function(rpcEntry) { | |
var text = null; | |
if(rpcEntry != null) { | |
var errorObj = rpcEntry.response.get_error(); | |
if(errorObj != null) { | |
text = Std.string(errorObj.name) + "\n" + Std.string(errorObj.description); | |
} | |
} | |
if(EpicWarEnv.hidePreloaderFunc != null) { | |
EpicWarEnv.hidePreloaderFunc(null); | |
} | |
com_progrestar_game_ui_UI.showServerError(text); | |
} | |
,onOpenSocialBox: function(e) { | |
com_progrestar_common_managers_Settings.fullScreen.set_value(false); | |
} | |
,onResize: function(e) { | |
this.resize(); | |
} | |
,onDisplayMode: function(e) { | |
} | |
,resize: function(value) { | |
if(com_progrestar_common_global_Env.stage != null) { | |
com_progrestar_common_global_Env.stage.set_scaleMode(2); | |
com_progrestar_common_managers_Settings.appSize.set_value(new openfl_geom_Point(com_progrestar_common_global_Env.stage.stageWidth * com_progrestar_common_global_Env.get_stageZoom(),com_progrestar_common_global_Env.stage.stageHeight * com_progrestar_common_global_Env.get_stageZoom())); | |
} | |
} | |
,__class__: GameProject | |
,__properties__: $extend(openfl_display_Sprite.prototype.__properties__,{get_isShowed:"get_isShowed"}) | |
}); | |
var IGameModule = function() { }; | |
$hxClasses["IGameModule"] = IGameModule; | |
IGameModule.__name__ = ["IGameModule"]; | |
IGameModule.prototype = { | |
get_visual: null | |
,register: null | |
,__class__: IGameModule | |
,__properties__: {get_visual:"get_visual"} | |
}; | |
var GameController = function() { | |
this.isServerTimeLoaded = false; | |
GameProject.call(this); | |
GameSceneFactory.create(); | |
com_progrestar_ui_core_UiNode.init(new com_progrestar_ui_utils_SuiFactoryAdapter(),this,30); | |
com_progrestar_ui_core_UiNode.addAddition(com_progrestar_ui_core_UiStates,com_progrestar_game_ui_ui_additions_UiStateTextChecker); | |
com_progrestar_ui_core_UiNode.addAddition(com_progrestar_ui_components_button_UiButton,com_progrestar_game_ui_ui_additions_UiBtnClickSound); | |
com_progrestar_ui_components_UiSettings.btnSkinCollectionKey = "ui/skin/ui_button_skin"; | |
com_progrestar_ui_components_UiSettings.tooltipSkinCollectionKey = "ui/ui"; | |
com_progrestar_cas_global_$event_GlobalEventManager.addObserver("HomeMapLoaded",$bind(this,this.onHomeMapLoaded)); | |
}; | |
$hxClasses["GameController"] = GameController; | |
GameController.__name__ = ["GameController"]; | |
GameController.__interfaces__ = [IGameModule]; | |
GameController.actionManager = null; | |
GameController.__super__ = GameProject; | |
GameController.prototype = $extend(GameProject.prototype,{ | |
loader: null | |
,onHomeMapLoaded: function(v) { | |
com_progrestar_cas_global_$event_GlobalEventManager.removeObserver("HomeMapLoaded",$bind(this,this.onHomeMapLoaded)); | |
this.show(); | |
} | |
,get_visual: function() { | |
return this; | |
} | |
,assetLoadedErrorHandler: function(e) { | |
} | |
,refreshPage: function(v) { | |
if(openfl_external_ExternalInterface.available) { | |
openfl_external_ExternalInterface.call("document.location.reload()"); | |
} | |
} | |
,register: function(manager) { | |
com_progrestar_common_server_UncaughtErrorManager.register(this); | |
this.loader = StaticExt.kast(Std,manager.get_gameLoader(),com_progrestar_game_data_loader_CustomLoader); | |
this.loader.onStart = $bind(this,this.onStart); | |
com_progrestar_common_factory_McFactory.defaultErrorHandler = $bind(this,this.assetLoadedErrorHandler); | |
com_progrestar_framework_sound_$system_SoundManager.SOUND_BUTTON_CLICK_ASSET = new com_progrestar_framework_sound_$system_SoundAsset("sounds/gui.swf","ClickMetall"); | |
GameController.actionManager = new com_progrestar_game_server_RpcManager(com_progrestar_common_global_Env.SERVER_URL,com_progrestar_game_server_Parser.sync,$bind(this,this.onRpcAlert),$bind(this,this.onRpcError)); | |
com_progrestar_game_data_loader_Network.createSocialAdapter(); | |
new com_progrestar_game_data_loader_SocialLoader(manager); | |
var langLoader = new com_progrestar_game_language_LangLoader(com_progrestar_common_global_Env.STATIC_URL + "locale/" + com_progrestar_common_global_LangManager.get_locale() + ".json.gz"); | |
var libHashLoader = new com_progrestar_game_data_loader_LibHashLoader(); | |
var libLoader = new com_progrestar_game_data_loader_LibLoader(com_progrestar_common_global_Env.STATIC_URL + "lib/lib" + ".json.gz"); | |
var tasks = manager.get_tasks(); | |
tasks.addTask(manager.get_socialLoader(),4); | |
tasks.addTask(langLoader,4,[manager.get_fileIndexLoader()]); | |
tasks.addTask(libHashLoader,0,[manager.get_fileIndexLoader()]); | |
tasks.addTask(libLoader,4,[manager.get_fileIndexLoader(),langLoader,manager.get_socialLoader(),libHashLoader]); | |
tasks.addTask(GameController.actionManager,4,[manager.get_socialLoader(),manager.get_coreAssetsLoader(),manager.get_firstAssetsLoader(),langLoader,libLoader]); | |
tasks.addTask(this.loader,1,[langLoader,libLoader,GameController.actionManager,manager.get_coreAssetsLoader(),manager.get_firstAssetsLoader()]); | |
this.syncTime(); | |
} | |
,onRpcAlert: function(v0,v1) { | |
} | |
,onRpcError: function(key,description,request,responce) { | |
if(!this.environmentCreated) { | |
this.createEnvironment(); | |
} | |
if(key == "USER_LOCKED" || key == "USER_PROTECTED") { | |
com_progrestar_game_ui_UI.notify("T_ERROR_WINDOW",description,false,true); | |
} else if(key == "INVALID_SESSION") { | |
com_progrestar_game_ui_UI.showCriticalErrorWindow("T_ERROR_INVALIDSESSION",$bind(this,this.refreshPage),request,responce); | |
} else { | |
com_progrestar_game_ui_UI.showCriticalErrorWindow(key,$bind(this,this.refreshPage),request,responce); | |
} | |
} | |
,isServerTimeLoaded: null | |
,syncTime: function() { | |
var syncer = null; | |
syncer = new com_progrestar_common_server_TimeSyncer(com_progrestar_common_global_Env.SERVER_URL + "time.php"); | |
syncer.timeLoaded.add($bind(this,this.onTimeSynced)); | |
} | |
,onTimeSynced: function(v) { | |
this.isServerTimeLoaded = true; | |
} | |
,onStart: function(v) { | |
com_progrestar_game_managers_VisualManager.init(); | |
if(!this.createEnvironment()) { | |
this.loader.onLog("game environment - failed","FF4040"); | |
return; | |
} | |
var _this = this.stage.window.application.meta; | |
com_junkbyte_console_Cc.addHTML("<font family='_typewriter' color='#666666'>" + ["<b>CLIENT VERSION: " + (__map_reserved["version"] != null ? _this.getReserved("version") : _this.h["version"]) + "</b>","commit_hash:\t " + "15ab286b5","tree_hash:\t\t " + "2065f1f69","commiter:\t\t " + "1","date:\t\t\t " + "2020-12-24 18:11:26 +0300","timestamp:\t\t " + "1608822686","ref:\t\t\t " + "origin/release/2020-12-24","build_timestamp: " + "1608822728","==========="].join("\n\t") + "</font>"); | |
this.coreInit(); | |
} | |
,coreInit: function() { | |
this.initConst(); | |
if(com_progrestar_game_server_RpcManager.get_registrationError() != null) { | |
this.onUserInfoError(StaticExt.kast(Std,com_progrestar_game_server_RpcManager.get_registrationError(),com_progrestar_common_new_$rpc_RpcEntryBase)); | |
} else if(com_progrestar_game_server_RpcManager.get_registrationInfo() != null) { | |
this.userInfoLoaded = true; | |
this.resize(); | |
EpicGameFactory.setup(this,com_progrestar_game_server_RpcManager.get_registrationInfo()); | |
com_progrestar_framework_time_Time.start(($_=this.loader,$bind($_,$_.onSuccess)),0.1,1); | |
} | |
} | |
,initConst: function() { | |
var title = com_progrestar_common_lang_Translate.translate("T_FB_INVITE_FRIENDS"); | |
var message = com_progrestar_common_lang_Translate.translate("T_WALLPOST_HOMELAND_INVITE"); | |
com_progrestar_common_global_Env.fbDefaultInviteParams = { "title" : title, "message" : message, "filters" : ["app_non_users"]}; | |
} | |
,__class__: GameController | |
,__properties__: $extend(GameProject.prototype.__properties__,{get_visual:"get_visual"}) | |
}); | |
var com_progrestar_framework_genome_atlas_AtlasConfig = function(group,compress,useMipMap) { | |
if(useMipMap == null) { | |
useMipMap = false; | |
} | |
if(compress == null) { | |
compress = false; | |
} | |
if(group == null) { | |
group = "default"; | |
} | |
this.useMipMap = false; | |
this.compress = false; | |
this.group = group; | |
this.compress = compress; | |
this.useMipMap = useMipMap; | |
}; | |
$hxClasses["com.progrestar.framework.genome.atlas.AtlasConfig"] = com_progrestar_framework_genome_atlas_AtlasConfig; | |
com_progrestar_framework_genome_atlas_AtlasConfig.__name__ = ["com","progrestar","framework","genome","atlas","AtlasConfig"]; | |
com_progrestar_framework_genome_atlas_AtlasConfig.prototype = { | |
group: null | |
,compress: null | |
,useMipMap: null | |
,toString: function() { | |
return JSON.stringify(this); | |
} | |
,get_format: function() { | |
if(this.compress) { | |
return 2; | |
} else { | |
return 1; | |
} | |
} | |
,__class__: com_progrestar_framework_genome_atlas_AtlasConfig | |
,__properties__: {get_format:"get_format"} | |
}; | |
var GameSceneFactory = function() { | |
var config = new com_progrestar_framework_genome_display_GenomeConfig(); | |
GameSceneFactory.scene = new com_progrestar_framework_genome_display_GenomeScene(com_progrestar_common_global_Env.main,config); | |
com_progrestar_framework_core_utils_DisplayUtils.waitStage(com_progrestar_common_global_Env.main,$bind(this,this.onStage)); | |
GameSceneFactory.scene.get_sceneStateChanged().add(GameSceneFactory.onSceneStateRefresh); | |
GameSceneFactory.scene.resourceError.add(GameSceneFactory.onResourceError); | |
GameSceneFactory.onSceneStateRefresh(); | |
GameSceneFactory.maskController = new com_progrestar_game_render2_SceneShadowController(GameSceneFactory.scene); | |
com_progrestar_framework_time_Time.start($bind(this,this.updateStatistic),2,0); | |
}; | |
$hxClasses["GameSceneFactory"] = GameSceneFactory; | |
GameSceneFactory.__name__ = ["GameSceneFactory"]; | |
GameSceneFactory.scene = null; | |
GameSceneFactory.perfomance = null; | |
GameSceneFactory.maskController = null; | |
GameSceneFactory.create = function() { | |
new GameSceneFactory(); | |
com_progrestar_framework_genome_atlas_AtlasConfig.LINEAR_TEXTURE_FILTER = com_progrestar_common_global_Env.isHardware; | |
}; | |
GameSceneFactory.setup = function(v) { | |
com_progrestar_game_render2_controller_IsometricUtils.setTileSize(com_progrestar_common_global_Env.TILE_SIZE); | |
com_progrestar_framework_genome_atlas_proxy_ImageProxy.clipConfigMaker = GameSceneFactory.clipConfigMaker; | |
}; | |
GameSceneFactory.clipConfigMaker = function(image) { | |
var resourceName = image.resource.get_name(); | |
if(resourceName.indexOf("background/") >= 0) { | |
return GameSceneFactory.NON_COMPRESSED_CONFIG; | |
} | |
if(resourceName.indexOf("ui/cursors/tower_radius") >= 0) { | |
return GameSceneFactory.NON_COMPRESSED_CONFIG; | |
} | |
if(resourceName.indexOf("effects/fire") >= 0) { | |
return GameSceneFactory.NON_COMPRESSED_CONFIG; | |
} | |
if(resourceName.indexOf("shapes") >= 0) { | |
return GameSceneFactory.NON_COMPRESSED_CONFIG; | |
} | |
if(resourceName.indexOf("effects/primary") >= 0) { | |
return GameSceneFactory.NON_COMPRESSED_CONFIG; | |
} | |
if(resourceName.indexOf("crusades") >= 0 && resourceName.indexOf("units") == -1) { | |
return GameSceneFactory.NON_COMPRESSED_CONFIG; | |
} | |
return GameSceneFactory.MAIN_CONFIG; | |
}; | |
GameSceneFactory.onResourceError = function(v) { | |
com_progrestar_common_global_Env.log.setup("Scene.resource","failed"); | |
}; | |
GameSceneFactory.onSceneStateRefresh = function(v) { | |
if(GameSceneFactory.scene.get_sceneState() == "fail") { | |
com_progrestar_common_global_Env.log.setup("Scene.state","failed"); | |
} | |
if(GameSceneFactory.scene.get_sceneState() == "init") { | |
com_progrestar_common_global_Env.log.setup("Scene.state","initialize"); | |
} | |
if(GameSceneFactory.scene.get_sceneState() == "work") { | |
com_progrestar_common_global_Env.log.setup("Scene.state","working"); | |
} | |
if(com_genome2d_Genome2D.g2d_instance == null) { | |
com_genome2d_Genome2D.g2d_instantiable = true; | |
new com_genome2d_Genome2D(); | |
com_genome2d_Genome2D.g2d_instantiable = false; | |
} | |
var engine = com_genome2d_Genome2D.g2d_instance; | |
var driverInfo = null; | |
com_progrestar_common_global_Env.log.setup("Scene.driver","undefined"); | |
if(engine != null) { | |
if(engine.g2d_context != null) { | |
driverInfo = "context-created"; | |
if(engine.g2d_context.getNativeContext()) { | |
driverInfo = engine.g2d_context.getDriverInfo(); | |
com_progrestar_common_global_Env.isBitmapRender = driverInfo.indexOf("BitmapRender") >= 0; | |
com_progrestar_common_global_Env.isHardware = driverInfo.indexOf("Direct") >= 0 || driverInfo.indexOf("Open") >= 0; | |
} | |
} | |
com_progrestar_common_global_Env.log.setup("Scene.driver",driverInfo); | |
} | |
}; | |
GameSceneFactory.setUI = function(showUI) { | |
GameSceneFactory.maskController.setUI(showUI); | |
}; | |
GameSceneFactory.prototype = { | |
onStage: function(v) { | |
GameSceneFactory.perfomance = new com_progrestar_framework_genome_display_GenomePerfomance(GameSceneFactory.scene,com_progrestar_common_global_Env.main.stage); | |
} | |
,updateStatistic: function(v) { | |
} | |
,__class__: GameSceneFactory | |
}; | |
var HxOverrides = function() { }; | |
$hxClasses["HxOverrides"] = HxOverrides; | |
HxOverrides.__name__ = ["HxOverrides"]; | |
HxOverrides.strDate = function(s) { | |
var _g = s.length; | |
switch(_g) { | |
case 8: | |
var k = s.split(":"); | |
var d = new Date(); | |
d["setTime"](0); | |
d["setUTCHours"](k[0]); | |
d["setUTCMinutes"](k[1]); | |
d["setUTCSeconds"](k[2]); | |
return d; | |
case 10: | |
var k1 = s.split("-"); | |
return new Date(k1[0],k1[1] - 1,k1[2],0,0,0); | |
case 19: | |
var k2 = s.split(" "); | |
var y = k2[0].split("-"); | |
var t = k2[1].split(":"); | |
return new Date(y[0],y[1] - 1,y[2],t[0],t[1],t[2]); | |
default: | |
throw new js__$Boot_HaxeError("Invalid date format : " + s); | |
} | |
}; | |
HxOverrides.cca = function(s,index) { | |
var x = s.charCodeAt(index); | |
if(x != x) { | |
return undefined; | |
} | |
return x; | |
}; | |
HxOverrides.substr = function(s,pos,len) { | |
if(len == null) { | |
len = s.length; | |
} else if(len < 0) { | |
if(pos == 0) { | |
len = s.length + len; | |
} else { | |
return ""; | |
} | |
} | |
return s.substr(pos,len); | |
}; | |
HxOverrides.remove = function(a,obj) { | |
var i = a.indexOf(obj); | |
if(i == -1) { | |
return false; | |
} | |
a.splice(i,1); | |
return true; | |
}; | |
HxOverrides.iter = function(a) { | |
return { cur : 0, arr : a, hasNext : function() { | |
return this.cur < this.arr.length; | |
}, next : function() { | |
return this.arr[this.cur++]; | |
}}; | |
}; | |
var ILoadManager = function() { }; | |
$hxClasses["ILoadManager"] = ILoadManager; | |
ILoadManager.__name__ = ["ILoadManager"]; | |
ILoadManager.prototype = { | |
get_loaderInfoLoader: null | |
,get_extendsAssetsLoader: null | |
,get_coreAssetsLoader: null | |
,get_firstAssetsLoader: null | |
,get_fileIndexLoader: null | |
,get_socialLoader: null | |
,get_gameLoader: null | |
,get_tasks: null | |
,get_application: null | |
,__class__: ILoadManager | |
,__properties__: {get_loaderInfoLoader:"get_loaderInfoLoader",get_extendsAssetsLoader:"get_extendsAssetsLoader",get_coreAssetsLoader:"get_coreAssetsLoader",get_firstAssetsLoader:"get_firstAssetsLoader",get_fileIndexLoader:"get_fileIndexLoader",get_socialLoader:"get_socialLoader",get_gameLoader:"get_gameLoader",get_tasks:"get_tasks",get_application:"get_application"} | |
}; | |
var Lambda = function() { }; | |
$hxClasses["Lambda"] = Lambda; | |
Lambda.__name__ = ["Lambda"]; | |
Lambda.array = function(it) { | |
var a = []; | |
var i = $iterator(it)(); | |
while(i.hasNext()) { | |
var i1 = i.next(); | |
a.push(i1); | |
} | |
return a; | |
}; | |
Lambda.indexOf = function(it,v) { | |
var i = 0; | |
var v2 = $iterator(it)(); | |
while(v2.hasNext()) { | |
var v21 = v2.next(); | |
if(v == v21) { | |
return i; | |
} | |
++i; | |
} | |
return -1; | |
}; | |
var LayerInfo = function(layer_) { | |
this.time = 0; | |
this.counter = 0; | |
this._layer = layer_; | |
}; | |
$hxClasses["LayerInfo"] = LayerInfo; | |
LayerInfo.__name__ = ["LayerInfo"]; | |
LayerInfo.prototype = { | |
_layer: null | |
,counter: null | |
,time: null | |
,get_layer: function() { | |
return this._layer; | |
} | |
,__class__: LayerInfo | |
,__properties__: {get_layer:"get_layer"} | |
}; | |
var _$List_ListNode = function(item,next) { | |
this.item = item; | |
this.next = next; | |
}; | |
$hxClasses["_List.ListNode"] = _$List_ListNode; | |
_$List_ListNode.__name__ = ["_List","ListNode"]; | |
_$List_ListNode.prototype = { | |
item: null | |
,next: null | |
,__class__: _$List_ListNode | |
}; | |
var _$List_ListIterator = function(head) { | |
this.head = head; | |
}; | |
$hxClasses["_List.ListIterator"] = _$List_ListIterator; | |
_$List_ListIterator.__name__ = ["_List","ListIterator"]; | |
_$List_ListIterator.prototype = { | |
head: null | |
,hasNext: function() { | |
return this.head != null; | |
} | |
,next: function() { | |
var val = this.head.item; | |
this.head = this.head.next; | |
return val; | |
} | |
,__class__: _$List_ListIterator | |
}; | |
var LoadManager = function(start) { | |
this.socialModuleLoader = new com_progrestar_game_data_loader_CustomLoader("EpicSocial"); | |
this.gameModuleLoader = new com_progrestar_game_data_loader_CustomLoader("EpicGame"); | |
this.taskManager = new com_progrestar_cas_task_TaskManager(); | |
this.start = start; | |
}; | |
$hxClasses["LoadManager"] = LoadManager; | |
LoadManager.__name__ = ["LoadManager"]; | |
LoadManager.__interfaces__ = [ILoadManager]; | |
LoadManager.instance = null; | |
LoadManager.prototype = { | |
taskManager: null | |
,_firstAssetsLoader: null | |
,_coreAssetsLoader: null | |
,_extendsAssetsLoader: null | |
,_loaderInfoLoader: null | |
,_fileIndexLoader: null | |
,gameModuleLoader: null | |
,socialModuleLoader: null | |
,start: null | |
,initFileIndexer: function() { | |
this._fileIndexLoader = new com_progrestar_game_data_loader_FileIndexLoader(com_progrestar_common_global_Env.STATIC_URL,EpicWarEnv.FILE_INDEXER,com_progrestar_common_global_Env.NETWORK); | |
this.get_tasks().addTask(this._fileIndexLoader,4); | |
} | |
,initPreLoader: function() { | |
this._loaderInfoLoader = new com_progrestar_game_data_loader_LoaderInfoLoader(); | |
this.get_tasks().addTask(this._loaderInfoLoader,4); | |
} | |
,initGame: function() { | |
this._firstAssetsLoader = com_progrestar_game_data_loader_AssetsLoader.initFirstBattleAssets(this); | |
this._coreAssetsLoader = com_progrestar_game_data_loader_AssetsLoader.initCoreAssets(this); | |
this._extendsAssetsLoader = com_progrestar_game_data_loader_AssetsLoader.initExtendAssets(this); | |
} | |
,get_application: function() { | |
return this.start; | |
} | |
,get_tasks: function() { | |
return this.taskManager; | |
} | |
,get_firstAssetsLoader: function() { | |
return this._firstAssetsLoader; | |
} | |
,get_coreAssetsLoader: function() { | |
return this._coreAssetsLoader; | |
} | |
,get_loaderInfoLoader: function() { | |
return this._loaderInfoLoader; | |
} | |
,get_extendsAssetsLoader: function() { | |
return this._extendsAssetsLoader; | |
} | |
,get_fileIndexLoader: function() { | |
return this._fileIndexLoader; | |
} | |
,get_socialLoader: function() { | |
return this.socialModuleLoader; | |
} | |
,get_gameLoader: function() { | |
return this.gameModuleLoader; | |
} | |
,__class__: LoadManager | |
,__properties__: {get_gameLoader:"get_gameLoader",get_socialLoader:"get_socialLoader",get_fileIndexLoader:"get_fileIndexLoader",get_extendsAssetsLoader:"get_extendsAssetsLoader",get_loaderInfoLoader:"get_loaderInfoLoader",get_coreAssetsLoader:"get_coreAssetsLoader",get_firstAssetsLoader:"get_firstAssetsLoader",get_tasks:"get_tasks",get_application:"get_application"} | |
}; | |
var LoaderInfoData = function() { | |
}; | |
$hxClasses["LoaderInfoData"] = LoaderInfoData; | |
LoaderInfoData.__name__ = ["LoaderInfoData"]; | |
LoaderInfoData.prototype = { | |
top: null | |
,activeEventIdent: null | |
,crusadeEventIdent: null | |
,parse: function(data) { | |
data.top.sort($bind(this,this.sortOnPlace)); | |
this.top = data.top; | |
this.activeEventIdent = data.activeEventIdent && data.activeEventIdent.length > 0 ? data.activeEventIdent : null; | |
this.crusadeEventIdent = data.crusadeEventIdent && data.crusadeEventIdent.length > 0 ? data.crusadeEventIdent : null; | |
} | |
,sortOnPlace: function(a,b) { | |
if(a.place > b.place) { | |
return 1; | |
} else { | |
return -1; | |
} | |
} | |
,__class__: LoaderInfoData | |
}; | |
var LoaderView = function(loadManager) { | |
this.readySignal = new utils_signals_Signal(); | |
this.hMax = 640; | |
this.wMax = 1000; | |
this.socialInited = false; | |
openfl_display_Sprite.call(this); | |
this._loadManager = loadManager; | |
if(this._loadManager.get_tasks().get_isAllCompleted()) { | |
this.onStart(); | |
} else { | |
this._loadManager.get_tasks().get_completed().add($bind(this,this.onStart)); | |
} | |
}; | |
$hxClasses["LoaderView"] = LoaderView; | |
LoaderView.__name__ = ["LoaderView"]; | |
LoaderView.__super__ = openfl_display_Sprite; | |
LoaderView.prototype = $extend(openfl_display_Sprite.prototype,{ | |
preloader: null | |
,parallax: null | |
,testInfo: null | |
,percents: null | |
,message: null | |
,progressBar: null | |
,highlightsMc: null | |
,shineMc: null | |
,socialInited: null | |
,customPicture: null | |
,background: null | |
,wMax: null | |
,hMax: null | |
,readySignal: null | |
,_loadManager: null | |
,onStart: function(v) { | |
this._loadManager.get_tasks().get_completed().remove($bind(this,this.onStart)); | |
this._loadManager.get_tasks().get_progressChanged().add($bind(this,this.onLoadProgress)); | |
this._loadManager.get_socialLoader().get_successSignal().add($bind(this,this.onSocialSuccess)); | |
this._loadManager.get_coreAssetsLoader().get_successSignal().add($bind(this,this.onFontsLoaded)); | |
com_progrestar_framework_core_utils_DisplayUtils.waitStage(this,$bind(this,this.init)); | |
} | |
,init: function(v) { | |
this.addEventListener("enterFrame",$bind(this,this.tick)); | |
this.initBackground(); | |
this.initTestInfo(); | |
this.updateTestMode(); | |
com_progrestar_common_global_Env.log.get_loadInfoCreated().add($bind(this,this.showLog)); | |
this.updateTestMode(); | |
this.initBigLoader(); | |
this.stage.addEventListener("resize",$bind(this,this.onStageResized)); | |
} | |
,initBackground: function() { | |
this.background = new openfl_display_Shape(); | |
this.background.get_graphics().drawRect(0,0,10,10); | |
this.addChildAt(this.background,0); | |
} | |
,initBigLoader: function() { | |
this.loadPicture(); | |
var loader = com_progrestar_framework_class_$system_ClassFactory.getClass(EpicWarEnv.preloader,"Main",$bind(this,this.onBigLoaderAssetComplete)); | |
loader.get_file().progress.add($bind(this,this.onBigloaderAssetProgress)); | |
loader.get_classFailed().add($bind(this,this.onError)); | |
} | |
,onBigloaderAssetProgress: function(file) { | |
var progress = (file.get_loadedBytes() / file.get_totalBytes() * 30 | 0) + 70; | |
this.showMiniProgress(progress); | |
} | |
,onBigLoaderAssetComplete: function(main) { | |
var assetMc = StaticExt.kast(Std,main.instantiate(),openfl_display_MovieClip); | |
this.createPreloader(assetMc); | |
this.tryAddCustomPicture(); | |
this.tryAddCustomLogo(); | |
this.updateSize(); | |
this.readySignal.dispatch(); | |
} | |
,loadPicture: function() { | |
var data = LoadManager.instance.get_loaderInfoLoader().data; | |
var picUrl = "preloader/1600/sands.jpg"; | |
if(data.crusadeEventIdent != null) { | |
picUrl = "preloader/1600/crusade.jpg"; | |
} else if(data.activeEventIdent != null) { | |
picUrl = "preloader/1600/" + data.activeEventIdent + ".jpg"; | |
} | |
var path = com_progrestar_common_global_Env.ASSETS_URL + picUrl; | |
com_progrestar_framework_file_$system_FileSystem.item(path,$bind(this,this.onPictureLoaded)); | |
} | |
,onPictureLoaded: function(file) { | |
this.customPicture = StaticExt.kast(Std,file.getContent(),openfl_display_Bitmap); | |
this.tryAddCustomPicture(); | |
this.updateSize(); | |
} | |
,tryAddCustomPicture: function() { | |
if(this.preloader == null) { | |
return; | |
} | |
if(this.customPicture != null && this.customPicture.get_width() > 0 && this.customPicture.get_height() > 0) { | |
this.tryCreateParallax(); | |
this.tryAddPreloader(); | |
} | |
} | |
,tryAddCustomLogo: function() { | |
if(this.preloader == null) { | |
return; | |
} | |
this.setLogo(); | |
} | |
,tryCreateParallax: function() { | |
if(this.preloader != null) { | |
var parallaxMc = StaticExt.kast(Std,this.preloader.getChildByName("parallax"),openfl_display_MovieClip); | |
if(parallaxMc != null) { | |
if(this.customPicture != null) { | |
this.customPicture.smoothing = true; | |
parallaxMc.removeChildren(); | |
parallaxMc.addChild(this.customPicture); | |
this.wMax = this.customPicture.get_width() | 0; | |
this.hMax = this.customPicture.get_height() | 0; | |
this.customPicture.set_x(-0.5 * this.customPicture.get_width()); | |
this.customPicture.set_y(-0.5 * this.customPicture.get_height()); | |
} | |
} | |
} | |
} | |
,tryAddPreloader: function() { | |
if(this.preloader != null && this.parallax != null) { | |
if(!this.contains(this.preloader)) { | |
this.addChildAt(this.preloader,0); | |
} | |
} | |
} | |
,onError: function(v) { | |
this.readySignal.dispatch(); | |
} | |
,createPreloader: function(asset) { | |
if(this.stage == null) { | |
return; | |
} | |
this.addChild(asset); | |
this.preloader = asset; | |
if(this.preloader != null) { | |
this.percents = StaticExt.kast(Std,this.preloader.getChildByName("txt"),openfl_text_TextField); | |
if(this.percents != null) { | |
this.percents.set_text(""); | |
} | |
this.highlightsMc = StaticExt.kast(Std,this.preloader.getChildByName("highlights"),openfl_display_MovieClip); | |
this.shineMc = StaticExt.kast(Std,this.preloader.getChildByName("shine"),openfl_display_MovieClip); | |
var child = null; | |
var _g1 = 0; | |
var _g = this.preloader.get_numChildren(); | |
while(_g1 < _g) { | |
var i = _g1++; | |
child = StaticExt.kast(Std,this.preloader.getChildAt(i),openfl_display_MovieClip); | |
if(child != null) { | |
child.stop(); | |
} | |
} | |
var playingFriends = StaticExt.kast(Std,this.preloader.getChildByName("playingFriends"),openfl_display_MovieClip); | |
if(playingFriends != null) { | |
var labels = StaticExt.kast(Std,playingFriends.getChildByName("labels"),openfl_display_MovieClip); | |
if(labels != null) { | |
if(com_progrestar_common_global_LangManager.get_locale() == "ru" || com_progrestar_common_global_LangManager.get_locale() == "en") { | |
labels.gotoAndStop(com_progrestar_common_global_LangManager.get_locale()); | |
} else { | |
labels.set_visible(false); | |
} | |
} | |
} | |
this.addChildAt(this.preloader,0); | |
this.showMobileIcons(); | |
} | |
} | |
,setLogo: function() { | |
var mainLogo = StaticExt.kast(Std,this.preloader.getChildByName("mainLogo"),openfl_display_MovieClip); | |
if(mainLogo != null) { | |
var fr = null; | |
if(com_progrestar_common_global_LangManager.get_locale() == "ru") { | |
fr = "ru"; | |
} else { | |
fr = "en"; | |
} | |
mainLogo.gotoAndStop(fr); | |
var data = LoadManager.instance.get_loaderInfoLoader().data; | |
if(data.activeEventIdent != null) { | |
fr += "Event"; | |
} | |
var labels = mainLogo.get_currentLabels(); | |
var _g = 0; | |
while(_g < labels.length) { | |
var label = labels[_g]; | |
++_g; | |
if(label != null && label.get_name() == fr) { | |
mainLogo.gotoAndStop(fr); | |
return; | |
} | |
} | |
} | |
} | |
,showCitadelWinners: function() { | |
if(this.preloader != null) { | |
var winnersBlock = StaticExt.kast(Std,this.preloader.getChildByName("citadelWinnersPlaceHolder"),openfl_display_MovieClip); | |
if(winnersBlock != null) { | |
var data = LoadManager.instance.get_loaderInfoLoader().data; | |
if(data.top != null) { | |
new com_progrestar_game_citadel_ui_CitadelLastWinnersBlock(winnersBlock,data.top); | |
} | |
} | |
} | |
} | |
,tick: function(e) { | |
if(this.parallax != null) { | |
this.parallax.tick(); | |
} | |
} | |
,showMobileIcons: function() { | |
var iconPlace = StaticExt.kast(Std,this.preloader.getChildByName("mobileIcons"),openfl_display_MovieClip); | |
if(iconPlace != null) { | |
new com_progrestar_game_ui_preloader_WaitAndGetPanel(iconPlace); | |
} | |
} | |
,onSocialSuccess: function(v) { | |
this.socialInited = true; | |
this._loadManager.get_socialLoader().get_successSignal().remove($bind(this,this.onSocialSuccess)); | |
} | |
,showMiniProgress: function(progress) { | |
if(this.percents != null) { | |
this.percents.set_text(progress + "%"); | |
} | |
if(this.progressBar != null) { | |
this.progressBar.gotoAndStop(progress); | |
} | |
} | |
,initTestInfo: function() { | |
this.testInfo = new openfl_text_TextField(); | |
this.testInfo.set_background(true); | |
this.testInfo.set_backgroundColor(32); | |
this.testInfo.set_defaultTextFormat(new openfl_text_TextFormat("Arial",9,10539263)); | |
this.testInfo.set_autoSize(1); | |
this.addChild(this.testInfo); | |
} | |
,updateTestMode: function() { | |
this.testInfo.set_visible(com_progrestar_common_global_Env.testMode); | |
} | |
,showLog: function(item) { | |
if(item.color == "FF4040" && com_progrestar_common_global_Env.testMode) { | |
this.testInfo.set_visible(true); | |
} | |
var colorString = "<font color='#" + item.color + "'>"; | |
com_progrestar_framework_core_utils_TraceUtils.consoleLog("LoaderVier >> " + item.message); | |
this.testInfo.set_multiline(true); | |
var _g = this.testInfo; | |
_g.set_htmlText(lime_text__$UTF8String_UTF8String_$Impl_$.plus(_g.get_htmlText(),colorString + item.message + "<br>")); | |
} | |
,onLoadProgress: function(progress) { | |
if(this.preloader != null) { | |
progress *= 100; | |
if(this.percents != null) { | |
this.percents.set_text(StaticExt.toFixed(progress,0) + "%"); | |
} | |
if(this.highlightsMc != null) { | |
this.highlightsMc.gotoAndStop(progress); | |
} | |
if(this.shineMc != null) { | |
this.shineMc.gotoAndStop(progress | 0); | |
} | |
} | |
} | |
,onFontsLoaded: function(task) { | |
this.showCitadelWinners(); | |
} | |
,destroy: function() { | |
this.parallax = null; | |
com_progrestar_common_global_Env.log.get_loadInfoCreated().remove($bind(this,this.showLog)); | |
this._loadManager.get_tasks().get_progressChanged().remove($bind(this,this.onLoadProgress)); | |
this._loadManager.get_socialLoader().get_successSignal().remove($bind(this,this.onSocialSuccess)); | |
this._loadManager.get_coreAssetsLoader().get_successSignal().remove($bind(this,this.onFontsLoaded)); | |
this._loadManager = null; | |
this.removeEventListener("enterFrame",$bind(this,this.tick)); | |
this.stage.removeEventListener("resize",$bind(this,this.onStageResized)); | |
} | |
,onStageResized: function(event) { | |
this.updateSize(); | |
} | |
,updateSize: function() { | |
var sw = this.stage.stageWidth; | |
var sh = this.stage.stageHeight; | |
if(this.preloader != null) { | |
var targetH = sh; | |
var targetW = Math.min(sw,targetH / this.hMax * this.wMax); | |
var targetScale = targetH / this.hMax; | |
var rl = Math.floor(0.5 * (sw - targetW)); | |
var rt = Math.floor(0.5 * (sh - targetH)); | |
var rr = Math.ceil(0.5 * (sw + targetW)); | |
var rb = Math.ceil(0.5 * (sh + targetH)); | |
var targetRect = new lime_math_Rectangle(rl,rt,rr - rl,rb - rt); | |
var frameScaleV = rl > 0 ? 0.25 : 0; | |
var frameScaleH = 0; | |
var winnersBlock = StaticExt.kast(Std,this.preloader.getChildByName("citadelWinnersPlaceHolder"),openfl_display_MovieClip); | |
if(winnersBlock != null) { | |
winnersBlock.set_x(targetRect.get_left() + 120); | |
winnersBlock.set_y(targetRect.get_bottom() - 160); | |
} | |
var tl = StaticExt.kast(Std,this.preloader.getChildByName("tl"),openfl_display_MovieClip); | |
if(tl != null) { | |
tl.set_x(targetRect.get_left() + 20); | |
tl.set_y(targetRect.get_top() + 20); | |
} | |
var tr = StaticExt.kast(Std,this.preloader.getChildByName("mainLogo"),openfl_display_MovieClip); | |
if(tr != null) { | |
tr.set_x(targetRect.get_right() - 20); | |
tr.set_y(targetRect.get_top()); | |
} | |
var progress = StaticExt.kast(Std,this.preloader.getChildByName("shine"),openfl_display_MovieClip); | |
if(progress != null) { | |
progress.set_x(0.5 * (sw - progress.get_width())); | |
progress.set_y(targetRect.get_bottom() - 50); | |
} | |
var text = StaticExt.kast(Std,this.preloader.getChildByName("txt"),openfl_text_TextField); | |
if(text != null) { | |
text.set_x(0.5 * (sw - text.get_width())); | |
text.set_y(targetRect.get_bottom() - 70); | |
} | |
var parallaxMc = StaticExt.kast(Std,this.preloader.getChildByName("parallax"),openfl_display_MovieClip); | |
if(parallaxMc != null) { | |
parallaxMc.set_scaleX(parallaxMc.set_scaleY(targetScale)); | |
parallaxMc.set_x(0.5 * sw); | |
parallaxMc.set_y(0.5 * sh); | |
} | |
var shadow_l = StaticExt.kast(Std,this.preloader.getChildByName("shadow_l"),openfl_display_MovieClip); | |
var shadow_r = StaticExt.kast(Std,this.preloader.getChildByName("shadow_r"),openfl_display_MovieClip); | |
var shadow_t = StaticExt.kast(Std,this.preloader.getChildByName("shadow_t"),openfl_display_MovieClip); | |
var shadow_b = StaticExt.kast(Std,this.preloader.getChildByName("shadow_b"),openfl_display_MovieClip); | |
shadow_l.set_x(targetRect.get_left()); | |
shadow_l.set_y(targetRect.get_top()); | |
shadow_l.set_scaleX(frameScaleV); | |
shadow_l.set_height(targetRect.height); | |
shadow_r.set_x(targetRect.get_right()); | |
shadow_r.set_y(targetRect.get_top()); | |
shadow_r.set_scaleX(-frameScaleV); | |
shadow_r.set_height(targetRect.height); | |
shadow_t.set_x(targetRect.get_left()); | |
shadow_t.set_y(targetRect.get_top()); | |
shadow_t.set_height(targetRect.width); | |
shadow_t.set_scaleX(-frameScaleH); | |
shadow_t.set_rotation(-90); | |
shadow_b.set_x(targetRect.get_left()); | |
shadow_b.set_y(targetRect.get_bottom()); | |
shadow_b.set_height(targetRect.width); | |
shadow_b.set_scaleX(frameScaleH); | |
shadow_b.set_rotation(-90); | |
} | |
if(this.background != null) { | |
this.background.set_x(0); | |
this.background.set_y(0); | |
this.background.set_width(this.stage.stageWidth); | |
this.background.set_height(this.stage.stageHeight); | |
} | |
} | |
,__class__: LoaderView | |
}); | |
var ManifestResources = function() { }; | |
$hxClasses["ManifestResources"] = ManifestResources; | |
ManifestResources.__name__ = ["ManifestResources"]; | |
ManifestResources.preloadLibraries = null; | |
ManifestResources.preloadLibraryNames = null; | |
ManifestResources.rootPath = null; | |
ManifestResources.init = function(config) { | |
ManifestResources.preloadLibraries = []; | |
ManifestResources.preloadLibraryNames = []; | |
ManifestResources.rootPath = null; | |
if(config != null && Object.prototype.hasOwnProperty.call(config,"rootPath")) { | |
ManifestResources.rootPath = Reflect.field(config,"rootPath"); | |
} | |
if(ManifestResources.rootPath == null) { | |
ManifestResources.rootPath = ""; | |
} | |
lime_utils_Assets.defaultRootPath = ManifestResources.rootPath; | |
openfl_text_Font.registerFont(_$_$ASSET_$_$OPENFL_$_$fonts_$officinaserifblackitc_$ttf); | |
openfl_text_Font.registerFont(_$_$ASSET_$_$OPENFL_$_$fonts_$epicwar_$title_$ttf); | |
openfl_text_Font.registerFont(_$_$ASSET_$_$OPENFL_$_$fonts_$ozhandicraft_$ttf); | |
openfl_text_Font.registerFont(_$_$ASSET_$_$OPENFL_$_$fonts_$roboto_$condensed_$regular_$ttf); | |
openfl_text_Font.registerFont(_$_$ASSET_$_$OPENFL_$_$fonts_$roboto_$condensed_$bold_$ttf); | |
openfl_text_Font.registerFont(_$_$ASSET_$_$OPENFL_$_$fonts_$officinasansblack_$ttf); | |
var data; | |
var manifest; | |
var library; | |
var bundle; | |
data = "{\"name\":null,\"assets\":\"aoy4:sizei258436y4:typey4:FONTy9:classNamey40:__ASSET__fonts_officinaserifblackitc_ttfy2:idy33:fonts%2FOfficinaSerifBlackITC.ttfy7:preloadtgoR0i323096R1R2R3y32:__ASSET__fonts_epicwar_title_ttfR5y25:fonts%2FEpicwar_title.ttfR7tgoR0i141624R1R2R3y31:__ASSET__fonts_ozhandicraft_ttfR5y24:fonts%2FOzHandicraft.ttfR7tgoR0i114568R1R2R3y43:__ASSET__fonts_roboto_condensed_regular_ttfR5y40:fonts%2FRoboto%20Condensed%20Regular.ttfR7tgoR0i115036R1R2R3y40:__ASSET__fonts_roboto_condensed_bold_ttfR5y37:fonts%2FRoboto%20Condensed%20Bold.ttfR7tgoR0i47376R1R2R3y36:__ASSET__fonts_officinasansblack_ttfR5y29:fonts%2FOfficinaSansBlack.ttfR7tgh\",\"rootPath\":\"../\",\"version\":2,\"libraryArgs\":[],\"libraryType\":null}"; | |
manifest = lime_utils_AssetManifest.parse(data,ManifestResources.rootPath); | |
library = lime_utils_AssetLibrary.fromManifest(manifest); | |
lime_utils_Assets.registerLibrary("default",library); | |
library = lime_utils_Assets.getLibrary("default"); | |
if(library != null) { | |
ManifestResources.preloadLibraries.push(library); | |
} else { | |
ManifestResources.preloadLibraryNames.push("default"); | |
} | |
}; | |
var lime_text_Font = function(name) { | |
if(name != null) { | |
this.name = name; | |
} | |
if(!this.__init) { | |
if(this.ascender == undefined) { | |
this.ascender = 0; | |
} | |
if(this.descender == undefined) { | |
this.descender = 0; | |
} | |
if(this.height == undefined) { | |
this.height = 0; | |
} | |
if(this.numGlyphs == undefined) { | |
this.numGlyphs = 0; | |
} | |
if(this.underlinePosition == undefined) { | |
this.underlinePosition = 0; | |
} | |
if(this.underlineThickness == undefined) { | |
this.underlineThickness = 0; | |
} | |
if(this.unitsPerEM == undefined) { | |
this.unitsPerEM = 0; | |
} | |
if(this.__fontID != null) { | |
if(lime_utils_Assets.isLocal(this.__fontID)) { | |
this.__fromBytes(lime_utils_Assets.getBytes(this.__fontID)); | |
} | |
} else if(this.__fontPath != null) { | |
this.__fromFile(this.__fontPath); | |
} | |
} | |
}; | |
$hxClasses["lime.text.Font"] = lime_text_Font; | |
lime_text_Font.__name__ = ["lime","text","Font"]; | |
lime_text_Font.fromBytes = function(bytes) { | |
if(bytes == null) { | |
return null; | |
} | |
var font = new lime_text_Font(); | |
font.__fromBytes(bytes); | |
return font; | |
}; | |
lime_text_Font.fromFile = function(path) { | |
if(path == null) { | |
return null; | |
} | |
var font = new lime_text_Font(); | |
font.__fromFile(path); | |
return font; | |
}; | |
lime_text_Font.loadFromBytes = function(bytes) { | |
return lime_app_Future.withValue(lime_text_Font.fromBytes(bytes)); | |
}; | |
lime_text_Font.loadFromFile = function(path) { | |
var request = new lime_net__$HTTPRequest_$lime_$text_$Font(); | |
return request.load(path).then(function(font) { | |
if(font != null) { | |
return lime_app_Future.withValue(font); | |
} else { | |
return lime_app_Future.withError(""); | |
} | |
}); | |
}; | |
lime_text_Font.loadFromName = function(path) { | |
var font = new lime_text_Font(); | |
return font.__loadFromName(path); | |
}; | |
lime_text_Font.__measureFontNode = function(fontFamily) { | |
var node = window.document.createElement("span"); | |
node.setAttribute("aria-hidden","true"); | |
var text = window.document.createTextNode("BESbswy"); | |
node.appendChild(text); | |
var style = node.style; | |
style.display = "block"; | |
style.position = "absolute"; | |
style.top = "-9999px"; | |
style.left = "-9999px"; | |
style.fontSize = "300px"; | |
style.width = "auto"; | |
style.height = "auto"; | |
style.lineHeight = "normal"; | |
style.margin = "0"; | |
style.padding = "0"; | |
style.fontVariant = "normal"; | |
style.whiteSpace = "nowrap"; | |
style.fontFamily = fontFamily; | |
window.document.body.appendChild(node); | |
return node; | |
}; | |
lime_text_Font.prototype = { | |
ascender: null | |
,descender: null | |
,height: null | |
,name: null | |
,numGlyphs: null | |
,src: null | |
,underlinePosition: null | |
,underlineThickness: null | |
,unitsPerEM: null | |
,__fontID: null | |
,__fontPath: null | |
,__init: null | |
,decompose: function() { | |
return null; | |
} | |
,getGlyph: function(character) { | |
return -1; | |
} | |
,getGlyphs: function(characters) { | |
if(characters == null) { | |
characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^`'\"/\\&*()[]{}<>|:;_-+=?,. "; | |
} | |
return null; | |
} | |
,getGlyphMetrics: function(glyph) { | |
return null; | |
} | |
,renderGlyph: function(glyph,fontSize) { | |
return null; | |
} | |
,renderGlyphs: function(glyphs,fontSize) { | |
return null; | |
} | |
,__copyFrom: function(other) { | |
if(other != null) { | |
this.ascender = other.ascender; | |
this.descender = other.descender; | |
this.height = other.height; | |
this.name = other.name; | |
this.numGlyphs = other.numGlyphs; | |
this.src = other.src; | |
this.underlinePosition = other.underlinePosition; | |
this.underlineThickness = other.underlineThickness; | |
this.unitsPerEM = other.unitsPerEM; | |
this.__fontID = other.__fontID; | |
this.__fontPath = other.__fontPath; | |
this.__init = true; | |
} | |
} | |
,__fromBytes: function(bytes) { | |
this.__fontPath = null; | |
} | |
,__fromFile: function(path) { | |
this.__fontPath = path; | |
} | |
,__initializeSource: function() { | |
this.__init = true; | |
} | |
,__loadFromName: function(name) { | |
var _gthis = this; | |
var promise = new lime_app_Promise(); | |
this.name = name; | |
var userAgent = window.navigator.userAgent.toLowerCase(); | |
var isSafari = userAgent.indexOf(" safari/") >= 0 && userAgent.indexOf(" chrome/") < 0; | |
var isUIWebView = new EReg("(iPhone|iPod|iPad).*AppleWebKit(?!.*Version)","i").match(userAgent); | |
if(!isSafari && !isUIWebView && (window.document.fonts && ($_=window.document.fonts,$bind($_,$_.load)))) { | |
window.document.fonts.load("1em '" + name + "'").then(function(_) { | |
promise.complete(_gthis); | |
},function(_1) { | |
lime_utils_Log.warn("Could not load web font \"" + name + "\"",{ fileName : "Font.hx", lineNumber : 513, className : "lime.text.Font", methodName : "__loadFromName"}); | |
promise.complete(_gthis); | |
}); | |
} else { | |
var node1 = lime_text_Font.__measureFontNode("'" + name + "', sans-serif"); | |
var node2 = lime_text_Font.__measureFontNode("'" + name + "', serif"); | |
var width1 = node1.offsetWidth; | |
var width2 = node2.offsetWidth; | |
var interval = -1; | |
var timeout = 3000; | |
var intervalLength = 50; | |
var intervalCount = 0; | |
var loaded; | |
var timeExpired; | |
var checkFont = function() { | |
intervalCount += 1; | |
if(node1.offsetWidth == width1) { | |
loaded = node2.offsetWidth != width2; | |
} else { | |
loaded = true; | |
} | |
timeExpired = intervalCount * intervalLength >= timeout; | |
if(loaded || timeExpired) { | |
window.clearInterval(interval); | |
node1.parentNode.removeChild(node1); | |
node2.parentNode.removeChild(node2); | |
node1 = null; | |
node2 = null; | |
if(timeExpired) { | |
lime_utils_Log.warn("Could not load web font \"" + name + "\"",{ fileName : "Font.hx", lineNumber : 548, className : "lime.text.Font", methodName : "__loadFromName"}); | |
} | |
promise.complete(_gthis); | |
} | |
}; | |
interval = window.setInterval(checkFont,intervalLength); | |
} | |
return promise.future; | |
} | |
,__setSize: function(size) { | |
} | |
,__class__: lime_text_Font | |
}; | |
var _$_$ASSET_$_$fonts_$officinaserifblackitc_$ttf = $hx_exports["__ASSET__fonts_officinaserifblackitc_ttf"] = function() { | |
this.ascender = 1000; | |
this.descender = -286; | |
this.height = 1339; | |
this.numGlyphs = 787; | |
this.underlinePosition = -100; | |
this.underlineThickness = 50; | |
this.unitsPerEM = 1000; | |
this.name = "OfficinaSerifBlackITC Regular"; | |
lime_text_Font.call(this); | |
}; | |
$hxClasses["__ASSET__fonts_officinaserifblackitc_ttf"] = _$_$ASSET_$_$fonts_$officinaserifblackitc_$ttf; | |
_$_$ASSET_$_$fonts_$officinaserifblackitc_$ttf.__name__ = ["__ASSET__fonts_officinaserifblackitc_ttf"]; | |
_$_$ASSET_$_$fonts_$officinaserifblackitc_$ttf.__super__ = lime_text_Font; | |
_$_$ASSET_$_$fonts_$officinaserifblackitc_$ttf.prototype = $extend(lime_text_Font.prototype,{ | |
__class__: _$_$ASSET_$_$fonts_$officinaserifblackitc_$ttf | |
}); | |
var _$_$ASSET_$_$fonts_$epicwar_$title_$ttf = $hx_exports["__ASSET__fonts_epicwar_title_ttf"] = function() { | |
this.ascender = 2093; | |
this.descender = -524; | |
this.height = 3027; | |
this.numGlyphs = 662; | |
this.underlinePosition = -256; | |
this.underlineThickness = 117; | |
this.unitsPerEM = 2048; | |
this.name = "Epicwar_title"; | |
lime_text_Font.call(this); | |
}; | |
$hxClasses["__ASSET__fonts_epicwar_title_ttf"] = _$_$ASSET_$_$fonts_$epicwar_$title_$ttf; | |
_$_$ASSET_$_$fonts_$epicwar_$title_$ttf.__name__ = ["__ASSET__fonts_epicwar_title_ttf"]; | |
_$_$ASSET_$_$fonts_$epicwar_$title_$ttf.__super__ = lime_text_Font; | |
_$_$ASSET_$_$fonts_$epicwar_$title_$ttf.prototype = $extend(lime_text_Font.prototype,{ | |
__class__: _$_$ASSET_$_$fonts_$epicwar_$title_$ttf | |
}); | |
var _$_$ASSET_$_$fonts_$ozhandicraft_$ttf = $hx_exports["__ASSET__fonts_ozhandicraft_ttf"] = function() { | |
this.ascender = 2093; | |
this.descender = -524; | |
this.height = 2617; | |
this.numGlyphs = 662; | |
this.underlinePosition = -257; | |
this.underlineThickness = 117; | |
this.unitsPerEM = 2048; | |
this.name = "Oz Handicraft Win95BT"; | |
lime_text_Font.call(this); | |
}; | |
$hxClasses["__ASSET__fonts_ozhandicraft_ttf"] = _$_$ASSET_$_$fonts_$ozhandicraft_$ttf; | |
_$_$ASSET_$_$fonts_$ozhandicraft_$ttf.__name__ = ["__ASSET__fonts_ozhandicraft_ttf"]; | |
_$_$ASSET_$_$fonts_$ozhandicraft_$ttf.__super__ = lime_text_Font; | |
_$_$ASSET_$_$fonts_$ozhandicraft_$ttf.prototype = $extend(lime_text_Font.prototype,{ | |
__class__: _$_$ASSET_$_$fonts_$ozhandicraft_$ttf | |
}); | |
var _$_$ASSET_$_$fonts_$roboto_$condensed_$regular_$ttf = $hx_exports["__ASSET__fonts_roboto_condensed_regular_ttf"] = function() { | |
this.ascender = 1900; | |
this.descender = -500; | |
this.height = 2400; | |
this.numGlyphs = 1053; | |
this.underlinePosition = -200; | |
this.underlineThickness = 100; | |
this.unitsPerEM = 2048; | |
this.name = "Roboto Condensed Regular"; | |
lime_text_Font.call(this); | |
}; | |
$hxClasses["__ASSET__fonts_roboto_condensed_regular_ttf"] = _$_$ASSET_$_$fonts_$roboto_$condensed_$regular_$ttf; | |
_$_$ASSET_$_$fonts_$roboto_$condensed_$regular_$ttf.__name__ = ["__ASSET__fonts_roboto_condensed_regular_ttf"]; | |
_$_$ASSET_$_$fonts_$roboto_$condensed_$regular_$ttf.__super__ = lime_text_Font; | |
_$_$ASSET_$_$fonts_$roboto_$condensed_$regular_$ttf.prototype = $extend(lime_text_Font.prototype,{ | |
__class__: _$_$ASSET_$_$fonts_$roboto_$condensed_$regular_$ttf | |
}); | |
var _$_$ASSET_$_$fonts_$roboto_$condensed_$bold_$ttf = $hx_exports["__ASSET__fonts_roboto_condensed_bold_ttf"] = function() { | |
this.ascender = 1900; | |
this.descender = -500; | |
this.height = 2400; | |
this.numGlyphs = 1053; | |
this.underlinePosition = -200; | |
this.underlineThickness = 100; | |
this.unitsPerEM = 2048; | |
this.name = "Roboto Condensed Bold"; | |
lime_text_Font.call(this); | |
}; | |
$hxClasses["__ASSET__fonts_roboto_condensed_bold_ttf"] = _$_$ASSET_$_$fonts_$roboto_$condensed_$bold_$ttf; | |
_$_$ASSET_$_$fonts_$roboto_$condensed_$bold_$ttf.__name__ = ["__ASSET__fonts_roboto_condensed_bold_ttf"]; | |
_$_$ASSET_$_$fonts_$roboto_$condensed_$bold_$ttf.__super__ = lime_text_Font; | |
_$_$ASSET_$_$fonts_$roboto_$condensed_$bold_$ttf.prototype = $extend(lime_text_Font.prototype,{ | |
__class__: _$_$ASSET_$_$fonts_$roboto_$condensed_$bold_$ttf | |
}); | |
var _$_$ASSET_$_$fonts_$officinasansblack_$ttf = $hx_exports["__ASSET__fonts_officinasansblack_ttf"] = function() { | |
this.ascender = 723; | |
this.descender = -210; | |
this.height = 1256; | |
this.numGlyphs = 235; | |
this.underlinePosition = -100; | |
this.underlineThickness = 50; | |
this.unitsPerEM = 1000; | |
this.name = "OfficinaSansBlackC"; | |
lime_text_Font.call(this); | |
}; | |
$hxClasses["__ASSET__fonts_officinasansblack_ttf"] = _$_$ASSET_$_$fonts_$officinasansblack_$ttf; | |
_$_$ASSET_$_$fonts_$officinasansblack_$ttf.__name__ = ["__ASSET__fonts_officinasansblack_ttf"]; | |
_$_$ASSET_$_$fonts_$officinasansblack_$ttf.__super__ = lime_text_Font; | |
_$_$ASSET_$_$fonts_$officinasansblack_$ttf.prototype = $extend(lime_text_Font.prototype,{ | |
__class__: _$_$ASSET_$_$fonts_$officinasansblack_$ttf | |
}); | |
var openfl_text_Font = function(name) { | |
lime_text_Font.call(this,name); | |
}; | |
$hxClasses["openfl.text.Font"] = openfl_text_Font; | |
openfl_text_Font.__name__ = ["openfl","text","Font"]; | |
openfl_text_Font.enumerateFonts = function(enumerateDeviceFonts) { | |
if(enumerateDeviceFonts == null) { | |
enumerateDeviceFonts = false; | |
} | |
return openfl_text_Font.__registeredFonts; | |
}; | |
openfl_text_Font.getFontByName = function(name) { | |
var fullname = name; | |
var _this = openfl_text_Font.__fontByName; | |
if(__map_reserved[fullname] != null ? _this.existsReserved(fullname) : _this.h.hasOwnProperty(fullname)) { | |
var _this1 = openfl_text_Font.__fontByName; | |
if(__map_reserved[fullname] != null) { | |
return _this1.getReserved(fullname); | |
} else { | |
return _this1.h[fullname]; | |
} | |
} | |
var tmp; | |
var _this2 = openfl_text_Font.replaces; | |
if(__map_reserved[fullname] != null ? _this2.existsReserved(fullname) : _this2.h.hasOwnProperty(fullname)) { | |
var this1 = openfl_text_Font.__fontByName; | |
var _this3 = openfl_text_Font.replaces; | |
var key = __map_reserved[fullname] != null ? _this3.getReserved(fullname) : _this3.h[fullname]; | |
var _this4 = this1; | |
if(__map_reserved[key] != null) { | |
tmp = _this4.existsReserved(key); | |
} else { | |
tmp = _this4.h.hasOwnProperty(key); | |
} | |
} else { | |
tmp = false; | |
} | |
if(tmp) { | |
var this2 = openfl_text_Font.__fontByName; | |
var _this5 = openfl_text_Font.replaces; | |
var key1 = __map_reserved[fullname] != null ? _this5.getReserved(fullname) : _this5.h[fullname]; | |
var _this6 = this2; | |
if(__map_reserved[key1] != null) { | |
return _this6.getReserved(key1); | |
} else { | |
return _this6.h[key1]; | |
} | |
} | |
var family = fullname.split(" ")[0]; | |
var _this7 = openfl_text_Font.__fontByName; | |
if(__map_reserved[family] != null ? _this7.existsReserved(family) : _this7.h.hasOwnProperty(family)) { | |
var _this8 = openfl_text_Font.__fontByName; | |
if(__map_reserved[family] != null) { | |
return _this8.getReserved(family); | |
} else { | |
return _this8.h[family]; | |
} | |
} | |
var tmp1; | |
var _this9 = openfl_text_Font.replaces; | |
if(__map_reserved[family] != null ? _this9.existsReserved(family) : _this9.h.hasOwnProperty(family)) { | |
var this3 = openfl_text_Font.__fontByName; | |
var _this10 = openfl_text_Font.replaces; | |
var key2 = __map_reserved[family] != null ? _this10.getReserved(family) : _this10.h[family]; | |
var _this11 = this3; | |
if(__map_reserved[key2] != null) { | |
tmp1 = _this11.existsReserved(key2); | |
} else { | |
tmp1 = _this11.h.hasOwnProperty(key2); | |
} | |
} else { | |
tmp1 = false; | |
} | |
if(tmp1) { | |
var this4 = openfl_text_Font.__fontByName; | |
var _this12 = openfl_text_Font.replaces; | |
var key3 = __map_reserved[family] != null ? _this12.getReserved(family) : _this12.h[family]; | |
var _this13 = this4; | |
if(__map_reserved[key3] != null) { | |
return _this13.getReserved(key3); | |
} else { | |
return _this13.h[key3]; | |
} | |
} | |
return null; | |
}; | |
openfl_text_Font.fromBytes = function(bytes) { | |
var font = new openfl_text_Font(); | |
font.__fromBytes(openfl_utils__$ByteArray_ByteArray_$Impl_$.toBytes(bytes)); | |
return font; | |
}; | |
openfl_text_Font.fromFile = function(path) { | |
var font = new openfl_text_Font(); | |
font.__fromFile(path); | |
return font; | |
}; | |
openfl_text_Font.loadFromBytes = function(bytes) { | |
return lime_text_Font.loadFromBytes(openfl_utils__$ByteArray_ByteArray_$Impl_$.toBytes(bytes)).then(function(limeFont) { | |
var font = new openfl_text_Font(); | |
font.__fromLimeFont(limeFont); | |
return lime_app_Future.withValue(font); | |
}); | |
}; | |
openfl_text_Font.loadFromFile = function(path) { | |
return lime_text_Font.loadFromFile(path).then(function(limeFont) { | |
var font = new openfl_text_Font(); | |
font.__fromLimeFont(limeFont); | |
return lime_app_Future.withValue(font); | |
}); | |
}; | |
openfl_text_Font.loadFromName = function(path) { | |
return lime_text_Font.loadFromName(path).then(function(limeFont) { | |
var font = new openfl_text_Font(); | |
font.__fromLimeFont(limeFont); | |
return lime_app_Future.withValue(font); | |
}); | |
}; | |
openfl_text_Font.registerFont = function(font) { | |
var instance = null; | |
var o = font; | |
if((o == null ? null : js_Boot.getClass(o)) == null) { | |
instance = js_Boot.__cast(Type.createInstance(font,[]) , openfl_text_Font); | |
} else { | |
instance = js_Boot.__cast(font , openfl_text_Font); | |
} | |
if(instance != null) { | |
openfl_text_Font.__registeredFonts.push(instance); | |
var k = instance.name; | |
var _this = openfl_text_Font.__fontByName; | |
if(__map_reserved[k] != null) { | |
_this.setReserved(k,instance); | |
} else { | |
_this.h[k] = instance; | |
} | |
} | |
}; | |
openfl_text_Font.__super__ = lime_text_Font; | |
openfl_text_Font.prototype = $extend(lime_text_Font.prototype,{ | |
fontStyle: null | |
,fontType: null | |
,__initialized: null | |
,__fromLimeFont: function(font) { | |
this.__copyFrom(font); | |
} | |
,__initialize: function() { | |
return this.__initialized; | |
} | |
,get_fontName: function() { | |
return this.name; | |
} | |
,set_fontName: function(value) { | |
return this.name = value; | |
} | |
,__class__: openfl_text_Font | |
,__properties__: {set_fontName:"set_fontName",get_fontName:"get_fontName"} | |
}); | |
var _$_$ASSET_$_$OPENFL_$_$fonts_$officinaserifblackitc_$ttf = $hx_exports["__ASSET__OPENFL__fonts_officinaserifblackitc_ttf"] = function() { | |
this.__fromLimeFont(new _$_$ASSET_$_$fonts_$officinaserifblackitc_$ttf()); | |
openfl_text_Font.call(this); | |
}; | |
$hxClasses["__ASSET__OPENFL__fonts_officinaserifblackitc_ttf"] = _$_$ASSET_$_$OPENFL_$_$fonts_$officinaserifblackitc_$ttf; | |
_$_$ASSET_$_$OPENFL_$_$fonts_$officinaserifblackitc_$ttf.__name__ = ["__ASSET__OPENFL__fonts_officinaserifblackitc_ttf"]; | |
_$_$ASSET_$_$OPENFL_$_$fonts_$officinaserifblackitc_$ttf.__super__ = openfl_text_Font; | |
_$_$ASSET_$_$OPENFL_$_$fonts_$officinaserifblackitc_$ttf.prototype = $extend(openfl_text_Font.prototype,{ | |
__class__: _$_$ASSET_$_$OPENFL_$_$fonts_$officinaserifblackitc_$ttf | |
}); | |
var _$_$ASSET_$_$OPENFL_$_$fonts_$epicwar_$title_$ttf = $hx_exports["__ASSET__OPENFL__fonts_epicwar_title_ttf"] = function() { | |
this.__fromLimeFont(new _$_$ASSET_$_$fonts_$epicwar_$title_$ttf()); | |
openfl_text_Font.call(this); | |
}; | |
$hxClasses["__ASSET__OPENFL__fonts_epicwar_title_ttf"] = _$_$ASSET_$_$OPENFL_$_$fonts_$epicwar_$title_$ttf; | |
_$_$ASSET_$_$OPENFL_$_$fonts_$epicwar_$title_$ttf.__name__ = ["__ASSET__OPENFL__fonts_epicwar_title_ttf"]; | |
_$_$ASSET_$_$OPENFL_$_$fonts_$epicwar_$title_$ttf.__super__ = openfl_text_Font; | |
_$_$ASSET_$_$OPENFL_$_$fonts_$epicwar_$title_$ttf.prototype = $extend(openfl_text_Font.prototype,{ | |
__class__: _$_$ASSET_$_$OPENFL_$_$fonts_$epicwar_$title_$ttf | |
}); | |
var _$_$ASSET_$_$OPENFL_$_$fonts_$ozhandicraft_$ttf = $hx_exports["__ASSET__OPENFL__fonts_ozhandicraft_ttf"] = function() { | |
this.__fromLimeFont(new _$_$ASSET_$_$fonts_$ozhandicraft_$ttf()); | |
openfl_text_Font.call(this); | |
}; | |
$hxClasses["__ASSET__OPENFL__fonts_ozhandicraft_ttf"] = _$_$ASSET_$_$OPENFL_$_$fonts_$ozhandicraft_$ttf; | |
_$_$ASSET_$_$OPENFL_$_$fonts_$ozhandicraft_$ttf.__name__ = ["__ASSET__OPENFL__fonts_ozhandicraft_ttf"]; | |
_$_$ASSET_$_$OPENFL_$_$fonts_$ozhandicraft_$ttf.__super__ = openfl_text_Font; | |
_$_$ASSET_$_$OPENFL_$_$fonts_$ozhandicraft_$ttf.prototype = $extend(openfl_text_Font.prototype,{ | |
__class__: _$_$ASSET_$_$OPENFL_$_$fonts_$ozhandicraft_$ttf | |
}); | |
var _$_$ASSET_$_$OPENFL_$_$fonts_$roboto_$condensed_$regular_$ttf = $hx_exports["__ASSET__OPENFL__fonts_roboto_condensed_regular_ttf"] = function() { | |
this.__fromLimeFont(new _$_$ASSET_$_$fonts_$roboto_$condensed_$regular_$ttf()); | |
openfl_text_Font.call(this); | |
}; | |
$hxClasses["__ASSET__OPENFL__fonts_roboto_condensed_regular_ttf"] = _$_$ASSET_$_$OPENFL_$_$fonts_$roboto_$condensed_$regular_$ttf; | |
_$_$ASSET_$_$OPENFL_$_$fonts_$roboto_$condensed_$regular_$ttf.__name__ = ["__ASSET__OPENFL__fonts_roboto_condensed_regular_ttf"]; | |
_$_$ASSET_$_$OPENFL_$_$fonts_$roboto_$condensed_$regular_$ttf.__super__ = openfl_text_Font; | |
_$_$ASSET_$_$OPENFL_$_$fonts_$roboto_$condensed_$regular_$ttf.prototype = $extend(openfl_text_Font.prototype,{ | |
__class__: _$_$ASSET_$_$OPENFL_$_$fonts_$roboto_$condensed_$regular_$ttf | |
}); | |
var _$_$ASSET_$_$OPENFL_$_$fonts_$roboto_$condensed_$bold_$ttf = $hx_exports["__ASSET__OPENFL__fonts_roboto_condensed_bold_ttf"] = function() { | |
this.__fromLimeFont(new _$_$ASSET_$_$fonts_$roboto_$condensed_$bold_$ttf()); | |
openfl_text_Font.call(this); | |
}; | |
$hxClasses["__ASSET__OPENFL__fonts_roboto_condensed_bold_ttf"] = _$_$ASSET_$_$OPENFL_$_$fonts_$roboto_$condensed_$bold_$ttf; | |
_$_$ASSET_$_$OPENFL_$_$fonts_$roboto_$condensed_$bold_$ttf.__name__ = ["__ASSET__OPENFL__fonts_roboto_condensed_bold_ttf"]; | |
_$_$ASSET_$_$OPENFL_$_$fonts_$roboto_$condensed_$bold_$ttf.__super__ = openfl_text_Font; | |
_$_$ASSET_$_$OPENFL_$_$fonts_$roboto_$condensed_$bold_$ttf.prototype = $extend(openfl_text_Font.prototype,{ | |
__class__: _$_$ASSET_$_$OPENFL_$_$fonts_$roboto_$condensed_$bold_$ttf | |
}); | |
var _$_$ASSET_$_$OPENFL_$_$fonts_$officinasansblack_$ttf = $hx_exports["__ASSET__OPENFL__fonts_officinasansblack_ttf"] = function() { | |
this.__fromLimeFont(new _$_$ASSET_$_$fonts_$officinasansblack_$ttf()); | |
openfl_text_Font.call(this); | |
}; | |
$hxClasses["__ASSET__OPENFL__fonts_officinasansblack_ttf"] = _$_$ASSET_$_$OPENFL_$_$fonts_$officinasansblack_$ttf; | |
_$_$ASSET_$_$OPENFL_$_$fonts_$officinasansblack_$ttf.__name__ = ["__ASSET__OPENFL__fonts_officinasansblack_ttf"]; | |
_$_$ASSET_$_$OPENFL_$_$fonts_$officinasansblack_$ttf.__super__ = openfl_text_Font; | |
_$_$ASSET_$_$OPENFL_$_$fonts_$officinasansblack_$ttf.prototype = $extend(openfl_text_Font.prototype,{ | |
__class__: _$_$ASSET_$_$OPENFL_$_$fonts_$officinasansblack_$ttf | |
}); | |
Math.__name__ = ["Math"]; | |
var Misc = function() { | |
}; | |
$hxClasses["Misc"] = Misc; | |
Misc.__name__ = ["Misc"]; | |
Misc.prototype = { | |
__class__: Misc | |
}; | |
var Reflect = function() { }; | |
$hxClasses["Reflect"] = Reflect; | |
Reflect.__name__ = ["Reflect"]; | |
Reflect.field = function(o,field) { | |
try { | |
return o[field]; | |
} catch( e ) { | |
haxe_CallStack.lastException = e; | |
return null; | |
} | |
}; | |
Reflect.getProperty = function(o,field) { | |
var tmp; | |
if(o == null) { | |
return null; | |
} else { | |
var tmp1; | |
if(o.__properties__) { | |
tmp = o.__properties__["get_" + field]; | |
tmp1 = tmp; | |
} else { | |
tmp1 = false; | |
} | |
if(tmp1) { | |
return o[tmp](); | |
} else { | |
return o[field]; | |
} | |
} | |
}; | |
Reflect.setProperty = function(o,field,value) { | |
var tmp; | |
var tmp1; | |
if(o.__properties__) { | |
tmp = o.__properties__["set_" + field]; | |
tmp1 = tmp; | |
} else { | |
tmp1 = false; | |
} | |
if(tmp1) { | |
o[tmp](value); | |
} else { | |
o[field] = value; | |
} | |
}; | |
Reflect.fields = function(o) { | |
var a = []; | |
if(o != null) { | |
var hasOwnProperty = Object.prototype.hasOwnProperty; | |
for( var f in o ) { | |
if(f != "__id__" && f != "hx__closures__" && hasOwnProperty.call(o,f)) { | |
a.push(f); | |
} | |
} | |
} | |
return a; | |
}; | |
Reflect.isFunction = function(f) { | |
if(typeof(f) == "function") { | |
return !(f.__name__ || f.__ename__); | |
} else { | |
return false; | |
} | |
}; | |
Reflect.compare = function(a,b) { | |
if(a == b) { | |
return 0; | |
} else if(a > b) { | |
return 1; | |
} else { | |
return -1; | |
} | |
}; | |
Reflect.compareMethods = function(f1,f2) { | |
if(f1 == f2) { | |
return true; | |
} | |
if(!Reflect.isFunction(f1) || !Reflect.isFunction(f2)) { | |
return false; | |
} | |
if(f1.scope == f2.scope && f1.method == f2.method) { | |
return f1.method != null; | |
} else { | |
return false; | |
} | |
}; | |
Reflect.isEnumValue = function(v) { | |
if(v != null) { | |
return v.__enum__ != null; | |
} else { | |
return false; | |
} | |
}; | |
Reflect.deleteField = function(o,field) { | |
if(!Object.prototype.hasOwnProperty.call(o,field)) { | |
return false; | |
} | |
delete(o[field]); | |
return true; | |
}; | |
Reflect.makeVarArgs = function(f) { | |
return function() { | |
var a = Array.prototype.slice.call(arguments); | |
return f(a); | |
}; | |
}; | |
var StaticExt = function() { }; | |
$hxClasses["StaticExt"] = StaticExt; | |
StaticExt.__name__ = ["StaticExt"]; | |
StaticExt.toFloat = function(self) { | |
return (self.low + haxe__$Int32_Int32_$Impl_$._mul(self.high,2) | 0) ^ 32; | |
}; | |
StaticExt.setP = function(self,name,v) { | |
Reflect.setProperty(self,name,v); | |
return v; | |
}; | |
StaticExt.isEmpty = function(self) { | |
var k = $iterator(self)(); | |
while(k.hasNext()) { | |
var k1 = k.next(); | |
return false; | |
} | |
return true; | |
}; | |
StaticExt.count = function(self) { | |
var ret = 0; | |
var k = $iterator(self)(); | |
while(k.hasNext()) { | |
var k1 = k.next(); | |
++ret; | |
} | |
return ret; | |
}; | |
StaticExt.spliceV = function(self,pos,len,ins) { | |
var r = self.splice(pos,len); | |
if(ins != null) { | |
var _g1 = 0; | |
var _g = ins.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
self.insertAt(pos + i,ins[i]); | |
} | |
} | |
return r; | |
}; | |
StaticExt.pushMult = function(self,toPush) { | |
var v = $iterator(toPush)(); | |
while(v.hasNext()) { | |
var v1 = v.next(); | |
self.push(v1); | |
} | |
}; | |
StaticExt.pushMultV = function(self,toPush) { | |
var v = $iterator(toPush)(); | |
while(v.hasNext()) { | |
var v1 = v.next(); | |
self.push(v1); | |
} | |
}; | |
StaticExt.unshiftMult = function(self,toUnshift) { | |
var v = $iterator(toUnshift)(); | |
while(v.hasNext()) { | |
var v1 = v.next(); | |
self.unshift(v1); | |
} | |
}; | |
StaticExt.spliceA = function(self,pos,len,ins) { | |
var r = self.splice(pos,len); | |
if(ins != null) { | |
var _g1 = 0; | |
var _g = ins.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
self.splice(pos + i,0,ins[i]); | |
} | |
} | |
return r; | |
}; | |
StaticExt.reverseCopy = function(self) { | |
var r = []; | |
var _g = 0; | |
while(_g < self.length) { | |
var v = self[_g]; | |
++_g; | |
r.unshift(v); | |
} | |
return r; | |
}; | |
StaticExt.removeAll = function(self) { | |
self.length = 0; | |
}; | |
StaticExt.setLength = function(self,len) { | |
self.length = len; | |
}; | |
StaticExt.vectorView = function(self) { | |
var v = openfl__$Vector_Vector_$Impl_$.toNullVector(null); | |
v.data.__array = self; | |
return v; | |
}; | |
StaticExt.asVector = function(self,target) { | |
v.data.__array = target; | |
return target; | |
}; | |
StaticExt.jsSort = function(self) { | |
self.sort(); | |
}; | |
StaticExt.mergeSort = function(self,comparefn) { | |
var aux = self.slice(); | |
StaticExt.sortarrtoarr(self,aux,0,self.length - 1,comparefn); | |
return self; | |
}; | |
StaticExt.merge = function(arr,aux,lo,mid,hi,comparefn) { | |
var i = lo; | |
var j = mid + 1; | |
var k = lo; | |
while(true) { | |
var cmp = comparefn(arr[i],arr[j]); | |
if(cmp <= 0) { | |
aux[k++] = arr[i++]; | |
if(i > mid) { | |
while(true) { | |
aux[k++] = arr[j++]; | |
if(!(j <= hi)) { | |
break; | |
} | |
} | |
break; | |
} | |
} else { | |
aux[k++] = arr[j++]; | |
if(j > hi) { | |
while(true) { | |
aux[k++] = arr[i++]; | |
if(!(i <= mid)) { | |
break; | |
} | |
} | |
break; | |
} | |
} | |
} | |
}; | |
StaticExt.sortarrtoaux = function(arr,aux,lo,hi,comparefn) { | |
if(hi < lo) { | |
return; | |
} | |
if(hi == lo) { | |
aux[lo] = arr[lo]; | |
return; | |
} | |
var mid = Math.floor(lo + (hi - lo) / 2); | |
StaticExt.sortarrtoarr(arr,aux,lo,mid,comparefn); | |
StaticExt.sortarrtoarr(arr,aux,mid + 1,hi,comparefn); | |
var i = lo; | |
var j = mid + 1; | |
var k = lo; | |
while(true) { | |
var cmp = comparefn(arr[i],arr[j]); | |
if(cmp <= 0) { | |
aux[k++] = arr[i++]; | |
if(i > mid) { | |
while(true) { | |
aux[k++] = arr[j++]; | |
if(!(j <= hi)) { | |
break; | |
} | |
} | |
break; | |
} | |
} else { | |
aux[k++] = arr[j++]; | |
if(j > hi) { | |
while(true) { | |
aux[k++] = arr[i++]; | |
if(!(i <= mid)) { | |
break; | |
} | |
} | |
break; | |
} | |
} | |
} | |
}; | |
StaticExt.sortarrtoarr = function(arr,aux,lo,hi,comparefn) { | |
if(hi <= lo) { | |
return; | |
} | |
var mid = Math.floor(lo + (hi - lo) / 2); | |
StaticExt.sortarrtoaux(arr,aux,lo,mid,comparefn); | |
StaticExt.sortarrtoaux(arr,aux,mid + 1,hi,comparefn); | |
var i = lo; | |
var j = mid + 1; | |
var k = lo; | |
while(true) { | |
var cmp = comparefn(aux[i],aux[j]); | |
if(cmp <= 0) { | |
arr[k++] = aux[i++]; | |
if(i > mid) { | |
while(true) { | |
arr[k++] = aux[j++]; | |
if(!(j <= hi)) { | |
break; | |
} | |
} | |
break; | |
} | |
} else { | |
arr[k++] = aux[j++]; | |
if(j > hi) { | |
while(true) { | |
arr[k++] = aux[i++]; | |
if(!(i <= mid)) { | |
break; | |
} | |
} | |
break; | |
} | |
} | |
} | |
}; | |
StaticExt.quickSort = function(self,compareFn) { | |
StaticExt.qsort(self,0,self.length - 1,self.length,compareFn); | |
return self; | |
}; | |
StaticExt.qsort = function(arr,leftPos,rightPos,arrLength,compareFn) { | |
var initialLeftPos = leftPos; | |
var initialRightPos = rightPos; | |
var direction = true; | |
var pivot = rightPos; | |
while(leftPos - rightPos < 0) if(direction) { | |
if(compareFn(arr[pivot],arr[leftPos]) < 0) { | |
var swapedElem = arr[pivot]; | |
arr[pivot] = arr[leftPos]; | |
arr[leftPos] = swapedElem; | |
pivot = leftPos; | |
--rightPos; | |
direction = !direction; | |
} else { | |
++leftPos; | |
} | |
} else if(compareFn(arr[pivot],arr[rightPos]) <= 0) { | |
--rightPos; | |
} else { | |
var swapedElem1 = arr[pivot]; | |
arr[pivot] = arr[rightPos]; | |
arr[rightPos] = swapedElem1; | |
++leftPos; | |
pivot = rightPos; | |
direction = !direction; | |
} | |
if(pivot - 1 > initialLeftPos) { | |
StaticExt.qsort(arr,initialLeftPos,pivot - 1,arrLength,compareFn); | |
} | |
if(pivot + 1 < initialRightPos) { | |
StaticExt.qsort(arr,pivot + 1,initialRightPos,arrLength,compareFn); | |
} | |
}; | |
StaticExt.qsort_swap = function(arr,el1,el2) { | |
var swapedElem = arr[el1]; | |
arr[el1] = arr[el2]; | |
arr[el2] = swapedElem; | |
}; | |
StaticExt.imin = function(self,a,b) { | |
if(a > b) { | |
return b; | |
} else { | |
return a; | |
} | |
}; | |
StaticExt.imax = function(self,a,b) { | |
if(a > b) { | |
return a; | |
} else { | |
return b; | |
} | |
}; | |
StaticExt.fmin = function(self,a,b) { | |
if(a > b) { | |
return b; | |
} else { | |
return a; | |
} | |
}; | |
StaticExt.fmax = function(self,a,b) { | |
if(a > b) { | |
return a; | |
} else { | |
return b; | |
} | |
}; | |
StaticExt.imina = function(self,a) { | |
if(a.length == 0) { | |
throw new js__$Boot_HaxeError("imina: need more args"); | |
} | |
var r = a[0]; | |
var _g = 0; | |
while(_g < a.length) { | |
var i = a[_g]; | |
++_g; | |
r = StaticExt.imin(self,r,i); | |
} | |
return r; | |
}; | |
StaticExt.imaxa = function(self,a) { | |
if(a.length == 0) { | |
throw new js__$Boot_HaxeError("imaxa: need more args"); | |
} | |
var r = a[0]; | |
var _g = 0; | |
while(_g < a.length) { | |
var i = a[_g]; | |
++_g; | |
r = StaticExt.imax(self,r,i); | |
} | |
return r; | |
}; | |
StaticExt.fmina = function(self,a) { | |
if(a.length == 0) { | |
throw new js__$Boot_HaxeError("fmina: need more args"); | |
} | |
var r = a[0]; | |
var _g = 0; | |
while(_g < a.length) { | |
var i = a[_g]; | |
++_g; | |
r = StaticExt.fmin(self,r,i); | |
} | |
return r; | |
}; | |
StaticExt.fmaxa = function(self,a) { | |
if(a.length == 0) { | |
throw new js__$Boot_HaxeError("fmaxa: need more args"); | |
} | |
var r = a[0]; | |
var _g = 0; | |
while(_g < a.length) { | |
var i = a[_g]; | |
++_g; | |
r = StaticExt.fmax(self,r,i); | |
} | |
return r; | |
}; | |
StaticExt.ipow = function(self,a,n) { | |
var r = 1; | |
var _g1 = 0; | |
var _g = n; | |
while(_g1 < _g) { | |
var i = _g1++; | |
r *= a; | |
} | |
return r; | |
}; | |
StaticExt.fromCharCodes = function(self,codes) { | |
return String.fromCharCode.apply(null,codes); | |
}; | |
StaticExt.replace = function(self,str,reg,withStr) { | |
if(str != null) { | |
return StringTools.replace(self,str,withStr); | |
} else if(reg != null) { | |
return self.replace(reg.r,withStr); | |
} | |
throw new js__$Boot_HaxeError(new openfl_errors_Error("invalid str replace")); | |
}; | |
StaticExt.splitr = function(self,str,reg) { | |
if(str != null) { | |
return self.split(str); | |
} else if(reg != null) { | |
return reg.split(self); | |
} | |
throw new js__$Boot_HaxeError(new openfl_errors_Error("invalid str split")); | |
}; | |
StaticExt.match = function(self,str,reg) { | |
var matches = []; | |
if(str != null) { | |
var i = 0; | |
var l = str.length; | |
while(true) { | |
i = self.indexOf(str,i); | |
if(i == -1) { | |
break; | |
} | |
i += l; | |
matches.push(str); | |
} | |
} else if(reg != null) { | |
var i1 = 0; | |
while(reg.matchSub(self,i1)) { | |
matches.push(reg.matched(0)); | |
var mp = reg.matchedPos(); | |
i1 = mp.pos + mp.len; | |
} | |
} | |
if(matches.length == 0) { | |
return null; | |
} | |
return matches; | |
}; | |
StaticExt.search = function(self,str,reg) { | |
if(str != null) { | |
return self.indexOf(str,0); | |
} else if(reg != null) { | |
if(reg.match(self)) { | |
return reg.matchedPos().pos; | |
} | |
} | |
return -1; | |
}; | |
StaticExt.nullOrEmpty = function(self) { | |
if(self != null) { | |
return self == ""; | |
} else { | |
return true; | |
} | |
}; | |
StaticExt.toFixed = function(v,fractionDigits) { | |
return v.toFixed(fractionDigits); | |
}; | |
StaticExt.getTimer = function(self) { | |
return Math.round(new Date().getTime() / 1000 * 1000); | |
}; | |
StaticExt.setTimeout = function(self,closure,delay,value) { | |
return setTimeout(closure,delay,value); | |
}; | |
StaticExt.clearTimeout = function(self,id) { | |
clearTimeout(id); | |
}; | |
StaticExt.setInterval = function(self,closure,delay,value) { | |
return setInterval(closure,delay,value); | |
}; | |
StaticExt.clearInterval = function(self,id) { | |
clearInterval(id); | |
}; | |
StaticExt.kast = function(self,o,t,defaultValue) { | |
if(js_Boot.__instanceof(o,t)) { | |
return o; | |
} else { | |
return defaultValue; | |
} | |
}; | |
StaticExt.asArray = function(self,o,t,defaultValue) { | |
if(Array.isArray(o)) { | |
return o; | |
} else { | |
return defaultValue; | |
} | |
}; | |
StaticExt.asArrayDyn = function(self,o,defaultValue) { | |
if(Array.isArray(o)) { | |
return o; | |
} else { | |
return defaultValue; | |
} | |
}; | |
StaticExt.asFn = function(self,o,defaultValue) { | |
if(typeof(o) == "function") { | |
return o; | |
} else { | |
return defaultValue; | |
} | |
}; | |
StaticExt.asInt = function(self,o) { | |
if(o == null || o == false) { | |
return 0; | |
} else if(typeof(o) == "string") { | |
return Std.parseInt(o); | |
} | |
return o; | |
}; | |
StaticExt.nullIfEmptyStr = function(self,arg) { | |
if(arg == "") { | |
return null; | |
} else { | |
return arg; | |
} | |
}; | |
StaticExt["typeof"] = function(self,o) { | |
return typeof(o); | |
}; | |
StaticExt.toValues = function(self) { | |
if(Array.isArray(self)) { | |
return self; | |
} | |
var a = []; | |
if(self != null) { | |
for(var _i_ in self)if(self.hasOwnProperty(_i_))a.push(self[_i_]); | |
} | |
return a; | |
}; | |
StaticExt.isTextOrNull = function(self,v) { | |
if(v != null) { | |
return v + 1 + 2 != v + 2 + 1; | |
} else { | |
return true; | |
} | |
}; | |
StaticExt.release = function(self) { | |
}; | |
StaticExt.dispatchT1 = function(self,v0) { | |
if(self.defaultValue != null) { | |
self.defaultValue.v0 = v0; | |
self.dispatch(self.defaultValue); | |
} else { | |
self.dispatch(new utils_ds_tuple_Tup1(v0)); | |
} | |
}; | |
StaticExt.dispatchT2 = function(self,v0,v1) { | |
if(self.defaultValue != null) { | |
self.defaultValue.v0 = v0; | |
self.defaultValue.v1 = v1; | |
self.dispatch(self.defaultValue); | |
} else { | |
self.dispatch(new utils_ds_tuple_Tup2(v0,v1)); | |
} | |
}; | |
StaticExt.dispatchT3 = function(self,v0,v1,v2) { | |
if(self.defaultValue != null) { | |
self.defaultValue.v0 = v0; | |
self.defaultValue.v1 = v1; | |
self.defaultValue.v2 = v2; | |
self.dispatch(self.defaultValue); | |
} else { | |
self.dispatch(new utils_ds_tuple_Tup3(v0,v1,v2)); | |
} | |
}; | |
StaticExt.each = function(self,f) { | |
var k = new utils_ds_JSIterator(self.keys()); | |
while(k.hasNext()) { | |
var k1 = k.next(); | |
f(k1); | |
} | |
}; | |
StaticExt.toArray = function(self,target) { | |
return utils_MathUtil.setToArray(self,target); | |
}; | |
StaticExt.collect = function(self,func,target) { | |
var item = $iterator(utils_ds__$JSMap_JSMap_$Impl_$)(self); | |
while(item.hasNext()) { | |
var item1 = item.next(); | |
if(func(item1)) { | |
target.push(item1); | |
} | |
} | |
}; | |
StaticExt.jsSetToArray = function(self,target) { | |
var a1 = target; | |
self.forEach(function(a2,a3,a4) { | |
StaticExt.pushStuff(a1,a2,a3,a4); | |
},null); | |
return target; | |
}; | |
StaticExt.pushStuff = function(target,arg,arg2,arg3) { | |
target.push(arg); | |
}; | |
StaticExt.map = function(self,f,ret) { | |
var k = new utils_ds_JSIterator(self.keys()); | |
while(k.hasNext()) { | |
var k1 = k.next(); | |
var v = f(k1); | |
ret.set(k1,v); | |
} | |
return ret; | |
}; | |
StaticExt.mapToSet = function(self,f,ret) { | |
var k = new utils_ds_JSIterator(self.keys()); | |
while(k.hasNext()) { | |
var k1 = k.next(); | |
ret.add(f(k1)); | |
} | |
return ret; | |
}; | |
StaticExt.setProgramConstantsFromArray = function(self,programType,firstRegister,a,numRegisters) { | |
if(numRegisters == null) { | |
numRegisters = -1; | |
} | |
StaticExt.__tmpFloatVec.data.__array = a; | |
self.setProgramConstantsFromVector(programType,firstRegister,StaticExt.__tmpFloatVec,numRegisters); | |
}; | |
StaticExt.fixUrl = function(self,path) { | |
if(HxOverrides.substr(path,0,"https:".length) != "https:") { | |
return "https:" + path; | |
} | |
return path; | |
}; | |
StaticExt.toPool = function(self,inst) { | |
self.push(inst); | |
}; | |
StaticExt.fromPool = function(self,cls) { | |
var inst = self.length > 0 ? self.pop() : Type.createInstance(cls,StaticExt.__noarg); | |
return inst; | |
}; | |
StaticExt.prototype = { | |
__poolInstance: function(pool) { | |
} | |
,__class__: StaticExt | |
}; | |
var Std = function() { }; | |
$hxClasses["Std"] = Std; | |
Std.__name__ = ["Std"]; | |
Std["is"] = function(v,t) { | |
return js_Boot.__instanceof(v,t); | |
}; | |
Std.instance = function(value,c) { | |
if((value instanceof c)) { | |
return value; | |
} else { | |
return null; | |
} | |
}; | |
Std.string = function(s) { | |
return js_Boot.__string_rec(s,""); | |
}; | |
Std["int"] = function(x) { | |
return x | 0; | |
}; | |
Std.parseInt = function(x) { | |
var v = parseInt(x,10); | |
if(v == 0 && (HxOverrides.cca(x,1) == 120 || HxOverrides.cca(x,1) == 88)) { | |
v = parseInt(x); | |
} | |
if(isNaN(v)) { | |
return null; | |
} | |
return v; | |
}; | |
Std.parseFloat = function(x) { | |
return parseFloat(x); | |
}; | |
Std.random = function(x) { | |
if(x <= 0) { | |
return 0; | |
} else { | |
return Math.floor(Math.random() * x); | |
} | |
}; | |
var StringBuf = function() { | |
this.b = ""; | |
}; | |
$hxClasses["StringBuf"] = StringBuf; | |
StringBuf.__name__ = ["StringBuf"]; | |
StringBuf.prototype = { | |
b: null | |
,__class__: StringBuf | |
}; | |
var StringTools = function() { }; | |
$hxClasses["StringTools"] = StringTools; | |
StringTools.__name__ = ["StringTools"]; | |
StringTools.htmlEscape = function(s,quotes) { | |
s = s.split("&").join("&").split("<").join("<").split(">").join(">"); | |
if(quotes) { | |
return s.split("\"").join(""").split("'").join("'"); | |
} else { | |
return s; | |
} | |
}; | |
StringTools.startsWith = function(s,start) { | |
if(s.length >= start.length) { | |
return HxOverrides.substr(s,0,start.length) == start; | |
} else { | |
return false; | |
} | |
}; | |
StringTools.endsWith = function(s,end) { | |
var elen = end.length; | |
var slen = s.length; | |
if(slen >= elen) { | |
return HxOverrides.substr(s,slen - elen,elen) == end; | |
} else { | |
return false; | |
} | |
}; | |
StringTools.isSpace = function(s,pos) { | |
var c = HxOverrides.cca(s,pos); | |
if(!(c > 8 && c < 14)) { | |
return c == 32; | |
} else { | |
return true; | |
} | |
}; | |
StringTools.ltrim = function(s) { | |
var l = s.length; | |
var r = 0; | |
while(r < l && StringTools.isSpace(s,r)) ++r; | |
if(r > 0) { | |
return HxOverrides.substr(s,r,l - r); | |
} else { | |
return s; | |
} | |
}; | |
StringTools.rtrim = function(s) { | |
var l = s.length; | |
var r = 0; | |
while(r < l && StringTools.isSpace(s,l - r - 1)) ++r; | |
if(r > 0) { | |
return HxOverrides.substr(s,0,l - r); | |
} else { | |
return s; | |
} | |
}; | |
StringTools.trim = function(s) { | |
return StringTools.ltrim(StringTools.rtrim(s)); | |
}; | |
StringTools.replace = function(s,sub,by) { | |
return s.split(sub).join(by); | |
}; | |
StringTools.hex = function(n,digits) { | |
var s = ""; | |
var hexChars = "0123456789ABCDEF"; | |
while(true) { | |
s = hexChars.charAt(n & 15) + s; | |
n >>>= 4; | |
if(!(n > 0)) { | |
break; | |
} | |
} | |
if(digits != null) { | |
while(s.length < digits) s = "0" + s; | |
} | |
return s; | |
}; | |
var openfl_display_MovieClip = function() { | |
openfl_display_Sprite.call(this); | |
this.__currentFrame = 1; | |
this.__currentLabels = []; | |
this.__instanceFields = []; | |
this.__totalFrames = 0; | |
this.__enabled = true; | |
if(openfl_display_MovieClip.__constructor != null) { | |
var method = openfl_display_MovieClip.__constructor; | |
openfl_display_MovieClip.__constructor = null; | |
method(this); | |
} else if(openfl_display_MovieClip.__initSymbol != null) { | |
this.__swf = openfl_display_MovieClip.__initSWF; | |
this.__symbol = openfl_display_MovieClip.__initSymbol; | |
this.__frameObject = openfl_display_MovieClip.__initFrameObject; | |
openfl_display_MovieClip.__initSWF = null; | |
openfl_display_MovieClip.__initSymbol = null; | |
openfl_display_MovieClip.__initFrameObject = null; | |
this.__fromSymbol(this.__swf,this.__symbol); | |
} | |
}; | |
$hxClasses["openfl.display.MovieClip"] = openfl_display_MovieClip; | |
openfl_display_MovieClip.__name__ = ["openfl","display","MovieClip"]; | |
openfl_display_MovieClip.__constructor = null; | |
openfl_display_MovieClip.__initSWF = null; | |
openfl_display_MovieClip.__initSymbol = null; | |
openfl_display_MovieClip.__initFrameObject = null; | |
openfl_display_MovieClip.__topLevelCtor = null; | |
openfl_display_MovieClip.__mcFields = null; | |
openfl_display_MovieClip.__super__ = openfl_display_Sprite; | |
openfl_display_MovieClip.prototype = $extend(openfl_display_Sprite.prototype,{ | |
__activeInstances: null | |
,__activeInstancesByFrameObjectID: null | |
,__currentFrame: null | |
,__currentFrameLabel: null | |
,__currentLabel: null | |
,__currentLabels: null | |
,__enabled: null | |
,__frameScripts: null | |
,__frameTime: null | |
,__hasDown: null | |
,__hasOver: null | |
,__hasUp: null | |
,__instanceFields: null | |
,__lastFrameScriptEval: null | |
,__lastFrameUpdate: null | |
,__mouseIsDown: null | |
,__playing: null | |
,__swf: null | |
,__symbol: null | |
,__frameObject: null | |
,__timeElapsed: null | |
,__totalFrames: null | |
,cloneFromSymbol: function() { | |
return this.__symbol.__createObject(this.__swf); | |
} | |
,getFrameChild: function(name) { | |
if(this.__symbol != null) { | |
var fr = this.__symbol.frames[this.__currentFrame - 1]; | |
if(fr.objects == null) { | |
return null; | |
} | |
var _g = 0; | |
var _g1 = fr.objects; | |
while(_g < _g1.length) { | |
var o = _g1[_g]; | |
++_g; | |
if(o.name == name) { | |
var inst = this.__activeInstancesByFrameObjectID.h[o.id]; | |
if(inst != null && inst.bracketLink == null) { | |
throw new js__$Boot_HaxeError(">>Frame link missing: " + name); | |
} | |
if(inst != null) { | |
return inst.bracketLink; | |
} else { | |
return null; | |
} | |
} | |
} | |
} | |
return null; | |
} | |
,addFrameScript: function(index,method) { | |
if(index < 0) { | |
return; | |
} | |
var frame = index + 1; | |
if(method != null) { | |
if(this.__frameScripts == null) { | |
this.__frameScripts = new haxe_ds_IntMap(); | |
} | |
this.__frameScripts.h[frame] = method; | |
} else if(this.__frameScripts != null) { | |
this.__frameScripts.remove(frame); | |
} | |
} | |
,gotoAndPlay: function(frame,scene) { | |
this.play(); | |
this.__goto(this.__resolveFrameReference(frame)); | |
} | |
,gotoAndStop: function(frame,scene) { | |
this.stop(); | |
this.__goto(this.__resolveFrameReference(frame)); | |
} | |
,nextFrame: function() { | |
this.stop(); | |
this.__goto(this.__currentFrame + 1); | |
} | |
,play: function() { | |
if(this.__symbol == null || this.__playing || this.__totalFrames < 2) { | |
return; | |
} | |
this.__updateEnterFrameListeners(1); | |
this.__playing = true; | |
} | |
,prevFrame: function() { | |
this.stop(); | |
this.__goto(this.__currentFrame - 1); | |
} | |
,stop: function() { | |
if(this.__playing) { | |
this.__updateEnterFrameListeners(-1); | |
this.__playing = false; | |
} | |
} | |
,__initFrame: function() { | |
this.__updateFrameScript(0); | |
this.__updateSymbol(this.__currentFrame); | |
openfl_display_Sprite.prototype.__initFrame.call(this); | |
} | |
,__enterFrame: function(deltaTime) { | |
this.__updateFrameScript(deltaTime); | |
this.__updateSymbol(this.__currentFrame); | |
openfl_display_Sprite.prototype.__enterFrame.call(this,deltaTime); | |
} | |
,__updateFrameScript: function(deltaTime) { | |
if(this.__symbol != null && this.__playing) { | |
var nextFrame = this.__getNextFrame(deltaTime); | |
if(this.__lastFrameScriptEval == nextFrame) { | |
return; | |
} | |
if(this.__frameScripts != null) { | |
if(nextFrame < this.__currentFrame) { | |
if(!this.__evaluateFrameScripts(this.__totalFrames)) { | |
return; | |
} | |
this.__currentFrame = 1; | |
} | |
if(!this.__evaluateFrameScripts(nextFrame)) { | |
return; | |
} | |
} else { | |
this.__currentFrame = nextFrame; | |
} | |
} | |
} | |
,__initTimeline: function() { | |
if(this.__symbol != null) { | |
this.__activeInstances = []; | |
var currentInstances = new haxe_ds_IntMap(); | |
var frameData; | |
var frame; | |
var instance; | |
var nframes = this.__symbol.frames.length; | |
var _g1 = 0; | |
var _g = nframes; | |
while(_g1 < _g) { | |
var i = _g1++; | |
frame = i + 1; | |
frameData = this.__symbol.frames[i]; | |
if(frameData != null && frameData.objects != null) { | |
var _g2 = 0; | |
var _g3 = frameData.objects; | |
while(_g2 < _g3.length) { | |
var frameObject = _g3[_g2]; | |
++_g2; | |
var _g4 = frameObject.type; | |
switch(_g4[1]) { | |
case 0: | |
instance = new openfl_display_FrameSymbolInstance(frame,frameObject.id,frameObject.symbol,frameObject.depth,frameObject.clipDepth); | |
instance.frames.push(frameObject); | |
instance.keys.push(frame); | |
instance.killFrame = nframes + 1; | |
currentInstances.h[frameObject.id] = instance; | |
this.__activeInstancesByFrameObjectID.set(frameObject.id,instance); | |
this.__activeInstances.push(instance); | |
break; | |
case 1: | |
instance = currentInstances.h[frameObject.id]; | |
instance.frames.push(frameObject); | |
instance.keys.push(frame); | |
break; | |
case 2: | |
instance = currentInstances.h[frameObject.id]; | |
instance.killFrame = frame; | |
break; | |
} | |
} | |
} | |
} | |
} | |
} | |
,__updateSymbol: function(targetFrame) { | |
if(this.__symbol != null && this.__currentFrame != this.__lastFrameUpdate) { | |
this.__updateFrameLabel(); | |
var currentInstances = []; | |
var currentMasks = []; | |
var forward = this.__currentFrame > this.__lastFrameUpdate; | |
var prevOwner = openfl_display_DisplayObject.__timelineOwner; | |
openfl_display_DisplayObject.__timelineOwner = this; | |
var _g = 0; | |
var _g1 = this.__activeInstances; | |
while(_g < _g1.length) { | |
var inst = _g1[_g]; | |
++_g; | |
if(inst.initFrame <= targetFrame && inst.killFrame > targetFrame) { | |
if(inst.displayObject == null && (!forward || inst.state != 3)) { | |
var symbol = this.__swf.symbols.h[inst.characterID]; | |
if(symbol != null) { | |
openfl_display_MovieClip.__initFrameObject = inst.frames[0]; | |
if(js_Boot.__instanceof(symbol,openfl__$internal_symbols_DynamicTextSymbol)) { | |
(js_Boot.__cast(symbol , openfl__$internal_symbols_DynamicTextSymbol)).name = openfl_display_MovieClip.__initFrameObject.name; | |
} | |
var d = symbol.__createObject(this.__swf); | |
inst.bracketLink = inst.displayObject = d; | |
d.__fsi = inst; | |
inst.state = 1; | |
} | |
} | |
if(inst.displayObject != null && inst.state != 2) { | |
var i = 0; | |
while(inst.keys[i] <= targetFrame) { | |
this.__updateDisplayObject(inst.displayObject,inst.frames[i],i == 0); | |
++i; | |
} | |
} | |
currentInstances.push(inst); | |
if(inst.clipDepth > 0) { | |
currentMasks.push(inst); | |
} | |
} | |
} | |
currentInstances.sort($bind(this,this.__sortDepths)); | |
var existingChild; | |
var targetDepth; | |
var targetChild; | |
var child; | |
var maskApplied; | |
var instance; | |
var d1 = 0; | |
var _g11 = 0; | |
var _g2 = currentInstances.length; | |
while(_g11 < _g2) { | |
var i1 = _g11++; | |
existingChild = this.__children[d1]; | |
instance = currentInstances[i1]; | |
if(instance.displayObject == null) { | |
if(existingChild != null) { | |
++d1; | |
} | |
continue; | |
} | |
targetDepth = instance.depth; | |
targetChild = instance.displayObject; | |
if(existingChild != targetChild) { | |
if(targetChild.parent == this && targetChild.stage != this.stage) { | |
targetChild.__setStageReference(this.stage); | |
} | |
child = targetChild; | |
this.addChildAt(targetChild,d1); | |
} else { | |
child = existingChild; | |
} | |
++d1; | |
maskApplied = false; | |
var _g21 = 0; | |
while(_g21 < currentMasks.length) { | |
var mask = currentMasks[_g21]; | |
++_g21; | |
if(targetDepth > mask.depth && targetDepth <= mask.clipDepth) { | |
child.set_mask(mask.displayObject); | |
maskApplied = true; | |
break; | |
} | |
} | |
if(currentMasks.length > 0 && !maskApplied && child.get_mask() != null) { | |
child.set_mask(null); | |
} | |
} | |
var child1; | |
var fsi; | |
var i2 = this.__children.length - 1; | |
while(i2 >= 0) { | |
child1 = this.__children[i2]; | |
fsi = child1.__fsi; | |
if(fsi != null && (fsi.initFrame > targetFrame || fsi.killFrame <= targetFrame)) { | |
if(js_Boot.__instanceof(child1,openfl_display_MovieClip)) { | |
var movie = child1; | |
movie.__lastFrameUpdate = null; | |
movie.__lastFrameScriptEval = null; | |
movie.gotoAndPlay(1); | |
} | |
child1.__serial = openfl_display_DisplayObject.__serials++; | |
this.removeChild(child1); | |
} | |
--i2; | |
} | |
this.__lastFrameUpdate = this.__currentFrame; | |
openfl_display_DisplayObject.__timelineOwner = prevOwner; | |
this.__updateInstanceFields(); | |
} | |
} | |
,__evaluateFrameScripts: function(advanceToFrame) { | |
var _g1 = this.__currentFrame; | |
var _g = advanceToFrame + 1; | |
while(_g1 < _g) { | |
var frame = _g1++; | |
if(frame == this.__lastFrameScriptEval) { | |
continue; | |
} | |
this.__lastFrameScriptEval = frame; | |
this.__currentFrame = frame; | |
if(this.__frameScripts.h.hasOwnProperty(frame)) { | |
this.__updateSymbol(frame); | |
var script = this.__frameScripts.h[frame]; | |
script(); | |
if(this.__currentFrame != frame) { | |
return false; | |
} | |
} | |
if(!this.__playing) { | |
return false; | |
} | |
} | |
return true; | |
} | |
,__fromSymbol: function(swf,symbol) { | |
var _gthis = this; | |
if(this.__activeInstances != null) { | |
return; | |
} | |
this.__swf = swf; | |
this.__symbol = symbol; | |
this.__activeInstances = []; | |
this.__activeInstancesByFrameObjectID = new haxe_ds_IntMap(); | |
this.__currentFrame = 1; | |
this.__lastFrameScriptEval = -1; | |
this.__lastFrameUpdate = -1; | |
this.__totalFrames = this.__symbol.frames.length; | |
var frame; | |
var frameData; | |
var _g1 = 0; | |
var _g = this.__symbol.frames.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
frame = i + 1; | |
frameData = this.__symbol.frames[i]; | |
if(frameData.label != null) { | |
this.__currentLabels.push(new openfl_display_FrameLabel(frameData.label,i + 1)); | |
} | |
if(frameData.script != null) { | |
if(this.__frameScripts == null) { | |
this.__frameScripts = new haxe_ds_IntMap(); | |
} | |
this.__frameScripts.h[frame] = frameData.script; | |
} else if(frameData.scriptSource != null) { | |
if(this.__frameScripts == null) { | |
this.__frameScripts = new haxe_ds_IntMap(); | |
} | |
try { | |
var script = [eval("(function(){" + frameData.scriptSource + "})")]; | |
var wrapper = (function(script1) { | |
return function() { | |
try { | |
script1[0].call(_gthis); | |
} catch( e ) { | |
haxe_CallStack.lastException = e; | |
if (e instanceof js__$Boot_HaxeError) e = e.val; | |
lime_utils_Log.info("Error evaluating frame script\n " + Std.string(e) + "\n" + haxe_CallStack.exceptionStack().map((function() { | |
return function(a) { | |
return a[2]; | |
}; | |
})()).join("\n") + "\n" + Std.string(e.stack) + "\n" + script1[0].toString(),{ fileName : "MovieClip.hx", lineNumber : 767, className : "openfl.display.MovieClip", methodName : "__fromSymbol"}); | |
} | |
}; | |
})(script); | |
this.__frameScripts.h[frame] = wrapper; | |
} catch( e1 ) { | |
haxe_CallStack.lastException = e1; | |
if(this.__symbol.className != null) { | |
lime_utils_Log.warn("Unable to evaluate frame script source for symbol \"" + this.__symbol.className + "\" frame " + frame + "\n" + frameData.scriptSource,{ fileName : "MovieClip.hx", lineNumber : 788, className : "openfl.display.MovieClip", methodName : "__fromSymbol"}); | |
} else { | |
lime_utils_Log.warn("Unable to evaluate frame script source:\n" + frameData.scriptSource,{ fileName : "MovieClip.hx", lineNumber : 793, className : "openfl.display.MovieClip", methodName : "__fromSymbol"}); | |
} | |
} | |
} | |
} | |
this.__initTimeline(); | |
if(this.__totalFrames > 1) { | |
this.play(); | |
} | |
if(!openfl_display_MovieClip.__topLevelCtor) { | |
openfl_display_MovieClip.__topLevelCtor = true; | |
this.__initFrame(); | |
openfl_display_MovieClip.__topLevelCtor = false; | |
} | |
this.__instanceFields = this.getInstanceFields(); | |
this.__updateInstanceFields(); | |
} | |
,getInstanceFields: function() { | |
var cls = js_Boot.getClass(this); | |
if(cls == openfl_display_MovieClip) { | |
if(openfl_display_MovieClip.__mcFields == null) { | |
openfl_display_MovieClip.__mcFields = Type.getInstanceFields(cls); | |
} | |
return openfl_display_MovieClip.__mcFields; | |
} | |
return Type.getInstanceFields(cls); | |
} | |
,__getNextFrame: function(deltaTime) { | |
var nextFrame = 0; | |
nextFrame = this.__currentFrame + (deltaTime > 0 ? 1 : 0); | |
if(nextFrame > this.__totalFrames) { | |
nextFrame = 1; | |
} | |
return nextFrame; | |
} | |
,__goto: function(frame) { | |
if(this.__symbol == null) { | |
return; | |
} | |
if(frame < 1) { | |
frame = 1; | |
} else if(frame > this.__totalFrames) { | |
frame = this.__totalFrames; | |
} | |
this.__currentFrame = frame; | |
this.__enterFrame(0); | |
} | |
,__resolveFrameReference: function(frame) { | |
if(typeof(frame) == "number" && ((frame | 0) === frame)) { | |
return frame; | |
} else if(typeof(frame) == "string") { | |
var label = frame; | |
var _g = 0; | |
var _g1 = this.__currentLabels; | |
while(_g < _g1.length) { | |
var frameLabel = _g1[_g]; | |
++_g; | |
if(frameLabel.get_name() == label) { | |
return frameLabel.get_frame(); | |
} | |
} | |
throw new js__$Boot_HaxeError(new openfl_errors_ArgumentError("Error #2109: Frame label " + label + " not found in scene.")); | |
} else { | |
throw new js__$Boot_HaxeError("Invalid type for frame " + Type.getClassName(frame)); | |
} | |
} | |
,__sortDepths: function(a,b) { | |
return a.depth - b.depth; | |
} | |
,__stopAllMovieClips: function() { | |
openfl_display_Sprite.prototype.__stopAllMovieClips.call(this); | |
this.stop(); | |
} | |
,__tabTest: function(stack) { | |
if(!this.__enabled) { | |
return; | |
} | |
openfl_display_Sprite.prototype.__tabTest.call(this,stack); | |
} | |
,__updateDisplayObject: function(displayObject,frameObject,reset) { | |
if(reset == null) { | |
reset = false; | |
} | |
if(displayObject == null) { | |
return; | |
} | |
if(frameObject.name != null) { | |
displayObject.set_name(frameObject.name); | |
} | |
if(frameObject.matrix != null) { | |
displayObject.get_transform().set_matrix(frameObject.matrix); | |
} | |
if(frameObject.colorTransform != null) { | |
displayObject.get_transform().set_colorTransform(frameObject.colorTransform); | |
} else if(reset && !displayObject.get_transform().get_colorTransform().__isDefault(true)) { | |
displayObject.get_transform().set_colorTransform(new openfl_geom_ColorTransform()); | |
} | |
if(frameObject.filters != null) { | |
var filters = []; | |
var _g = 0; | |
var _g1 = frameObject.filters; | |
while(_g < _g1.length) { | |
var filter = _g1[_g]; | |
++_g; | |
switch(filter[1]) { | |
case 0: | |
var quality = filter[4]; | |
var blurY = filter[3]; | |
var blurX = filter[2]; | |
filters.push(new openfl_filters_BlurFilter(blurX,blurY,quality)); | |
break; | |
case 1: | |
var matrix = filter[2]; | |
filters.push(new openfl_filters_ColorMatrixFilter(matrix)); | |
break; | |
case 2: | |
var hideObject = filter[12]; | |
var knockout = filter[11]; | |
var inner = filter[10]; | |
var quality1 = filter[9]; | |
var strength = filter[8]; | |
var blurY1 = filter[7]; | |
var blurX1 = filter[6]; | |
var alpha = filter[5]; | |
var color = filter[4]; | |
var angle = filter[3]; | |
var distance = filter[2]; | |
filters.push(new openfl_filters_DropShadowFilter(distance,angle,color,alpha,blurX1,blurY1,strength,quality1,inner,knockout,hideObject)); | |
break; | |
case 3: | |
var knockout1 = filter[9]; | |
var inner1 = filter[8]; | |
var quality2 = filter[7]; | |
var strength1 = filter[6]; | |
var blurY2 = filter[5]; | |
var blurX2 = filter[4]; | |
var alpha1 = filter[3]; | |
var color1 = filter[2]; | |
filters.push(new openfl_filters_GlowFilter(color1,alpha1,blurX2,blurY2,strength1,quality2,inner1,knockout1)); | |
break; | |
} | |
} | |
displayObject.set_filters(filters); | |
} else { | |
displayObject.set_filters(null); | |
} | |
if(frameObject.visible != null) { | |
displayObject.set_visible(frameObject.visible); | |
} | |
if(frameObject.blendMode != null) { | |
displayObject.set_blendMode(frameObject.blendMode); | |
} | |
if(frameObject.cacheAsBitmap != null) { | |
displayObject.set_cacheAsBitmap(frameObject.cacheAsBitmap); | |
} | |
} | |
,__updateFrameLabel: function() { | |
this.__currentFrameLabel = this.__symbol.frames[this.__currentFrame - 1].label; | |
if(this.__currentFrameLabel != null) { | |
this.__currentLabel = this.__currentFrameLabel; | |
} else { | |
this.__currentLabel = null; | |
var _g = 0; | |
var _g1 = this.__currentLabels; | |
while(_g < _g1.length) { | |
var label = _g1[_g]; | |
++_g; | |
if(label.get_frame() < this.__currentFrame) { | |
this.__currentLabel = label.get_name(); | |
} else { | |
break; | |
} | |
} | |
} | |
} | |
,__updateInstanceFields: function() { | |
var _g = 0; | |
var _g1 = this.__instanceFields; | |
while(_g < _g1.length) { | |
var field = _g1[_g]; | |
++_g; | |
var _g2 = 0; | |
var _g3 = this.__children; | |
while(_g2 < _g3.length) { | |
var child = _g3[_g2]; | |
++_g2; | |
if(child.get_name() == field) { | |
this[field] = child; | |
break; | |
} | |
} | |
} | |
} | |
,__onMouseDown: function(event) { | |
if(this.__enabled && this.__hasDown) { | |
this.gotoAndStop("_down"); | |
} | |
this.__mouseIsDown = true; | |
this.stage.addEventListener("mouseUp",$bind(this,this.__onMouseUp),true); | |
} | |
,__onMouseUp: function(event) { | |
this.__mouseIsDown = false; | |
if(this.stage != null) { | |
this.stage.removeEventListener("mouseUp",$bind(this,this.__onMouseUp)); | |
} | |
if(event.target == this && this.__enabled && this.__hasOver) { | |
this.gotoAndStop("_over"); | |
} else if(this.__enabled && this.__hasUp) { | |
this.gotoAndStop("_up"); | |
} | |
} | |
,__onRollOut: function(event) { | |
if(!this.__enabled) { | |
return; | |
} | |
if(this.__mouseIsDown && this.__hasOver) { | |
this.gotoAndStop("_over"); | |
} else if(this.__hasUp) { | |
this.gotoAndStop("_up"); | |
} | |
} | |
,__onRollOver: function(event) { | |
if(this.__enabled && this.__hasOver) { | |
this.gotoAndStop("_over"); | |
} | |
} | |
,set_buttonMode: function(value) { | |
if(this.__buttonMode != value) { | |
if(value) { | |
this.__hasDown = false; | |
this.__hasOver = false; | |
this.__hasUp = false; | |
var _g = 0; | |
var _g1 = this.__currentLabels; | |
while(_g < _g1.length) { | |
var frameLabel = _g1[_g]; | |
++_g; | |
var _g2 = frameLabel.get_name(); | |
switch(_g2) { | |
case "_down": | |
this.__hasDown = true; | |
break; | |
case "_over": | |
this.__hasOver = true; | |
break; | |
case "_up": | |
this.__hasUp = true; | |
break; | |
default: | |
} | |
} | |
if(this.__hasDown || this.__hasOver || this.__hasUp) { | |
this.addEventListener("rollOver",$bind(this,this.__onRollOver)); | |
this.addEventListener("rollOut",$bind(this,this.__onRollOut)); | |
this.addEventListener("mouseDown",$bind(this,this.__onMouseDown)); | |
} | |
} else { | |
this.removeEventListener("rollOver",$bind(this,this.__onRollOver)); | |
this.removeEventListener("rollOut",$bind(this,this.__onRollOut)); | |
this.removeEventListener("mouseDown",$bind(this,this.__onMouseDown)); | |
} | |
this.__buttonMode = value; | |
} | |
return value; | |
} | |
,get_currentFrame: function() { | |
return this.__currentFrame; | |
} | |
,get_currentFrameLabel: function() { | |
return this.__currentFrameLabel; | |
} | |
,get_currentLabel: function() { | |
return this.__currentLabel; | |
} | |
,get_currentLabels: function() { | |
return this.__currentLabels; | |
} | |
,get_enabled: function() { | |
return this.__enabled; | |
} | |
,set_enabled: function(value) { | |
return this.__enabled = value; | |
} | |
,get_framesLoaded: function() { | |
return this.__totalFrames; | |
} | |
,get_isPlaying: function() { | |
return this.__playing; | |
} | |
,get_totalFrames: function() { | |
return this.__totalFrames; | |
} | |
,__class__: openfl_display_MovieClip | |
,__properties__: $extend(openfl_display_Sprite.prototype.__properties__,{get_totalFrames:"get_totalFrames",get_isPlaying:"get_isPlaying",get_framesLoaded:"get_framesLoaded",set_enabled:"set_enabled",get_enabled:"get_enabled",get_currentLabels:"get_currentLabels",get_currentLabel:"get_currentLabel",get_currentFrameLabel:"get_currentFrameLabel",get_currentFrame:"get_currentFrame"}) | |
}); | |
var com_progrestar_common_lang_Lang = function() { | |
this.M_PATTERN = new EReg("\\$m\\(.*?|.*?|.*?\\)","g"); | |
this.TRIGGER_PATTERN = new EReg("\\$([a-z])([^\\(]*)\\(([^\\(\\)]+?)\\)","ig"); | |
openfl_display_MovieClip.call(this); | |
}; | |
$hxClasses["com.progrestar.common.lang.Lang"] = com_progrestar_common_lang_Lang; | |
com_progrestar_common_lang_Lang.__name__ = ["com","progrestar","common","lang","Lang"]; | |
com_progrestar_common_lang_Lang.__super__ = openfl_display_MovieClip; | |
com_progrestar_common_lang_Lang.prototype = $extend(openfl_display_MovieClip.prototype,{ | |
TRIGGER_PATTERN: null | |
,M_PATTERN: null | |
,triggerM: function(s,params) { | |
if(com_progrestar_common_global_LangManager.get_locale() == "ru") { | |
return this.triggerMRu(s,params); | |
} else { | |
return this.triggerMEn(s,params); | |
} | |
} | |
,triggerG: function(s,params) { | |
if(com_progrestar_common_global_LangManager.get_locale() == "ru") { | |
this.triggerGRu(s,params); | |
} | |
if(com_progrestar_common_global_LangManager.get_locale() == "en") { | |
this.triggerGEn(s,params); | |
} | |
return ""; | |
} | |
,triggerMRu: function(s,params) { | |
var last = (params[0] | 0) % 100; | |
if(last > 14) { | |
last %= 10; | |
} | |
var postfixes = StaticExt.splitr(s,"|"); | |
if(last == 1) { | |
return postfixes[0]; | |
} | |
if(last > 1 && last < 5 || postfixes.length < 3) { | |
return postfixes[1]; | |
} | |
return postfixes[2]; | |
} | |
,triggerMEn: function(s,params) { | |
var last = (params[0] | 0) % 100; | |
if(last > 11) { | |
last %= 10; | |
} | |
var postfixes = StaticExt.splitr(s,"|"); | |
if(last == 1) { | |
return postfixes[0]; | |
} | |
return postfixes[1]; | |
} | |
,triggerGRu: function(s,params) { | |
var last = Std.string(params[0]); | |
var postfixes = StaticExt.splitr(s,"|"); | |
if(HxOverrides.substr(last,0,1) == "f" || HxOverrides.substr(last,0,1) == "F") { | |
return postfixes[1]; | |
} else { | |
return postfixes[0]; | |
} | |
} | |
,triggerGEn: function(s,params) { | |
var last = Std.string(params[0]); | |
var postfixes = StaticExt.splitr(s,"|"); | |
if(HxOverrides.substr(last,0,1) == "f" || HxOverrides.substr(last,0,1) == "F") { | |
return postfixes[1]; | |
} else { | |
return postfixes[0]; | |
} | |
} | |
,__class__: com_progrestar_common_lang_Lang | |
}); | |
var ThroneFonts = function() { | |
com_progrestar_common_lang_Lang.call(this); | |
}; | |
$hxClasses["ThroneFonts"] = ThroneFonts; | |
ThroneFonts.__name__ = ["ThroneFonts"]; | |
ThroneFonts.__interfaces__ = [IGameModule]; | |
ThroneFonts.__super__ = com_progrestar_common_lang_Lang; | |
ThroneFonts.prototype = $extend(com_progrestar_common_lang_Lang.prototype,{ | |
register: function(manager) { | |
com_progrestar_common_lang_Translate.init(this); | |
var fonts = openfl_text_Font.enumerateFonts(false); | |
com_progrestar_framework_core_utils_TraceUtils.consoleLogA(fonts); | |
} | |
,get_visual: function() { | |
return null; | |
} | |
,__class__: ThroneFonts | |
,__properties__: $extend(com_progrestar_common_lang_Lang.prototype.__properties__,{get_visual:"get_visual"}) | |
}); | |
var TutorialLib = function() { | |
}; | |
$hxClasses["TutorialLib"] = TutorialLib; | |
TutorialLib.__name__ = ["TutorialLib"]; | |
TutorialLib.__properties__ = {get_START:"get_START"}; | |
TutorialLib.get_START = function() { | |
return com_progrestar_game_lib_RuleLib.get_firstTutorialStep(); | |
}; | |
TutorialLib.initWithSplit = function(data) { | |
var steps = []; | |
var _g = 0; | |
var _g1 = Reflect.fields(data.tutorial); | |
while(_g < _g1.length) { | |
var key = _g1[_g]; | |
++_g; | |
steps.push(Reflect.field(data.tutorial,key)); | |
} | |
TutorialLib.init(steps); | |
}; | |
TutorialLib.init = function(data) { | |
var _g = 0; | |
while(_g < data.length) { | |
var item = data[_g]; | |
++_g; | |
var key = item.key; | |
var next = item.next; | |
var progress = item.progress; | |
var controller = com_progrestar_game_data_tutorial_core_TutorialFactory.create(item); | |
if(controller != null) { | |
var lib = new com_progrestar_game_lib_TutorialLibItem(progress,next,controller); | |
TutorialLib.items.set(key,lib); | |
} | |
} | |
}; | |
TutorialLib.getByKey = function(key) { | |
return TutorialLib.items.get(key); | |
}; | |
TutorialLib.getVector = function() { | |
return utils_MathUtil.jsMapToArray(TutorialLib.items); | |
}; | |
TutorialLib.prototype = { | |
__class__: TutorialLib | |
}; | |
var ValueType = $hxClasses["ValueType"] = { __ename__ : ["ValueType"], __constructs__ : ["TNull","TInt","TFloat","TBool","TObject","TFunction","TClass","TEnum","TUnknown"] }; | |
ValueType.TNull = ["TNull",0]; | |
ValueType.TNull.toString = $estr; | |
ValueType.TNull.__enum__ = ValueType; | |
ValueType.TInt = ["TInt",1]; | |
ValueType.TInt.toString = $estr; | |
ValueType.TInt.__enum__ = ValueType; | |
ValueType.TFloat = ["TFloat",2]; | |
ValueType.TFloat.toString = $estr; | |
ValueType.TFloat.__enum__ = ValueType; | |
ValueType.TBool = ["TBool",3]; | |
ValueType.TBool.toString = $estr; | |
ValueType.TBool.__enum__ = ValueType; | |
ValueType.TObject = ["TObject",4]; | |
ValueType.TObject.toString = $estr; | |
ValueType.TObject.__enum__ = ValueType; | |
ValueType.TFunction = ["TFunction",5]; | |
ValueType.TFunction.toString = $estr; | |
ValueType.TFunction.__enum__ = ValueType; | |
ValueType.TClass = function(c) { var $x = ["TClass",6,c]; $x.__enum__ = ValueType; $x.toString = $estr; return $x; }; | |
ValueType.TEnum = function(e) { var $x = ["TEnum",7,e]; $x.__enum__ = ValueType; $x.toString = $estr; return $x; }; | |
ValueType.TUnknown = ["TUnknown",8]; | |
ValueType.TUnknown.toString = $estr; | |
ValueType.TUnknown.__enum__ = ValueType; | |
var Type = function() { }; | |
$hxClasses["Type"] = Type; | |
Type.__name__ = ["Type"]; | |
Type.getSuperClass = function(c) { | |
return c.__super__; | |
}; | |
Type.getClassName = function(c) { | |
var a = c.__name__; | |
if(a == null) { | |
return null; | |
} | |
return a.join("."); | |
}; | |
Type.getEnumName = function(e) { | |
var a = e.__ename__; | |
return a.join("."); | |
}; | |
Type.resolveClass = function(name) { | |
var cl = $hxClasses[name]; | |
if(cl == null || !cl.__name__) { | |
return null; | |
} | |
return cl; | |
}; | |
Type.resolveEnum = function(name) { | |
var e = $hxClasses[name]; | |
if(e == null || !e.__ename__) { | |
return null; | |
} | |
return e; | |
}; | |
Type.createInstance = function(cl,args) { | |
var _g = args.length; | |
switch(_g) { | |
case 0: | |
return new cl(); | |
case 1: | |
return new cl(args[0]); | |
case 2: | |
return new cl(args[0],args[1]); | |
case 3: | |
return new cl(args[0],args[1],args[2]); | |
case 4: | |
return new cl(args[0],args[1],args[2],args[3]); | |
case 5: | |
return new cl(args[0],args[1],args[2],args[3],args[4]); | |
case 6: | |
return new cl(args[0],args[1],args[2],args[3],args[4],args[5]); | |
case 7: | |
return new cl(args[0],args[1],args[2],args[3],args[4],args[5],args[6]); | |
case 8: | |
return new cl(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7]); | |
case 9: | |
return new cl(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8]); | |
case 10: | |
return new cl(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8],args[9]); | |
case 11: | |
return new cl(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8],args[9],args[10]); | |
case 12: | |
return new cl(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8],args[9],args[10],args[11]); | |
case 13: | |
return new cl(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8],args[9],args[10],args[11],args[12]); | |
case 14: | |
return new cl(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8],args[9],args[10],args[11],args[12],args[13]); | |
default: | |
throw new js__$Boot_HaxeError("Too many arguments"); | |
} | |
}; | |
Type.createEmptyInstance = function(cl) { | |
function empty() {}; empty.prototype = cl.prototype; | |
return new empty(); | |
}; | |
Type.createEnum = function(e,constr,params) { | |
var f = Reflect.field(e,constr); | |
if(f == null) { | |
throw new js__$Boot_HaxeError("No such constructor " + constr); | |
} | |
if(Reflect.isFunction(f)) { | |
if(params == null) { | |
throw new js__$Boot_HaxeError("Constructor " + constr + " need parameters"); | |
} | |
return f.apply(e,params); | |
} | |
if(params != null && params.length != 0) { | |
throw new js__$Boot_HaxeError("Constructor " + constr + " does not need parameters"); | |
} | |
return f; | |
}; | |
Type.getInstanceFields = function(c) { | |
var a = []; | |
for(var i in c.prototype) a.push(i); | |
HxOverrides.remove(a,"__class__"); | |
HxOverrides.remove(a,"__properties__"); | |
return a; | |
}; | |
Type.getClassFields = function(c) { | |
var a = Reflect.fields(c); | |
HxOverrides.remove(a,"__name__"); | |
HxOverrides.remove(a,"__interfaces__"); | |
HxOverrides.remove(a,"__properties__"); | |
HxOverrides.remove(a,"__super__"); | |
HxOverrides.remove(a,"__meta__"); | |
HxOverrides.remove(a,"prototype"); | |
return a; | |
}; | |
Type["typeof"] = function(v) { | |
var _g = typeof(v); | |
switch(_g) { | |
case "boolean": | |
return ValueType.TBool; | |
case "function": | |
if(v.__name__ || v.__ename__) { | |
return ValueType.TObject; | |
} | |
return ValueType.TFunction; | |
case "number": | |
if(Math.ceil(v) == v % 2147483648.0) { | |
return ValueType.TInt; | |
} | |
return ValueType.TFloat; | |
case "object": | |
if(v == null) { | |
return ValueType.TNull; | |
} | |
var e = v.__enum__; | |
if(e != null) { | |
return ValueType.TEnum(e); | |
} | |
var c = js_Boot.getClass(v); | |
if(c != null) { | |
return ValueType.TClass(c); | |
} | |
return ValueType.TObject; | |
case "string": | |
return ValueType.TClass(String); | |
case "undefined": | |
return ValueType.TNull; | |
default: | |
return ValueType.TUnknown; | |
} | |
}; | |
Type.enumEq = function(a,b) { | |
if(a == b) { | |
return true; | |
} | |
try { | |
if(a[0] != b[0]) { | |
return false; | |
} | |
var _g1 = 2; | |
var _g = a.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
if(!Type.enumEq(a[i],b[i])) { | |
return false; | |
} | |
} | |
var e = a.__enum__; | |
if(e != b.__enum__ || e == null) { | |
return false; | |
} | |
} catch( e1 ) { | |
haxe_CallStack.lastException = e1; | |
return false; | |
} | |
return true; | |
}; | |
var _$UInt_UInt_$Impl_$ = {}; | |
$hxClasses["_UInt.UInt_Impl_"] = _$UInt_UInt_$Impl_$; | |
_$UInt_UInt_$Impl_$.__name__ = ["_UInt","UInt_Impl_"]; | |
_$UInt_UInt_$Impl_$.gt = function(a,b) { | |
var aNeg = a < 0; | |
var bNeg = b < 0; | |
if(aNeg != bNeg) { | |
return aNeg; | |
} else { | |
return a > b; | |
} | |
}; | |
_$UInt_UInt_$Impl_$.toFloat = function(this1) { | |
var $int = this1; | |
if($int < 0) { | |
return 4294967296.0 + $int; | |
} else { | |
return $int + 0.0; | |
} | |
}; | |
var UserExtraSettings = function() { | |
}; | |
$hxClasses["UserExtraSettings"] = UserExtraSettings; | |
UserExtraSettings.__name__ = ["UserExtraSettings"]; | |
UserExtraSettings.loadInfo = function() { | |
var serverUrl = com_progrestar_common_global_Env.SERVER_URL + "getInfo.php?userId=" + com_progrestar_common_global_Env.network.get_userId(); | |
com_progrestar_common_server_Request.security(serverUrl,{ "userId" : com_progrestar_common_global_Env.network.get_userId()},UserExtraSettings.onInfoLoaded,UserExtraSettings.onInfoError); | |
}; | |
UserExtraSettings.onInfoLoaded = function(e) { | |
var data = Reflect.field(e.target,"data"); | |
if(data == null) { | |
return; | |
} | |
var temp = data.split("\n"); | |
var dataObj = { }; | |
var _g1 = 0; | |
var _g = temp.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
var str = temp[i]; | |
if(str != null) { | |
var a = str.split("="); | |
dataObj[a[0]] = a[1]; | |
} | |
} | |
var tmp = Object.prototype.hasOwnProperty.call(dataObj,"bg"); | |
if(Object.prototype.hasOwnProperty.call(dataObj,"id")) { | |
var id = StaticExt.asInt(Std,dataObj.id); | |
if(!isNaN(id)) { | |
EpicWarEnv.isRegistered = id != 0; | |
} | |
} | |
if(Object.prototype.hasOwnProperty.call(dataObj,"medal")) { | |
EpicWarEnv.medal = dataObj.medal == 1; | |
} | |
}; | |
UserExtraSettings.onInfoError = function(e) { | |
com_progrestar_common_global_Env.log.loadInfo("user info error","FF4040"); | |
}; | |
UserExtraSettings.prototype = { | |
__class__: UserExtraSettings | |
}; | |
var Xml = function(nodeType) { | |
this.nodeType = nodeType; | |
this.children = []; | |
this.attributeMap = new haxe_ds_StringMap(); | |
}; | |
$hxClasses["Xml"] = Xml; | |
Xml.__name__ = ["Xml"]; | |
Xml.parse = function(str) { | |
return haxe_xml_Parser.parse(str); | |
}; | |
Xml.createElement = function(name) { | |
var xml = new Xml(Xml.Element); | |
if(xml.nodeType != Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + xml.nodeType); | |
} | |
xml.nodeName = name; | |
return xml; | |
}; | |
Xml.createPCData = function(data) { | |
var xml = new Xml(Xml.PCData); | |
if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, unexpected " + xml.nodeType); | |
} | |
xml.nodeValue = data; | |
return xml; | |
}; | |
Xml.createCData = function(data) { | |
var xml = new Xml(Xml.CData); | |
if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, unexpected " + xml.nodeType); | |
} | |
xml.nodeValue = data; | |
return xml; | |
}; | |
Xml.createComment = function(data) { | |
var xml = new Xml(Xml.Comment); | |
if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, unexpected " + xml.nodeType); | |
} | |
xml.nodeValue = data; | |
return xml; | |
}; | |
Xml.createDocType = function(data) { | |
var xml = new Xml(Xml.DocType); | |
if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, unexpected " + xml.nodeType); | |
} | |
xml.nodeValue = data; | |
return xml; | |
}; | |
Xml.createProcessingInstruction = function(data) { | |
var xml = new Xml(Xml.ProcessingInstruction); | |
if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, unexpected " + xml.nodeType); | |
} | |
xml.nodeValue = data; | |
return xml; | |
}; | |
Xml.createDocument = function() { | |
return new Xml(Xml.Document); | |
}; | |
Xml.prototype = { | |
nodeType: null | |
,nodeName: null | |
,nodeValue: null | |
,parent: null | |
,children: null | |
,attributeMap: null | |
,get: function(att) { | |
if(this.nodeType != Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + this.nodeType); | |
} | |
var _this = this.attributeMap; | |
if(__map_reserved[att] != null) { | |
return _this.getReserved(att); | |
} else { | |
return _this.h[att]; | |
} | |
} | |
,set: function(att,value) { | |
if(this.nodeType != Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + this.nodeType); | |
} | |
var _this = this.attributeMap; | |
if(__map_reserved[att] != null) { | |
_this.setReserved(att,value); | |
} else { | |
_this.h[att] = value; | |
} | |
} | |
,exists: function(att) { | |
if(this.nodeType != Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + this.nodeType); | |
} | |
var _this = this.attributeMap; | |
if(__map_reserved[att] != null) { | |
return _this.existsReserved(att); | |
} else { | |
return _this.h.hasOwnProperty(att); | |
} | |
} | |
,attributes: function() { | |
if(this.nodeType != Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + this.nodeType); | |
} | |
return this.attributeMap.keys(); | |
} | |
,elements: function() { | |
if(this.nodeType != Xml.Document && this.nodeType != Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, expected Element or Document but found " + this.nodeType); | |
} | |
var _g = []; | |
var _g1 = 0; | |
var _g2 = this.children; | |
while(_g1 < _g2.length) { | |
var child = _g2[_g1]; | |
++_g1; | |
if(child.nodeType == Xml.Element) { | |
_g.push(child); | |
} | |
} | |
var ret = _g; | |
return HxOverrides.iter(ret); | |
} | |
,elementsNamed: function(name) { | |
if(this.nodeType != Xml.Document && this.nodeType != Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, expected Element or Document but found " + this.nodeType); | |
} | |
var _g = []; | |
var _g1 = 0; | |
var _g2 = this.children; | |
while(_g1 < _g2.length) { | |
var child = _g2[_g1]; | |
++_g1; | |
var tmp; | |
if(child.nodeType == Xml.Element) { | |
if(child.nodeType != Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, expected Element but found " + child.nodeType); | |
} | |
tmp = child.nodeName == name; | |
} else { | |
tmp = false; | |
} | |
if(tmp) { | |
_g.push(child); | |
} | |
} | |
var ret = _g; | |
return HxOverrides.iter(ret); | |
} | |
,firstElement: function() { | |
if(this.nodeType != Xml.Document && this.nodeType != Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, expected Element or Document but found " + this.nodeType); | |
} | |
var _g = 0; | |
var _g1 = this.children; | |
while(_g < _g1.length) { | |
var child = _g1[_g]; | |
++_g; | |
if(child.nodeType == Xml.Element) { | |
return child; | |
} | |
} | |
return null; | |
} | |
,addChild: function(x) { | |
if(this.nodeType != Xml.Document && this.nodeType != Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, expected Element or Document but found " + this.nodeType); | |
} | |
if(x.parent != null) { | |
x.parent.removeChild(x); | |
} | |
this.children.push(x); | |
x.parent = this; | |
} | |
,removeChild: function(x) { | |
if(this.nodeType != Xml.Document && this.nodeType != Xml.Element) { | |
throw new js__$Boot_HaxeError("Bad node type, expected Element or Document but found " + this.nodeType); | |
} | |
if(HxOverrides.remove(this.children,x)) { | |
x.parent = null; | |
return true; | |
} | |
return false; | |
} | |
,__class__: Xml | |
}; | |
var battle_$pack_BattleConsole = function() { | |
}; | |
$hxClasses["battle_pack.BattleConsole"] = battle_$pack_BattleConsole; | |
battle_$pack_BattleConsole.__name__ = ["battle_pack","BattleConsole"]; | |
battle_$pack_BattleConsole.init = function() { | |
com_progrestar_framework_console_Console.addCommand("showReplay","showReplay battleId [a|d|r] -- see as a(attacker) or d(defender), or s (print result only)",battle_$pack_BattleConsole.startReplay,true); | |
com_progrestar_framework_console_Console.addCommand("startBattle","Using: attackPlayer [userId] (default -- battle with himself)",battle_$pack_BattleConsole.attackPlayer,true); | |
com_progrestar_framework_console_Console.addCommand("startBastion","Using: startBastion [fairId] ",battle_$pack_BattleConsole.startBastion); | |
com_progrestar_framework_console_Console.addCommand("attackScenario","Using: attackScenario [scenarioId]",battle_$pack_BattleConsole.attackScenario); | |
com_progrestar_framework_console_Console.addCommand("attackPlayer","Using: attackPlayer [userId] [force=0] (default -- battle with himself)",battle_$pack_BattleConsole.attackPlayer,true); | |
com_progrestar_framework_console_Console.addCommand("attackMission","Using: attackMission [missionId] (missionId --- from mission=>id in library)",battle_$pack_BattleConsole.attackMission); | |
com_progrestar_framework_console_Console.addCommand("attackCustom","Using: attackCustom [mapKey] (mapKey -- from map=>key in library)",battle_$pack_BattleConsole.attackCustom); | |
com_progrestar_framework_console_Console.addCommand("attackStop","Using: attackStop (completing current battle)",battle_$pack_BattleConsole.attackStop); | |
com_progrestar_framework_console_Console.addCommand("convertBattleCommands","Using: convertBattleCommands [commands] (supported only spawn commands)",battle_$pack_BattleConsole.convertBattleCommands); | |
com_progrestar_framework_console_Console.addCommand("getBattleId","Using: getBattleId",battle_$pack_BattleConsole.getBattleId); | |
com_progrestar_framework_console_Console.addCommand("getUserId","",battle_$pack_BattleConsole.getUserId); | |
com_progrestar_framework_console_Console.addCommand("showFakeBattleResult","showFakeBattleResult [state] (state 1 - win, state 0 - loose)",battle_$pack_BattleConsole.showFakeBattleResult); | |
com_progrestar_framework_console_Console.addCommand("killBot","killBo [id] kills bot with given id",battle_$pack_BattleConsole.killBot); | |
com_progrestar_framework_console_Console.addCommand("selectUnit","selectUnit [unitId] select unit for spawn by unitId",battle_$pack_BattleConsole.selectUnit); | |
}; | |
battle_$pack_BattleConsole.selectUnit = function(unitId) { | |
var unitLibItem = StaticExt.kast(Std,com_progrestar_game_unit_lib_UnitLib.get_instance().getById(unitId),com_progrestar_game_unit_lib_UnitLevelLibItem); | |
var data = com_progrestar_game_scene_SceneManager.get_activeLocation().get_battleController().get_render().get_data(); | |
var amount = data.get_location().get_attacker().get_unitPacksReserve().getUnitAmountByType(unitLibItem); | |
var onSuccess = function(response) { | |
data.cursor.item.set_value(unitLibItem); | |
}; | |
if(amount != 0) { | |
onSuccess(null); | |
} else { | |
com_progrestar_game_server_types_CheatRPC.setUnit(unitId,1,onSuccess); | |
} | |
}; | |
battle_$pack_BattleConsole.getBattleId = function(v) { | |
com_progrestar_framework_console_Console.trace("Current battle ID is " + com_progrestar_game_scene_SceneManager.get_activeLocation().get_battleController().get_record().battleId); | |
}; | |
battle_$pack_BattleConsole.getUserId = function(v) { | |
com_progrestar_framework_console_Console.trace("Current user id is " + com_progrestar_game_scene_SceneManager.get_activeLocation().get_id() + " type " + com_progrestar_game_scene_SceneManager.get_activeLocation().get_locationLink().get_type()); | |
}; | |
battle_$pack_BattleConsole.convertBattleCommands = function(commands) { | |
var list = new epicwar_haxe_battle_commands_CommandLog(); | |
var items = []; | |
list.unpack(commands); | |
var _g = 0; | |
var _g1 = list.getCommands(); | |
while(_g < _g1.length) { | |
var cmd = _g1[_g]; | |
++_g; | |
var item = null; | |
if(cmd.kind == "spawn") { | |
item = { "col" : cmd.col, "row" : cmd.row, "type" : cmd.kind, "time" : cmd.time, "typeId" : cmd.typeId}; | |
} | |
if(item != null) { | |
items.push(item); | |
} | |
} | |
var formatted = JSON.stringify(items); | |
com_progrestar_framework_console_Console.trace(formatted); | |
}; | |
battle_$pack_BattleConsole.startReplay = function(args) { | |
var battleId = args[0]; | |
var observer = args.length > 1 ? args[1] : null; | |
var record = new com_progrestar_game_battle_BattleRecord(); | |
record.battleId = battleId; | |
if(observer != null && observer.charAt(0) == "a") { | |
record.observer = "attacker"; | |
} | |
if(observer != null && observer.charAt(0) == "d") { | |
record.observer = "defender"; | |
} | |
if(observer != null && observer.charAt(0) == "r") { | |
com_progrestar_game_battle_BattleReplayLoader.loadReplay(record,battle_$pack_BattleConsole.onAnswer,battle_$pack_BattleConsole.onFailed); | |
return; | |
} | |
com_progrestar_game_battle_BattleFactory.startReplay(record); | |
}; | |
battle_$pack_BattleConsole.onFailed = function(v) { | |
}; | |
battle_$pack_BattleConsole.onAnswer = function(battleData) { | |
com_progrestar_framework_console_Console.trace("attackerStars" + "\n" + battleData.attackerStars + "\n"); | |
com_progrestar_framework_console_Console.trace("attackerUnits" + "\n" + Std.string(battleData.attackerUnits) + "\n"); | |
com_progrestar_framework_console_Console.trace("attackerRewards" + "\n" + Std.string(battleData.attackerRewards) + "\n"); | |
com_progrestar_framework_console_Console.trace("defenderRewards" + "\n" + Std.string(battleData.defenderRewards) + "\n"); | |
com_progrestar_framework_console_Console.trace("maxRewards" + "\n" + Std.string(battleData.maxReward) + "\n"); | |
}; | |
battle_$pack_BattleConsole.attackScenario = function(idValue) { | |
if(idValue == null) { | |
idValue = "1"; | |
} | |
var id = StaticExt.asInt(Std,idValue); | |
var scenario = com_progrestar_game_citadel_lib_BattleScenarioLib.instance.getById(id); | |
if(scenario != null) { | |
com_progrestar_game_battle_BattleFactory.startScenario(scenario); | |
com_progrestar_framework_console_Console.trace("Scenario started (" + idValue + ")",false); | |
} else { | |
com_progrestar_framework_console_Console.trace("Undefined scenario by id: " + idValue,true); | |
} | |
}; | |
battle_$pack_BattleConsole.attackStop = function(v) { | |
com_progrestar_game_scene_SceneManager.get_activeLocation().get_battleController().stopBattle(com_progrestar_game_ui_battle_$ui_StopBattleReason.CONSOLE); | |
}; | |
battle_$pack_BattleConsole.attackCustom = function(mapKey) { | |
com_progrestar_game_battle_BattleFactory.startCustomMap(mapKey); | |
}; | |
battle_$pack_BattleConsole.attackPlayer = function(args) { | |
var userId = args.length > 0 ? args[0] : null; | |
var forceValue = args.length > 1 ? args[1] : "0"; | |
var force = forceValue != "0"; | |
if(userId == null) { | |
userId = com_progrestar_game_managers_PlayersManager.get_instance().get_selfId(); | |
} | |
com_progrestar_game_battle_BattleFactory.battleStartPvp(userId,force); | |
}; | |
battle_$pack_BattleConsole.startBastion = function(fairId) { | |
if(fairId == null) { | |
battle_$pack_BattleConsole.showError("no fairId. syntax: startBastion [fairId]"); | |
return; | |
} | |
com_progrestar_game_battle_BattlesManager.createBastionFromConsole(fairId); | |
}; | |
battle_$pack_BattleConsole.attackMission = function(missionId) { | |
if(missionId == null) { | |
battle_$pack_BattleConsole.showError("missionId missed"); | |
return; | |
} | |
var mission = com_progrestar_game_lib_MissionLib.get_instance().getById(StaticExt.asInt(Std,missionId)); | |
if(mission == null) { | |
battle_$pack_BattleConsole.showError("Ouch! Mission (" + missionId + ") is undefined"); | |
return; | |
} | |
if(com_progrestar_game_managers_MissionManager.getState(mission).get_locked()) { | |
battle_$pack_BattleConsole.showError("Ouch! Mission (" + missionId + ") is locked"); | |
return; | |
} | |
com_progrestar_game_battle_BattleFactory.startMission(mission); | |
}; | |
battle_$pack_BattleConsole.showError = function(text) { | |
com_progrestar_framework_console_Console.trace(text,true); | |
}; | |
battle_$pack_BattleConsole.showFakeBattleResult = function(win) { | |
var fake_data_win = { "body" : { "defender" : { "pvpScore" : 407, "id" : "100002315255076", "leagueTypeId" : "7", "level" : "61", "villageCaption" : "Philippe", "alliance" : null, "protectionExpireTime" : 1505131144}, "attackerId" : "1945380", "attackerLeagueBonus" : { "resource" : [{ "amount" : 3918, "id" : 1},{ "amount" : 3918, "id" : 2}]}, "battleResult" : "15^40`1!2^7`104`0`~1~17!2^1`0`1`6`~1~2^1`0`1`6`~1~2^1`0`1`6`~1~2^1`0`1`6`~1~2^1`0`1`6`~1~2^1`0`1`6`~1~2^1`0`1`6`~1~2^1`0`1`6`~1~2^1`0`1`6`~1~2^1`0`1`6`~1~2^1`0`102`1`~1~2^1`0`102`1`~1~2^1`0`102`1`~1~2^1`0`102`1`~1~2^1`0`102`1`~1~2^0`5`102`1`~1~2^0`10`1`6`~1~325`1`1`380`329`pvp`420`1^50`5000`750`~1~`0!1!3^47`5`6`7`0`~1~1!2^2111`1`1`~1~3!2^7`104`0`~1~2^1082111`1`1`~1~2^1620000`2`1`~1~47!1^7`7`19`6`~1~1^8`7`23`6`~1~1^9`7`23`6`~1~1^11`7`23`6`~1~1^13`7`21`6`~1~1^13`7`21`6`~1~1^14`7`20`6`~1~1^14`7`19`6`~1~1^17`7`23`6`~1~1^18`7`22`6`~1~1^16`7`19`6`~1~1^18`7`17`6`~1~1^20`7`17`6`~1~1^22`7`18`6`~1~1^22`7`15`6`~1~1^22`7`15`6`~1~1^22`7`15`6`~1~1^22`7`15`6`~1~1^22`7`15`6`~1~1^22`7`15`6`~1~1^22`7`15`6`~1~1^22`7`15`6`~1~1^22`7`15`6`~1~1^22`7`15`6`~1~1^22`7`15`6`~1~1^22`7`15`6`~1~1^22`7`15`6`~1~1^22`7`15`6`~1~1^22`7`15`6`~1~1^22`7`15`6`~1~1^22`7`15`6`~1~1^22`7`15`6`~1~1^22`7`15`6`~1~1^22`7`15`6`~1~1^22`7`15`6`~1~1^22`7`15`6`~1~1^22`7`15`6`~1~1^30`7`20`6`~1~1^29`7`18`6`~1~1^29`7`18`6`~1~1^30`7`17`6`~1~1^30`7`16`6`~1~1^30`7`16`6`~1~1^29`7`15`6`~1~1^29`7`15`6`~1~1^29`7`15`6`~1~1^30`7`14`6`~1~36!2^121`0`0`0`1`~1~2^194`0`0`0`1`~1~2^371`3825`0`0`1`~1~2^370`3825`0`0`1`~1~2^369`4455`0`0`1`~1~2^368`4455`0`0`1`~1~2^367`4455`0`0`1`~1~2^1`0`1`0`1`~1~2^404`0`0`0`1`~1~2^373`4770`0`0`1`~1~2^372`4770`0`0`1`~1~2^374`4770`0`0`1`~1~2^209`0`0`0`1`~1~2^207`0`0`0`1`~1~2^401`0`1`0`1`~1~2^7`0`1`0`0`~1~2^192`0`1`0`0`~1~2^73`0`1`0`0`~1~2^166`0`1`0`0`~1~2^119`0`1`0`0`~1~2^205`0`1`0`0`~1~2^142`0`1`0`0`~1~2^198`0`1`0`0`~1~2^195`0`1`0`0`~1~2^402`0`1`0`0`~1~2^208`0`1`0`0`~1~2^145`0`1`0`0`~1~2^95`0`1`0`0`~1~2^203`0`1`0`0`~1~2^143`0`1`0`0`~1~2^123`0`1`0`0`~1~2^118`0`1`0`0`~1~2^199`0`1`0`0`~1~2^8`0`1`0`0`~1~2^190`0`1`0`0`~1~2^16`0`1`0`0`~1~10!1^119`~1~2^270000`1`1`~1~1^205`~1~2^270000`1`1`~1~1^142`~1~2^270000`1`1`~1~1^198`~1~2^270000`1`1`~1~1^143`~1~2^270000`2`1`~1~1^118`~1~2^270000`2`1`~1~1^199`~1~2^270000`2`1`~1~1^8`~1~2^270000`2`1`~1~1^190`~1~2^270000`2`1`~1~1^16`~1~2^270000`2`1`~1~97``0`0`0!`0!0!~0~", "attacker" : { "pvpScore" : 342, "id" : "1945380", "leagueTypeId" : "5", "level" : "53", "villageCaption" : "alexTOSHIRO", "alliance" : { "title" : "Rukus2", "icon" : "clan8"}, "protectionExpireTime" : 1505123837}, "defenderId" : "100002315255076", "attackerName" : "alexTOSHIRO"}}; | |
var fake_data_loose = { "body" : { "defender" : { "pvpScore" : "1172", "id" : "1502870799", "leagueTypeId" : 14, "level" : "57", "villageCaption" : "Codrin", "alliance" : { "title" : "steo", "icon" : "clan1"}, "protectionExpireTime" : false}, "attackerName" : "alexTOSHIRO", "attackerId" : "1945380", "battleResult" : "15^12`2!2^1`8`0`~1~2^5`104`0`~1~17!2^1`0`1`6`~1~2^1`0`1`6`~1~2^1`0`1`6`~1~2^1`0`1`6`~1~2^1`0`1`6`~1~2^1`0`1`6`~1~2^1`0`1`6`~1~2^1`0`1`6`~1~2^1`0`1`6`~1~2^1`0`1`6`~1~2^1`0`102`1`~1~2^1`0`102`1`~1~2^1`0`102`1`~1~2^1`0`102`1`~1~2^1`0`102`1`~1~2^0`5`102`1`~1~2^0`10`1`6`~1~325`0`0`380`346`pvp`1172`1^50`5000`750`~1~`0!1!3^52`5`6`7`0`~1~1!2^504`1`1`~1~4!2^1`8`0`~1~2^5`104`0`~1~2^19254`1`1`~1~2^15000`2`1`~1~52!1^6`7`19`6`~1~1^7`7`21`6`~1~1^7`7`20`6`~1~1^8`7`22`6`~1~1^9`7`22`6`~1~1^12`7`22`6`~1~1^13`7`20`6`~1~1^13`7`21`6`~1~1^15`7`19`6`~1~1^14`7`19`6`~1~1^15`7`19`6`~1~1^14`7`18`6`~1~1^13`7`17`6`~1~1^14`7`18`6`~1~1^14`7`16`6`~1~1^14`7`16`6`~1~1^14`7`16`6`~1~1^14`7`16`6`~1~1^14`7`16`6`~1~1^14`7`16`6`~1~1^14`7`16`6`~1~1^14`7`16`6`~1~1^14`7`16`6`~1~1^14`7`16`6`~1~1^14`7`17`6`~1~1^14`7`17`6`~1~1^14`7`17`6`~1~1^14`7`17`6`~1~1^14`7`17`6`~1~1^14`7`17`6`~1~1^14`7`17`6`~1~1^14`7`18`6`~1~1^14`7`18`6`~1~1^14`7`18`6`~1~1^14`7`18`6`~1~1^14`7`18`6`~1~1^14`7`18`6`~1~1^14`7`18`6`~1~1^14`7`18`6`~1~1^14`7`18`6`~1~1^13`7`16`6`~1~1^13`7`15`6`~1~1^13`7`15`6`~1~1^13`7`15`6`~1~1^13`7`15`6`~1~1^13`7`15`6`~1~1^13`7`15`6`~1~1^13`7`15`6`~1~1^13`7`15`6`~1~1^13`7`15`6`~1~1^13`7`15`6`~1~1^13`7`15`6`~1~29!2^293`0`0`0`1`~1~2^147`0`0`0`1`~1~2^105`7455`0`0`1`~1~2^43`7455`0`0`1`~1~2^98`7455`0`0`1`~1~2^146`0`0`0`1`~1~2^48`6035`0`0`1`~1~2^84`6485`0`0`1`~1~2^56`6485`0`0`1`~1~2^264`928`0`0`1`~1~2^190`0`0`0`1`~1~2^42`6485`0`0`1`~1~2^136`635`0`0`1`~1~2^104`6485`0`0`1`~1~2^169`6485`0`0`1`~1~2^198`6485`0`0`1`~1~2^65`505`0`0`1`~1~2^133`6485`0`0`1`~1~2^140`0`0`0`1`~1~2^23`8085`0`0`1`~1~2^132`6485`0`0`1`~1~2^209`6485`0`0`1`~1~2^135`0`0`0`1`~1~2^67`0`1`0`0`~1~2^5`0`1`0`0`~1~2^262`0`1`0`0`~1~2^17`0`1`0`0`~1~2^6`0`1`0`0`~1~2^137`0`1`0`0`~1~2!1^262`~1~2^15000`2`1`~1~1^6`~1~2^18750`1`1`~1~82``0`0`0!`0!0!~0~", "attacker" : { "pvpScore" : 345, "id" : "1945380", "leagueTypeId" : "5", "level" : "53", "villageCaption" : "alexTOSHIRO", "alliance" : { "title" : "Rukus2", "icon" : "clan8"}, "protectionExpireTime" : 1505123377}, "defenderId" : "1502870799", "attackerLeagueBonus" : { "resource" : [{ "amount" : 2057, "id" : 1},{ "amount" : 2057, "id" : 2}]}}}; | |
var info = com_progrestar_game_battle_BattleRecordParser.parse(win != 0 ? fake_data_win.body : fake_data_loose.body); | |
com_progrestar_game_ui_UI.addDialog(new com_progrestar_game_ui_message_fight_$result_$window_BattleResultWindowWithAnimation(info,true,com_progrestar_game_battle_BattleViewFromType.BASE)); | |
}; | |
battle_$pack_BattleConsole.killBot = function(userId) { | |
if(userId == null) { | |
com_progrestar_framework_console_Console.trace("please provide userId"); | |
return; | |
} | |
com_progrestar_game_server_RpcManager.createCustomRequest("killBot",{ "userId" : userId},battle_$pack_BattleConsole.onKillBotSuccess); | |
}; | |
battle_$pack_BattleConsole.onKillBotSuccess = function(data) { | |
com_progrestar_framework_console_Console.trace("server response:"); | |
com_progrestar_framework_console_Console.trace(JSON.stringify(data)); | |
}; | |
battle_$pack_BattleConsole.prototype = { | |
__class__: battle_$pack_BattleConsole | |
}; | |
var battle_$pack_core_BattleConfigGenerator = function() { | |
}; | |
$hxClasses["battle_pack.core.BattleConfigGenerator"] = battle_$pack_core_BattleConfigGenerator; | |
battle_$pack_core_BattleConfigGenerator.__name__ = ["battle_pack","core","BattleConfigGenerator"]; | |
battle_$pack_core_BattleConfigGenerator.tutorial = function(mission) { | |
var config = new epicwar_haxe_battle_configs_BattleConfig(); | |
config.duration = 600; | |
config.map.cols = 64; | |
config.map.rows = 64; | |
config.attacker.townHallLevel = 1; | |
config.defender.townHallLevel = 1; | |
var castle = config.defender.createBuilding("townhall"); | |
castle.typeId = 1; | |
castle.level = 4; | |
castle.hp = com_progrestar_game_lib_building_BuildingLevelLib.get_instance().getByTypeId(castle.typeId,castle.level).get_attackData().get_hp(); | |
castle.col = 27; | |
castle.row = 27; | |
castle.width = 6; | |
castle.height = 6; | |
castle.underConstruction = false; | |
var _g = 24; | |
while(_g < 34) { | |
var iteration = _g++; | |
var _g1 = 0; | |
while(_g1 < 1) { | |
var phase = _g1++; | |
var _g2 = 0; | |
while(_g2 < 4) { | |
var sub = _g2++; | |
var wall = config.defender.createBuilding("wall"); | |
wall.typeId = 11; | |
wall.level = 6; | |
wall.hp = com_progrestar_game_lib_building_BuildingLevelLib.get_instance().getByTypeId(wall.typeId,6).get_attackData().get_hp(); | |
if(sub == 0) { | |
wall.col = iteration; | |
wall.row = 24 + phase; | |
} | |
if(sub == 1) { | |
wall.col = iteration; | |
wall.row = 33 - phase; | |
} | |
if(sub == 2) { | |
wall.col = 24 + phase; | |
wall.row = iteration - phase; | |
} | |
if(sub == 3) { | |
wall.col = 33 - phase; | |
wall.row = iteration; | |
} | |
wall.width = 1; | |
wall.height = 1; | |
wall.underConstruction = false; | |
} | |
} | |
} | |
var unit = null; | |
unit = config.attacker.createUnit(); | |
unit.typeId = 5; | |
unit.level = 1; | |
unit.amount = 5; | |
unit.hp = 100; | |
unit.attack.power = 50; | |
unit.attack.bulletSpeed = 2; | |
unit.attack.radiusMin = 0; | |
unit.attack.radiusMax = 5; | |
unit.movement.speed = 1; | |
unit.movement.setKind("groundUnit"); | |
unit = config.attacker.createUnit(); | |
unit.typeId = 1; | |
unit.level = 1; | |
unit.amount = 50; | |
unit.hp = 100; | |
unit.attack.power = 50; | |
unit.movement.speed = 1; | |
unit.movement.setKind("groundUnit"); | |
unit = config.attacker.createUnit(); | |
unit.typeId = 2; | |
unit.level = 1; | |
unit.amount = 50; | |
unit.hp = 100; | |
unit.attack.power = 50; | |
unit.attack.bulletSpeed = 1; | |
unit.attack.radiusMin = 0; | |
unit.attack.radiusMax = 3; | |
unit.movement.speed = 1; | |
unit.movement.setKind("groundUnit"); | |
unit = config.attacker.createUnit(); | |
unit.typeId = 3; | |
unit.level = 1; | |
unit.amount = 50; | |
unit.hp = 100; | |
unit.attack.power = 50; | |
unit.movement.speed = 1; | |
unit.movement.setKind("groundUnit"); | |
unit = config.attacker.createUnit(); | |
unit.typeId = 4; | |
unit.level = 1; | |
unit.amount = 50; | |
unit.hp = 100; | |
unit.attack.power = 50; | |
unit.attack.bulletSpeed = 2; | |
unit.attack.radiusMin = 0; | |
unit.attack.radiusMax = 4; | |
unit.movement.speed = 1; | |
unit.movement.setKind("groundUnit"); | |
return config; | |
}; | |
battle_$pack_core_BattleConfigGenerator.benchmark = function(v) { | |
var config = new epicwar_haxe_battle_configs_BattleConfig(); | |
config.duration = 300; | |
config.map.cols = 64; | |
config.map.rows = 64; | |
config.map.setBlockingCell(2,1); | |
config.attacker.townHallLevel = 5; | |
config.defender.townHallLevel = 5; | |
var unit = null; | |
unit = config.attacker.createUnit(); | |
unit.typeId = 2; | |
unit.amount = 10000; | |
unit.hp = 40; | |
unit.level = 2; | |
unit.attack.power = 5; | |
unit.attack.radiusMin = 0; | |
unit.attack.radiusMax = 3; | |
unit.movement.speed = 3; | |
unit.movement.setKind("groundUnit"); | |
unit = config.attacker.createUnit(); | |
unit.typeId = 4; | |
unit.amount = 10000; | |
unit.hp = 80; | |
unit.level = 4; | |
unit.attack.power = 15; | |
unit.attack.radiusMin = 0; | |
unit.attack.radiusMax = 5; | |
unit.movement.speed = 2; | |
unit.movement.setKind("groundUnit"); | |
unit = config.attacker.createUnit(); | |
unit.typeId = 6; | |
unit.amount = 10000; | |
unit.hp = 200; | |
unit.level = 2; | |
unit.attack.power = 50; | |
unit.attack.radiusMin = 2; | |
unit.attack.radiusMax = 3; | |
unit.movement.speed = 1.5; | |
unit.movement.setKind("groundUnit"); | |
var castle = config.defender.createBuilding("townhall"); | |
castle.typeId = 1; | |
castle.level = 2; | |
castle.hp = com_progrestar_game_lib_building_BuildingLevelLib.get_instance().getByTypeId(castle.typeId,castle.level).get_attackData().get_hp(); | |
castle.col = 6; | |
castle.row = 6; | |
castle.width = 6; | |
castle.height = 6; | |
castle.underConstruction = false; | |
var _g = 4; | |
while(_g < 61) { | |
var iteration = _g++; | |
var _g1 = 0; | |
while(_g1 < 2) { | |
var phase = _g1++; | |
var _g2 = 0; | |
while(_g2 < 4) { | |
var sub = _g2++; | |
var wall = config.defender.createBuilding("wall"); | |
wall.typeId = 11; | |
wall.level = phase * 2 + 2; | |
wall.hp = com_progrestar_game_lib_building_BuildingLevelLib.get_instance().getByTypeId(castle.typeId,castle.level).get_attackData().get_hp(); | |
if(sub == 0) { | |
wall.col = iteration; | |
wall.row = 4 + phase; | |
} | |
if(sub == 1) { | |
wall.col = iteration; | |
wall.row = 60 - phase; | |
} | |
if(sub == 2) { | |
wall.col = 4 + phase; | |
wall.row = iteration - phase; | |
} | |
if(sub == 3) { | |
wall.col = 60 - phase; | |
wall.row = iteration; | |
} | |
wall.width = 1; | |
wall.height = 1; | |
wall.underConstruction = false; | |
} | |
} | |
} | |
var x = 0; | |
while(x < 18) { | |
var y = 0; | |
while(y < 18) { | |
if(y <= 3) { | |
if(x <= 2) { | |
++y; | |
continue; | |
} | |
var turret = config.defender.createBuilding("turret"); | |
turret.typeId = com_progrestar_framework_core_utils_RandomUtils.randomSelectFromArray([13,15,34]); | |
turret.level = 2; | |
turret.hp = com_progrestar_game_lib_building_BuildingLevelLib.get_instance().getByTypeId(turret.typeId,turret.level).get_attackData().get_hp(); | |
turret.col = x * 3 + 6 + (y % 2 != 0 ? 0 : 1); | |
turret.row = y * 3 + 6; | |
turret.width = 2; | |
turret.height = 2; | |
turret.attack.power = 50; | |
turret.attack.radiusMax = 6; | |
turret.attack.rechargeTime = 2; | |
turret.attack.splashRadius = 2; | |
turret.attack.bulletSpeed = 2; | |
turret.underConstruction = false; | |
} else { | |
var building = config.defender.createBuilding(y % 2 != 0 ? "mine" : "farm"); | |
building.typeId = y % 2 != 0 ? 2 : 4; | |
building.level = 1; | |
building.hp = com_progrestar_game_lib_building_BuildingLevelLib.get_instance().getByTypeId(building.typeId,building.level).get_attackData().get_hp(); | |
building.col = x * 3 + 6 + (y % 2 != 0 ? 0 : 1); | |
building.row = y * 3 + 6; | |
building.width = 2; | |
building.height = 2; | |
building.flip = com_progrestar_framework_core_utils_RandomUtils.randb(); | |
building.underConstruction = com_progrestar_framework_core_utils_RandomUtils.chance(0.3); | |
} | |
++y; | |
} | |
++x; | |
} | |
var spell = null; | |
spell = config.attacker.createSpell(); | |
spell.typeId = 1; | |
spell.power = 100; | |
spell.radius = 0; | |
spell.castTime = 0.8; | |
spell.amount = 1000; | |
spell.paidAmount = 6; | |
spell = config.attacker.createSpell(); | |
spell.typeId = 2; | |
spell.power = 50; | |
spell.radius = 3; | |
spell.castTime = 0.3; | |
spell.amount = 1000; | |
spell.paidAmount = 6; | |
spell = config.attacker.createSpell(); | |
spell.typeId = 4; | |
spell.power = 50; | |
spell.radius = 3; | |
spell.castTime = 0.4; | |
spell.amount = 1000; | |
spell.paidAmount = 6; | |
spell = config.attacker.createSpell(); | |
spell.typeId = 9; | |
spell.power = 50; | |
spell.radius = 3; | |
spell.castTime = 0.5; | |
spell.amount = 1000; | |
spell.paidAmount = 6; | |
spell = config.attacker.createSpell(); | |
spell.typeId = 13; | |
spell.power = 50; | |
spell.radius = 3; | |
spell.castTime = 0.3; | |
spell.amount = 1000; | |
spell.paidAmount = 6; | |
return config; | |
}; | |
battle_$pack_core_BattleConfigGenerator.prototype = { | |
__class__: battle_$pack_core_BattleConfigGenerator | |
}; | |
var com_progrestar_framework_core_IRelease = function() { }; | |
$hxClasses["com.progrestar.framework.core.IRelease"] = com_progrestar_framework_core_IRelease; | |
com_progrestar_framework_core_IRelease.__name__ = ["com","progrestar","framework","core","IRelease"]; | |
com_progrestar_framework_core_IRelease.prototype = { | |
release: null | |
,__class__: com_progrestar_framework_core_IRelease | |
}; | |
var battle_$pack_core_BattleProxy = function(controller,config,commands,maxReward,baseReward) { | |
this._sticksObject = { }; | |
this._pause = false; | |
this._battleStopped = false; | |
this._virtualTime = 0; | |
this._lastTime = 0; | |
this.STEP = 50; | |
this._config = config; | |
this._battle = new epicwar_haxe_battle_Battle(); | |
this._location = controller.get_location(); | |
if(config.type != "crusade") { | |
this._location.get_attacker().get_resources().set_pvpScore(0); | |
this._location.get_defender().get_resources().set_pvpScore(0); | |
this._location.get_defender().get_baseResources().set_pvpScore(0); | |
} | |
this._location.get_defender().get_resources().setCollection(maxReward); | |
this._location.get_defender().get_baseResources().setCollection(baseReward); | |
this._controller = controller; | |
com_progrestar_game_spell_purchase_BattleSpellPurchaseManager.get_instance().reset(); | |
this.start(this.get_location()); | |
this.get_location().setSize(this._config.map.cols,this._config.map.rows); | |
var _g = 0; | |
var _g1 = this._config.getRegions(); | |
while(_g < _g1.length) { | |
var region = _g1[_g]; | |
++_g; | |
this.onRegionCreated(region.col,region.row,region.width,region.height); | |
} | |
this._battle.configure(config); | |
this._location.get_defender().get_baseResources().set_pvpScore(this._location.get_defender().get_resources().get_pvpScore()); | |
if(commands != null) { | |
this._battle.cmd.autoPilot(commands); | |
} | |
this._battle.reportPvpScores(); | |
if(controller.get_record().validationRequired) { | |
this.pause(); | |
} else { | |
this.unpause(); | |
} | |
this._controller.battleFinished.add($bind(this,this.onBattleClosed)); | |
}; | |
$hxClasses["battle_pack.core.BattleProxy"] = battle_$pack_core_BattleProxy; | |
battle_$pack_core_BattleProxy.__name__ = ["battle_pack","core","BattleProxy"]; | |
battle_$pack_core_BattleProxy.__interfaces__ = [com_progrestar_framework_core_IRelease]; | |
battle_$pack_core_BattleProxy.prototype = { | |
STEP: null | |
,_lastTime: null | |
,_virtualTime: null | |
,_battle: null | |
,_config: null | |
,_controller: null | |
,_location: null | |
,_battleStopped: null | |
,_pause: null | |
,_sticksObject: null | |
,release: function() { | |
this._controller.battleFinished.remove($bind(this,this.onBattleClosed)); | |
this.stop(); | |
this._battle.finish(); | |
this._battle = null; | |
this._controller = null; | |
this._config = null; | |
} | |
,start: function(location) { | |
var cb = this._battle.events.cb; | |
cb._onBuildingCreated = $bind(this,this.onBuildingCreated); | |
cb._onBuildingSpawned = $bind(this,this.onBuildingSpawned); | |
cb._onBuildingActivated = $bind(this,this.onBuildingActivated); | |
cb._onSummonTypeAdded = $bind(this,this.onSummonTypeAdded); | |
cb._onUnitTypeAdded = $bind(this,this.onUnitTypeAdded); | |
cb._onUnitCreated = $bind(this,this.onUnitCreated); | |
cb._onUnitReplaced = $bind(this,this.onUnitReplaced); | |
cb._onNewUnitTarget = $bind(this,this.onNewUnitTarget); | |
cb._onUnitSpawned = $bind(this,this.onUnitSpawned); | |
cb._onSpellAdded = $bind(this,this.onSpellAdded); | |
cb._onSpellLaunched = $bind(this,this.onSpellLaunched); | |
cb._onActorHpChanged = $bind(this,this.onActorHpChanged); | |
cb._onBoostHp = $bind(this,this.onBoostHp); | |
cb._onStartAttack = $bind(this,this.onStartAttack); | |
cb._onFireCell = $bind(this,this.onFireCell); | |
cb._onFireTarget = $bind(this,this.onFireTarget); | |
cb._onUnitMove = $bind(this,this.onUnitMove); | |
cb._onCrystalEvent = $bind(this,this.onCrystalEvent); | |
cb._onLoot = $bind(this,this.onLoot); | |
cb._onLootCustom = $bind(this,this.onLootCustom); | |
cb._onLootStarsResource = $bind(this,this.onLootStarsResource); | |
cb._onProgress = $bind(this,this.onProgress); | |
cb._onStar = $bind(this,this.onStar); | |
cb._onLootStarsResource = $bind(this,this.onLootStarResource); | |
cb._onNewPvpScoreValue = $bind(this,this.onNewPvpScoreValue); | |
cb._onSpellBuy = $bind(this,this.onSpellBuy); | |
cb._onSpellPrice = $bind(this,this.onSpellPrice); | |
cb._onSpellNoPrice = $bind(this,this.onSpellNoPrice); | |
cb._onCrystalAdded = $bind(this,this.onCrystalAdded); | |
cb._onBattleFinished = $bind(this,this.onBattleFinished); | |
cb._onBuildingFillChanged = $bind(this,this.onBuildingFillChanged); | |
cb._onSkillStarted = $bind(this,this.onSkillStarted); | |
cb._onSkillProgress = $bind(this,this.onSkillProgress); | |
cb._onSkillApplied = $bind(this,this.onSkillApplied); | |
cb._onEffectApplied = $bind(this,this.onEffectApplied); | |
cb._onEffectRemoved = $bind(this,this.onEffectRemoved); | |
cb._onBuildingDisabled = $bind(this,this.onBuildingDisabled); | |
cb._onMoveDurationChanged = $bind(this,this.onMoveDurationChanged); | |
cb._onAttackSpeedFactor = $bind(this,this.onAttackSpeedFactor); | |
cb._onActorState = $bind(this,this.onActorState); | |
cb._onChangeVisible = $bind(this,this.onChangeVisible); | |
cb._onStick = $bind(this,this.onStick); | |
cb._onUnstick = $bind(this,this.onUnstick); | |
} | |
,stop: function() { | |
var cb = this._battle.events.cb; | |
cb._onBuildingCreated = null; | |
cb._onBuildingSpawned = null; | |
cb._onSummonTypeAdded = null; | |
cb._onUnitTypeAdded = null; | |
cb._onUnitCreated = null; | |
cb._onUnitReplaced = null; | |
cb._onUnitSpawned = null; | |
cb._onSpellAdded = null; | |
cb._onSpellLaunched = null; | |
cb._onActorHpChanged = null; | |
cb._onBoostHp = null; | |
cb._onStartAttack = null; | |
cb._onFireCell = null; | |
cb._onFireTarget = null; | |
cb._onUnitMove = null; | |
cb._onCrystalEvent = null; | |
cb._onLoot = null; | |
cb._onLootCustom = null; | |
cb._onLootStarsResource = null; | |
cb._onProgress = null; | |
cb._onStar = null; | |
cb._onNewPvpScoreValue = null; | |
cb._onSpellBuy = null; | |
cb._onSpellPrice = null; | |
cb._onSpellNoPrice = null; | |
cb._onCrystalAdded = null; | |
cb._onBattleFinished = null; | |
cb._onBuildingFillChanged = null; | |
cb._onSkillStarted = null; | |
cb._onSkillApplied = null; | |
cb._onEffectApplied = null; | |
cb._onEffectRemoved = null; | |
cb._onBuildingDisabled = null; | |
cb._onMoveDurationChanged = null; | |
cb._onAttackSpeedFactor = null; | |
cb._onActorState = null; | |
cb._onChangeVisible = null; | |
cb._onStick = null; | |
cb._onUnstick = null; | |
} | |
,onBuildingFillChanged: function(buildingId,storageFill) { | |
var building = StaticExt.kast(Std,this._location.getObject(buildingId),battle_$pack_location_building_BattleBuildingInstance); | |
if(building != null) { | |
building.get_storage().setup(com_progrestar_game_lib_ResourceLib.get_instance().getById(1),Math.round(storageFill * 1000),1000); | |
} | |
} | |
,onNewPvpScoreValue: function(attackerScore,defenderScore) { | |
this.output("pvp score: ",[attackerScore,defenderScore],["attackerScore","defenderScore"]); | |
this.get_location().get_attacker().get_resources().set_pvpScore(attackerScore); | |
this.get_location().get_defender().get_resources().set_pvpScore(defenderScore); | |
} | |
,onCrystalAdded: function(objectId,resourceId,crystalEffect,crystalLevel) { | |
var building = StaticExt.kast(Std,this._location.getObject(objectId),battle_$pack_location_building_BattleBuildingInstance); | |
var crystal = null; | |
if(building != null) { | |
crystal = com_progrestar_game_crystals_CrystalLib.get_instance().getById(resourceId); | |
building.insertCrystal(crystal); | |
} | |
var unit = StaticExt.kast(Std,this._location.getObject(objectId),battle_$pack_location_unit_UnitInstance); | |
if(unit != null) { | |
crystal = com_progrestar_game_crystals_CrystalLib.get_instance().getById(resourceId); | |
unit.insertCrystal(crystal); | |
} | |
} | |
,onFireCell: function(attackerId,bulletFlyTime,x,y,bulletId) { | |
this.output("fire cell: ",[attackerId,bulletFlyTime,x,y,bulletId],["attacker","bulletFlyTime","x","y","bulletId"]); | |
var object = this._location.getObject(attackerId); | |
object.fireByTile(bulletId,Math.ceil(bulletFlyTime / this.STEP) * this.STEP,x,y,null); | |
} | |
,onStartAttack: function(attackerId,x,y) { | |
this.output("attack: ",[attackerId,x,y],["attacker","x","y"]); | |
var object = this._location.getObject(attackerId); | |
object.startAttack(x,y); | |
} | |
,onFireTarget: function(attackerId,bulletFlyTime,targetId,bulletId) { | |
this.output("fire target: ",[attackerId,bulletFlyTime,targetId,bulletId],["attacker","bulletFlyTime","target","bulletId"]); | |
var object = this._location.getObject(attackerId); | |
object.fireByTarget(bulletId,Math.ceil(bulletFlyTime / this.STEP) * this.STEP,targetId); | |
} | |
,onLoot: function(buildingId,resourceId,amount) { | |
this.output("loot: ",[buildingId,resourceId,amount],["building","resource","amount"]); | |
var building = StaticExt.kast(Std,this._location.getObject(buildingId),battle_$pack_location_building_BattleBuildingInstance); | |
var resource = com_progrestar_game_lib_ResourceLib.get_instance().getById(resourceId); | |
var element = new com_progrestar_framework_collection_CollectionElement(resource,amount); | |
building.get_storage().farm(element); | |
this._location.get_attacker().get_resources().addItem(element.get_elementType(),element.get_amount()); | |
this._location.get_defender().get_resources().addItem(element.get_elementType(),-element.get_amount()); | |
if(resourceId == com_progrestar_game_data_promo_SaintPatrickController.instance.get_pseudoStarMoneyId()) { | |
com_progrestar_game_managers_leprechaun_$drop_LeprechaunDropManager.instance.spawn(building); | |
} | |
} | |
,onLootCustom: function(resourceId,amount) { | |
this.output("loot custom: ",[resourceId,amount],["resource","amount"]); | |
var resource = com_progrestar_game_lib_ResourceLib.get_instance().getById(resourceId); | |
var element = new com_progrestar_framework_collection_CollectionElement(resource,amount); | |
this._location.get_attacker().get_resources().addItem(element.get_elementType(),element.get_amount()); | |
this._location.get_defender().get_resources().addItem(element.get_elementType(),-element.get_amount()); | |
} | |
,onLootStarsResource: function(star,resourceId,amount) { | |
this.output("loot: ",[star,resourceId,amount],["star","resource","amount"]); | |
var resource = com_progrestar_game_lib_ResourceLib.get_instance().getById(resourceId); | |
var element = new com_progrestar_framework_collection_CollectionElement(resource,amount); | |
this._location.get_attacker().get_resources().addItem(element.get_elementType(),element.get_amount()); | |
this._location.get_defender().get_resources().addItem(element.get_elementType(),-element.get_amount()); | |
} | |
,onProgress: function(progressPercent) { | |
this.output("progress: ",[progressPercent],["progressPercent"]); | |
this._controller.scoreController.set_progress(progressPercent); | |
} | |
,onStar: function() { | |
this.output("star: ",[],[]); | |
var _g = this._controller.scoreController; | |
_g.set_stars(_g.get_stars() + 1); | |
} | |
,onLootStarResource: function(stars,resourceId,amount) { | |
var _gthis = this; | |
this.output("onLootStarResource: ",[stars,resourceId,amount],["stars","resource","amount"]); | |
var resource = com_progrestar_game_lib_ResourceLib.get_instance().getById(resourceId); | |
var element = new com_progrestar_framework_collection_CollectionElement(resource,amount); | |
if(this._controller.get_record().isCrusadeBattle) { | |
var onOneElementCreate = function(v) { | |
_gthis._location.get_defender().get_resources().addItem(element.get_elementType(),-1); | |
}; | |
var onOneElementRemove = function(v1) { | |
_gthis._location.get_attacker().get_resources().addItem(element.get_elementType(),1); | |
}; | |
com_progrestar_game_crusades_CrusadesManager.get_instance().animations.flyRewardOnBattle(element,onOneElementCreate,onOneElementRemove); | |
} else { | |
this._location.get_attacker().get_resources().addItem(element.get_elementType(),element.get_amount()); | |
this._location.get_defender().get_resources().addItem(element.get_elementType(),-element.get_amount()); | |
} | |
} | |
,onBattleFinished: function() { | |
var _g = 0; | |
var _g1 = this._location.getBuildings(); | |
while(_g < _g1.length) { | |
var building = _g1[_g]; | |
++_g; | |
if(building.get_state() != "Death" && (!js_Boot.__instanceof(building,battle_$pack_location_building_BattleTurretInstance) || StaticExt.kast(Std,building,battle_$pack_location_building_BattleTurretInstance).getFirstCharge() == null)) { | |
building.standBy(); | |
} | |
} | |
var _g2 = 0; | |
var _g11 = this._location.getUnits(); | |
while(_g2 < _g11.length) { | |
var unit = _g11[_g2]; | |
++_g2; | |
if(unit.get_state() != "Death") { | |
unit.standBy(); | |
} | |
} | |
this.output("battle finished: ",[],[]); | |
this._controller.onBattleFinished(); | |
} | |
,onBattleClosed: function(v) { | |
this._battleStopped = true; | |
} | |
,onActorHpChanged: function(objectId,hp) { | |
this.output("actor hp changed: ",[objectId,hp],["object","hp"]); | |
var hpf = hp / 1000; | |
var object = this.get_location().getObject(objectId); | |
com_progrestar_framework_core_Assert.isTrue(object != null,"invalid object id"); | |
object.setHP(hpf); | |
} | |
,onBoostHp: function(objectId,maxHp,hp) { | |
this.output("actor hp boost: ",[objectId,hp],["object","hp"]); | |
var hpf = hp / 1000; | |
var object = this.get_location().getObject(objectId); | |
com_progrestar_framework_core_Assert.isTrue(object != null,"invalid object id"); | |
object.setHP(hpf); | |
} | |
,onSpellLaunched: function(typeId,x,y,armyId) { | |
this.output("spell launched: ",[typeId,x,y],["type","x","y"]); | |
var spellLevel = this.get_location().get_attacker().get_spellsPackReserve().findSpellLevel(typeId); | |
com_progrestar_framework_core_Assert.isTrue(spellLevel != null,"spell is not founded in attacker reserve"); | |
this.get_location().launchSpell(spellLevel,this._battle.attacker.spells.get(typeId),x,y); | |
} | |
,buySpell: function(spellTypeId) { | |
this._battle.cmd.run("buySpell",spellTypeId); | |
} | |
,stopBattle: function() { | |
this.unpause(); | |
this._battle.cmd.run("finishBattle",0,0,0); | |
this._battle.tick(); | |
} | |
,onCrystalEvent: function(objectId,effect) { | |
this.output("crystal event: ",[objectId,effect],["object","effect"]); | |
var object = this.get_location().getObject(objectId); | |
com_progrestar_framework_core_Assert.isTrue(object != null,"invalid object id"); | |
object.crystalEvent(effect); | |
} | |
,onSpellAdded: function(typeId,level,amount,paidAmount,armyId) { | |
this.output("spell added: ",[typeId,level,amount,paidAmount],["type","level","amount","paidAmount"]); | |
var spellData = com_progrestar_game_data_spell_SpellLevelLib.get_instance().getByTypeId(typeId,level); | |
this.get_location().get_attacker().addSpellReserve(spellData,amount,paidAmount); | |
} | |
,onSpellBuy: function(spellTypeId) { | |
this.output("spell buy: ",[spellTypeId],["type"]); | |
this.get_location().get_attacker().addPaidSpell(spellTypeId); | |
} | |
,onRegionCreated: function(x,y,w,h) { | |
battle_$pack_location_building_BuildingFactory.placeRegion(this.get_location(),x,y,w,h); | |
} | |
,onBuildingCreated: function(buildingId,typeId,level,hp,flip,underConstruction) { | |
this.output("building created: ",[buildingId,typeId,level,hp,flip,underConstruction],["building","type","level","hp","flip","underConstruction"]); | |
var building = this._battle.getBuilding(buildingId); | |
var buildingLevel = com_progrestar_game_lib_building_BuildingLevelLib.get_instance().getByTypeId(typeId,level,true); | |
battle_$pack_location_building_BuildingFactory.createBuilding(this.get_location(),buildingId,buildingLevel,hp / 1000,flip,underConstruction,building.get_actor().flags); | |
} | |
,onBuildingSpawned: function(buildingId,x,y) { | |
this.output("building spawned: ",[buildingId,x,y],["building","x","y"]); | |
var building = StaticExt.kast(Std,this.get_location().getObject(buildingId),battle_$pack_location_building_BattleBuildingInstance); | |
com_progrestar_framework_core_Assert.isTrue(building != null,"invalid building id"); | |
building.spawn(x,y); | |
} | |
,onBuildingActivated: function(buildingId,splashRadius,attackViewId) { | |
this.output("building spawned: ",[buildingId,splashRadius,attackViewId],["buildingId","splashRadius","attackViewId"]); | |
var building = StaticExt.kast(Std,this.get_location().getObject(buildingId),battle_$pack_location_building_BattleBuildingInstance); | |
com_progrestar_framework_core_Assert.isTrue(building != null,"invalid building id"); | |
com_progrestar_framework_core_Assert.isTrue(js_Boot.__instanceof(building,battle_$pack_location_building_BattleTurretInstance),"invalid building type"); | |
StaticExt.kast(Std,building,battle_$pack_location_building_BattleTurretInstance).activated(splashRadius,attackViewId); | |
} | |
,onSummonTypeAdded: function(typeId,level) { | |
this.output("summon unit added: ",[typeId,level],["type","level"]); | |
var unitLevel = com_progrestar_game_unit_lib_UnitLevelLib.get_instance().getByTypeId(typeId,level); | |
if(unitLevel != null) { | |
this._location.addSummonUnit(unitLevel); | |
} | |
} | |
,onUnitTypeAdded: function(typeId,level,amount,armyId) { | |
this.output("unit added: ",[typeId,level,amount],["type","level","amount"]); | |
var unitLevel = com_progrestar_game_unit_lib_UnitLevelLib.get_instance().getByTypeId(typeId,level); | |
if(unitLevel != null) { | |
this._location.get_attacker().addUnitReserve(unitLevel,amount); | |
} | |
var heroLevel = com_progrestar_game_hero_lib_HeroLevelLib.get_instance().getByTypeId(typeId,level); | |
if(heroLevel != null) { | |
this._location.get_attacker().addUnitReserve(heroLevel,amount); | |
} | |
} | |
,onUnitCreated: function(id,typeId,hp) { | |
this.output("unit created: ",[id,typeId,hp],["id","type","hp"]); | |
var unitData = this.get_location().get_attacker().get_unitPacksReserve().findUnitLevel(typeId); | |
if(unitData == null) { | |
unitData = com_progrestar_game_collection_CollectionManager.findUnitLevel(typeId,this.get_location().get_summonUnitsReserve()); | |
} | |
com_progrestar_framework_core_Assert.isTrue(unitData != null,"unit was not found in attacker reserve"); | |
battle_$pack_location_unit_UnitFactory.createUnit(this._location,id,unitData,hp / 1000); | |
} | |
,onUnitReplaced: function(idA,idB,kill) { | |
this.output("unit replaced: ",[idA,idB,kill],["idA","idB","kill"]); | |
if(kill) { | |
var unit = StaticExt.kast(Std,this.get_location().getObject(idB),battle_$pack_location_unit_UnitInstance); | |
unit.setHP(0); | |
} | |
} | |
,onNewUnitTarget: function(unitId,buildingId) { | |
var unit = StaticExt.kast(Std,this.get_location().getObject(unitId),battle_$pack_location_unit_UnitInstance); | |
if(unit.getIsFirstTarget()) { | |
unit.firstTargetFround(); | |
var buildingInstance = StaticExt.kast(Std,this.get_location().getObject(buildingId),battle_$pack_location_building_BattleBuildingInstance); | |
buildingInstance.setTargetBy(); | |
} | |
} | |
,onUnitSpawned: function(unitId,x,y,armyId) { | |
this.output("unit spawned: ",[unitId,x,y],["unit","x","y"]); | |
var unit = StaticExt.kast(Std,this.get_location().getObject(unitId),battle_$pack_location_unit_UnitInstance); | |
com_progrestar_framework_core_Assert.isTrue(unit != null,"invalid unit id"); | |
unit.spawn(x,y); | |
} | |
,onUnitMove: function(unitId,moveDuration,x,y) { | |
this.output("unit move: ",[unitId,moveDuration,x,y],["unit","moveDuration","x","y"]); | |
var unit = StaticExt.kast(Std,this.get_location().getObject(unitId),battle_$pack_location_unit_UnitInstance); | |
com_progrestar_framework_core_Assert.isTrue(unit != null,"invalid unit id"); | |
unit.startMove(x,y,moveDuration); | |
this.updateStickedObjects(unitId); | |
} | |
,update: function() { | |
if(this._lastTime == 0) { | |
this._lastTime = Math.round(new Date().getTime() / 1000 * 1000); | |
} | |
var currentTime = Math.round(new Date().getTime() / 1000 * 1000); | |
var speed = battle_$pack_location_location_$view_SceneConfig.instance.gameSpeed.get_value(); | |
var deltaTime = (currentTime - this._lastTime) * speed; | |
this._lastTime = currentTime; | |
if(!this._pause && !this._battleStopped) { | |
this._virtualTime += deltaTime; | |
} | |
var nextTime = this._battle.time + 50; | |
while(this._virtualTime >= nextTime && !this._battle.isFinished() && !this._battleStopped && !this._pause) { | |
this._battle.tick(); | |
if(this._battle == null) { | |
return; | |
} | |
nextTime = this._battle.time + 50; | |
} | |
if(!this._battle.isFinished() && !this._battleStopped && !this._pause) { | |
this._location.tick(deltaTime); | |
} | |
} | |
,get_battle: function() { | |
return this._battle; | |
} | |
,get_config: function() { | |
return this._config; | |
} | |
,get_location: function() { | |
return this._location; | |
} | |
,onSpellPrice: function(spellTypeId,price) { | |
this.output("spellPrice",[spellTypeId,price],["spellTypeId","price"]); | |
var spell = com_progrestar_game_data_spell_SpellLib.get_instance().getById(spellTypeId); | |
if(spell != null) { | |
com_progrestar_game_spell_purchase_BattleSpellPurchaseManager.get_instance().setCost(spell,price); | |
} | |
} | |
,onSpellNoPrice: function(spellTypeId) { | |
this.output("spellNoPrice",[spellTypeId],["spellTypeId"]); | |
var spell = com_progrestar_game_data_spell_SpellLib.get_instance().getById(spellTypeId); | |
if(spell != null) { | |
com_progrestar_game_spell_purchase_BattleSpellPurchaseManager.get_instance().setCost(spell,0); | |
} | |
} | |
,onSkillStarted: function(id,type,objectId,data) { | |
this.output("onSkillStarted",[type,objectId,data],["type","objectId","data"]); | |
var objectInstance = this._location.getObject(objectId); | |
objectInstance.startSkill(type,data); | |
} | |
,onSkillProgress: function(id,type,objectId,progress) { | |
this.output("onSkillProgress",[type,objectId,progress],["type","objectId","progress"]); | |
var objectInstance = this._location.getObject(objectId); | |
objectInstance.setSkillProgress(type,progress); | |
} | |
,onSkillApplied: function(id,type,objectId,data) { | |
this.output("skillApllied",[type,objectId,JSON.stringify(data)],["type","objectId","data"]); | |
var objectInstance = this._location.getObject(objectId); | |
objectInstance.applySkill(id,type,data); | |
} | |
,onEffectApplied: function(id,type,viewType,objectId) { | |
this.output("effectAdd",[id,type,viewType,objectId],["id","type","viewType","objectId"]); | |
var objectInstance = this._location.getObject(objectId); | |
objectInstance.addEffect(id,type,viewType); | |
} | |
,onEffectProlonged: function(id,objectId) { | |
this.output("effectProlonged",[id,objectId],["id","objectId"]); | |
var objectInstance = this._location.getObject(objectId); | |
objectInstance.prolongEffect(id); | |
} | |
,onEffectRemoved: function(id,objectId) { | |
this.output("effectRemoved",[id,objectId],["id","objectId"]); | |
var objectInstance = this._location.getObject(objectId); | |
objectInstance.removeEffect(id); | |
} | |
,onBuildingDisabled: function(id) { | |
this.output("buildingDisabled",[id],["id"]); | |
var building = StaticExt.kast(Std,this._location.getObject(id),battle_$pack_location_building_BattleBuildingInstance); | |
if(building.get_buildingData().get_buildingLibItem().get_isTurret()) { | |
building.deactivate(); | |
} | |
} | |
,onMoveDurationChanged: function(id,duration) { | |
this.output("moveDurationChanged",[id,duration],["id","duration"]); | |
var unit = StaticExt.kast(Std,this.get_location().getObject(id),battle_$pack_location_unit_UnitInstance); | |
com_progrestar_framework_core_Assert.isTrue(unit != null,"invalid unit id"); | |
unit.changeMoveDuration(duration); | |
} | |
,onAttackSpeedFactor: function(id,factor) { | |
this.output("Attack speed of object changed by factor ",[id,factor],["id","factor"]); | |
var unit = StaticExt.kast(Std,this.get_location().getObject(id),battle_$pack_location_unit_UnitInstance); | |
if(unit != null) { | |
unit.changeAttackSpeedFactor(factor); | |
} | |
} | |
,onActorState: function(actorId,viewState) { | |
this.output("Actor state changed ",[actorId,viewState],["actorId","viewState"]); | |
var object = this.get_location().getObject(actorId); | |
object.setStateId(viewState); | |
} | |
,onChangeVisible: function(actorId,visible) { | |
this.output("Actor visible changed",[actorId,visible],["actorId","visible"]); | |
var object = this.get_location().getObject(actorId); | |
object.setVisible(visible); | |
} | |
,onUnstick: function(actorId) { | |
this.output("Unstick ",[actorId],["actorId"]); | |
var object = StaticExt.kast(Std,this.get_location().getObject(actorId),battle_$pack_location_unit_UnitInstance); | |
var _g = 0; | |
var _g1 = Reflect.fields(this._sticksObject); | |
while(_g < _g1.length) { | |
var targetId = _g1[_g]; | |
++_g; | |
if(Reflect.field(this._sticksObject,targetId) == actorId) { | |
Reflect.deleteField(this._sticksObject,targetId); | |
break; | |
} | |
} | |
object.standBy(); | |
} | |
,onStick: function(actorId,targetId) { | |
this.output("Stick ",[actorId,targetId],["actorId","targetId"]); | |
var object = this.get_location().getObject(actorId); | |
var target = this.get_location().getObject(targetId); | |
this._sticksObject[targetId == null ? "null" : "" + targetId] = actorId; | |
this.updateStickedObjects(targetId,true); | |
} | |
,updateStickedObjects: function(unitId,immidiate) { | |
if(immidiate == null) { | |
immidiate = false; | |
} | |
if(Reflect.field(this._sticksObject,unitId == null ? "null" : "" + unitId) != null) { | |
var unit = StaticExt.kast(Std,this.get_location().getObject(unitId),battle_$pack_location_unit_UnitInstance); | |
var stickedObjectId = Reflect.field(this._sticksObject,unitId == null ? "null" : "" + unitId); | |
var stickedObject = StaticExt.kast(Std,this.get_location().getObject(stickedObjectId),battle_$pack_location_unit_UnitInstance); | |
if(immidiate) { | |
var moveFinishX = null; | |
var moveFinishY = null; | |
if(unit.get_moveState().running) { | |
moveFinishX = unit.get_moveState().targetX; | |
moveFinishY = unit.get_moveState().targetY; | |
} else { | |
moveFinishX = unit.get_x(); | |
moveFinishY = unit.get_y(); | |
} | |
var U = null; | |
var V = null; | |
var moveProgress = com_progrestar_framework_core_utils_MathUtils.clampf((this.get_location().get_locationTime() - unit.get_moveState().startTime) / unit.get_moveState().duration,0,1); | |
if(unit.get_moveState().running) { | |
U = moveProgress; | |
} else { | |
U = 0; | |
} | |
if(U < 0) { | |
U = 0; | |
} else if(U > 1) { | |
U = 1; | |
} | |
V = 1 - U; | |
var tileX = unit.get_x() * V + U * moveFinishX; | |
var tileY = unit.get_y() * V + U * moveFinishY; | |
stickedObject.setPosition(tileX,tileY); | |
if(unit.get_moveState().running) { | |
stickedObject.startMove(unit.get_moveState().targetX,unit.get_moveState().targetY,unit.get_moveState().duration - (this.get_location().get_locationTime() - unit.get_moveState().startTime)); | |
} | |
} else { | |
stickedObject.startMove(unit.get_moveState().targetX,unit.get_moveState().targetY,unit.get_moveState().duration); | |
} | |
} | |
} | |
,output: function(name,values,keys) { | |
if(!battle_$pack_location_location_$view_SceneConfig.instance.showLog.get_value()) { | |
return; | |
} | |
var items = []; | |
var _g1 = 0; | |
var _g = values.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
var value = values[i]; | |
items.push(keys[i] + ":" + Std.string(value)); | |
} | |
com_progrestar_framework_core_utils_TraceUtils.consoleLogA(["BATTLE:",com_progrestar_cas_utils_StringUtils.amountToStr(this._battle.time) + ":",name,items]); | |
} | |
,unpause: function() { | |
this._pause = false; | |
} | |
,pause: function() { | |
this._pause = true; | |
} | |
,get_isPaused: function() { | |
return this._pause; | |
} | |
,__class__: battle_$pack_core_BattleProxy | |
,__properties__: {get_isPaused:"get_isPaused",get_location:"get_location",get_config:"get_config",get_battle:"get_battle"} | |
}; | |
var battle_$pack_core_MouseMoveController = function(data,listener) { | |
this.data = data; | |
this.listener = listener; | |
listener.addEventListener("mouseMove",$bind(this,this.onMoveCursor)); | |
}; | |
$hxClasses["battle_pack.core.MouseMoveController"] = battle_$pack_core_MouseMoveController; | |
battle_$pack_core_MouseMoveController.__name__ = ["battle_pack","core","MouseMoveController"]; | |
battle_$pack_core_MouseMoveController.prototype = { | |
listener: null | |
,data: null | |
,release: function() { | |
this.listener.removeEventListener("mouseMove",$bind(this,this.onMoveCursor)); | |
this.data = null; | |
this.listener = null; | |
} | |
,onMoveCursor: function(event) { | |
this.data.cursor.position.set_value(this.data.get_transform().screenToModel(this.listener.stage.get_mouseX(),this.listener.stage.get_mouseY())); | |
} | |
,__class__: battle_$pack_core_MouseMoveController | |
}; | |
var battle_$pack_core_deploy_DeployController = function(data,proxy,listener) { | |
this.data = data; | |
this.proxy = proxy; | |
this.listener = listener; | |
this._repeaterFirstInterval = com_progrestar_game_lib_RuleLib.getRepeaterFirstInterval(); | |
this._repeaterSecondInterval = com_progrestar_game_lib_RuleLib.getRepeaterSecondInterval(); | |
this._repeaterBaseInterval = com_progrestar_game_lib_RuleLib.getRepeaterBaseInterval(); | |
this._repeaterMinInterval = com_progrestar_game_lib_RuleLib.getRepeaterMinInterval(); | |
this._shiftFirstInterval = com_progrestar_game_lib_RuleLib.getShiftRepeaterFirstInterval(); | |
this._shiftSecondInterval = com_progrestar_game_lib_RuleLib.getShiftRepeaterSecondInterval(); | |
this._shiftBaseInterval = com_progrestar_game_lib_RuleLib.getShiftRepeaterBaseInterval(); | |
this._shiftMinInterval = com_progrestar_game_lib_RuleLib.getShiftRepeaterMinInterval(); | |
this.unitDeployer = new com_progrestar_cas_utils_MouseRepeater(listener,listener,$bind(this,this.onUnitDeploy),this._repeaterFirstInterval,this._repeaterSecondInterval,this._repeaterBaseInterval,this._repeaterMinInterval,0.95); | |
this.spellDeployer = new com_progrestar_cas_utils_MouseRepeater(listener,listener,$bind(this,this.onSpellDeploy),Infinity,Infinity,3,1,0.95); | |
data.get_scene().get_camera().get_changed().add($bind(this,this.cancelDeploy)); | |
listener.addEventListener("mouseMove",$bind(this,this.onMoveCursor)); | |
listener.addEventListener("mouseDown",$bind(this,this.onMouseDown),false,10000); | |
listener.addEventListener("mouseUp",$bind(this,this.onMouseUp),false,10000); | |
}; | |
$hxClasses["battle_pack.core.deploy.DeployController"] = battle_$pack_core_deploy_DeployController; | |
battle_$pack_core_deploy_DeployController.__name__ = ["battle_pack","core","deploy","DeployController"]; | |
battle_$pack_core_deploy_DeployController.prototype = { | |
listener: null | |
,proxy: null | |
,unitDeployer: null | |
,spellDeployer: null | |
,data: null | |
,_repeaterFirstInterval: null | |
,_repeaterSecondInterval: null | |
,_repeaterBaseInterval: null | |
,_repeaterMinInterval: null | |
,_shiftFirstInterval: null | |
,_shiftSecondInterval: null | |
,_shiftBaseInterval: null | |
,_shiftMinInterval: null | |
,release: function() { | |
com_progrestar_framework_time_Time.stop($bind(this,this.hideUnitDeployLock)); | |
this.hideUnitDeployLock(); | |
this.data.get_scene().get_camera().get_changed().remove($bind(this,this.cancelDeploy)); | |
this.listener.removeEventListener("mouseMove",$bind(this,this.onMoveCursor)); | |
this.listener.removeEventListener("mouseDown",$bind(this,this.onMouseDown)); | |
this.listener.removeEventListener("mouseUp",$bind(this,this.onMouseUp)); | |
this.listener.removeEventListener("rightMouseDown",$bind(this,this.onSpellDeploy)); | |
this.unitDeployer.release(); | |
this.spellDeployer.release(); | |
this.unitDeployer = null; | |
this.spellDeployer = null; | |
this.proxy = null; | |
this.data = null; | |
this.listener = null; | |
} | |
,onMoveCursor: function(event) { | |
this.data.cursor.position.set_value(this.data.get_transform().screenToModel(this.listener.stage.get_mouseX(),this.listener.stage.get_mouseY())); | |
} | |
,onMouseDown: function(event) { | |
if(event.shiftKey) { | |
this.setShiftRepeaterIntervals(); | |
} else { | |
this.setDefaultRepeaterIntervals(); | |
} | |
} | |
,onMouseUp: function(event) { | |
this.setDefaultRepeaterIntervals(); | |
} | |
,setShiftRepeaterIntervals: function() { | |
this.unitDeployer.updateIntervals(this._shiftFirstInterval,this._shiftSecondInterval,this._shiftBaseInterval,this._shiftMinInterval); | |
} | |
,setDefaultRepeaterIntervals: function() { | |
this.unitDeployer.updateIntervals(this._repeaterFirstInterval,this._repeaterSecondInterval,this._repeaterBaseInterval,this._repeaterMinInterval); | |
} | |
,cancelDeploy: function(v) { | |
this.unitDeployer.stop(); | |
this.spellDeployer.stop(); | |
} | |
,onUnitDeploy: function(v) { | |
var selectedItem = this.data.cursor.item.get_value(); | |
var unit = StaticExt.kast(Std,selectedItem,com_progrestar_game_unit_lib_UnitLevelLibItem); | |
if(unit == null) { | |
return "blocked"; | |
} | |
var selectedPosition = this.data.cursor.position.get_value(); | |
var tile = this.data.get_location().get_surface().getTile(Math.floor(selectedPosition.x),Math.floor(selectedPosition.y)); | |
if(tile == null || tile.lock.deployAir || tile.lock.deployGround) { | |
this.showUnitLock(); | |
return "blocked"; | |
} | |
var _this = this.proxy.get_battle().map; | |
var col = tile.position.get_x() | 0; | |
var row = tile.position.get_y() | 0; | |
var walkable = 0 <= col && col < _this.cols && 0 <= row && row < _this.rows && _this.data[col][row]; | |
if(!walkable) { | |
this.showUnitLock(); | |
return "blocked"; | |
} | |
var _this1 = this.proxy.get_battle().map; | |
var col1 = tile.position.get_x() | 0; | |
var row1 = tile.position.get_y() | 0; | |
var inside = 0 <= col1 && col1 < _this1.cols && 0 <= row1 && row1 < _this1.rows; | |
if(!inside) { | |
this.showUnitLock(); | |
return "blocked"; | |
} | |
if(this.proxy.get_battle().isFinished()) { | |
return "blocked"; | |
} | |
if(this.data.get_locationConfig().useFoundation.get_value()) { | |
var hasFoundation = false; | |
var _g = 0; | |
var _g1 = tile.buildings; | |
while(_g < _g1.length) { | |
var building = _g1[_g]; | |
++_g; | |
if(building.get_buildingData().get_buildingType() == "foundation") { | |
hasFoundation = true; | |
break; | |
} | |
} | |
if(!hasFoundation) { | |
this.showUnitLock(); | |
return "blocked"; | |
} | |
} | |
this.proxy.unpause(); | |
this.proxy.get_battle().cmd.run("spawn",unit.get_unit().get_id(),Math.floor(tile.position.get_x()),Math.floor(tile.position.get_y())); | |
return "allowed"; | |
} | |
,showUnitLock: function() { | |
if(this.data.get_config().blockShowUnitDeployLock.get_value()) { | |
return; | |
} | |
this.data.get_config().showUnitDeployLock.set_value(true); | |
com_progrestar_game_ui_UI.showSmartText(null,"T_CANT_DEPLOY_THERE"); | |
com_progrestar_framework_time_Time.start($bind(this,this.hideUnitDeployLock),3,1,null,true); | |
} | |
,hideUnitDeployLock: function(v) { | |
if(this.data.get_config().blockShowUnitDeployLock.get_value()) { | |
return; | |
} | |
this.data.get_config().showUnitDeployLock.set_value(false); | |
} | |
,onSpellDeploy: function(v) { | |
var selectedPosition = this.data.cursor.position.get_value(); | |
var selectedItem = this.data.cursor.item.get_value(); | |
var spell = StaticExt.kast(Std,selectedItem,com_progrestar_game_data_spell_SpellLevelLibItem); | |
if(spell == null) { | |
return "blocked"; | |
} | |
if(this.proxy.get_battle().isFinished()) { | |
return "blocked"; | |
} | |
var _this = this.proxy.get_battle().map; | |
var col = Math.floor(selectedPosition.x); | |
var row = Math.floor(selectedPosition.y); | |
if(0 <= col && col < _this.cols && 0 <= row && row < _this.rows) { | |
this.proxy.unpause(); | |
this.proxy.get_battle().cmd.run("cast",spell.get_spellLibItem().get_id(),selectedPosition.x | 0,selectedPosition.y | 0); | |
return "allowed"; | |
} else { | |
com_progrestar_game_ui_UI.showSmartText(null,"T_CANT_DEPLOY_THERE"); | |
return "blocked"; | |
} | |
} | |
,__class__: battle_$pack_core_deploy_DeployController | |
}; | |
var battle_$pack_location_LocationInstance = function(defender) { | |
this._listener = new battle_$pack_location_LocationListener(); | |
this._summonUnitsReserve = new com_progrestar_game_collection_Collection(); | |
this._surface = new battle_$pack_location_surface_SurfaceInstance(); | |
this.units = new battle_$pack_location_abstr_UnitRegistry(); | |
this.bullets = new battle_$pack_location_abstr_BulletRegistry(); | |
this.buildings = new battle_$pack_location_abstr_BuildingRegistry(); | |
this.objects = new battle_$pack_location_abstr_ObjectRegistry(); | |
this._ticker = new com_progrestar_framework_time_ManualTicker(); | |
this._locationTime = 0; | |
this.plugConnector = new battle_$pack_location_building_view_plug_PlugConnector(); | |
this._defender = new battle_$pack_location_owner_OwnerInstance(defender); | |
this._summonUnitsReserve.set_saveZero(true); | |
}; | |
$hxClasses["battle_pack.location.LocationInstance"] = battle_$pack_location_LocationInstance; | |
battle_$pack_location_LocationInstance.__name__ = ["battle_pack","location","LocationInstance"]; | |
battle_$pack_location_LocationInstance.prototype = { | |
plugConnector: null | |
,_locationTime: null | |
,_ticker: null | |
,objects: null | |
,buildings: null | |
,bullets: null | |
,units: null | |
,_surface: null | |
,_defender: null | |
,_attacker: null | |
,_summonUnitsReserve: null | |
,_listener: null | |
,release: function() { | |
this._ticker.release(); | |
this.objects.release(); | |
this.buildings.release(); | |
this.bullets.release(); | |
this.units.release(); | |
this._surface.release(); | |
this._defender.release(); | |
if(this._attacker != null) { | |
this._attacker.release(); | |
} | |
this._listener.release(); | |
this._summonUnitsReserve.release(); | |
this._summonUnitsReserve = null; | |
this._ticker = null; | |
this.objects = null; | |
this.buildings = null; | |
this.bullets = null; | |
this.units = null; | |
this._surface = null; | |
this._defender = null; | |
this._attacker = null; | |
this._listener = null; | |
this.plugConnector = null; | |
} | |
,setAttacker: function(link) { | |
if(this._attacker != null) { | |
this._attacker.release(); | |
this._attacker = null; | |
} | |
if(link != null) { | |
this._attacker = new battle_$pack_location_owner_OwnerInstance(link); | |
} | |
} | |
,registerBuilding: function(building) { | |
var buildingId = building.get_id(); | |
com_progrestar_framework_core_Assert.isTrue(this.objects.getItem(buildingId) == null,"building by id " + buildingId + " already exist"); | |
this.buildings.addItem(buildingId,building); | |
this.objects.addItem(buildingId,building); | |
} | |
,registerUnit: function(unit) { | |
var unitId = unit.get_id(); | |
com_progrestar_framework_core_Assert.isTrue(this.objects.getItem(unitId) == null,"unit by id " + unitId + " already exist"); | |
this.units.addItem(unitId,unit); | |
this.objects.addItem(unitId,unit); | |
} | |
,registerBullet: function(bullet) { | |
var bulletId = bullet.id; | |
com_progrestar_framework_core_Assert.isTrue(this.bullets.getItem(bulletId) == null,"bullet by id " + bulletId + " already exist"); | |
this.bullets.addItem(bulletId,bullet); | |
this._listener.bulletCreated.dispatch(bullet); | |
} | |
,launchSpell: function(spellData,battleSpell,x,y) { | |
com_progrestar_framework_core_Assert.isTrue(spellData != null,"undefined spell data"); | |
this._attacker.deploySpell(spellData); | |
var spell = new battle_$pack_location_spell_SpellInstance(); | |
spell.spellData = spellData; | |
spell.castTime = battleSpell.castTime; | |
spell.lifeTime = battleSpell.lifeTime; | |
spell.x = x; | |
spell.y = y; | |
this._listener.spellSpawned.dispatch(spell); | |
return spell; | |
} | |
,getObject: function(objectId) { | |
return this.objects.getItem(objectId); | |
} | |
,tick: function(deltaTime) { | |
this._ticker.tick(deltaTime | 0); | |
this._locationTime += deltaTime | 0; | |
} | |
,addSummonUnit: function(unitData) { | |
com_progrestar_framework_core_Assert.isTrue(unitData != null,"unknown unit type"); | |
this._summonUnitsReserve.setItem(unitData,0); | |
} | |
,get_summonUnitsReserve: function() { | |
return this._summonUnitsReserve; | |
} | |
,setSize: function(x,y) { | |
this._surface.setSize(x,y); | |
} | |
,get_locationTime: function() { | |
return this._locationTime; | |
} | |
,get_defender: function() { | |
return this._defender; | |
} | |
,get_attacker: function() { | |
return this._attacker; | |
} | |
,getBuildings: function() { | |
return this.buildings.getItems(); | |
} | |
,getUnits: function() { | |
return this.units.getItems(); | |
} | |
,get_surface: function() { | |
return this._surface; | |
} | |
,get_ticker: function() { | |
return this._ticker; | |
} | |
,get_listener: function() { | |
return this._listener; | |
} | |
,__class__: battle_$pack_location_LocationInstance | |
,__properties__: {get_listener:"get_listener",get_ticker:"get_ticker",get_surface:"get_surface",get_attacker:"get_attacker",get_defender:"get_defender",get_locationTime:"get_locationTime",get_summonUnitsReserve:"get_summonUnitsReserve"} | |
}; | |
var battle_$pack_location_LocationListener = function() { | |
this.spellSpawned = new utils_signals_Signal(); | |
this.bulletCreated = new utils_signals_Signal(); | |
this.buildingSpawnedSignal = new utils_signals_Signal(); | |
this.objectKilledSignal = new utils_signals_Signal(); | |
this.unitSpawnedSignal = new utils_signals_Signal(); | |
}; | |
$hxClasses["battle_pack.location.LocationListener"] = battle_$pack_location_LocationListener; | |
battle_$pack_location_LocationListener.__name__ = ["battle_pack","location","LocationListener"]; | |
battle_$pack_location_LocationListener.prototype = { | |
unitSpawnedSignal: null | |
,objectKilledSignal: null | |
,buildingSpawnedSignal: null | |
,bulletCreated: null | |
,spellSpawned: null | |
,release: function() { | |
StaticExt.release(this.unitSpawnedSignal); | |
StaticExt.release(this.objectKilledSignal); | |
StaticExt.release(this.buildingSpawnedSignal); | |
StaticExt.release(this.bulletCreated); | |
StaticExt.release(this.spellSpawned); | |
} | |
,__class__: battle_$pack_location_LocationListener | |
}; | |
var battle_$pack_location_abstr_BuildingRegistry = function() { | |
this.items = []; | |
this.map = new haxe_ds_IntMap(); | |
}; | |
$hxClasses["battle_pack.location.abstr.BuildingRegistry"] = battle_$pack_location_abstr_BuildingRegistry; | |
battle_$pack_location_abstr_BuildingRegistry.__name__ = ["battle_pack","location","abstr","BuildingRegistry"]; | |
battle_$pack_location_abstr_BuildingRegistry.prototype = { | |
map: null | |
,items: null | |
,release: function() { | |
var self = this.items; | |
self.length = 0; | |
this.items = null; | |
this.map = null; | |
} | |
,addItem: function(key,value) { | |
com_progrestar_framework_core_Assert.isTrue(this.map.h[key] == null,"duplicate key: " + key); | |
this.items.push(value); | |
this.map.h[key] = value; | |
} | |
,getItem: function(key) { | |
return this.items[key]; | |
} | |
,getItems: function() { | |
return this.items.slice(); | |
} | |
,__class__: battle_$pack_location_abstr_BuildingRegistry | |
}; | |
var battle_$pack_location_abstr_BulletRegistry = function() { | |
this.items = []; | |
this.map = new haxe_ds_IntMap(); | |
}; | |
$hxClasses["battle_pack.location.abstr.BulletRegistry"] = battle_$pack_location_abstr_BulletRegistry; | |
battle_$pack_location_abstr_BulletRegistry.__name__ = ["battle_pack","location","abstr","BulletRegistry"]; | |
battle_$pack_location_abstr_BulletRegistry.__interfaces__ = [com_progrestar_framework_core_IRelease]; | |
battle_$pack_location_abstr_BulletRegistry.prototype = { | |
map: null | |
,items: null | |
,release: function() { | |
var self = this.items; | |
self.length = 0; | |
this.items = null; | |
this.map = null; | |
} | |
,addItem: function(key,value) { | |
com_progrestar_framework_core_Assert.isTrue(this.map.h[key] == null,"duplicate key: " + key); | |
this.items.push(value); | |
this.map.h[key] = value; | |
} | |
,getItem: function(key) { | |
return this.map.h[key]; | |
} | |
,getItems: function() { | |
return this.items.slice(); | |
} | |
,__class__: battle_$pack_location_abstr_BulletRegistry | |
}; | |
var battle_$pack_location_abstr_ObjectRegistry = function() { | |
this.items = []; | |
this.map = utils_ds__$JSMap_JSMap_$Impl_$._new(); | |
}; | |
$hxClasses["battle_pack.location.abstr.ObjectRegistry"] = battle_$pack_location_abstr_ObjectRegistry; | |
battle_$pack_location_abstr_ObjectRegistry.__name__ = ["battle_pack","location","abstr","ObjectRegistry"]; | |
battle_$pack_location_abstr_ObjectRegistry.prototype = { | |
map: null | |
,items: null | |
,release: function() { | |
var _g = 0; | |
var _g1 = this.items; | |
while(_g < _g1.length) { | |
var value = _g1[_g]; | |
++_g; | |
value.release(); | |
} | |
var self = this.items; | |
self.length = 0; | |
this.items = null; | |
this.map = null; | |
} | |
,addItem: function(key,value) { | |
com_progrestar_framework_core_Assert.isTrue(this.map.get(key) == null,"duplicate key: " + key); | |
this.items.push(value); | |
this.map.set(key,value); | |
} | |
,getItem: function(key) { | |
return this.map.get(key); | |
} | |
,getItems: function() { | |
return this.items.slice(); | |
} | |
,__class__: battle_$pack_location_abstr_ObjectRegistry | |
}; | |
var battle_$pack_location_abstr_UnitRegistry = function() { | |
this.items = []; | |
this.map = utils_ds__$JSMap_JSMap_$Impl_$._new(); | |
}; | |
$hxClasses["battle_pack.location.abstr.UnitRegistry"] = battle_$pack_location_abstr_UnitRegistry; | |
battle_$pack_location_abstr_UnitRegistry.__name__ = ["battle_pack","location","abstr","UnitRegistry"]; | |
battle_$pack_location_abstr_UnitRegistry.prototype = { | |
map: null | |
,items: null | |
,release: function() { | |
var self = this.items; | |
self.length = 0; | |
this.items = null; | |
this.map = null; | |
} | |
,addItem: function(key,value) { | |
com_progrestar_framework_core_Assert.isTrue(this.map.get(key) == null,"duplicate key: " + key); | |
this.items.push(value); | |
this.map.set(key,value); | |
} | |
,getItem: function(key) { | |
return this.items[key]; | |
} | |
,getItems: function() { | |
return this.items.slice(); | |
} | |
,__class__: battle_$pack_location_abstr_UnitRegistry | |
}; | |
var com_progrestar_framework_scene_core_IController = function() { }; | |
$hxClasses["com.progrestar.framework.scene.core.IController"] = com_progrestar_framework_scene_core_IController; | |
com_progrestar_framework_scene_core_IController.__name__ = ["com","progrestar","framework","scene","core","IController"]; | |
com_progrestar_framework_scene_core_IController.__interfaces__ = [com_progrestar_framework_core_IRelease]; | |
com_progrestar_framework_scene_core_IController.prototype = { | |
setup: null | |
,__class__: com_progrestar_framework_scene_core_IController | |
}; | |
var com_progrestar_framework_scene_core_AbstractController = function() { | |
}; | |
$hxClasses["com.progrestar.framework.scene.core.AbstractController"] = com_progrestar_framework_scene_core_AbstractController; | |
com_progrestar_framework_scene_core_AbstractController.__name__ = ["com","progrestar","framework","scene","core","AbstractController"]; | |
com_progrestar_framework_scene_core_AbstractController.__interfaces__ = [com_progrestar_framework_scene_core_IController]; | |
com_progrestar_framework_scene_core_AbstractController.prototype = { | |
_holder: null | |
,setup: function(holder) { | |
this._holder = holder; | |
if(holder != null) { | |
this.start(); | |
} | |
} | |
,start: function() { | |
} | |
,finish: function() { | |
} | |
,get_holder: function() { | |
return this._holder; | |
} | |
,release: function() { | |
if(this._holder != null) { | |
this.finish(); | |
this._holder.removeController(this); | |
this._holder = null; | |
} | |
} | |
,__class__: com_progrestar_framework_scene_core_AbstractController | |
,__properties__: {get_holder:"get_holder"} | |
}; | |
var battle_$pack_location_abstr_view_LifeController = function(building,child) { | |
this.contains = false; | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
this.building = building; | |
this.child = child; | |
}; | |
$hxClasses["battle_pack.location.abstr.view.LifeController"] = battle_$pack_location_abstr_view_LifeController; | |
battle_$pack_location_abstr_view_LifeController.__name__ = ["battle_pack","location","abstr","view","LifeController"]; | |
battle_$pack_location_abstr_view_LifeController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_abstr_view_LifeController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
building: null | |
,child: null | |
,contains: null | |
,start: function() { | |
com_progrestar_framework_scene_core_AbstractController.prototype.start.call(this); | |
this.building.get_stateChanged().add($bind(this,this.refreshState)); | |
this.refreshState(); | |
} | |
,finish: function() { | |
this.building.get_stateChanged().remove($bind(this,this.refreshState)); | |
com_progrestar_framework_scene_core_AbstractController.prototype.finish.call(this); | |
this.building = null; | |
this.child = null; | |
} | |
,refreshState: function(v) { | |
if(this.building.get_hp() > 0 && !this.contains && this.child != null) { | |
this.contains = true; | |
this._holder.addController(this.child); | |
} | |
if(this.building.get_hp() <= 0 && this.contains && this.child != null) { | |
this.contains = false; | |
this.building.get_stateChanged().remove($bind(this,this.refreshState)); | |
this.child.release(); | |
this.child = null; | |
} | |
} | |
,__class__: battle_$pack_location_abstr_view_LifeController | |
}); | |
var battle_$pack_location_object_ObjectInstance = function(id,location,owner) { | |
this._killDelay = 0; | |
this._fireStarted = new utils_signals_Signal(); | |
this._skills = []; | |
this._skillApplied = new utils_signals_Signal(); | |
this._skillProgressUpdate = new utils_signals_Signal(); | |
this._skillStarted = new utils_signals_Signal(); | |
this._effects = []; | |
this._effectRemoved = new utils_signals_Signal(); | |
this._effectProlonged = new utils_signals_Signal(); | |
this._effectAdded = new utils_signals_Signal(); | |
this._playSoundEvent = new utils_signals_Signal(); | |
this._crystalEventSignal = new utils_signals_Signal(); | |
this._activatedSignal = new utils_signals_Signal(); | |
this._killedSignal = new utils_signals_Signal(); | |
this._positionChanged = new utils_signals_Signal(); | |
this._stateChanged = new utils_signals_Signal(); | |
this._visibleChanged = new utils_signals_Signal(); | |
this._hpChanged = new utils_signals_Signal(); | |
this._size = 0; | |
this._id = 0; | |
this._hpMax = NaN; | |
this._hp = NaN; | |
this._visible = true; | |
this._stateId = 0; | |
this._state = "Stand"; | |
this._id = id; | |
this._location = location; | |
this._owner = owner; | |
}; | |
$hxClasses["battle_pack.location.object.ObjectInstance"] = battle_$pack_location_object_ObjectInstance; | |
battle_$pack_location_object_ObjectInstance.__name__ = ["battle_pack","location","object","ObjectInstance"]; | |
battle_$pack_location_object_ObjectInstance.__interfaces__ = [com_progrestar_framework_core_IRelease]; | |
battle_$pack_location_object_ObjectInstance.prototype = { | |
_owner: null | |
,_state: null | |
,_stateId: null | |
,_visible: null | |
,_hp: null | |
,_hpMax: null | |
,_x: null | |
,_y: null | |
,_id: null | |
,_location: null | |
,_size: null | |
,_hpChanged: null | |
,_visibleChanged: null | |
,_stateChanged: null | |
,_positionChanged: null | |
,_killedSignal: null | |
,_activatedSignal: null | |
,_crystalEventSignal: null | |
,_playSoundEvent: null | |
,_effectAdded: null | |
,_effectProlonged: null | |
,_effectRemoved: null | |
,_effects: null | |
,_skillStarted: null | |
,_skillProgressUpdate: null | |
,_skillApplied: null | |
,_skills: null | |
,_fireStarted: null | |
,_killDelay: null | |
,release: function() { | |
StaticExt.release(this._hpChanged); | |
this._hpChanged = null; | |
StaticExt.release(this._visibleChanged); | |
this._visibleChanged = null; | |
StaticExt.release(this._stateChanged); | |
this._stateChanged = null; | |
StaticExt.release(this._positionChanged); | |
this._positionChanged = null; | |
StaticExt.release(this._killedSignal); | |
this._killedSignal = null; | |
StaticExt.release(this._playSoundEvent); | |
this._playSoundEvent = null; | |
StaticExt.release(this._crystalEventSignal); | |
this._crystalEventSignal = null; | |
StaticExt.release(this._effectAdded); | |
this._effectAdded = null; | |
StaticExt.release(this._effectRemoved); | |
this._effectRemoved = null; | |
this._effects = null; | |
StaticExt.release(this._skillStarted); | |
this._skillStarted = null; | |
StaticExt.release(this._skillApplied); | |
this._skillApplied = null; | |
this._skills = null; | |
this._location = null; | |
} | |
,get_killDelay: function() { | |
return this._killDelay; | |
} | |
,set_killDelay: function(value) { | |
this._killDelay = value; | |
return value; | |
} | |
,setState: function(state) { | |
if(this._state == state) { | |
return; | |
} | |
this._state = state; | |
this._stateChanged.dispatch(); | |
} | |
,setVisible: function(visible) { | |
if(this._visible == visible) { | |
return; | |
} | |
this._visible = visible; | |
this._visibleChanged.dispatch(); | |
} | |
,setStateId: function(stateId) { | |
if(this._stateId == stateId) { | |
return; | |
} | |
this._stateId = stateId; | |
this._stateChanged.dispatch(); | |
} | |
,setSize: function(size) { | |
this._size = size; | |
} | |
,setHP: function(hp) { | |
if(hp < 0) { | |
hp = 0; | |
} | |
if(this._hp == hp) { | |
return; | |
} | |
var delta = hp - this._hp; | |
this._hp = hp; | |
this._hpMax = com_progrestar_framework_core_utils_MathUtils.max(this._hpMax,this._hp); | |
this._hpChanged.dispatch(delta); | |
if(this._hp <= 0 && this._state != "Death") { | |
if(this._killDelay > 0) { | |
com_progrestar_framework_time_Time.wait($bind(this,this.killMe),this._killDelay); | |
} else { | |
this.killMe(); | |
} | |
} | |
} | |
,killMe: function(v) { | |
this.setState("Death"); | |
this._killedSignal.dispatch(); | |
this._location.get_listener().objectKilledSignal.dispatch(this); | |
} | |
,setPosition: function(x,y) { | |
if(this._x == x && this._y == y) { | |
return; | |
} | |
this._x = x; | |
this._y = y; | |
this._positionChanged.dispatch(); | |
} | |
,fireByTarget: function(bulletId,bulletFlyTime,defenderId) { | |
var object = this.get_location().getObject(defenderId); | |
var radius = object.get_size() / 2; | |
this.fireByTile(bulletId,bulletFlyTime,object.get_x() + radius,object.get_y() + radius,object); | |
} | |
,fireByTile: function(bulletId,bulletFlyTime,x,y,target) { | |
var bulletData = this.get_attackData().get_bulletLibItem(); | |
if(bulletData != null) { | |
com_progrestar_framework_core_Assert.isTrue(bulletId > 0,"invalid bullet"); | |
var effect = this.getFirstEffect(); | |
if(bulletData != null && bulletData.canShow(this.get_skin(),effect != null ? effect.get_viewType() : 0)) { | |
battle_$pack_location_bullet_BulletFactory.create(this.get_location(),bulletId,bulletData,this,this.get_attackData().get_attackDelay() | 0,bulletFlyTime,x,y,target); | |
} | |
} | |
this.onFire(bulletId,x,y); | |
} | |
,onFire: function(bulletId,x,y) { | |
this._fireStarted.dispatch(this); | |
} | |
,startAttack: function(x,y) { | |
} | |
,get_id: function() { | |
return this._id; | |
} | |
,get_attackData: function() { | |
return null; | |
} | |
,get_x: function() { | |
return this._x; | |
} | |
,get_y: function() { | |
return this._y; | |
} | |
,get_hp: function() { | |
return this._hp | 0; | |
} | |
,get_state: function() { | |
return this._state; | |
} | |
,get_visible: function() { | |
return this._visible; | |
} | |
,get_stateId: function() { | |
return this._stateId; | |
} | |
,get_location: function() { | |
return this._location; | |
} | |
,get_size: function() { | |
return this._size; | |
} | |
,get_hpChanged: function() { | |
return this._hpChanged; | |
} | |
,get_stateChanged: function() { | |
return this._stateChanged; | |
} | |
,get_visibleChanged: function() { | |
return this._visibleChanged; | |
} | |
,get_positionChanged: function() { | |
return this._positionChanged; | |
} | |
,playSoundEvent: function(soundId) { | |
this._playSoundEvent.dispatch(soundId); | |
} | |
,get_playSoundEventSignal: function() { | |
return this._playSoundEvent; | |
} | |
,crystalEvent: function(crystalEffect) { | |
this._crystalEventSignal.dispatch(crystalEffect); | |
} | |
,get_crystalEventSignal: function() { | |
return this._crystalEventSignal; | |
} | |
,get_killedSignal: function() { | |
return this._killedSignal; | |
} | |
,get_activatedSignal: function() { | |
return this._activatedSignal; | |
} | |
,get_effectAdded: function() { | |
return this._effectAdded; | |
} | |
,get_effectProlonged: function() { | |
return this._effectProlonged; | |
} | |
,get_effectRemoved: function() { | |
return this._effectRemoved; | |
} | |
,get_skillApplied: function() { | |
return this._skillApplied; | |
} | |
,get_skillStarted: function() { | |
return this._skillStarted; | |
} | |
,get_owner: function() { | |
return this._owner; | |
} | |
,setOwner: function(owner) { | |
if(this._owner == owner) { | |
return; | |
} | |
this._owner = owner; | |
this._stateChanged.dispatch(); | |
} | |
,startSkill: function(skillType,data) { | |
this.get_skillStarted().dispatch({ "interval" : data.interval, "skillType" : skillType}); | |
} | |
,setSkillProgress: function(skillType,skillProgress) { | |
this._skillProgressUpdate.dispatch({ "skillType" : skillType, "skillProgress" : skillProgress}); | |
} | |
,applySkill: function(skillId,skillType,data) { | |
var skill = this.getSkillByType(skillType); | |
if(skill == null) { | |
skill = new battle_$pack_location_object_ObjectInstanceSkill(skillId,skillType,data); | |
this._skills.push(skill); | |
} | |
this._skillApplied.dispatch(skillType); | |
this._skills.splice(this._skills.indexOf(skill),1); | |
} | |
,hasSkill: function(skillType) { | |
return this.getSkillByType(skillType) != null; | |
} | |
,getSkillByType: function(skillType) { | |
var _g = 0; | |
var _g1 = this._skills; | |
while(_g < _g1.length) { | |
var skill = _g1[_g]; | |
++_g; | |
if(skill.get_type() == skillType) { | |
return skill; | |
} | |
} | |
return null; | |
} | |
,addEffect: function(effectId,effectType,effectViewType) { | |
this._effects.push(new battle_$pack_location_object_ObjectInstanceEffect(effectId,effectType,effectViewType)); | |
this._effectAdded.dispatch(effectViewType); | |
} | |
,prolongEffect: function(effectId) { | |
this._effectProlonged.dispatch(effectId); | |
} | |
,removeEffect: function(effectId) { | |
var effect = this.getEffectById(effectId); | |
if(effect != null) { | |
var index = this._effects.indexOf(effect); | |
this._effects.splice(index,1); | |
this._effectRemoved.dispatch(effect.get_viewType()); | |
} | |
} | |
,getEffects: function() { | |
return this._effects; | |
} | |
,hasEffects: function() { | |
return this._effects.length > 0; | |
} | |
,hasEffect: function(effectViewType) { | |
return this.getEffectByViewType(effectViewType) != null; | |
} | |
,getEffectById: function(effectId) { | |
var _g = 0; | |
var _g1 = this._effects; | |
while(_g < _g1.length) { | |
var effect = _g1[_g]; | |
++_g; | |
if(effect.get_id() == effectId) { | |
return effect; | |
} | |
} | |
return null; | |
} | |
,getEffectByViewType: function(effectViewType) { | |
var _g = 0; | |
var _g1 = this._effects; | |
while(_g < _g1.length) { | |
var effect = _g1[_g]; | |
++_g; | |
if(effect.get_viewType() == effectViewType) { | |
return effect; | |
} | |
} | |
return null; | |
} | |
,getFirstEffect: function() { | |
if(this._effects.length != 0) { | |
return this._effects[0]; | |
} else { | |
return null; | |
} | |
} | |
,get_skillProgressUpdate: function() { | |
return this._skillProgressUpdate; | |
} | |
,set_skillProgressUpdate: function(value) { | |
this._skillProgressUpdate = value; | |
return value; | |
} | |
,get_fireStarted: function() { | |
return this._fireStarted; | |
} | |
,get_skin: function() { | |
return null; | |
} | |
,__class__: battle_$pack_location_object_ObjectInstance | |
,__properties__: {get_skin:"get_skin",get_fireStarted:"get_fireStarted",set_skillProgressUpdate:"set_skillProgressUpdate",get_skillProgressUpdate:"get_skillProgressUpdate",get_owner:"get_owner",get_skillStarted:"get_skillStarted",get_skillApplied:"get_skillApplied",get_effectRemoved:"get_effectRemoved",get_effectProlonged:"get_effectProlonged",get_effectAdded:"get_effectAdded",get_activatedSignal:"get_activatedSignal",get_killedSignal:"get_killedSignal",get_crystalEventSignal:"get_crystalEventSignal",get_playSoundEventSignal:"get_playSoundEventSignal",get_positionChanged:"get_positionChanged",get_visibleChanged:"get_visibleChanged",get_stateChanged:"get_stateChanged",get_hpChanged:"get_hpChanged",get_size:"get_size",get_location:"get_location",get_stateId:"get_stateId",get_visible:"get_visible",get_state:"get_state",get_hp:"get_hp",get_y:"get_y",get_x:"get_x",get_attackData:"get_attackData",get_id:"get_id",set_killDelay:"set_killDelay",get_killDelay:"get_killDelay"} | |
}; | |
var battle_$pack_location_building_BattleBuildingInstance = function(id,buildingLevel,location) { | |
this._targetByChangedSignal = new utils_signals_Signal(); | |
this.flags = 0; | |
this.underConstruction = false; | |
this.flip = false; | |
this.direction = 1; | |
battle_$pack_location_object_ObjectInstance.call(this,id,location,location.get_defender()); | |
this._buildingData = buildingLevel; | |
if(buildingLevel.get_buildingLibItem().get_slotPacketLib() != null) { | |
this._slotPacket = new com_progrestar_game_crystals_slots_SlotPacket(buildingLevel.get_buildingLibItem().get_slotPacketLib()); | |
} | |
this._storage = new battle_$pack_location_building_BuildingStorage(); | |
this.setSize(this._buildingData.get_buildingLibItem().get_width()); | |
}; | |
$hxClasses["battle_pack.location.building.BattleBuildingInstance"] = battle_$pack_location_building_BattleBuildingInstance; | |
battle_$pack_location_building_BattleBuildingInstance.__name__ = ["battle_pack","location","building","BattleBuildingInstance"]; | |
battle_$pack_location_building_BattleBuildingInstance.__super__ = battle_$pack_location_object_ObjectInstance; | |
battle_$pack_location_building_BattleBuildingInstance.prototype = $extend(battle_$pack_location_object_ObjectInstance.prototype,{ | |
direction: null | |
,flip: null | |
,underConstruction: null | |
,flags: null | |
,_storage: null | |
,_buildingData: null | |
,_slotPacket: null | |
,release: function() { | |
battle_$pack_location_object_ObjectInstance.prototype.release.call(this); | |
if(this._slotPacket != null) { | |
this._slotPacket.release(); | |
this._slotPacket = null; | |
} | |
} | |
,insertCrystal: function(crystal) { | |
com_progrestar_framework_core_Assert.isTrue(this._slotPacket != null,"Invalid slot packet"); | |
com_progrestar_game_crystals_CrystalManager.insertCrystal(this._slotPacket,this._buildingData.get_level(),crystal); | |
} | |
,standBy: function() { | |
this.setState("Stand"); | |
} | |
,deactivate: function() { | |
this.setState("Broken"); | |
} | |
,spawn: function(x,y) { | |
this.setPosition(x,y); | |
battle_$pack_location_surface_tile_TileLockManager.add(this.get_location().get_surface(),this); | |
this.get_location().get_listener().buildingSpawnedSignal.dispatch(this); | |
} | |
,get_buildingData: function() { | |
return this._buildingData; | |
} | |
,startAttack: function(x,y) { | |
battle_$pack_location_object_ObjectInstance.prototype.startAttack.call(this,x,y); | |
this.direction = com_progrestar_common_util_abstr_types_Direction.getDirection(this.get_x(),this.get_y(),x,y); | |
this.setState("Attack"); | |
} | |
,get_attackData: function() { | |
return this._buildingData.get_attackData(); | |
} | |
,get_hpMax: function() { | |
var maxHp = (this.get_buildingData() != null ? this.get_buildingData().get_attackData().get_hp() : 0) | 0; | |
return maxHp; | |
} | |
,get_storage: function() { | |
return this._storage; | |
} | |
,get_slotPacket: function() { | |
return this._slotPacket; | |
} | |
,_targetByChangedSignal: null | |
,setTargetBy: function() { | |
this._targetByChangedSignal.dispatch(); | |
} | |
,get_currentTargetByChangedSignal: function() { | |
return this._targetByChangedSignal; | |
} | |
,__class__: battle_$pack_location_building_BattleBuildingInstance | |
,__properties__: $extend(battle_$pack_location_object_ObjectInstance.prototype.__properties__,{get_currentTargetByChangedSignal:"get_currentTargetByChangedSignal",get_slotPacket:"get_slotPacket",get_storage:"get_storage",get_hpMax:"get_hpMax",get_buildingData:"get_buildingData"}) | |
}); | |
var battle_$pack_location_building_BattleBuildingTargetByController = function() { | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.building.BattleBuildingTargetByController"] = battle_$pack_location_building_BattleBuildingTargetByController; | |
battle_$pack_location_building_BattleBuildingTargetByController.__name__ = ["battle_pack","location","building","BattleBuildingTargetByController"]; | |
battle_$pack_location_building_BattleBuildingTargetByController.create = function(instance,scene) { | |
var inst = StaticExt.fromPool(battle_$pack_location_building_BattleBuildingTargetByController.__pool,battle_$pack_location_building_BattleBuildingTargetByController); | |
inst.init(instance,scene); | |
return inst; | |
}; | |
battle_$pack_location_building_BattleBuildingTargetByController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_building_BattleBuildingTargetByController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
instance: null | |
,_scene: null | |
,clip: null | |
,init: function(instance,scene) { | |
this.instance = instance; | |
this._scene = scene; | |
} | |
,start: function() { | |
this.instance.get_currentTargetByChangedSignal().add($bind(this,this.updateTarget)); | |
this.instance.get_killedSignal().add($bind(this,this.onAnimationEnd)); | |
} | |
,finish: function() { | |
this.instance.get_currentTargetByChangedSignal().remove($bind(this,this.updateTarget)); | |
this.instance.get_killedSignal().remove($bind(this,this.onAnimationEnd)); | |
this.instance = null; | |
this._scene = null; | |
StaticExt.toPool(battle_$pack_location_building_BattleBuildingTargetByController.__pool,this); | |
} | |
,updateTarget: function(v) { | |
if(this.clip == null) { | |
this.clip = this._scene.createClipPlayer("effects/Aim@AimAnim","BattleBuildingTarget"); | |
this.clip.stop(); | |
this._holder.addChild(this.clip); | |
} | |
if(!this.clip.get_isPlaying()) { | |
this.clip.goTo(0); | |
this.clip.play(false); | |
} | |
} | |
,onAnimationEnd: function(v) { | |
this.release(); | |
} | |
,__class__: battle_$pack_location_building_BattleBuildingTargetByController | |
}); | |
var battle_$pack_location_building_BattleTurretInstance = function(id,buildingLevel,location) { | |
this._splashRadius = 0; | |
battle_$pack_location_building_BattleBuildingInstance.call(this,id,buildingLevel,location); | |
}; | |
$hxClasses["battle_pack.location.building.BattleTurretInstance"] = battle_$pack_location_building_BattleTurretInstance; | |
battle_$pack_location_building_BattleTurretInstance.__name__ = ["battle_pack","location","building","BattleTurretInstance"]; | |
battle_$pack_location_building_BattleTurretInstance.__super__ = battle_$pack_location_building_BattleBuildingInstance; | |
battle_$pack_location_building_BattleTurretInstance.prototype = $extend(battle_$pack_location_building_BattleBuildingInstance.prototype,{ | |
_splashRadius: null | |
,_serverBoosts: null | |
,getFirstCharge: function() { | |
if(this._serverBoosts != null && this._serverBoosts.length != 0) { | |
return this._serverBoosts[0]; | |
} else { | |
return null; | |
} | |
} | |
,activated: function(splashRadius,attackViewId) { | |
this._splashRadius = splashRadius; | |
var boost = com_progrestar_game_data_boost_lib_BoostLib.get_instance().getById(attackViewId); | |
if(this._serverBoosts != null) { | |
var self = this._serverBoosts; | |
self.length = 0; | |
} else { | |
this._serverBoosts = []; | |
} | |
this._serverBoosts.push(boost); | |
this.get_activatedSignal().dispatch(); | |
} | |
,get_splashRadius: function() { | |
return this._splashRadius; | |
} | |
,getChargeCoef: function() { | |
if(this.getFirstCharge() != null && this.get_splashRadius() != 0) { | |
return 1 + (this.get_splashRadius() - 5) / 5; | |
} | |
return 1; | |
} | |
,__class__: battle_$pack_location_building_BattleTurretInstance | |
,__properties__: $extend(battle_$pack_location_building_BattleBuildingInstance.prototype.__properties__,{get_splashRadius:"get_splashRadius"}) | |
}); | |
var battle_$pack_location_building_BuildingFactory = function() { | |
}; | |
$hxClasses["battle_pack.location.building.BuildingFactory"] = battle_$pack_location_building_BuildingFactory; | |
battle_$pack_location_building_BuildingFactory.__name__ = ["battle_pack","location","building","BuildingFactory"]; | |
battle_$pack_location_building_BuildingFactory.placeRegion = function(location,x,y,w,h) { | |
var regionData = com_progrestar_game_lib_building_BuildingLevelLib.get_instance().getByTypeId(85,1); | |
var region = battle_$pack_location_building_BuildingFactory.createBuilding(location,battle_$pack_location_building_BuildingFactory.NEXT_BUILDING_ID++,regionData,1,false,false); | |
region.setSize(w); | |
region.spawn(x,y); | |
}; | |
battle_$pack_location_building_BuildingFactory.createBuilding = function(location,buildingId,buildingData,hp,flip,underConstruction,flags) { | |
if(flags == null) { | |
flags = 0; | |
} | |
com_progrestar_framework_core_Assert.isTrue(buildingData != null,"undefined building data"); | |
var building = null; | |
if(buildingData.get_buildingLibItem().get_isTrap() || buildingData.get_buildingLibItem().get_isTurret()) { | |
building = new battle_$pack_location_building_BattleTurretInstance(buildingId,buildingData,location); | |
} else { | |
building = new battle_$pack_location_building_BattleBuildingInstance(buildingId,buildingData,location); | |
} | |
building.flip = flip; | |
building.underConstruction = underConstruction; | |
building.setHP(hp); | |
location.registerBuilding(building); | |
building.flags = flags; | |
return building; | |
}; | |
battle_$pack_location_building_BuildingFactory.placeDecor = function(location,rawDecor) { | |
var level = Object.prototype.hasOwnProperty.call(rawDecor,"level") ? Reflect.field(rawDecor,"level") : 1; | |
var buildingData = com_progrestar_game_lib_building_BuildingLevelLib.get_instance().getByTypeId(rawDecor.typeId,level); | |
var building = battle_$pack_location_building_BuildingFactory.createBuilding(location,battle_$pack_location_building_BuildingFactory.NEXT_BUILDING_ID++,buildingData,1,Reflect.field(rawDecor,"flip"),false); | |
building.setSize(buildingData.get_width() | 0); | |
building.spawn(rawDecor.x,rawDecor.y); | |
}; | |
battle_$pack_location_building_BuildingFactory.prototype = { | |
__class__: battle_$pack_location_building_BuildingFactory | |
}; | |
var battle_$pack_location_building_BuildingStorage = function() { | |
this._capacity = 0; | |
this._resources = new com_progrestar_game_collection_Collection(); | |
this._farmSignal = new utils_signals_Signal(); | |
}; | |
$hxClasses["battle_pack.location.building.BuildingStorage"] = battle_$pack_location_building_BuildingStorage; | |
battle_$pack_location_building_BuildingStorage.__name__ = ["battle_pack","location","building","BuildingStorage"]; | |
battle_$pack_location_building_BuildingStorage.prototype = { | |
_farmSignal: null | |
,_resources: null | |
,_capacity: null | |
,setup: function(resource,amount,capacity) { | |
this._capacity = capacity; | |
this._resources.setItem(resource,amount); | |
} | |
,farm: function(element) { | |
this._resources.addItem(element.get_elementType(),-element.get_amount()); | |
this._farmSignal.dispatch(element); | |
} | |
,get_resources: function() { | |
return this._resources; | |
} | |
,get_capacity: function() { | |
return this._capacity; | |
} | |
,get_farmSignal: function() { | |
return this._farmSignal; | |
} | |
,__class__: battle_$pack_location_building_BuildingStorage | |
,__properties__: {get_farmSignal:"get_farmSignal",get_capacity:"get_capacity",get_resources:"get_resources"} | |
}; | |
var battle_$pack_location_building_view_BuildingBaseController = function() { | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.building.view.BuildingBaseController"] = battle_$pack_location_building_view_BuildingBaseController; | |
battle_$pack_location_building_view_BuildingBaseController.__name__ = ["battle_pack","location","building","view","BuildingBaseController"]; | |
battle_$pack_location_building_view_BuildingBaseController.__interfaces__ = [com_progrestar_framework_scene_core_IController]; | |
battle_$pack_location_building_view_BuildingBaseController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_building_view_BuildingBaseController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
building: null | |
,_visual: null | |
,data: null | |
,lastLink: null | |
,baseInit: function(data,base) { | |
this.data = data; | |
this.building = base; | |
this._visual = data.get_scene().createClipPlayer(null,"BuildingBaseCtr"); | |
} | |
,start: function() { | |
com_progrestar_framework_scene_core_AbstractController.prototype.start.call(this); | |
com_progrestar_game_managers_GameQualityManager.showBuildingsAnimationChanged.add($bind(this,this.onShowBuildingsAnimationChanged)); | |
this._holder.addChild(this._visual); | |
} | |
,finish: function() { | |
com_progrestar_game_managers_GameQualityManager.showBuildingsAnimationChanged.remove($bind(this,this.onShowBuildingsAnimationChanged)); | |
if(this._holder != null && this._holder.containsChild(this._visual)) { | |
this._holder.removeChild(this._visual); | |
} | |
if(this._visual != null) { | |
this._visual.release(); | |
} | |
this._visual = null; | |
this.building = null; | |
this.data = null; | |
this.lastLink = null; | |
com_progrestar_framework_scene_core_AbstractController.prototype.finish.call(this); | |
} | |
,play: function(clipLink,loop) { | |
if(this._visual == null || this.lastLink == clipLink) { | |
return; | |
} | |
this.lastLink = clipLink; | |
var buildingType = this.building.get_buildingData().get_buildingType(); | |
if(com_progrestar_game_lib_building_BuildingType.DECOR_GROUP.indexOf(buildingType) < 0) { | |
this._visual.setClipFromFile(this.building.get_buildingData().get_preloaderLink()); | |
} | |
this._visual.setClipFromFile(clipLink); | |
if(com_progrestar_game_managers_GameQualityManager.get_showBuildingsAnimation() || this.building.get_buildingData().get_buildingType() == "trap") { | |
this._visual.play(loop); | |
} else { | |
this._visual.stop(); | |
} | |
} | |
,onShowBuildingsAnimationChanged: function(v) { | |
if(this._visual != null && !this._visual.get_isReleased()) { | |
if(this._visual.get_isPlaying()) { | |
this._visual.stop(); | |
} else { | |
this._visual.play(this._visual.get_isLooping()); | |
} | |
} | |
} | |
,__class__: battle_$pack_location_building_view_BuildingBaseController | |
}); | |
var battle_$pack_location_building_view_BuildingColorEffectController = function() { | |
this.maxHP = 0; | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.building.view.BuildingColorEffectController"] = battle_$pack_location_building_view_BuildingColorEffectController; | |
battle_$pack_location_building_view_BuildingColorEffectController.__name__ = ["battle_pack","location","building","view","BuildingColorEffectController"]; | |
battle_$pack_location_building_view_BuildingColorEffectController.create = function(data,building,environment) { | |
var inst = StaticExt.fromPool(battle_$pack_location_building_view_BuildingColorEffectController.__pool,battle_$pack_location_building_view_BuildingColorEffectController); | |
inst.init(data,building,environment); | |
return inst; | |
}; | |
battle_$pack_location_building_view_BuildingColorEffectController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_building_view_BuildingColorEffectController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
_building: null | |
,maxHP: null | |
,data: null | |
,environment: null | |
,init: function(data,building,environment) { | |
this.data = data; | |
this.environment = environment; | |
this._building = building; | |
} | |
,start: function() { | |
this._building.get_hpChanged().add($bind(this,this.update)); | |
if(this.environment != null) { | |
this.environment.isTarget.get_changed().add($bind(this,this.update)); | |
} | |
this.update(); | |
} | |
,finish: function() { | |
if(this.environment != null) { | |
this.environment.isTarget.get_changed().remove($bind(this,this.update)); | |
} | |
this._building.get_hpChanged().remove($bind(this,this.update)); | |
this.data = null; | |
this.environment = null; | |
this._building = null; | |
StaticExt.toPool(battle_$pack_location_building_view_BuildingColorEffectController.__pool,this); | |
} | |
,update: function(v) { | |
var color = null; | |
var currentHP = this._building.get_hp(); | |
if(this.maxHP < currentHP) { | |
this.maxHP = currentHP; | |
} | |
if(this.environment != null && this.environment.isTarget.get_value()) { | |
var r = 1; | |
var g = 1; | |
var b = 1; | |
if(com_progrestar_game_lib_RuleLib.RESIST_TYPES.indexOf(this._building.get_buildingData().get_attackData().get_attackerType()) >= 0) { | |
r = 1; | |
g = 0.3; | |
b = 0; | |
} else { | |
r = 1; | |
g = 0.6; | |
b = 0.26; | |
} | |
this._holder.get_transform().setRGB(r,g,b); | |
return; | |
} | |
if(currentHP >= 0) { | |
var state = com_progrestar_framework_core_utils_MathUtils.clampf(currentHP / this.maxHP,0,1); | |
color = 1; | |
this._holder.get_transform().setRGB(color,color,color); | |
} else { | |
color = 0.6; | |
this._holder.get_transform().setRGB(color,color,color); | |
} | |
} | |
,__class__: battle_$pack_location_building_view_BuildingColorEffectController | |
}); | |
var battle_$pack_location_building_view_BuildingDamageController = function() { | |
this._enabled = true; | |
this.buildingHeight = 0; | |
this.accumulateHP = 0; | |
this.maxDHP = 0; | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.building.view.BuildingDamageController"] = battle_$pack_location_building_view_BuildingDamageController; | |
battle_$pack_location_building_view_BuildingDamageController.__name__ = ["battle_pack","location","building","view","BuildingDamageController"]; | |
battle_$pack_location_building_view_BuildingDamageController.create = function(data,base) { | |
var inst = StaticExt.fromPool(battle_$pack_location_building_view_BuildingDamageController.__pool,battle_$pack_location_building_view_BuildingDamageController); | |
inst.init(data,base); | |
return inst; | |
}; | |
battle_$pack_location_building_view_BuildingDamageController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_building_view_BuildingDamageController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
_building: null | |
,maxDHP: null | |
,accumulateHP: null | |
,data: null | |
,buildingHeight: null | |
,init: function(data,building) { | |
this.data = data; | |
this._building = building; | |
} | |
,_enabled: null | |
,get_enabled: function() { | |
return this._enabled; | |
} | |
,set_enabled: function(value) { | |
this._enabled = value; | |
return value; | |
} | |
,start: function() { | |
this._building.get_hpChanged().add($bind(this,this.onHpReduced)); | |
this.buildingHeight = -this._building.get_buildingData().get_visualData().get_hpSelfConfig().dY / 24; | |
this.maxDHP = this._building.get_hpMax() / (3 * this._building.get_buildingData().get_width() * this._building.get_buildingData().get_height()); | |
} | |
,finish: function() { | |
this._building.get_hpChanged().remove($bind(this,this.onHpReduced)); | |
this._building = null; | |
this.data = null; | |
this.maxDHP = 0; | |
this.accumulateHP = 0; | |
this.buildingHeight = 0; | |
StaticExt.toPool(battle_$pack_location_building_view_BuildingDamageController.__pool,this); | |
} | |
,refresh: function() { | |
} | |
,onHpReduced: function(deltaHp) { | |
if(!this._enabled || this.maxDHP == 0) { | |
return; | |
} | |
this.accumulateHP -= deltaHp; | |
while(this.maxDHP != 0 && !isNaN(this.maxDHP) && this.accumulateHP > this.maxDHP) { | |
this.accumulateHP -= this.maxDHP; | |
this.generateEffect(); | |
} | |
} | |
,generateEffect: function() { | |
var _gthis = this; | |
var view = this.data.get_scene().createClipPlayer(null,"BuildingDamageCtr"); | |
this._holder.addChild(view); | |
this.generateRandomPosition(view.get_transform()); | |
view.setClipFromFile(battle_$pack_location_building_view_BuildingDamageController.DAMAGE_EFFECTS[2]); | |
var onAnimationEnd = function(v) { | |
_gthis._holder.removeChild(view); | |
view.release(); | |
view = null; | |
}; | |
view.goTo(0); | |
view.play(false); | |
view.get_animationEnd().add(onAnimationEnd); | |
} | |
,generateRandomPosition: function(transform) { | |
var maxX = this._building.get_buildingData().get_buildingLibItem().get_width(); | |
var maxY = this._building.get_buildingData().get_buildingLibItem().get_height(); | |
var x = com_progrestar_framework_core_utils_RandomUtils.randf(0.5 - maxX / 2,maxX / 2 - 0.5); | |
var y = com_progrestar_framework_core_utils_RandomUtils.randf(0.5 - maxY / 2,maxY / 2 - 0.5); | |
var z = this._building.underConstruction ? 0 : com_progrestar_framework_core_utils_RandomUtils.randf(0,this.buildingHeight); | |
this.data.get_transform().applyTo(transform,x,y,z); | |
} | |
,__class__: battle_$pack_location_building_view_BuildingDamageController | |
,__properties__: $extend(com_progrestar_framework_scene_core_AbstractController.prototype.__properties__,{set_enabled:"set_enabled",get_enabled:"get_enabled"}) | |
}); | |
var battle_$pack_location_building_view_BuildingEnvironment = function(building) { | |
this.isTarget = new com_progrestar_cas_utils_property_BooleanProperty(false); | |
this.isFocused = new com_progrestar_cas_utils_property_BooleanProperty(false); | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
this.building = building; | |
com_progrestar_framework_core_Assert.isTrue(battle_$pack_location_building_view_BuildingEnvironment.ITEMS.h[building.__id__] == null,"Only one environment-instance for one building-instance"); | |
}; | |
$hxClasses["battle_pack.location.building.view.BuildingEnvironment"] = battle_$pack_location_building_view_BuildingEnvironment; | |
battle_$pack_location_building_view_BuildingEnvironment.__name__ = ["battle_pack","location","building","view","BuildingEnvironment"]; | |
battle_$pack_location_building_view_BuildingEnvironment.getEnvironment = function(building) { | |
return battle_$pack_location_building_view_BuildingEnvironment.ITEMS.h[building.__id__]; | |
}; | |
battle_$pack_location_building_view_BuildingEnvironment.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_building_view_BuildingEnvironment.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
shootMark: null | |
,isFocused: null | |
,isTarget: null | |
,building: null | |
,start: function() { | |
battle_$pack_location_building_view_BuildingEnvironment.ITEMS.set(this.building,this); | |
} | |
,finish: function() { | |
battle_$pack_location_building_view_BuildingEnvironment.ITEMS.remove(this.building); | |
} | |
,__class__: battle_$pack_location_building_view_BuildingEnvironment | |
}); | |
var battle_$pack_location_building_view_BuildingFireController = function() { | |
this.hasCrater = false; | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.building.view.BuildingFireController"] = battle_$pack_location_building_view_BuildingFireController; | |
battle_$pack_location_building_view_BuildingFireController.__name__ = ["battle_pack","location","building","view","BuildingFireController"]; | |
battle_$pack_location_building_view_BuildingFireController.create = function(data,base) { | |
var inst = StaticExt.fromPool(battle_$pack_location_building_view_BuildingFireController.__pool,battle_$pack_location_building_view_BuildingFireController); | |
inst.init(data,base); | |
return inst; | |
}; | |
battle_$pack_location_building_view_BuildingFireController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_building_view_BuildingFireController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
_building: null | |
,data: null | |
,fireAccumulate: null | |
,fireAccumalateBasicHP: null | |
,players: null | |
,_clips: null | |
,_fireCounter: null | |
,size: null | |
,init: function(data,building) { | |
this._building = building; | |
this.data = data; | |
this.fireAccumulate = 0; | |
this.fireAccumalateBasicHP = 0; | |
this._fireCounter = 0; | |
} | |
,start: function() { | |
com_progrestar_game_render2_controller_building_fire_BuildingFireAssets.getAssets().add($bind(this,this.onAssets)); | |
this.size = this._building.get_buildingData().get_width(); | |
this.fireAccumalateBasicHP = this._building.get_buildingData().get_attackData().get_hp() / (this.size * 2) | 0; | |
this._building.get_hpChanged().add($bind(this,this.onHpReduced)); | |
this.players = []; | |
} | |
,refresh: function() { | |
var speed = battle_$pack_location_location_$view_SceneConfig.instance.gameSpeed.get_value(); | |
var _g = 0; | |
var _g1 = this.players; | |
while(_g < _g1.length) { | |
var player = _g1[_g]; | |
++_g; | |
player.set_speed(speed); | |
} | |
} | |
,onAssets: function(clips) { | |
this._clips = clips; | |
} | |
,finish: function() { | |
var _g = 0; | |
var _g1 = this.players; | |
while(_g < _g1.length) { | |
var player = _g1[_g]; | |
++_g; | |
player.release(); | |
} | |
this._clips = null; | |
var self = this.players; | |
self.length = 0; | |
this.players = null; | |
this._building.get_hpChanged().remove($bind(this,this.onHpReduced)); | |
this._building = null; | |
this.data = null; | |
StaticExt.toPool(battle_$pack_location_building_view_BuildingFireController.__pool,this); | |
} | |
,onHpReduced: function(deltaHp) { | |
this.fireAccumulate -= deltaHp | 0; | |
if(this.fireAccumulate > this.fireAccumalateBasicHP && this._clips != null) { | |
this.fireAccumulate -= this.fireAccumalateBasicHP; | |
new battle_$pack_location_building_view_BuildingFireItem(this._holder,this,this._building,this.data.get_scene().createClipPlayer(null,"BuildingFireItem"),this._clips); | |
this.tryCreateEnvironmentSmoke(); | |
} | |
} | |
,hasCrater: null | |
,tryCreateEnvironmentSmoke: function() { | |
if(this._building.get_hp() <= 0 && this.size >= 2 && com_progrestar_framework_core_utils_RandomUtils.chance(this.size / 4)) { | |
var environmentSmoke = this.data.get_scene().createClipPlayer("effects/fire@Smoke","BuildingEnvSmoke"); | |
environmentSmoke.get_transform().set_alpha(0.5); | |
environmentSmoke.get_transform().setScale(this.size + 1,this.size + 1); | |
environmentSmoke.get_transform().setDepth(com_progrestar_game_render2_Depth.SMOKE); | |
environmentSmoke.goTo(0); | |
environmentSmoke.play(true); | |
this._holder.addChild(environmentSmoke); | |
var speed = battle_$pack_location_location_$view_SceneConfig.instance.gameSpeed.get_value(); | |
environmentSmoke.set_speed(speed); | |
this.players.push(environmentSmoke); | |
} | |
} | |
,onDrawCrater: function(v) { | |
var tileX = com_progrestar_framework_core_utils_RandomUtils.randf(this._building.get_x(),this._building.get_x() + this.size); | |
var tileY = com_progrestar_framework_core_utils_RandomUtils.randf(this._building.get_y(),this._building.get_y() + this.size); | |
com_progrestar_game_render2_utils_CanvasUtils.drawByLink(this.data.get_staticEffects(),"bullets/pack_extended@FireCrater",tileX,tileY,1); | |
} | |
,get_fireCounter: function() { | |
return this._fireCounter; | |
} | |
,set_fireCounter: function(value) { | |
if(this._fireCounter == value) { | |
return value; | |
} | |
this._fireCounter = value; | |
return value; | |
} | |
,__class__: battle_$pack_location_building_view_BuildingFireController | |
,__properties__: $extend(com_progrestar_framework_scene_core_AbstractController.prototype.__properties__,{set_fireCounter:"set_fireCounter",get_fireCounter:"get_fireCounter"}) | |
}); | |
var battle_$pack_location_building_view_BuildingFireItem = function(holder,controller,building,fireView,clips) { | |
this._burning = false; | |
this._controller = controller; | |
this._building = building; | |
this._fireView = fireView; | |
this._clips = clips; | |
var info = this.generateRandomFire(); | |
this.buildingHeight = -this._building.get_buildingData().get_visualData().get_hpSelfConfig().dY / 24; | |
com_progrestar_framework_time_Time.start($bind(this,this.onFireStopped),info.length,1); | |
this._fireClip = info.clip; | |
this._fireView.setClip(this._fireClip); | |
this._fireView.goTo(0); | |
this._fireView.play(false); | |
holder.addChild(this._fireView); | |
this.generateRandomPosition(this._fireView.get_transform()); | |
if(!this._burning) { | |
this._burning = true; | |
var _g = this._controller; | |
var _g1 = _g.get_fireCounter(); | |
_g.set_fireCounter(_g1 + 1); | |
} | |
}; | |
$hxClasses["battle_pack.location.building.view.BuildingFireItem"] = battle_$pack_location_building_view_BuildingFireItem; | |
battle_$pack_location_building_view_BuildingFireItem.__name__ = ["battle_pack","location","building","view","BuildingFireItem"]; | |
battle_$pack_location_building_view_BuildingFireItem.prototype = { | |
_building: null | |
,_fireView: null | |
,_clips: null | |
,_fireClip: null | |
,_controller: null | |
,_burning: null | |
,buildingHeight: null | |
,release: function() { | |
com_progrestar_framework_time_Time.stop($bind(this,this.onFireStopped)); | |
this.onFireStopped(); | |
this._fireClip = null; | |
this._fireView.release(); | |
this._fireView = null; | |
this._building = null; | |
this._controller = null; | |
} | |
,generateRandomFire: function() { | |
if(battle_$pack_location_building_view_BuildingFireItem.cacheFireAnimations.length >= 20) { | |
return com_progrestar_framework_core_utils_RandomUtils.randomSelectFromArray(battle_$pack_location_building_view_BuildingFireItem.cacheFireAnimations); | |
} | |
var clip = new com_progrestar_framework_ares_core_Clip(0); | |
var changing = 60; | |
var fire = com_progrestar_framework_core_utils_RandomUtils.randi(2,5) * 60; | |
var smoke = Math.round(com_progrestar_framework_core_utils_RandomUtils.quadraticRandf(5,20)) * 60 | 0; | |
com_progrestar_framework_scene_extended_clip_ClipMaker.appendClip(clip,this._clips.get("effects/fire@ToFire"),changing); | |
com_progrestar_framework_scene_extended_clip_ClipMaker.appendClip(clip,this._clips.get("effects/fire@Fire"),fire); | |
com_progrestar_framework_scene_extended_clip_ClipMaker.appendClip(clip,this._clips.get("effects/fire@ToSmoke"),changing); | |
com_progrestar_framework_scene_extended_clip_ClipMaker.appendClip(clip,this._clips.get("effects/fire@Smoke"),smoke); | |
com_progrestar_framework_scene_extended_clip_ClipMaker.appendClip(clip,this._clips.get("effects/fire@ToEmpty"),changing); | |
var info = new battle_$pack_location_building_view_FireInfo(); | |
info.clip = clip; | |
info.length = (changing + fire) / 30 | 0; | |
battle_$pack_location_building_view_BuildingFireItem.cacheFireAnimations.push(info); | |
return info; | |
} | |
,onFireStopped: function(v) { | |
if(this._burning) { | |
this._burning = false; | |
var _g = this._controller; | |
var _g1 = _g.get_fireCounter(); | |
_g.set_fireCounter(_g1 - 1); | |
} | |
} | |
,generateRandomPosition: function(transform) { | |
var halfWidth = this._building.get_buildingData().get_buildingLibItem().get_width() / 2 - 0.2; | |
var halfHeight = this._building.get_buildingData().get_buildingLibItem().get_height() / 2 - 0.2; | |
var x = com_progrestar_framework_core_utils_RandomUtils.randf(-halfWidth,halfWidth); | |
var y = com_progrestar_framework_core_utils_RandomUtils.randf(-halfHeight,halfHeight); | |
var z = this._building.underConstruction ? 0 : com_progrestar_framework_core_utils_RandomUtils.randf(0,this.buildingHeight); | |
var scale = com_progrestar_framework_core_utils_RandomUtils.randf(0.5,1.5); | |
com_progrestar_game_render2_controller_IsometricUtils.worldToScreen(transform,x,y,z,-halfWidth); | |
transform.setScale(scale,scale); | |
transform.setRGBA(com_progrestar_framework_core_utils_RandomUtils.randf(0.7,1.0),com_progrestar_framework_core_utils_RandomUtils.randf(0.7,1.0),com_progrestar_framework_core_utils_RandomUtils.randf(0.7,1.0),com_progrestar_framework_core_utils_RandomUtils.randf(0.8,1.0)); | |
} | |
,__class__: battle_$pack_location_building_view_BuildingFireItem | |
}; | |
var battle_$pack_location_building_view_BuildingRender = function() { | |
}; | |
$hxClasses["battle_pack.location.building.view.BuildingRender"] = battle_$pack_location_building_view_BuildingRender; | |
battle_$pack_location_building_view_BuildingRender.__name__ = ["battle_pack","location","building","view","BuildingRender"]; | |
battle_$pack_location_building_view_BuildingRender.create = function(view,building) { | |
var groundNode = view.get_scene().createNode("building" + building.get_id()); | |
var isDecor = com_progrestar_game_lib_building_BuildingType.DECOR_GROUP.indexOf(building.get_buildingData().get_buildingType()) >= 0; | |
var environment = new battle_$pack_location_building_view_BuildingEnvironment(building); | |
groundNode.addController(environment); | |
if(!isDecor) { | |
var ruinsNode = view.get_scene().createNode("buildingRuins" + building.get_id()); | |
ruinsNode.addController(battle_$pack_location_building_view_RuinsBody.create(view,building,environment)); | |
ruinsNode.addController(battle_$pack_location_object_view_ObjectGPS.create(building,0)); | |
view.get_backLayer().addChild(ruinsNode); | |
} | |
if(building.get_buildingData().get_buildingType() == "turret") { | |
groundNode.addController(battle_$pack_location_effects_CrystalEffectController.create(building,environment,"effects/crystal_effect@BuildingCriticalHit","effects/crystal_effect@BuildingEvasion",view.get_scene(),true)); | |
groundNode.addController(battle_$pack_location_effects_FreezingEffectController.create(building,view.get_scene())); | |
groundNode.addController(battle_$pack_location_effects_BeamTowerLoseTargetEffectController.create(building,view.get_scene())); | |
} | |
var bodyNode = view.get_scene().createNode("buildingBody" + building.get_id()); | |
groundNode.addChild(bodyNode); | |
if(building.get_buildingData().get_buildingType() == "wall") { | |
bodyNode.addController(battle_$pack_location_building_view_WallBody.create(view,building)); | |
bodyNode.addController(battle_$pack_location_effects_WallCrushEffectController.create(building,view.get_scene())); | |
groundNode.addController(battle_$pack_location_effects_WallEffectController.create(building,view.get_scene())); | |
} else if(building.get_buildingData().get_buildingType() == "farm" || building.get_buildingData().get_buildingType() == "warehouse") { | |
bodyNode.addController(battle_$pack_location_building_view_StorageBody.create(view,building,environment)); | |
} else { | |
bodyNode.addController(battle_$pack_location_building_view_TurretBody.create(view,building,environment)); | |
} | |
if(building.get_buildingData().get_buildingType() == "trap") { | |
groundNode.addController(battle_$pack_location_effects_TrapChargeEffectController.create(StaticExt.kast(Std,building,battle_$pack_location_building_BattleTurretInstance),view.get_scene())); | |
} | |
bodyNode.addController(battle_$pack_location_building_view_BuildingVisibleController.create(view,building,environment)); | |
bodyNode.addController(battle_$pack_location_building_view_BuildingColorEffectController.create(view,building,environment)); | |
bodyNode.addController(battle_$pack_location_effects_SakuraEffectController.create(building,view.get_scene())); | |
bodyNode.addController(battle_$pack_location_effects_PoizonEffectController.create(building,view.get_scene())); | |
if(building.get_buildingData().get_buildingType() == "townhall") { | |
bodyNode.addController(com_progrestar_game_render2_controller_building_BattleBuildingNationalFlagsController.create(building,view.get_scene())); | |
} | |
if(!isDecor) { | |
groundNode.addController(battle_$pack_location_building_view_BuildingDamageController.create(view,building)); | |
if(!building.get_buildingData().get_buildingLibItem().hasCustomAssetLink("Death")) { | |
groundNode.addController(battle_$pack_location_building_view_ExplosionController.create(view,building)); | |
groundNode.addController(battle_$pack_location_building_view_BuildingFireController.create(view,building)); | |
} | |
if(building.get_buildingData().get_buildingLibItem().get_hasFullDropSkill()) { | |
groundNode.addController(battle_$pack_location_building_view_LootSimultaneousDropEffectController.create(view,building)); | |
} else { | |
groundNode.addController(battle_$pack_location_building_view_LootDropEffectController.create(view,building)); | |
} | |
groundNode.addController(com_progrestar_game_render2_controller_building_BuildingInfoPanelControllerNext.create(building,view.get_scene(),view.main)); | |
} | |
groundNode.addController(com_progrestar_game_render2_controller_building_BattleBuildingSoundController.create(building)); | |
groundNode.addController(battle_$pack_location_object_view_ObjectGPS.create(building,"foundation" == building.get_buildingData().get_buildingType() ? 1e3 : 0)); | |
if(building.get_buildingData().get_buildingLibItem().get_isObstacle()) { | |
view.get_groundLayer().addChild(groundNode); | |
} else { | |
view.get_backLayer().addChild(groundNode); | |
} | |
var hpNode = view.get_scene().createNode("buildingHp" + building.get_id()); | |
hpNode.addController(battle_$pack_location_object_view_ObjectGPS.create(building,0)); | |
hpNode.addController(battle_$pack_location_object_view_ObjectHP.create(view,building,false,building.get_buildingData().get_visualData())); | |
hpNode.addController(battle_$pack_location_building_BattleBuildingTargetByController.create(building,view.get_scene())); | |
view.get_airLayer().addChild(hpNode); | |
com_progrestar_game_render2_controller_building_range_battle_BattleBuildingRangeFactory.apply(groundNode,building,environment,view); | |
}; | |
battle_$pack_location_building_view_BuildingRender.prototype = { | |
__class__: battle_$pack_location_building_view_BuildingRender | |
}; | |
var battle_$pack_location_building_view_BuildingVisibleController = function() { | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.building.view.BuildingVisibleController"] = battle_$pack_location_building_view_BuildingVisibleController; | |
battle_$pack_location_building_view_BuildingVisibleController.__name__ = ["battle_pack","location","building","view","BuildingVisibleController"]; | |
battle_$pack_location_building_view_BuildingVisibleController.create = function(data,base,environment) { | |
var inst = StaticExt.fromPool(battle_$pack_location_building_view_BuildingVisibleController.__pool,battle_$pack_location_building_view_BuildingVisibleController); | |
inst.init(data,base,environment); | |
return inst; | |
}; | |
battle_$pack_location_building_view_BuildingVisibleController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_building_view_BuildingVisibleController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
_building: null | |
,_data: null | |
,_decoration: null | |
,init: function(view,unit,decoration) { | |
this._data = view; | |
this._building = unit; | |
this._decoration = decoration; | |
} | |
,start: function() { | |
this.changeVisible(); | |
this._building.get_visibleChanged().add($bind(this,this.changeVisible)); | |
} | |
,finish: function() { | |
this._building.get_visibleChanged().remove($bind(this,this.changeVisible)); | |
this._data = null; | |
this._building = null; | |
this._decoration = null; | |
StaticExt.toPool(battle_$pack_location_building_view_BuildingVisibleController.__pool,this); | |
} | |
,changeVisible: function(v) { | |
this._holder.get_transform().set_alpha(this._building.get_visible() ? 1 : 0); | |
} | |
,__class__: battle_$pack_location_building_view_BuildingVisibleController | |
}); | |
var battle_$pack_location_building_view_CrystalEnvironmentController = function(scene,slotPacket,body,positionOffset) { | |
if(positionOffset == null) { | |
positionOffset = 0; | |
} | |
this._offsetAdded = false; | |
this._positionOffset = 0; | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
this.scene = scene; | |
this.slotPacket = slotPacket; | |
this.body = body; | |
this._positionOffset = positionOffset; | |
this.render = scene.createParticleSystemRender(); | |
this.render.set_useCache(false); | |
}; | |
$hxClasses["battle_pack.location.building.view.CrystalEnvironmentController"] = battle_$pack_location_building_view_CrystalEnvironmentController; | |
battle_$pack_location_building_view_CrystalEnvironmentController.__name__ = ["battle_pack","location","building","view","CrystalEnvironmentController"]; | |
battle_$pack_location_building_view_CrystalEnvironmentController.init = function(holder,scene,player,building) { | |
var slotPacket = building.get_slotPacket(); | |
var showCrystal = building.get_hp() > 0 && !building.underConstruction && slotPacket != null; | |
if(showCrystal) { | |
holder.addController(new battle_$pack_location_abstr_view_LifeController(building,new battle_$pack_location_building_view_CrystalEnvironmentController(scene,slotPacket,player,building.get_buildingData().get_width() >= 4 ? 65 : 0))); | |
} else { | |
holder.addChild(player); | |
} | |
}; | |
battle_$pack_location_building_view_CrystalEnvironmentController.takeSystem = function(hasOrange,hasGreen,level) { | |
var key = "-" + level + (hasGreen ? "-green" : "-") + (hasOrange ? "-orange" : "-"); | |
var _this = battle_$pack_location_building_view_CrystalEnvironmentController.systems; | |
var ps = __map_reserved[key] != null ? _this.getReserved(key) : _this.h[key]; | |
if(ps == null && (hasGreen || hasOrange)) { | |
var container = new com_progrestar_game_render2_controller_ParticleSystemModificator(); | |
container.emissionFactor = level / 8; | |
if(hasOrange && hasGreen) { | |
container.load("effects/particles_orange_green.json","effects/particle@particle"); | |
} | |
if(hasOrange && !hasGreen) { | |
container.load("effects/particles_orange.json","effects/particle@particle"); | |
} | |
if(!hasOrange && hasGreen) { | |
container.load("effects/particles_green.json","effects/particle@particle"); | |
} | |
ps = container.model; | |
var v = ps; | |
var _this1 = battle_$pack_location_building_view_CrystalEnvironmentController.systems; | |
if(__map_reserved[key] != null) { | |
_this1.setReserved(key,v); | |
} else { | |
_this1.h[key] = v; | |
} | |
} | |
return ps; | |
}; | |
battle_$pack_location_building_view_CrystalEnvironmentController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_building_view_CrystalEnvironmentController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
_positionOffset: null | |
,_offsetAdded: null | |
,scene: null | |
,slotPacket: null | |
,body: null | |
,render: null | |
,start: function() { | |
com_progrestar_framework_scene_core_AbstractController.prototype.start.call(this); | |
this.slotPacket.get_changed().add($bind(this,this.refreshParticles)); | |
com_progrestar_game_managers_GameQualityManager.showCrystalsBattleChanged.add($bind(this,this.onSettingsChanged)); | |
this.refreshParticles(); | |
} | |
,refreshParticles: function(v) { | |
var slotA = this.slotPacket.getItem(0); | |
var slotB = this.slotPacket.getItem(1); | |
var level = null; | |
if(slotA != null) { | |
level = slotA.get_level(); | |
} | |
if(slotB != null) { | |
level = slotB.get_level(); | |
} | |
if(slotA != null && slotB != null) { | |
level = (slotA.get_level() + slotB.get_level()) / 2 | 0; | |
} | |
var hasOrange = slotA != null && slotA.get_slotType() == "orange" || slotB != null && slotB.get_slotType() == "orange"; | |
var hasGreen = slotA != null && slotA.get_slotType() == "green" || slotB != null && slotB.get_slotType() == "green"; | |
if((hasOrange || hasGreen) && com_progrestar_game_managers_GameQualityManager.get_showCrystalsBattle()) { | |
this.render.setModel(battle_$pack_location_building_view_CrystalEnvironmentController.takeSystem(hasOrange,hasGreen,level)); | |
this.render.addChild(this.body); | |
this.get_holder().addChild(this.render); | |
this.addOffset(); | |
} else { | |
this.get_holder().addChild(this.body); | |
this.get_holder().removeChild(this.render); | |
this.render.setModel(null); | |
this.clearOffset(); | |
} | |
} | |
,addOffset: function(v) { | |
if(!this._offsetAdded) { | |
this.render.get_transform().setPosition(this.render.get_transform().getPosition().x,this.render.get_transform().getPosition().y - this._positionOffset); | |
this.body.get_transform().setPosition(this.body.get_transform().getPosition().x,this.body.get_transform().getPosition().y + this._positionOffset); | |
this._offsetAdded = true; | |
} | |
} | |
,clearOffset: function(v) { | |
if(this._offsetAdded) { | |
this.render.get_transform().setPosition(this.render.get_transform().getPosition().x,this.render.get_transform().getPosition().y + this._positionOffset); | |
this.body.get_transform().setPosition(this.body.get_transform().getPosition().x,this.body.get_transform().getPosition().y - this._positionOffset); | |
this._offsetAdded = false; | |
} | |
} | |
,finish: function() { | |
if(!this.body.get_isReleased()) { | |
this._holder.addChild(this.body); | |
} | |
this.slotPacket.get_changed().remove($bind(this,this.refreshParticles)); | |
com_progrestar_game_managers_GameQualityManager.showCrystalsBattleChanged.remove($bind(this,this.onSettingsChanged)); | |
if(this.render != null) { | |
this.render.release(); | |
this.render = null; | |
} | |
com_progrestar_framework_scene_core_AbstractController.prototype.finish.call(this); | |
this.scene = null; | |
this.slotPacket = null; | |
this.body = null; | |
} | |
,onSettingsChanged: function(v) { | |
this.refreshParticles(); | |
} | |
,__class__: battle_$pack_location_building_view_CrystalEnvironmentController | |
}); | |
var battle_$pack_location_building_view_ExplosionController = function() { | |
this._explosionLink = "effects/secondary@BuildingExplosion"; | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.building.view.ExplosionController"] = battle_$pack_location_building_view_ExplosionController; | |
battle_$pack_location_building_view_ExplosionController.__name__ = ["battle_pack","location","building","view","ExplosionController"]; | |
battle_$pack_location_building_view_ExplosionController.create = function(data,base) { | |
var inst = StaticExt.fromPool(battle_$pack_location_building_view_ExplosionController.__pool,battle_$pack_location_building_view_ExplosionController); | |
inst.init(data,base); | |
return inst; | |
}; | |
battle_$pack_location_building_view_ExplosionController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_building_view_ExplosionController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
_instance: null | |
,clip: null | |
,data: null | |
,init: function(data,model) { | |
this.data = data; | |
this._instance = model; | |
} | |
,_explosionLink: null | |
,get_explosionLink: function() { | |
return this._explosionLink; | |
} | |
,set_explosionLink: function(value) { | |
this._explosionLink = value; | |
return value; | |
} | |
,start: function() { | |
this._instance.get_stateChanged().add($bind(this,this.onStateChanged)); | |
} | |
,finish: function() { | |
if(this.data != null) { | |
if(this.clip != null) { | |
this.clip.release(); | |
this.clip = null; | |
} | |
if(this._instance != null) { | |
this._instance.get_stateChanged().remove($bind(this,this.onStateChanged)); | |
this._instance = null; | |
} | |
this.data = null; | |
StaticExt.toPool(battle_$pack_location_building_view_ExplosionController.__pool,this); | |
} | |
} | |
,refresh: function() { | |
if(this.clip != null) { | |
var speed = battle_$pack_location_location_$view_SceneConfig.instance.gameSpeed.get_value(); | |
this.clip.set_speed(speed); | |
} | |
} | |
,onStateChanged: function(v) { | |
if(this._instance.get_state() == "Death" && this.clip == null) { | |
this.clip = this.data.get_scene().createClipPlayer(this._explosionLink,"ExplosionCtr"); | |
this.clip.goTo(0); | |
this.clip.set_speed(battle_$pack_location_location_$view_SceneConfig.instance.gameSpeed.get_value()); | |
this.clip.play(false); | |
this.clip.get_animationEnd().add($bind(this,this.onAnimationStopped)); | |
this._holder.addChild(this.clip); | |
} | |
} | |
,onAnimationStopped: function(v) { | |
this.finish(); | |
} | |
,__class__: battle_$pack_location_building_view_ExplosionController | |
,__properties__: $extend(com_progrestar_framework_scene_core_AbstractController.prototype.__properties__,{set_explosionLink:"set_explosionLink",get_explosionLink:"get_explosionLink"}) | |
}); | |
var battle_$pack_location_building_view_FireInfo = function() { | |
this.length = 0; | |
}; | |
$hxClasses["battle_pack.location.building.view.FireInfo"] = battle_$pack_location_building_view_FireInfo; | |
battle_$pack_location_building_view_FireInfo.__name__ = ["battle_pack","location","building","view","FireInfo"]; | |
battle_$pack_location_building_view_FireInfo.prototype = { | |
clip: null | |
,length: null | |
,__class__: battle_$pack_location_building_view_FireInfo | |
}; | |
var battle_$pack_location_building_view_IVisual = function() { }; | |
$hxClasses["battle_pack.location.building.view.IVisual"] = battle_$pack_location_building_view_IVisual; | |
battle_$pack_location_building_view_IVisual.__name__ = ["battle_pack","location","building","view","IVisual"]; | |
battle_$pack_location_building_view_IVisual.__interfaces__ = [com_progrestar_framework_scene_core_IController]; | |
battle_$pack_location_building_view_IVisual.prototype = { | |
get_visual: null | |
,__class__: battle_$pack_location_building_view_IVisual | |
,__properties__: {get_visual:"get_visual"} | |
}; | |
var battle_$pack_location_building_view_LootDropEffectController = function() { | |
this.buffer = new com_progrestar_game_collection_Collection(); | |
this.lastTime = 0; | |
this.counter = 0; | |
this._negative = false; | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.building.view.LootDropEffectController"] = battle_$pack_location_building_view_LootDropEffectController; | |
battle_$pack_location_building_view_LootDropEffectController.__name__ = ["battle_pack","location","building","view","LootDropEffectController"]; | |
battle_$pack_location_building_view_LootDropEffectController.create = function(data,base) { | |
var inst = StaticExt.fromPool(battle_$pack_location_building_view_LootDropEffectController.__pool,battle_$pack_location_building_view_LootDropEffectController); | |
inst.init(data,base); | |
return inst; | |
}; | |
battle_$pack_location_building_view_LootDropEffectController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_building_view_LootDropEffectController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
data: null | |
,_building: null | |
,_negative: null | |
,counter: null | |
,lastTime: null | |
,buffer: null | |
,init: function(data,building) { | |
this._building = building; | |
this.data = data; | |
} | |
,start: function() { | |
this._building.get_storage().get_farmSignal().add($bind(this,this.onLoot)); | |
this._building.get_killedSignal().add($bind(this,this.checkAnimation)); | |
} | |
,finish: function() { | |
com_progrestar_framework_time_Time.stop($bind(this,this.checkAnimation)); | |
this._building.get_storage().get_farmSignal().remove($bind(this,this.onLoot)); | |
this._building.get_killedSignal().remove($bind(this,this.checkAnimation)); | |
this._building = null; | |
this.buffer.clear(); | |
this.data = null; | |
StaticExt.toPool(battle_$pack_location_building_view_LootDropEffectController.__pool,this); | |
} | |
,refresh: function() { | |
} | |
,onLoot: function(element) { | |
this.buffer.addItem(element.get_elementType(),element.get_amount()); | |
this.checkAnimation(); | |
} | |
,checkAnimation: function(v) { | |
var currentTime = Math.round(new Date().getTime() / 1000 * 1000); | |
if(this.get_hasNext() && currentTime > this.lastTime + 1000.) { | |
this.lastTime = currentTime; | |
var element = this.buffer.getFirstElement(); | |
this.showEffect(element); | |
this.buffer.setItem(element.get_elementType(),0); | |
} | |
if(this.get_hasNext()) { | |
com_progrestar_framework_time_Time.start($bind(this,this.checkAnimation),1.0,1); | |
} | |
} | |
,get_hasNext: function() { | |
if(this._building.get_hp() != 0) { | |
return this.buffer.getTotalAmount() >= 100; | |
} | |
return this.buffer.getTotalAmount() > 0; | |
} | |
,showEffect: function(element) { | |
com_progrestar_framework_core_Assert.isTrue(this._building != null,"invalid show time"); | |
var pos = new openfl_geom_Point(); | |
this.data.get_transform().modelToView(this._building.get_x(),this._building.get_y(),0,pos); | |
pos.x += ++this.counter % 2 != 0 ? -50 : 50; | |
pos.y += this._building.get_buildingData().get_visualData().iconPosition.y; | |
com_progrestar_game_render2_factory_ResourceAnimationFactory.showResAnim(this.data.get_scene(),this.data.get_airLayer(),element,pos,this._negative); | |
} | |
,__class__: battle_$pack_location_building_view_LootDropEffectController | |
,__properties__: $extend(com_progrestar_framework_scene_core_AbstractController.prototype.__properties__,{get_hasNext:"get_hasNext"}) | |
}); | |
var battle_$pack_location_building_view_LootSimultaneousDropEffectController = function() { | |
this.simultaneousAnimationsCounter = 0; | |
this.buffer = new com_progrestar_game_collection_Collection(); | |
this.lastTime = 0; | |
this.counter = 0; | |
this._negative = false; | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.building.view.LootSimultaneousDropEffectController"] = battle_$pack_location_building_view_LootSimultaneousDropEffectController; | |
battle_$pack_location_building_view_LootSimultaneousDropEffectController.__name__ = ["battle_pack","location","building","view","LootSimultaneousDropEffectController"]; | |
battle_$pack_location_building_view_LootSimultaneousDropEffectController.create = function(data,base) { | |
var inst = StaticExt.fromPool(battle_$pack_location_building_view_LootSimultaneousDropEffectController.__pool,battle_$pack_location_building_view_LootSimultaneousDropEffectController); | |
inst.init(data,base); | |
return inst; | |
}; | |
battle_$pack_location_building_view_LootSimultaneousDropEffectController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_building_view_LootSimultaneousDropEffectController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
data: null | |
,_building: null | |
,_negative: null | |
,counter: null | |
,lastTime: null | |
,buffer: null | |
,init: function(data,building) { | |
this._building = building; | |
this.data = data; | |
} | |
,start: function() { | |
this._building.get_storage().get_farmSignal().add($bind(this,this.onLoot)); | |
this._building.get_killedSignal().add($bind(this,this.checkAnimation)); | |
} | |
,finish: function() { | |
com_progrestar_framework_time_Time.stop($bind(this,this.checkAnimation)); | |
this._building.get_storage().get_farmSignal().remove($bind(this,this.onLoot)); | |
this._building.get_killedSignal().remove($bind(this,this.checkAnimation)); | |
this._building = null; | |
this.buffer.clear(); | |
this.data = null; | |
StaticExt.toPool(battle_$pack_location_building_view_LootSimultaneousDropEffectController.__pool,this); | |
} | |
,refresh: function() { | |
} | |
,onLoot: function(element) { | |
this.buffer.addItem(element.get_elementType(),element.get_amount()); | |
this.checkAnimation(); | |
} | |
,simultaneousAnimationsCounter: null | |
,checkAnimation: function(v) { | |
var currentTime = Math.round(new Date().getTime() / 1000 * 1000); | |
if(this.get_hasNext() && currentTime > this.lastTime + 10.) { | |
var element = this.buffer.getFirstElement(); | |
if(currentTime - this.lastTime < 100.) { | |
this.showEffect(element,20 * (this.simultaneousAnimationsCounter + 1),30 * (this.simultaneousAnimationsCounter + 1)); | |
this.simultaneousAnimationsCounter++; | |
} else { | |
this.showEffect(element); | |
this.simultaneousAnimationsCounter = 0; | |
} | |
this.buffer.setItem(element.get_elementType(),0); | |
this.lastTime = currentTime; | |
} | |
if(this.get_hasNext()) { | |
com_progrestar_framework_time_Time.start($bind(this,this.checkAnimation),0.01,1); | |
} | |
} | |
,get_hasNext: function() { | |
if(this._building.get_hp() != 0) { | |
return this.buffer.getTotalAmount() >= 100; | |
} | |
return this.buffer.getTotalAmount() > 0; | |
} | |
,showEffect: function(element,deltaX,deltaY) { | |
if(deltaY == null) { | |
deltaY = 0; | |
} | |
if(deltaX == null) { | |
deltaX = 0; | |
} | |
com_progrestar_framework_core_Assert.isTrue(this._building != null,"invalid show time"); | |
var pos = new openfl_geom_Point(); | |
this.data.get_transform().modelToView(this._building.get_x(),this._building.get_y(),0,pos); | |
pos.x += deltaX; | |
pos.y += this._building.get_buildingData().get_visualData().iconPosition.y + deltaY; | |
com_progrestar_game_render2_factory_ResourceAnimationFactory.showResAnim(this.data.get_scene(),this.data.get_airLayer(),element,pos,this._negative); | |
} | |
,__class__: battle_$pack_location_building_view_LootSimultaneousDropEffectController | |
,__properties__: $extend(com_progrestar_framework_scene_core_AbstractController.prototype.__properties__,{get_hasNext:"get_hasNext"}) | |
}); | |
var battle_$pack_location_building_view_RuinsBody = function() { | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.building.view.RuinsBody"] = battle_$pack_location_building_view_RuinsBody; | |
battle_$pack_location_building_view_RuinsBody.__name__ = ["battle_pack","location","building","view","RuinsBody"]; | |
battle_$pack_location_building_view_RuinsBody.__interfaces__ = [battle_$pack_location_building_view_IVisual,com_progrestar_framework_scene_core_IController]; | |
battle_$pack_location_building_view_RuinsBody.create = function(data,base,environment) { | |
var inst = StaticExt.fromPool(battle_$pack_location_building_view_RuinsBody.__pool,battle_$pack_location_building_view_RuinsBody); | |
inst.init(data,base,environment); | |
return inst; | |
}; | |
battle_$pack_location_building_view_RuinsBody.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_building_view_RuinsBody.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
building: null | |
,_visual: null | |
,data: null | |
,environment: null | |
,lastLink: null | |
,init: function(data,base,environment) { | |
this.building = base; | |
this.data = data; | |
this.environment = environment; | |
} | |
,start: function() { | |
this.building.get_killedSignal().add($bind(this,this.updateState)); | |
this.updateState(); | |
} | |
,finish: function() { | |
this.building.get_killedSignal().remove($bind(this,this.updateState)); | |
this.building.get_positionChanged().remove($bind(this,this.updatePosition)); | |
if(this._visual != null) { | |
this._visual.release(); | |
this._holder.removeChild(this._visual); | |
this._visual = null; | |
} | |
this.building = null; | |
this.data = null; | |
this.environment = null; | |
this.lastLink = null; | |
StaticExt.toPool(battle_$pack_location_building_view_RuinsBody.__pool,this); | |
} | |
,updateState: function(v) { | |
if(this.building.get_state() != "Death") { | |
return; | |
} | |
var clipLink = this.building.get_buildingData().get_ruinsLink(); | |
if(this.lastLink == clipLink) { | |
return; | |
} | |
this.lastLink = clipLink; | |
if(this._visual == null) { | |
this.building.get_positionChanged().add($bind(this,this.updatePosition)); | |
this._visual = this.data.get_scene().createClipPlayer(null,"RuinsBody"); | |
this._holder.addChild(this._visual); | |
this.updatePosition(); | |
} | |
this._visual.setClipFromFile(clipLink); | |
this._visual.play(true); | |
} | |
,get_visual: function() { | |
return this._visual; | |
} | |
,updatePosition: function(v) { | |
var transform = this._holder.get_transform(); | |
var half = this.building.get_size() / 2; | |
var wx = this.building.get_x() + half; | |
var wy = this.building.get_y() + half; | |
var vx = (wx - wy) * 32; | |
var vy = (wx + wy) * 16; | |
this._visual.get_transform().setRGBA(0.8,0.8,0.8,1.0); | |
transform.setPosition(vx,vy); | |
transform.setDepth(-wx - wy + 1e3); | |
} | |
,__class__: battle_$pack_location_building_view_RuinsBody | |
,__properties__: $extend(com_progrestar_framework_scene_core_AbstractController.prototype.__properties__,{get_visual:"get_visual"}) | |
}); | |
var battle_$pack_location_building_view_StorageBody = function() { | |
battle_$pack_location_building_view_BuildingBaseController.call(this); | |
}; | |
$hxClasses["battle_pack.location.building.view.StorageBody"] = battle_$pack_location_building_view_StorageBody; | |
battle_$pack_location_building_view_StorageBody.__name__ = ["battle_pack","location","building","view","StorageBody"]; | |
battle_$pack_location_building_view_StorageBody.__interfaces__ = [com_progrestar_framework_scene_core_IController]; | |
battle_$pack_location_building_view_StorageBody.create = function(data,base,environment) { | |
var inst = StaticExt.fromPool(battle_$pack_location_building_view_StorageBody.__pool,battle_$pack_location_building_view_StorageBody); | |
inst.init(data,base,environment); | |
return inst; | |
}; | |
battle_$pack_location_building_view_StorageBody.__super__ = battle_$pack_location_building_view_BuildingBaseController; | |
battle_$pack_location_building_view_StorageBody.prototype = $extend(battle_$pack_location_building_view_BuildingBaseController.prototype,{ | |
environment: null | |
,init: function(data,base,environment) { | |
battle_$pack_location_building_view_BuildingBaseController.prototype.baseInit.call(this,data,base); | |
this.environment = environment; | |
} | |
,start: function() { | |
battle_$pack_location_building_view_BuildingBaseController.prototype.start.call(this); | |
this.building.get_storage().get_resources().get_totalObserver().add($bind(this,this.updateState)); | |
this.building.get_stateChanged().add($bind(this,this.updateState)); | |
battle_$pack_location_building_view_CrystalEnvironmentController.init(this._holder,this.data.get_scene(),this._visual,this.building); | |
this.updateState(); | |
} | |
,finish: function() { | |
this.building.get_storage().get_resources().get_totalObserver().remove($bind(this,this.updateState)); | |
this.building.get_stateChanged().remove($bind(this,this.updateState)); | |
battle_$pack_location_building_view_BuildingBaseController.prototype.finish.call(this); | |
this.environment = null; | |
StaticExt.toPool(battle_$pack_location_building_view_StorageBody.__pool,this); | |
} | |
,refresh: function() { | |
var speed = battle_$pack_location_location_$view_SceneConfig.instance.gameSpeed.get_value(); | |
this._visual.set_speed(speed); | |
} | |
,updateState: function(v) { | |
var speed = battle_$pack_location_location_$view_SceneConfig.instance.gameSpeed.get_value(); | |
var clipLink = null; | |
var loop = true; | |
this._visual.set_speed(speed); | |
if(this.building.get_state() == "Death") { | |
this._visual.setClip(null); | |
} else if(this.building.underConstruction) { | |
clipLink = this.building.get_buildingData().get_constructionLink(); | |
this.play(clipLink,loop); | |
this._visual.goTo(com_progrestar_framework_core_utils_RandomUtils.randi()); | |
} else { | |
var storageFill = 0; | |
if(this.building.get_storage() != null) { | |
storageFill = com_progrestar_framework_core_utils_MathUtils.clampf(this.building.get_storage().get_resources().getTotalAmount() / this.building.get_storage().get_capacity(),0,1); | |
} | |
clipLink = com_progrestar_game_render2_controller_building_body_BuildingSkinNext.getSkin(this.building.get_buildingData(),storageFill,1,this.building.direction); | |
this._visual.goTo(0); | |
this.play(clipLink,loop); | |
} | |
var tmp = this.building.flip ? -1 : 1; | |
this._visual.get_transform().setScale(tmp,1); | |
} | |
,__class__: battle_$pack_location_building_view_StorageBody | |
}); | |
var lime_math_Matrix3 = function(a,b,c,d,tx,ty) { | |
if(ty == null) { | |
ty = 0; | |
} | |
if(tx == null) { | |
tx = 0; | |
} | |
if(d == null) { | |
d = 1; | |
} | |
if(c == null) { | |
c = 0; | |
} | |
if(b == null) { | |
b = 0; | |
} | |
if(a == null) { | |
a = 1; | |
} | |
this.a = a; | |
this.b = b; | |
this.c = c; | |
this.d = d; | |
this.tx = tx; | |
this.ty = ty; | |
}; | |
$hxClasses["lime.math.Matrix3"] = lime_math_Matrix3; | |
lime_math_Matrix3.__name__ = ["lime","math","Matrix3"]; | |
lime_math_Matrix3.prototype = { | |
a: null | |
,b: null | |
,c: null | |
,d: null | |
,tx: null | |
,ty: null | |
,clone: function() { | |
return new lime_math_Matrix3(this.a,this.b,this.c,this.d,this.tx,this.ty); | |
} | |
,concat: function(m) { | |
var a1 = this.a * m.a + this.b * m.c; | |
this.b = this.a * m.b + this.b * m.d; | |
this.a = a1; | |
var c1 = this.c * m.a + this.d * m.c; | |
this.d = this.c * m.b + this.d * m.d; | |
this.c = c1; | |
var tx1 = this.tx * m.a + this.ty * m.c + m.tx; | |
this.ty = this.tx * m.b + this.ty * m.d + m.ty; | |
this.tx = tx1; | |
} | |
,copyColumnFrom: function(column,vector4) { | |
if(column > 2) { | |
throw new js__$Boot_HaxeError("Column " + column + " out of bounds (2)"); | |
} else if(column == 0) { | |
this.a = vector4.x; | |
this.b = vector4.y; | |
} else if(column == 1) { | |
this.c = vector4.x; | |
this.d = vector4.y; | |
} else { | |
this.tx = vector4.x; | |
this.ty = vector4.y; | |
} | |
} | |
,copyColumnTo: function(column,vector4) { | |
if(column > 2) { | |
throw new js__$Boot_HaxeError("Column " + column + " out of bounds (2)"); | |
} else if(column == 0) { | |
vector4.x = this.a; | |
vector4.y = this.b; | |
vector4.z = 0; | |
} else if(column == 1) { | |
vector4.x = this.c; | |
vector4.y = this.d; | |
vector4.z = 0; | |
} else { | |
vector4.x = this.tx; | |
vector4.y = this.ty; | |
vector4.z = 1; | |
} | |
} | |
,copyFrom: function(sourceMatrix3) { | |
this.a = sourceMatrix3.a; | |
this.b = sourceMatrix3.b; | |
this.c = sourceMatrix3.c; | |
this.d = sourceMatrix3.d; | |
this.tx = sourceMatrix3.tx; | |
this.ty = sourceMatrix3.ty; | |
} | |
,copyRowFrom: function(row,vector4) { | |
if(row > 2) { | |
throw new js__$Boot_HaxeError("Row " + row + " out of bounds (2)"); | |
} else if(row == 0) { | |
this.a = vector4.x; | |
this.c = vector4.y; | |
this.tx = vector4.z; | |
} else if(row == 1) { | |
this.b = vector4.x; | |
this.d = vector4.y; | |
this.ty = vector4.z; | |
} | |
} | |
,copyRowTo: function(row,vector4) { | |
if(row > 2) { | |
throw new js__$Boot_HaxeError("Row " + row + " out of bounds (2)"); | |
} else if(row == 0) { | |
vector4.x = this.a; | |
vector4.y = this.c; | |
vector4.z = this.tx; | |
} else if(row == 1) { | |
vector4.x = this.b; | |
vector4.y = this.d; | |
vector4.z = this.ty; | |
} else { | |
vector4.x = 0; | |
vector4.y = 0; | |
vector4.z = 1; | |
} | |
} | |
,createBox: function(scaleX,scaleY,rotation,tx,ty) { | |
if(ty == null) { | |
ty = 0; | |
} | |
if(tx == null) { | |
tx = 0; | |
} | |
if(rotation == null) { | |
rotation = 0; | |
} | |
if(rotation != 0) { | |
var cos = Math.cos(rotation); | |
var sin = Math.sin(rotation); | |
this.a = cos * scaleX; | |
this.b = sin * scaleY; | |
this.c = -sin * scaleX; | |
this.d = cos * scaleY; | |
} else { | |
this.a = scaleX; | |
this.b = 0; | |
this.c = 0; | |
this.d = scaleY; | |
} | |
this.tx = tx; | |
this.ty = ty; | |
} | |
,createGradientBox: function(width,height,rotation,tx,ty) { | |
if(ty == null) { | |
ty = 0; | |
} | |
if(tx == null) { | |
tx = 0; | |
} | |
if(rotation == null) { | |
rotation = 0; | |
} | |
this.a = width / 1638.4; | |
this.d = height / 1638.4; | |
if(rotation != 0) { | |
var cos = Math.cos(rotation); | |
var sin = Math.sin(rotation); | |
this.b = sin * this.d; | |
this.c = -sin * this.a; | |
this.a *= cos; | |
this.d *= cos; | |
} else { | |
this.b = 0; | |
this.c = 0; | |
} | |
this.tx = tx + width / 2; | |
this.ty = ty + height / 2; | |
} | |
,equals: function(matrix3) { | |
if(matrix3 != null && this.tx == matrix3.tx && this.ty == matrix3.ty && this.a == matrix3.a && this.b == matrix3.b && this.c == matrix3.c) { | |
return this.d == matrix3.d; | |
} else { | |
return false; | |
} | |
} | |
,deltaTransformVector: function(Vector2,result) { | |
if(result == null) { | |
result = new lime_math_Vector2(); | |
} | |
result.x = Vector2.x * this.a + Vector2.y * this.c; | |
result.y = Vector2.x * this.b + Vector2.y * this.d; | |
return result; | |
} | |
,identity: function() { | |
this.a = 1; | |
this.b = 0; | |
this.c = 0; | |
this.d = 1; | |
this.tx = 0; | |
this.ty = 0; | |
} | |
,invert: function() { | |
var norm = this.a * this.d - this.b * this.c; | |
if(norm == 0) { | |
this.a = this.b = this.c = this.d = 0; | |
this.tx = -this.tx; | |
this.ty = -this.ty; | |
} else { | |
norm = 1.0 / norm; | |
var a1 = this.d * norm; | |
this.d = this.a * norm; | |
this.a = a1; | |
this.b *= -norm; | |
this.c *= -norm; | |
var tx1 = -this.a * this.tx - this.c * this.ty; | |
this.ty = -this.b * this.tx - this.d * this.ty; | |
this.tx = tx1; | |
} | |
return this; | |
} | |
,rotate: function(theta) { | |
var cos = Math.cos(theta); | |
var sin = Math.sin(theta); | |
var a1 = this.a * cos - this.b * sin; | |
this.b = this.a * sin + this.b * cos; | |
this.a = a1; | |
var c1 = this.c * cos - this.d * sin; | |
this.d = this.c * sin + this.d * cos; | |
this.c = c1; | |
var tx1 = this.tx * cos - this.ty * sin; | |
this.ty = this.tx * sin + this.ty * cos; | |
this.tx = tx1; | |
} | |
,scale: function(sx,sy) { | |
this.a *= sx; | |
this.b *= sy; | |
this.c *= sx; | |
this.d *= sy; | |
this.tx *= sx; | |
this.ty *= sy; | |
} | |
,setRotation: function(theta,scale) { | |
if(scale == null) { | |
scale = 1; | |
} | |
this.a = Math.cos(theta) * scale; | |
this.c = Math.sin(theta) * scale; | |
this.b = -this.c; | |
this.d = this.a; | |
} | |
,setTo: function(a,b,c,d,tx,ty) { | |
this.a = a; | |
this.b = b; | |
this.c = c; | |
this.d = d; | |
this.tx = tx; | |
this.ty = ty; | |
} | |
,to3DString: function(roundPixels) { | |
if(roundPixels == null) { | |
roundPixels = false; | |
} | |
if(roundPixels) { | |
return "matrix3d(" + this.a + ", " + this.b + ", " + "0, 0, " + this.c + ", " + this.d + ", " + "0, 0, 0, 0, 1, 0, " + (this.tx | 0) + ", " + (this.ty | 0) + ", 0, 1)"; | |
} else { | |
return "matrix3d(" + this.a + ", " + this.b + ", " + "0, 0, " + this.c + ", " + this.d + ", " + "0, 0, 0, 0, 1, 0, " + this.tx + ", " + this.ty + ", 0, 1)"; | |
} | |
} | |
,toString: function() { | |
return "matrix(" + this.a + ", " + this.b + ", " + this.c + ", " + this.d + ", " + this.tx + ", " + this.ty + ")"; | |
} | |
,transformRect: function(rect,result) { | |
if(result == null) { | |
result = new lime_math_Rectangle(); | |
} | |
var tx0 = this.a * rect.x + this.c * rect.y; | |
var tx1 = tx0; | |
var ty0 = this.b * rect.x + this.d * rect.y; | |
var ty1 = ty0; | |
var tx = this.a * (rect.x + rect.width) + this.c * rect.y; | |
var ty = this.b * (rect.x + rect.width) + this.d * rect.y; | |
if(tx < tx0) { | |
tx0 = tx; | |
} | |
if(ty < ty0) { | |
ty0 = ty; | |
} | |
if(tx > tx1) { | |
tx1 = tx; | |
} | |
if(ty > ty1) { | |
ty1 = ty; | |
} | |
tx = this.a * (rect.x + rect.width) + this.c * (rect.y + rect.height); | |
ty = this.b * (rect.x + rect.width) + this.d * (rect.y + rect.height); | |
if(tx < tx0) { | |
tx0 = tx; | |
} | |
if(ty < ty0) { | |
ty0 = ty; | |
} | |
if(tx > tx1) { | |
tx1 = tx; | |
} | |
if(ty > ty1) { | |
ty1 = ty; | |
} | |
tx = this.a * rect.x + this.c * (rect.y + rect.height); | |
ty = this.b * rect.x + this.d * (rect.y + rect.height); | |
if(tx < tx0) { | |
tx0 = tx; | |
} | |
if(ty < ty0) { | |
ty0 = ty; | |
} | |
if(tx > tx1) { | |
tx1 = tx; | |
} | |
if(ty > ty1) { | |
ty1 = ty; | |
} | |
result.setTo(tx0 + tx,ty0 + ty,tx1 - tx0,ty1 - ty0); | |
return result; | |
} | |
,transformVector: function(pos,result) { | |
if(result == null) { | |
result = new lime_math_Vector2(); | |
} | |
result.x = pos.x * this.a + pos.y * this.c + this.tx; | |
result.y = pos.x * this.b + pos.y * this.d + this.ty; | |
return result; | |
} | |
,translate: function(dx,dy) { | |
this.tx += dx; | |
this.ty += dy; | |
} | |
,__class__: lime_math_Matrix3 | |
}; | |
var openfl_geom_Matrix = function(a,b,c,d,tx,ty) { | |
if(ty == null) { | |
ty = 0; | |
} | |
if(tx == null) { | |
tx = 0; | |
} | |
if(d == null) { | |
d = 1; | |
} | |
if(c == null) { | |
c = 0; | |
} | |
if(b == null) { | |
b = 0; | |
} | |
if(a == null) { | |
a = 1; | |
} | |
this.a = a; | |
this.b = b; | |
this.c = c; | |
this.d = d; | |
this.tx = tx; | |
this.ty = ty; | |
}; | |
$hxClasses["openfl.geom.Matrix"] = openfl_geom_Matrix; | |
openfl_geom_Matrix.__name__ = ["openfl","geom","Matrix"]; | |
openfl_geom_Matrix.prototype = { | |
a: null | |
,b: null | |
,c: null | |
,d: null | |
,tx: null | |
,ty: null | |
,__array: null | |
,clone: function() { | |
return new openfl_geom_Matrix(this.a,this.b,this.c,this.d,this.tx,this.ty); | |
} | |
,concat: function(m) { | |
var a1 = this.a * m.a + this.b * m.c; | |
this.b = this.a * m.b + this.b * m.d; | |
this.a = a1; | |
var c1 = this.c * m.a + this.d * m.c; | |
this.d = this.c * m.b + this.d * m.d; | |
this.c = c1; | |
var tx1 = this.tx * m.a + this.ty * m.c + m.tx; | |
this.ty = this.tx * m.b + this.ty * m.d + m.ty; | |
this.tx = tx1; | |
} | |
,copyColumnFrom: function(column,vector3D) { | |
if(column > 2) { | |
throw new js__$Boot_HaxeError("Column " + column + " out of bounds (2)"); | |
} else if(column == 0) { | |
this.a = vector3D.x; | |
this.b = vector3D.y; | |
} else if(column == 1) { | |
this.c = vector3D.x; | |
this.d = vector3D.y; | |
} else { | |
this.tx = vector3D.x; | |
this.ty = vector3D.y; | |
} | |
} | |
,copyColumnTo: function(column,vector3D) { | |
if(column > 2) { | |
throw new js__$Boot_HaxeError("Column " + column + " out of bounds (2)"); | |
} else if(column == 0) { | |
vector3D.x = this.a; | |
vector3D.y = this.b; | |
vector3D.z = 0; | |
} else if(column == 1) { | |
vector3D.x = this.c; | |
vector3D.y = this.d; | |
vector3D.z = 0; | |
} else { | |
vector3D.x = this.tx; | |
vector3D.y = this.ty; | |
vector3D.z = 1; | |
} | |
} | |
,copyFrom: function(sourceMatrix) { | |
this.a = sourceMatrix.a; | |
this.b = sourceMatrix.b; | |
this.c = sourceMatrix.c; | |
this.d = sourceMatrix.d; | |
this.tx = sourceMatrix.tx; | |
this.ty = sourceMatrix.ty; | |
} | |
,copyRowFrom: function(row,vector3D) { | |
if(row > 2) { | |
throw new js__$Boot_HaxeError("Row " + row + " out of bounds (2)"); | |
} else if(row == 0) { | |
this.a = vector3D.x; | |
this.c = vector3D.y; | |
this.tx = vector3D.z; | |
} else if(row == 1) { | |
this.b = vector3D.x; | |
this.d = vector3D.y; | |
this.ty = vector3D.z; | |
} | |
} | |
,copyRowTo: function(row,vector3D) { | |
if(row > 2) { | |
throw new js__$Boot_HaxeError("Row " + row + " out of bounds (2)"); | |
} else if(row == 0) { | |
vector3D.x = this.a; | |
vector3D.y = this.c; | |
vector3D.z = this.tx; | |
} else if(row == 1) { | |
vector3D.x = this.b; | |
vector3D.y = this.d; | |
vector3D.z = this.ty; | |
} else { | |
vector3D.setTo(0,0,1); | |
} | |
} | |
,createBox: function(scaleX,scaleY,rotation,tx,ty) { | |
if(ty == null) { | |
ty = 0; | |
} | |
if(tx == null) { | |
tx = 0; | |
} | |
if(rotation == null) { | |
rotation = 0; | |
} | |
if(rotation != 0) { | |
var cos = Math.cos(rotation); | |
var sin = Math.sin(rotation); | |
this.a = cos * scaleX; | |
this.b = sin * scaleY; | |
this.c = -sin * scaleX; | |
this.d = cos * scaleY; | |
} else { | |
this.a = scaleX; | |
this.b = 0; | |
this.c = 0; | |
this.d = scaleY; | |
} | |
this.tx = tx; | |
this.ty = ty; | |
} | |
,createGradientBox: function(width,height,rotation,tx,ty) { | |
if(ty == null) { | |
ty = 0; | |
} | |
if(tx == null) { | |
tx = 0; | |
} | |
if(rotation == null) { | |
rotation = 0; | |
} | |
this.a = width / 1638.4; | |
this.d = height / 1638.4; | |
if(rotation != 0) { | |
var cos = Math.cos(rotation); | |
var sin = Math.sin(rotation); | |
this.b = sin * this.d; | |
this.c = -sin * this.a; | |
this.a *= cos; | |
this.d *= cos; | |
} else { | |
this.b = 0; | |
this.c = 0; | |
} | |
this.tx = tx + width / 2; | |
this.ty = ty + height / 2; | |
} | |
,deltaTransformPoint: function(point) { | |
return new openfl_geom_Point(point.x * this.a + point.y * this.c,point.x * this.b + point.y * this.d); | |
} | |
,equals: function(matrix) { | |
if(matrix != null && this.tx == matrix.tx && this.ty == matrix.ty && this.a == matrix.a && this.b == matrix.b && this.c == matrix.c) { | |
return this.d == matrix.d; | |
} else { | |
return false; | |
} | |
} | |
,identity: function() { | |
this.a = 1; | |
this.b = 0; | |
this.c = 0; | |
this.d = 1; | |
this.tx = 0; | |
this.ty = 0; | |
} | |
,invert: function() { | |
var norm = this.a * this.d - this.b * this.c; | |
if(norm == 0) { | |
this.a = this.b = this.c = this.d = 0; | |
this.tx = -this.tx; | |
this.ty = -this.ty; | |
} else { | |
norm = 1.0 / norm; | |
var a1 = this.d * norm; | |
this.d = this.a * norm; | |
this.a = a1; | |
this.b *= -norm; | |
this.c *= -norm; | |
var tx1 = -this.a * this.tx - this.c * this.ty; | |
this.ty = -this.b * this.tx - this.d * this.ty; | |
this.tx = tx1; | |
} | |
return this; | |
} | |
,rotate: function(theta) { | |
var cos = Math.cos(theta); | |
var sin = Math.sin(theta); | |
var a1 = this.a * cos - this.b * sin; | |
this.b = this.a * sin + this.b * cos; | |
this.a = a1; | |
var c1 = this.c * cos - this.d * sin; | |
this.d = this.c * sin + this.d * cos; | |
this.c = c1; | |
var tx1 = this.tx * cos - this.ty * sin; | |
this.ty = this.tx * sin + this.ty * cos; | |
this.tx = tx1; | |
} | |
,scale: function(sx,sy) { | |
this.a *= sx; | |
this.b *= sy; | |
this.c *= sx; | |
this.d *= sy; | |
this.tx *= sx; | |
this.ty *= sy; | |
} | |
,setRotation: function(theta,scale) { | |
if(scale == null) { | |
scale = 1; | |
} | |
this.a = Math.cos(theta) * scale; | |
this.c = Math.sin(theta) * scale; | |
this.b = -this.c; | |
this.d = this.a; | |
} | |
,setTo: function(a,b,c,d,tx,ty) { | |
this.a = a; | |
this.b = b; | |
this.c = c; | |
this.d = d; | |
this.tx = tx; | |
this.ty = ty; | |
} | |
,to3DString: function(roundPixels) { | |
if(roundPixels == null) { | |
roundPixels = false; | |
} | |
if(roundPixels) { | |
return "matrix3d(" + this.a + ", " + this.b + ", 0, 0, " + this.c + ", " + this.d + ", 0, 0, 0, 0, 1, 0, " + (this.tx | 0) + ", " + (this.ty | 0) + ", 0, 1)"; | |
} else { | |
return "matrix3d(" + this.a + ", " + this.b + ", 0, 0, " + this.c + ", " + this.d + ", 0, 0, 0, 0, 1, 0, " + this.tx + ", " + this.ty + ", 0, 1)"; | |
} | |
} | |
,toMozString: function() { | |
return "matrix(" + this.a + ", " + this.b + ", " + this.c + ", " + this.d + ", " + this.tx + "px, " + this.ty + "px)"; | |
} | |
,toString: function() { | |
return "matrix(" + this.a + ", " + this.b + ", " + this.c + ", " + this.d + ", " + this.tx + ", " + this.ty + ")"; | |
} | |
,transformPoint: function(pos) { | |
return new openfl_geom_Point(pos.x * this.a + pos.y * this.c + this.tx,pos.x * this.b + pos.y * this.d + this.ty); | |
} | |
,translate: function(dx,dy) { | |
this.tx += dx; | |
this.ty += dy; | |
} | |
,toArray: function(transpose) { | |
if(transpose == null) { | |
transpose = false; | |
} | |
if(this.__array == null) { | |
var this1 = new Float32Array(9); | |
this.__array = this1; | |
} | |
if(transpose) { | |
this.__array[0] = this.a; | |
this.__array[1] = this.b; | |
this.__array[2] = 0; | |
this.__array[3] = this.c; | |
this.__array[4] = this.d; | |
this.__array[5] = 0; | |
this.__array[6] = this.tx; | |
this.__array[7] = this.ty; | |
this.__array[8] = 1; | |
} else { | |
this.__array[0] = this.a; | |
this.__array[1] = this.c; | |
this.__array[2] = this.tx; | |
this.__array[3] = this.b; | |
this.__array[4] = this.d; | |
this.__array[5] = this.ty; | |
this.__array[6] = 0; | |
this.__array[7] = 0; | |
this.__array[8] = 1; | |
} | |
return this.__array; | |
} | |
,__cleanValues: function() { | |
this.a = Math.round(this.a * 1000) / 1000; | |
this.b = Math.round(this.b * 1000) / 1000; | |
this.c = Math.round(this.c * 1000) / 1000; | |
this.d = Math.round(this.d * 1000) / 1000; | |
this.tx = Math.round(this.tx * 10) / 10; | |
this.ty = Math.round(this.ty * 10) / 10; | |
} | |
,__toMatrix3: function() { | |
openfl_geom_Matrix.__matrix3.setTo(this.a,this.b,this.c,this.d,this.tx,this.ty); | |
return openfl_geom_Matrix.__matrix3; | |
} | |
,__transformInversePoint: function(point) { | |
var norm = this.a * this.d - this.b * this.c; | |
if(norm == 0) { | |
point.x = -this.tx; | |
point.y = -this.ty; | |
} else { | |
var px = 1.0 / norm * (this.c * (this.ty - point.y) + this.d * (point.x - this.tx)); | |
point.y = 1.0 / norm * (this.a * (point.y - this.ty) + this.b * (this.tx - point.x)); | |
point.x = px; | |
} | |
} | |
,__transformInverseX: function(px,py) { | |
var norm = this.a * this.d - this.b * this.c; | |
if(norm == 0) { | |
return -this.tx; | |
} else { | |
return 1.0 / norm * (this.c * (this.ty - py) + this.d * (px - this.tx)); | |
} | |
} | |
,__transformInverseY: function(px,py) { | |
var norm = this.a * this.d - this.b * this.c; | |
if(norm == 0) { | |
return -this.ty; | |
} else { | |
return 1.0 / norm * (this.a * (py - this.ty) + this.b * (this.tx - px)); | |
} | |
} | |
,__transformPoint: function(point) { | |
var px = point.x; | |
var py = point.y; | |
point.x = px * this.a + py * this.c + this.tx; | |
point.y = px * this.b + py * this.d + this.ty; | |
} | |
,__transformX: function(px,py) { | |
return px * this.a + py * this.c + this.tx; | |
} | |
,__transformY: function(px,py) { | |
return px * this.b + py * this.d + this.ty; | |
} | |
,__translateTransformed: function(px,py) { | |
this.tx = px * this.a + py * this.c + this.tx; | |
this.ty = px * this.b + py * this.d + this.ty; | |
} | |
,__class__: openfl_geom_Matrix | |
}; | |
var battle_$pack_location_building_view_TurretBody = function() { | |
battle_$pack_location_building_view_BuildingBaseController.call(this); | |
}; | |
$hxClasses["battle_pack.location.building.view.TurretBody"] = battle_$pack_location_building_view_TurretBody; | |
battle_$pack_location_building_view_TurretBody.__name__ = ["battle_pack","location","building","view","TurretBody"]; | |
battle_$pack_location_building_view_TurretBody.__interfaces__ = [com_progrestar_framework_scene_core_IController]; | |
battle_$pack_location_building_view_TurretBody.create = function(data,base,environment) { | |
var inst = StaticExt.fromPool(battle_$pack_location_building_view_TurretBody.__pool,battle_$pack_location_building_view_TurretBody); | |
inst.init(data,base,environment); | |
return inst; | |
}; | |
battle_$pack_location_building_view_TurretBody.__super__ = battle_$pack_location_building_view_BuildingBaseController; | |
battle_$pack_location_building_view_TurretBody.prototype = $extend(battle_$pack_location_building_view_BuildingBaseController.prototype,{ | |
environment: null | |
,init: function(data,base,environment) { | |
battle_$pack_location_building_view_BuildingBaseController.prototype.baseInit.call(this,data,base); | |
this.environment = environment; | |
} | |
,start: function() { | |
battle_$pack_location_building_view_BuildingBaseController.prototype.start.call(this); | |
this.building.get_stateChanged().add($bind(this,this.updateState)); | |
battle_$pack_location_building_view_CrystalEnvironmentController.init(this._holder,this.data.get_scene(),this._visual,this.building); | |
this.updateState(); | |
} | |
,finish: function() { | |
this.building.get_stateChanged().remove($bind(this,this.updateState)); | |
battle_$pack_location_building_view_BuildingBaseController.prototype.finish.call(this); | |
this.environment = null; | |
StaticExt.toPool(battle_$pack_location_building_view_TurretBody.__pool,this); | |
} | |
,refresh: function() { | |
var speed = battle_$pack_location_location_$view_SceneConfig.instance.gameSpeed.get_value(); | |
this._visual.set_speed(speed); | |
} | |
,updateState: function(v) { | |
var speed = battle_$pack_location_location_$view_SceneConfig.instance.gameSpeed.get_value(); | |
var buildingLevelLibItem = this.building.get_buildingData(); | |
var skin = com_progrestar_game_render2_controller_building_body_BuildingSkin.getSelfSkin(buildingLevelLibItem,this.building.get_owner().get_homeLink().get_player()); | |
var loop = buildingLevelLibItem.getAssetLoop(this.building.get_state(),this.building.direction,skin,null,this.building.get_stateId()); | |
var clipLink = buildingLevelLibItem.getAssetLink(this.building.get_state(),this.building.direction,skin,null,this.building.get_stateId()); | |
this._visual.set_speed(speed); | |
var onAnimationEndCallback = null; | |
if(this.building.get_state() == "Death") { | |
if(this.building.get_buildingData().get_buildingLibItem().hasCustomAssetLink(this.building.get_state(),this.building.get_stateId())) { | |
this._visual.goTo(0); | |
this.play(clipLink,loop); | |
} else { | |
this._visual.setClip(null); | |
} | |
} else if(this.building.underConstruction) { | |
clipLink = this.building.get_buildingData().get_constructionLink(); | |
this.play(clipLink,loop); | |
this._visual.goTo(com_progrestar_framework_core_utils_RandomUtils.randi()); | |
} else if(this.building.get_state() == "Attack") { | |
this._visual.goTo(0); | |
this.play(clipLink,loop); | |
onAnimationEndCallback = $bind(this,this.onAttackFinished); | |
} else { | |
this._visual.goTo(0); | |
this.play(clipLink,loop); | |
} | |
var tmp = this.building.flip ? -1 : 1; | |
this._visual.get_transform().setScale(tmp,1); | |
if(buildingLevelLibItem.getNextAssetLink(this.building.get_state(),this.building.direction,skin,null,this.building.get_stateId()) != null) { | |
onAnimationEndCallback = $bind(this,this.onAnimationEnd); | |
} | |
if(onAnimationEndCallback != null) { | |
this._visual.get_animationEnd().add(onAnimationEndCallback); | |
} | |
this.findShootMark(); | |
} | |
,onAnimationEnd: function(v) { | |
this._visual.get_animationEnd().remove($bind(this,this.onAnimationEnd)); | |
var buildingLevelLibItem = this.building.get_buildingData(); | |
var skin = com_progrestar_game_render2_controller_building_body_BuildingSkin.getSelfSkin(buildingLevelLibItem,this.building.get_owner().get_homeLink().get_player()); | |
var link = buildingLevelLibItem.getNextAssetLink(this.building.get_state(),this.building.direction,skin,null,this.building.get_stateId()); | |
this._visual.goTo(0); | |
this.play(link,true); | |
} | |
,findShootMark: function() { | |
var tmp = this.building.get_buildingData().get_buildingLibItem().get_isTurret() ? battle_$pack_location_building_view_TurretBody.TOWER_MATRIX : null; | |
this.environment.shootMark = tmp; | |
if(this._visual.get_clip() != null && this._visual.get_clip().timeLine.length != 0) { | |
var container = StaticExt.kast(Std,this._visual.get_clip().timeLine[0],com_progrestar_framework_ares_core_Container); | |
if(container != null) { | |
var _g = 0; | |
var _g1 = container.nodes; | |
while(_g < _g1.length) { | |
var node = _g1[_g]; | |
++_g; | |
if(node.state.name == "shootMark") { | |
this.environment.shootMark = node.state.matrix; | |
break; | |
} | |
} | |
} | |
} | |
} | |
,onAttackFinished: function(v) { | |
this._visual.get_animationEnd().remove($bind(this,this.onAttackFinished)); | |
if(this.building.get_state() == "Attack") { | |
this.building.setState("Stand"); | |
} | |
} | |
,__class__: battle_$pack_location_building_view_TurretBody | |
}); | |
var battle_$pack_location_building_view_plug_IPlug = function() { }; | |
$hxClasses["battle_pack.location.building.view.plug.IPlug"] = battle_$pack_location_building_view_plug_IPlug; | |
battle_$pack_location_building_view_plug_IPlug.__name__ = ["battle_pack","location","building","view","plug","IPlug"]; | |
battle_$pack_location_building_view_plug_IPlug.prototype = { | |
plugState: null | |
,onStateChanged: null | |
,__class__: battle_$pack_location_building_view_plug_IPlug | |
}; | |
var battle_$pack_location_building_view_WallBody = function() { | |
this.lastY = 0; | |
this.lastX = 0; | |
this.plugState = null; | |
battle_$pack_location_building_view_BuildingBaseController.call(this); | |
}; | |
$hxClasses["battle_pack.location.building.view.WallBody"] = battle_$pack_location_building_view_WallBody; | |
battle_$pack_location_building_view_WallBody.__name__ = ["battle_pack","location","building","view","WallBody"]; | |
battle_$pack_location_building_view_WallBody.__interfaces__ = [battle_$pack_location_building_view_IVisual,battle_$pack_location_building_view_plug_IPlug,com_progrestar_framework_scene_core_IController]; | |
battle_$pack_location_building_view_WallBody.create = function(data,base) { | |
var inst = StaticExt.fromPool(battle_$pack_location_building_view_WallBody.__pool,battle_$pack_location_building_view_WallBody); | |
inst.init(data,base); | |
return inst; | |
}; | |
battle_$pack_location_building_view_WallBody.__super__ = battle_$pack_location_building_view_BuildingBaseController; | |
battle_$pack_location_building_view_WallBody.prototype = $extend(battle_$pack_location_building_view_BuildingBaseController.prototype,{ | |
wallConnector: null | |
,plugState: null | |
,lastX: null | |
,lastY: null | |
,init: function(data,base) { | |
battle_$pack_location_building_view_BuildingBaseController.prototype.baseInit.call(this,data,base); | |
this.wallConnector = data.get_location().plugConnector; | |
} | |
,start: function() { | |
battle_$pack_location_building_view_BuildingBaseController.prototype.start.call(this); | |
this.building.get_stateChanged().add($bind(this,this.onStateChanged)); | |
this.building.get_positionChanged().add($bind(this,this.onPositionChanged)); | |
this.onStateChanged(); | |
this.onPositionChanged(); | |
} | |
,finish: function() { | |
this.wallConnector.clear(this.lastX,this.lastY); | |
this.wallConnector = null; | |
this.building.get_positionChanged().remove($bind(this,this.onPositionChanged)); | |
this.building.get_stateChanged().remove($bind(this,this.onStateChanged)); | |
battle_$pack_location_building_view_BuildingBaseController.prototype.finish.call(this); | |
this.lastX = 0; | |
this.lastY = 0; | |
this.plugState = null; | |
StaticExt.toPool(battle_$pack_location_building_view_WallBody.__pool,this); | |
} | |
,onPositionChanged: function(v) { | |
this.wallConnector.remove(this.lastX,this.lastY,this); | |
this.lastX = this.building.get_x() | 0; | |
this.lastY = this.building.get_y() | 0; | |
this.wallConnector.add(this.lastX,this.lastY,this); | |
} | |
,refresh: function() { | |
var speed = battle_$pack_location_location_$view_SceneConfig.instance.gameSpeed.get_value(); | |
this._visual.set_speed(speed); | |
} | |
,onStateChanged: function(v) { | |
var speed = battle_$pack_location_location_$view_SceneConfig.instance.gameSpeed.get_value(); | |
var clipLink = null; | |
var loop = true; | |
this._visual.set_speed(speed); | |
if(this.building.get_state() == "Death") { | |
this._visual.setClip(null); | |
} else if(this.building.underConstruction) { | |
clipLink = this.building.get_buildingData().get_constructionLink(); | |
this.play(clipLink,loop); | |
this._visual.goTo(com_progrestar_framework_core_utils_RandomUtils.randi()); | |
} else if(this.plugState != null) { | |
var clipLink1 = battle_$pack_location_building_view_WallBody.states.h[this.plugState]; | |
clipLink = this.building.get_buildingData().getAssetLink("Stand",1,clipLink1); | |
this.play(clipLink,loop); | |
this._visual.goTo(com_progrestar_framework_core_utils_RandomUtils.randi()); | |
} | |
} | |
,get_visual: function() { | |
return this._visual; | |
} | |
,__class__: battle_$pack_location_building_view_WallBody | |
,__properties__: $extend(battle_$pack_location_building_view_BuildingBaseController.prototype.__properties__,{get_visual:"get_visual"}) | |
}); | |
var battle_$pack_location_building_view_plug_PlugConnector = function() { | |
this.walls = utils_ds__$JSMap_JSMap_$Impl_$._new(); | |
}; | |
$hxClasses["battle_pack.location.building.view.plug.PlugConnector"] = battle_$pack_location_building_view_plug_PlugConnector; | |
battle_$pack_location_building_view_plug_PlugConnector.__name__ = ["battle_pack","location","building","view","plug","PlugConnector"]; | |
battle_$pack_location_building_view_plug_PlugConnector.prototype = { | |
walls: null | |
,clear: function(x,y) { | |
var plug = this.walls.get(x | y << 16); | |
if(plug != null) { | |
this.remove(x,y,null); | |
} | |
} | |
,remove: function(x,y,plug) { | |
if(plug != null) { | |
plug.plugState = 0; | |
plug.onStateChanged(); | |
} | |
this.walls["delete"](x | y << 16); | |
var n = this.walls.get(x - 1 | y << 16); | |
if(n != null) { | |
n.plugState -= 1; | |
n.onStateChanged(); | |
} | |
n = this.walls.get(x + 1 | y << 16); | |
if(n != null) { | |
n.plugState -= 2; | |
n.onStateChanged(); | |
} | |
n = this.walls.get(x | y - 1 << 16); | |
if(n != null) { | |
n.plugState -= 4; | |
n.onStateChanged(); | |
} | |
n = this.walls.get(x | y + 1 << 16); | |
if(n != null) { | |
n.plugState -= 8; | |
n.onStateChanged(); | |
} | |
} | |
,add: function(x,y,plug) { | |
var wall = this.walls.get(x | y << 16); | |
com_progrestar_framework_core_Assert.isTrue(wall == null,"Trying to add wall over already existing one"); | |
this.walls.set(x | y << 16,plug); | |
var s = 0; | |
var n = this.walls.get(x - 1 | y << 16); | |
if(n != null) { | |
s += 2; | |
n.plugState += 1; | |
n.onStateChanged(); | |
} | |
n = this.walls.get(x + 1 | y << 16); | |
if(n != null) { | |
++s; | |
n.plugState += 2; | |
n.onStateChanged(); | |
} | |
n = this.walls.get(x | y - 1 << 16); | |
if(n != null) { | |
s += 8; | |
n.plugState += 4; | |
n.onStateChanged(); | |
} | |
n = this.walls.get(x | y + 1 << 16); | |
if(n != null) { | |
s += 4; | |
n.plugState += 8; | |
n.onStateChanged(); | |
} | |
plug.plugState = s; | |
plug.onStateChanged(); | |
} | |
,formatCoords: function(x,y) { | |
return x | y << 16; | |
} | |
,__class__: battle_$pack_location_building_view_plug_PlugConnector | |
}; | |
var battle_$pack_location_bullet_BulletFactory = function() { | |
}; | |
$hxClasses["battle_pack.location.bullet.BulletFactory"] = battle_$pack_location_bullet_BulletFactory; | |
battle_$pack_location_bullet_BulletFactory.__name__ = ["battle_pack","location","bullet","BulletFactory"]; | |
battle_$pack_location_bullet_BulletFactory.create = function(location,bulletId,bulletData,launcher,bulletDelay,bulletFlyTime,x,y,target) { | |
com_progrestar_framework_core_Assert.isTrue(bulletData != null,"undefined bullet data"); | |
com_progrestar_framework_core_Assert.isTrue(launcher != null,"undefined bullet launcher"); | |
var bullet = new battle_$pack_location_bullet_BulletInstance(); | |
bullet.id = bulletId; | |
var effect = launcher.getFirstEffect(); | |
bullet.effectViewType = effect != null ? effect.get_viewType() : 0; | |
bullet.bulletData = bulletData; | |
bullet.launcher = launcher; | |
bullet.startDelay = bulletDelay; | |
bullet.flyTime = bulletFlyTime; | |
bullet.targetX = x; | |
bullet.targetY = y; | |
bullet.target = target; | |
location.registerBullet(bullet); | |
return bullet; | |
}; | |
battle_$pack_location_bullet_BulletFactory.prototype = { | |
__class__: battle_$pack_location_bullet_BulletFactory | |
}; | |
var battle_$pack_location_bullet_BulletInstance = function() { | |
this.id = 0; | |
this.flyTime = 0; | |
this.startDelay = 0; | |
this.effectViewType = 0; | |
}; | |
$hxClasses["battle_pack.location.bullet.BulletInstance"] = battle_$pack_location_bullet_BulletInstance; | |
battle_$pack_location_bullet_BulletInstance.__name__ = ["battle_pack","location","bullet","BulletInstance"]; | |
battle_$pack_location_bullet_BulletInstance.prototype = { | |
launcher: null | |
,effectViewType: null | |
,bulletData: null | |
,startDelay: null | |
,flyTime: null | |
,targetX: null | |
,targetY: null | |
,id: null | |
,target: null | |
,get_skin: function() { | |
return this.launcher.get_skin(); | |
} | |
,__class__: battle_$pack_location_bullet_BulletInstance | |
,__properties__: {get_skin:"get_skin"} | |
}; | |
var battle_$pack_location_bullet_BulletSound = function() { | |
}; | |
$hxClasses["battle_pack.location.bullet.BulletSound"] = battle_$pack_location_bullet_BulletSound; | |
battle_$pack_location_bullet_BulletSound.__name__ = ["battle_pack","location","bullet","BulletSound"]; | |
battle_$pack_location_bullet_BulletSound.fire = function(bullet) { | |
com_progrestar_framework_sound_$system_SoundManager.playSoundCustom(bullet.bulletData.get_sound().get_fireSounds(),0.8,1.0,0.7,100,0); | |
}; | |
battle_$pack_location_bullet_BulletSound.bang = function(bullet) { | |
com_progrestar_framework_sound_$system_SoundManager.playSoundCustom(bullet.bulletData.get_sound().get_bangSounds(),0.8,1.0,0.7,100,0); | |
}; | |
battle_$pack_location_bullet_BulletSound.prototype = { | |
__class__: battle_$pack_location_bullet_BulletSound | |
}; | |
var battle_$pack_location_bullet_view_BulletBangView = function(data,bullet,x,y) { | |
var speed = battle_$pack_location_location_$view_SceneConfig.instance.gameSpeed.get_value(); | |
this.clip = data.get_scene().createClipPlayer(null,"BulletBangView"); | |
this.clip.setClipFromFile(bullet.bulletData.getBulletBangLink(bullet.get_skin(),bullet.effectViewType)); | |
this.clip.set_speed(speed); | |
this.clip.goTo(0); | |
this.clip.get_animationEnd().add($bind(this,this.onAnimationEnd)); | |
this.clip.play(false); | |
if(js_Boot.__instanceof(bullet.launcher,battle_$pack_location_building_BattleTurretInstance)) { | |
var turret = StaticExt.kast(Std,bullet.launcher,battle_$pack_location_building_BattleTurretInstance); | |
var scale = turret.getChargeCoef(); | |
this.clip.get_transform().setScale(scale,scale); | |
} | |
data.get_transform().applyTo(this.clip.get_transform(),x,y); | |
data.get_airLayer().addChild(this.clip); | |
if(bullet.bulletData.get_craterEffect()) { | |
com_progrestar_game_render2_utils_CanvasUtils.drawByLink(data.get_staticEffects(),bullet.bulletData.getBulletCraterLink(bullet.get_skin(),bullet.effectViewType),x,y,1); | |
} | |
}; | |
$hxClasses["battle_pack.location.bullet.view.BulletBangView"] = battle_$pack_location_bullet_view_BulletBangView; | |
battle_$pack_location_bullet_view_BulletBangView.__name__ = ["battle_pack","location","bullet","view","BulletBangView"]; | |
battle_$pack_location_bullet_view_BulletBangView.prototype = { | |
clip: null | |
,onAnimationEnd: function(v) { | |
if(!this.clip.get_isReleased()) { | |
this.clip.release(); | |
} | |
this.clip = null; | |
} | |
,__class__: battle_$pack_location_bullet_view_BulletBangView | |
}; | |
var battle_$pack_location_bullet_view_BulletLaunchView = function(data,bullet,x,y) { | |
var speed = battle_$pack_location_location_$view_SceneConfig.instance.gameSpeed.get_value(); | |
this.clip = data.get_scene().createClipPlayer(null,"BulletLaunchView"); | |
this.clip.setClipFromFile(bullet.bulletData.getBulletLaunchLink(bullet.get_skin(),bullet.effectViewType)); | |
this.clip.set_speed(speed); | |
this.clip.goTo(0); | |
this.clip.get_animationEnd().add($bind(this,this.onAnimationEnd)); | |
this.clip.play(false); | |
if(js_Boot.__instanceof(bullet.launcher,battle_$pack_location_building_BattleTurretInstance)) { | |
var turret = StaticExt.kast(Std,bullet.launcher,battle_$pack_location_building_BattleTurretInstance); | |
var scale = turret.getChargeCoef(); | |
this.clip.get_transform().setScale(scale,scale); | |
} | |
data.get_transform().applyTo(this.clip.get_transform(),x,y); | |
data.get_airLayer().addChild(this.clip); | |
}; | |
$hxClasses["battle_pack.location.bullet.view.BulletLaunchView"] = battle_$pack_location_bullet_view_BulletLaunchView; | |
battle_$pack_location_bullet_view_BulletLaunchView.__name__ = ["battle_pack","location","bullet","view","BulletLaunchView"]; | |
battle_$pack_location_bullet_view_BulletLaunchView.prototype = { | |
clip: null | |
,onAnimationEnd: function(v) { | |
if(!this.clip.get_isReleased()) { | |
this.clip.release(); | |
} | |
this.clip = null; | |
} | |
,__class__: battle_$pack_location_bullet_view_BulletLaunchView | |
}; | |
var battle_$pack_location_bullet_view_BulletRangeView = function(data,bullet,bulletFlyTime,fx,fy,fz) { | |
this.started = false; | |
this.bulletFinishTime = 0; | |
this.bulletStartTime = 0; | |
this.visualFlyTime = 0; | |
this.finish = new openfl_geom_Vector3D(); | |
this.data = data; | |
this.bulletStartTime = data.get_location().get_locationTime(); | |
this.visualFlyTime = bulletFlyTime; | |
this.bulletFinishTime = this.bulletStartTime + bulletFlyTime; | |
this.bullet = bullet; | |
data.get_ticker().add($bind(this,this.update)); | |
this.finish.x = fx; | |
this.finish.y = fy; | |
this.finish.z = fz; | |
this.update(); | |
}; | |
$hxClasses["battle_pack.location.bullet.view.BulletRangeView"] = battle_$pack_location_bullet_view_BulletRangeView; | |
battle_$pack_location_bullet_view_BulletRangeView.__name__ = ["battle_pack","location","bullet","view","BulletRangeView"]; | |
battle_$pack_location_bullet_view_BulletRangeView.initBulletRange = function(location,bulletFinishTime,centerX,centerY,range) { | |
var _g1 = Math.floor(centerX - range); | |
var _g = Math.ceil(centerX + range + 1); | |
while(_g1 < _g) { | |
var tileX = _g1++; | |
var _g3 = Math.floor(centerY - range); | |
var _g2 = Math.ceil(centerY + range + 1); | |
while(_g3 < _g2) { | |
var tileY = _g3++; | |
var dx = centerX - tileX; | |
var dy = centerY - tileY; | |
if(Math.sqrt(dx * dx + dy * dy) > range) { | |
continue; | |
} | |
var info = location.get_surface().getTile(tileX,tileY); | |
info.lastBulletTime = StaticExt.imax(Math,info.lastBulletTime,bulletFinishTime); | |
} | |
} | |
}; | |
battle_$pack_location_bullet_view_BulletRangeView.prototype = { | |
data: null | |
,finish: null | |
,visualFlyTime: null | |
,bulletStartTime: null | |
,bulletFinishTime: null | |
,bullet: null | |
,releaseMain: function() { | |
} | |
,release: function() { | |
this.releaseMain(); | |
this.data.get_ticker().remove($bind(this,this.update)); | |
this.finish = null; | |
this.data = null; | |
} | |
,started: null | |
,update: function(v) { | |
var currentFlyTime = this.data.get_location().get_locationTime() - this.bulletStartTime; | |
var progress = com_progrestar_framework_core_utils_MathUtils.clampf(currentFlyTime / this.visualFlyTime,0,1); | |
if(progress == 1) { | |
if(!this.started) { | |
this.started = true; | |
battle_$pack_location_bullet_view_BulletRangeView.initBulletRange(this.data.get_location(),this.bulletFinishTime,this.finish.x | 0,this.finish.y | 0,this.bullet.get_splashRange()); | |
} | |
this.redrawRange(); | |
if(this.bulletFinishTime + 2000 < this.data.get_location().get_locationTime()) { | |
this.release(); | |
} | |
} | |
} | |
,redrawRange: function() { | |
var config = this.data.get_config(); | |
var activeLocation = com_progrestar_game_scene_SceneManager.get_activeLocation(); | |
if(config.showGrid.get_value() && activeLocation != null) { | |
var centerX = this.finish.x | 0; | |
var centerY = this.finish.y | 0; | |
var range = this.bullet.get_splashRange(); | |
var _g1 = Math.floor(centerX - range); | |
var _g = Math.ceil(centerX + range + 1); | |
while(_g1 < _g) { | |
var tileX = _g1++; | |
var _g3 = Math.floor(centerY - range); | |
var _g2 = Math.ceil(centerY + range + 1); | |
while(_g3 < _g2) { | |
var tileY = _g3++; | |
battle_$pack_location_surface_view_TileRender.draw(this.data,this.data.get_location().get_surface(),tileX,tileY); | |
} | |
} | |
} | |
} | |
,__class__: battle_$pack_location_bullet_view_BulletRangeView | |
}; | |
var battle_$pack_location_bullet_view_BulletRender = function() { | |
}; | |
$hxClasses["battle_pack.location.bullet.view.BulletRender"] = battle_$pack_location_bullet_view_BulletRender; | |
battle_$pack_location_bullet_view_BulletRender.__name__ = ["battle_pack","location","bullet","view","BulletRender"]; | |
battle_$pack_location_bullet_view_BulletRender.create = function(data,bullet) { | |
var targetX = bullet.targetX; | |
var targetY = bullet.targetY; | |
var targetZ = 0.5; | |
var target = StaticExt.kast(Std,bullet.target,battle_$pack_location_unit_UnitInstance); | |
if(data.get_config().randomOffsets.get_value() && target == null) { | |
targetX += com_progrestar_framework_core_utils_RandomUtils.randf(0.1,0.9); | |
targetY += com_progrestar_framework_core_utils_RandomUtils.randf(0.1,0.9); | |
targetZ = com_progrestar_framework_core_utils_RandomUtils.randf(0.1,0.9); | |
} else if(target != null) { | |
var environment = battle_$pack_location_unit_view_UnitEnvironment.ITEMS.get(target); | |
var bloodPosition = environment.bloodMark.getPosition(); | |
targetX += environment.offsetX + (bloodPosition.y * 2 + bloodPosition.x) * 0.5 / 32; | |
targetY += environment.offsetY + (bloodPosition.y * 2 - bloodPosition.x) * 0.5 / 32; | |
} else { | |
targetX += 0.5; | |
targetY += 0.5; | |
} | |
var startX = bullet.launcher.get_x(); | |
var startY = bullet.launcher.get_y(); | |
var objectHeight = 0; | |
if(js_Boot.__instanceof(bullet.launcher,battle_$pack_location_building_BattleBuildingInstance)) { | |
var building = StaticExt.kast(Std,bullet.launcher,battle_$pack_location_building_BattleBuildingInstance); | |
var buildingEnvironment = battle_$pack_location_building_view_BuildingEnvironment.ITEMS.h[building.__id__]; | |
if(buildingEnvironment != null) { | |
startX += building.get_buildingData().get_width() / 2; | |
startY += building.get_buildingData().get_height() / 2; | |
if(buildingEnvironment.shootMark != null) { | |
startX += (buildingEnvironment.shootMark.ty * 2 + buildingEnvironment.shootMark.tx) * 0.5 / 32; | |
startY += (buildingEnvironment.shootMark.ty * 2 - buildingEnvironment.shootMark.tx) * 0.5 / 32; | |
} | |
} else { | |
objectHeight = building.get_buildingData().get_attackData().get_startHeight(); | |
} | |
} else if(js_Boot.__instanceof(bullet.launcher,battle_$pack_location_unit_UnitInstance)) { | |
var unit = StaticExt.kast(Std,bullet.launcher,battle_$pack_location_unit_UnitInstance); | |
var unitEnvironment = battle_$pack_location_unit_view_UnitEnvironment.ITEMS.get(unit); | |
if(unitEnvironment != null) { | |
var shootOffset = unitEnvironment.shootMark.getPosition(); | |
startX += unitEnvironment.offsetX + (shootOffset.y * 2 + shootOffset.x) * 0.5 / 32; | |
startY += unitEnvironment.offsetY + (shootOffset.y * 2 - shootOffset.x) * 0.5 / 32; | |
} | |
} | |
if(bullet.bulletData.getLaunchEffect(null,0)) { | |
new battle_$pack_location_bullet_view_BulletLaunchView(data,bullet,startX,startY); | |
} | |
battle_$pack_location_bullet_view_BulletRender.createBullet(data,bullet,data.get_config().showServerMove.get_value(),startX,startY,objectHeight,targetX,targetY,targetZ); | |
if(data.get_config().showBulletRange.get_value()) { | |
new battle_$pack_location_bullet_view_BulletRangeView(data,bullet.bulletData,bullet.flyTime,targetX,targetY,0.5); | |
} | |
}; | |
battle_$pack_location_bullet_view_BulletRender.createBullet = function(data,bullet,debugMode,sx,sy,sz,fx,fy,fz) { | |
var bulletList = battle_$pack_location_bullet_view_BulletRender.bulletListMap.get(bullet); | |
if(bulletList == null) { | |
bulletList = []; | |
battle_$pack_location_bullet_view_BulletRender.bulletListMap.set(bullet,bulletList); | |
} | |
var view = null; | |
if(bulletList.length != 0) { | |
view = bulletList.pop(); | |
} else { | |
view = new battle_$pack_location_bullet_view_BulletView(data.get_scene(),bulletList,bullet); | |
} | |
view.startLife(data,debugMode,sx,sy,sz,fx,fy,fz); | |
return view; | |
}; | |
battle_$pack_location_bullet_view_BulletRender.prototype = { | |
__class__: battle_$pack_location_bullet_view_BulletRender | |
}; | |
var battle_$pack_location_bullet_view_BulletTraceView = function() { | |
}; | |
$hxClasses["battle_pack.location.bullet.view.BulletTraceView"] = battle_$pack_location_bullet_view_BulletTraceView; | |
battle_$pack_location_bullet_view_BulletTraceView.__name__ = ["battle_pack","location","bullet","view","BulletTraceView"]; | |
battle_$pack_location_bullet_view_BulletTraceView.create = function(bullet,data,screenPosition,angle) { | |
new battle_$pack_location_bullet_view_BulletTraceView().start(bullet,data,screenPosition,angle); | |
}; | |
battle_$pack_location_bullet_view_BulletTraceView.prototype = { | |
clip: null | |
,start: function(bullet,data,screenPosition,rotation) { | |
var link = bullet.bulletData.getBulletTraceLink(bullet.get_skin(),bullet.effectViewType); | |
this.clip = data.get_scene().createClipPlayer(link,"BulletTraceView"); | |
this.clip.get_transform().setPosition(screenPosition.x,screenPosition.y); | |
this.clip.get_transform().setRotation(rotation); | |
this.clip.get_animationEnd().add($bind(this,this.finish)); | |
this.clip.play(false); | |
this.clip.set_speed(battle_$pack_location_location_$view_SceneConfig.instance.gameSpeed.get_value()); | |
data.get_airLayer().addChild(this.clip); | |
} | |
,finish: function(v) { | |
if(!this.clip.get_isReleased()) { | |
this.clip.release(); | |
} | |
this.clip = null; | |
} | |
,__class__: battle_$pack_location_bullet_view_BulletTraceView | |
}; | |
var battle_$pack_location_bullet_view_BulletView = function(scene,bulletList,bullet) { | |
this.lastTraceTime = 0; | |
this.tick = 0; | |
this.screenPosition = new openfl_geom_Point(); | |
this._deltaPoint = new openfl_geom_Point(); | |
this._lastBulletPosition = new openfl_geom_Point(); | |
this.debugMode = false; | |
this.path = new com_progrestar_game_utils_behavior_ParabolaPathController(); | |
this.current = new openfl_geom_Vector3D(); | |
this.finish = new openfl_geom_Vector3D(); | |
this.start = new openfl_geom_Vector3D(); | |
this.bullet = bullet; | |
this.bulletList = bulletList; | |
this.view = scene.createClipPlayer(bullet.bulletData.getBulletLink(bullet.get_skin(),bullet.effectViewType),"BulletView"); | |
this.view.get_transform().set_alpha(0); | |
}; | |
$hxClasses["battle_pack.location.bullet.view.BulletView"] = battle_$pack_location_bullet_view_BulletView; | |
battle_$pack_location_bullet_view_BulletView.__name__ = ["battle_pack","location","bullet","view","BulletView"]; | |
battle_$pack_location_bullet_view_BulletView.prototype = { | |
view: null | |
,start: null | |
,finish: null | |
,current: null | |
,path: null | |
,bulletFlyTime: null | |
,bulletStartTime: null | |
,location: null | |
,bullet: null | |
,debugMode: null | |
,_lastBulletPosition: null | |
,_deltaPoint: null | |
,bulletList: null | |
,data: null | |
,screenPosition: null | |
,tick: null | |
,finishLife: function() { | |
battle_$pack_location_bullet_BulletSound.bang(this.bullet); | |
this.data.get_ticker().remove($bind(this,this.updateAsNormal)); | |
this.data.get_ticker().remove($bind(this,this.updateAsDebug)); | |
this.view.get_transform().set_alpha(0); | |
this.view.stop(); | |
if(this.view.get_parent() != null) { | |
this.view.get_parent().removeChild(this.view); | |
} | |
this.bulletList.push(this); | |
} | |
,startLife: function(data,debugMode,sx,sy,sz,fx,fy,fz) { | |
battle_$pack_location_bullet_BulletSound.fire(this.bullet); | |
this.view.get_transform().set_alpha(1); | |
this.debugMode = debugMode; | |
this.data = data; | |
this.location = data.get_location(); | |
this.bulletStartTime = this.location.get_locationTime(); | |
this.bulletFlyTime = this.bullet.flyTime; | |
this.start.x = sx; | |
this.start.y = sy; | |
this.start.z = debugMode ? 0 : sz; | |
this.finish.x = fx; | |
this.finish.y = fy; | |
this.finish.z = debugMode ? 0 : fz; | |
var curve = data.get_config().randomOffsets.get_value() ? com_progrestar_framework_core_utils_RandomUtils.randf(1,2) * this.bullet.bulletData.get_curve() : this.bullet.bulletData.get_curve(); | |
if(debugMode) { | |
curve = 0; | |
} | |
this.path.setup(this.start,this.finish,curve); | |
if(debugMode) { | |
this.updateAsDebug(); | |
data.get_ticker().add($bind(this,this.updateAsDebug)); | |
} else { | |
this.updateAsNormal(); | |
data.get_ticker().add($bind(this,this.updateAsNormal)); | |
} | |
data.get_airLayer().addChild(this.view); | |
this.view.play(this.view.get_isLooping()); | |
com_progrestar_game_render2_controller_IsometricUtils.worldToScreenPoint(this._deltaPoint,0,0,sz); | |
} | |
,release: function() { | |
this.data.get_ticker().remove($bind(this,this.updateAsNormal)); | |
this.data.get_ticker().remove($bind(this,this.updateAsDebug)); | |
if(this.view != null) { | |
this.view.release(); | |
this.view = null; | |
} | |
this.start = null; | |
this.finish = null; | |
this.current = null; | |
this.path = null; | |
this.location = null; | |
} | |
,lastTraceTime: null | |
,updateAsNormal: function(v) { | |
var currentFlyTime = this.location.get_locationTime() - this.bulletStartTime; | |
var alpha = 1; | |
if(currentFlyTime < 100) { | |
alpha = currentFlyTime / 100; | |
} | |
var progress = com_progrestar_framework_core_utils_MathUtils.clampf(currentFlyTime / this.bulletFlyTime,0,1); | |
if(progress == 1) { | |
if(this.bullet.bulletData.get_bangEffect()) { | |
new battle_$pack_location_bullet_view_BulletBangView(this.data,this.bullet,this.finish.x,this.finish.y); | |
} | |
this.finishLife(); | |
} else { | |
this.path.calculate(this.current,progress); | |
var transform = this.view.get_transform(); | |
this.screenPosition.x = (this.current.x - this.current.y) * 32; | |
this.screenPosition.y = (this.current.x + this.current.y - this.current.z) * 16; | |
transform.setPosition(this.screenPosition.x,this.screenPosition.y); | |
transform.setDepth(-this.current.x - this.current.y); | |
transform.set_alpha(alpha); | |
if(this._lastBulletPosition.x != this.screenPosition.x && this._lastBulletPosition.y != this.screenPosition.y) { | |
this.screenPosition.x += this._deltaPoint.x * (1 - progress); | |
this.screenPosition.y += this._deltaPoint.y * (1 - progress); | |
var angle = Math.atan2(this._lastBulletPosition.y - this.screenPosition.y,this._lastBulletPosition.x - this.screenPosition.x); | |
transform.setRotation(Math.PI + angle); | |
this._lastBulletPosition.x = this.screenPosition.x; | |
this._lastBulletPosition.y = this.screenPosition.y; | |
if(this.lastTraceTime == 0) { | |
this.lastTraceTime = this.location.get_locationTime(); | |
} | |
if(this.lastTraceTime + 25 < this.location.get_locationTime()) { | |
this.lastTraceTime += 25; | |
if(this.bullet.bulletData.getShowTrace(this.bullet.get_skin(),this.bullet.effectViewType)) { | |
battle_$pack_location_bullet_view_BulletTraceView.create(this.bullet,this.data,this.screenPosition,angle); | |
} | |
} | |
} | |
} | |
} | |
,updateAsDebug: function(v) { | |
var currentFlyTime = this.location.get_locationTime() - this.bulletStartTime; | |
var progress = com_progrestar_framework_core_utils_MathUtils.clampf(currentFlyTime / this.bulletFlyTime,0,1); | |
this.path.calculate(this.current,progress); | |
this.data.get_transform().applyTo(this.view.get_transform(),this.current.x,this.current.y,this.current.z); | |
if(progress == 1) { | |
this.finishLife(); | |
} | |
} | |
,__class__: battle_$pack_location_bullet_view_BulletView | |
}; | |
var battle_$pack_location_cursor_Cursor = function() { | |
this.position = new com_progrestar_cas_utils_property_PointProperty(new openfl_geom_Point()); | |
this.item = new com_progrestar_cas_utils_property_CustomProperty(null); | |
}; | |
$hxClasses["battle_pack.location.cursor.Cursor"] = battle_$pack_location_cursor_Cursor; | |
battle_$pack_location_cursor_Cursor.__name__ = ["battle_pack","location","cursor","Cursor"]; | |
battle_$pack_location_cursor_Cursor.prototype = { | |
item: null | |
,position: null | |
,getCurrentDeployLocked: function(location) { | |
if(js_Boot.__instanceof(this.item.get_value(),com_progrestar_game_data_spell_SpellLevelLibItem)) { | |
return this.getSpellDeployLocked(location); | |
} | |
if(js_Boot.__instanceof(this.item.get_value(),com_progrestar_game_unit_lib_UnitLevelLibItem)) { | |
return this.getUnitDeployLocked(location); | |
} | |
return true; | |
} | |
,setItem: function(value) { | |
this.item.set_value(value); | |
} | |
,getUnitDeployLocked: function(location) { | |
var info = location.get_surface().getTile(Math.floor(this.position.get_value().x),Math.floor(this.position.get_value().y)); | |
if(info == null) { | |
return true; | |
} | |
if(!info.lock.deployAir) { | |
return info.lock.deployGround; | |
} else { | |
return true; | |
} | |
} | |
,getSpellDeployLocked: function(location) { | |
var info = location.get_surface().getTile(Math.floor(this.position.get_value().x),Math.floor(this.position.get_value().y)); | |
return info == null; | |
} | |
,__class__: battle_$pack_location_cursor_Cursor | |
}; | |
var battle_$pack_location_cursor_view_CursorBody = function() { | |
this.DISABLE_COLOR = new com_progrestar_framework_core_types_Color(1,0,0,1); | |
this.ENABLE_COLOR = new com_progrestar_framework_core_types_Color(1,1,1,1); | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.cursor.view.CursorBody"] = battle_$pack_location_cursor_view_CursorBody; | |
battle_$pack_location_cursor_view_CursorBody.__name__ = ["battle_pack","location","cursor","view","CursorBody"]; | |
battle_$pack_location_cursor_view_CursorBody.create = function(data) { | |
var inst = StaticExt.fromPool(battle_$pack_location_cursor_view_CursorBody.__pool,battle_$pack_location_cursor_view_CursorBody); | |
inst.init(data); | |
return inst; | |
}; | |
battle_$pack_location_cursor_view_CursorBody.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_cursor_view_CursorBody.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
data: null | |
,clipController: null | |
,ENABLE_COLOR: null | |
,DISABLE_COLOR: null | |
,init: function(data) { | |
this.data = data; | |
} | |
,start: function() { | |
this.data.cursor.item.get_changed().add($bind(this,this.refreshBody)); | |
this.data.cursor.position.get_changed().add($bind(this,this.refreshBody)); | |
this.clipController = com_progrestar_framework_scene_extended_clip_ClipsSwitchController.create(this.data.get_scene()); | |
this._holder.addController(this.clipController); | |
} | |
,finish: function() { | |
this.data.cursor.item.get_changed().remove($bind(this,this.refreshBody)); | |
this.data.cursor.position.get_changed().remove($bind(this,this.refreshBody)); | |
this.data = null; | |
StaticExt.toPool(battle_$pack_location_cursor_view_CursorBody.__pool,this); | |
} | |
,refreshBody: function(v) { | |
var unitData = StaticExt.kast(Std,this.data.cursor.item.get_value(),com_progrestar_game_unit_lib_UnitLevelLibItem); | |
if(unitData != null) { | |
var unitAmount = this.data.get_location().get_attacker().get_unitPacksReserve().getUnitAmountByType(unitData); | |
if(unitAmount > 0) { | |
var direction = 1; | |
if(this.data.townHall != null) { | |
var cursor = this.data.cursor.position.get_value(); | |
direction = com_progrestar_common_util_abstr_types_Direction.getDirection(cursor.x,cursor.y,this.data.townHall.get_x(),this.data.townHall.get_y()); | |
} | |
var skin = null; | |
if(com_progrestar_game_battle_BattlesManager.get_activeBattle() != null) { | |
skin = com_progrestar_game_hero_lib_skin_HeroSkinLib.get_instance().getHeroSkinFromArray(com_progrestar_game_battle_BattlesManager.get_activeBattle().get_battleController().get_proxy().get_config().attacker.skins,unitData.get_unit().get_id()); | |
} | |
var link = unitData.getDefaultAnimation(skin); | |
if(link != null) { | |
link = StaticExt.replace(link,"{dir}",null,com_progrestar_common_util_abstr_types_Direction.getDirectionCode(direction)); | |
this.clipController.switchToClip(link); | |
this.clipController.speed(0); | |
this.clipController.play(true); | |
} else { | |
this.clipController.switchToClip(null); | |
this.clipController.speed(0); | |
} | |
} else { | |
this.clipController.switchToClip(null); | |
} | |
} else { | |
this.clipController.switchToClip(null); | |
} | |
this.updateColor(); | |
} | |
,updateColor: function(v) { | |
var itemLocked = this.data.cursor.getCurrentDeployLocked(this.data.get_location()); | |
this._holder.get_transform().setColor(itemLocked ? this.DISABLE_COLOR : this.ENABLE_COLOR); | |
} | |
,__class__: battle_$pack_location_cursor_view_CursorBody | |
}); | |
var battle_$pack_location_cursor_view_CursorGPS = function() { | |
this.rounding = false; | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.cursor.view.CursorGPS"] = battle_$pack_location_cursor_view_CursorGPS; | |
battle_$pack_location_cursor_view_CursorGPS.__name__ = ["battle_pack","location","cursor","view","CursorGPS"]; | |
battle_$pack_location_cursor_view_CursorGPS.create = function(data,rounding,depthOffset) { | |
if(depthOffset == null) { | |
depthOffset = 0; | |
} | |
var inst = StaticExt.fromPool(battle_$pack_location_cursor_view_CursorGPS.__pool,battle_$pack_location_cursor_view_CursorGPS); | |
inst.init(data,rounding,depthOffset); | |
return inst; | |
}; | |
battle_$pack_location_cursor_view_CursorGPS.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_cursor_view_CursorGPS.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
data: null | |
,rounding: null | |
,depthOffset: null | |
,init: function(data,rounding,depthOffset) { | |
if(depthOffset == null) { | |
depthOffset = 0; | |
} | |
this.depthOffset = depthOffset; | |
this.data = data; | |
this.rounding = rounding; | |
} | |
,start: function() { | |
this.data.cursor.position.get_changed().add($bind(this,this.updatePosition)); | |
} | |
,finish: function() { | |
this.data.cursor.position.get_changed().remove($bind(this,this.updatePosition)); | |
this.data = null; | |
StaticExt.toPool(battle_$pack_location_cursor_view_CursorGPS.__pool,this); | |
} | |
,updatePosition: function(v) { | |
if(this.rounding) { | |
this.data.get_transform().applyTo(this._holder.get_transform(),Math.floor(this.data.cursor.position.get_value().x) + 0.5,Math.floor(this.data.cursor.position.get_value().y) + 0.5,0,this.depthOffset); | |
} else { | |
this.data.get_transform().applyTo(this._holder.get_transform(),this.data.cursor.position.get_value().x,this.data.cursor.position.get_value().y,0,this.depthOffset); | |
} | |
} | |
,__class__: battle_$pack_location_cursor_view_CursorGPS | |
}); | |
var battle_$pack_location_cursor_view_CursorMarker = function() { | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.cursor.view.CursorMarker"] = battle_$pack_location_cursor_view_CursorMarker; | |
battle_$pack_location_cursor_view_CursorMarker.__name__ = ["battle_pack","location","cursor","view","CursorMarker"]; | |
battle_$pack_location_cursor_view_CursorMarker.create = function(data) { | |
var inst = StaticExt.fromPool(battle_$pack_location_cursor_view_CursorMarker.__pool,battle_$pack_location_cursor_view_CursorMarker); | |
inst.init(data); | |
return inst; | |
}; | |
battle_$pack_location_cursor_view_CursorMarker.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_cursor_view_CursorMarker.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
data: null | |
,marker: null | |
,init: function(data) { | |
this.data = data; | |
} | |
,start: function() { | |
this.data.cursor.item.get_changed().add($bind(this,this.updateCursor)); | |
this.data.cursor.position.get_changed().add($bind(this,this.updateCursor)); | |
this.marker = this.data.get_scene().createClipPlayer(null,"CursorMarker"); | |
this.marker.goTo(com_progrestar_framework_core_utils_RandomUtils.randi(0,1000)); | |
this.marker.play(true); | |
this._holder.set_depthSorting(true); | |
this._holder.addChild(this.marker); | |
} | |
,finish: function() { | |
this.data.cursor.position.get_changed().remove($bind(this,this.updateCursor)); | |
this.data.cursor.item.get_changed().remove($bind(this,this.updateCursor)); | |
this.data = null; | |
this._holder.removeChild(this.marker); | |
this.marker.release(); | |
this.marker = null; | |
StaticExt.toPool(battle_$pack_location_cursor_view_CursorMarker.__pool,this); | |
} | |
,updateCursor: function(v) { | |
var cursor = this.data.cursor; | |
var cursorState = cursor.getCurrentDeployLocked(this.data.get_location()) ? "DisabledCursor" : "EnabledCursor"; | |
var unitData = StaticExt.kast(Std,cursor.item.get_value(),com_progrestar_game_unit_lib_UnitLevelLibItem); | |
if(unitData != null) { | |
this.marker.setClipFromFile("ui/cursors/deploy_unit.rsx@" + cursorState); | |
return; | |
} | |
var spellData = StaticExt.kast(Std,cursor.item.get_value(),com_progrestar_game_data_spell_SpellLevelLibItem); | |
if(spellData != null) { | |
this.marker.setClipFromFile("ui/cursors/deploy_spell.rsx@" + cursorState); | |
return; | |
} | |
this.marker.setClipFromFile(null); | |
} | |
,__class__: battle_$pack_location_cursor_view_CursorMarker | |
}); | |
var battle_$pack_location_cursor_view_CursorRender = function() { | |
}; | |
$hxClasses["battle_pack.location.cursor.view.CursorRender"] = battle_$pack_location_cursor_view_CursorRender; | |
battle_$pack_location_cursor_view_CursorRender.__name__ = ["battle_pack","location","cursor","view","CursorRender"]; | |
battle_$pack_location_cursor_view_CursorRender.create = function(location,data,showBody) { | |
var backNode = data.get_scene().createNode("spellRangeCursor"); | |
backNode.addController(battle_$pack_location_cursor_view_CursorGPS.create(data,true,900)); | |
backNode.addController(battle_$pack_location_cursor_view_CursorSpellRange.create(data,"tiles@SpellArea")); | |
data.get_groundLayer().addChild(backNode); | |
if(showBody) { | |
var tileCursor1 = data.get_scene().createNode("tileCursor"); | |
tileCursor1.addController(battle_$pack_location_cursor_view_CursorGPS.create(data,false,800)); | |
tileCursor1.addController(battle_$pack_location_cursor_view_CursorMarker.create(data)); | |
tileCursor1.get_transform().set_alpha(1.0); | |
data.get_groundLayer().addChild(tileCursor1); | |
var bodyCursor = data.get_scene().createNode("bodyCursor"); | |
bodyCursor.addController(battle_$pack_location_cursor_view_CursorGPS.create(data,false)); | |
bodyCursor.addController(battle_$pack_location_cursor_view_CursorBody.create(data)); | |
data.get_airLayer().addChild(bodyCursor); | |
} | |
}; | |
battle_$pack_location_cursor_view_CursorRender.prototype = { | |
__class__: battle_$pack_location_cursor_view_CursorRender | |
}; | |
var battle_$pack_location_cursor_view_CursorSpellRange = function() { | |
this.subTiles = []; | |
this.focuses = []; | |
this.targets = []; | |
this.lastRadius = 0; | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.cursor.view.CursorSpellRange"] = battle_$pack_location_cursor_view_CursorSpellRange; | |
battle_$pack_location_cursor_view_CursorSpellRange.__name__ = ["battle_pack","location","cursor","view","CursorSpellRange"]; | |
battle_$pack_location_cursor_view_CursorSpellRange.create = function(data,tileClipLink) { | |
var inst = StaticExt.fromPool(battle_$pack_location_cursor_view_CursorSpellRange.__pool,battle_$pack_location_cursor_view_CursorSpellRange); | |
inst.init(data,tileClipLink); | |
return inst; | |
}; | |
battle_$pack_location_cursor_view_CursorSpellRange.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_cursor_view_CursorSpellRange.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
data: null | |
,lastRadius: null | |
,targets: null | |
,focuses: null | |
,tileClipLink: null | |
,subTiles: null | |
,init: function(data,tileClipLink) { | |
this.data = data; | |
this.tileClipLink = tileClipLink; | |
} | |
,start: function() { | |
this._holder.set_mouseEnabled(this._holder.set_mouseChildren(false)); | |
this.data.cursor.item.get_changed().add($bind(this,this.refreshCursorArea)); | |
this.data.cursor.position.get_changed().add($bind(this,this.refreshCursorArea)); | |
this.refreshCursorArea(); | |
} | |
,finish: function() { | |
this.data.cursor.item.get_changed().remove($bind(this,this.refreshCursorArea)); | |
this.data.cursor.position.get_changed().remove($bind(this,this.refreshCursorArea)); | |
while(this.subTiles.length != 0) this.subTiles.pop().release(); | |
while(this.targets.length != 0) this.targets.pop(); | |
while(this.focuses.length != 0) this.focuses.pop(); | |
this.tileClipLink = null; | |
this.data = null; | |
this.lastRadius = 0; | |
StaticExt.toPool(battle_$pack_location_cursor_view_CursorSpellRange.__pool,this); | |
} | |
,refreshCursorArea: function(v) { | |
var range = 0; | |
var spellData = StaticExt.kast(Std,this.data.cursor.item.get_value(),com_progrestar_game_data_spell_SpellLevelLibItem); | |
if(spellData != null) { | |
range = spellData.getAttackRange(); | |
} | |
if(this.lastRadius != range) { | |
this.lastRadius = range; | |
while(this.subTiles.length != 0) this.subTiles.pop().release(); | |
this.generateSubTiles(); | |
} | |
var environment = null; | |
var _g = 0; | |
var _g1 = this.targets; | |
while(_g < _g1.length) { | |
var lastTarget = _g1[_g]; | |
++_g; | |
environment = battle_$pack_location_building_view_BuildingEnvironment.getEnvironment(lastTarget); | |
if(environment != null) { | |
environment.isTarget.set_value(false); | |
} | |
} | |
var self = this.targets; | |
self.length = 0; | |
if(spellData != null) { | |
this.targets = this.data.get_location().get_surface().getBuildingInRadius(Math.floor(this.data.cursor.position.get_value().x),Math.floor(this.data.cursor.position.get_value().y),this.lastRadius); | |
var _g2 = 0; | |
var _g11 = this.targets; | |
while(_g2 < _g11.length) { | |
var nextTarget = _g11[_g2]; | |
++_g2; | |
environment = battle_$pack_location_building_view_BuildingEnvironment.getEnvironment(nextTarget); | |
var spell = spellData.get_spellLibItem(); | |
var goodTarget = ((spell.get_targetFlags() ^ nextTarget.flags) & (spell.get_targetFlags() | epicwar_haxe_battle_actors_ActorFlags.AFBoostBuilding | epicwar_haxe_battle_actors_ActorFlags.AFSpell | epicwar_haxe_battle_actors_ActorFlags.AFBoostCustom | 0)) == 0; | |
if(goodTarget && environment != null && !nextTarget.get_buildingData().get_buildingLibItem().get_isNeutral()) { | |
environment.isTarget.set_value(true); | |
} | |
} | |
} | |
var _g3 = 0; | |
var _g12 = this.focuses; | |
while(_g3 < _g12.length) { | |
var lastFocus = _g12[_g3]; | |
++_g3; | |
environment = battle_$pack_location_building_view_BuildingEnvironment.getEnvironment(lastFocus); | |
if(environment != null) { | |
environment.isFocused.set_value(false); | |
} | |
} | |
var self1 = this.focuses; | |
self1.length = 0; | |
this.focuses = this.data.get_location().get_surface().getBuildingInRadius(Math.floor(this.data.cursor.position.get_value().x),Math.floor(this.data.cursor.position.get_value().y),0); | |
var _g4 = 0; | |
var _g13 = this.focuses; | |
while(_g4 < _g13.length) { | |
var nextFocus = _g13[_g4]; | |
++_g4; | |
environment = battle_$pack_location_building_view_BuildingEnvironment.getEnvironment(nextFocus); | |
if(environment != null && !nextFocus.get_buildingData().get_buildingLibItem().get_isNeutral()) { | |
environment.isFocused.set_value(true); | |
} | |
} | |
} | |
,generateSubTiles: function() { | |
var points = com_progrestar_game_world_location_map_MapUtils.getTilesInRadius(this.lastRadius | 0,0,0); | |
var _g = 0; | |
while(_g < points.length) { | |
var point = points[_g]; | |
++_g; | |
var view = this.data.get_scene().createClipPlayer(null,"CursorSpellRange"); | |
view.setClipFromFile(this.tileClipLink); | |
this.data.get_transform().applyTo(view.get_transform(),point.x,point.y); | |
this._holder.addChild(view); | |
this.subTiles.push(view); | |
} | |
} | |
,__class__: battle_$pack_location_cursor_view_CursorSpellRange | |
}); | |
var battle_$pack_location_effects_BeamTowerLoseTargetEffectController = function() { | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.effects.BeamTowerLoseTargetEffectController"] = battle_$pack_location_effects_BeamTowerLoseTargetEffectController; | |
battle_$pack_location_effects_BeamTowerLoseTargetEffectController.__name__ = ["battle_pack","location","effects","BeamTowerLoseTargetEffectController"]; | |
battle_$pack_location_effects_BeamTowerLoseTargetEffectController.create = function(instance,scene) { | |
var inst = StaticExt.fromPool(battle_$pack_location_effects_BeamTowerLoseTargetEffectController.__pool,battle_$pack_location_effects_BeamTowerLoseTargetEffectController); | |
inst.init(instance,scene); | |
return inst; | |
}; | |
battle_$pack_location_effects_BeamTowerLoseTargetEffectController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_effects_BeamTowerLoseTargetEffectController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
instance: null | |
,_scene: null | |
,init: function(instance,scene) { | |
this.instance = instance; | |
this._scene = scene; | |
} | |
,start: function() { | |
com_progrestar_framework_scene_core_AbstractController.prototype.start.call(this); | |
this.instance.get_effectAdded().add($bind(this,this.onEffectChanged)); | |
this.instance.get_effectRemoved().add($bind(this,this.onEffectChanged)); | |
} | |
,onEffectChanged: function(v) { | |
var _gthis = this; | |
if(this.instance.hasEffect(33)) { | |
var player = this._scene.createClipPlayer("buildings/BeamTower@MinRangeBlink","BeamTowerLooseTarget"); | |
player.goTo(0); | |
player.get_transform().setDepth(1e9); | |
this.get_holder().addChild(player); | |
var onAnimationEnd = null; | |
onAnimationEnd = function(v1) { | |
player.get_animationEnd().remove(onAnimationEnd); | |
_gthis.get_holder().removeChild(player); | |
}; | |
player.get_animationEnd().add(onAnimationEnd); | |
player.play(false); | |
} | |
} | |
,finish: function() { | |
this.instance.get_effectAdded().remove($bind(this,this.onEffectChanged)); | |
this.instance.get_effectRemoved().remove($bind(this,this.onEffectChanged)); | |
this.instance = null; | |
this._scene = null; | |
StaticExt.toPool(battle_$pack_location_effects_BeamTowerLoseTargetEffectController.__pool,this); | |
} | |
,__class__: battle_$pack_location_effects_BeamTowerLoseTargetEffectController | |
}); | |
var com_progrestar_framework_scene_core_ITransformRead = function() { }; | |
$hxClasses["com.progrestar.framework.scene.core.ITransformRead"] = com_progrestar_framework_scene_core_ITransformRead; | |
com_progrestar_framework_scene_core_ITransformRead.__name__ = ["com","progrestar","framework","scene","core","ITransformRead"]; | |
com_progrestar_framework_scene_core_ITransformRead.__interfaces__ = [com_progrestar_framework_core_IRelease]; | |
com_progrestar_framework_scene_core_ITransformRead.prototype = { | |
getScale: null | |
,getSkew: null | |
,getPosition: null | |
,getRotation: null | |
,getColor: null | |
,__class__: com_progrestar_framework_scene_core_ITransformRead | |
}; | |
var com_progrestar_framework_scene_core_ITransform = function() { }; | |
$hxClasses["com.progrestar.framework.scene.core.ITransform"] = com_progrestar_framework_scene_core_ITransform; | |
com_progrestar_framework_scene_core_ITransform.__name__ = ["com","progrestar","framework","scene","core","ITransform"]; | |
com_progrestar_framework_scene_core_ITransform.__interfaces__ = [com_progrestar_framework_scene_core_ITransformRead]; | |
com_progrestar_framework_scene_core_ITransform.prototype = { | |
set_blue: null | |
,get_blue: null | |
,set_green: null | |
,get_green: null | |
,set_red: null | |
,get_red: null | |
,set_alpha: null | |
,get_alpha: null | |
,setSkew: null | |
,setScale: null | |
,setPosition: null | |
,setRotation: null | |
,setDepth: null | |
,setRGB: null | |
,setRGBA: null | |
,setColor: null | |
,copyFrom: null | |
,addTransform: null | |
,toString: null | |
,__class__: com_progrestar_framework_scene_core_ITransform | |
,__properties__: {set_blue:"set_blue",get_blue:"get_blue",set_green:"set_green",get_green:"get_green",set_red:"set_red",get_red:"get_red",set_alpha:"set_alpha",get_alpha:"get_alpha"} | |
}; | |
var com_progrestar_framework_scene_core_AbstractTransform = function() { | |
this.a = 1; | |
this.b = 1; | |
this.g = 1; | |
this.r = 1; | |
this.depth = 0; | |
this.rotation = 0; | |
this.skewY = 1; | |
this.skewX = 1; | |
this.scaleY = 1; | |
this.scaleX = 1; | |
this.y = 0; | |
this.x = 0; | |
}; | |
$hxClasses["com.progrestar.framework.scene.core.AbstractTransform"] = com_progrestar_framework_scene_core_AbstractTransform; | |
com_progrestar_framework_scene_core_AbstractTransform.__name__ = ["com","progrestar","framework","scene","core","AbstractTransform"]; | |
com_progrestar_framework_scene_core_AbstractTransform.__interfaces__ = [com_progrestar_framework_scene_core_ITransform]; | |
com_progrestar_framework_scene_core_AbstractTransform.prototype = { | |
x: null | |
,y: null | |
,scaleX: null | |
,scaleY: null | |
,skewX: null | |
,skewY: null | |
,rotation: null | |
,depth: null | |
,r: null | |
,g: null | |
,b: null | |
,a: null | |
,release: function() { | |
} | |
,toString: function() { | |
return "[" + "x:" + this.x + "y:" + this.y + "scaleX:" + this.scaleX + "scaleY:" + this.scaleY + "skewX:" + this.skewX + "skewY:" + this.skewY + "]"; | |
} | |
,copyFrom: function(other) { | |
this.rotation = other.getRotation(); | |
var scale = other.getScale(); | |
this.scaleX = scale.x; | |
this.scaleY = scale.y; | |
var pos = other.getPosition(); | |
this.x = pos.x; | |
this.y = pos.y; | |
var color = other.getColor(); | |
this.r = color.x; | |
this.g = color.y; | |
this.b = color.z; | |
this.a = color.w; | |
} | |
,addTransform: function(other) { | |
var position = other.getPosition(); | |
this.x += position.x; | |
this.y += position.y; | |
var scale = other.getScale(); | |
this.scaleX *= scale.x; | |
this.scaleY *= scale.y; | |
this.rotation += other.getRotation(); | |
} | |
,setSkew: function(x,y) { | |
this.skewX = x; | |
this.skewY = y; | |
} | |
,setScale: function(x,y) { | |
this.scaleX = x; | |
this.scaleY = y; | |
} | |
,setPosition: function(x,y) { | |
this.x = x; | |
this.y = y; | |
} | |
,setRotation: function(rotation) { | |
this.rotation = rotation; | |
} | |
,getColor: function() { | |
return new openfl_geom_Vector3D(this.r,this.g,this.b,this.a); | |
} | |
,getScale: function() { | |
return new openfl_geom_Point(this.scaleX,this.scaleY); | |
} | |
,getSkew: function() { | |
return new openfl_geom_Point(this.skewX,this.skewY); | |
} | |
,getPosition: function() { | |
return new openfl_geom_Point(this.x,this.y); | |
} | |
,setDepth: function(depth) { | |
this.depth = depth; | |
} | |
,getRotation: function() { | |
return this.rotation; | |
} | |
,get_alpha: function() { | |
return this.a; | |
} | |
,set_alpha: function(value) { | |
this.a = value; | |
return value; | |
} | |
,get_red: function() { | |
return this.r; | |
} | |
,set_red: function(value) { | |
this.r = value; | |
return value; | |
} | |
,get_green: function() { | |
return this.g; | |
} | |
,set_green: function(value) { | |
this.g = value; | |
return value; | |
} | |
,get_blue: function() { | |
return this.b; | |
} | |
,set_blue: function(value) { | |
this.b = value; | |
return value; | |
} | |
,setRGB: function(r,g,b) { | |
this.r = r; | |
this.g = g; | |
this.b = b; | |
} | |
,setRGBA: function(r,g,b,a) { | |
this.r = r; | |
this.g = g; | |
this.b = b; | |
this.a = a; | |
} | |
,setColor: function(color) { | |
this.r = color.r; | |
this.g = color.g; | |
this.b = color.b; | |
this.a = color.a; | |
} | |
,__class__: com_progrestar_framework_scene_core_AbstractTransform | |
,__properties__: {set_blue:"set_blue",get_blue:"get_blue",set_green:"set_green",get_green:"get_green",set_red:"set_red",get_red:"get_red",set_alpha:"set_alpha",get_alpha:"get_alpha"} | |
}; | |
var battle_$pack_location_effects_CrystalEffectController = function() { | |
this.lastUpdate = 0; | |
this.useSorting = false; | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.effects.CrystalEffectController"] = battle_$pack_location_effects_CrystalEffectController; | |
battle_$pack_location_effects_CrystalEffectController.__name__ = ["battle_pack","location","effects","CrystalEffectController"]; | |
battle_$pack_location_effects_CrystalEffectController.create = function(instance,environment,criticalHitEffect,evasionEffect,scene,useSorting) { | |
var inst = StaticExt.fromPool(battle_$pack_location_effects_CrystalEffectController.__pool,battle_$pack_location_effects_CrystalEffectController); | |
inst.init(instance,environment,criticalHitEffect,evasionEffect,scene,useSorting); | |
return inst; | |
}; | |
battle_$pack_location_effects_CrystalEffectController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_effects_CrystalEffectController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
instance: null | |
,_scene: null | |
,evasionView: null | |
,evasionViewFront: null | |
,criticalHitView: null | |
,evasionLink: null | |
,criticalHitLink: null | |
,evasionFrontLink: null | |
,useSorting: null | |
,unitEnvironment: null | |
,buildEnvironment: null | |
,crystalTransform: null | |
,lastUpdate: null | |
,init: function(instance,environment,criticalHitEffect,evasionEffect,scene,useSorting) { | |
this.instance = instance; | |
this.useSorting = useSorting; | |
this.evasionLink = evasionEffect; | |
this.evasionFrontLink = evasionEffect + "Front"; | |
this.criticalHitLink = criticalHitEffect; | |
this._scene = scene; | |
this.unitEnvironment = StaticExt.kast(Std,environment,battle_$pack_location_unit_view_UnitEnvironment); | |
this.buildEnvironment = StaticExt.kast(Std,environment,battle_$pack_location_building_view_BuildingEnvironment); | |
} | |
,start: function() { | |
com_progrestar_framework_scene_core_AbstractController.prototype.start.call(this); | |
this.instance.get_crystalEventSignal().add($bind(this,this.onCrystalEffect)); | |
} | |
,updateMarker: function() { | |
if(this.unitEnvironment != null) { | |
this.crystalTransform = this.unitEnvironment.crystalMark; | |
} else { | |
this.crystalTransform = battle_$pack_location_effects_CrystalEffectController.DEFAULT_CRYSTAL; | |
} | |
var g = StaticExt.kast(Std,this.crystalTransform,com_progrestar_framework_genome_display_GenomeTransform); | |
if(g != null && g.getTransform() == null) { | |
com_progrestar_framework_core_utils_TraceUtils.consoleError("CrystalEffectController error"); | |
} | |
} | |
,finish: function() { | |
com_progrestar_framework_time_Time.stop($bind(this,this.onRemoveAnimation)); | |
this.instance.get_crystalEventSignal().remove($bind(this,this.onCrystalEffect)); | |
if(this.evasionView != null) { | |
this.evasionView.release(); | |
this.evasionView = null; | |
} | |
if(this.criticalHitView != null) { | |
this.criticalHitView.release(); | |
this.criticalHitView = null; | |
} | |
this.instance = null; | |
this._scene = null; | |
this.crystalTransform = null; | |
this.unitEnvironment = null; | |
this.buildEnvironment = null; | |
StaticExt.toPool(battle_$pack_location_effects_CrystalEffectController.__pool,this); | |
} | |
,onCrystalEffect: function(effect) { | |
if("criticalHitChance" == effect) { | |
this.onCriticalHit(); | |
} | |
if("evasionChance" == effect) { | |
this.onEvasion(); | |
} | |
} | |
,onEvasion: function(v) { | |
this.updateMarker(); | |
com_progrestar_framework_time_Time.start($bind(this,this.onRemoveAnimation),2.5,1); | |
this.lastUpdate = Math.round(new Date().getTime() / 1000 * 1000); | |
if(this.evasionView == null) { | |
this.evasionView = this._scene.createClipPlayer(this.evasionLink,"CrystalEff1"); | |
this.evasionView.play(false); | |
if(this.useSorting) { | |
this._holder.set_depthSorting(true); | |
this.evasionView.get_transform().setDepth(1e9); | |
this.evasionViewFront = this._scene.createClipPlayer(this.evasionFrontLink,"CrystalEff2"); | |
this.evasionViewFront.get_transform().setDepth(-1e9); | |
this._holder.addChild(this.evasionViewFront); | |
this.evasionViewFront.play(false); | |
} | |
} else { | |
this.evasionView.stop(); | |
this.evasionView.play(false); | |
if(this.useSorting) { | |
this.evasionViewFront.stop(); | |
this.evasionViewFront.play(false); | |
} | |
} | |
this.evasionView.get_transform().copyFrom(this.crystalTransform); | |
if(this.evasionViewFront != null) { | |
this.evasionViewFront.get_transform().copyFrom(this.crystalTransform); | |
} | |
this._holder.addChild(this.evasionView); | |
} | |
,onRemoveAnimation: function(v) { | |
if(this.criticalHitView != null) { | |
this._holder.removeChild(this.criticalHitView); | |
} | |
if(this.evasionView != null) { | |
this._holder.removeChild(this.evasionView); | |
} | |
if(this.evasionViewFront != null) { | |
this._holder.removeChild(this.evasionViewFront); | |
} | |
} | |
,onCriticalHit: function(v) { | |
this.updateMarker(); | |
com_progrestar_framework_time_Time.start($bind(this,this.onRemoveAnimation),2.5,1); | |
this.lastUpdate = Math.round(new Date().getTime() / 1000 * 1000); | |
if(this.criticalHitView == null) { | |
this.criticalHitView = this._scene.createClipPlayer(this.criticalHitLink,"CrystalEffCrit"); | |
this.criticalHitView.play(false); | |
} else { | |
this.criticalHitView.stop(); | |
this.criticalHitView.play(false); | |
} | |
this.criticalHitView.get_transform().copyFrom(this.crystalTransform); | |
this._holder.addChild(this.criticalHitView); | |
} | |
,__class__: battle_$pack_location_effects_CrystalEffectController | |
}); | |
var battle_$pack_location_effects_FreezingEffectController = function() { | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.effects.FreezingEffectController"] = battle_$pack_location_effects_FreezingEffectController; | |
battle_$pack_location_effects_FreezingEffectController.__name__ = ["battle_pack","location","effects","FreezingEffectController"]; | |
battle_$pack_location_effects_FreezingEffectController.create = function(instance,scene) { | |
var inst = StaticExt.fromPool(battle_$pack_location_effects_FreezingEffectController.__pool,battle_$pack_location_effects_FreezingEffectController); | |
inst.init(instance,scene); | |
return inst; | |
}; | |
battle_$pack_location_effects_FreezingEffectController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_effects_FreezingEffectController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
instance: null | |
,_scene: null | |
,frontView: null | |
,backView: null | |
,init: function(instance,scene) { | |
this.instance = instance; | |
this._scene = scene; | |
} | |
,start: function() { | |
com_progrestar_framework_scene_core_AbstractController.prototype.start.call(this); | |
this.instance.get_effectAdded().add($bind(this,this.onEffectChanged)); | |
this.instance.get_effectRemoved().add($bind(this,this.onEffectChanged)); | |
this.instance.get_killedSignal().add($bind(this,this.onKilled)); | |
} | |
,onEffectChanged: function(v) { | |
if(this.instance.hasEffect(1001) || this.instance.hasEffect(epicwar_haxe_battle_effects_EffectViewType.EVTTowerSpeedDown)) { | |
if(this.frontView == null) { | |
this.frontView = this._scene.createClipPlayer("effects/freezing_snow@FrozenEffectStart","FreezeEff1"); | |
this.frontView.play(false); | |
this.frontView.get_transform().setDepth(-1e9); | |
this.get_holder().addChild(this.frontView); | |
this.frontView.get_animationEnd().add($bind(this,this.onFrontStartEnd)); | |
} | |
if(this.backView == null) { | |
this.backView = this._scene.createClipPlayer("effects/freezing_snow@FrozenEffectGroundLoop","FreezeEff2"); | |
this.backView.play(true); | |
this.backView.get_transform().setDepth(1e9); | |
this.get_holder().addChild(this.backView); | |
} | |
} else { | |
this.onKilled(); | |
} | |
} | |
,onFrontStartEnd: function(v) { | |
if(this.frontView != null) { | |
this.frontView.get_animationEnd().remove($bind(this,this.onFrontStartEnd)); | |
this.frontView.setClipFromFile("effects/freezing_snow@FrozenEffectLoop"); | |
this.frontView.play(true); | |
} | |
} | |
,onKilled: function(v) { | |
if(this.frontView != null) { | |
this.frontView.setClipFromFile("effects/freezing_snow@FrozenEffectEnd"); | |
this.frontView.play(false); | |
this.frontView.get_animationEnd().add($bind(this,this.onFrontEndEnd)); | |
} | |
} | |
,onFrontEndEnd: function(v) { | |
this.onRemoveAnimation(); | |
} | |
,finish: function() { | |
this.instance.get_killedSignal().remove($bind(this,this.onKilled)); | |
this.instance.get_effectAdded().remove($bind(this,this.onEffectChanged)); | |
this.instance.get_effectRemoved().remove($bind(this,this.onEffectChanged)); | |
this.onRemoveAnimation(); | |
this.instance = null; | |
this._scene = null; | |
StaticExt.toPool(battle_$pack_location_effects_FreezingEffectController.__pool,this); | |
} | |
,onRemoveAnimation: function(v) { | |
if(this.frontView != null) { | |
this.frontView.get_animationEnd().remove($bind(this,this.onFrontEndEnd)); | |
this.frontView.get_animationEnd().remove($bind(this,this.onFrontStartEnd)); | |
this.get_holder().removeChild(this.frontView); | |
this.frontView = null; | |
} | |
if(this.backView != null) { | |
this.get_holder().removeChild(this.backView); | |
this.backView = null; | |
} | |
} | |
,__class__: battle_$pack_location_effects_FreezingEffectController | |
}); | |
var battle_$pack_location_effects_PoizonEffectController = function() { | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.effects.PoizonEffectController"] = battle_$pack_location_effects_PoizonEffectController; | |
battle_$pack_location_effects_PoizonEffectController.__name__ = ["battle_pack","location","effects","PoizonEffectController"]; | |
battle_$pack_location_effects_PoizonEffectController.create = function(instance,scene) { | |
var inst = StaticExt.fromPool(battle_$pack_location_effects_PoizonEffectController.__pool,battle_$pack_location_effects_PoizonEffectController); | |
inst.init(instance,scene); | |
return inst; | |
}; | |
battle_$pack_location_effects_PoizonEffectController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_effects_PoizonEffectController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
instance: null | |
,_scene: null | |
,frontView: null | |
,init: function(instance,scene) { | |
this.instance = instance; | |
this._scene = scene; | |
} | |
,start: function() { | |
com_progrestar_framework_scene_core_AbstractController.prototype.start.call(this); | |
this.instance.get_effectAdded().add($bind(this,this.onEffectChanged)); | |
this.instance.get_effectRemoved().add($bind(this,this.onEffectChanged)); | |
this.instance.get_killedSignal().add($bind(this,this.onKilled)); | |
} | |
,onEffectChanged: function(v) { | |
if(this.instance.hasEffect(1003)) { | |
this.instance.get_hpChanged().add($bind(this,this.onDamage)); | |
} else { | |
this.instance.get_hpChanged().remove($bind(this,this.onDamage)); | |
this.onRemoveAnimation(); | |
} | |
} | |
,onKilled: function(v) { | |
this.onRemoveAnimation(); | |
} | |
,onDamage: function(v) { | |
this.playAnimation(); | |
} | |
,playAnimation: function() { | |
if(this.frontView == null) { | |
this.frontView = this._scene.createClipPlayer("effects/poizon@Damage","PoisonEffCtr"); | |
this.frontView.play(true); | |
this.frontView.get_transform().setDepth(-1e9); | |
this.get_holder().addChild(this.frontView); | |
} | |
} | |
,finish: function() { | |
this.instance.get_killedSignal().remove($bind(this,this.onKilled)); | |
this.instance.get_effectAdded().remove($bind(this,this.onEffectChanged)); | |
this.instance.get_effectRemoved().remove($bind(this,this.onEffectChanged)); | |
this.instance.get_hpChanged().remove($bind(this,this.onDamage)); | |
if(this.frontView != null) { | |
this.frontView.release(); | |
this.frontView = null; | |
} | |
this.instance = null; | |
this._scene = null; | |
StaticExt.toPool(battle_$pack_location_effects_PoizonEffectController.__pool,this); | |
} | |
,onRemoveAnimation: function(v) { | |
if(this.frontView != null) { | |
this.get_holder().removeChild(this.frontView); | |
this.frontView = null; | |
} | |
} | |
,__class__: battle_$pack_location_effects_PoizonEffectController | |
}); | |
var com_progrestar_framework_core_types_Color = function(_r,_g,_b,_a) { | |
if(_a == null) { | |
_a = 1; | |
} | |
if(_b == null) { | |
_b = 0; | |
} | |
if(_g == null) { | |
_g = 0; | |
} | |
if(_r == null) { | |
_r = 0; | |
} | |
this.init(_r,_g,_b,_a); | |
}; | |
$hxClasses["com.progrestar.framework.core.types.Color"] = com_progrestar_framework_core_types_Color; | |
com_progrestar_framework_core_types_Color.__name__ = ["com","progrestar","framework","core","types","Color"]; | |
com_progrestar_framework_core_types_Color.value = function(argb) { | |
var color = new com_progrestar_framework_core_types_Color(); | |
color.set_argb(argb); | |
return color; | |
}; | |
com_progrestar_framework_core_types_Color.differenceSQ = function(A,B) { | |
var dr = A.r - B.r; | |
var dg = A.g - B.g; | |
var db = A.b - B.b; | |
var da = A.a - B.a; | |
return dr * dr + dg * dg + db * db + da * da; | |
}; | |
com_progrestar_framework_core_types_Color.rgba = function(_r,_g,_b,_a) { | |
if(_a == null) { | |
_a = 1; | |
} | |
return (_b * 255 | 0) + ((_g * 255 | 0) << 8) + ((_r * 255 | 0) << 16) + ((_a * 255 | 0) << 24); | |
}; | |
com_progrestar_framework_core_types_Color.rgb = function(_r,_g,_b) { | |
return (com_progrestar_framework_core_utils_MathUtils.clampi(_r * 255 | 0,0,255) << 16) + (com_progrestar_framework_core_utils_MathUtils.clampi(_g * 255 | 0,0,255) << 8) + com_progrestar_framework_core_utils_MathUtils.clampi(_b * 255 | 0,0,255); | |
}; | |
com_progrestar_framework_core_types_Color.extractRed = function(rgb) { | |
return rgb >> 16 & 255; | |
}; | |
com_progrestar_framework_core_types_Color.extractGreen = function(rgb) { | |
return rgb >> 8 & 255; | |
}; | |
com_progrestar_framework_core_types_Color.extractBlue = function(rgb) { | |
return rgb & 255; | |
}; | |
com_progrestar_framework_core_types_Color.extractAlpha = function(argb) { | |
return argb >> 24 & 255; | |
}; | |
com_progrestar_framework_core_types_Color.displayInHex = function(rgb) { | |
return "#" + StringTools.hex(rgb,6); | |
}; | |
com_progrestar_framework_core_types_Color.isEqual = function(A,B) { | |
if(A.r != B.r) { | |
return false; | |
} | |
if(A.g != B.g) { | |
return false; | |
} | |
if(A.b != B.b) { | |
return false; | |
} | |
if(A.a != B.a) { | |
return false; | |
} | |
return true; | |
}; | |
com_progrestar_framework_core_types_Color.prototype = { | |
r: null | |
,g: null | |
,b: null | |
,a: null | |
,init: function(_r,_g,_b,_a) { | |
if(_a == null) { | |
_a = 1; | |
} | |
this.r = _r; | |
this.g = _g; | |
this.b = _b; | |
this.a = _a; | |
} | |
,set_argb: function(argb_) { | |
this.a = com_progrestar_framework_core_types_Color.extractAlpha(argb_) / 255; | |
this.r = com_progrestar_framework_core_types_Color.extractRed(argb_ & 16777215) / 255; | |
this.g = com_progrestar_framework_core_types_Color.extractGreen(argb_ & 16777215) / 255; | |
this.b = com_progrestar_framework_core_types_Color.extractBlue(argb_ & 16777215) / 255; | |
return argb_; | |
} | |
,getRGB: function() { | |
return com_progrestar_framework_core_types_Color.rgb(this.r,this.g,this.b); | |
} | |
,getRGBA: function() { | |
return com_progrestar_framework_core_types_Color.rgba(this.r,this.g,this.b,this.a); | |
} | |
,setRGB: function(rgb) { | |
this.r = com_progrestar_framework_core_types_Color.extractRed(rgb) / 255; | |
this.g = com_progrestar_framework_core_types_Color.extractGreen(rgb) / 255; | |
this.b = com_progrestar_framework_core_types_Color.extractBlue(rgb) / 255; | |
} | |
,copyFrom: function(other) { | |
this.r = other.r; | |
this.g = other.g; | |
this.b = other.b; | |
this.a = other.a; | |
} | |
,__class__: com_progrestar_framework_core_types_Color | |
,__properties__: {set_argb:"set_argb"} | |
}; | |
var battle_$pack_location_effects_SakuraEffectController = function() { | |
this.EFFECT_COLOR = new com_progrestar_framework_core_types_Color(1.,0.556862745098039236,0.596078431372549,1); | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.effects.SakuraEffectController"] = battle_$pack_location_effects_SakuraEffectController; | |
battle_$pack_location_effects_SakuraEffectController.__name__ = ["battle_pack","location","effects","SakuraEffectController"]; | |
battle_$pack_location_effects_SakuraEffectController.create = function(instance,scene) { | |
var inst = StaticExt.fromPool(battle_$pack_location_effects_SakuraEffectController.__pool,battle_$pack_location_effects_SakuraEffectController); | |
inst.init(instance,scene); | |
return inst; | |
}; | |
battle_$pack_location_effects_SakuraEffectController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_effects_SakuraEffectController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
instance: null | |
,_scene: null | |
,EFFECT_COLOR: null | |
,init: function(instance,scene) { | |
this.instance = instance; | |
this._scene = scene; | |
} | |
,start: function() { | |
com_progrestar_framework_scene_core_AbstractController.prototype.start.call(this); | |
this.instance.get_effectAdded().add($bind(this,this.onEffectChanged)); | |
this.instance.get_effectRemoved().add($bind(this,this.onEffectChanged)); | |
this.instance.get_killedSignal().add($bind(this,this.onKilled)); | |
} | |
,onEffectChanged: function(v) { | |
if(this.instance.hasEffect(1004)) { | |
this.playAnimation(); | |
} else { | |
this.onRemoveAnimation(); | |
} | |
} | |
,onKilled: function(v) { | |
this.onRemoveAnimation(); | |
} | |
,playAnimation: function() { | |
motion_Actuate.stop(this.get_holder().get_transform(),null,false,false); | |
motion_Actuate.tween(this.get_holder().get_transform(),0.5,{ "red" : this.EFFECT_COLOR.r, "green" : this.EFFECT_COLOR.g, "blue" : this.EFFECT_COLOR.b, "alpha" : this.EFFECT_COLOR.a}).repeat(10).reflect().onComplete($bind(this,this.onRemoveAnimation)); | |
} | |
,finish: function() { | |
this.onRemoveAnimation(); | |
this.instance.get_killedSignal().remove($bind(this,this.onKilled)); | |
this.instance.get_effectAdded().remove($bind(this,this.onEffectChanged)); | |
this.instance.get_effectRemoved().remove($bind(this,this.onEffectChanged)); | |
this.instance = null; | |
this._scene = null; | |
StaticExt.toPool(battle_$pack_location_effects_SakuraEffectController.__pool,this); | |
} | |
,onRemoveAnimation: function(v) { | |
if(this.get_holder() != null) { | |
motion_Actuate.stop(this.get_holder().get_transform(),null,false,false); | |
this.get_holder().get_transform().setColor(battle_$pack_location_effects_SakuraEffectController.BASE_COLOR); | |
} | |
} | |
,__class__: battle_$pack_location_effects_SakuraEffectController | |
}); | |
var battle_$pack_location_effects_TrapChargeEffectController = function() { | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.effects.TrapChargeEffectController"] = battle_$pack_location_effects_TrapChargeEffectController; | |
battle_$pack_location_effects_TrapChargeEffectController.__name__ = ["battle_pack","location","effects","TrapChargeEffectController"]; | |
battle_$pack_location_effects_TrapChargeEffectController.create = function(instance,scene) { | |
var inst = StaticExt.fromPool(battle_$pack_location_effects_TrapChargeEffectController.__pool,battle_$pack_location_effects_TrapChargeEffectController); | |
inst.init(instance,scene); | |
return inst; | |
}; | |
battle_$pack_location_effects_TrapChargeEffectController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_effects_TrapChargeEffectController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
instance: null | |
,_scene: null | |
,frontView: null | |
,init: function(instance,scene) { | |
this.instance = instance; | |
this._scene = scene; | |
} | |
,start: function() { | |
com_progrestar_framework_scene_core_AbstractController.prototype.start.call(this); | |
this.instance.get_fireStarted().add($bind(this,this.onAttackStarted)); | |
this.instance.get_killedSignal().add($bind(this,this.onKilled)); | |
} | |
,onKilled: function(v) { | |
this.onRemoveAnimation(); | |
} | |
,onAttackStarted: function(v) { | |
this.playAnimation(); | |
} | |
,playAnimation: function() { | |
if(this.frontView == null) { | |
var currentBoost = this.instance.getFirstCharge(); | |
if(currentBoost != null) { | |
this.frontView = this._scene.createClipPlayer("effects/TrapCharges@BubbleAnim" + currentBoost.get_id(),"TrapChargeEffCtr"); | |
this.frontView.play(false); | |
this.frontView.set_frameRate(20); | |
this.frontView.get_transform().setDepth(-1e9); | |
this.get_holder().addChild(this.frontView); | |
} | |
} | |
} | |
,finish: function() { | |
this.instance.get_fireStarted().remove($bind(this,this.onAttackStarted)); | |
this.instance.get_killedSignal().remove($bind(this,this.onKilled)); | |
if(this.frontView != null) { | |
this.frontView.release(); | |
this.frontView = null; | |
} | |
this.instance = null; | |
this._scene = null; | |
StaticExt.toPool(battle_$pack_location_effects_TrapChargeEffectController.__pool,this); | |
} | |
,onRemoveAnimation: function(v) { | |
if(this.frontView != null) { | |
this.get_holder().removeChild(this.frontView); | |
this.frontView = null; | |
} | |
} | |
,__class__: battle_$pack_location_effects_TrapChargeEffectController | |
}); | |
var battle_$pack_location_effects_WallCrushEffectController = function() { | |
this.EFFECT_COLOR = new com_progrestar_framework_core_types_Color(0.7,0.7,3,1); | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.effects.WallCrushEffectController"] = battle_$pack_location_effects_WallCrushEffectController; | |
battle_$pack_location_effects_WallCrushEffectController.__name__ = ["battle_pack","location","effects","WallCrushEffectController"]; | |
battle_$pack_location_effects_WallCrushEffectController.create = function(instance,scene) { | |
var inst = StaticExt.fromPool(battle_$pack_location_effects_WallCrushEffectController.__pool,battle_$pack_location_effects_WallCrushEffectController); | |
inst.init(instance,scene); | |
return inst; | |
}; | |
battle_$pack_location_effects_WallCrushEffectController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_effects_WallCrushEffectController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
instance: null | |
,_scene: null | |
,EFFECT_COLOR: null | |
,init: function(instance,scene) { | |
this.instance = instance; | |
this._scene = scene; | |
} | |
,start: function() { | |
com_progrestar_framework_scene_core_AbstractController.prototype.start.call(this); | |
this.instance.get_effectAdded().add($bind(this,this.onEffectChanged)); | |
this.instance.get_effectRemoved().add($bind(this,this.onEffectChanged)); | |
this.instance.get_killedSignal().add($bind(this,this.onKilled)); | |
} | |
,onEffectChanged: function(v) { | |
if(this.instance.hasEffect(epicwar_haxe_battle_effects_EffectViewType.EVTWallCrushTarget)) { | |
this.onStartEffect(); | |
} | |
} | |
,onKilled: function(v) { | |
this.onClearEffect(); | |
} | |
,finish: function() { | |
this.instance.get_killedSignal().remove($bind(this,this.onKilled)); | |
this.instance.get_effectAdded().remove($bind(this,this.onEffectChanged)); | |
this.instance.get_effectRemoved().remove($bind(this,this.onEffectChanged)); | |
this.onClearEffect(); | |
this.instance = null; | |
this._scene = null; | |
StaticExt.toPool(battle_$pack_location_effects_WallCrushEffectController.__pool,this); | |
} | |
,onStartEffect: function(v) { | |
this._holder.get_transform().setColor(battle_$pack_location_effects_WallCrushEffectController.BASE_COLOR); | |
motion_Actuate.stop(this._holder.get_transform()); | |
motion_Actuate.tween(this._holder.get_transform(),3.5,{ "red" : this.EFFECT_COLOR.r, "green" : this.EFFECT_COLOR.g, "blue" : this.EFFECT_COLOR.b, "alpha" : this.EFFECT_COLOR.a}).reverse().ease(motion_easing_Linear.get_easeNone()); | |
} | |
,onClearEffect: function(v) { | |
motion_Actuate.stop(this._holder.get_transform()); | |
this._holder.get_transform().setColor(battle_$pack_location_effects_WallCrushEffectController.BASE_COLOR); | |
} | |
,__class__: battle_$pack_location_effects_WallCrushEffectController | |
}); | |
var battle_$pack_location_effects_WallEffectController = function() { | |
this.EFFECT_COLOR = new com_progrestar_framework_core_types_Color(1.,0.22745098039215686,0.,1); | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.effects.WallEffectController"] = battle_$pack_location_effects_WallEffectController; | |
battle_$pack_location_effects_WallEffectController.__name__ = ["battle_pack","location","effects","WallEffectController"]; | |
battle_$pack_location_effects_WallEffectController.create = function(instance,scene) { | |
var inst = StaticExt.fromPool(battle_$pack_location_effects_WallEffectController.__pool,battle_$pack_location_effects_WallEffectController); | |
inst.init(instance,scene); | |
return inst; | |
}; | |
battle_$pack_location_effects_WallEffectController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_effects_WallEffectController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
instance: null | |
,_scene: null | |
,EFFECT_COLOR: null | |
,init: function(instance,scene) { | |
this.instance = instance; | |
this._scene = scene; | |
} | |
,start: function() { | |
com_progrestar_framework_scene_core_AbstractController.prototype.start.call(this); | |
this.instance.get_effectAdded().add($bind(this,this.onEffectChanged)); | |
this.instance.get_effectRemoved().add($bind(this,this.onEffectChanged)); | |
this.instance.get_killedSignal().add($bind(this,this.onKilled)); | |
} | |
,onEffectChanged: function(v) { | |
if(this.instance.hasEffect(1005)) { | |
this.playAnimation(); | |
} else { | |
this.onRemoveAnimation(false); | |
} | |
} | |
,onKilled: function(v) { | |
this.finish(); | |
} | |
,playAnimation: function() { | |
var damageController = StaticExt.kast(Std,this.get_holder().getControllerByClass(battle_$pack_location_building_view_BuildingDamageController),battle_$pack_location_building_view_BuildingDamageController); | |
damageController.set_enabled(false); | |
var explosionController = StaticExt.kast(Std,this.get_holder().getControllerByClass(battle_$pack_location_building_view_ExplosionController),battle_$pack_location_building_view_ExplosionController); | |
explosionController.set_explosionLink("effects/secondary@WallExplosion"); | |
var soundController = StaticExt.kast(Std,this.get_holder().getControllerByClass(com_progrestar_game_render2_controller_building_BattleBuildingSoundController),com_progrestar_game_render2_controller_building_BattleBuildingSoundController); | |
soundController.crashSounds = com_progrestar_game_data_spell_SpellLib.get_instance().getById(115).get_buildingSounds().get_crash(); | |
this.instance.set_killDelay(Math.random() * 0.5); | |
motion_Actuate.stop(this.get_holder().get_transform()); | |
motion_Actuate.tween(this.get_holder().get_transform(),0.5,{ "red" : this.EFFECT_COLOR.r, "green" : this.EFFECT_COLOR.g, "blue" : this.EFFECT_COLOR.b, "alpha" : this.EFFECT_COLOR.a}); | |
} | |
,finish: function() { | |
if(this._scene != null) { | |
this.onRemoveAnimation(true); | |
if(this.instance != null) { | |
this.instance.get_killedSignal().remove($bind(this,this.onKilled)); | |
this.instance.get_effectAdded().remove($bind(this,this.onEffectChanged)); | |
this.instance.get_effectRemoved().remove($bind(this,this.onEffectChanged)); | |
this.instance = null; | |
} | |
this._scene = null; | |
StaticExt.toPool(battle_$pack_location_effects_WallEffectController.__pool,this); | |
} | |
} | |
,onRemoveAnimation: function(fast) { | |
if(this.get_holder() != null) { | |
var damageController = StaticExt.kast(Std,this.get_holder().getControllerByClass(battle_$pack_location_building_view_BuildingDamageController),battle_$pack_location_building_view_BuildingDamageController); | |
if(damageController != null) { | |
damageController.set_enabled(true); | |
} | |
var explosionController = StaticExt.kast(Std,this.get_holder().getControllerByClass(battle_$pack_location_building_view_ExplosionController),battle_$pack_location_building_view_ExplosionController); | |
if(explosionController != null) { | |
explosionController.set_explosionLink("effects/secondary@BuildingExplosion"); | |
} | |
var soundController = StaticExt.kast(Std,this.get_holder().getControllerByClass(com_progrestar_game_render2_controller_building_BattleBuildingSoundController),com_progrestar_game_render2_controller_building_BattleBuildingSoundController); | |
if(soundController != null) { | |
soundController.crashSounds = null; | |
} | |
if(this.instance != null) { | |
this.instance.set_killDelay(0); | |
} | |
motion_Actuate.stop(this.get_holder().get_transform()); | |
if(fast) { | |
this.get_holder().get_transform().setColor(battle_$pack_location_effects_WallEffectController.BASE_COLOR); | |
} else { | |
motion_Actuate.tween(this.get_holder().get_transform(),0.3,{ "red" : battle_$pack_location_effects_WallEffectController.BASE_COLOR.r, "green" : battle_$pack_location_effects_WallEffectController.BASE_COLOR.g, "blue" : battle_$pack_location_effects_WallEffectController.BASE_COLOR.b, "alpha" : battle_$pack_location_effects_WallEffectController.BASE_COLOR.a}); | |
} | |
} | |
} | |
,__class__: battle_$pack_location_effects_WallEffectController | |
}); | |
var com_progrestar_game_world_location_map_ILocationRender = function() { }; | |
$hxClasses["com.progrestar.game.world.location.map.ILocationRender"] = com_progrestar_game_world_location_map_ILocationRender; | |
com_progrestar_game_world_location_map_ILocationRender.__name__ = ["com","progrestar","game","world","location","map","ILocationRender"]; | |
com_progrestar_game_world_location_map_ILocationRender.__interfaces__ = [com_progrestar_framework_core_IRelease]; | |
com_progrestar_game_world_location_map_ILocationRender.prototype = { | |
get_staticEffects: null | |
,get_groundObjects: null | |
,get_airObjects: null | |
,get_backgroundEffects: null | |
,get_background: null | |
,get_debugLayer: null | |
,get_root: null | |
,get_scene: null | |
,get_location: null | |
,__class__: com_progrestar_game_world_location_map_ILocationRender | |
,__properties__: {get_staticEffects:"get_staticEffects",get_groundObjects:"get_groundObjects",get_airObjects:"get_airObjects",get_backgroundEffects:"get_backgroundEffects",get_background:"get_background",get_debugLayer:"get_debugLayer",get_root:"get_root",get_scene:"get_scene",get_location:"get_location"} | |
}; | |
var battle_$pack_location_location_$view_LocationRender = function(location,instance,main,locationConfig) { | |
this._location = location; | |
this._data = new battle_$pack_location_location_$view_LocationRenderEnvironment(instance,main,locationConfig); | |
this.main = main; | |
main.addEventListener("enterFrame",$bind(this,this.onFrame)); | |
this._root = this._data.get_scene().createNode("location"); | |
battle_$pack_location_surface_view_SurfaceRender.create(this._root,this._data,this._data.get_location().get_surface()); | |
this._root.addChild(this._data.get_backLayer()); | |
this._root.addChild(this._data.get_staticEffects()); | |
com_progrestar_game_render2_utils_CanvasUtils.setupCanvas(this._data.get_staticEffects(),1); | |
this._root.addChild(this._data.get_helperGrid()); | |
this._root.addChild(this._data.get_groundLayer()); | |
this._root.addChild(this._data.get_airLayer()); | |
this._root.addChild(this._data.get_topLayer()); | |
var listener = this._data.get_location().get_listener(); | |
listener.buildingSpawnedSignal.add($bind(this,this.onBuildingSpawned)); | |
listener.unitSpawnedSignal.add($bind(this,this.onUnitSpawned)); | |
listener.bulletCreated.add($bind(this,this.onBulletCreated)); | |
listener.spellSpawned.add($bind(this,this.onSpellCreated)); | |
battle_$pack_location_cursor_view_CursorRender.create(this._root,this._data,!locationConfig.record.replay); | |
}; | |
$hxClasses["battle_pack.location.location_view.LocationRender"] = battle_$pack_location_location_$view_LocationRender; | |
battle_$pack_location_location_$view_LocationRender.__name__ = ["battle_pack","location","location_view","LocationRender"]; | |
battle_$pack_location_location_$view_LocationRender.__interfaces__ = [com_progrestar_game_world_location_map_ILocationRender]; | |
battle_$pack_location_location_$view_LocationRender.prototype = { | |
_location: null | |
,_data: null | |
,main: null | |
,_root: null | |
,release: function() { | |
this.main.removeEventListener("enterFrame",$bind(this,this.onFrame)); | |
var listener = this._data.get_location().get_listener(); | |
listener.buildingSpawnedSignal.remove($bind(this,this.onBuildingSpawned)); | |
listener.unitSpawnedSignal.remove($bind(this,this.onUnitSpawned)); | |
listener.bulletCreated.remove($bind(this,this.onBulletCreated)); | |
listener.spellSpawned.remove($bind(this,this.onSpellCreated)); | |
this._root.release(); | |
this._data.release(); | |
this._data = null; | |
this.main = null; | |
this._root = null; | |
} | |
,get_background: function() { | |
return this._data.get_backLayer(); | |
} | |
,get_backgroundEffects: function() { | |
return this._data.get_backEffectLayer(); | |
} | |
,get_staticEffects: function() { | |
return this._data.get_staticEffects(); | |
} | |
,get_groundObjects: function() { | |
return this._data.get_groundLayer(); | |
} | |
,get_airObjects: function() { | |
return this._data.get_airLayer(); | |
} | |
,onBuildingSpawned: function(building) { | |
battle_$pack_location_building_view_BuildingRender.create(this._data,building); | |
} | |
,onUnitSpawned: function(unit) { | |
battle_$pack_location_unit_view_UnitRender.create(this._data,unit); | |
} | |
,onBulletCreated: function(bullet) { | |
battle_$pack_location_bullet_view_BulletRender.create(this._data,bullet); | |
} | |
,onSpellCreated: function(spell) { | |
battle_$pack_location_spell_view_SpellRender.create(this._data,spell); | |
} | |
,onFrame: function(event) { | |
this._data.get_ticker().tick(40); | |
} | |
,get_debugLayer: function() { | |
return this._data.get_topLayer(); | |
} | |
,get_root: function() { | |
return this._root; | |
} | |
,get_data: function() { | |
return this._data; | |
} | |
,get_location: function() { | |
return this._location; | |
} | |
,get_scene: function() { | |
return this._data.get_scene(); | |
} | |
,__class__: battle_$pack_location_location_$view_LocationRender | |
,__properties__: {get_scene:"get_scene",get_location:"get_location",get_data:"get_data",get_root:"get_root",get_debugLayer:"get_debugLayer",get_airObjects:"get_airObjects",get_groundObjects:"get_groundObjects",get_staticEffects:"get_staticEffects",get_backgroundEffects:"get_backgroundEffects",get_background:"get_background"} | |
}; | |
var battle_$pack_location_location_$view_LocationRenderEnvironment = function(location,main,locationConfig) { | |
this.cursor = new battle_$pack_location_cursor_Cursor(); | |
this.main = main; | |
this._locationConfig = locationConfig; | |
this._location = location; | |
this._config = battle_$pack_location_location_$view_SceneConfig.instance; | |
this._scene = GameSceneFactory.scene; | |
this._transform = new battle_$pack_location_location_$view_LocationTransform(GameSceneFactory.scene); | |
this._ticker = new com_progrestar_framework_time_ManualTicker(); | |
this._staticEffects = this.get_scene().createCanvas("_staticEffects"); | |
this.initGrid(); | |
this._backLayer = this._scene.createNode("_backLayer"); | |
this._backEffectLayer = this._scene.createNode("_backEffectLayer"); | |
this._groundLayer = this._scene.createNode("_groundLayer"); | |
this._groundLayer.addController(this._area = battle_$pack_location_surface_view_AreaBlinkController.create(this._scene)); | |
this._airLayer = this._scene.createNode("_airLayer"); | |
this._topLayer = this._scene.createNode("_topLayer"); | |
}; | |
$hxClasses["battle_pack.location.location_view.LocationRenderEnvironment"] = battle_$pack_location_location_$view_LocationRenderEnvironment; | |
battle_$pack_location_location_$view_LocationRenderEnvironment.__name__ = ["battle_pack","location","location_view","LocationRenderEnvironment"]; | |
battle_$pack_location_location_$view_LocationRenderEnvironment.prototype = { | |
cursor: null | |
,_area: null | |
,_location: null | |
,_backLayer: null | |
,_backEffectLayer: null | |
,_groundLayer: null | |
,_airLayer: null | |
,_topLayer: null | |
,_helperGrid: null | |
,_staticEffects: null | |
,_transform: null | |
,_ticker: null | |
,_scene: null | |
,_config: null | |
,_locationConfig: null | |
,townHall: null | |
,main: null | |
,initGrid: function() { | |
this._helperGrid = new com_progrestar_framework_genome_display_GenomeGrid(); | |
var viewport = this._locationConfig.viewport.get_value(); | |
this._helperGrid.get_transform().setPosition(viewport.x,viewport.y); | |
this._helperGrid.setSize(viewport.width,viewport.height); | |
} | |
,release: function() { | |
this._ticker.release(); | |
this._helperGrid.dispose(); | |
this.cursor = null; | |
this._location = null; | |
this._backLayer = null; | |
this._backEffectLayer = null; | |
this._groundLayer = null; | |
this._airLayer = null; | |
this._topLayer = null; | |
this._helperGrid = null; | |
this._staticEffects = null; | |
this._transform = null; | |
this._ticker = null; | |
this._scene = null; | |
this._config = null; | |
this.townHall = null; | |
} | |
,get_location: function() { | |
return this._location; | |
} | |
,get_config: function() { | |
return this._config; | |
} | |
,get_groundLayer: function() { | |
return this._groundLayer; | |
} | |
,get_airLayer: function() { | |
return this._airLayer; | |
} | |
,get_backLayer: function() { | |
return this._backLayer; | |
} | |
,get_helperGrid: function() { | |
return this._helperGrid; | |
} | |
,get_staticEffects: function() { | |
return this._staticEffects; | |
} | |
,get_transform: function() { | |
return this._transform; | |
} | |
,get_ticker: function() { | |
return this._ticker; | |
} | |
,get_scene: function() { | |
return this._scene; | |
} | |
,get_topLayer: function() { | |
return this._topLayer; | |
} | |
,get_backEffectLayer: function() { | |
return this._backEffectLayer; | |
} | |
,get_area: function() { | |
return this._area; | |
} | |
,get_locationConfig: function() { | |
return this._locationConfig; | |
} | |
,__class__: battle_$pack_location_location_$view_LocationRenderEnvironment | |
,__properties__: {get_locationConfig:"get_locationConfig",get_area:"get_area",get_backEffectLayer:"get_backEffectLayer",get_topLayer:"get_topLayer",get_scene:"get_scene",get_ticker:"get_ticker",get_transform:"get_transform",get_staticEffects:"get_staticEffects",get_helperGrid:"get_helperGrid",get_backLayer:"get_backLayer",get_airLayer:"get_airLayer",get_groundLayer:"get_groundLayer",get_config:"get_config",get_location:"get_location"} | |
}; | |
var battle_$pack_location_location_$view_LocationTransform = function(scene) { | |
this.scene = scene; | |
}; | |
$hxClasses["battle_pack.location.location_view.LocationTransform"] = battle_$pack_location_location_$view_LocationTransform; | |
battle_$pack_location_location_$view_LocationTransform.__name__ = ["battle_pack","location","location_view","LocationTransform"]; | |
battle_$pack_location_location_$view_LocationTransform.prototype = { | |
scene: null | |
,screenToModel: function(screenX,screenY,model) { | |
var screen = new openfl_geom_Point(screenX,screenY); | |
var view = this.scene.screenToView(screen); | |
return this.viewToModel(view.x,view.y,model); | |
} | |
,viewToModel: function(viewX,viewY,model) { | |
if(model != null) { | |
model = model; | |
} else { | |
model = new openfl_geom_Point(); | |
} | |
model.x = (viewY + viewY + viewX) * battle_$pack_location_location_$view_LocationTransform.HALF_DIV_TILE_SIZE; | |
model.y = (viewY + viewY - viewX) * battle_$pack_location_location_$view_LocationTransform.HALF_DIV_TILE_SIZE; | |
return model; | |
} | |
,modelToView: function(modelX,modelY,modelZ,view) { | |
if(modelZ == null) { | |
modelZ = 0; | |
} | |
if(view != null) { | |
view = view; | |
} else { | |
view = new openfl_geom_Point(); | |
} | |
view.x = (modelX - modelY) * battle_$pack_location_location_$view_LocationTransform.TILE_SIZE; | |
view.y = (modelX + modelY - modelZ) * battle_$pack_location_location_$view_LocationTransform.HALF_TILE_SIZE; | |
return view; | |
} | |
,applyTo: function(output,tileX,tileY,tileZ,depth) { | |
if(depth == null) { | |
depth = 0; | |
} | |
if(tileZ == null) { | |
tileZ = 0; | |
} | |
var viewX = (tileX - tileY) * battle_$pack_location_location_$view_LocationTransform.TILE_SIZE; | |
var viewY = (tileX + tileY - tileZ) * battle_$pack_location_location_$view_LocationTransform.HALF_TILE_SIZE; | |
output.setPosition(viewX,viewY); | |
output.setDepth(depth - tileX - tileY); | |
} | |
,__class__: battle_$pack_location_location_$view_LocationTransform | |
}; | |
var battle_$pack_location_location_$view_SceneConfig = function() { | |
this.gameSpeed = new com_progrestar_cas_utils_property_NumberProperty(1); | |
this.randomOffsets = new com_progrestar_cas_utils_property_BooleanProperty(true); | |
this.showFoundation = new com_progrestar_cas_utils_property_BooleanProperty(false); | |
this.showUnitDeployLock = new com_progrestar_cas_utils_property_BooleanProperty(false); | |
this.blockShowUnitDeployLock = new com_progrestar_cas_utils_property_BooleanProperty(false); | |
this.showTowerRange = new com_progrestar_cas_utils_property_BooleanProperty(false); | |
this.showBulletRange = new com_progrestar_cas_utils_property_BooleanProperty(false); | |
this.showDefaultGrid = new com_progrestar_cas_utils_property_BooleanProperty(false); | |
this.showGrid = new com_progrestar_cas_utils_property_BooleanProperty(true); | |
this.showServerMove = new com_progrestar_cas_utils_property_BooleanProperty(false); | |
this.showLog = new com_progrestar_cas_utils_property_BooleanProperty(false); | |
this.showTime = new com_progrestar_cas_utils_property_BooleanProperty(false); | |
}; | |
$hxClasses["battle_pack.location.location_view.SceneConfig"] = battle_$pack_location_location_$view_SceneConfig; | |
battle_$pack_location_location_$view_SceneConfig.__name__ = ["battle_pack","location","location_view","SceneConfig"]; | |
battle_$pack_location_location_$view_SceneConfig.prototype = { | |
showTime: null | |
,showLog: null | |
,showServerMove: null | |
,showGrid: null | |
,showDefaultGrid: null | |
,showBulletRange: null | |
,showTowerRange: null | |
,blockShowUnitDeployLock: null | |
,showUnitDeployLock: null | |
,showFoundation: null | |
,randomOffsets: null | |
,gameSpeed: null | |
,__class__: battle_$pack_location_location_$view_SceneConfig | |
}; | |
var battle_$pack_location_location_$view_SceneConsole = function() { | |
}; | |
$hxClasses["battle_pack.location.location_view.SceneConsole"] = battle_$pack_location_location_$view_SceneConsole; | |
battle_$pack_location_location_$view_SceneConsole.__name__ = ["battle_pack","location","location_view","SceneConsole"]; | |
battle_$pack_location_location_$view_SceneConsole.init = function() { | |
com_progrestar_framework_console_Console.addCommand("SceneShowLog","SceneShowLog",battle_$pack_location_location_$view_SceneConsole.switchLog); | |
com_progrestar_framework_console_Console.addCommand("SceneSmoothMove","SceneSmoothMove",battle_$pack_location_location_$view_SceneConsole.switchSmoothMove); | |
com_progrestar_framework_console_Console.addCommand("SceneRandomOffsets","SceneRandomOffsets",battle_$pack_location_location_$view_SceneConsole.switchRandomOffsets); | |
com_progrestar_framework_console_Console.addCommand("SceneGameSpeed","SceneGameSpeed <speed> -- some float number from 0.1 to 10",battle_$pack_location_location_$view_SceneConsole.setGameSpeed); | |
}; | |
battle_$pack_location_location_$view_SceneConsole.switchLog = function(v) { | |
battle_$pack_location_location_$view_SceneConfig.instance.showLog.switchValue(); | |
com_progrestar_framework_console_Console.trace("log is " + (battle_$pack_location_location_$view_SceneConfig.instance.showLog.get_value() ? "on" : "off")); | |
}; | |
battle_$pack_location_location_$view_SceneConsole.switchSmoothMove = function(v) { | |
battle_$pack_location_location_$view_SceneConfig.instance.showServerMove.switchValue(); | |
com_progrestar_framework_console_Console.trace("server move is " + (battle_$pack_location_location_$view_SceneConfig.instance.showServerMove.get_value() ? "on" : "off")); | |
}; | |
battle_$pack_location_location_$view_SceneConsole.switchRandomOffsets = function(v) { | |
battle_$pack_location_location_$view_SceneConfig.instance.randomOffsets.switchValue(); | |
com_progrestar_framework_console_Console.trace("visual random offset is " + (battle_$pack_location_location_$view_SceneConfig.instance.randomOffsets.get_value() ? "on" : "off")); | |
}; | |
battle_$pack_location_location_$view_SceneConsole.setGameSpeed = function(speedValue) { | |
var speed = parseFloat(speedValue); | |
if(isFinite(speed)) { | |
speed = com_progrestar_framework_core_utils_MathUtils.clampf(speed,0.1,10); | |
battle_$pack_location_location_$view_SceneConfig.instance.gameSpeed.set_value(speed); | |
com_progrestar_framework_console_Console.trace("game speed is " + StaticExt.toFixed(speed,1)); | |
} | |
}; | |
battle_$pack_location_location_$view_SceneConsole.prototype = { | |
__class__: battle_$pack_location_location_$view_SceneConsole | |
}; | |
var battle_$pack_location_object_ObjectInstanceEffect = function(id,type,viewType) { | |
this._viewType = 0; | |
this._id = 0; | |
this._id = id; | |
this._type = type; | |
this._viewType = viewType; | |
}; | |
$hxClasses["battle_pack.location.object.ObjectInstanceEffect"] = battle_$pack_location_object_ObjectInstanceEffect; | |
battle_$pack_location_object_ObjectInstanceEffect.__name__ = ["battle_pack","location","object","ObjectInstanceEffect"]; | |
battle_$pack_location_object_ObjectInstanceEffect.prototype = { | |
_id: null | |
,get_id: function() { | |
return this._id; | |
} | |
,_type: null | |
,get_type: function() { | |
return this._type; | |
} | |
,_viewType: null | |
,get_viewType: function() { | |
return this._viewType; | |
} | |
,__class__: battle_$pack_location_object_ObjectInstanceEffect | |
,__properties__: {get_viewType:"get_viewType",get_type:"get_type",get_id:"get_id"} | |
}; | |
var battle_$pack_location_object_ObjectInstanceSkill = function(id,type,data) { | |
this._type = 0; | |
this._id = 0; | |
this._id = id; | |
this._type = type; | |
this._data = data; | |
}; | |
$hxClasses["battle_pack.location.object.ObjectInstanceSkill"] = battle_$pack_location_object_ObjectInstanceSkill; | |
battle_$pack_location_object_ObjectInstanceSkill.__name__ = ["battle_pack","location","object","ObjectInstanceSkill"]; | |
battle_$pack_location_object_ObjectInstanceSkill.prototype = { | |
_id: null | |
,get_id: function() { | |
return this._id; | |
} | |
,_type: null | |
,get_type: function() { | |
return this._type; | |
} | |
,_data: null | |
,get_data: function() { | |
return this._data; | |
} | |
,__class__: battle_$pack_location_object_ObjectInstanceSkill | |
,__properties__: {get_data:"get_data",get_type:"get_type",get_id:"get_id"} | |
}; | |
var battle_$pack_location_object_view_ObjectGPS = function() { | |
this._offset = 0; | |
this.depthOffset = 0; | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.object.view.ObjectGPS"] = battle_$pack_location_object_view_ObjectGPS; | |
battle_$pack_location_object_view_ObjectGPS.__name__ = ["battle_pack","location","object","view","ObjectGPS"]; | |
battle_$pack_location_object_view_ObjectGPS.create = function(instance,depthOffset) { | |
var inst = StaticExt.fromPool(battle_$pack_location_object_view_ObjectGPS.__pool,battle_$pack_location_object_view_ObjectGPS); | |
inst.init(instance,depthOffset); | |
return inst; | |
}; | |
battle_$pack_location_object_view_ObjectGPS.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_object_view_ObjectGPS.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
instance: null | |
,depthOffset: null | |
,_offset: null | |
,init: function(instance,depthOffset) { | |
this.depthOffset = depthOffset; | |
this.instance = instance; | |
} | |
,start: function() { | |
this.instance.get_positionChanged().add($bind(this,this.updatePosition)); | |
this.instance.get_killedSignal().add($bind(this,this.updatePosition)); | |
this.updatePosition(); | |
} | |
,updateOffset: function(offset) { | |
this._offset = offset; | |
this.updatePosition(); | |
} | |
,finish: function() { | |
this.instance.get_positionChanged().remove($bind(this,this.updatePosition)); | |
this.instance.get_killedSignal().remove($bind(this,this.updatePosition)); | |
this.instance = null; | |
StaticExt.toPool(battle_$pack_location_object_view_ObjectGPS.__pool,this); | |
} | |
,updatePosition: function(v) { | |
var transform = this._holder.get_transform(); | |
var half = this.instance.get_size() / 2; | |
var wx = this.instance.get_x() + half; | |
var wy = this.instance.get_y() + half; | |
var vx = (wx - wy) * 32; | |
var vy = (wx + wy) * 16 - this._offset * 500; | |
transform.setPosition(vx,vy); | |
transform.setDepth(-wx - wy + this.depthOffset); | |
} | |
,__class__: battle_$pack_location_object_view_ObjectGPS | |
}); | |
var battle_$pack_location_object_view_ObjectHP = function() { | |
this.isBuilding = false; | |
this.isHero = false; | |
this.isFriendly = false; | |
this.hpMax = 0; | |
this.EFFECT_COLOR = new com_progrestar_framework_core_types_Color(2,.2,1,1); | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.object.view.ObjectHP"] = battle_$pack_location_object_view_ObjectHP; | |
battle_$pack_location_object_view_ObjectHP.__name__ = ["battle_pack","location","object","view","ObjectHP"]; | |
battle_$pack_location_object_view_ObjectHP.create = function(data,ground,isFriendly,visualData,environment) { | |
var inst = StaticExt.fromPool(battle_$pack_location_object_view_ObjectHP.__pool,battle_$pack_location_object_view_ObjectHP); | |
inst.init(data,ground,isFriendly,visualData,environment); | |
return inst; | |
}; | |
battle_$pack_location_object_view_ObjectHP.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_object_view_ObjectHP.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
EFFECT_COLOR: null | |
,ground: null | |
,data: null | |
,hpMax: null | |
,isFriendly: null | |
,visualData: null | |
,environment: null | |
,bg: null | |
,filler: null | |
,offsetPoint: null | |
,isHero: null | |
,isBuilding: null | |
,init: function(data,ground,isFriendly,visualData,environment) { | |
this.data = data; | |
this.ground = ground; | |
this.isBuilding = js_Boot.__instanceof(ground,battle_$pack_location_building_BattleBuildingInstance); | |
this.isHero = !this.isBuilding && js_Boot.__instanceof(ground,battle_$pack_location_unit_UnitInstance) && js_Boot.__instanceof(StaticExt.kast(Std,ground,battle_$pack_location_unit_UnitInstance).get_unitData(),com_progrestar_game_hero_lib_HeroLevelLibItem); | |
this.isFriendly = isFriendly; | |
this.visualData = visualData; | |
this.environment = environment; | |
} | |
,start: function() { | |
if(this.ground != null) { | |
this.ground.get_hpChanged().add($bind(this,this.updateHP)); | |
this.ground.get_killedSignal().add($bind(this,this.clearBar)); | |
} | |
this.updateHP(); | |
} | |
,finish: function() { | |
if(this.environment != null) { | |
this.environment.get_changed().remove($bind(this,this.updatePosition)); | |
this.environment = null; | |
} | |
this.ground.get_hpChanged().remove($bind(this,this.updateHP)); | |
this.ground.get_killedSignal().remove($bind(this,this.clearBar)); | |
this.clearBar(); | |
this.hpMax = 0; | |
this.data = null; | |
this.ground = null; | |
this.visualData = null; | |
StaticExt.toPool(battle_$pack_location_object_view_ObjectHP.__pool,this); | |
} | |
,updateHP: function(v) { | |
if(this.ground == null || this.visualData == null) { | |
return; | |
} | |
this.hpMax = com_progrestar_framework_core_utils_MathUtils.max(this.hpMax,this.ground.get_hp()); | |
var hpConfig = this.isFriendly ? this.visualData.get_hpSelfConfig() : this.visualData.get_hpEnemyConfig(); | |
var originalProgress = com_progrestar_framework_core_utils_MathUtils.clampf(this.ground.get_hp() / this.hpMax,0,1); | |
var height = this.isHero ? 12 : 9; | |
var frame = null; | |
if(originalProgress == 0 || originalProgress == 1) { | |
this.clearBar(); | |
} else { | |
if(this.bg == null) { | |
this.createHpBar(); | |
} | |
if(this.filler == null || this.bg == null || hpConfig == null) { | |
return; | |
} | |
this.filler.setSize(hpConfig.width * originalProgress - 2,height - 2); | |
if(js_Boot.__instanceof(this.ground,battle_$pack_location_building_BattleBuildingInstance)) { | |
frame = 2; | |
} else if(originalProgress > .5) { | |
frame = 1; | |
} else if(originalProgress > .25) { | |
frame = 3; | |
} else { | |
frame = 0; | |
} | |
this.filler.setFrame(frame); | |
if(js_Boot.__instanceof(this.ground,battle_$pack_location_building_BattleBuildingInstance)) { | |
return; | |
} | |
var fromVars = { "red" : this.EFFECT_COLOR.r, "green" : this.EFFECT_COLOR.g, "blue" : this.EFFECT_COLOR.b, "alpha" : this.EFFECT_COLOR.a}; | |
var toVars = { "red" : 1, "green" : 1, "blue" : 1, "alpha" : 1}; | |
var _g = 0; | |
var _g1 = [this.filler.get_transform(),this.bg.get_transform()]; | |
while(_g < _g1.length) { | |
var obj = _g1[_g]; | |
++_g; | |
motion_Actuate.stop(obj); | |
motion_Actuate.apply(obj,fromVars); | |
motion_Actuate.tween(obj,0.2,toVars); | |
} | |
} | |
} | |
,clearBar: function(v) { | |
if(this.bg != null) { | |
this._holder.removeChild(this.bg); | |
battle_$pack_location_object_view_ObjectHP.__bgPool.push(this.bg); | |
this.bg = null; | |
} | |
if(this.filler != null) { | |
this._holder.removeChild(this.filler); | |
battle_$pack_location_object_view_ObjectHP.__fillerPool.push(this.filler); | |
this.filler = null; | |
} | |
} | |
,createHpBar: function() { | |
var hpConfig = this.isFriendly ? this.visualData.get_hpSelfConfig() : this.visualData.get_hpEnemyConfig(); | |
var temp_height = this.isHero ? 12 : 9; | |
this.bg = battle_$pack_location_object_view_ObjectHP.__bgPool.length > 0 ? battle_$pack_location_object_view_ObjectHP.__bgPool.pop() : this.data.get_scene().createSlice3Sprite("ui/hp_bar@HpBg"); | |
this.bg.get_transform().setDepth(com_progrestar_game_render2_Depth.INFO); | |
this.bg.setSize(hpConfig.width,temp_height); | |
this.filler = battle_$pack_location_object_view_ObjectHP.__fillerPool.length > 0 ? battle_$pack_location_object_view_ObjectHP.__fillerPool.pop() : this.data.get_scene().createSlice3Sprite("ui/hp_bar@HpFiller"); | |
this.filler.get_transform().setDepth(com_progrestar_game_render2_Depth.INFO); | |
this.filler.setSize(hpConfig.width - 2,temp_height - 2); | |
this.offsetPoint = new openfl_geom_Point(-hpConfig.width * .5,-temp_height); | |
var position = new openfl_geom_Point(hpConfig.dX + this.offsetPoint.x,hpConfig.dY + this.offsetPoint.y); | |
var building = StaticExt.kast(Std,this.ground,battle_$pack_location_building_BattleBuildingInstance); | |
if(building == null) { | |
position.y += 16; | |
} else if(building.underConstruction) { | |
position.y = 0; | |
} | |
this.bg.get_transform().setPosition(position.x,position.y); | |
this.filler.get_transform().setPosition(position.x + 1,position.y + 1); | |
if(this.environment != null) { | |
this.environment.get_changed().add($bind(this,this.updatePosition)); | |
} | |
this.updatePosition(); | |
this._holder.addChild(this.bg); | |
this._holder.addChild(this.filler); | |
} | |
,updatePosition: function(v) { | |
if(this.environment == null || this.bg == null || this.filler == null) { | |
return; | |
} | |
this.bg.get_transform().copyFrom(this.environment.get_hpBarMark()); | |
var position = this.bg.get_transform().getPosition().add(this.offsetPoint); | |
this.bg.get_transform().setPosition(position.x,position.y); | |
this.filler.get_transform().setPosition(position.x + 1,position.y + 1); | |
} | |
,__class__: battle_$pack_location_object_view_ObjectHP | |
}); | |
var battle_$pack_location_owner_OwnerInstance = function(homeLink) { | |
this._spellsPaidTotal = new battle_$pack_location_unit_ItemPacksContainer(); | |
this._spellsTotal = new battle_$pack_location_unit_ItemPacksContainer(); | |
this._spellsPackPaid = new battle_$pack_location_unit_ItemPacksContainer(); | |
this._spellsPackReserve = new battle_$pack_location_unit_ItemPacksContainer(); | |
this._spellsPaid = new com_progrestar_game_collection_Collection(); | |
this._spellsDeploy = new com_progrestar_game_collection_Collection(); | |
this._spellsReserve = new com_progrestar_game_collection_Collection(); | |
this._unitsTotal = new battle_$pack_location_unit_ItemPacksContainer(); | |
this._unitPacksReserve = new battle_$pack_location_unit_ItemPacksContainer(); | |
this._unitsDeploy = new com_progrestar_game_collection_Collection(); | |
this._baseResource = new com_progrestar_game_collection_Collection(); | |
this._resources = new com_progrestar_game_collection_Collection(); | |
this._resources.set_saveZero(true); | |
this._baseResource.set_saveZero(true); | |
this._spellsReserve.set_saveZero(true); | |
this._homeLink = homeLink; | |
}; | |
$hxClasses["battle_pack.location.owner.OwnerInstance"] = battle_$pack_location_owner_OwnerInstance; | |
battle_$pack_location_owner_OwnerInstance.__name__ = ["battle_pack","location","owner","OwnerInstance"]; | |
battle_$pack_location_owner_OwnerInstance.prototype = { | |
_homeLink: null | |
,_resources: null | |
,_baseResource: null | |
,_unitsDeploy: null | |
,_unitPacksReserve: null | |
,_unitsTotal: null | |
,_spellsReserve: null | |
,_spellsDeploy: null | |
,_spellsPaid: null | |
,_spellsPackReserve: null | |
,_spellsPackPaid: null | |
,_spellsTotal: null | |
,_spellsPaidTotal: null | |
,release: function() { | |
this._resources.release(); | |
this._baseResource.release(); | |
this._unitPacksReserve.release(); | |
this._unitsTotal.release(); | |
this._spellsPaid.release(); | |
this._spellsReserve.release(); | |
this._spellsPackReserve.release(); | |
this._spellsPackPaid.release(); | |
this._spellsTotal.release(); | |
this._spellsPaidTotal.release(); | |
this._resources = null; | |
this._baseResource = null; | |
this._spellsPaid = null; | |
this._spellsReserve = null; | |
this._unitPacksReserve = null; | |
this._unitsTotal = null; | |
this._spellsPackReserve = null; | |
this._spellsPackPaid = null; | |
this._spellsTotal = null; | |
this._spellsPaidTotal = null; | |
} | |
,addSpellReserve: function(spellData,amount,paidAmount) { | |
com_progrestar_framework_core_Assert.isTrue(spellData != null,"unknown spell type"); | |
this._spellsReserve.setItem(spellData,amount + paidAmount); | |
this._spellsPaid.setItem(spellData,paidAmount); | |
this._spellsPackReserve.registerSpellPack(spellData,amount + paidAmount); | |
this._spellsTotal.registerSpellPack(spellData,amount + paidAmount); | |
this._spellsPackPaid.registerSpellPack(spellData,paidAmount); | |
this._spellsPaidTotal.registerSpellPack(spellData,paidAmount); | |
} | |
,addPaidSpell: function(spellId) { | |
var totalCe = this.getSpellCeFromCollection(spellId,this._spellsReserve); | |
var totalAmount = 0; | |
if(totalCe != null) { | |
totalAmount = totalCe.get_amount() | 0; | |
} | |
var paidCe = this.getSpellCeFromCollection(spellId,this._spellsPaid); | |
var paidAmount = 0; | |
if(paidCe != null) { | |
paidAmount = paidCe.get_amount() | 0; | |
} | |
var newTotalAmount = totalAmount + 1; | |
var newPaidAmount = paidAmount + 1; | |
var spellData = null; | |
if(totalCe != null) { | |
spellData = StaticExt.kast(Std,totalCe.get_elementType(),com_progrestar_game_data_spell_SpellLevelLibItem); | |
} | |
if(spellData == null) { | |
com_progrestar_framework_core_utils_TraceUtils.consoleLog("Error: unknown spellId " + spellId); | |
} | |
this._spellsReserve.setItem(spellData,newTotalAmount); | |
this._spellsPaid.setItem(spellData,newPaidAmount); | |
this._spellsPackReserve.setValueForSpellPack(spellData,newTotalAmount); | |
this._spellsTotal.setValueForSpellPack(spellData,newTotalAmount); | |
this._spellsPackPaid.setValueForSpellPack(spellData,newPaidAmount); | |
this._spellsPaidTotal.setValueForSpellPack(spellData,newPaidAmount); | |
} | |
,getSpellCeFromCollection: function(spellId,collection) { | |
var _g = 0; | |
var _g1 = collection.getElements(); | |
while(_g < _g1.length) { | |
var element = _g1[_g]; | |
++_g; | |
var spell = StaticExt.kast(Std,element.get_elementType(),com_progrestar_game_data_spell_SpellLevelLibItem); | |
if(spell.get_spellLibItem().get_id() == spellId) { | |
return element; | |
} | |
} | |
return null; | |
} | |
,deploySpell: function(spellData) { | |
this._spellsReserve.addItem(spellData,-1); | |
this._spellsDeploy.addItem(spellData,1); | |
this._spellsPackReserve.changeSpellPack(spellData,-1,0); | |
} | |
,addUnitReserve: function(unitData,amount) { | |
com_progrestar_framework_core_Assert.isTrue(unitData != null,"unknown unit type"); | |
this._unitPacksReserve.registerUnitPack(unitData,amount); | |
this._unitsTotal.registerUnitPack(unitData,amount); | |
} | |
,deployUnit: function(unitData) { | |
this._unitPacksReserve.changeUnitPack(unitData,-1,0); | |
this._unitsDeploy.addItem(unitData,1); | |
} | |
,get_spellsReserve: function() { | |
return this._spellsReserve; | |
} | |
,get_spellsPaid: function() { | |
return this._spellsPaid; | |
} | |
,get_spellsPackReserve: function() { | |
return this._spellsPackReserve; | |
} | |
,get_spellsPackPaid: function() { | |
return this._spellsPackPaid; | |
} | |
,get_unitPacksReserve: function() { | |
return this._unitPacksReserve; | |
} | |
,get_homeLink: function() { | |
return this._homeLink; | |
} | |
,get_resources: function() { | |
return this._resources; | |
} | |
,get_baseResources: function() { | |
return this._baseResource; | |
} | |
,get_unitsDeploy: function() { | |
return this._unitsDeploy; | |
} | |
,get_spellsDeploy: function() { | |
return this._spellsDeploy; | |
} | |
,get_itemsUsedInCrusadeBattle: function() { | |
var result = []; | |
var units = this.get_unitPacksReserve().getUsedElements(); | |
result = result.concat(units); | |
var spells = this.get_spellsPackReserve().getElements(); | |
result = result.concat(spells); | |
return result; | |
} | |
,get_itemsTakenIntoCrusadeBattle: function() { | |
var result = []; | |
var units = this._unitsTotal.getElements(); | |
result = result.concat(units); | |
var spells = this._spellsTotal.getElements(); | |
result = result.concat(spells); | |
return result; | |
} | |
,__class__: battle_$pack_location_owner_OwnerInstance | |
,__properties__: {get_itemsTakenIntoCrusadeBattle:"get_itemsTakenIntoCrusadeBattle",get_itemsUsedInCrusadeBattle:"get_itemsUsedInCrusadeBattle",get_spellsDeploy:"get_spellsDeploy",get_unitsDeploy:"get_unitsDeploy",get_baseResources:"get_baseResources",get_resources:"get_resources",get_homeLink:"get_homeLink",get_unitPacksReserve:"get_unitPacksReserve",get_spellsPackPaid:"get_spellsPackPaid",get_spellsPackReserve:"get_spellsPackReserve",get_spellsPaid:"get_spellsPaid",get_spellsReserve:"get_spellsReserve"} | |
}; | |
var battle_$pack_location_spell_SpellInstance = function() { | |
this.lifeTime = 0; | |
this.castTime = 0; | |
}; | |
$hxClasses["battle_pack.location.spell.SpellInstance"] = battle_$pack_location_spell_SpellInstance; | |
battle_$pack_location_spell_SpellInstance.__name__ = ["battle_pack","location","spell","SpellInstance"]; | |
battle_$pack_location_spell_SpellInstance.prototype = { | |
spellData: null | |
,castTime: null | |
,lifeTime: null | |
,x: null | |
,y: null | |
,__class__: battle_$pack_location_spell_SpellInstance | |
}; | |
var battle_$pack_location_spell_SpellSound = function() { | |
}; | |
$hxClasses["battle_pack.location.spell.SpellSound"] = battle_$pack_location_spell_SpellSound; | |
battle_$pack_location_spell_SpellSound.__name__ = ["battle_pack","location","spell","SpellSound"]; | |
battle_$pack_location_spell_SpellSound.setup = function(instance) { | |
battle_$pack_location_spell_SpellSound.deploy(); | |
var spellLibItem = instance.spellData.get_spellLibItem(); | |
var delay = instance.castTime; | |
var onFire = function(v) { | |
battle_$pack_location_spell_SpellSound.sayFire(spellLibItem); | |
}; | |
com_progrestar_framework_time_Time.wait(onFire,delay / 1000); | |
}; | |
battle_$pack_location_spell_SpellSound.deploy = function() { | |
var volume = com_progrestar_framework_core_utils_RandomUtils.randf(0.6,1.0); | |
Assets.sounds_gui_spell_click.play(volume,0,1000); | |
}; | |
battle_$pack_location_spell_SpellSound.sayFire = function(spellLibItem) { | |
com_progrestar_framework_sound_$system_SoundManager.playSoundCustom(spellLibItem.get_sound().get_fires(),0.2,1.0,1.0,1000); | |
}; | |
battle_$pack_location_spell_SpellSound.prototype = { | |
__class__: battle_$pack_location_spell_SpellSound | |
}; | |
var battle_$pack_location_spell_view_SpellRender = function() { | |
}; | |
$hxClasses["battle_pack.location.spell.view.SpellRender"] = battle_$pack_location_spell_view_SpellRender; | |
battle_$pack_location_spell_view_SpellRender.__name__ = ["battle_pack","location","spell","view","SpellRender"]; | |
battle_$pack_location_spell_view_SpellRender.create = function(data,spell) { | |
data.get_airLayer().addController(new battle_$pack_location_spell_view_SpellView(data,spell)); | |
}; | |
battle_$pack_location_spell_view_SpellRender.prototype = { | |
__class__: battle_$pack_location_spell_view_SpellRender | |
}; | |
var battle_$pack_location_spell_view_SpellView = function(data,spell) { | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
com_progrestar_framework_core_Assert.isTrue(data != null && spell != null,"invalid arguments for SpellBody"); | |
this.data = data; | |
this.spell = spell; | |
}; | |
$hxClasses["battle_pack.location.spell.view.SpellView"] = battle_$pack_location_spell_view_SpellView; | |
battle_$pack_location_spell_view_SpellView.__name__ = ["battle_pack","location","spell","view","SpellView"]; | |
battle_$pack_location_spell_view_SpellView.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_spell_view_SpellView.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
back: null | |
,top: null | |
,_startTime: null | |
,data: null | |
,spell: null | |
,finish: function() { | |
com_progrestar_framework_time_Time.stop($bind(this,this.drawCraterSgn)); | |
this.releaseTop(); | |
this.releaseBack(); | |
this.data = null; | |
this.spell = null; | |
} | |
,start: function() { | |
battle_$pack_location_spell_SpellSound.setup(this.spell); | |
var speed = battle_$pack_location_location_$view_SceneConfig.instance.gameSpeed.get_value(); | |
this._startTime = com_progrestar_game_utils_TimeUtils.getTimeStampFloat(); | |
if(this.spell.spellData.get_spellLibItem().get_spellAnimationBackLink() != null) { | |
this.back = this.data.get_scene().createClipPlayer(null,"SpellView1"); | |
this.back.setClipFromFile(this.spell.spellData.get_spellLibItem().get_spellAnimationBackLink()); | |
this.back.set_speed(speed); | |
this.back.goTo(0); | |
this.back.play(false); | |
this.back.get_animationEnd().add($bind(this,this.onBackAnimationFinished)); | |
this.data.get_transform().applyTo(this.back.get_transform(),this.spell.x + 0.5,this.spell.y + 0.5); | |
this.data.get_backLayer().addChild(this.back); | |
} | |
if(this.spell.spellData.get_spellLibItem().get_spellAnimationLink() != null) { | |
this.top = this.data.get_scene().createClipPlayer(null,"SpellView2"); | |
this.top.setClipFromFile(this.spell.spellData.get_spellLibItem().get_spellAnimationLink()); | |
this.top.set_speed(speed); | |
this.top.goTo(0); | |
this.top.play(false); | |
this.top.get_animationEnd().add($bind(this,this.onTopAnimationFinished)); | |
this.data.get_transform().applyTo(this.top.get_transform(),this.spell.x + 0.5,this.spell.y + 0.5); | |
this.data.get_airLayer().addChild(this.top); | |
} | |
com_progrestar_framework_time_Time.start($bind(this,this.drawCraterSgn),this.spell.castTime * 0.05,1,{ "libItem" : this.spell.spellData.get_spellLibItem(), "location" : this.data.get_location(), "x" : this.spell.x + 0.5, "y" : this.spell.y + 0.5}); | |
} | |
,drawCraterSgn: function(o) { | |
this.drawCrater(o.libItem,o.location,o.x,o.y); | |
} | |
,onBackAnimationFinished: function(v) { | |
if(this.spell.spellData.get_spellLibItem().get_spellAnimationBackLoopLink() != null) { | |
this.back.get_animationEnd().remove($bind(this,this.onBackAnimationFinished)); | |
this.back.setClipFromFile(this.spell.spellData.get_spellLibItem().get_spellAnimationBackLoopLink()); | |
this.back.goTo(0); | |
this.back.play(true); | |
com_progrestar_framework_time_Time.start($bind(this,this.finishBack),this.spell.lifeTime * 0.05 - (com_progrestar_game_utils_TimeUtils.getTimeStampFloat() - this._startTime),1); | |
} else { | |
this.finishBack(); | |
} | |
} | |
,onTopAnimationFinished: function(v) { | |
if(this.spell.spellData.get_spellLibItem().get_spellAnimationLoopLink() != null) { | |
this.top.get_animationEnd().remove($bind(this,this.onTopAnimationFinished)); | |
this.top.setClipFromFile(this.spell.spellData.get_spellLibItem().get_spellAnimationLoopLink()); | |
this.top.goTo(0); | |
this.top.play(true); | |
com_progrestar_framework_time_Time.start($bind(this,this.finishTop),this.spell.lifeTime * 0.05 - (com_progrestar_game_utils_TimeUtils.getTimeStampFloat() - this._startTime),1); | |
} else { | |
this.finishTop(); | |
} | |
} | |
,finishBack: function(v) { | |
com_progrestar_framework_time_Time.stop($bind(this,this.finishBack)); | |
if(this.back != null) { | |
if(this.spell.spellData.get_spellLibItem().get_animationBackEndLink() != null) { | |
this.back.setClipFromFile(this.spell.spellData.get_spellLibItem().get_animationBackEndLink()); | |
this.back.goTo(0); | |
this.back.play(false); | |
this.back.get_animationEnd().add($bind(this,this.releaseBack)); | |
} else { | |
this.releaseBack(); | |
} | |
} | |
} | |
,finishTop: function(v) { | |
if(this.top != null) { | |
com_progrestar_framework_time_Time.stop($bind(this,this.finishTop)); | |
if(this.top != null && this.spell.spellData.get_spellLibItem().get_animationEndLink() != null) { | |
this.top.setClipFromFile(this.spell.spellData.get_spellLibItem().get_animationEndLink()); | |
this.top.goTo(0); | |
this.top.play(false); | |
this.top.get_animationEnd().add($bind(this,this.releaseTop)); | |
} else { | |
this.releaseTop(); | |
} | |
} | |
} | |
,releaseBack: function(v) { | |
if(this.back != null) { | |
this.back.get_animationEnd().remove($bind(this,this.releaseBack)); | |
if(this.back.get_parent() != null) { | |
this.back.get_parent().removeChild(this.back); | |
} | |
this.back.release(); | |
this.back = null; | |
} | |
} | |
,releaseTop: function(v) { | |
if(this.top != null) { | |
this.top.get_animationEnd().remove($bind(this,this.releaseTop)); | |
if(this.top.get_parent() != null) { | |
this.top.get_parent().removeChild(this.top); | |
} | |
this.top.release(); | |
this.top = null; | |
} | |
} | |
,drawCrater: function(spellLib,location,x,y) { | |
if(this.data == null) { | |
return; | |
} | |
com_progrestar_game_render2_utils_CanvasUtils.drawByLink(this.data.get_staticEffects(),spellLib.get_spellCraterLink(),x,y,1); | |
} | |
,__class__: battle_$pack_location_spell_view_SpellView | |
}); | |
var battle_$pack_location_surface_SurfaceInstance = function() { | |
this._tiles = []; | |
this._height = 0; | |
this._width = 0; | |
}; | |
$hxClasses["battle_pack.location.surface.SurfaceInstance"] = battle_$pack_location_surface_SurfaceInstance; | |
battle_$pack_location_surface_SurfaceInstance.__name__ = ["battle_pack","location","surface","SurfaceInstance"]; | |
battle_$pack_location_surface_SurfaceInstance.__interfaces__ = [com_progrestar_framework_core_IRelease]; | |
battle_$pack_location_surface_SurfaceInstance.prototype = { | |
_width: null | |
,_height: null | |
,_tiles: null | |
,release: function() { | |
this._tiles = null; | |
} | |
,getTile: function(tileX,tileY) { | |
if(tileX < 0 || tileY < 0) { | |
return null; | |
} | |
if(tileX >= this._width || tileY >= this._height) { | |
return null; | |
} | |
var tileKey = tileX + tileY * this._height; | |
return this._tiles[tileKey]; | |
} | |
,setSize: function(width,height) { | |
this._width = width; | |
this._height = height; | |
var self = this._tiles; | |
var len = this._width * this._height; | |
self.length = len; | |
var tile = null; | |
var _g1 = 0; | |
var _g = this._width; | |
while(_g1 < _g) { | |
var tileX = _g1++; | |
var _g3 = 0; | |
var _g2 = this._height; | |
while(_g3 < _g2) { | |
var tileY = _g3++; | |
var tileKey = tileX + tileY * this._height; | |
tile = this._tiles[tileKey]; | |
if(tile == null) { | |
var tmp = this._tiles; | |
tile = new battle_$pack_location_surface_tile_TileInstance(); | |
tmp[tileKey] = tile; | |
tile.position = com_progrestar_framework_core_types_Point2D.create(tileX,tileY); | |
} | |
} | |
} | |
} | |
,get_width: function() { | |
return this._width; | |
} | |
,get_height: function() { | |
return this._height; | |
} | |
,getBuildingInRadius: function(tileX,tileY,radius) { | |
var buildings = []; | |
var radiusSQ = radius * radius; | |
var _g1 = tileX - radius | 0; | |
var _g = tileX + radius + 1 | 0; | |
while(_g1 < _g) { | |
var dx = _g1++; | |
var _g3 = tileY - radius | 0; | |
var _g2 = tileY + radius + 1 | 0; | |
while(_g3 < _g2) { | |
var dy = _g3++; | |
var tile = this.getTile(dx,dy); | |
if(tile != null) { | |
var _g4 = 0; | |
var _g5 = tile.buildings; | |
while(_g4 < _g5.length) { | |
var building = _g5[_g4]; | |
++_g4; | |
var dist = (dx - tileX) * (dx - tileX) + (dy - tileY) * (dy - tileY); | |
if(dist > radiusSQ) { | |
continue; | |
} | |
if(buildings.indexOf(building) < 0) { | |
buildings.push(building); | |
} | |
} | |
} | |
} | |
} | |
return buildings; | |
} | |
,getLockBuildingsInTile: function(tileX,tileY) { | |
var buildings = []; | |
var _g = -1; | |
while(_g < 2) { | |
var dx = _g++; | |
var _g1 = -1; | |
while(_g1 < 2) { | |
var dy = _g1++; | |
var tile = this.getTile(tileX + dx,tileY + dy); | |
if(tile != null) { | |
var _g2 = 0; | |
var _g3 = tile.buildings; | |
while(_g2 < _g3.length) { | |
var building = _g3[_g2]; | |
++_g2; | |
if(!building.get_buildingData().get_buildingLibItem().get_isObstacle()) { | |
continue; | |
} | |
if(building.get_buildingData().get_buildingType() == "nature" && (dx != 0 || dy != 0)) { | |
continue; | |
} | |
if(buildings.indexOf(building) < 0) { | |
buildings.push(building); | |
} | |
} | |
} | |
} | |
} | |
return buildings; | |
} | |
,__class__: battle_$pack_location_surface_SurfaceInstance | |
,__properties__: {get_height:"get_height",get_width:"get_width"} | |
}; | |
var battle_$pack_location_surface_generator_DebugGrid = function() { | |
}; | |
$hxClasses["battle_pack.location.surface.generator.DebugGrid"] = battle_$pack_location_surface_generator_DebugGrid; | |
battle_$pack_location_surface_generator_DebugGrid.__name__ = ["battle_pack","location","surface","generator","DebugGrid"]; | |
battle_$pack_location_surface_generator_DebugGrid.generate = function(tileX,tileY) { | |
var checkmate = (tileX % 2 ^ tileY % 2) != 0; | |
if(checkmate) { | |
return "tiles@TileEnableDark"; | |
} else { | |
return "tiles@TileEnable"; | |
} | |
}; | |
battle_$pack_location_surface_generator_DebugGrid.prototype = { | |
__class__: battle_$pack_location_surface_generator_DebugGrid | |
}; | |
var battle_$pack_location_surface_tile_TileInstance = function() { | |
this.lock = new battle_$pack_location_surface_tile_TileLock(); | |
this.lastBulletTime = -2147483648; | |
this.buildings = []; | |
this.inTurretRange = []; | |
}; | |
$hxClasses["battle_pack.location.surface.tile.TileInstance"] = battle_$pack_location_surface_tile_TileInstance; | |
battle_$pack_location_surface_tile_TileInstance.__name__ = ["battle_pack","location","surface","tile","TileInstance"]; | |
battle_$pack_location_surface_tile_TileInstance.prototype = { | |
position: null | |
,inTurretRange: null | |
,buildings: null | |
,lastBulletTime: null | |
,lock: null | |
,__class__: battle_$pack_location_surface_tile_TileInstance | |
}; | |
var battle_$pack_location_surface_tile_TileLock = function() { | |
this.moveGround = false; | |
this.moveAir = false; | |
this.deployGround = false; | |
this.deployAir = false; | |
this.hasFoundationAround = false; | |
this.hasFoundation = false; | |
}; | |
$hxClasses["battle_pack.location.surface.tile.TileLock"] = battle_$pack_location_surface_tile_TileLock; | |
battle_$pack_location_surface_tile_TileLock.__name__ = ["battle_pack","location","surface","tile","TileLock"]; | |
battle_$pack_location_surface_tile_TileLock.prototype = { | |
hasFoundation: null | |
,hasFoundationAround: null | |
,deployAir: null | |
,deployGround: null | |
,moveAir: null | |
,moveGround: null | |
,__class__: battle_$pack_location_surface_tile_TileLock | |
}; | |
var battle_$pack_location_surface_tile_TileLockManager = function() { | |
}; | |
$hxClasses["battle_pack.location.surface.tile.TileLockManager"] = battle_$pack_location_surface_tile_TileLockManager; | |
battle_$pack_location_surface_tile_TileLockManager.__name__ = ["battle_pack","location","surface","tile","TileLockManager"]; | |
battle_$pack_location_surface_tile_TileLockManager.add = function(surface,building) { | |
var centerX = building.get_x() + building.get_size() / 2; | |
var centerY = building.get_y() + building.get_size() / 2; | |
var tile = null; | |
var tileX = null; | |
var tileY = null; | |
var _g1 = building.get_x() | 0; | |
var _g = building.get_x() + building.get_size() | 0; | |
while(_g1 < _g) { | |
var _tileX_ = _g1++; | |
tileX = _tileX_; | |
var _g3 = building.get_y() | 0; | |
var _g2 = building.get_y() + building.get_size() | 0; | |
while(_g3 < _g2) { | |
var _tileY_ = _g3++; | |
tileY = _tileY_; | |
tile = surface.getTile(tileX,tileY); | |
if(tile != null) { | |
var collection = tile.buildings; | |
if(collection.indexOf(building) < 0) { | |
collection.push(building); | |
} | |
} | |
} | |
} | |
var isObstacle = building.get_buildingData().get_buildingLibItem().get_isVisibleObstacle(); | |
var isFoundation = building.get_buildingData().get_buildingType() == "foundation"; | |
var border = building.get_buildingData().get_buildingType() == "nature" || isFoundation ? 0 : 1; | |
var _g11 = building.get_x() - border | 0; | |
var _g4 = building.get_x() + building.get_size() + border | 0; | |
while(_g11 < _g4) { | |
var _tileX_1 = _g11++; | |
tileX = _tileX_1; | |
var _g31 = building.get_y() - border | 0; | |
var _g21 = building.get_y() + building.get_size() + border | 0; | |
while(_g31 < _g21) { | |
var _tileY_1 = _g31++; | |
tileY = _tileY_1; | |
tile = surface.getTile(tileX,tileY); | |
if(tile != null) { | |
if(isObstacle) { | |
tile.lock.deployGround = true; | |
tile.lock.deployAir = true; | |
} | |
if(isFoundation) { | |
tile.lock.hasFoundation = isFoundation; | |
} | |
} | |
} | |
} | |
var foundationRange = 3; | |
var _g12 = building.get_x() - foundationRange | 0; | |
var _g5 = building.get_x() + building.get_size() + foundationRange | 0; | |
while(_g12 < _g5) { | |
var _tileX_2 = _g12++; | |
tileX = _tileX_2; | |
var _g32 = building.get_y() - foundationRange | 0; | |
var _g22 = building.get_y() + building.get_size() + foundationRange | 0; | |
while(_g32 < _g22) { | |
var _tileY_2 = _g32++; | |
tileY = _tileY_2; | |
tile = surface.getTile(tileX,tileY); | |
if(tile != null) { | |
tile.lock.hasFoundationAround = true; | |
} | |
} | |
} | |
var attackRange = building.get_buildingData().get_attackData().get_range(); | |
var _g13 = centerX - attackRange - 1 | 0; | |
var _g6 = centerX + attackRange + 2 | 0; | |
while(_g13 < _g6) { | |
var _tileX_3 = _g13++; | |
tileX = _tileX_3; | |
var _g33 = centerY - attackRange - 1 | 0; | |
var _g23 = centerY + attackRange + 2 | 0; | |
while(_g33 < _g23) { | |
var _tileY_3 = _g33++; | |
tileY = _tileY_3; | |
var dx = centerX - (tileX + 0.5); | |
var dy = centerY - (tileY + 0.5); | |
if(Math.sqrt(dx * dx + dy * dy) > attackRange) { | |
continue; | |
} | |
tile = surface.getTile(tileX,tileY); | |
if(tile != null) { | |
var collection1 = tile.inTurretRange; | |
if(collection1.indexOf(building) < 0) { | |
collection1.push(building); | |
} | |
} | |
} | |
} | |
}; | |
battle_$pack_location_surface_tile_TileLockManager.prototype = { | |
__class__: battle_$pack_location_surface_tile_TileLockManager | |
}; | |
var battle_$pack_location_surface_view_AreaBlinkController = function() { | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.surface.view.AreaBlinkController"] = battle_$pack_location_surface_view_AreaBlinkController; | |
battle_$pack_location_surface_view_AreaBlinkController.__name__ = ["battle_pack","location","surface","view","AreaBlinkController"]; | |
battle_$pack_location_surface_view_AreaBlinkController.create = function(scene) { | |
var inst = StaticExt.fromPool(battle_$pack_location_surface_view_AreaBlinkController.__pool,battle_$pack_location_surface_view_AreaBlinkController); | |
inst.init(scene); | |
return inst; | |
}; | |
battle_$pack_location_surface_view_AreaBlinkController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_surface_view_AreaBlinkController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
_scene: null | |
,area: null | |
,blink: null | |
,node: null | |
,init: function(scene) { | |
this._scene = scene; | |
} | |
,start: function() { | |
com_progrestar_common_global_Env.main.stage.addEventListener("enterFrame",$bind(this,this.onFrame)); | |
} | |
,finish: function() { | |
com_progrestar_common_global_Env.main.stage.removeEventListener("enterFrame",$bind(this,this.onFrame)); | |
this._scene = null; | |
this.area = null; | |
if(this.blink != null) { | |
this.blink.stop(); | |
} | |
this.blink = null; | |
StaticExt.toPool(battle_$pack_location_surface_view_AreaBlinkController.__pool,this); | |
} | |
,setArea: function(value) { | |
if(this.area != value) { | |
this.area = value; | |
this.updateArea(); | |
} | |
} | |
,onFrame: function(event) { | |
if(this.blink != null) { | |
this.blink.updateEffect(); | |
} | |
} | |
,updateArea: function() { | |
if(this.node != null) { | |
this._holder.removeChild(this.node); | |
} | |
if(this.area != null && this.area.width > 0 && this.area.height > 0) { | |
if(this.node == null) { | |
this.node = this._scene.createNode("areaBlink"); | |
this._holder.addChild(this.node); | |
} | |
var _g1 = this.area.get_left() | 0; | |
var _g = this.area.get_right() | 0; | |
while(_g1 < _g) { | |
var ax = _g1++; | |
var _g3 = this.area.get_top() | 0; | |
var _g2 = this.area.get_bottom() | 0; | |
while(_g3 < _g2) { | |
var ay = _g3++; | |
var view = this._scene.createClipPlayer("tiles@Tile","AreaBlink"); | |
com_progrestar_game_render2_controller_IsometricUtils.worldToScreen(view.get_transform(),ax + 0.5,ay + 0.5); | |
this.node.addChild(view); | |
} | |
} | |
if(this.blink == null) { | |
this.blink = new com_progrestar_game_render2_effect_TutorialBlinkEffect(this.node.get_transform(),this._holder.get_ticker()); | |
} | |
this.blink.start(); | |
} else if(this.blink != null) { | |
this.blink.stop(); | |
} | |
} | |
,__class__: battle_$pack_location_surface_view_AreaBlinkController | |
}); | |
var battle_$pack_location_surface_view_SurfaceRender = function() { | |
}; | |
$hxClasses["battle_pack.location.surface.view.SurfaceRender"] = battle_$pack_location_surface_view_SurfaceRender; | |
battle_$pack_location_surface_view_SurfaceRender.__name__ = ["battle_pack","location","surface","view","SurfaceRender"]; | |
battle_$pack_location_surface_view_SurfaceRender.create = function(location,data,surface) { | |
var grid = data.get_scene().createNode("grid"); | |
grid.addController(new battle_$pack_location_surface_view_TileGridController(data,surface)); | |
location.addChild(grid); | |
}; | |
battle_$pack_location_surface_view_SurfaceRender.prototype = { | |
__class__: battle_$pack_location_surface_view_SurfaceRender | |
}; | |
var battle_$pack_location_surface_view_TileAssets = function() { | |
}; | |
$hxClasses["battle_pack.location.surface.view.TileAssets"] = battle_$pack_location_surface_view_TileAssets; | |
battle_$pack_location_surface_view_TileAssets.__name__ = ["battle_pack","location","surface","view","TileAssets"]; | |
battle_$pack_location_surface_view_TileAssets.prototype = { | |
__class__: battle_$pack_location_surface_view_TileAssets | |
}; | |
var battle_$pack_location_surface_view_TileGridController = function(view,surface) { | |
this._initialized = false; | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
this.view = view; | |
this.surface = surface; | |
}; | |
$hxClasses["battle_pack.location.surface.view.TileGridController"] = battle_$pack_location_surface_view_TileGridController; | |
battle_$pack_location_surface_view_TileGridController.__name__ = ["battle_pack","location","surface","view","TileGridController"]; | |
battle_$pack_location_surface_view_TileGridController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_surface_view_TileGridController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
surface: null | |
,view: null | |
,_initialized: null | |
,start: function() { | |
this.view.get_config().showDefaultGrid.get_changed().add($bind(this,this.update)); | |
this.view.get_config().showTowerRange.get_changed().add($bind(this,this.update)); | |
this.view.get_config().showUnitDeployLock.get_changed().add($bind(this,this.update)); | |
this.view.get_config().showFoundation.get_changed().add($bind(this,this.update)); | |
com_progrestar_game_scene_SceneManager.get_sceneChanged().add($bind(this,this.updateScene)); | |
this.update(); | |
} | |
,finish: function() { | |
this.view.get_config().showDefaultGrid.get_changed().remove($bind(this,this.update)); | |
this.view.get_config().showTowerRange.get_changed().remove($bind(this,this.update)); | |
this.view.get_config().showUnitDeployLock.get_changed().remove($bind(this,this.update)); | |
this.view.get_config().showFoundation.get_changed().remove($bind(this,this.update)); | |
com_progrestar_game_scene_SceneManager.get_sceneChanged().remove($bind(this,this.updateScene)); | |
} | |
,fullUpdate: function() { | |
var config = this.view.get_config(); | |
var activeLocation = com_progrestar_game_scene_SceneManager.get_activeLocation(); | |
var canvas = this.view.get_helperGrid(); | |
canvas.dropState(); | |
if(config.showGrid.get_value() && activeLocation != null) { | |
var BORDER = 4; | |
var _g1 = -BORDER; | |
var _g = this.surface.get_width() + BORDER; | |
while(_g1 < _g) { | |
var tileX = _g1++; | |
var _g3 = -BORDER; | |
var _g2 = this.surface.get_height() + BORDER; | |
while(_g3 < _g2) { | |
var tileY = _g3++; | |
battle_$pack_location_surface_view_TileRender.draw(this.view,this.surface,tileX,tileY); | |
} | |
} | |
this._initialized = true; | |
} | |
} | |
,updateScene: function(v) { | |
this._initialized = false; | |
this.update(); | |
} | |
,update: function(value) { | |
if(value == null) { | |
value = true; | |
} | |
com_progrestar_framework_core_utils_TraceUtils.consoleLog("update tile grid"); | |
var showDefaultGrid = this.view.get_config().showDefaultGrid.get_value(); | |
var showTowerRange = this.view.get_config().showTowerRange.get_value(); | |
var showUnitDeployLock = this.view.get_config().showUnitDeployLock.get_value(); | |
if(!showDefaultGrid && !showTowerRange && !showUnitDeployLock) { | |
this.view.get_helperGrid().get_transform().set_alpha(0); | |
com_progrestar_framework_core_utils_TraceUtils.consoleLog("hide grid"); | |
} else { | |
if(!com_progrestar_game_scene_SceneManager.get_isBattle() || !this._initialized) { | |
this.fullUpdate(); | |
com_progrestar_framework_core_utils_TraceUtils.consoleLog("update grid"); | |
} | |
this.view.get_helperGrid().get_transform().set_alpha(1); | |
com_progrestar_framework_core_utils_TraceUtils.consoleLog("show grid"); | |
} | |
} | |
,__class__: battle_$pack_location_surface_view_TileGridController | |
}); | |
var battle_$pack_location_surface_view_TileRender = function() { | |
}; | |
$hxClasses["battle_pack.location.surface.view.TileRender"] = battle_$pack_location_surface_view_TileRender; | |
battle_$pack_location_surface_view_TileRender.__name__ = ["battle_pack","location","surface","view","TileRender"]; | |
battle_$pack_location_surface_view_TileRender.draw = function(view,surface,tileX,tileY) { | |
var checkmate = false; | |
var config = view.get_config(); | |
var showDefaultGrid = config.showDefaultGrid.get_value(); | |
var showUnitDeployLock = config.showUnitDeployLock.get_value(); | |
var showFoundation = config.showFoundation.get_value(); | |
var canvas = view.get_helperGrid(); | |
var tileInfo = null; | |
var tileAsset = null; | |
tileInfo = surface.getTile(tileX,tileY); | |
if(tileInfo == null) { | |
var self = Math; | |
var a = [tileX,tileY,surface.get_width() - tileX,surface.get_height() - tileY]; | |
if(a.length == 0) { | |
throw new js__$Boot_HaxeError("imina: need more args"); | |
} | |
var r = a[0]; | |
var _g = 0; | |
while(_g < a.length) { | |
var i = a[_g]; | |
++_g; | |
r = StaticExt.imin(self,r,i); | |
} | |
var border = -r; | |
checkmate = (tileX % 2 ^ tileY % 2) != 0; | |
var alpha = 1 - border / 5; | |
if(alpha > 0) { | |
if(!showFoundation) { | |
if(checkmate) { | |
tileAsset = "tiles@TileDisableDark"; | |
} else { | |
tileAsset = "tiles@TileDisable"; | |
} | |
canvas.setState(tileX,tileY,tileAsset,alpha); | |
} | |
} | |
return; | |
} | |
if(showUnitDeployLock && tileInfo != null) { | |
checkmate = (tileX % 2 ^ tileY % 2) != 0; | |
var battleController = com_progrestar_game_scene_SceneManager.get_activeLocation().get_battleController(); | |
var foundationLock = showFoundation && !tileInfo.lock.hasFoundation && tileInfo.lock.hasFoundationAround; | |
var tmp; | |
if(battleController != null) { | |
if(!foundationLock) { | |
var _this = battleController.get_proxy().get_battle().map; | |
tmp = !(0 <= tileX && tileX < _this.cols && 0 <= tileY && tileY < _this.rows && _this.data[tileX][tileY]); | |
} else { | |
tmp = true; | |
} | |
} else { | |
tmp = false; | |
} | |
if(tmp) { | |
if(checkmate) { | |
tileAsset = "tiles@TileDisableDark"; | |
} else { | |
tileAsset = "tiles@TileDisable"; | |
} | |
canvas.setState(tileX,tileY,tileAsset,1); | |
} else if(tileInfo.lock.deployAir || tileInfo.lock.deployGround) { | |
if(checkmate) { | |
tileAsset = "tiles@TileDisableDark"; | |
} else { | |
tileAsset = "tiles@TileDisable"; | |
} | |
canvas.setState(tileX,tileY,tileAsset,1); | |
} | |
} | |
if(showDefaultGrid) { | |
tileAsset = battle_$pack_location_surface_generator_DebugGrid.generate(tileX,tileY); | |
canvas.setState(tileX,tileY,tileAsset,0.5); | |
} | |
}; | |
battle_$pack_location_surface_view_TileRender.prototype = { | |
__class__: battle_$pack_location_surface_view_TileRender | |
}; | |
var battle_$pack_location_unit_ActionState = function() { | |
this.speedFactor = 1; | |
this.targetY = NaN; | |
this.targetX = NaN; | |
this.duration = NaN; | |
this.startTime = NaN; | |
this.running = false; | |
}; | |
$hxClasses["battle_pack.location.unit.ActionState"] = battle_$pack_location_unit_ActionState; | |
battle_$pack_location_unit_ActionState.__name__ = ["battle_pack","location","unit","ActionState"]; | |
battle_$pack_location_unit_ActionState.prototype = { | |
running: null | |
,startTime: null | |
,duration: null | |
,targetX: null | |
,targetY: null | |
,speedFactor: null | |
,__class__: battle_$pack_location_unit_ActionState | |
}; | |
var battle_$pack_location_unit_ItemPack = function(dataType,amountValue) { | |
if(amountValue == null) { | |
amountValue = 0; | |
} | |
this.type = "unit"; | |
this.index = 0; | |
this.defaultAmount = 0; | |
this._amount = 0; | |
this.type = dataType; | |
this._amount = amountValue; | |
this.defaultAmount = this._amount; | |
}; | |
$hxClasses["battle_pack.location.unit.ItemPack"] = battle_$pack_location_unit_ItemPack; | |
battle_$pack_location_unit_ItemPack.__name__ = ["battle_pack","location","unit","ItemPack"]; | |
battle_$pack_location_unit_ItemPack.prototype = { | |
_unitLib: null | |
,_spellLib: null | |
,_amount: null | |
,defaultAmount: null | |
,index: null | |
,type: null | |
,collectionElement: null | |
,getLibId: function() { | |
if(this.type == "unit" && this._unitLib != null) { | |
return this._unitLib.get_id(); | |
} | |
if(this.type == "spell" && this._spellLib != null) { | |
return this._spellLib.get_id(); | |
} | |
return null; | |
} | |
,isSamePack: function(other) { | |
if(this.type != other.type) { | |
return false; | |
} | |
if(this.getLibId() != other.getLibId()) { | |
return false; | |
} | |
return true; | |
} | |
,get_amount: function() { | |
return this._amount | 0; | |
} | |
,set_amount: function(value) { | |
this._amount = value; | |
if(this.collectionElement != null) { | |
this.collectionElement.setAmount(this._amount); | |
} | |
return value; | |
} | |
,get_unitLib: function() { | |
return this._unitLib; | |
} | |
,set_unitLib: function(value) { | |
this._unitLib = value; | |
this.collectionElement = new com_progrestar_framework_collection_CollectionElement(this._unitLib,this._amount); | |
return value; | |
} | |
,get_spellLib: function() { | |
return this._spellLib; | |
} | |
,set_spellLib: function(value) { | |
this._spellLib = value; | |
this.collectionElement = new com_progrestar_framework_collection_CollectionElement(this._spellLib,this._amount); | |
return value; | |
} | |
,get_usedAmount: function() { | |
return this.defaultAmount - this._amount | 0; | |
} | |
,__class__: battle_$pack_location_unit_ItemPack | |
,__properties__: {get_usedAmount:"get_usedAmount",set_spellLib:"set_spellLib",get_spellLib:"get_spellLib",set_unitLib:"set_unitLib",get_unitLib:"get_unitLib",set_amount:"set_amount",get_amount:"get_amount"} | |
}; | |
var battle_$pack_location_unit_ItemPacksContainer = function() { | |
this.totalObserver = new utils_signals_Signal(); | |
this.items = []; | |
}; | |
$hxClasses["battle_pack.location.unit.ItemPacksContainer"] = battle_$pack_location_unit_ItemPacksContainer; | |
battle_$pack_location_unit_ItemPacksContainer.__name__ = ["battle_pack","location","unit","ItemPacksContainer"]; | |
battle_$pack_location_unit_ItemPacksContainer.prototype = { | |
items: null | |
,totalObserver: null | |
,registerUnitPack: function(lib,amount) { | |
var pack = new battle_$pack_location_unit_ItemPack("unit",amount); | |
pack.set_unitLib(lib); | |
pack.index = this.getLastPackIndex(pack) + 1; | |
this.items.push(pack); | |
this.totalObserver.dispatch(); | |
} | |
,changeUnitPack: function(lib,delta,index) { | |
var _g1 = 0; | |
var _g = this.items.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
if(this.items[i].getLibId() == lib.get_id() && this.items[i].type == "unit") { | |
if(this.items[i].get_amount() > 0) { | |
var _g2 = this.items[i]; | |
_g2.set_amount(_g2.get_amount() + (delta | 0)); | |
this.totalObserver.dispatch(); | |
return; | |
} | |
} | |
} | |
} | |
,registerSpellPack: function(lib,amount) { | |
var pack = new battle_$pack_location_unit_ItemPack("spell",amount); | |
pack.set_spellLib(lib); | |
pack.index = this.getLastPackIndex(pack) + 1; | |
this.items.push(pack); | |
this.totalObserver.dispatch(); | |
} | |
,changeSpellPack: function(lib,delta,index) { | |
if(index == null) { | |
index = 0; | |
} | |
var _g1 = 0; | |
var _g = this.items.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
if(this.items[i].getLibId() == lib.get_id() && this.items[i].type == "spell") { | |
if(this.items[i].get_amount() > 0) { | |
var _g2 = this.items[i]; | |
_g2.set_amount(_g2.get_amount() + (delta | 0)); | |
this.totalObserver.dispatch(); | |
return; | |
} | |
} | |
} | |
} | |
,setValueForSpellPack: function(lib,newValue) { | |
var _g1 = 0; | |
var _g = this.items.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
if(this.items[i].getLibId() == lib.get_id() && this.items[i].type == "spell") { | |
this.items[i].set_amount(newValue); | |
this.totalObserver.dispatch(); | |
return; | |
} | |
} | |
com_progrestar_framework_core_utils_TraceUtils.consoleLog("Can't change spell value to " + newValue + ". Spell " + lib.get_id() + " was not found"); | |
} | |
,getLastPackIndex: function(item) { | |
var result = 0; | |
var _g1 = 0; | |
var _g = this.items.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
if(this.items[i].type == item.type) { | |
if(this.items[i].getLibId() == item.getLibId()) { | |
if(result < this.items[i].index) { | |
result = this.items[i].index; | |
} | |
} | |
} | |
} | |
return result; | |
} | |
,release: function() { | |
this.items = null; | |
} | |
,getUnitAmountByType: function(unit) { | |
var result = 0; | |
var _g1 = 0; | |
var _g = this.items.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
if(this.items[i].getLibId() == unit.get_id()) { | |
result += this.items[i].get_amount(); | |
} | |
} | |
return result; | |
} | |
,getSpellAmountByType: function(spell) { | |
var result = 0; | |
var _g1 = 0; | |
var _g = this.items.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
if(this.items[i].getLibId() == spell.get_id()) { | |
result += this.items[i].get_amount(); | |
} | |
} | |
return result; | |
} | |
,getTotalAmount: function() { | |
var result = 0; | |
var _g1 = 0; | |
var _g = this.items.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
result += this.items[i].get_amount(); | |
} | |
return result; | |
} | |
,findUnitLevel: function(unitType) { | |
var _g1 = 0; | |
var _g = this.items.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
if(this.items[i].get_unitLib().get_unit().get_id() == unitType) { | |
return this.items[i].get_unitLib(); | |
} | |
} | |
return null; | |
} | |
,findSpellLevel: function(spellId) { | |
var _g1 = 0; | |
var _g = this.items.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
if(this.items[i].get_spellLib().get_spellLibItem().get_id() == spellId) { | |
return this.items[i].get_spellLib(); | |
} | |
} | |
return null; | |
} | |
,getElements: function() { | |
var result = []; | |
var _g1 = 0; | |
var _g = this.items.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
result.push(this.items[i].collectionElement); | |
} | |
return result; | |
} | |
,getUsedElements: function() { | |
var result = []; | |
var _g1 = 0; | |
var _g = this.items.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
if(this.items[i].get_usedAmount() == 0) { | |
continue; | |
} | |
var ce = null; | |
if(this.items[i].get_unitLib() != null) { | |
ce = new com_progrestar_framework_collection_CollectionElement(this.items[i].get_unitLib(),this.items[i].get_usedAmount()); | |
} else if(this.items[i].get_spellLib() != null) { | |
ce = new com_progrestar_framework_collection_CollectionElement(this.items[i].get_spellLib(),this.items[i].get_usedAmount()); | |
} | |
if(ce != null) { | |
result.push(ce); | |
} | |
} | |
return result; | |
} | |
,getUnitsForUi: function() { | |
var i = null; | |
var unitsData = []; | |
var heroesData = []; | |
var result = []; | |
var _g1 = 0; | |
var _g = this.items.length; | |
while(_g1 < _g) { | |
var _i_ = _g1++; | |
i = _i_; | |
var id = this.items[i].get_unitLib().get_unit().get_id(); | |
if(com_progrestar_game_hero_lib_HeroLib.get_instance().getById(id) != null) { | |
heroesData.push(this.items[i].collectionElement); | |
} else { | |
unitsData.push(this.items[i].collectionElement); | |
} | |
} | |
var _g2 = 0; | |
while(_g2 < 8) { | |
var _i_1 = _g2++; | |
i = _i_1; | |
if(i < 5) { | |
if(unitsData.length > i) { | |
result.push(unitsData[i]); | |
} else { | |
result.push(null); | |
} | |
} | |
if(i >= 5 && i < 8) { | |
if(heroesData.length > i - 5) { | |
result.push(heroesData[i - 5]); | |
} else { | |
result.push(null); | |
} | |
} | |
} | |
return result; | |
} | |
,getElementByUnitType: function(unit) { | |
var quantity = 0; | |
var _g1 = 0; | |
var _g = this.items.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
if(this.items[i].getLibId() == unit.get_id()) { | |
return this.items[i].collectionElement; | |
} | |
} | |
return null; | |
} | |
,getElementBySpellId: function(spellId) { | |
var _g1 = 0; | |
var _g = this.items.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
if(this.items[i].type == "spell") { | |
if(this.items[i].get_spellLib().get_spellLibItem().get_id() == spellId) { | |
return this.items[i].collectionElement; | |
} | |
} | |
} | |
return null; | |
} | |
,getSpellsForUi: function() { | |
var result = []; | |
var _g1 = 0; | |
var _g = this.items.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
result.push(this.items[i].collectionElement); | |
} | |
return result; | |
} | |
,__class__: battle_$pack_location_unit_ItemPacksContainer | |
}; | |
var battle_$pack_location_unit_UnitFactory = function() { | |
}; | |
$hxClasses["battle_pack.location.unit.UnitFactory"] = battle_$pack_location_unit_UnitFactory; | |
battle_$pack_location_unit_UnitFactory.__name__ = ["battle_pack","location","unit","UnitFactory"]; | |
battle_$pack_location_unit_UnitFactory.createUnit = function(location,unitId,unitData,hp) { | |
com_progrestar_framework_core_Assert.isTrue(unitData != null,"undefined unit data"); | |
if(unitData.get_volume() != 0) { | |
location.get_attacker().deployUnit(unitData); | |
} | |
var unit = new battle_$pack_location_unit_UnitInstance(unitId,unitData,location,location.get_attacker()); | |
unit.setHP(hp); | |
location.registerUnit(unit); | |
return unit; | |
}; | |
battle_$pack_location_unit_UnitFactory.prototype = { | |
__class__: battle_$pack_location_unit_UnitFactory | |
}; | |
var battle_$pack_location_unit_UnitInstance = function(id,unitData,main,owner) { | |
this._isFirstTarget = true; | |
this.overrideAttackSound = false; | |
this._moveSignal = new utils_signals_Signal(); | |
this._moveState = new battle_$pack_location_unit_ActionState(); | |
this._attackState = new battle_$pack_location_unit_ActionState(); | |
battle_$pack_location_object_ObjectInstance.call(this,id,main,owner); | |
this._unitData = unitData; | |
if(this._unitData.get_slotPacketLib() != null) { | |
com_progrestar_framework_core_Assert.isTrue(owner.get_homeLink() != null,"invalid location"); | |
this._slotPacket = com_progrestar_game_crystals_CrystalManager.get_instance().getUnitSlotPacketByPlayer(owner.get_homeLink(),this._unitData); | |
} | |
this.setSize(1); | |
}; | |
$hxClasses["battle_pack.location.unit.UnitInstance"] = battle_$pack_location_unit_UnitInstance; | |
battle_$pack_location_unit_UnitInstance.__name__ = ["battle_pack","location","unit","UnitInstance"]; | |
battle_$pack_location_unit_UnitInstance.__super__ = battle_$pack_location_object_ObjectInstance; | |
battle_$pack_location_unit_UnitInstance.prototype = $extend(battle_$pack_location_object_ObjectInstance.prototype,{ | |
_attackState: null | |
,_moveState: null | |
,_unitData: null | |
,_moveSignal: null | |
,_slotPacket: null | |
,overrideAttackSound: null | |
,customAttackSound: null | |
,release: function() { | |
if(!this.get_owner().get_homeLink().isSelf()) { | |
com_progrestar_game_crystals_CrystalManager.get_instance().clearUnitSlotPacketByPlayer(this.get_owner().get_homeLink(),this._unitData); | |
} | |
battle_$pack_location_object_ObjectInstance.prototype.release.call(this); | |
StaticExt.release(this._moveSignal); | |
this._attackState = null; | |
this._moveState = null; | |
this._unitData = null; | |
this._slotPacket = null; | |
this._moveSignal = null; | |
} | |
,updateAction: function(v) { | |
if(this._moveState.running && this._moveState.startTime + this._moveState.duration <= this.get_location().get_locationTime()) { | |
this.setPosition(this._moveState.targetX,this._moveState.targetY); | |
this._moveState.running = false; | |
this._moveSignal.dispatch(); | |
if(this.get_state() == "Move") { | |
this.setState("Stand"); | |
this.get_location().get_ticker().remove($bind(this,this.updateAction)); | |
} | |
} | |
if(this._attackState.running && this._attackState.startTime + this._attackState.duration <= this.get_location().get_locationTime()) { | |
this._attackState.running = false; | |
if(this.get_state() == "Attack") { | |
this.setState("Stand"); | |
this.get_location().get_ticker().remove($bind(this,this.updateAction)); | |
} | |
} | |
} | |
,startMove: function(x,y,duration) { | |
if(this._moveState.running) { | |
this.setPosition(this._moveState.targetX,this._moveState.targetY); | |
} | |
this._moveState.running = true; | |
this._moveState.targetX = x; | |
this._moveState.targetY = y; | |
this._moveState.duration = duration; | |
this._moveState.startTime = this.get_location().get_locationTime(); | |
if(this.get_state() != "Move") { | |
this.setState("Move"); | |
} | |
this.get_location().get_ticker().add($bind(this,this.updateAction)); | |
this._moveSignal.dispatch(); | |
} | |
,standBy: function() { | |
this._attackState.running = false; | |
this._moveState.running = false; | |
this.setState("Stand"); | |
} | |
,startAttack: function(x,y) { | |
battle_$pack_location_object_ObjectInstance.prototype.startAttack.call(this,x,y); | |
if(this.get_state() == "Attack") { | |
this.setState("Stand"); | |
} | |
this._attackState.running = true; | |
this._attackState.targetX = x; | |
this._attackState.targetY = y; | |
this._attackState.startTime = this.get_location().get_locationTime(); | |
var tmp = this.get_unitData().get_attackData().get_recharge(); | |
this._attackState.duration = tmp * 1000; | |
this.setState("Attack"); | |
this.get_location().get_ticker().add($bind(this,this.updateAction)); | |
} | |
,spawn: function(x,y) { | |
this.setPosition(x,y); | |
this.get_location().get_listener().unitSpawnedSignal.dispatch(this); | |
} | |
,get_moveSignal: function() { | |
return this._moveSignal; | |
} | |
,get_unitData: function() { | |
return this._unitData; | |
} | |
,get_moveState: function() { | |
return this._moveState; | |
} | |
,get_attackState: function() { | |
return this._attackState; | |
} | |
,get_attackData: function() { | |
return this._unitData.get_attackData(); | |
} | |
,insertCrystal: function(crystal) { | |
com_progrestar_framework_core_Assert.isTrue(this._slotPacket != null,"Invalid slot packet"); | |
com_progrestar_game_crystals_CrystalManager.insertCrystal(this._slotPacket,this._unitData.get_level(),crystal); | |
} | |
,changeMoveDuration: function(duration) { | |
if(this._moveState.running) { | |
this._moveState.duration = duration; | |
} | |
} | |
,changeAttackSpeedFactor: function(factor) { | |
this._attackState.speedFactor = factor; | |
} | |
,changeAttackSoundOnce: function(soundId) { | |
this.overrideAttackSound = true; | |
this.customAttackSound = soundId; | |
} | |
,get_skin: function() { | |
var skin = null; | |
if(com_progrestar_game_battle_BattlesManager.get_activeBattle() != null) { | |
skin = com_progrestar_game_hero_lib_skin_HeroSkinLib.get_instance().getHeroSkinFromArray(com_progrestar_game_battle_BattlesManager.get_activeBattle().get_battleController().get_proxy().get_config().attacker.skins,this.get_unitData().get_unit().get_id()); | |
} | |
return skin; | |
} | |
,_isFirstTarget: null | |
,getIsFirstTarget: function() { | |
return this._isFirstTarget; | |
} | |
,firstTargetFround: function() { | |
this._isFirstTarget = false; | |
} | |
,__class__: battle_$pack_location_unit_UnitInstance | |
,__properties__: $extend(battle_$pack_location_object_ObjectInstance.prototype.__properties__,{get_attackState:"get_attackState",get_moveState:"get_moveState",get_unitData:"get_unitData",get_moveSignal:"get_moveSignal"}) | |
}); | |
var battle_$pack_location_unit_heroes_BattleUnitEffectsController = function() { | |
this._currentEffects = []; | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.BattleUnitEffectsController"] = battle_$pack_location_unit_heroes_BattleUnitEffectsController; | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController.__name__ = ["battle_pack","location","unit","heroes","BattleUnitEffectsController"]; | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr = null; | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController.initEffects = function() { | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr = utils_ds__$JSMap_JSMap_$Impl_$._new(); | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr.set(epicwar_haxe_battle_effects_EffectViewType.EVTUnitSpeedDown,battle_$pack_location_unit_heroes_effects_SpeedDownEffectController.create); | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr.set(epicwar_haxe_battle_effects_EffectViewType.EVTHeroCircleSpeedUp,battle_$pack_location_unit_heroes_effects_BattleSongEffectController.create); | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr.set(epicwar_haxe_battle_effects_EffectViewType.EVTHealCircle,battle_$pack_location_unit_heroes_effects_HealCircleEffectController.create); | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr.set(epicwar_haxe_battle_effects_EffectViewType.EVTHide,battle_$pack_location_unit_heroes_effects_HideSkillEffectController.create); | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr.set(epicwar_haxe_battle_effects_EffectViewType.EVTReborn,battle_$pack_location_unit_heroes_effects_RebornEffectController.create); | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr.set(epicwar_haxe_battle_effects_EffectViewType.EVTAnimateDead,battle_$pack_location_unit_heroes_effects_AnimateDeadEffectController.create); | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr.set(epicwar_haxe_battle_effects_EffectViewType.EVTAggroEffect,battle_$pack_location_unit_heroes_effects_AggroSkillEffectController.create); | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr.set(epicwar_haxe_battle_effects_EffectViewType.EVTAntifreezeCircle,battle_$pack_location_unit_heroes_effects_AntifreezeCircleEffectController.create); | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr.set(epicwar_haxe_battle_effects_EffectViewType.EVTPainDispatcher,battle_$pack_location_unit_heroes_effects_PainDispatcherEffectController.create); | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr.set(epicwar_haxe_battle_effects_EffectViewType.EVTTowerRush,battle_$pack_location_unit_heroes_effects_TowerRushEffectController.create); | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr.set(epicwar_haxe_battle_effects_EffectViewType.EVTAnrifreezeCircleForUnit,battle_$pack_location_unit_heroes_effects_AnifreezeCircleForUnitEffectController.create); | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr.set(1000,battle_$pack_location_unit_heroes_effects_RageEffectController.create); | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr.set(1002,battle_$pack_location_unit_heroes_effects_FreezeEffectController.create); | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr.set(4,battle_$pack_location_unit_heroes_effects_FreezeEffectController.create); | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr.set(10,battle_$pack_location_unit_heroes_effects_FrenzyMedEffectController.create); | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr.set(11,battle_$pack_location_unit_heroes_effects_FrenzyLowEffectController.create); | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr.set(30,battle_$pack_location_unit_heroes_effects_SpriteEffectController.create); | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr.set(31,battle_$pack_location_unit_heroes_effects_SpriteEffectController.create); | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr.set(32,battle_$pack_location_unit_heroes_effects_SpriteEffectController.create); | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr.set(33,battle_$pack_location_unit_heroes_effects_SupernovaEffectController.create); | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr.set(39,battle_$pack_location_unit_heroes_effects_HealEffectController.create); | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr.set(40,battle_$pack_location_unit_heroes_effects_RebornEffectController.create); | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr.set(41,battle_$pack_location_unit_heroes_effects_InvisibilityEffectController.create); | |
}; | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController.create = function(view,unit,decoration) { | |
if(battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr == null) { | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController.initEffects(); | |
} | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_BattleUnitEffectsController.__pool,battle_$pack_location_unit_heroes_BattleUnitEffectsController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_unit_heroes_BattleUnitEffectsController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
_unit: null | |
,_data: null | |
,_decoration: null | |
,_currentEffect: null | |
,_currentEffects: null | |
,init: function(view,unit,decoration) { | |
this._data = view; | |
this._unit = unit; | |
this._decoration = decoration; | |
} | |
,start: function() { | |
this._unit.get_effectAdded().add($bind(this,this.addEffect)); | |
this._unit.get_effectRemoved().add($bind(this,this.removeEffect)); | |
this._unit.get_killedSignal().add($bind(this,this.onKill)); | |
} | |
,finish: function() { | |
if(this._unit != null) { | |
this._unit.get_effectAdded().remove($bind(this,this.addEffect)); | |
this._unit.get_effectRemoved().remove($bind(this,this.removeEffect)); | |
this._unit.get_killedSignal().remove($bind(this,this.onKill)); | |
this.removeAllEffects(); | |
this._unit = null; | |
this._data = null; | |
this._decoration = null; | |
this._currentEffect = null; | |
this._currentEffects = []; | |
StaticExt.toPool(battle_$pack_location_unit_heroes_BattleUnitEffectsController.__pool,this); | |
} | |
} | |
,addEffect: function(effectViewType) { | |
var effectCtr = battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr.get(effectViewType); | |
if(effectCtr != null) { | |
var effect = effectCtr(this._data,this._unit,this._decoration); | |
effect._type = effectViewType; | |
effect.setup(this._holder); | |
this._currentEffects.push(effect); | |
} | |
} | |
,removeEffect: function(effectViewType) { | |
if(this._currentEffects != null) { | |
if(battle_$pack_location_unit_heroes_BattleUnitEffectsController._effectsCtr.get(effectViewType) != null) { | |
var i = this._currentEffects.length; | |
while(i-- != 0) if(this._currentEffects[i]._type == effectViewType) { | |
this._currentEffects[i].release(); | |
this._currentEffects.splice(i,1); | |
} | |
} | |
} | |
} | |
,removeAllEffects: function() { | |
if(this._currentEffects != null) { | |
var i = this._currentEffects.length; | |
while(i-- != 0) { | |
this._currentEffects[i].release(); | |
this._currentEffects.splice(i,1); | |
} | |
this._currentEffects = null; | |
} | |
} | |
,onKill: function(v) { | |
this.finish(); | |
} | |
,__class__: battle_$pack_location_unit_heroes_BattleUnitEffectsController | |
}); | |
var battle_$pack_location_unit_heroes_BattleUnitSkillsController = function() { | |
this._currentSkills = utils_ds__$JSMap_JSMap_$Impl_$._new(); | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.BattleUnitSkillsController"] = battle_$pack_location_unit_heroes_BattleUnitSkillsController; | |
battle_$pack_location_unit_heroes_BattleUnitSkillsController.__name__ = ["battle_pack","location","unit","heroes","BattleUnitSkillsController"]; | |
battle_$pack_location_unit_heroes_BattleUnitSkillsController._skillsCtr = null; | |
battle_$pack_location_unit_heroes_BattleUnitSkillsController.initSkills = function() { | |
battle_$pack_location_unit_heroes_BattleUnitSkillsController._skillsCtr = utils_ds__$JSMap_JSMap_$Impl_$._new(); | |
battle_$pack_location_unit_heroes_BattleUnitSkillsController._skillsCtr.set(epicwar_haxe_battle_skills_SkillType.STCannonBall,battle_$pack_location_unit_heroes_skills_CannonBallSkillController.create); | |
battle_$pack_location_unit_heroes_BattleUnitSkillsController._skillsCtr.set(epicwar_haxe_battle_skills_SkillType.STHide,battle_$pack_location_unit_heroes_skills_HideSkillController.create); | |
battle_$pack_location_unit_heroes_BattleUnitSkillsController._skillsCtr.set(epicwar_haxe_battle_skills_SkillType.STSpeedCircle,battle_$pack_location_unit_heroes_skills_BattleSongSkillController.create); | |
battle_$pack_location_unit_heroes_BattleUnitSkillsController._skillsCtr.set(epicwar_haxe_battle_skills_SkillType.STRunCircle,battle_$pack_location_unit_heroes_skills_RunCircleSkillController.create); | |
battle_$pack_location_unit_heroes_BattleUnitSkillsController._skillsCtr.set(epicwar_haxe_battle_skills_SkillType.STHealCircle,battle_$pack_location_unit_heroes_skills_HealingCircleSkillController.create); | |
battle_$pack_location_unit_heroes_BattleUnitSkillsController._skillsCtr.set(epicwar_haxe_battle_skills_SkillType.STAggroIllusion,battle_$pack_location_unit_heroes_skills_AggroIllusionSkillController.create); | |
battle_$pack_location_unit_heroes_BattleUnitSkillsController._skillsCtr.set(epicwar_haxe_battle_skills_SkillType.STAggro,battle_$pack_location_unit_heroes_skills_AggroSkillController.create); | |
battle_$pack_location_unit_heroes_BattleUnitSkillsController._skillsCtr.set(epicwar_haxe_battle_skills_SkillType.STResurrect,battle_$pack_location_unit_heroes_skills_ResurrectSkillController.create); | |
battle_$pack_location_unit_heroes_BattleUnitSkillsController._skillsCtr.set(epicwar_haxe_battle_skills_SkillType.STReborn,battle_$pack_location_unit_heroes_skills_RebornSkillController.create); | |
battle_$pack_location_unit_heroes_BattleUnitSkillsController._skillsCtr.set(epicwar_haxe_battle_skills_SkillType.STEmpowerDead,battle_$pack_location_unit_heroes_skills_EmpowerDeadSkillController.create); | |
battle_$pack_location_unit_heroes_BattleUnitSkillsController._skillsCtr.set(epicwar_haxe_battle_skills_SkillType.STPainDispatcher,battle_$pack_location_unit_heroes_skills_PainDispatcherSkillController.create); | |
battle_$pack_location_unit_heroes_BattleUnitSkillsController._skillsCtr.set(epicwar_haxe_battle_skills_SkillType.STTowerRush,battle_$pack_location_unit_heroes_skills_TowerRushSkillController.create); | |
battle_$pack_location_unit_heroes_BattleUnitSkillsController._skillsCtr.set(epicwar_haxe_battle_skills_SkillType.STRushEffect,battle_$pack_location_unit_heroes_skills_RushEffectSkillController.create); | |
battle_$pack_location_unit_heroes_BattleUnitSkillsController._skillsCtr.set(epicwar_haxe_battle_skills_SkillType.STWallCrush,battle_$pack_location_unit_heroes_skills_WallCrushSkillController.create); | |
battle_$pack_location_unit_heroes_BattleUnitSkillsController._skillsCtr.set(29,battle_$pack_location_unit_heroes_skills_SummonOnSpawnSkillController.create); | |
}; | |
battle_$pack_location_unit_heroes_BattleUnitSkillsController.create = function(view,unit,decoration) { | |
if(battle_$pack_location_unit_heroes_BattleUnitSkillsController._skillsCtr == null) { | |
battle_$pack_location_unit_heroes_BattleUnitSkillsController.initSkills(); | |
} | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_BattleUnitSkillsController.__pool,battle_$pack_location_unit_heroes_BattleUnitSkillsController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_BattleUnitSkillsController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_unit_heroes_BattleUnitSkillsController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
_unit: null | |
,_data: null | |
,_decoration: null | |
,_currentSkill: null | |
,_currentType: null | |
,_currentSkills: null | |
,init: function(view,unit,decoration) { | |
this._data = view; | |
this._unit = unit; | |
this._decoration = decoration; | |
} | |
,onKilled: function(v) { | |
this.finish(); | |
} | |
,start: function() { | |
this._unit.get_skillApplied().add($bind(this,this.updateSkills)); | |
this._unit.get_killedSignal().add($bind(this,this.onKilled)); | |
} | |
,finish: function() { | |
if(this._unit != null) { | |
this._unit.get_skillApplied().remove($bind(this,this.updateSkills)); | |
this._unit.get_killedSignal().remove($bind(this,this.onKilled)); | |
this.releaseCurrentSkill(); | |
this._currentSkills.clear(); | |
this._currentType = null; | |
this._unit = null; | |
this._data = null; | |
this._decoration = null; | |
StaticExt.toPool(battle_$pack_location_unit_heroes_BattleUnitSkillsController.__pool,this); | |
} | |
} | |
,updateSkills: function(skillType) { | |
if(this.hasSkills()) { | |
this.releaseCurrentSkill(); | |
this._currentType = skillType; | |
this._currentSkill = this._currentSkills.get(this._currentType) != null ? this._currentSkills.get(this._currentType) : (battle_$pack_location_unit_heroes_BattleUnitSkillsController._skillsCtr.get(this._currentType))(this._data,this._unit,this._decoration); | |
this._currentSkill.setup(this._holder); | |
} else if(this._currentSkill != null) { | |
this.releaseCurrentSkill(); | |
} | |
} | |
,releaseCurrentSkill: function() { | |
if(this._currentSkill != null) { | |
if(!this._currentSkill.getIsReleasable()) { | |
this._currentSkills.set(this._currentType,this._currentSkill); | |
this._currentSkill = null; | |
} else { | |
this._currentSkill.release(); | |
this._currentSkill = null; | |
} | |
} | |
} | |
,hasSkills: function() { | |
var skill = utils_ds__$JSMap_JSMap_$Impl_$.keys(battle_$pack_location_unit_heroes_BattleUnitSkillsController._skillsCtr); | |
while(skill.hasNext()) { | |
var skill1 = skill.next(); | |
if(this._unit.hasSkill(skill1)) { | |
return true; | |
} | |
} | |
return false; | |
} | |
,__class__: battle_$pack_location_unit_heroes_BattleUnitSkillsController | |
}); | |
var battle_$pack_location_unit_heroes_effects_BattleUnitEffectController = function() { | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.effects.BattleUnitEffectController"] = battle_$pack_location_unit_heroes_effects_BattleUnitEffectController; | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.__name__ = ["battle_pack","location","unit","heroes","effects","BattleUnitEffectController"]; | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
_unit: null | |
,_data: null | |
,_decoration: null | |
,_type: null | |
,initBase: function(view,unit,decoration) { | |
this._data = view; | |
this._unit = unit; | |
this._decoration = decoration; | |
} | |
,finish: function() { | |
this._unit = null; | |
this._data = null; | |
this._decoration = null; | |
} | |
,__class__: battle_$pack_location_unit_heroes_effects_BattleUnitEffectController | |
}); | |
var battle_$pack_location_unit_heroes_effects_AggroSkillEffectController = function() { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.effects.AggroSkillEffectController"] = battle_$pack_location_unit_heroes_effects_AggroSkillEffectController; | |
battle_$pack_location_unit_heroes_effects_AggroSkillEffectController.__name__ = ["battle_pack","location","unit","heroes","effects","AggroSkillEffectController"]; | |
battle_$pack_location_unit_heroes_effects_AggroSkillEffectController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_effects_AggroSkillEffectController.__pool,battle_$pack_location_unit_heroes_effects_AggroSkillEffectController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_effects_AggroSkillEffectController.__super__ = battle_$pack_location_unit_heroes_effects_BattleUnitEffectController; | |
battle_$pack_location_unit_heroes_effects_AggroSkillEffectController.prototype = $extend(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype,{ | |
_player: null | |
,_auraNode: null | |
,init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,start: function() { | |
var speed = battle_$pack_location_location_$view_SceneConfig.instance.gameSpeed.get_value(); | |
this._player = this._data.get_scene().createClipPlayer(null,"AggroSkillEff"); | |
this._player.set_speed(speed); | |
this._player.goTo(0); | |
this._player.setClipFromFile("units/palladin/protect_effect@protection_start"); | |
this._player.get_animationEnd().add($bind(this,this.onStartFinished)); | |
this._player.play(false); | |
this._auraNode = this._data.get_scene().createNode("auraEffectNode" + this._unit.get_id()); | |
this._auraNode.addController(battle_$pack_location_unit_view_UnitGPS.create(this._data,this._unit,this._decoration,0)); | |
this._auraNode.addChild(this._player); | |
this._data.get_airLayer().addChild(this._auraNode); | |
this._unit.get_killedSignal().add($bind(this,this.onDeath)); | |
} | |
,onStartFinished: function(v) { | |
if(this._player != null && !this._player.get_isReleased()) { | |
this._player.get_animationEnd().remove($bind(this,this.onStartFinished)); | |
this._player.setClipFromFile("units/palladin/protect_effect@protection"); | |
this._player.play(true); | |
} | |
} | |
,onDeath: function(v) { | |
if(this._player != null) { | |
if(!this._player.get_isReleased()) { | |
this._player.setClipFromFile("units/palladin/protect_effect@protection_end"); | |
this._player.get_animationEnd().add($bind(this,this.onAnimEnd)); | |
this._player.play(false); | |
} | |
} | |
} | |
,onAnimEnd: function(v) { | |
this.finish(); | |
} | |
,finish: function() { | |
this._unit.get_killedSignal().remove($bind(this,this.onDeath)); | |
if(this._player != null && !this._player.get_isReleased()) { | |
this._player.release(); | |
this._player = null; | |
if(this._auraNode != null) { | |
if(this._auraNode.get_parent() != null) { | |
this._auraNode.get_parent().removeChild(this._auraNode); | |
} | |
this._auraNode = null; | |
} | |
} | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_effects_AggroSkillEffectController.__pool,this); | |
} | |
} | |
,__class__: battle_$pack_location_unit_heroes_effects_AggroSkillEffectController | |
}); | |
var battle_$pack_location_unit_heroes_effects_AnifreezeCircleForUnitEffectController = function() { | |
this.EFFECT_COLOR = new com_progrestar_framework_core_types_Color(1.5,1.5,3,1); | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.effects.AnifreezeCircleForUnitEffectController"] = battle_$pack_location_unit_heroes_effects_AnifreezeCircleForUnitEffectController; | |
battle_$pack_location_unit_heroes_effects_AnifreezeCircleForUnitEffectController.__name__ = ["battle_pack","location","unit","heroes","effects","AnifreezeCircleForUnitEffectController"]; | |
battle_$pack_location_unit_heroes_effects_AnifreezeCircleForUnitEffectController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_effects_AnifreezeCircleForUnitEffectController.__pool,battle_$pack_location_unit_heroes_effects_AnifreezeCircleForUnitEffectController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_effects_AnifreezeCircleForUnitEffectController.__super__ = battle_$pack_location_unit_heroes_effects_BattleUnitEffectController; | |
battle_$pack_location_unit_heroes_effects_AnifreezeCircleForUnitEffectController.prototype = $extend(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype,{ | |
EFFECT_COLOR: null | |
,init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,start: function() { | |
motion_Actuate.tween(this._holder.get_transform(),0.5,{ "red" : this.EFFECT_COLOR.r, "green" : this.EFFECT_COLOR.g, "blue" : this.EFFECT_COLOR.b, "alpha" : this.EFFECT_COLOR.a}).repeat(-1).reflect(); | |
} | |
,finish: function() { | |
motion_Actuate.stop(this._holder.get_transform()); | |
this._holder.get_transform().setColor(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.BASE_COLOR); | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_effects_AnifreezeCircleForUnitEffectController.__pool,this); | |
} | |
} | |
,__class__: battle_$pack_location_unit_heroes_effects_AnifreezeCircleForUnitEffectController | |
}); | |
var battle_$pack_location_unit_heroes_effects_AnimateDeadEffectController = function() { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.effects.AnimateDeadEffectController"] = battle_$pack_location_unit_heroes_effects_AnimateDeadEffectController; | |
battle_$pack_location_unit_heroes_effects_AnimateDeadEffectController.__name__ = ["battle_pack","location","unit","heroes","effects","AnimateDeadEffectController"]; | |
battle_$pack_location_unit_heroes_effects_AnimateDeadEffectController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_effects_AnimateDeadEffectController.__pool,battle_$pack_location_unit_heroes_effects_AnimateDeadEffectController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_effects_AnimateDeadEffectController.__super__ = battle_$pack_location_unit_heroes_effects_BattleUnitEffectController; | |
battle_$pack_location_unit_heroes_effects_AnimateDeadEffectController.prototype = $extend(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype,{ | |
_player: null | |
,_auraNode: null | |
,init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,start: function() { | |
var speed = battle_$pack_location_location_$view_SceneConfig.instance.gameSpeed.get_value(); | |
this._player = this._data.get_scene().createClipPlayer(null,"AnimateDeadEff"); | |
this._player.set_speed(speed); | |
this._player.goTo(0); | |
this._player.setClipFromFile("units/skeleton/animate_dead_aura@animate_dead_aura_start"); | |
this._player.get_animationEnd().add($bind(this,this.onStartFinished)); | |
this._player.play(false); | |
this._auraNode = this._data.get_scene().createNode("auraEffectNode" + this._unit.get_id()); | |
this._auraNode.addController(battle_$pack_location_unit_view_UnitGPS.create(this._data,this._unit,this._decoration,0)); | |
this._auraNode.addChild(this._player); | |
this._data.get_backLayer().addChild(this._auraNode); | |
this._unit.get_killedSignal().add($bind(this,this.onDeath)); | |
} | |
,onStartFinished: function(v) { | |
if(this._player != null && !this._player.get_isReleased()) { | |
this._player.get_animationEnd().remove($bind(this,this.onStartFinished)); | |
this._player.setClipFromFile("units/skeleton/animate_dead_aura@animate_dead_aura"); | |
this._player.play(true); | |
} | |
} | |
,onDeath: function(v) { | |
if(this._player != null) { | |
if(!this._player.get_isReleased()) { | |
this._player.setClipFromFile("units/skeleton/animate_dead_aura@animate_dead_aura_end"); | |
this._player.get_animationEnd().add($bind(this,this.onAnimEnd)); | |
this._player.play(false); | |
} | |
} | |
} | |
,onAnimEnd: function(v) { | |
this.finish(); | |
} | |
,finish: function() { | |
this._unit.get_killedSignal().remove($bind(this,this.onDeath)); | |
if(this._player != null && !this._player.get_isReleased()) { | |
this._player.release(); | |
this._player = null; | |
} | |
if(this._auraNode != null) { | |
if(this._auraNode.get_parent() != null) { | |
this._auraNode.get_parent().removeChild(this._auraNode); | |
} | |
this._auraNode = null; | |
} | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_effects_AnimateDeadEffectController.__pool,this); | |
} | |
} | |
,__class__: battle_$pack_location_unit_heroes_effects_AnimateDeadEffectController | |
}); | |
var battle_$pack_location_unit_heroes_effects_AntifreezeCircleEffectController = function() { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.effects.AntifreezeCircleEffectController"] = battle_$pack_location_unit_heroes_effects_AntifreezeCircleEffectController; | |
battle_$pack_location_unit_heroes_effects_AntifreezeCircleEffectController.__name__ = ["battle_pack","location","unit","heroes","effects","AntifreezeCircleEffectController"]; | |
battle_$pack_location_unit_heroes_effects_AntifreezeCircleEffectController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_effects_AntifreezeCircleEffectController.__pool,battle_$pack_location_unit_heroes_effects_AntifreezeCircleEffectController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_effects_AntifreezeCircleEffectController.__super__ = battle_$pack_location_unit_heroes_effects_BattleUnitEffectController; | |
battle_$pack_location_unit_heroes_effects_AntifreezeCircleEffectController.prototype = $extend(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype,{ | |
_player: null | |
,_auraNode: null | |
,_animationPrefix: null | |
,init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,start: function() { | |
var speed = battle_$pack_location_location_$view_SceneConfig.instance.gameSpeed.get_value(); | |
this._animationPrefix = this._unit.get_unitData().getAnimationLink("Antifreeze",com_progrestar_game_hero_HeroSkinManager.getActiveSkinForHero(this._unit.get_unitData().get_unit())); | |
this._player = this._data.get_scene().createClipPlayer(null,"AntifreezeCirc"); | |
this._player.set_speed(speed); | |
this._player.goTo(0); | |
this._player.setClipFromFile(this._animationPrefix + "start"); | |
this._player.get_animationEnd().add($bind(this,this.onStartFinished)); | |
this._player.play(false); | |
this._auraNode = this._data.get_scene().createNode("antifreezeCircleNode" + this._unit.get_id()); | |
this._auraNode.addController(battle_$pack_location_unit_view_UnitGPS.create(this._data,this._unit,this._decoration,0)); | |
this._auraNode.addChild(this._player); | |
this._data.get_backLayer().addChild(this._auraNode); | |
this._unit.get_killedSignal().add($bind(this,this.onDeath)); | |
} | |
,onStartFinished: function(v) { | |
if(this._player != null && !this._player.get_isReleased()) { | |
this._player.get_animationEnd().remove($bind(this,this.onStartFinished)); | |
this._player.setClipFromFile(this._animationPrefix + "main"); | |
this._player.play(true); | |
} | |
} | |
,onDeath: function(v) { | |
if(this._player != null) { | |
if(!this._player.get_isReleased()) { | |
this._player.setClipFromFile(this._animationPrefix + "end"); | |
this._player.get_animationEnd().add($bind(this,this.onAnimEnd)); | |
this._player.play(false); | |
} | |
} | |
} | |
,onAnimEnd: function(v) { | |
this.finish(); | |
} | |
,finish: function() { | |
this._unit.get_killedSignal().remove($bind(this,this.onDeath)); | |
if(this._player != null && !this._player.get_isReleased()) { | |
this._player.release(); | |
this._player = null; | |
} | |
if(this._auraNode != null) { | |
if(this._auraNode.get_parent() != null) { | |
this._auraNode.get_parent().removeChild(this._auraNode); | |
} | |
this._auraNode = null; | |
} | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_effects_AntifreezeCircleEffectController.__pool,this); | |
} | |
} | |
,__class__: battle_$pack_location_unit_heroes_effects_AntifreezeCircleEffectController | |
}); | |
var battle_$pack_location_unit_heroes_effects_BattleSongEffectController = function() { | |
this.EFFECT_COLOR = new com_progrestar_framework_core_types_Color(2,2,2,1); | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.effects.BattleSongEffectController"] = battle_$pack_location_unit_heroes_effects_BattleSongEffectController; | |
battle_$pack_location_unit_heroes_effects_BattleSongEffectController.__name__ = ["battle_pack","location","unit","heroes","effects","BattleSongEffectController"]; | |
battle_$pack_location_unit_heroes_effects_BattleSongEffectController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_effects_BattleSongEffectController.__pool,battle_$pack_location_unit_heroes_effects_BattleSongEffectController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_effects_BattleSongEffectController.__super__ = battle_$pack_location_unit_heroes_effects_BattleUnitEffectController; | |
battle_$pack_location_unit_heroes_effects_BattleSongEffectController.prototype = $extend(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype,{ | |
EFFECT_COLOR: null | |
,init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,start: function() { | |
motion_Actuate.tween(this._holder.get_transform(),0.5,{ "red" : this.EFFECT_COLOR.r, "green" : this.EFFECT_COLOR.g, "blue" : this.EFFECT_COLOR.b, "alpha" : this.EFFECT_COLOR.a}).repeat(-1).reflect(); | |
} | |
,finish: function() { | |
motion_Actuate.stop(this._holder.get_transform()); | |
this._holder.get_transform().setColor(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.BASE_COLOR); | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_effects_BattleSongEffectController.__pool,this); | |
} | |
} | |
,__class__: battle_$pack_location_unit_heroes_effects_BattleSongEffectController | |
}); | |
var battle_$pack_location_unit_heroes_effects_FreezeEffectController = function() { | |
this.EFFECT_COLOR = new com_progrestar_framework_core_types_Color(0,5,255,0.25); | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.effects.FreezeEffectController"] = battle_$pack_location_unit_heroes_effects_FreezeEffectController; | |
battle_$pack_location_unit_heroes_effects_FreezeEffectController.__name__ = ["battle_pack","location","unit","heroes","effects","FreezeEffectController"]; | |
battle_$pack_location_unit_heroes_effects_FreezeEffectController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_effects_FreezeEffectController.__pool,battle_$pack_location_unit_heroes_effects_FreezeEffectController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_effects_FreezeEffectController.__super__ = battle_$pack_location_unit_heroes_effects_BattleUnitEffectController; | |
battle_$pack_location_unit_heroes_effects_FreezeEffectController.prototype = $extend(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype,{ | |
EFFECT_COLOR: null | |
,init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,start: function() { | |
motion_Actuate.stop(this.get_holder().get_transform()); | |
motion_Actuate.tween(this.get_holder().get_transform(),0.5,{ "red" : this.EFFECT_COLOR.r, "green" : this.EFFECT_COLOR.g, "blue" : this.EFFECT_COLOR.b, "alpha" : this.EFFECT_COLOR.a}).repeat(-1).reflect(); | |
} | |
,finish: function() { | |
motion_Actuate.stop(this.get_holder().get_transform()); | |
this.get_holder().get_transform().setColor(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.BASE_COLOR); | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_effects_FreezeEffectController.__pool,this); | |
} | |
} | |
,__class__: battle_$pack_location_unit_heroes_effects_FreezeEffectController | |
}); | |
var battle_$pack_location_unit_heroes_effects_FrenzyLowEffectController = function() { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.effects.FrenzyLowEffectController"] = battle_$pack_location_unit_heroes_effects_FrenzyLowEffectController; | |
battle_$pack_location_unit_heroes_effects_FrenzyLowEffectController.__name__ = ["battle_pack","location","unit","heroes","effects","FrenzyLowEffectController"]; | |
battle_$pack_location_unit_heroes_effects_FrenzyLowEffectController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_effects_FrenzyLowEffectController.__pool,battle_$pack_location_unit_heroes_effects_FrenzyLowEffectController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_effects_FrenzyLowEffectController.__super__ = battle_$pack_location_unit_heroes_effects_BattleUnitEffectController; | |
battle_$pack_location_unit_heroes_effects_FrenzyLowEffectController.prototype = $extend(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype,{ | |
init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,start: function() { | |
this._unit.changeAttackSoundOnce("ability2"); | |
} | |
,finish: function() { | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_effects_FrenzyLowEffectController.__pool,this); | |
} | |
} | |
,__class__: battle_$pack_location_unit_heroes_effects_FrenzyLowEffectController | |
}); | |
var battle_$pack_location_unit_heroes_effects_FrenzyMedEffectController = function() { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.effects.FrenzyMedEffectController"] = battle_$pack_location_unit_heroes_effects_FrenzyMedEffectController; | |
battle_$pack_location_unit_heroes_effects_FrenzyMedEffectController.__name__ = ["battle_pack","location","unit","heroes","effects","FrenzyMedEffectController"]; | |
battle_$pack_location_unit_heroes_effects_FrenzyMedEffectController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_effects_FrenzyMedEffectController.__pool,battle_$pack_location_unit_heroes_effects_FrenzyMedEffectController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_effects_FrenzyMedEffectController.__super__ = battle_$pack_location_unit_heroes_effects_BattleUnitEffectController; | |
battle_$pack_location_unit_heroes_effects_FrenzyMedEffectController.prototype = $extend(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype,{ | |
init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,start: function() { | |
this._unit.changeAttackSoundOnce("ability1"); | |
} | |
,finish: function() { | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_effects_FrenzyMedEffectController.__pool,this); | |
} | |
} | |
,__class__: battle_$pack_location_unit_heroes_effects_FrenzyMedEffectController | |
}); | |
var battle_$pack_location_unit_heroes_effects_HealCircleEffectController = function() { | |
this.EFFECT_COLOR = new com_progrestar_framework_core_types_Color(2,2,2,1); | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.effects.HealCircleEffectController"] = battle_$pack_location_unit_heroes_effects_HealCircleEffectController; | |
battle_$pack_location_unit_heroes_effects_HealCircleEffectController.__name__ = ["battle_pack","location","unit","heroes","effects","HealCircleEffectController"]; | |
battle_$pack_location_unit_heroes_effects_HealCircleEffectController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_effects_HealCircleEffectController.__pool,battle_$pack_location_unit_heroes_effects_HealCircleEffectController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_effects_HealCircleEffectController.__super__ = battle_$pack_location_unit_heroes_effects_BattleUnitEffectController; | |
battle_$pack_location_unit_heroes_effects_HealCircleEffectController.prototype = $extend(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype,{ | |
EFFECT_COLOR: null | |
,init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,start: function() { | |
motion_Actuate.tween(this._holder.get_transform(),0.5,{ "red" : this.EFFECT_COLOR.r, "green" : this.EFFECT_COLOR.g, "blue" : this.EFFECT_COLOR.b, "alpha" : this.EFFECT_COLOR.a}).repeat(-1).reflect(); | |
} | |
,finish: function() { | |
motion_Actuate.stop(this._holder.get_transform()); | |
this._holder.get_transform().setColor(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.BASE_COLOR); | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_effects_HealCircleEffectController.__pool,this); | |
} | |
} | |
,__class__: battle_$pack_location_unit_heroes_effects_HealCircleEffectController | |
}); | |
var battle_$pack_location_unit_heroes_effects_HealEffectController = function() { | |
this.EFFECT_COLOR = new com_progrestar_framework_core_types_Color(5,5,5,1); | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.effects.HealEffectController"] = battle_$pack_location_unit_heroes_effects_HealEffectController; | |
battle_$pack_location_unit_heroes_effects_HealEffectController.__name__ = ["battle_pack","location","unit","heroes","effects","HealEffectController"]; | |
battle_$pack_location_unit_heroes_effects_HealEffectController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_effects_HealEffectController.__pool,battle_$pack_location_unit_heroes_effects_HealEffectController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_effects_HealEffectController.__super__ = battle_$pack_location_unit_heroes_effects_BattleUnitEffectController; | |
battle_$pack_location_unit_heroes_effects_HealEffectController.prototype = $extend(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype,{ | |
EFFECT_COLOR: null | |
,init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,start: function() { | |
motion_Actuate.stop(this.get_holder().get_transform()); | |
motion_Actuate.tween(this.get_holder().get_transform(),0.25,{ "red" : this.EFFECT_COLOR.r, "green" : this.EFFECT_COLOR.g, "blue" : this.EFFECT_COLOR.b, "alpha" : this.EFFECT_COLOR.a}).repeat(-1).reflect(); | |
} | |
,finish: function() { | |
motion_Actuate.stop(this.get_holder().get_transform()); | |
this.get_holder().get_transform().setColor(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.BASE_COLOR); | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_effects_HealEffectController.__pool,this); | |
} | |
} | |
,__class__: battle_$pack_location_unit_heroes_effects_HealEffectController | |
}); | |
var battle_$pack_location_unit_heroes_effects_HideSkillEffectController = function() { | |
this.EFFECT_COLOR = new com_progrestar_framework_core_types_Color(2,2,2,1); | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.effects.HideSkillEffectController"] = battle_$pack_location_unit_heroes_effects_HideSkillEffectController; | |
battle_$pack_location_unit_heroes_effects_HideSkillEffectController.__name__ = ["battle_pack","location","unit","heroes","effects","HideSkillEffectController"]; | |
battle_$pack_location_unit_heroes_effects_HideSkillEffectController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_effects_HideSkillEffectController.__pool,battle_$pack_location_unit_heroes_effects_HideSkillEffectController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_effects_HideSkillEffectController.__super__ = battle_$pack_location_unit_heroes_effects_BattleUnitEffectController; | |
battle_$pack_location_unit_heroes_effects_HideSkillEffectController.prototype = $extend(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype,{ | |
EFFECT_COLOR: null | |
,_player: null | |
,_cloudEffectNode: null | |
,init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,start: function() { | |
this._unit.get_killedSignal().add($bind(this,this.onDeath)); | |
motion_Actuate.tween(this._holder.get_transform(),0.5,{ "red" : this.EFFECT_COLOR.r, "green" : this.EFFECT_COLOR.g, "blue" : this.EFFECT_COLOR.b, "alpha" : this.EFFECT_COLOR.a}).repeat(-1).reflect(); | |
var speed = battle_$pack_location_location_$view_SceneConfig.instance.gameSpeed.get_value(); | |
this._player = this._data.get_scene().createClipPlayer(null,"SkillEffectCtr"); | |
this._player.set_speed(speed); | |
this._player.goTo(0); | |
this._player.get_animationEnd().add($bind(this,this.onStartFinished)); | |
this._player.setClipFromFile("units/halloween/gryphon/cloud_effect_for_skill@cloud_effect_start"); | |
this._player.play(false); | |
this._cloudEffectNode = this._data.get_scene().createNode("cloudEffectNode" + this._unit.get_id()); | |
this._cloudEffectNode.addController(battle_$pack_location_unit_view_UnitGPS.create(this._data,this._unit,this._decoration,-400)); | |
this._cloudEffectNode.addChild(this._player); | |
this._data.get_airLayer().addChild(this._cloudEffectNode); | |
} | |
,onStartFinished: function(v) { | |
if(this._player != null && !this._player.get_isReleased()) { | |
this._player.get_animationEnd().remove($bind(this,this.onStartFinished)); | |
this._player.setClipFromFile("units/halloween/gryphon/cloud_effect_for_skill@cloud_effect"); | |
this._player.play(true); | |
} | |
} | |
,finish: function() { | |
motion_Actuate.stop(this._holder.get_transform()); | |
this._holder.get_transform().setColor(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.BASE_COLOR); | |
this._unit.get_killedSignal().remove($bind(this,this.onDeath)); | |
if(!this._player.get_isReleased()) { | |
this._player.get_animationEnd().remove($bind(this,this.onStartFinished)); | |
this._player.release(); | |
this._player = null; | |
} | |
if(this._cloudEffectNode != null) { | |
if(this._cloudEffectNode.get_parent() != null) { | |
this._cloudEffectNode.get_parent().removeChild(this._cloudEffectNode); | |
} | |
this._cloudEffectNode = null; | |
} | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_effects_HideSkillEffectController.__pool,this); | |
} | |
} | |
,onDeath: function(v) { | |
this.finish(); | |
} | |
,__class__: battle_$pack_location_unit_heroes_effects_HideSkillEffectController | |
}); | |
var battle_$pack_location_unit_heroes_effects_InvisibilityEffectController = function() { | |
this.EFFECT_COLOR = new com_progrestar_framework_core_types_Color(1,1,1,0.5); | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.effects.InvisibilityEffectController"] = battle_$pack_location_unit_heroes_effects_InvisibilityEffectController; | |
battle_$pack_location_unit_heroes_effects_InvisibilityEffectController.__name__ = ["battle_pack","location","unit","heroes","effects","InvisibilityEffectController"]; | |
battle_$pack_location_unit_heroes_effects_InvisibilityEffectController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_effects_InvisibilityEffectController.__pool,battle_$pack_location_unit_heroes_effects_InvisibilityEffectController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_effects_InvisibilityEffectController.__super__ = battle_$pack_location_unit_heroes_effects_BattleUnitEffectController; | |
battle_$pack_location_unit_heroes_effects_InvisibilityEffectController.prototype = $extend(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype,{ | |
EFFECT_COLOR: null | |
,init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,start: function() { | |
motion_Actuate.stop(this.get_holder().get_transform()); | |
motion_Actuate.tween(this.get_holder().get_transform(),0.5,{ "red" : this.EFFECT_COLOR.r, "green" : this.EFFECT_COLOR.g, "blue" : this.EFFECT_COLOR.b, "alpha" : this.EFFECT_COLOR.a}).repeat(-1).reflect(); | |
} | |
,finish: function() { | |
motion_Actuate.stop(this.get_holder().get_transform()); | |
this.get_holder().get_transform().setColor(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.BASE_COLOR); | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_effects_InvisibilityEffectController.__pool,this); | |
} | |
} | |
,__class__: battle_$pack_location_unit_heroes_effects_InvisibilityEffectController | |
}); | |
var battle_$pack_location_unit_heroes_effects_PainDispatcherEffectController = function() { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.effects.PainDispatcherEffectController"] = battle_$pack_location_unit_heroes_effects_PainDispatcherEffectController; | |
battle_$pack_location_unit_heroes_effects_PainDispatcherEffectController.__name__ = ["battle_pack","location","unit","heroes","effects","PainDispatcherEffectController"]; | |
battle_$pack_location_unit_heroes_effects_PainDispatcherEffectController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_effects_PainDispatcherEffectController.__pool,battle_$pack_location_unit_heroes_effects_PainDispatcherEffectController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_effects_PainDispatcherEffectController.__super__ = battle_$pack_location_unit_heroes_effects_BattleUnitEffectController; | |
battle_$pack_location_unit_heroes_effects_PainDispatcherEffectController.prototype = $extend(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype,{ | |
_player: null | |
,_auraNode: null | |
,init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,start: function() { | |
var speed = battle_$pack_location_location_$view_SceneConfig.instance.gameSpeed.get_value(); | |
this._player = this._data.get_scene().createClipPlayer(null,"PianDispatcherEff"); | |
this._player.set_speed(speed); | |
this._player.goTo(0); | |
this._player.setClipFromFile("units/ice_golem/pain_dispatcher@start"); | |
this._player.get_animationEnd().add($bind(this,this.onStartFinished)); | |
this._player.play(false); | |
this._auraNode = this._data.get_scene().createNode("painDispatcher" + this._unit.get_id()); | |
this._auraNode.addController(battle_$pack_location_unit_view_UnitGPS.create(this._data,this._unit,this._decoration,0)); | |
this._auraNode.addChild(this._player); | |
this._data.get_backLayer().addChild(this._auraNode); | |
this._unit.get_killedSignal().add($bind(this,this.onDeath)); | |
} | |
,onStartFinished: function(v) { | |
if(this._player != null && !this._player.get_isReleased()) { | |
this._player.get_animationEnd().remove($bind(this,this.onStartFinished)); | |
this._player.setClipFromFile("units/ice_golem/pain_dispatcher@main"); | |
this._player.play(true); | |
} | |
} | |
,onDeath: function(v) { | |
if(this._player != null) { | |
if(!this._player.get_isReleased()) { | |
this._player.setClipFromFile("units/ice_golem/pain_dispatcher@end"); | |
this._player.get_animationEnd().add($bind(this,this.onAnimEnd)); | |
this._player.play(false); | |
} | |
} | |
} | |
,onAnimEnd: function(v) { | |
this.finish(); | |
} | |
,finish: function() { | |
this._unit.get_killedSignal().remove($bind(this,this.onDeath)); | |
if(this._player != null && !this._player.get_isReleased()) { | |
this._player.release(); | |
this._player = null; | |
} | |
if(this._auraNode != null) { | |
if(this._auraNode.get_parent() != null) { | |
this._auraNode.get_parent().removeChild(this._auraNode); | |
} | |
this._auraNode = null; | |
} | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_effects_PainDispatcherEffectController.__pool,this); | |
} | |
} | |
,__class__: battle_$pack_location_unit_heroes_effects_PainDispatcherEffectController | |
}); | |
var battle_$pack_location_unit_heroes_effects_RageEffectController = function() { | |
this.EFFECT_COLOR = new com_progrestar_framework_core_types_Color(130,0,0,0.1); | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.effects.RageEffectController"] = battle_$pack_location_unit_heroes_effects_RageEffectController; | |
battle_$pack_location_unit_heroes_effects_RageEffectController.__name__ = ["battle_pack","location","unit","heroes","effects","RageEffectController"]; | |
battle_$pack_location_unit_heroes_effects_RageEffectController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_effects_RageEffectController.__pool,battle_$pack_location_unit_heroes_effects_RageEffectController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_effects_RageEffectController.__super__ = battle_$pack_location_unit_heroes_effects_BattleUnitEffectController; | |
battle_$pack_location_unit_heroes_effects_RageEffectController.prototype = $extend(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype,{ | |
EFFECT_COLOR: null | |
,init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,start: function() { | |
motion_Actuate.stop(this.get_holder().get_transform()); | |
motion_Actuate.tween(this.get_holder().get_transform(),0.5,{ "red" : this.EFFECT_COLOR.r, "green" : this.EFFECT_COLOR.g, "blue" : this.EFFECT_COLOR.b, "alpha" : this.EFFECT_COLOR.a}).repeat(-1).reflect(); | |
var clipController = StaticExt.kast(Std,this.get_holder().getControllerByClass(com_progrestar_framework_scene_extended_clip_ClipsSwitchController),com_progrestar_framework_scene_extended_clip_ClipsSwitchController); | |
if(clipController != null) { | |
clipController.scale(1.3); | |
} | |
} | |
,finish: function() { | |
motion_Actuate.stop(this.get_holder().get_transform()); | |
this.get_holder().get_transform().setColor(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.BASE_COLOR); | |
var clipController = StaticExt.kast(Std,this.get_holder().getControllerByClass(com_progrestar_framework_scene_extended_clip_ClipsSwitchController),com_progrestar_framework_scene_extended_clip_ClipsSwitchController); | |
if(clipController != null) { | |
clipController.scale(1); | |
} | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_effects_RageEffectController.__pool,this); | |
} | |
} | |
,__class__: battle_$pack_location_unit_heroes_effects_RageEffectController | |
}); | |
var battle_$pack_location_unit_heroes_effects_RebornEffectController = function() { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.effects.RebornEffectController"] = battle_$pack_location_unit_heroes_effects_RebornEffectController; | |
battle_$pack_location_unit_heroes_effects_RebornEffectController.__name__ = ["battle_pack","location","unit","heroes","effects","RebornEffectController"]; | |
battle_$pack_location_unit_heroes_effects_RebornEffectController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_effects_RebornEffectController.__pool,battle_$pack_location_unit_heroes_effects_RebornEffectController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_effects_RebornEffectController.__super__ = battle_$pack_location_unit_heroes_effects_BattleUnitEffectController; | |
battle_$pack_location_unit_heroes_effects_RebornEffectController.prototype = $extend(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype,{ | |
init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,start: function() { | |
this._unit.setState("Reborn"); | |
this._unit.playSoundEvent("reborn"); | |
} | |
,finish: function() { | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_effects_RebornEffectController.__pool,this); | |
} | |
} | |
,__class__: battle_$pack_location_unit_heroes_effects_RebornEffectController | |
}); | |
var battle_$pack_location_unit_heroes_effects_SpeedDownEffectController = function() { | |
this.EFFECT_COLOR = new com_progrestar_framework_core_types_Color(0,5,255,0.25); | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.effects.SpeedDownEffectController"] = battle_$pack_location_unit_heroes_effects_SpeedDownEffectController; | |
battle_$pack_location_unit_heroes_effects_SpeedDownEffectController.__name__ = ["battle_pack","location","unit","heroes","effects","SpeedDownEffectController"]; | |
battle_$pack_location_unit_heroes_effects_SpeedDownEffectController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_effects_SpeedDownEffectController.__pool,battle_$pack_location_unit_heroes_effects_SpeedDownEffectController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_effects_SpeedDownEffectController.__super__ = battle_$pack_location_unit_heroes_effects_BattleUnitEffectController; | |
battle_$pack_location_unit_heroes_effects_SpeedDownEffectController.prototype = $extend(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype,{ | |
EFFECT_COLOR: null | |
,init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,start: function() { | |
this._holder.get_transform().setColor(this.EFFECT_COLOR); | |
} | |
,finish: function() { | |
this._holder.get_transform().setColor(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.BASE_COLOR); | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_effects_SpeedDownEffectController.__pool,this); | |
} | |
} | |
,__class__: battle_$pack_location_unit_heroes_effects_SpeedDownEffectController | |
}); | |
var battle_$pack_location_unit_heroes_effects_SpriteEffectController = function() { | |
this._waiting = 0; | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.effects.SpriteEffectController"] = battle_$pack_location_unit_heroes_effects_SpriteEffectController; | |
battle_$pack_location_unit_heroes_effects_SpriteEffectController.__name__ = ["battle_pack","location","unit","heroes","effects","SpriteEffectController"]; | |
battle_$pack_location_unit_heroes_effects_SpriteEffectController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_effects_SpriteEffectController.__pool,battle_$pack_location_unit_heroes_effects_SpriteEffectController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_effects_SpriteEffectController.__super__ = battle_$pack_location_unit_heroes_effects_BattleUnitEffectController; | |
battle_$pack_location_unit_heroes_effects_SpriteEffectController.prototype = $extend(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype,{ | |
_playerOverlay: null | |
,_overlayNode: null | |
,_animationOverlayPrefix: null | |
,_playerUnderlay: null | |
,_undelayNode: null | |
,_animationUnderlayPrefix: null | |
,_waiting: null | |
,init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,start: function() { | |
var speed = battle_$pack_location_location_$view_SceneConfig.instance.gameSpeed.get_value(); | |
this._animationOverlayPrefix = this._unit.get_unitData().getAnimationLink("AbilityOverlaySprite",com_progrestar_game_hero_HeroSkinManager.getActiveSkinForHero(this._unit.get_unitData().get_unit())); | |
if(this._animationOverlayPrefix != null) { | |
this._playerOverlay = this._data.get_scene().createClipPlayer(null,"SpriteEffCtr"); | |
this._playerOverlay.set_speed(speed); | |
this._playerOverlay.goTo(0); | |
this._playerOverlay.setClipFromFile(this._animationOverlayPrefix + "_start"); | |
this._playerOverlay.get_animationEnd().add($bind(this,this.onOverlayStartFinished)); | |
this._playerOverlay.play(false); | |
this._overlayNode = this._data.get_scene().createNode("abilityOverlaySpriteNode" + this._unit.get_id()); | |
this._overlayNode.addController(battle_$pack_location_unit_view_UnitGPS.create(this._data,this._unit,this._decoration,0)); | |
this._overlayNode.addChild(this._playerOverlay); | |
this._data.get_airLayer().addChild(this._overlayNode); | |
} | |
this._animationUnderlayPrefix = this._unit.get_unitData().getAnimationLink("AbilityUnderlaySprite",com_progrestar_game_hero_HeroSkinManager.getActiveSkinForHero(this._unit.get_unitData().get_unit())); | |
if(this._animationUnderlayPrefix != null) { | |
this._playerUnderlay = this._data.get_scene().createClipPlayer(null,"SpriteEffCtr2"); | |
this._playerUnderlay.set_speed(speed); | |
this._playerUnderlay.goTo(0); | |
this._playerUnderlay.setClipFromFile(this._animationUnderlayPrefix + "_start"); | |
this._playerUnderlay.get_animationEnd().add($bind(this,this.onUnderlayStartFinished)); | |
this._playerUnderlay.play(false); | |
this._undelayNode = this._data.get_scene().createNode("abilityUnderlaySpriteNode" + this._unit.get_id()); | |
this._undelayNode.addController(battle_$pack_location_unit_view_UnitGPS.create(this._data,this._unit,this._decoration,0)); | |
this._undelayNode.addChild(this._playerUnderlay); | |
this._data.get_backLayer().addChild(this._undelayNode); | |
} | |
this._unit.get_killedSignal().add($bind(this,this.onDeath)); | |
} | |
,onOverlayStartFinished: function(v) { | |
if(this._playerOverlay != null && !this._playerOverlay.get_isReleased()) { | |
this._playerOverlay.get_animationEnd().remove($bind(this,this.onOverlayStartFinished)); | |
this._playerOverlay.setClipFromFile(this._animationOverlayPrefix + "_loop"); | |
this._playerOverlay.play(true); | |
} | |
} | |
,onUnderlayStartFinished: function(v) { | |
if(this._playerUnderlay != null && !this._playerUnderlay.get_isReleased()) { | |
this._playerUnderlay.get_animationEnd().remove($bind(this,this.onUnderlayStartFinished)); | |
this._playerUnderlay.setClipFromFile(this._animationUnderlayPrefix + "_loop"); | |
this._playerUnderlay.play(true); | |
} | |
} | |
,onDeath: function(v) { | |
this.finish(); | |
} | |
,finish: function() { | |
this._unit.get_killedSignal().remove($bind(this,this.onDeath)); | |
if(this._playerOverlay != null && !this._playerOverlay.get_isReleased()) { | |
this._waiting++; | |
this._playerOverlay.setClipFromFile(this._animationOverlayPrefix + "_end"); | |
this._playerOverlay.get_animationEnd().add($bind(this,this.onOverlayEndFinished)); | |
this._playerOverlay.play(false); | |
} | |
if(this._playerUnderlay != null && !this._playerUnderlay.get_isReleased()) { | |
this._waiting++; | |
this._playerUnderlay.setClipFromFile(this._animationUnderlayPrefix + "_end"); | |
this._playerUnderlay.get_animationEnd().add($bind(this,this.onUnderlayEndFinished)); | |
this._playerUnderlay.play(false); | |
} | |
this.tryPool(); | |
} | |
,onOverlayEndFinished: function(v) { | |
if(this._playerOverlay != null && !this._playerOverlay.get_isReleased()) { | |
this._playerOverlay.release(); | |
this._playerOverlay = null; | |
} | |
if(this._overlayNode != null) { | |
if(this._overlayNode.get_parent() != null) { | |
this._overlayNode.get_parent().removeChild(this._overlayNode); | |
} | |
this._overlayNode = null; | |
} | |
this.tryPool(); | |
} | |
,onUnderlayEndFinished: function(v) { | |
if(this._playerUnderlay != null && !this._playerUnderlay.get_isReleased()) { | |
this._playerUnderlay.release(); | |
this._playerUnderlay = null; | |
} | |
if(this._undelayNode != null) { | |
if(this._undelayNode.get_parent() != null) { | |
this._undelayNode.get_parent().removeChild(this._undelayNode); | |
} | |
this._undelayNode = null; | |
} | |
this.tryPool(); | |
} | |
,tryPool: function() { | |
if(this._waiting == 0 && this._unit != null) { | |
this._animationOverlayPrefix = null; | |
this._animationUnderlayPrefix = null; | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_effects_SpriteEffectController.__pool,this); | |
} | |
} | |
,__class__: battle_$pack_location_unit_heroes_effects_SpriteEffectController | |
}); | |
var battle_$pack_location_unit_heroes_effects_SupernovaEffectController = function() { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.effects.SupernovaEffectController"] = battle_$pack_location_unit_heroes_effects_SupernovaEffectController; | |
battle_$pack_location_unit_heroes_effects_SupernovaEffectController.__name__ = ["battle_pack","location","unit","heroes","effects","SupernovaEffectController"]; | |
battle_$pack_location_unit_heroes_effects_SupernovaEffectController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_effects_SupernovaEffectController.__pool,battle_$pack_location_unit_heroes_effects_SupernovaEffectController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_effects_SupernovaEffectController.__super__ = battle_$pack_location_unit_heroes_effects_BattleUnitEffectController; | |
battle_$pack_location_unit_heroes_effects_SupernovaEffectController.prototype = $extend(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype,{ | |
init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,start: function() { | |
this._unit.setState("Supernova"); | |
this._unit.playSoundEvent("ability1"); | |
} | |
,finish: function() { | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_effects_SupernovaEffectController.__pool,this); | |
} | |
} | |
,__class__: battle_$pack_location_unit_heroes_effects_SupernovaEffectController | |
}); | |
var battle_$pack_location_unit_heroes_effects_TowerRushEffectController = function() { | |
this.EFFECT_COLOR = new com_progrestar_framework_core_types_Color(2,2,1.2,0.9); | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.effects.TowerRushEffectController"] = battle_$pack_location_unit_heroes_effects_TowerRushEffectController; | |
battle_$pack_location_unit_heroes_effects_TowerRushEffectController.__name__ = ["battle_pack","location","unit","heroes","effects","TowerRushEffectController"]; | |
battle_$pack_location_unit_heroes_effects_TowerRushEffectController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_effects_TowerRushEffectController.__pool,battle_$pack_location_unit_heroes_effects_TowerRushEffectController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_effects_TowerRushEffectController.__super__ = battle_$pack_location_unit_heroes_effects_BattleUnitEffectController; | |
battle_$pack_location_unit_heroes_effects_TowerRushEffectController.prototype = $extend(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype,{ | |
EFFECT_COLOR: null | |
,init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,start: function() { | |
motion_Actuate.tween(this._holder.get_transform(),0.1,{ "red" : this.EFFECT_COLOR.r, "green" : this.EFFECT_COLOR.g, "blue" : this.EFFECT_COLOR.b, "alpha" : this.EFFECT_COLOR.a}).repeat(-1).reflect(); | |
this._unit.get_killedSignal().add($bind(this,this.onDeath)); | |
} | |
,finish: function() { | |
motion_Actuate.stop(this._holder.get_transform()); | |
this._holder.get_transform().setColor(battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.BASE_COLOR); | |
this._unit.get_killedSignal().remove($bind(this,this.onDeath)); | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_effects_BattleUnitEffectController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_effects_TowerRushEffectController.__pool,this); | |
} | |
} | |
,onDeath: function(v) { | |
this.finish(); | |
} | |
,__class__: battle_$pack_location_unit_heroes_effects_TowerRushEffectController | |
}); | |
var battle_$pack_location_unit_heroes_skills_BattleUnitSkillController = function() { | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.skills.BattleUnitSkillController"] = battle_$pack_location_unit_heroes_skills_BattleUnitSkillController; | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.__name__ = ["battle_pack","location","unit","heroes","skills","BattleUnitSkillController"]; | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
_unit: null | |
,_view: null | |
,_decoration: null | |
,initBase: function(view,unit,decoration) { | |
this._view = view; | |
this._unit = unit; | |
this._decoration = decoration; | |
} | |
,finish: function() { | |
this._view = null; | |
this._unit = null; | |
this._decoration = null; | |
} | |
,getIsReleasable: function() { | |
return true; | |
} | |
,__class__: battle_$pack_location_unit_heroes_skills_BattleUnitSkillController | |
}); | |
var battle_$pack_location_unit_heroes_skills_AggroIllusionSkillController = function() { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.skills.AggroIllusionSkillController"] = battle_$pack_location_unit_heroes_skills_AggroIllusionSkillController; | |
battle_$pack_location_unit_heroes_skills_AggroIllusionSkillController.__name__ = ["battle_pack","location","unit","heroes","skills","AggroIllusionSkillController"]; | |
battle_$pack_location_unit_heroes_skills_AggroIllusionSkillController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_skills_AggroIllusionSkillController.__pool,battle_$pack_location_unit_heroes_skills_AggroIllusionSkillController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_skills_AggroIllusionSkillController.__super__ = battle_$pack_location_unit_heroes_skills_BattleUnitSkillController; | |
battle_$pack_location_unit_heroes_skills_AggroIllusionSkillController.prototype = $extend(battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype,{ | |
init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,finish: function() { | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_skills_AggroIllusionSkillController.__pool,this); | |
} | |
} | |
,start: function() { | |
this._unit.setState("AggroIllusionSkill"); | |
this._unit.playSoundEvent("ability1"); | |
} | |
,__class__: battle_$pack_location_unit_heroes_skills_AggroIllusionSkillController | |
}); | |
var battle_$pack_location_unit_heroes_skills_AggroSkillController = function() { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.skills.AggroSkillController"] = battle_$pack_location_unit_heroes_skills_AggroSkillController; | |
battle_$pack_location_unit_heroes_skills_AggroSkillController.__name__ = ["battle_pack","location","unit","heroes","skills","AggroSkillController"]; | |
battle_$pack_location_unit_heroes_skills_AggroSkillController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_skills_AggroSkillController.__pool,battle_$pack_location_unit_heroes_skills_AggroSkillController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_skills_AggroSkillController.__super__ = battle_$pack_location_unit_heroes_skills_BattleUnitSkillController; | |
battle_$pack_location_unit_heroes_skills_AggroSkillController.prototype = $extend(battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype,{ | |
init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,start: function() { | |
this._unit.setState("AggroSkill"); | |
this._unit.playSoundEvent("ability3"); | |
} | |
,finish: function() { | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_skills_AggroSkillController.__pool,this); | |
} | |
} | |
,getIsReleasable: function() { | |
return false; | |
} | |
,__class__: battle_$pack_location_unit_heroes_skills_AggroSkillController | |
}); | |
var battle_$pack_location_unit_heroes_skills_BattleSongSkillController = function() { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.skills.BattleSongSkillController"] = battle_$pack_location_unit_heroes_skills_BattleSongSkillController; | |
battle_$pack_location_unit_heroes_skills_BattleSongSkillController.__name__ = ["battle_pack","location","unit","heroes","skills","BattleSongSkillController"]; | |
battle_$pack_location_unit_heroes_skills_BattleSongSkillController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_skills_BattleSongSkillController.__pool,battle_$pack_location_unit_heroes_skills_BattleSongSkillController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_skills_BattleSongSkillController.__super__ = battle_$pack_location_unit_heroes_skills_BattleUnitSkillController; | |
battle_$pack_location_unit_heroes_skills_BattleSongSkillController.prototype = $extend(battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype,{ | |
init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,finish: function() { | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_skills_BattleSongSkillController.__pool,this); | |
} | |
} | |
,start: function() { | |
this._unit.setState("BattleSong"); | |
this._unit.playSoundEvent("ability1"); | |
} | |
,__class__: battle_$pack_location_unit_heroes_skills_BattleSongSkillController | |
}); | |
var battle_$pack_location_unit_heroes_skills_CannonBallSkillController = function() { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.skills.CannonBallSkillController"] = battle_$pack_location_unit_heroes_skills_CannonBallSkillController; | |
battle_$pack_location_unit_heroes_skills_CannonBallSkillController.__name__ = ["battle_pack","location","unit","heroes","skills","CannonBallSkillController"]; | |
battle_$pack_location_unit_heroes_skills_CannonBallSkillController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_skills_CannonBallSkillController.__pool,battle_$pack_location_unit_heroes_skills_CannonBallSkillController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_skills_CannonBallSkillController.__super__ = battle_$pack_location_unit_heroes_skills_BattleUnitSkillController; | |
battle_$pack_location_unit_heroes_skills_CannonBallSkillController.prototype = $extend(battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype,{ | |
init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,finish: function() { | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_skills_CannonBallSkillController.__pool,this); | |
} | |
} | |
,start: function() { | |
this._unit.changeAttackSoundOnce("ability1"); | |
} | |
,__class__: battle_$pack_location_unit_heroes_skills_CannonBallSkillController | |
}); | |
var battle_$pack_location_unit_heroes_skills_EmpowerDeadSkillController = function() { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.skills.EmpowerDeadSkillController"] = battle_$pack_location_unit_heroes_skills_EmpowerDeadSkillController; | |
battle_$pack_location_unit_heroes_skills_EmpowerDeadSkillController.__name__ = ["battle_pack","location","unit","heroes","skills","EmpowerDeadSkillController"]; | |
battle_$pack_location_unit_heroes_skills_EmpowerDeadSkillController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_skills_EmpowerDeadSkillController.__pool,battle_$pack_location_unit_heroes_skills_EmpowerDeadSkillController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_skills_EmpowerDeadSkillController.__super__ = battle_$pack_location_unit_heroes_skills_BattleUnitSkillController; | |
battle_$pack_location_unit_heroes_skills_EmpowerDeadSkillController.prototype = $extend(battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype,{ | |
init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,finish: function() { | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_skills_EmpowerDeadSkillController.__pool,this); | |
} | |
} | |
,start: function() { | |
this._unit.setState("EmpowerDead"); | |
} | |
,__class__: battle_$pack_location_unit_heroes_skills_EmpowerDeadSkillController | |
}); | |
var battle_$pack_location_unit_heroes_skills_HealingCircleSkillController = function() { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.skills.HealingCircleSkillController"] = battle_$pack_location_unit_heroes_skills_HealingCircleSkillController; | |
battle_$pack_location_unit_heroes_skills_HealingCircleSkillController.__name__ = ["battle_pack","location","unit","heroes","skills","HealingCircleSkillController"]; | |
battle_$pack_location_unit_heroes_skills_HealingCircleSkillController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_skills_HealingCircleSkillController.__pool,battle_$pack_location_unit_heroes_skills_HealingCircleSkillController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_skills_HealingCircleSkillController.__super__ = battle_$pack_location_unit_heroes_skills_BattleUnitSkillController; | |
battle_$pack_location_unit_heroes_skills_HealingCircleSkillController.prototype = $extend(battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype,{ | |
init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,finish: function() { | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_skills_HealingCircleSkillController.__pool,this); | |
} | |
} | |
,start: function() { | |
this._unit.setState("HealingCircle"); | |
this._unit.playSoundEvent("ability1"); | |
} | |
,__class__: battle_$pack_location_unit_heroes_skills_HealingCircleSkillController | |
}); | |
var battle_$pack_location_unit_heroes_skills_HideSkillController = function() { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.skills.HideSkillController"] = battle_$pack_location_unit_heroes_skills_HideSkillController; | |
battle_$pack_location_unit_heroes_skills_HideSkillController.__name__ = ["battle_pack","location","unit","heroes","skills","HideSkillController"]; | |
battle_$pack_location_unit_heroes_skills_HideSkillController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_skills_HideSkillController.__pool,battle_$pack_location_unit_heroes_skills_HideSkillController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_skills_HideSkillController.__super__ = battle_$pack_location_unit_heroes_skills_BattleUnitSkillController; | |
battle_$pack_location_unit_heroes_skills_HideSkillController.prototype = $extend(battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype,{ | |
init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,finish: function() { | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_skills_HideSkillController.__pool,this); | |
} | |
} | |
,start: function() { | |
this._unit.setState("HideSkill"); | |
this._unit.playSoundEvent("ability2"); | |
} | |
,__class__: battle_$pack_location_unit_heroes_skills_HideSkillController | |
}); | |
var battle_$pack_location_unit_heroes_skills_PainDispatcherSkillController = function() { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.skills.PainDispatcherSkillController"] = battle_$pack_location_unit_heroes_skills_PainDispatcherSkillController; | |
battle_$pack_location_unit_heroes_skills_PainDispatcherSkillController.__name__ = ["battle_pack","location","unit","heroes","skills","PainDispatcherSkillController"]; | |
battle_$pack_location_unit_heroes_skills_PainDispatcherSkillController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_skills_PainDispatcherSkillController.__pool,battle_$pack_location_unit_heroes_skills_PainDispatcherSkillController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_skills_PainDispatcherSkillController.__super__ = battle_$pack_location_unit_heroes_skills_BattleUnitSkillController; | |
battle_$pack_location_unit_heroes_skills_PainDispatcherSkillController.prototype = $extend(battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype,{ | |
_lineNode: null | |
,_currentTarget: null | |
,_glowTopNode: null | |
,_glowBottomNode: null | |
,_playerTop: null | |
,_playerBottom: null | |
,init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,start: function() { | |
var skill = this._unit.getSkillByType(epicwar_haxe_battle_skills_SkillType.STPainDispatcher); | |
var skillData = skill != null ? skill.get_data() : null; | |
if(skillData != null && skillData.targetId != 0) { | |
this.clearLine(); | |
this.clearCurrentTarget(); | |
this._currentTarget = StaticExt.kast(Std,this._view.get_location().getObject(skillData.targetId),battle_$pack_location_unit_UnitInstance); | |
if(this._currentTarget != null) { | |
this._currentTarget.get_hpChanged().add($bind(this,this.check)); | |
this._currentTarget.get_killedSignal().add($bind(this,this.check)); | |
this._lineNode = this._view.get_scene().createNode("painDispatcherLine" + this._unit.get_id()); | |
this._lineNode.addController(battle_$pack_location_unit_view_UnitGPS.create(this._view,this._unit,this._decoration,0)); | |
this._lineNode.addController(battle_$pack_location_unit_view_PainDispatcherLine.create(this._view,this._decoration,this._unit,this._currentTarget)); | |
this._view.get_airLayer().addChild(this._lineNode); | |
this._unit.playSoundEvent("ability1"); | |
} | |
} else { | |
this.clearLine(); | |
this.clearCurrentTarget(); | |
} | |
this.createGlow(); | |
this._unit.get_hpChanged().add($bind(this,this.check)); | |
this._unit.get_killedSignal().add($bind(this,this.check)); | |
} | |
,check: function(v) { | |
if(this._currentTarget == null || this._unit.get_hp() == 0 || this._currentTarget.get_hp() == 0) { | |
this.clearAll(); | |
} | |
} | |
,clearAll: function() { | |
this.clearLine(); | |
this.clearCurrentTarget(); | |
this.clearGlow(); | |
this._unit.get_hpChanged().remove($bind(this,this.check)); | |
this._unit.get_killedSignal().remove($bind(this,this.check)); | |
} | |
,clearLine: function() { | |
if(this._lineNode != null && this._lineNode.get_container() != null) { | |
this._lineNode.release(); | |
this._lineNode = null; | |
} | |
} | |
,clearCurrentTarget: function() { | |
if(this._currentTarget != null) { | |
this._currentTarget.get_hpChanged().remove($bind(this,this.check)); | |
this._currentTarget.get_killedSignal().remove($bind(this,this.check)); | |
this._currentTarget = null; | |
} | |
} | |
,finish: function() { | |
this.clearAll(); | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_skills_PainDispatcherSkillController.__pool,this); | |
} | |
} | |
,getIsReleasable: function() { | |
return false; | |
} | |
,createGlow: function() { | |
var speed = battle_$pack_location_location_$view_SceneConfig.instance.gameSpeed.get_value(); | |
this._playerBottom = this._view.get_scene().createClipPlayer(null,"PainDispatcherSkill1"); | |
this._playerBottom.set_speed(speed); | |
this._playerBottom.goTo(0); | |
this._glowBottomNode = this._view.get_scene().createNode("painGlowNodeBottom" + this._unit.get_id()); | |
this._glowBottomNode.addController(battle_$pack_location_unit_view_UnitGpsWithSubnode.create(this._view,this._unit,this._decoration)); | |
this._glowBottomNode.addChild(this._playerBottom); | |
this._view.get_groundLayer().addChild(this._glowBottomNode); | |
this._playerTop = this._view.get_scene().createClipPlayer(null,"PainDispatcherSkill2"); | |
this._playerTop.set_speed(speed); | |
this._playerTop.goTo(0); | |
this._glowTopNode = this._view.get_scene().createNode("painGlowNodeTop" + this._unit.get_id()); | |
this._glowTopNode.addController(battle_$pack_location_unit_view_UnitGpsWithSubnode.create(this._view,this._unit,this._decoration)); | |
this._glowTopNode.addChild(this._playerTop); | |
this._view.get_airLayer().addChild(this._glowTopNode); | |
this._unit.get_hpChanged().add($bind(this,this.showGlow)); | |
} | |
,showGlow: function(hpDelta) { | |
if(this._playerTop != null && !this._playerTop.get_isReleased()) { | |
this._playerTop.setClipFromFile("units/ice_golem/anim@glowAbility_top" + this.getGlowPowerIndex(hpDelta | 0)); | |
this._playerTop.get_animationEnd().add($bind(this,this.onGlowTopFinished)); | |
this._playerTop.play(false); | |
} | |
if(this._playerBottom != null && !this._playerBottom.get_isReleased()) { | |
this._playerBottom.setClipFromFile("units/ice_golem/anim@glowAbility_bottom" + this.getGlowPowerIndex(hpDelta | 0)); | |
this._playerBottom.get_animationEnd().add($bind(this,this.onGlowBottomFinished)); | |
this._playerBottom.play(false); | |
} | |
} | |
,getGlowPowerIndex: function(hpDelta) { | |
if(hpDelta > -100) { | |
return "1"; | |
} | |
if(hpDelta > -1000) { | |
return "2"; | |
} | |
return "3"; | |
} | |
,onGlowTopFinished: function(v) { | |
this.clearGlow(); | |
} | |
,onGlowBottomFinished: function(v) { | |
this.clearGlow(); | |
} | |
,clearGlow: function() { | |
this._unit.get_hpChanged().remove($bind(this,this.showGlow)); | |
if(this._playerTop != null && !this._playerTop.get_isReleased()) { | |
this._playerTop.release(); | |
this._playerTop = null; | |
} | |
if(this._glowTopNode != null) { | |
if(this._glowTopNode.get_parent() != null) { | |
this._glowTopNode.get_parent().removeChild(this._glowTopNode); | |
} | |
if(this._glowTopNode.get_container() != null) { | |
this._glowTopNode.release(); | |
} | |
this._glowTopNode = null; | |
} | |
if(this._playerBottom != null && !this._playerBottom.get_isReleased()) { | |
this._playerBottom.release(); | |
this._playerBottom = null; | |
} | |
if(this._glowBottomNode != null) { | |
if(this._glowBottomNode.get_parent() != null) { | |
this._glowBottomNode.get_parent().removeChild(this._glowBottomNode); | |
} | |
if(this._glowBottomNode.get_container() != null) { | |
this._glowBottomNode.release(); | |
} | |
this._glowBottomNode = null; | |
} | |
} | |
,__class__: battle_$pack_location_unit_heroes_skills_PainDispatcherSkillController | |
}); | |
var battle_$pack_location_unit_heroes_skills_RebornSkillController = function() { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.skills.RebornSkillController"] = battle_$pack_location_unit_heroes_skills_RebornSkillController; | |
battle_$pack_location_unit_heroes_skills_RebornSkillController.__name__ = ["battle_pack","location","unit","heroes","skills","RebornSkillController"]; | |
battle_$pack_location_unit_heroes_skills_RebornSkillController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_skills_RebornSkillController.__pool,battle_$pack_location_unit_heroes_skills_RebornSkillController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_skills_RebornSkillController.__super__ = battle_$pack_location_unit_heroes_skills_BattleUnitSkillController; | |
battle_$pack_location_unit_heroes_skills_RebornSkillController.prototype = $extend(battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype,{ | |
init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,finish: function() { | |
if(this._unit != null) { | |
this._unit.get_killedSignal().remove($bind(this,this.onDeath)); | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_skills_RebornSkillController.__pool,this); | |
} | |
} | |
,start: function() { | |
if(this._unit.get_hp() == 0) { | |
this.onDeath(); | |
} else { | |
this._unit.get_killedSignal().add($bind(this,this.onDeath)); | |
} | |
} | |
,onDeath: function(v) { | |
if(this._unit != null) { | |
this._unit.get_killedSignal().remove($bind(this,this.onDeath)); | |
this._unit.setState("Reborn"); | |
} | |
} | |
,__class__: battle_$pack_location_unit_heroes_skills_RebornSkillController | |
}); | |
var battle_$pack_location_unit_heroes_skills_ResurrectSkillController = function() { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.skills.ResurrectSkillController"] = battle_$pack_location_unit_heroes_skills_ResurrectSkillController; | |
battle_$pack_location_unit_heroes_skills_ResurrectSkillController.__name__ = ["battle_pack","location","unit","heroes","skills","ResurrectSkillController"]; | |
battle_$pack_location_unit_heroes_skills_ResurrectSkillController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_skills_ResurrectSkillController.__pool,battle_$pack_location_unit_heroes_skills_ResurrectSkillController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_skills_ResurrectSkillController.__super__ = battle_$pack_location_unit_heroes_skills_BattleUnitSkillController; | |
battle_$pack_location_unit_heroes_skills_ResurrectSkillController.prototype = $extend(battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype,{ | |
init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,finish: function() { | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_skills_ResurrectSkillController.__pool,this); | |
} | |
} | |
,start: function() { | |
this._unit.setState("ResurrectSkill"); | |
this._unit.playSoundEvent("ability2"); | |
} | |
,__class__: battle_$pack_location_unit_heroes_skills_ResurrectSkillController | |
}); | |
var battle_$pack_location_unit_heroes_skills_RunCircleSkillController = function() { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.skills.RunCircleSkillController"] = battle_$pack_location_unit_heroes_skills_RunCircleSkillController; | |
battle_$pack_location_unit_heroes_skills_RunCircleSkillController.__name__ = ["battle_pack","location","unit","heroes","skills","RunCircleSkillController"]; | |
battle_$pack_location_unit_heroes_skills_RunCircleSkillController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_skills_RunCircleSkillController.__pool,battle_$pack_location_unit_heroes_skills_RunCircleSkillController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_skills_RunCircleSkillController.__super__ = battle_$pack_location_unit_heroes_skills_BattleUnitSkillController; | |
battle_$pack_location_unit_heroes_skills_RunCircleSkillController.prototype = $extend(battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype,{ | |
init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,_player: null | |
,_back: null | |
,start: function() { | |
this._unit.setState("RunCircle"); | |
this._unit.playSoundEvent("ability2"); | |
var speed = battle_$pack_location_location_$view_SceneConfig.instance.gameSpeed.get_value(); | |
this._player = this._view.get_scene().createClipPlayer(null,"RuneCircleSkill"); | |
this._player.set_speed(speed); | |
this._player.goTo(0); | |
this._player.get_animationEnd().add($bind(this,this.onStartFinished)); | |
this._player.setClipFromFile("units/succubus/run_circle_aura@FireGroundAnim"); | |
this._player.play(false); | |
this._back = this._view.get_scene().createNode("runCircleNode" + this._unit.get_id()); | |
this._back.addController(battle_$pack_location_unit_view_UnitGPS.create(this._view,this._unit,this._decoration,0)); | |
this._back.addChild(this._player); | |
this._view.get_backLayer().addChild(this._back); | |
} | |
,onStartFinished: function(v) { | |
if(this._player != null && !this._player.get_isReleased()) { | |
this.fullFinish(); | |
} | |
} | |
,finish: function() { | |
this.fullFinish(); | |
} | |
,fullFinish: function() { | |
if(this._player != null && !this._player.get_isReleased()) { | |
this._player.get_animationEnd().remove($bind(this,this.onStartFinished)); | |
this._player.release(); | |
this._player = null; | |
} | |
if(this._back != null) { | |
if(this._back.get_parent() != null) { | |
this._back.get_parent().removeChild(this._back); | |
} | |
this._back = null; | |
} | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_skills_RunCircleSkillController.__pool,this); | |
} | |
} | |
,__class__: battle_$pack_location_unit_heroes_skills_RunCircleSkillController | |
}); | |
var battle_$pack_location_unit_heroes_skills_RushEffectSkillController = function() { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.skills.RushEffectSkillController"] = battle_$pack_location_unit_heroes_skills_RushEffectSkillController; | |
battle_$pack_location_unit_heroes_skills_RushEffectSkillController.__name__ = ["battle_pack","location","unit","heroes","skills","RushEffectSkillController"]; | |
battle_$pack_location_unit_heroes_skills_RushEffectSkillController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_skills_RushEffectSkillController.__pool,battle_$pack_location_unit_heroes_skills_RushEffectSkillController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_skills_RushEffectSkillController.__super__ = battle_$pack_location_unit_heroes_skills_BattleUnitSkillController; | |
battle_$pack_location_unit_heroes_skills_RushEffectSkillController.prototype = $extend(battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype,{ | |
init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,finish: function() { | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_skills_RushEffectSkillController.__pool,this); | |
} | |
} | |
,start: function() { | |
} | |
,getIsReleasable: function() { | |
return true; | |
} | |
,__class__: battle_$pack_location_unit_heroes_skills_RushEffectSkillController | |
}); | |
var battle_$pack_location_unit_heroes_skills_SummonOnSpawnSkillController = function() { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.skills.SummonOnSpawnSkillController"] = battle_$pack_location_unit_heroes_skills_SummonOnSpawnSkillController; | |
battle_$pack_location_unit_heroes_skills_SummonOnSpawnSkillController.__name__ = ["battle_pack","location","unit","heroes","skills","SummonOnSpawnSkillController"]; | |
battle_$pack_location_unit_heroes_skills_SummonOnSpawnSkillController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_skills_SummonOnSpawnSkillController.__pool,battle_$pack_location_unit_heroes_skills_SummonOnSpawnSkillController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_skills_SummonOnSpawnSkillController.__super__ = battle_$pack_location_unit_heroes_skills_BattleUnitSkillController; | |
battle_$pack_location_unit_heroes_skills_SummonOnSpawnSkillController.prototype = $extend(battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype,{ | |
init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,finish: function() { | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_skills_SummonOnSpawnSkillController.__pool,this); | |
} | |
} | |
,start: function() { | |
this._unit.setState("SummonOnSpawn"); | |
} | |
,__class__: battle_$pack_location_unit_heroes_skills_SummonOnSpawnSkillController | |
}); | |
var battle_$pack_location_unit_heroes_skills_TowerRushSkillController = function() { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.skills.TowerRushSkillController"] = battle_$pack_location_unit_heroes_skills_TowerRushSkillController; | |
battle_$pack_location_unit_heroes_skills_TowerRushSkillController.__name__ = ["battle_pack","location","unit","heroes","skills","TowerRushSkillController"]; | |
battle_$pack_location_unit_heroes_skills_TowerRushSkillController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_skills_TowerRushSkillController.__pool,battle_$pack_location_unit_heroes_skills_TowerRushSkillController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_skills_TowerRushSkillController.__super__ = battle_$pack_location_unit_heroes_skills_BattleUnitSkillController; | |
battle_$pack_location_unit_heroes_skills_TowerRushSkillController.prototype = $extend(battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype,{ | |
_lineNode: null | |
,_currentTarget: null | |
,init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,start: function() { | |
this.clearLine(); | |
this.clearCurrentTarget(); | |
this._unit.playSoundEvent("ability2"); | |
var skill = this._unit.getSkillByType(epicwar_haxe_battle_skills_SkillType.STTowerRush); | |
var skillData = skill != null ? skill.get_data() : null; | |
if(skillData != null && skillData.targetId != 0) { | |
this._currentTarget = StaticExt.kast(Std,this._view.get_location().getObject(skillData.targetId),battle_$pack_location_building_BattleBuildingInstance); | |
if(this._currentTarget != null) { | |
this._currentTarget.get_killedSignal().add($bind(this,this.onDeath)); | |
this._unit.get_killedSignal().add($bind(this,this.onDeath)); | |
this._unit.get_effectAdded().add($bind(this,this.onEffectAdded)); | |
this._unit.get_effectRemoved().add($bind(this,this.onEffectRemoved)); | |
} | |
} | |
} | |
,onEffectAdded: function(effectViewType) { | |
if(effectViewType == epicwar_haxe_battle_effects_EffectViewType.EVTTowerRush) { | |
this.createLine(); | |
} | |
} | |
,onEffectRemoved: function(effectViewType) { | |
if(!this._unit.hasEffect(epicwar_haxe_battle_effects_EffectViewType.EVTTowerRush)) { | |
this.clearLine(); | |
} | |
} | |
,createLine: function() { | |
this._lineNode = this._view.get_scene().createNode("painDispatcherLine" + this._unit.get_id()); | |
this._lineNode.addController(battle_$pack_location_unit_view_UnitGPS.create(this._view,this._unit,this._decoration,0)); | |
this._lineNode.addController(battle_$pack_location_unit_view_TowerRushLine.create(this._view,this._decoration,this._unit,this._currentTarget)); | |
this._view.get_airLayer().addChild(this._lineNode); | |
this._unit.setState("TowerRush"); | |
} | |
,clear: function() { | |
this.clearLine(); | |
this.clearCurrentTarget(); | |
if(this._unit != null) { | |
this._unit.get_killedSignal().remove($bind(this,this.onDeath)); | |
this._unit.get_effectAdded().remove($bind(this,this.onEffectAdded)); | |
this._unit.get_effectRemoved().remove($bind(this,this.onEffectRemoved)); | |
} | |
} | |
,clearLine: function() { | |
if(this._lineNode != null) { | |
this._lineNode.release(); | |
this._lineNode = null; | |
} | |
} | |
,clearCurrentTarget: function() { | |
if(this._currentTarget != null) { | |
this._currentTarget.get_killedSignal().remove($bind(this,this.onDeath)); | |
this._currentTarget = null; | |
} | |
} | |
,finish: function() { | |
this.clear(); | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_skills_TowerRushSkillController.__pool,this); | |
} | |
} | |
,getIsReleasable: function() { | |
return false; | |
} | |
,onDeath: function(v) { | |
this.clear(); | |
} | |
,__class__: battle_$pack_location_unit_heroes_skills_TowerRushSkillController | |
}); | |
var battle_$pack_location_unit_heroes_skills_WallCrushSkillController = function() { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.heroes.skills.WallCrushSkillController"] = battle_$pack_location_unit_heroes_skills_WallCrushSkillController; | |
battle_$pack_location_unit_heroes_skills_WallCrushSkillController.__name__ = ["battle_pack","location","unit","heroes","skills","WallCrushSkillController"]; | |
battle_$pack_location_unit_heroes_skills_WallCrushSkillController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_heroes_skills_WallCrushSkillController.__pool,battle_$pack_location_unit_heroes_skills_WallCrushSkillController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_heroes_skills_WallCrushSkillController.__super__ = battle_$pack_location_unit_heroes_skills_BattleUnitSkillController; | |
battle_$pack_location_unit_heroes_skills_WallCrushSkillController.prototype = $extend(battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype,{ | |
init: function(view,unit,decoration) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.initBase.call(this,view,unit,decoration); | |
} | |
,finish: function() { | |
if(this._unit != null) { | |
battle_$pack_location_unit_heroes_skills_BattleUnitSkillController.prototype.finish.call(this); | |
StaticExt.toPool(battle_$pack_location_unit_heroes_skills_WallCrushSkillController.__pool,this); | |
} | |
} | |
,start: function() { | |
this._unit.changeAttackSoundOnce("ability1"); | |
} | |
,__class__: battle_$pack_location_unit_heroes_skills_WallCrushSkillController | |
}); | |
var battle_$pack_location_unit_view_BattleUnitBodyController = function() { | |
this.bloodDrawn = false; | |
this.rechargeFactor = 1; | |
this.direction = 1; | |
this.stateId = 0; | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.view.BattleUnitBodyController"] = battle_$pack_location_unit_view_BattleUnitBodyController; | |
battle_$pack_location_unit_view_BattleUnitBodyController.__name__ = ["battle_pack","location","unit","view","BattleUnitBodyController"]; | |
battle_$pack_location_unit_view_BattleUnitBodyController.create = function(data,unit,environment) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_view_BattleUnitBodyController.__pool,battle_$pack_location_unit_view_BattleUnitBodyController); | |
inst.init(data,unit,environment); | |
return inst; | |
}; | |
battle_$pack_location_unit_view_BattleUnitBodyController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_unit_view_BattleUnitBodyController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
state: null | |
,stateId: null | |
,direction: null | |
,rechargeFactor: null | |
,bloodDrawn: null | |
,unit: null | |
,data: null | |
,_clipController: null | |
,_underlayClipController: null | |
,_underlayNode: null | |
,environment: null | |
,init: function(data,unit,environment) { | |
this.data = data; | |
this.unit = unit; | |
this.environment = environment; | |
this.rechargeFactor = 1 / unit.get_attackData().get_recharge() / 30; | |
} | |
,start: function() { | |
this._clipController = com_progrestar_framework_scene_extended_clip_ClipsSwitchController.create(this.data.get_scene()); | |
this._clipController.get_environmentUpdated().add($bind(this,this.updateMarkers)); | |
this._holder.addController(this._clipController); | |
if(this.unit.get_unitData().hasUnderlayStates()) { | |
this._underlayClipController = com_progrestar_framework_scene_extended_clip_ClipsSwitchController.create(this.data.get_scene()); | |
this._underlayNode = this.data.get_scene().createNode("unitUnderlay" + this.unit.get_id()); | |
this._underlayNode.addController(battle_$pack_location_unit_view_UnitGPS.create(this.data,this.unit,this.environment,0)); | |
this._underlayNode.addController(this._underlayClipController); | |
this.data.get_backLayer().addChild(this._underlayNode); | |
this.environment.underlayHolder = this._underlayNode; | |
} | |
this.unit.get_moveSignal().add($bind(this,this.updateState)); | |
this.unit.get_stateChanged().add($bind(this,this.updateState)); | |
this.unit.get_effectAdded().add($bind(this,this.updateEffect)); | |
this.updateState(); | |
} | |
,finish: function() { | |
this.unit.get_moveSignal().remove($bind(this,this.updateState)); | |
this.unit.get_stateChanged().remove($bind(this,this.updateState)); | |
this.unit.get_effectAdded().remove($bind(this,this.updateEffect)); | |
if(this._underlayNode != null) { | |
this._underlayClipController.release(); | |
this._underlayClipController = null; | |
if(this._underlayNode.get_parent() != null) { | |
this._underlayNode.get_parent().removeChild(this._underlayNode); | |
} | |
this._underlayNode.release(); | |
this._underlayNode = null; | |
this.environment.underlayHolder = null; | |
} | |
if(this._clipController != null) { | |
this._clipController.get_environmentUpdated().remove($bind(this,this.updateMarkers)); | |
this._clipController.release(); | |
this._clipController = null; | |
} | |
this.data = null; | |
this.unit = null; | |
this.environment = null; | |
this.state = null; | |
this.stateId = 0; | |
this.direction = 1; | |
this.rechargeFactor = 1; | |
this.bloodDrawn = false; | |
StaticExt.toPool(battle_$pack_location_unit_view_BattleUnitBodyController.__pool,this); | |
} | |
,updateEffect: function(v) { | |
this.updateStateWithParam(true); | |
} | |
,updateState: function(v) { | |
this.updateStateWithParam(); | |
} | |
,updateStateWithParam: function(dirty) { | |
if(dirty == null) { | |
dirty = false; | |
} | |
if(this.data.get_locationConfig().locationLink != com_progrestar_game_scene_SceneManager.get_activeLocation().get_locationLink()) { | |
return; | |
} | |
var nextDirection = 1; | |
var nextState = this.unit.get_state(); | |
var nextStateId = this.unit.get_stateId(); | |
if(this.unit.get_attackState().running) { | |
nextDirection = com_progrestar_common_util_abstr_types_Direction.getDirection(this.unit.get_x(),this.unit.get_y(),this.unit.get_attackState().targetX,this.unit.get_attackState().targetY); | |
} else if(this.unit.get_moveState().running) { | |
if(this.unit.get_x() == this.unit.get_moveState().targetX && this.unit.get_y() == this.unit.get_moveState().targetY) { | |
nextDirection = this.direction; | |
} else { | |
nextDirection = com_progrestar_common_util_abstr_types_Direction.getDirection(this.unit.get_x(),this.unit.get_y(),this.unit.get_moveState().targetX,this.unit.get_moveState().targetY); | |
} | |
} else { | |
nextDirection = this.direction; | |
} | |
if(this.state == nextState && this.stateId == nextStateId) { | |
if(this.state == "Death") { | |
return; | |
} else if(this.direction == nextDirection && !dirty) { | |
return; | |
} | |
} | |
this.direction = nextDirection; | |
this.state = nextState; | |
this.stateId = nextStateId; | |
if(this._clipController != null) { | |
this.updateStates(this._clipController); | |
if(this._clipController.get_isReleased()) { | |
this._clipController = null; | |
} | |
} | |
if(this._underlayClipController != null) { | |
this.updateStates(this._underlayClipController,true); | |
} | |
if(this.state == "Death") { | |
if(!js_Boot.__instanceof(this.unit.get_unitData(),com_progrestar_game_hero_lib_HeroLevelLibItem) && !this.bloodDrawn) { | |
this.bloodDrawn = true; | |
this.drawBlood(); | |
} | |
} | |
this.updateMarkers(); | |
} | |
,updateStates: function(clipController,underlay) { | |
if(underlay == null) { | |
underlay = false; | |
} | |
var effects = this.unit.getEffects(); | |
var link = null; | |
var loop = true; | |
var founded = false; | |
var skin = this.unit.get_skin(); | |
var _g = 0; | |
while(_g < effects.length) { | |
var effect = effects[_g]; | |
++_g; | |
if(this.unit.get_unitData().hasAnimationByEffectViewType(this.state,skin,effect.get_viewType(),this.stateId,underlay)) { | |
link = this.unit.get_unitData().getAnimationLink(this.state,skin,effect.get_viewType(),this.stateId,underlay); | |
loop = this.unit.get_unitData().getAnimationLoop(this.state,skin,effect.get_viewType(),this.stateId,underlay); | |
founded = true; | |
break; | |
} | |
} | |
if(!founded) { | |
link = this.unit.get_unitData().getAnimationLink(this.state,skin,epicwar_haxe_battle_effects_EffectViewType.EVTNoEffect,this.stateId,underlay); | |
loop = this.unit.get_unitData().getAnimationLoop(this.state,skin,epicwar_haxe_battle_effects_EffectViewType.EVTNoEffect,this.stateId,underlay); | |
} | |
if(link != null) { | |
link = StaticExt.replace(link,"{dir}",null,com_progrestar_common_util_abstr_types_Direction.getDirectionCode(this.direction)); | |
} | |
var speed = battle_$pack_location_location_$view_SceneConfig.instance.gameSpeed.get_value(); | |
if(this.state == "Attack") { | |
var normalizeAttackAnimation = 1; | |
var frameCount = clipController.getFramesCount(link); | |
if(frameCount > 1) { | |
normalizeAttackAnimation = frameCount * this.rechargeFactor * this.unit.get_attackState().speedFactor; | |
} | |
clipController.switchToClip(link); | |
clipController.speed(speed * normalizeAttackAnimation); | |
clipController.goTo(0); | |
clipController.play(loop); | |
if(!underlay) { | |
this.environment.shootMark = clipController.getFirePointMarker(); | |
} | |
} else if(this.state == "Move" || this.state == "Stand") { | |
clipController.switchToClip(link); | |
clipController.speed(speed); | |
clipController.goTo(0); | |
clipController.play(loop); | |
} else if(this.state == "Death") { | |
if(js_Boot.__instanceof(this.unit.get_unitData(),com_progrestar_game_hero_lib_HeroLevelLibItem)) { | |
link = StaticExt.replace(link,"{random}",null,Std.string(com_progrestar_framework_core_utils_RandomUtils.randi(1,2))); | |
clipController.switchToClip(link); | |
clipController.speed(speed); | |
clipController.goTo(0); | |
clipController.play(loop); | |
} else { | |
clipController.release(); | |
} | |
} else { | |
clipController.switchToClip(link); | |
clipController.speed(speed); | |
clipController.goTo(0); | |
clipController.play(this.state != "Reborn"); | |
} | |
} | |
,updateMarkers: function(v) { | |
if(this._clipController != null) { | |
this.environment.bloodMark = this._clipController.getBloodMarker(); | |
this.environment.crystalMark = this._clipController.getCrystalMarker(); | |
this.environment.set_hpBarMark(this._clipController.getHpBarMarker()); | |
this.environment.spellMark = this._clipController.getSpellMarker(); | |
this.environment.player = this._clipController.getPlayer(); | |
} | |
} | |
,drawBlood: function() { | |
var moveState = this.unit.get_moveState(); | |
var moveProgress = com_progrestar_framework_core_utils_MathUtils.clampf((this.data.get_location().get_locationTime() - moveState.startTime) / moveState.duration,0,1); | |
var U = null; | |
var V = null; | |
var moveStartX = null; | |
var moveStartY = null; | |
var moveFinishX = null; | |
var moveFinishY = null; | |
if(moveState.running) { | |
moveStartX = this.unit.get_x(); | |
moveStartY = this.unit.get_y(); | |
moveFinishX = this.unit.get_moveState().targetX; | |
moveFinishY = this.unit.get_moveState().targetY; | |
} else { | |
moveStartX = this.unit.get_x(); | |
moveStartY = this.unit.get_y(); | |
moveFinishX = this.unit.get_x(); | |
moveFinishY = this.unit.get_y(); | |
} | |
if(this.data.get_config().showServerMove.get_value()) { | |
U = 0; | |
V = 1; | |
} else { | |
if(moveState.running) { | |
U = moveProgress; | |
} else { | |
U = 0; | |
} | |
if(U < 0) { | |
U = 0; | |
} else if(U > 1) { | |
U = 1; | |
} | |
V = 1 - U; | |
} | |
var tileX = moveStartX * V + U * moveFinishX + this.environment.offsetX; | |
var tileY = moveStartY * V + U * moveFinishY + this.environment.offsetY; | |
com_progrestar_game_render2_utils_CanvasUtils.drawByLink(this.data.get_staticEffects(),this.unit.get_unitData().get_ruinsLink(),tileX,tileY,1); | |
} | |
,__class__: battle_$pack_location_unit_view_BattleUnitBodyController | |
}); | |
var battle_$pack_location_unit_view_MarkerAnimationContainer = function() { | |
this.transforms = []; | |
}; | |
$hxClasses["battle_pack.location.unit.view.MarkerAnimationContainer"] = battle_$pack_location_unit_view_MarkerAnimationContainer; | |
battle_$pack_location_unit_view_MarkerAnimationContainer.__name__ = ["battle_pack","location","unit","view","MarkerAnimationContainer"]; | |
battle_$pack_location_unit_view_MarkerAnimationContainer.prototype = { | |
getTransform: function(frame) { | |
var targetFrame = frame % this.transforms.length; | |
if(targetFrame < this.transforms.length) { | |
return this.transforms[targetFrame]; | |
} | |
return null; | |
} | |
,addTransform: function(frame,transform) { | |
this.transforms[frame] = transform; | |
} | |
,transforms: null | |
,__class__: battle_$pack_location_unit_view_MarkerAnimationContainer | |
}; | |
var battle_$pack_location_unit_view_MarkerType = function() { | |
}; | |
$hxClasses["battle_pack.location.unit.view.MarkerType"] = battle_$pack_location_unit_view_MarkerType; | |
battle_$pack_location_unit_view_MarkerType.__name__ = ["battle_pack","location","unit","view","MarkerType"]; | |
battle_$pack_location_unit_view_MarkerType.prototype = { | |
__class__: battle_$pack_location_unit_view_MarkerType | |
}; | |
var battle_$pack_location_unit_view_PainDispatcherLine = function() { | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.view.PainDispatcherLine"] = battle_$pack_location_unit_view_PainDispatcherLine; | |
battle_$pack_location_unit_view_PainDispatcherLine.__name__ = ["battle_pack","location","unit","view","PainDispatcherLine"]; | |
battle_$pack_location_unit_view_PainDispatcherLine.create = function(view,decoration,unitA,unitB) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_view_PainDispatcherLine.__pool,battle_$pack_location_unit_view_PainDispatcherLine); | |
inst.init(view,decoration,unitA,unitB); | |
return inst; | |
}; | |
battle_$pack_location_unit_view_PainDispatcherLine.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_unit_view_PainDispatcherLine.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
data: null | |
,unitA: null | |
,unitB: null | |
,decoration: null | |
,clip: null | |
,init: function(view,decoration,unitA,unitB) { | |
this.data = view; | |
this.unitA = unitA; | |
this.unitB = unitB; | |
this.decoration = decoration; | |
} | |
,finish: function() { | |
com_progrestar_framework_scene_core_AbstractController.prototype.finish.call(this); | |
this.data = null; | |
this.unitA = null; | |
this.unitB = null; | |
this.decoration = null; | |
this._holder.get_ticker().remove($bind(this,this.update)); | |
if(this.clip != null) { | |
this.clip.release(); | |
this.clip = null; | |
} | |
StaticExt.toPool(battle_$pack_location_unit_view_PainDispatcherLine.__pool,this); | |
} | |
,start: function() { | |
if(this.clip == null) { | |
this.clip = this.data.get_scene().createClipPlayer("units/ice_golem/pain_dispatcher_line.rsx@start","PainDispatcherLine"); | |
this.clip.get_animationEnd().add($bind(this,this.onStartFinish)); | |
this.clip.goTo(0); | |
this.clip.play(false); | |
this._holder.addChild(this.clip); | |
} | |
this._holder.get_ticker().add($bind(this,this.update)); | |
} | |
,onStartFinish: function(v) { | |
this.clip.get_animationEnd().remove($bind(this,this.onStartFinish)); | |
this.clip.setClipFromFile("units/ice_golem/pain_dispatcher_line.rsx@main"); | |
this.clip.goTo(0); | |
this.clip.play(true); | |
} | |
,update: function(v) { | |
var additionalPositionDelta = this.decoration.getSpellPoint(); | |
var tempPoint = new openfl_geom_Point(); | |
this.getUnitPosition(this.unitA,tempPoint); | |
var unitAX = tempPoint.x; | |
var unitAY = tempPoint.y; | |
this.getUnitPosition(this.unitB,tempPoint); | |
var unitBX = tempPoint.x; | |
var unitBY = tempPoint.y; | |
var directionX = unitBX - unitAX; | |
var directionY = unitBY - unitAY; | |
com_progrestar_game_render2_controller_IsometricUtils.worldToScreenXY(tempPoint,directionX,directionY); | |
this.bindToPoints(this.clip.get_transform(),140,additionalPositionDelta.x,additionalPositionDelta.y,tempPoint.x,tempPoint.y); | |
} | |
,getUnitPosition: function(unit,tempPoint) { | |
var moveStartX = null; | |
var moveStartY = null; | |
var moveFinishX = null; | |
var moveFinishY = null; | |
var moveState = unit.get_moveState(); | |
var moveProgress = com_progrestar_framework_core_utils_MathUtils.clampf((this.data.get_location().get_locationTime() - moveState.startTime) / moveState.duration,0,1); | |
var U = null; | |
if(moveState.running) { | |
moveStartX = unit.get_x(); | |
moveStartY = unit.get_y(); | |
moveFinishX = unit.get_moveState().targetX; | |
moveFinishY = unit.get_moveState().targetY; | |
U = moveProgress; | |
} else { | |
moveStartX = unit.get_x(); | |
moveStartY = unit.get_y(); | |
moveFinishX = unit.get_x(); | |
moveFinishY = unit.get_y(); | |
U = 0; | |
} | |
if(U < 0) { | |
U = 0; | |
} else if(U > 1) { | |
U = 1; | |
} | |
var V = 1 - U; | |
var tileX = moveStartX * V + U * moveFinishX; | |
var tileY = moveStartY * V + U * moveFinishY; | |
tempPoint.x = tileX; | |
tempPoint.y = tileY; | |
} | |
,bindToPoints: function(transform,size,x1,y1,x2,y2) { | |
var dirX = x2 - x1; | |
var dirY = y2 - y1; | |
var radians = com_progrestar_framework_core_utils_MathUtils.findAngle(dirX,dirY); | |
var dest = Math.sqrt(dirX * dirX + dirY * dirY); | |
var scale = dest / size; | |
transform.setScale(scale,scale); | |
transform.setPosition(x1,y1); | |
transform.setRotation(radians); | |
} | |
,__class__: battle_$pack_location_unit_view_PainDispatcherLine | |
}); | |
var battle_$pack_location_unit_view_TowerRushLine = function() { | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.view.TowerRushLine"] = battle_$pack_location_unit_view_TowerRushLine; | |
battle_$pack_location_unit_view_TowerRushLine.__name__ = ["battle_pack","location","unit","view","TowerRushLine"]; | |
battle_$pack_location_unit_view_TowerRushLine.create = function(view,decoration,unitA,unitB) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_view_TowerRushLine.__pool,battle_$pack_location_unit_view_TowerRushLine); | |
inst.init(view,decoration,unitA,unitB); | |
return inst; | |
}; | |
battle_$pack_location_unit_view_TowerRushLine.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_unit_view_TowerRushLine.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
data: null | |
,unitA: null | |
,unitB: null | |
,decoration: null | |
,clip: null | |
,init: function(view,decoration,unitA,unitB) { | |
this.data = view; | |
this.unitA = unitA; | |
this.unitB = unitB; | |
this.decoration = decoration; | |
} | |
,finish: function() { | |
com_progrestar_framework_scene_core_AbstractController.prototype.finish.call(this); | |
this.data = null; | |
this.unitA = null; | |
this.unitB = null; | |
this.decoration = null; | |
this._holder.get_ticker().remove($bind(this,this.update)); | |
if(this.clip != null) { | |
this.clip.release(); | |
this.clip = null; | |
} | |
StaticExt.toPool(battle_$pack_location_unit_view_TowerRushLine.__pool,this); | |
} | |
,start: function() { | |
if(this.clip == null) { | |
this.clip = this.data.get_scene().createClipPlayer("units/succubus/anim.rsx@lineAbility","TowerRushLine"); | |
this.clip.get_animationEnd().add($bind(this,this.onStartFinish)); | |
this.clip.goTo(0); | |
this.clip.play(false); | |
this._holder.addChild(this.clip); | |
} | |
this._holder.get_ticker().add($bind(this,this.update)); | |
} | |
,onStartFinish: function(v) { | |
this.clip.get_animationEnd().remove($bind(this,this.onStartFinish)); | |
this.clip.setClipFromFile("units/succubus/anim.rsx@lineAbility"); | |
this.clip.goTo(0); | |
this.clip.play(true); | |
} | |
,update: function(v) { | |
var tempPoint = new openfl_geom_Point(); | |
this.getUnitPosition(this.unitA,tempPoint); | |
var unitAX = tempPoint.x; | |
var unitAY = tempPoint.y; | |
var unitBX = this.unitB.get_x() + this.unitB.get_size() / 2; | |
var unitBY = this.unitB.get_y() + this.unitB.get_size() / 2; | |
var bloodMarkPoint = this.decoration.bloodMark.getPosition(); | |
var directionX = unitBX - unitAX; | |
var directionY = unitBY - unitAY; | |
com_progrestar_game_render2_controller_IsometricUtils.worldToScreenXY(tempPoint,directionX,directionY); | |
this.bindToPoints(this.clip.get_transform(),140,bloodMarkPoint.x,bloodMarkPoint.y,tempPoint.x,tempPoint.y); | |
} | |
,getUnitPosition: function(unit,tempPoint) { | |
var moveStartX = null; | |
var moveStartY = null; | |
var moveFinishX = null; | |
var moveFinishY = null; | |
var moveState = unit.get_moveState(); | |
var moveProgress = com_progrestar_framework_core_utils_MathUtils.clampf((this.data.get_location().get_locationTime() - moveState.startTime) / moveState.duration,0,1); | |
var U = null; | |
if(moveState.running) { | |
moveStartX = unit.get_x(); | |
moveStartY = unit.get_y(); | |
moveFinishX = unit.get_moveState().targetX; | |
moveFinishY = unit.get_moveState().targetY; | |
U = moveProgress; | |
} else { | |
moveStartX = unit.get_x(); | |
moveStartY = unit.get_y(); | |
moveFinishX = unit.get_x(); | |
moveFinishY = unit.get_y(); | |
U = 0; | |
} | |
if(U < 0) { | |
U = 0; | |
} else if(U > 1) { | |
U = 1; | |
} | |
var V = 1 - U; | |
var tileX = moveStartX * V + U * moveFinishX; | |
var tileY = moveStartY * V + U * moveFinishY; | |
tempPoint.x = tileX; | |
tempPoint.y = tileY; | |
} | |
,bindToPoints: function(transform,size,x1,y1,x2,y2) { | |
var dirX = x2 - x1; | |
var dirY = y2 - y1; | |
var radians = com_progrestar_framework_core_utils_MathUtils.findAngle(dirX,dirY); | |
var dest = Math.sqrt(dirX * dirX + dirY * dirY); | |
var scale = dest / size; | |
transform.setScale(scale,scale); | |
transform.setPosition(x1,y1); | |
transform.setRotation(radians); | |
} | |
,__class__: battle_$pack_location_unit_view_TowerRushLine | |
}); | |
var battle_$pack_location_unit_view_UnitAnimationEnvironment = function() { | |
this._markers = utils_ds__$JSMap_JSMap_$Impl_$._new(); | |
}; | |
$hxClasses["battle_pack.location.unit.view.UnitAnimationEnvironment"] = battle_$pack_location_unit_view_UnitAnimationEnvironment; | |
battle_$pack_location_unit_view_UnitAnimationEnvironment.__name__ = ["battle_pack","location","unit","view","UnitAnimationEnvironment"]; | |
battle_$pack_location_unit_view_UnitAnimationEnvironment.__interfaces__ = [com_progrestar_framework_core_IRelease]; | |
battle_$pack_location_unit_view_UnitAnimationEnvironment.create = function(player) { | |
var ret = com_progrestar_framework_genome_Pools.UNIT_ENV_POOL.pop(); | |
ret._player = player; | |
return ret; | |
}; | |
battle_$pack_location_unit_view_UnitAnimationEnvironment.prototype = { | |
_player: null | |
,_markers: null | |
,_spellMarker: null | |
,setMarker: function(name,marker) { | |
this._markers.set(name,marker); | |
} | |
,setSpellMarker: function(marker) { | |
this._spellMarker = marker; | |
} | |
,get_spellMarker: function() { | |
return this._spellMarker; | |
} | |
,release: function() { | |
this._player.release(); | |
this._player = null; | |
var m = $iterator(utils_ds__$JSMap_JSMap_$Impl_$)(this._markers); | |
while(m.hasNext()) { | |
var m1 = m.next(); | |
com_progrestar_framework_genome_Pools.ABSTR_TRANSFORM_POOL.push(m1); | |
} | |
this._spellMarker = null; | |
this._markers.clear(); | |
com_progrestar_framework_genome_Pools.UNIT_ENV_POOL.push(this); | |
} | |
,get_player: function() { | |
return this._player; | |
} | |
,getMarker: function(name) { | |
return this._markers.get(name); | |
} | |
,__class__: battle_$pack_location_unit_view_UnitAnimationEnvironment | |
,__properties__: {get_player:"get_player",get_spellMarker:"get_spellMarker"} | |
}; | |
var openfl_geom_Point = function(x,y) { | |
if(y == null) { | |
y = 0; | |
} | |
if(x == null) { | |
x = 0; | |
} | |
this.x = x; | |
this.y = y; | |
}; | |
$hxClasses["openfl.geom.Point"] = openfl_geom_Point; | |
openfl_geom_Point.__name__ = ["openfl","geom","Point"]; | |
openfl_geom_Point.__limeVector2 = null; | |
openfl_geom_Point.distance = function(pt1,pt2) { | |
var dx = pt1.x - pt2.x; | |
var dy = pt1.y - pt2.y; | |
return Math.sqrt(dx * dx + dy * dy); | |
}; | |
openfl_geom_Point.interpolate = function(pt1,pt2,f) { | |
return new openfl_geom_Point(pt2.x + f * (pt1.x - pt2.x),pt2.y + f * (pt1.y - pt2.y)); | |
}; | |
openfl_geom_Point.polar = function(len,angle) { | |
return new openfl_geom_Point(len * Math.cos(angle),len * Math.sin(angle)); | |
}; | |
openfl_geom_Point.prototype = { | |
x: null | |
,y: null | |
,add: function(v) { | |
return new openfl_geom_Point(v.x + this.x,v.y + this.y); | |
} | |
,clone: function() { | |
return new openfl_geom_Point(this.x,this.y); | |
} | |
,copyFrom: function(sourcePoint) { | |
this.x = sourcePoint.x; | |
this.y = sourcePoint.y; | |
} | |
,equals: function(toCompare) { | |
if(toCompare != null && toCompare.x == this.x) { | |
return toCompare.y == this.y; | |
} else { | |
return false; | |
} | |
} | |
,normalize: function(thickness) { | |
if(this.x == 0 && this.y == 0) { | |
return; | |
} else { | |
var norm = thickness / Math.sqrt(this.x * this.x + this.y * this.y); | |
this.x *= norm; | |
this.y *= norm; | |
} | |
} | |
,offset: function(dx,dy) { | |
this.x += dx; | |
this.y += dy; | |
} | |
,setTo: function(xa,ya) { | |
this.x = xa; | |
this.y = ya; | |
} | |
,subtract: function(v) { | |
return new openfl_geom_Point(this.x - v.x,this.y - v.y); | |
} | |
,toString: function() { | |
return "(x=" + this.x + ", y=" + this.y + ")"; | |
} | |
,__toLimeVector2: function() { | |
if(openfl_geom_Point.__limeVector2 == null) { | |
openfl_geom_Point.__limeVector2 = new lime_math_Vector2(); | |
} | |
var _this = openfl_geom_Point.__limeVector2; | |
_this.x = this.x; | |
_this.y = this.y; | |
return openfl_geom_Point.__limeVector2; | |
} | |
,get_length: function() { | |
return Math.sqrt(this.x * this.x + this.y * this.y); | |
} | |
,__class__: openfl_geom_Point | |
,__properties__: {get_length:"get_length"} | |
}; | |
var battle_$pack_location_unit_view_UnitEnvironment = function(data,unit) { | |
this._changed = new utils_signals_Signal(); | |
this._hpBarMark = new com_progrestar_framework_scene_core_AbstractTransform(); | |
this.crystalMark = new com_progrestar_framework_scene_core_AbstractTransform(); | |
this.shootMark = new com_progrestar_framework_scene_core_AbstractTransform(); | |
this.bloodMark = new com_progrestar_framework_scene_core_AbstractTransform(); | |
this.offsetY = 0.5; | |
this.offsetX = 0.5; | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
this.data = data; | |
this.unit = unit; | |
}; | |
$hxClasses["battle_pack.location.unit.view.UnitEnvironment"] = battle_$pack_location_unit_view_UnitEnvironment; | |
battle_$pack_location_unit_view_UnitEnvironment.__name__ = ["battle_pack","location","unit","view","UnitEnvironment"]; | |
battle_$pack_location_unit_view_UnitEnvironment.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_unit_view_UnitEnvironment.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
offsetX: null | |
,offsetY: null | |
,bloodMark: null | |
,shootMark: null | |
,crystalMark: null | |
,_hpBarMark: null | |
,spellMark: null | |
,data: null | |
,unit: null | |
,_changed: null | |
,player: null | |
,underlayHolder: null | |
,start: function() { | |
this.update(); | |
this.data.get_config().randomOffsets.get_changed().add($bind(this,this.update)); | |
battle_$pack_location_unit_view_UnitEnvironment.ITEMS.set(this.unit,this); | |
} | |
,finish: function() { | |
this.data.get_config().randomOffsets.get_changed().remove($bind(this,this.update)); | |
battle_$pack_location_unit_view_UnitEnvironment.ITEMS["delete"](this.unit); | |
this.data = null; | |
this.bloodMark = null; | |
} | |
,update: function(v) { | |
if(this.data.get_config().randomOffsets.get_value()) { | |
this.offsetX = com_progrestar_framework_core_utils_RandomUtils.randf(0.1,0.9); | |
this.offsetY = com_progrestar_framework_core_utils_RandomUtils.randf(0.1,0.9); | |
} else { | |
this.offsetX = 0.5; | |
this.offsetY = 0.5; | |
} | |
} | |
,get_hpBarMark: function() { | |
return this._hpBarMark; | |
} | |
,set_hpBarMark: function(value) { | |
if(this._hpBarMark != value) { | |
this._hpBarMark = value; | |
this._changed.dispatch(); | |
} | |
return value; | |
} | |
,get_changed: function() { | |
return this._changed; | |
} | |
,getSpellPoint: function() { | |
var spellPoint = battle_$pack_location_unit_view_UnitEnvironment.TEMP_POINT; | |
if(this.player != null && this.spellMark != null) { | |
var frame = this.player.get_currentFrame() | 0; | |
var spellTransform = this.spellMark.getTransform(frame); | |
if(spellTransform != null) { | |
spellPoint = spellTransform.getPosition(); | |
var scale = spellTransform.getScale(); | |
spellPoint.x *= scale.x; | |
spellPoint.y *= scale.y; | |
} | |
} else { | |
battle_$pack_location_unit_view_UnitEnvironment.TEMP_POINT.x = 0; | |
battle_$pack_location_unit_view_UnitEnvironment.TEMP_POINT.y = 0; | |
} | |
return spellPoint; | |
} | |
,__class__: battle_$pack_location_unit_view_UnitEnvironment | |
,__properties__: $extend(com_progrestar_framework_scene_core_AbstractController.prototype.__properties__,{get_changed:"get_changed",set_hpBarMark:"set_hpBarMark",get_hpBarMark:"get_hpBarMark"}) | |
}); | |
var battle_$pack_location_unit_view_UnitGPS = function() { | |
this._offset = 0; | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.view.UnitGPS"] = battle_$pack_location_unit_view_UnitGPS; | |
battle_$pack_location_unit_view_UnitGPS.__name__ = ["battle_pack","location","unit","view","UnitGPS"]; | |
battle_$pack_location_unit_view_UnitGPS.create = function(data,unit,decoration,depth) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_view_UnitGPS.__pool,battle_$pack_location_unit_view_UnitGPS); | |
inst.init(data,unit,decoration,depth); | |
return inst; | |
}; | |
battle_$pack_location_unit_view_UnitGPS.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_unit_view_UnitGPS.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
unit: null | |
,data: null | |
,decoration: null | |
,depth: null | |
,init: function(data,unit,decoration,depth) { | |
this.depth = depth; | |
this.unit = unit; | |
this.data = data; | |
this.decoration = decoration; | |
} | |
,start: function() { | |
this.unit.get_positionChanged().add($bind(this,this.updatePosition)); | |
this.unit.get_moveSignal().add($bind(this,this.updateMoves)); | |
this.updatePosition(); | |
} | |
,_offset: null | |
,updateOffset: function(offset) { | |
this._offset = offset; | |
} | |
,finish: function() { | |
this.unit.get_positionChanged().remove($bind(this,this.updatePosition)); | |
this.unit.get_moveSignal().remove($bind(this,this.updateMoves)); | |
this.data.get_location().get_ticker().remove($bind(this,this.updatePosition)); | |
this.data = null; | |
this.unit = null; | |
this.decoration = null; | |
StaticExt.toPool(battle_$pack_location_unit_view_UnitGPS.__pool,this); | |
} | |
,updateMoves: function(v) { | |
this.data.get_location().get_ticker().add($bind(this,this.updatePosition)); | |
this.updatePosition(); | |
} | |
,updatePosition: function(v) { | |
var moveState = this.unit.get_moveState(); | |
var moveFinishX = moveState.running ? moveState.targetX : this.unit.get_x(); | |
var moveFinishY = moveState.running ? moveState.targetY : this.unit.get_y(); | |
var moveProgress = this.data.get_config().showServerMove.get_value() || !moveState.running ? 0 : com_progrestar_framework_core_utils_MathUtils.clampf((this.data.get_location().get_locationTime() - moveState.startTime) / moveState.duration,0,1); | |
var tileX = this.unit.get_x() * (1 - moveProgress) + moveProgress * moveFinishX + this.decoration.offsetX; | |
var tileY = this.unit.get_y() * (1 - moveProgress) + moveProgress * moveFinishY + this.decoration.offsetY; | |
this.updateTargetTransform(this._holder.get_transform(),(tileX - tileY) * 32,(tileX + tileY) * 16 - this._offset * 4,-tileX - tileY + this.depth); | |
if(moveProgress >= 1) { | |
this.data.get_location().get_ticker().remove($bind(this,this.updatePosition)); | |
} | |
} | |
,updateTargetTransform: function(transform,posX,posY,depth) { | |
transform.setPosition(posX,posY); | |
transform.setDepth(depth); | |
} | |
,__class__: battle_$pack_location_unit_view_UnitGPS | |
}); | |
var battle_$pack_location_unit_view_UnitGpsWithSubnode = function() { | |
battle_$pack_location_unit_view_UnitGPS.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.view.UnitGpsWithSubnode"] = battle_$pack_location_unit_view_UnitGpsWithSubnode; | |
battle_$pack_location_unit_view_UnitGpsWithSubnode.__name__ = ["battle_pack","location","unit","view","UnitGpsWithSubnode"]; | |
battle_$pack_location_unit_view_UnitGpsWithSubnode.create = function(data,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_view_UnitGpsWithSubnode.__pool,battle_$pack_location_unit_view_UnitGpsWithSubnode); | |
inst.init(data,unit,decoration,0); | |
return inst; | |
}; | |
battle_$pack_location_unit_view_UnitGpsWithSubnode.__super__ = battle_$pack_location_unit_view_UnitGPS; | |
battle_$pack_location_unit_view_UnitGpsWithSubnode.prototype = $extend(battle_$pack_location_unit_view_UnitGPS.prototype,{ | |
updateTargetTransform: function(transform,posX,posY,depth) { | |
var additionalPositionDelta = this.decoration.getSpellPoint(); | |
transform.setPosition(posX + additionalPositionDelta.x,posY + additionalPositionDelta.y); | |
transform.setDepth(depth); | |
} | |
,finish: function() { | |
this.unit.get_positionChanged().remove($bind(this,this.updatePosition)); | |
this.unit.get_moveSignal().remove($bind(this,this.updateMoves)); | |
this.data.get_location().get_ticker().remove($bind(this,this.updatePosition)); | |
this.data = null; | |
this.unit = null; | |
this.decoration = null; | |
StaticExt.toPool(battle_$pack_location_unit_view_UnitGpsWithSubnode.__pool,this); | |
} | |
,__class__: battle_$pack_location_unit_view_UnitGpsWithSubnode | |
}); | |
var battle_$pack_location_unit_view_UnitRender = function() { | |
}; | |
$hxClasses["battle_pack.location.unit.view.UnitRender"] = battle_$pack_location_unit_view_UnitRender; | |
battle_$pack_location_unit_view_UnitRender.__name__ = ["battle_pack","location","unit","view","UnitRender"]; | |
battle_$pack_location_unit_view_UnitRender.create = function(view,unit) { | |
var environment = new battle_$pack_location_unit_view_UnitEnvironment(view,unit); | |
var mainContainer = null; | |
if(unit.get_unitData().get_attackData().get_attackerType() == "airUnit") { | |
mainContainer = view.get_scene().createNode("unit" + unit.get_id()); | |
if(unit.get_unitData().get_attackData().get_hp() != 0) { | |
mainContainer.addController(battle_$pack_location_object_view_ObjectHP.create(view,unit,true,unit.get_unitData().get_visualData(),environment)); | |
} | |
view.get_airLayer().addChild(mainContainer); | |
} else { | |
mainContainer = view.get_scene().createNode("unit" + unit.get_id()); | |
view.get_groundLayer().addChild(mainContainer); | |
var airNode = view.get_scene().createNode("unit" + unit.get_id()); | |
airNode.addController(battle_$pack_location_unit_view_UnitGPS.create(view,unit,environment,0)); | |
if(unit.get_unitData().get_attackData().get_hp() != 0) { | |
airNode.addController(battle_$pack_location_object_view_ObjectHP.create(view,unit,true,unit.get_unitData().get_visualData(),environment)); | |
} | |
view.get_topLayer().addChild(airNode); | |
} | |
mainContainer.addController(environment); | |
mainContainer.addController(battle_$pack_location_effects_CrystalEffectController.create(unit,environment,"effects/crystal_effect@UnitCriticalHit","effects/crystal_effect@UnitEvasion",view.get_scene(),false)); | |
mainContainer.addController(battle_$pack_location_unit_view_UnitGPS.create(view,unit,environment,0)); | |
mainContainer.addController(com_progrestar_game_sound_UnitSoundController.create(unit,environment)); | |
var body = view.get_scene().createNode("unit" + unit.get_id()); | |
body.addController(battle_$pack_location_unit_view_BattleUnitBodyController.create(view,unit,environment)); | |
body.addController(battle_$pack_location_unit_heroes_BattleUnitEffectsController.create(view,unit,environment)); | |
body.addController(battle_$pack_location_unit_view_UnitVisibleController.create(view,unit,environment)); | |
mainContainer.addChild(body); | |
if(unit.get_unitData().get_hasAbilities()) { | |
body.addController(battle_$pack_location_unit_heroes_BattleUnitSkillsController.create(view,unit,environment)); | |
} | |
if(js_Boot.__instanceof(unit.get_unitData(),com_progrestar_game_hero_lib_HeroLevelLibItem)) { | |
body.addController(battle_$pack_location_unit_heroes_BattleUnitSkillsController.create(view,unit,environment)); | |
mainContainer.addController(com_progrestar_game_unit_render_UnitLevelView.create(unit,environment)); | |
var runeNode = view.get_scene().createNode("unit" + unit.get_id()); | |
runeNode.addController(battle_$pack_location_unit_view_UnitGPS.create(view,unit,environment,100)); | |
runeNode.addController(com_progrestar_game_unit_render_HeroSkillProgressController.create(unit,view)); | |
view.get_groundLayer().addChild(runeNode); | |
} | |
}; | |
battle_$pack_location_unit_view_UnitRender.prototype = { | |
__class__: battle_$pack_location_unit_view_UnitRender | |
}; | |
var battle_$pack_location_unit_view_UnitVisibleController = function() { | |
com_progrestar_framework_scene_core_AbstractController.call(this); | |
}; | |
$hxClasses["battle_pack.location.unit.view.UnitVisibleController"] = battle_$pack_location_unit_view_UnitVisibleController; | |
battle_$pack_location_unit_view_UnitVisibleController.__name__ = ["battle_pack","location","unit","view","UnitVisibleController"]; | |
battle_$pack_location_unit_view_UnitVisibleController.create = function(view,unit,decoration) { | |
var inst = StaticExt.fromPool(battle_$pack_location_unit_view_UnitVisibleController.__pool,battle_$pack_location_unit_view_UnitVisibleController); | |
inst.init(view,unit,decoration); | |
return inst; | |
}; | |
battle_$pack_location_unit_view_UnitVisibleController.__super__ = com_progrestar_framework_scene_core_AbstractController; | |
battle_$pack_location_unit_view_UnitVisibleController.prototype = $extend(com_progrestar_framework_scene_core_AbstractController.prototype,{ | |
_unit: null | |
,_data: null | |
,_decoration: null | |
,init: function(view,unit,decoration) { | |
this._data = view; | |
this._unit = unit; | |
this._decoration = decoration; | |
} | |
,start: function() { | |
this.changeVisible(); | |
this._unit.get_visibleChanged().add($bind(this,this.changeVisible)); | |
} | |
,finish: function() { | |
this._unit.get_visibleChanged().remove($bind(this,this.changeVisible)); | |
this._unit = null; | |
this._data = null; | |
StaticExt.toPool(battle_$pack_location_unit_view_UnitVisibleController.__pool,this); | |
} | |
,changeVisible: function(v) { | |
this._holder.get_transform().set_alpha(this._unit.get_visible() ? 1 : 0); | |
if(this._decoration.underlayHolder != null) { | |
this._decoration.underlayHolder.get_transform().set_alpha(this._unit.get_visible() ? 1 : 0); | |
} | |
} | |
,__class__: battle_$pack_location_unit_view_UnitVisibleController | |
}); | |
var battle_$pack_rpc_BattleRPC = function() { | |
}; | |
$hxClasses["battle_pack.rpc.BattleRPC"] = battle_$pack_rpc_BattleRPC; | |
battle_$pack_rpc_BattleRPC.__name__ = ["battle_pack","rpc","BattleRPC"]; | |
battle_$pack_rpc_BattleRPC.loadReplay = function(battleId,record,onSuccess,onFailed) { | |
var _onSuccess = function(data) { | |
if(data.body.errorCode == "BATTLE_NOT_FOUND") { | |
var message = com_progrestar_common_lang_Translate.translate("T_ISNT_BATTLE_REPLAY"); | |
com_progrestar_game_ui_UI.notify("",message); | |
onFailed(null); | |
return; | |
} | |
com_progrestar_framework_core_Assert.isTrue(data != null && data.body && data.body.commands && data.body.config,"invalid answer data"); | |
var body = data.body; | |
com_progrestar_game_battle_BattleRecordParser.parse(body,record); | |
record.replay = true; | |
record.validationRequired = false; | |
var _onSuccess1 = body.attacker ? new com_progrestar_game_battle_UserDataDto(body.attacker) : com_progrestar_game_battle_UserDataDto.FAKE_MISSION; | |
record.attacker = _onSuccess1.get_link(); | |
if(body.defender) { | |
record.defender = new com_progrestar_game_battle_UserDataDto(body.defender).get_link(); | |
} else if(body.type == "crusade") { | |
record.defender = com_progrestar_game_data_LocationLink.take("crusade",body.defenderId); | |
var mapId = StaticExt.asInt(Std,body.defenderId); | |
var map = com_progrestar_game_crusades_datas_config_map_CrusadeMapLib.get_instance().getById(mapId); | |
record.defender.set_crusadeMission(map); | |
} else if(body.type == "bastion") { | |
record.defender = com_progrestar_game_data_LocationLink.take("fair",body.defenderId); | |
} else if(body.type == "mission") { | |
record.defender = com_progrestar_game_data_LocationLink.take("npc",body.defenderId); | |
} else { | |
record.defender = com_progrestar_game_battle_UserDataDto.FAKE_MISSION.get_link(); | |
} | |
record.commands = body.commands; | |
if(body.config) { | |
com_progrestar_game_battle_BattleRecordParser.parseConfig(record,body.config); | |
} | |
if(body.result) { | |
com_progrestar_game_battle_BattleRecordParser.parseResult(record,body.result); | |
} | |
onSuccess(record); | |
}; | |
com_progrestar_game_server_RpcManager.createCustomRequest("battle_replay",{ "battleId" : battleId, "version" : epicwar_haxe_battle_Battle.getVersion()},_onSuccess,onFailed); | |
}; | |
battle_$pack_rpc_BattleRPC.startBastion = function(forStarmoney,onSuccess,onFailed) { | |
var _onFailed = function(v) { | |
com_progrestar_game_ui_UI.notify("","request battle_startBastion failed"); | |
if(onFailed != null) { | |
onFailed(null); | |
} | |
}; | |
var _onSuccess = function(data) { | |
var record = new com_progrestar_game_battle_BattleRecord(); | |
if(battle_$pack_rpc_BattleRPC.parseBattleAnswer(record,data)) { | |
var fairId = data.body.fairId; | |
if(fairId != null) { | |
var item = com_progrestar_game_citadel_lib_CitadelMissionLib.instance.getById(StaticExt.asInt(Std,fairId)); | |
if(item != null) { | |
record.battleRewardType = "fair_wonderland"; | |
record.defender = com_progrestar_game_data_LocationLink.take("fair",fairId); | |
if(onSuccess != null) { | |
onSuccess(record); | |
} | |
return; | |
} | |
} | |
} | |
if(onFailed != null) { | |
onFailed(null); | |
} | |
}; | |
com_progrestar_game_server_RpcManager.createCustomRequest("battle_startBastion",{ "forStarmoney" : forStarmoney, "version" : epicwar_haxe_battle_Battle.getVersion()},_onSuccess,_onFailed); | |
}; | |
battle_$pack_rpc_BattleRPC.startBastionConsole = function(id,onSuccess,onFailed) { | |
var _onFailed = function(v) { | |
com_progrestar_game_ui_UI.notify("","request battle_startBastion failed"); | |
if(onFailed != null) { | |
onFailed(null); | |
} | |
}; | |
var _onSuccess = function(data) { | |
var record = new com_progrestar_game_battle_BattleRecord(); | |
if(battle_$pack_rpc_BattleRPC.parseBattleAnswer(record,data)) { | |
var fairId = data.body.fairId; | |
if(fairId != null) { | |
var item = com_progrestar_game_citadel_lib_CitadelMissionLib.instance.getById(StaticExt.asInt(Std,fairId)); | |
if(item != null) { | |
record.battleRewardType = "fair_wonderland"; | |
record.defender = com_progrestar_game_data_LocationLink.take("fair",fairId); | |
if(onSuccess != null) { | |
onSuccess(record); | |
} | |
return; | |
} | |
} | |
} | |
if(onFailed != null) { | |
onFailed(null); | |
} | |
}; | |
com_progrestar_game_server_RpcManager.createCustomRequest("battle_testBastion",{ "forStarmoney" : false, "version" : epicwar_haxe_battle_Battle.getVersion(), "fairId" : id},_onSuccess,_onFailed); | |
}; | |
battle_$pack_rpc_BattleRPC.parseBattleAnswer = function(record,data) { | |
var body = data != null ? data.body : null; | |
if(body == null || body.errorCode) { | |
var value = null; | |
if(body != null && body.errorCode) { | |
value = com_progrestar_common_lang_Translate.translate("T_ERROR_" + Std.string(body.errorCode)); | |
if(!com_progrestar_common_lang_Translate.has("T_ERROR_" + Std.string(body.errorCode))) { | |
value = com_progrestar_common_lang_Translate.translate("T_BATTLE_START_ERROR"); | |
if(com_progrestar_common_global_Env.testMode) { | |
value += "\n" + Std.string(body.errorCode); | |
} | |
} | |
} else { | |
value = "Unknown battle generate error"; | |
} | |
com_progrestar_game_ui_UI.notify("",value); | |
return false; | |
} | |
com_progrestar_framework_core_Assert.isTrue(body != null && body.config,"invalid answer data"); | |
record.replay = false; | |
record.battleId = body.battleId; | |
record.attacker = body.attacker ? new com_progrestar_game_battle_UserDataDto(body.attacker).get_link() : com_progrestar_game_data_LocationLink.fromPlayer(com_progrestar_game_managers_PlayersManager.get_instance().get_self()); | |
if(body.defender) { | |
record.defender = new com_progrestar_game_battle_UserDataDto(body.defender).get_link(); | |
} else if(body.mapId) { | |
record.defender = com_progrestar_game_data_LocationLink.take("crusade",body.mapId); | |
} else { | |
record.defender = com_progrestar_game_battle_UserDataDto.FAKE_MISSION.get_link(); | |
} | |
com_progrestar_game_battle_BattleRecordParser.parseConfig(record,body.config); | |
return true; | |
}; | |
battle_$pack_rpc_BattleRPC.testPvp = function(id,_onSuccess,_onFailed) { | |
}; | |
battle_$pack_rpc_BattleRPC.startPvp = function(onSuccess,onFailed) { | |
var _onFailed = function(v) { | |
com_progrestar_game_ui_UI.notify("","request battle_startPvp failed"); | |
if(onFailed != null) { | |
onFailed(null); | |
} | |
}; | |
var _onSuccess = function(data) { | |
var record = new com_progrestar_game_battle_BattleRecord(); | |
if(battle_$pack_rpc_BattleRPC.parseBattleAnswer(record,data)) { | |
record.battleRewardType = "resource"; | |
if(onSuccess != null) { | |
onSuccess(record); | |
} | |
} else if(onFailed != null) { | |
onFailed(null); | |
} | |
}; | |
com_progrestar_game_server_RpcManager.createCustomRequest("battle_startPvp",{ "version" : epicwar_haxe_battle_Battle.getVersion()},_onSuccess,_onFailed); | |
}; | |
battle_$pack_rpc_BattleRPC.sendState = function(battleId,commands) { | |
var _onSuccess = function(data) { | |
com_progrestar_framework_core_Assert.isTrue(data.body.success == true,"Can't add command (to battle " + battleId + ") " + commands); | |
}; | |
com_progrestar_game_server_RpcManager.createCustomRequest("battle_addCommands",{ "battleId" : battleId, "commands" : commands},_onSuccess,null); | |
}; | |
battle_$pack_rpc_BattleRPC.stopBattle = function(record,onSuccess) { | |
var _onSuccess = function(data) { | |
var _onSuccess1 = com_progrestar_game_battle_BattleRecordParser.parse(data.body,record); | |
onSuccess(_onSuccess1); | |
}; | |
com_progrestar_game_server_RpcManager.createCustomRequest("battle_finish",{ "battleId" : record.battleId, "commands" : record.commands},_onSuccess,null); | |
}; | |
battle_$pack_rpc_BattleRPC.startMission = function(mission,onSuccess,onFailed) { | |
com_progrestar_framework_core_Assert.isTrue(mission != null,"undefined mission for attack"); | |
var _onFailed = function(v) { | |
com_progrestar_game_ui_UI.notify("","request battle_startMission failed"); | |
if(onFailed != null) { | |
onFailed(null); | |
} | |
}; | |
var _onSuccess = function(data) { | |
var record = new com_progrestar_game_battle_BattleRecord(); | |
if(battle_$pack_rpc_BattleRPC.parseBattleAnswer(record,data)) { | |
record.battleRewardType = "resource"; | |
if(onSuccess != null) { | |
onSuccess(record); | |
} | |
} else if(onFailed != null) { | |
onFailed(null); | |
} | |
}; | |
com_progrestar_game_server_RpcManager.createCustomRequest("battle_startMission",{ "id" : mission.get_id(), "version" : epicwar_haxe_battle_Battle.getVersion()},_onSuccess,_onFailed); | |
}; | |
battle_$pack_rpc_BattleRPC.startRevenge = function(revenge,onSuccess,onFailed) { | |
com_progrestar_framework_core_Assert.isTrue(revenge != null,"undefined revenge"); | |
var _onFailed = function(v) { | |
com_progrestar_game_ui_UI.notify("","request battle_startRevenge failed"); | |
if(onFailed != null) { | |
onFailed(null); | |
} | |
}; | |
var _onSuccess = function(data) { | |
var record = new com_progrestar_game_battle_BattleRecord(); | |
if(battle_$pack_rpc_BattleRPC.parseBattleAnswer(record,data)) { | |
com_progrestar_game_data_notice_core_NoticeManager.remove(revenge.get_container()); | |
record.battleRewardType = "resource"; | |
if(onSuccess != null) { | |
onSuccess(record); | |
} | |
} else if(onFailed != null) { | |
onFailed(null); | |
} | |
}; | |
if(revenge.get_container().get_noticeType() != null && revenge.get_container().get_noticeType() != "battle_log_defense") { | |
com_progrestar_game_server_RpcManager.createCustomRequest("battle_startRevenge",{ "noticeId" : revenge.get_container().get_id(), "version" : epicwar_haxe_battle_Battle.getVersion()},_onSuccess,_onFailed); | |
} else { | |
com_progrestar_game_server_RpcManager.createCustomRequest("battle_startRevengeFromBattleLog",{ "battleId" : revenge.get_battleRecord().battleId, "version" : epicwar_haxe_battle_Battle.getVersion()},_onSuccess,_onFailed); | |
} | |
}; | |
battle_$pack_rpc_BattleRPC.testStartPvp = function(targetId,force,onSuccess,onFailed) { | |
var _onFailed = function(v) { | |
com_progrestar_game_ui_UI.notify("","request battle_testStartPvp failed"); | |
if(onFailed != null) { | |
onFailed(null); | |
} | |
}; | |
var _onSuccess = function(data) { | |
var record = new com_progrestar_game_battle_BattleRecord(); | |
if(battle_$pack_rpc_BattleRPC.parseBattleAnswer(record,data)) { | |
record.battleRewardType = "resource"; | |
if(onSuccess != null) { | |
onSuccess(record); | |
} | |
} else if(onFailed != null) { | |
onFailed(null); | |
} | |
}; | |
if(force) { | |
com_progrestar_game_server_RpcManager.createCustomRequest("battle_testPvp",{ "targetId" : targetId},_onSuccess,_onFailed); | |
} else { | |
com_progrestar_game_server_RpcManager.createCustomRequest("battle_testStartPvp",{ "targetId" : targetId},_onSuccess,_onFailed); | |
} | |
}; | |
battle_$pack_rpc_BattleRPC.scenario = function(battleScenario,onSuccess,onFailed) { | |
var _onFailed = function(v) { | |
com_progrestar_game_ui_UI.notify("","request battle_scenario failed"); | |
if(onFailed != null) { | |
onFailed(null); | |
} | |
}; | |
var _onSuccess = function(data) { | |
var record = new com_progrestar_game_battle_BattleRecord(); | |
if(battle_$pack_rpc_BattleRPC.parseBattleAnswer(record,data)) { | |
record.scenario = battleScenario; | |
com_progrestar_game_battle_BattleRecordParser.parseConfig(record,data.body.config); | |
record.commands = data.body.commands; | |
record.battleRewardType = "resource"; | |
record.validationRequired = false; | |
if(onSuccess != null) { | |
onSuccess(record); | |
} | |
} else if(onFailed != null) { | |
onFailed(null); | |
} | |
}; | |
com_progrestar_game_server_RpcManager.createCustomRequest("battle_scenario",{ "scenarioId" : battleScenario.get_id()},_onSuccess,_onFailed); | |
}; | |
battle_$pack_rpc_BattleRPC.startAllianceBattle = function(param,onSuccess) { | |
var _onFailed = function(v) { | |
}; | |
var _onSuccess = function(data) { | |
var info = { "body" : Reflect.field(data.body,"result")}; | |
var record = new com_progrestar_game_battle_BattleRecord(); | |
if(battle_$pack_rpc_BattleRPC.parseBattleAnswer(record,info)) { | |
record.battleRewardType = "resource"; | |
if(onSuccess != null) { | |
onSuccess(record); | |
} | |
} | |
}; | |
com_progrestar_game_server_RpcManager.createCustomRequest("alliance_battle_action_doAttack",param,_onSuccess,_onFailed); | |
}; | |
battle_$pack_rpc_BattleRPC.customMission = function(mapKey,commands,onSuccess,onFailed) { | |
com_progrestar_framework_core_Assert.isTrue(mapKey != null,"invalid mapKey"); | |
var _onFailed = function(v) { | |
com_progrestar_game_ui_UI.notify("","request battle_testMap failed"); | |
if(onFailed != null) { | |
onFailed(null); | |
} | |
}; | |
var _onSuccess = function(data) { | |
var record = new com_progrestar_game_battle_BattleRecord(); | |
if(battle_$pack_rpc_BattleRPC.parseBattleAnswer(record,data)) { | |
com_progrestar_game_battle_BattleRecordParser.parseConfig(record,data.body.config); | |
var unit = null; | |
unit = record.config.attacker.createUnit(); | |
unit.amount = 5; | |
unit.typeId = 7; | |
unit.level = 1; | |
unit.hp = 100; | |
unit.attack.power = 50; | |
unit.attack.bulletSpeed = 3; | |
unit.attack.radiusMin = 0; | |
unit.attack.radiusMax = 5; | |
unit.movement.speed = 1.5; | |
unit.movement.setKind("groundUnit"); | |
unit = record.config.attacker.createUnit(); | |
unit.amount = 10; | |
unit.typeId = 1; | |
unit.level = 1; | |
unit.hp = 40; | |
unit.attack.power = 2; | |
unit.movement.speed = 1; | |
unit.movement.setKind("groundUnit"); | |
unit = record.config.attacker.createUnit(); | |
unit.amount = 10; | |
unit.typeId = 3; | |
unit.level = 1; | |
unit.hp = 40; | |
unit.attack.power = 2; | |
unit.movement.speed = 1; | |
unit.movement.setKind("groundUnit"); | |
unit = record.config.attacker.createUnit(); | |
unit.amount = 10; | |
unit.typeId = 4; | |
unit.level = 1; | |
unit.hp = 40; | |
unit.attack.power = 2; | |
unit.movement.speed = 1; | |
unit.movement.setKind("groundUnit"); | |
record.battleRewardType = "resource"; | |
record.commands = commands; | |
record.validationRequired = false; | |
if(onSuccess != null) { | |
onSuccess(record); | |
} | |
} else if(onFailed != null) { | |
onFailed(null); | |
} | |
}; | |
com_progrestar_game_server_RpcManager.createCustomRequest("battle_testMap",{ "mapKey" : mapKey},_onSuccess,_onFailed); | |
}; | |
battle_$pack_rpc_BattleRPC.prototype = { | |
__class__: battle_$pack_rpc_BattleRPC | |
}; | |
var com_codeazur_as3swf_data_consts_SoundCompression = function() { | |
}; | |
$hxClasses["com.codeazur.as3swf.data.consts.SoundCompression"] = com_codeazur_as3swf_data_consts_SoundCompression; | |
com_codeazur_as3swf_data_consts_SoundCompression.__name__ = ["com","codeazur","as3swf","data","consts","SoundCompression"]; | |
com_codeazur_as3swf_data_consts_SoundCompression.toString = function(soundCompression) { | |
switch(soundCompression) { | |
case 0: | |
return "Uncompressed Native Endian"; | |
case 1: | |
return "ADPCM"; | |
case 2: | |
return "MP3"; | |
case 3: | |
return "Uncompressed Little Endian"; | |
case 4: | |
return "Nellymoser 16kHz"; | |
case 5: | |
return "Nellymoser 8kHz"; | |
case 6: | |
return "Nellymoser"; | |
case 11: | |
return "Speex"; | |
default: | |
return "unknown"; | |
} | |
}; | |
com_codeazur_as3swf_data_consts_SoundCompression.prototype = { | |
__class__: com_codeazur_as3swf_data_consts_SoundCompression | |
}; | |
var com_genome2d_debug_IGDebuggableInternal = function() { }; | |
$hxClasses["com.genome2d.debug.IGDebuggableInternal"] = com_genome2d_debug_IGDebuggableInternal; | |
com_genome2d_debug_IGDebuggableInternal.__name__ = ["com","genome2d","debug","IGDebuggableInternal"]; | |
var com_genome2d_Genome2D = function() { | |
this.g2d_renderMatrixIndex = 0; | |
this.g2d_runTime = 0; | |
this.g2d_currentFrameId = 0; | |
this.autoRender = true; | |
this.autoUpdate = true; | |
if(!com_genome2d_Genome2D.g2d_instantiable) { | |
var pos = { fileName : "Genome2D.hx", lineNumber : 217, className : "com.genome2d.Genome2D", methodName : "new"}; | |
var args = []; | |
args.push("Can't instantiate singleton directly"); | |
var msg = "ERROR: "; | |
if(pos != null) { | |
msg += pos.fileName + ":" + pos.lineNumber + " : " + pos.methodName; | |
} | |
if(args.length > 0) { | |
msg += " : " + args.toString(); | |
} | |
com_genome2d_debug_GDebug.g2d_console += msg; | |
if(com_genome2d_debug_GDebug.useNativeTrace) { | |
console.log(msg); | |
} | |
if(com_genome2d_debug_GDebug.g2d_onDebug != null) { | |
com_genome2d_debug_GDebug.g2d_onDebug.dispatch(msg); | |
} | |
throw new js__$Boot_HaxeError(msg); | |
} | |
com_genome2d_Genome2D.g2d_instance = this; | |
this.g2d_onInitialized = new com_genome2d_callbacks_GCallback0(); | |
this.g2d_onFailed = new com_genome2d_callbacks_GCallback1(); | |
this.g2d_onInvalidated = new com_genome2d_callbacks_GCallback0(); | |
this.g2d_onUpdate = new com_genome2d_callbacks_GCallback1(); | |
this.g2d_onPreRender = new com_genome2d_callbacks_GCallback0(); | |
this.g2d_onPostRender = new com_genome2d_callbacks_GCallback0(); | |
this.g2d_onKeyboardInput = new com_genome2d_callbacks_GCallback1(); | |
}; | |
$hxClasses["com.genome2d.Genome2D"] = com_genome2d_Genome2D; | |
com_genome2d_Genome2D.__name__ = ["com","genome2d","Genome2D"]; | |
com_genome2d_Genome2D.__interfaces__ = [com_genome2d_debug_IGDebuggableInternal]; | |
com_genome2d_Genome2D.g2d_instance = null; | |
com_genome2d_Genome2D.getInstance = function() { | |
if(com_genome2d_Genome2D.g2d_instance == null) { | |
com_genome2d_Genome2D.g2d_instantiable = true; | |
new com_genome2d_Genome2D(); | |
com_genome2d_Genome2D.g2d_instantiable = false; | |
} | |
return com_genome2d_Genome2D.g2d_instance; | |
}; | |
com_genome2d_Genome2D.prototype = { | |
autoUpdate: null | |
,autoRender: null | |
,g2d_onInitialized: null | |
,get_onInitialized: function() { | |
return this.g2d_onInitialized; | |
} | |
,g2d_onFailed: null | |
,get_onFailed: function() { | |
return this.g2d_onFailed; | |
} | |
,g2d_onInvalidated: null | |
,get_onInvalidated: function() { | |
return this.g2d_onInvalidated; | |
} | |
,g2d_onUpdate: null | |
,get_onUpdate: function() { | |
return this.g2d_onUpdate; | |
} | |
,g2d_onPreRender: null | |
,get_onPreRender: function() { | |
return this.g2d_onPreRender; | |
} | |
,g2d_onPostRender: null | |
,get_onPostRender: function() { | |
return this.g2d_onPostRender; | |
} | |
,g2d_onKeyboardInput: null | |
,get_onKeyboardInput: function() { | |
return this.g2d_onKeyboardInput; | |
} | |
,g2d_currentFrameId: null | |
,getCurrentFrameId: function() { | |
return this.g2d_currentFrameId; | |
} | |
,g2d_runTime: null | |
,getRunTime: function() { | |
return this.g2d_runTime; | |
} | |
,g2d_currentFrameDeltaTime: null | |
,getCurrentFrameDeltaTime: function() { | |
return this.g2d_currentFrameDeltaTime; | |
} | |
,g2d_root: null | |
,get_root: function() { | |
return this.g2d_root; | |
} | |
,g2d_context: null | |
,getContext: function() { | |
return this.g2d_context; | |
} | |
,g2d_renderMatrix: null | |
,g2d_renderMatrixIndex: null | |
,g2d_renderMatrixArray: null | |
,g2d_contextConfig: null | |
,g2d_cameras: null | |
,init: function(p_config) { | |
com_genome2d_proto_GPrototypeFactory.initializePrototypes(); | |
com_genome2d_assets_GAssetManager.init(); | |
com_genome2d_text_GFontManager.init(); | |
com_genome2d_textures_GTextureManager.init(); | |
com_genome2d_ui_skin_GUISkinManager.init(); | |
if(this.g2d_root != null) { | |
this.g2d_root.dispose(); | |
} | |
this.g2d_root = com_genome2d_node_GNode.create("root"); | |
this.g2d_cameras = []; | |
this.g2d_renderMatrix = new openfl_geom_Matrix(); | |
this.g2d_renderMatrixIndex = 0; | |
this.g2d_renderMatrixArray = []; | |
if(this.g2d_context != null) { | |
this.g2d_context.dispose(); | |
} | |
this.g2d_contextConfig = p_config; | |
this.g2d_context = Type.createInstance(p_config.contextClass,[this.g2d_contextConfig]); | |
this.g2d_context.onInitialized().add($bind(this,this.g2d_contextInitialized_handler)); | |
this.g2d_context.onFailed().add($bind(this,this.g2d_contextFailed_handler)); | |
this.g2d_context.onInvalidated().add($bind(this,this.g2d_contextInvalidated_handler)); | |
this.g2d_context.init(); | |
} | |
,update: function(p_deltaTime) { | |
this.g2d_currentFrameDeltaTime = p_deltaTime; | |
this.g2d_onUpdate.dispatch(this.g2d_currentFrameDeltaTime); | |
} | |
,render: function(p_camera) { | |
com_genome2d_context_stats_GStats.nodeRendered = 0; | |
com_genome2d_context_stats_GStats.nodeLocalMatrix = 0; | |
com_genome2d_context_stats_GStats.nodeWorldMatrix = 0; | |
if(this.g2d_context.begin()) { | |
this.g2d_onPreRender.dispatch(); | |
this.g2d_renderMatrix.identity(); | |
if(p_camera != null) { | |
p_camera.render(); | |
} else { | |
var cameraCount = this.g2d_cameras.length; | |
if(cameraCount == 0) { | |
this.g2d_root.render(false,false,this.g2d_context.getDefaultCamera()); | |
} else { | |
var _g1 = 0; | |
var _g = cameraCount; | |
while(_g1 < _g) { | |
var i = _g1++; | |
this.g2d_cameras[i].render(); | |
} | |
} | |
} | |
if(this.g2d_onPostRender.hasListeners()) { | |
this.g2d_context.setActiveCamera(this.g2d_context.getDefaultCamera()); | |
this.g2d_context.setRenderTarget(null); | |
this.g2d_onPostRender.dispatch(); | |
} | |
this.g2d_context.end(); | |
} | |
} | |
,dispose: function() { | |
if(this.g2d_root != null) { | |
this.g2d_root.dispose(); | |
} | |
this.g2d_root = null; | |
this.g2d_onInitialized.removeAll(); | |
this.g2d_onFailed.removeAll(); | |
this.g2d_onPostRender.removeAll(); | |
this.g2d_onPreRender.removeAll(); | |
this.g2d_onUpdate.removeAll(); | |
this.g2d_onInvalidated.removeAll(); | |
this.g2d_onKeyboardInput.removeAll(); | |
this.g2d_context.dispose(); | |
this.g2d_context = null; | |
} | |
,g2d_contextInitialized_handler: function() { | |
openfl_Lib.trace("genome2d init success"); | |
this.g2d_context.onFrame().add($bind(this,this.g2d_frame_handler)); | |
this.g2d_context.onMouseInput().add($bind(this,this.g2d_contextMouseInput_handler)); | |
this.g2d_context.onKeyboardInput().add($bind(this,this.g2d_contextKeyboardInput_handler)); | |
this.g2d_onInitialized.dispatch(); | |
} | |
,g2d_contextFailed_handler: function(p_error) { | |
openfl_Lib.trace("genome2d init failed"); | |
if(this.g2d_contextConfig.fallbackContextClass != null) { | |
this.g2d_context = Type.createInstance(this.g2d_contextConfig.fallbackContextClass,[this.g2d_contextConfig]); | |
this.g2d_context.onInitialized().add($bind(this,this.g2d_contextInitialized_handler)); | |
this.g2d_context.onFailed().add($bind(this,this.g2d_contextFailed_handler)); | |
this.g2d_context.init(); | |
} | |
this.g2d_onFailed.dispatch(p_error); | |
} | |
,g2d_contextInvalidated_handler: function() { | |
this.g2d_onInvalidated.dispatch(); | |
} | |
,g2d_frame_handler: function(p_deltaTime) { | |
if(this.autoUpdate) { | |
this.g2d_runTime += p_deltaTime; | |
this.update(p_deltaTime); | |
} | |
if(this.autoRender) { | |
this.g2d_currentFrameId++; | |
this.render(); | |
} | |
} | |
,g2d_addCameraController: function(p_camera) { | |
var _g1 = 0; | |
var _g = this.g2d_cameras.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
if(this.g2d_cameras[i] == p_camera) { | |
return; | |
} | |
} | |
this.g2d_cameras.push(p_camera); | |
} | |
,g2d_removeCameraController: function(p_camera) { | |
var _g1 = 0; | |
var _g = this.g2d_cameras.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
if(this.g2d_cameras[i] == p_camera) { | |
this.g2d_cameras.splice(i,1); | |
} | |
} | |
} | |
,g2d_contextMouseInput_handler: function(p_input) { | |
if(this.g2d_cameras.length == 0) { | |
this.g2d_root.captureMouseInput(p_input); | |
} else { | |
var _g1 = 0; | |
var _g = this.g2d_cameras.length; | |
while(_g1 < _g) { | |
var i = _g1++; | |
this.g2d_cameras[i].g2d_capturedThisFrame = false; | |
} | |
var i1 = this.g2d_cameras.length - 1; | |
while(i1 >= 0) { | |
this.g2d_cameras[i1].captureMouseInput(p_input); | |
--i1; | |
} | |
} | |
} | |
,g2d_contextKeyboardInput_handler: function(p_input) { | |
this.g2d_onKeyboardInput.dispatch(p_input); | |
} | |
,__class__: com_genome2d_Genome2D | |
,__properties__: {get_root:"get_root",get_onKeyboardInput:"get_onKeyboardInput",get_onPostRender:"get_onPostRender",get_onPreRender:"get_onPreRender",get_onUpdate:"get_onUpdate",get_onInvalidated:"get_onInvalidated",get_onFailed:"get_onFailed",get_onInitialized:"get_onInitialized"} | |
}; | |
var com_genome2d_animation_GFrameAnimation = function(p_frameTextures) { | |
this.g2d_currentFrame = -1; | |
this.g2d_playing = true; | |
this.g2d_endIndex = -1; | |
this.g2d_startIndex = -1; | |
this.g2d_lastUpdatedFrameId = 0; | |
this.g2d_accumulatedTime = 0; | |
this.g2d_speed = 33.3333333333333357; | |
this.reversed = false; | |
this.repeatable = true; | |
this.timeDilation = 1; | |
this.g2d_frameTextures = p_frameTextures; | |
this.g2d_frameCount = p_frameTextures.length; | |
this.g2d_currentFrame = 0; | |
if(this.g2d_frameTextures.length |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment