var DirtyFlags,UGameObject=function(){function d(t){this._cameraTarget=null,this._components=[],this.transform=this.addComponent(UTransform),this.name=t||"GameObject"}return d.create=function(t,e){var o=new d(t);return o.transform._initParent(e,null),o},d.createAtScene=function(t,e){var o=new d(t);return o.transform._initParent(null,e),o},d.prototype.addComponent=function(t){var e=Laya.ClassUtils.getInstance(t);return(e.gameObject=this)._components.push(e),d._isComponentBucketDirty=!0,e},d.prototype.getComponent=function(t){for(var e=0;e<this._components.length;e++){var o=this._components[e];if(o instanceof t)return o}return null},d.prototype.getComponentT=function(t){return this.getComponent(t)},d.prototype.getOrAddComponent=function(t){return this.getComponent(t)||this.addComponent(t)},d.prototype.getComponents=function(t,e){for(var o=0;o<this._components.length;o++){var i=this._components[o];i instanceof t&&e.push(i)}},d.prototype.getComponentInChildren=function(t){var e=this.getComponent(t);if(e)return e;for(var o=this.transform.getChildCount(),i=0;i<o;i++){if(e=this.transform.getChild(i).gameObject.getComponent(t))return e}return null},d.prototype.getComponentsInChildren=function(t,e){this.getComponents(t,e);for(var o=this.transform.getChildCount(),i=0;i<o;i++){this.transform.getChild(i).gameObject.getComponentsInChildren(t,e)}},Object.defineProperty(d.prototype,"name",{get:function(){return this._name},set:function(t){this._name=t,this.transform.getInternalNode().name=t},enumerable:!0,configurable:!0}),d.prototype.onCollisionEnter2D=function(t){for(var e=0,o=this._components;e<o.length;e++){var i=o[e],n=i.onCollisionEnter2D;n&&n.call(i,t)}},d.prototype.onCollisionExit2D=function(t){for(var e=0,o=this._components;e<o.length;e++){var i=o[e],n=i.onCollisionExit2D;n&&n.call(i,t)}},d.prototype.onDestroy=function(){for(var t=0;t<this.transform.getChildCount();++t){this.transform.getChild(t).gameObject.onDestroy()}for(t=1;t<this._components.length;t++){this._components[t].onDestroy()}this.transform.onDestroy(),this._components=null,this.transform=null},d.find=function(t){var e,o=SceneMgr.instance.getActiveScene(),i=t.indexOf("/");e=-1==i?t:t.substring(0,i);for(var n=0,r=o.getRootTransforms();n<r.length;n++){var s=r[n];if(s.name==e){if(-1==i)return s.gameObject;var a=s.find2(t,i+1);return a?a.gameObject:null}}return null},d.deserialize=function(t,e,o){var i,n=(i=o instanceof UTransform?d.create(t.name,o):o instanceof SceneBase?d.createAtScene(t.name,o):d.create(t.name,null)).transform,r=!1;null==e&&(r=!0,(e=new RefResolver).begin()),e.addRef(i,t.__id);for(var s=t.components,a=0;a<s.length;a++){var l=s[a],c=void 0,p=ComponentMap.name2Cls[l.__type];if(!p)throw new Error("unsupported component type "+l.__type+". Please register in ComponentMap.ts");p==UTransform?c=i.getComponent(p):(c=i.addComponent(p),p==UCameraTarget&&i.setCameraTarget(c)),e.addRef(c,l.__id),c.deserialize(l,e)}for(var h=t.children,u=0;u<h.length;++u){d.deserialize(h[u],e,n).transform.setParent(n)}return r&&e.end(),i},d.prototype.serialize=function(t){var e=!1;null==t&&(e=!0,(t=new RefResolver).begin());for(var o=t.getRefId(this),i=[],n=0;n<this._components.length;n++){var r=this._components[n],s=t.getRefId(r),a=r.serialize(t);a.__type=r.getSerializeClassName(),a.__id=s,i.push(a)}var l=[];for(n=0;n<this.transform.getChildCount();n++){var c=this.transform.getChild(n).gameObject;l.push(c.serialize(t))}return e&&t.end(),{__id:o,name:this.name,components:i,children:l}},d.setComponentBucketDirty=function(t){this._isComponentBucketDirty=t},d.isComponentBucketDirty=function(){return this._isComponentBucketDirty},d.Destroy=function(t){if(t&&t.transform){var e=t.transform.getScene();e&&e.destroyGameObject(t)}},d.prototype.getNetAgent=function(){var t=this.getComponent(UNetAgentProxy);return null!=t?t.agent:null},d.prototype.getNetID=function(){var t=this.getNetAgent();return null!=t?t.netId:0},d.prototype.updateComponentBucket=function(t,e,o,i){for(var n=0,r=this._components;n<r.length;n++){var s=r[n],a=s.__proto__.BEHAVIOR_FLAGS;a&BEHAVIOR_AWAKE_START&&s._needAwake&&i.push(s),a&BEHAVIOR_UPDATE&&s.enabled&&t.push(s),a&BEHAVIOR_FIXED_UPDATE&&s.enabled&&e.push(s),a&BEHAVIOR_LATE_UPDATE&&s.enabled&&o.push(s)}for(var l=0,c=this.transform.getChildren();l<c.length;l++){c[l].gameObject.updateComponentBucket(t,e,o,i)}},d.prototype.setVisible=function(t){this.transform.getInternalNode().visible=t},d.prototype.setCameraTarget=function(t){this._cameraTarget=t},Object.defineProperty(d.prototype,"cameraTarget",{get:function(){return this._cameraTarget},enumerable:!0,configurable:!0}),d._isComponentBucketDirty=!1,d}(),__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),UComponent=function(e){function t(){var t=e.call(this)||this;return t._enabled=!0,t._needAwake=!0,t._needStart=!0,t}return __extends(t,e),t.prototype.doAwake=function(){this._needAwake&&this._enabled&&(this._needAwake=!1,this.awake())},t.prototype.doStart=function(){this._needStart&&(this._needStart=!1,this.start())},t.prototype.isSingleton=function(){return!1},t.prototype.awake=function(){},t.prototype.start=function(){},t.prototype.update=function(){},t.prototype.fixedUpdate=function(){},t.prototype.lateUpdate=function(){},t.prototype.onDestroy=function(){},t.prototype.deserialize=function(t,e){deserializeSimple(this,t,e)},t.prototype.serialize=function(t){return serializeSimple(this,t)},Object.defineProperty(t.prototype,"transform",{get:function(){return this.gameObject.transform},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.gameObject.name},enumerable:!0,configurable:!0}),t.prototype.getSerializeClassName=function(){var t=Object.getPrototypeOf(this).__CompName__;return t||console.error("noserialized class name for ",this,"register it in ComponentMap"),t},t.prototype.onEnable=function(){},t.prototype.onDisable=function(){},Object.defineProperty(t.prototype,"enabled",{get:function(){return this._enabled},set:function(t){t!=this.enabled&&((this._enabled=t)?this.onEnable():this.onDisable(),UGameObject.setComponentBucketDirty(!0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"needAwake",{get:function(){return this._needAwake},set:function(t){this._needAwake=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"needStart",{get:function(){return this._needStart},set:function(t){this._needStart=t},enumerable:!0,configurable:!0}),t}(Laya.EventDispatcher),__decorate=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),this&&this.__decorate||function(t,e,o,i){var n,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,i);else for(var a=t.length-1;0<=a;a--)(n=t[a])&&(s=(r<3?n(s):3<r?n(e,o,s):n(e,o))||s);return 3<r&&s&&Object.defineProperty(e,o,s),s}),UCollider2D=function(e){function t(){var t=e.call(this)||this;return t._body=null,t.collision_group=0,t.collision_category=1,t.collision_mask=4294967295,t.isSensor=!1,t}return __extends(t,e),t.prototype.getInternalBody=function(){},t.prototype.updateTransform=function(){console.log("UCollider2D.updateTransform")},t.prototype.onBeginContact=function(t){this.gameObject.__Destroyed||t.otherCollider.gameObject.__Destroyed||this.gameObject.onCollisionEnter2D(t)},t.prototype.onEndContact=function(t){this.gameObject.__Destroyed||t.otherCollider.gameObject.__Destroyed||this.gameObject.onCollisionExit2D(t)},Object.defineProperty(t.prototype,"angularVelocity",{get:function(){return this._body?this._body.GetAngularVelocity():0},set:function(t){this._body&&this._body.SetAngularVelocity(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"linearVelocity",{get:function(){return this._body?this._body.GetLinearVelocity():0},set:function(t){this._body&&this._body.SetLinearVelocity(t)},enumerable:!0,configurable:!0}),t.prototype.onEnable=function(){this._body&&this._body.SetActive(!0)},t.prototype.onDisable=function(){this._body&&(console.log("disable!"),this._body.SetActive(!1))},t.prototype.setCollisionGroup=function(t){if(this.collision_group=t,this._body)for(var e=this._body.GetFixtureList();null!=e;){e.GetFilterData().groupIndex=t,e=e.GetNext()}},t.prototype.getCollisionGroup=function(){return this.collision_group},t.prototype.setCollisionCategory=function(t){if(this.collision_category=t,this._body)for(var e=this._body.GetFixtureList();null!=e;){e.GetFilterData().categoryBits=t,e=e.GetNext()}},t.prototype.getCollisionCategory=function(){return this.collision_category},t.prototype.setCollisionMask=function(t){if(this.collision_mask=t,this._body)for(var e=this._body.GetFixtureList();null!=e;){e.GetFilterData().maskBits=t,e=e.GetNext()}},t.prototype.getCollisionMask=function(){return this.collision_mask},t.prototype.onDestroy=function(){this._body=null},__decorate([serialize],t.prototype,"collision_group",void 0),__decorate([serialize],t.prototype,"collision_category",void 0),__decorate([serialize],t.prototype,"collision_mask",void 0),__decorate([serialize],t.prototype,"isSensor",void 0),t}(UComponent),UBoxCollider2D=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),__decorate=this&&this.__decorate||function(t,e,o,i){var n,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,i);else for(var a=t.length-1;0<=a;a--)(n=t[a])&&(s=(r<3?n(s):3<r?n(e,o,s):n(e,o))||s);return 3<r&&s&&Object.defineProperty(e,o,s),s},function(e){function t(){var t=e.call(this)||this;return t._lastSave=null,t.size=new Vector2(100,100),t.offset=Vector2.ZERO,t._body=null,t._fixture=null,t._realArea=-1,t._lastSave=[],t}return __extends(t,e),t.prototype.awake=function(){this._createInternalBody()},t.prototype._createInternalBody=function(){var t=new b2BodyDef,e=this.gameObject.transform,o=e.getScene().getPhyiscsWorld(),i=this.offset.x,n=this.offset.y,r=e.transformPoint(new Vector3(i,n,0));t.position.x=r.x,t.position.y=r.y;var s=this.solveBodyAngle();t.angle=s*DEG2RAD,this._body=o.createBody(t);var a=new Box2D.b2FixtureDef,l=new Box2D.b2PolygonShape,c=e.getGlobalScale(),p=.5*this.size.x*Math.abs(c.x),h=.5*this.size.y*Math.abs(c.y);this._realArea=p*h*4,l.SetAsBox(p,h),a.set_shape(l),a.set_density(this.getMass()/this._realArea);var u=new Box2D.b2Filter;u.categoryBits=1<<this.collision_category,u.maskBits=this.collision_mask,u.groupIndex=this.collision_group,a.filter=u,a.isSensor=this.isSensor,this._fixture=a,this._body.CreateFixture(a),this._body._collider2D=this},t.prototype.fixedUpdate=function(){this._saveCurrentTransform()},t.prototype.solveBodyAngle=function(){for(var t=this.transform,e=0,o=t.getInternalNode(),i=t.getSceneRoot();o!=i;)o.scaleX<0&&(e=-e),e+=o.rotation,o=o.parent;return e},t.prototype.invSolveBodyAngle=function(t){for(var e=this.transform,o=e.getInternalNode(),i=[],n=e.getSceneRoot();o!=n;)i.push(o),o=o.parent;for(var r=i.length-1;1<=r;--r)t-=(o=i[r]).rotation,o.scaleX<0&&(t=-t);return t},t.prototype.updateTransform=function(t){if(void 0===t&&(t=!1),this._body.GetType()!=Box2D.b2_staticBody){var e=this._body.GetPosition();if(0==this._lastSave.length)this._updateTransform(e.x,e.y,this._body.GetAngle());else{var o=Time.time,i=Time.physicsTime;if(i<=o||t)this._updateTransform(e.x,e.y,this._body.GetAngle());else{var n=this._lastSave[0],r=(o-n)/(i-n),s=1-r,a=s*this._lastSave[1]+r*e.x,l=s*this._lastSave[2]+r*e.y,c=s*this._lastSave[3]+r*this._body.GetAngle();this._updateTransform(a,l,c)}}}},t.prototype.getInternalBody=function(){return this._body},t.prototype.getArea=function(){return console.assert(0<this._realArea,"collider area not inited!"),this._realArea},t.prototype._saveCurrentTransform=function(){var t=this._body.GetPosition();this._lastSave[0]=Time.physicsTime,this._lastSave[1]=t.x,this._lastSave[2]=t.y,this._lastSave[3]=this._body.GetAngle()},t.prototype._updateTransform=function(t,e,o){var i=this.gameObject.transform,n=new Vector3(t,e,0),r=i.inverseTransformPoint(n),s=r.x-this.offset.x,a=r.y-this.offset.y;r=i.transformToParent(new Vector3(s,a,0));var l=this.invSolveBodyAngle(o*RAD2DEG);i.setLocalPosition(r),i.setLocalRotation(new Vector3(0,0,l))},t.prototype.getMass=function(){var t=this.gameObject.getComponentT(UBodyPart);return t?t.getMass():this.gameObject.getComponentT(URigidbody2D).mass},__decorate([autoSerialize(SerializeVector2)],t.prototype,"offset",void 0),__decorate([autoSerialize(SerializeVector2)],t.prototype,"size",void 0),t}(UCollider2D)),UCapsuleCollider2D=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),function(t){function e(){return t.call(this)||this}return __extends(e,t),e.prototype.getArea=function(){return 1},e}(UCollider2D)),UJoint2D=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),__decorate=this&&this.__decorate||function(t,e,o,i){var n,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,i);else for(var a=t.length-1;0<=a;a--)(n=t[a])&&(s=(r<3?n(s):3<r?n(e,o,s):n(e,o))||s);return 3<r&&s&&Object.defineProperty(e,o,s),s},function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.connectedRigidBody=null,t.anchor=[0,0],t.connectedAnchor=[0,0],t.enableCollision=!1,t._toBreak=null,t._constraint=null,t}return __extends(t,e),t.prototype.start=function(){this._buildConstraint(this.getJointDefClass(),this.getJointClass())},t.prototype.update=function(){this._toBreak&&(this.transform.getScene().getPhyiscsWorld().destroyJoint(this._toBreak),this._toBreak=null)},t.prototype.getInternalJoint=function(){return this._constraint},t.prototype.getConnectedRigidbody=function(){return this.connectedRigidBody},t.prototype._buildConstraint=function(t,e){if(null!=this.connectedRigidBody){var o=this.connectedRigidBody.getInternalBody();if(null!=o){var i=this.gameObject.getComponent(URigidbody2D);if(null!=i){var n=i.getInternalBody();if(null!=n){var r=this.transform.getScene().getPhyiscsWorld(),s=new t;this._initJointDef(s,r,n,o),this._constraint=r.createJoint(s)}}}}},t.prototype._initJointDef=function(t,e,o,i){var n=this.connectedRigidBody.gameObject.transform.transformPoint(new Vector3(this.connectedAnchor[0],this.connectedAnchor[1],0)),r=new Box2D.b2Vec2(n.x,n.y),s=(t.bodyB=i).GetLocalPoint(r);t.localAnchorB=s,n=this.transform.transformPoint(new Vector3(this.anchor[0],this.anchor[1],0)),r=new Box2D.b2Vec2(n.x,n.y);var a=(t.bodyA=o).GetLocalPoint(r);t.localAnchorA=a},t.prototype.break=function(){null!=this._constraint&&(this._toBreak=this._constraint,this._constraint=null,this.connectedRigidBody=null)},__decorate([autoSerialize(null,!0)],t.prototype,"connectedRigidBody",void 0),__decorate([serialize],t.prototype,"anchor",void 0),__decorate([serialize],t.prototype,"connectedAnchor",void 0),__decorate([serialize],t.prototype,"enableCollision",void 0),t}(UComponent)),UFixedJoint2D=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),function(s){function t(){return null!==s&&s.apply(this,arguments)||this}return __extends(t,s),t.prototype._initJointDef=function(t,e,o,i){s.prototype._initJointDef.call(this,t,e,o,i);var n=o.GetAngle(),r=i.GetAngle()-n;t.referenceAngle=r},t.prototype.getJointClass=function(){return Box2D.b2WeldJoint},t.prototype.getJointDefClass=function(){return Box2D.b2WeldJointDef},t}(UJoint2D)),UHingeJoint2D=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),__decorate=this&&this.__decorate||function(t,e,o,i){var n,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,i);else for(var a=t.length-1;0<=a;a--)(n=t[a])&&(s=(r<3?n(s):3<r?n(e,o,s):n(e,o))||s);return 3<r&&s&&Object.defineProperty(e,o,s),s},function(l){function t(){var t=l.call(this)||this;return t.useLimits=!0,t.limits=Vector2.ZERO,t}return __extends(t,l),t.prototype._initJointDef=function(t,e,o,i){l.prototype._initJointDef.call(this,t,e,o,i),t.enableLimit=this.useLimits;var n=o.GetAngle(),r=i.GetAngle()-n;if(t.referenceAngle=r,this.useLimits){var s=this.limits.x,a=this.limits.y;t.lowerAngle=s*DEG2RAD,t.upperAngle=a*DEG2RAD}},t.prototype.getJointClass=function(){return Box2D.b2RevoluteJoint},t.prototype.getJointDefClass=function(){return Box2D.b2RevoluteJointDef},t.prototype.onMirrored=function(){var t=this.limits,e=t.x;t.x=-t.y,t.y=-e},__decorate([serialize],t.prototype,"referenceAngle",void 0),__decorate([serialize],t.prototype,"useLimits",void 0),__decorate([autoSerialize(SerializeVector2)],t.prototype,"limits",void 0),t}(UJoint2D)),UPolygonCollider2D=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),function(t){function e(){return t.call(this)||this}return __extends(e,t),e.prototype.getArea=function(){return 0},e}(UCollider2D)),URigidbody2D=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),__decorate=this&&this.__decorate||function(t,e,o,i){var n,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,i);else for(var a=t.length-1;0<=a;a--)(n=t[a])&&(s=(r<3?n(s):3<r?n(e,o,s):n(e,o))||s);return 3<r&&s&&Object.defineProperty(e,o,s),s},function(o){function e(){var t=o.call(this)||this;return t.isBullet=!1,t.active=!0,t.serBuff=[0,0,0],t.mass=1,t.drag=0,t.angularDrag=0,t.simulated=!0,t._collider=null,t.bodyType=e.BODY_TYPE_STATIC,t}return __extends(e,o),e.prototype.awake=function(){this._collider=this.gameObject.getComponent(UCollider2D)},e.prototype.start=function(){this._initBody()},e.prototype.update=function(){this.simulated&&null!=this._collider&&this._collider.updateTransform()},e.prototype._initBody=function(){var t=this.getInternalBody();t&&(this.updateBodyType(),t.SetBullet(this.isBullet),t.SetActive(this.active),t.SetAngularDamping(this.angularDrag),t.SetLinearDamping(this.linearDrag))},e.prototype.setIsBullet=function(t){var e=this.getInternalBody();e&&(e.SetBullet(t),this.isBullet=t)},e.prototype.getIsBullet=function(){return this.isBullet},e.prototype._destroyBody=function(){var t=this.getInternalBody();t&&this.transform.getScene().getPhyiscsWorld().destroyBody(t)},e.prototype.deserialize=function(t,e){o.prototype.deserialize.call(this,t,e)},e.prototype.serialize=function(t){return o.prototype.serialize.call(this,t)},e.prototype.getInternalBody=function(){return this._collider?this._collider.getInternalBody():null},e.prototype.applyForce=function(t,e){var o=this.getInternalBody();if(null!=o){var i=FrameAllocator.b2Vec2(t.x,t.y);e?o.ApplyForce(i,FrameAllocator.b2Vec2(e.x,e.y)):o.ApplyForceToCenter(i)}},e.prototype.applyImpulse=function(t,e){var o=this.getInternalBody();if(null!=o){var i=FrameAllocator.b2Vec2(t.x,t.y);o.ApplyImpulse(i,FrameAllocator.b2Vec2(e.x,e.y))}},e.prototype.applyTorque=function(t){var e=this.getInternalBody();null!=e&&e.ApplyTorque(t)},e.prototype.setLinearVelocity=function(t){this.getInternalBody().SetLinearVelocity(FrameAllocator.b2Vec2(t.x,t.y))},e.prototype.getLinearVelocity=function(t){void 0===t&&(t=null),null==t&&(t=new Vector2);var e=this.getInternalBody().GetLinearVelocity();return t.x=e.x,t.y=e.y,t},e.prototype.SetAngularVelocity=function(t){this.getInternalBody().SetAngularVelocity(t)},e.prototype.GetAngularVelocity=function(){return this.getInternalBody().GetAngularVelocity()},e.prototype.serializeMoveState=function(t,e){var o=this.getInternalBody(),i=o.GetPosition();t[e]=i.x,t[e+1]=i.y,t[e+2]=o.GetAngle()},e.prototype.deserializeMoveState=function(t,e){this.getInternalBody().SetPositionAndAngle(FrameAllocator.b2Vec2(t[e],t[e+1]),t[e+2])},e.prototype.updateBodyType=function(){var t=this.getInternalBody();null!=t&&(this.bodyType==e.BODY_TYPE_STATIC?t.SetType(Box2D.b2_staticBody):this.bodyType==e.BODY_TYPE_DYNAMIC?t.SetType(Box2D.b2_dynamicBody):this.bodyType==e.BODY_TYPE_KINEMATIC?t.SetType(Box2D.b2_kinematicBody):console.assert(!1,"unknown body type: "+this.bodyType))},e.prototype.setBodyType=function(t){t!=this.bodyType&&(this.bodyType=t,this.updateBodyType())},e.prototype.getBounds=function(t){null==t&&(t=new Vector4);var e=this.getInternalBody().GetFixtureList().GetAABB(),o=e.GetCenter(),i=e.GetExtents();return t.x=o.x-i.x,t.y=o.y-i.y,t.z=o.x+i.x,t.w=o.y+i.y,t},e.prototype.setActive=function(t){if(this.active!=t){this.active=t;var e=this.getInternalBody();e&&e.SetActive(t)}},e.prototype.isActive=function(){return this.active},e.prototype.onDestroy=function(){this._destroyBody(),this._collider=null,o.prototype.onDestroy.call(this)},e.BODY_TYPE_STATIC="Static",e.BODY_TYPE_DYNAMIC="Dynamic",e.BODY_TYPE_KINEMATIC="Kinematic",e.MOVE_STATE_LENGTH=3,__decorate([serialize],e.prototype,"mass",void 0),__decorate([serialize],e.prototype,"drag",void 0),__decorate([serialize],e.prototype,"angularDrag",void 0),__decorate([serialize],e.prototype,"linearDrag",void 0),__decorate([serialize],e.prototype,"bodyType",void 0),e}(UComponent)),USpringJoint2D=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),__decorate=this&&this.__decorate||function(t,e,o,i){var n,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,i);else for(var a=t.length-1;0<=a;a--)(n=t[a])&&(s=(r<3?n(s):3<r?n(e,o,s):n(e,o))||s);return 3<r&&s&&Object.defineProperty(e,o,s),s},function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.distance=0,t.dampingRatio=0,t.frequency=1,t}return __extends(t,n),t.prototype.getJointClass=function(){return Box2D.b2DistanceJoint},t.prototype.getJointDefClass=function(){return Box2D.b2DistanceJointDef},t.prototype._initJointDef=function(t,e,o,i){n.prototype._initJointDef.call(this,t,e,o,i),t.length=this.distance,t.dampingRatio=this.dampingRatio,t.frequencyHz=this.frequency},__decorate([serialize],t.prototype,"distance",void 0),__decorate([serialize],t.prototype,"dampingRatio",void 0),__decorate([serialize],t.prototype,"frequency",void 0),t}(UJoint2D)),USpriteRenderer=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),__decorate=this&&this.__decorate||function(t,e,o,i){var n,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,i);else for(var a=t.length-1;0<=a;a--)(n=t[a])&&(s=(r<3?n(s):3<r?n(e,o,s):n(e,o))||s);return 3<r&&s&&Object.defineProperty(e,o,s),s},function(i){function t(){var t=i.call(this)||this;return t._texture=null,t.repeat=!1,t._texturePath="",t._pivot=Vector2.ZERO,t.size=Vector2.ZERO,t}return __extends(t,i),t.prototype.getPivot=function(){return this._pivot},t.prototype.loadTexture=function(e){var o=this;this._texturePath=e,this._texturePath?(this._texture&&this._texture.off("loaded",this,this.onTilingTextureLoaded),""!=e&&Gui.GuiMgr.instance.loadres(e,null,function(t){t&&(o._texture=Gui.GuiMgr.instance.getRes(e),o.onTilingTextureLoaded())})):this.transform.getInternalNode().graphics.clear()},t.prototype.onTilingTextureLoaded=function(){if(null!=this.transform){var t=this.transform.getInternalNode();if(t.graphics.clear(!0),this.repeat){var e=this._pivot.x/this._texture.width*this.size.x,o=this._pivot.x/this._texture.height*this.size.y;t.graphics.fillTexture(this._texture,-e,-o,this.size.x,this.size.y,"repeat")}else t.graphics.drawTexture(this._texture,-this._pivot.x,-this._pivot.y)}},t.prototype.deserialize=function(t,e){i.prototype.deserialize.call(this,t,e);var o=t.sprite;this._texturePath=o.texture,this._pivot=new Vector2(o.pivot[0],o.pivot[1]),this.loadTexture(this._texturePath)},t.prototype.serialize=function(t){var e=i.prototype.serialize.call(this,t);return e.sprite={texture:this._texturePath,pivot:[this._pivot.x,this._pivot.y]},e},t.prototype.onDestroy=function(){this._texture=null,i.prototype.onDestroy.call(this)},t.prototype.setAlpha=function(t){null!=this.transform&&(this.transform.getInternalNode().alpha=t)},t.prototype.setColor=function(t,e,o,i){if(this.transform)if(this.tintFilter){this.transform.getInternalNode().filters=[this.tintFilter];var n=this.tintFilter._mat;n[0]=t,n[5]=e,n[10]=o,n[15]=i}else{var r=[t,0,0,0,0,0,e,0,0,0,0,0,o,0,0,0,0,0,i,0];this.tintFilter=new Laya.ColorFilter(r),this.transform.getInternalNode().filters=[this.tintFilter]}},Object.defineProperty(t.prototype,"texture",{set:function(t){var e=Gui.GuiMgr.instance.getRes(t);e instanceof Laya.Texture&&(this._texture=e,this._texturePath=t,this.onTilingTextureLoaded())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"texturePath",{get:function(){return this._texturePath},set:function(t){this._texturePath=t},enumerable:!0,configurable:!0}),__decorate([serialize],t.prototype,"zorder",void 0),__decorate([serialize],t.prototype,"repeat",void 0),__decorate([autoSerialize(SerializeVector2)],t.prototype,"size",void 0),t}(UComponent)),UTrailRenderer=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),__decorate=this&&this.__decorate||function(t,e,o,i){var n,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,i);else for(var a=t.length-1;0<=a;a--)(n=t[a])&&(s=(r<3?n(s):3<r?n(e,o,s):n(e,o))||s);return 3<r&&s&&Object.defineProperty(e,o,s),s},function(o){function t(){var t=o.call(this)||this;return t.segCount=10,t.startPoint=null,t.endPoint=null,t.texture=null,t.sampleCount=0,t.vertices=null,t.indices=null,t.sprite=null,t}return __extends(t,o),t.prototype.deserialize=function(t,e){o.prototype.deserialize.call(this,t,e),this._texturePath=t.texture},t.prototype.serialize=function(t){var e=o.prototype.serialize.call(this,t);return e.texture=this._texturePath,e},t.prototype.awake=function(){this.initVertex(),this.loadTexture()},t.prototype.initVertex=function(){var t=8*(2*this.segCount+2),e=6*this.segCount;this.vertices=new Float32Array(t),this.indices=new Uint16Array(e);for(var o=1/this.segCount,i=0,n=0,r=0,s=0,a=0;a<=this.segCount;++a)i<e&&(this.indices[i++]=n+0,this.indices[i++]=n+1,this.indices[i++]=n+2,this.indices[i++]=n+2,this.indices[i++]=n+1,this.indices[i++]=n+3,n+=2),this.vertices[r++]=0,this.vertices[r++]=0,this.vertices[r++]=s,this.vertices[r++]=0,this.vertices[r++]=1,this.vertices[r++]=1,this.vertices[r++]=1,this.vertices[r++]=1,this.vertices[r++]=0,this.vertices[r++]=0,this.vertices[r++]=s,this.vertices[r++]=1,this.vertices[r++]=1,this.vertices[r++]=1,this.vertices[r++]=1,this.vertices[r++]=1,s+=o},t.prototype.loadTexture=function(){var o=this;Gui.GuiMgr.instance.loadres(this._texturePath,this,function(t){if(t){var e=Gui.GuiMgr.instance.getRes(o._texturePath);o.onTextureLoaded(e)}})},t.prototype.onTextureLoaded=function(t){t&&(this.texture=t,this.texture.bitmap.enableMerageInAtlas=!1)},t.prototype.setTexturePath=function(t,e){void 0===e&&(e=!1),t!=this._texturePath&&(this._texturePath=t,e&&this.loadTexture())},t.prototype.lateUpdate=function(){if(null!=this.startPoint&&null!=this.endPoint&&this.texture){var t=this.transform,e=t.transformFrom(Vector3.ZERO,this.startPoint),o=t.transformFrom(Vector3.ZERO,this.endPoint);this.addSample(e,o),this.sprite||(this.sprite=new JLShader.Texture2DSprite,this.sprite.indexesBuffer=this.indices,this.sprite.textureHost=this.texture,this.transform.getInternalNode().parent.addChildAt(this.sprite,0)),this.sprite.vertexBuffer=this.vertices}},t.prototype.addSample=function(t,e){if(!(this.segCount<1)){for(var o=this.vertices,i=this.vertices.length-16;0<i;i-=16)o[i+8]=o[i-8],o[i+9]=o[i-7],o[i]=o[i-16],o[i+1]=o[i-15];o[0]=t.x,o[1]=t.y,o[8]=e.x,o[9]=e.y}},t.prototype.onDestroy=function(){this.sprite&&this.sprite.destroy()},t.DEBUG_DRAW=!1,__decorate([serialize],t.prototype,"segCount",void 0),__decorate([autoSerialize(null,!0)],t.prototype,"startPoint",void 0),__decorate([autoSerialize(null,!0)],t.prototype,"endPoint",void 0),t}(UComponent));__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}();!function(t){t[t.Position=1]="Position",t[t.Scale=2]="Scale",t[t.Rotation=4]="Rotation"}(DirtyFlags||(DirtyFlags={}));var CollideEffectType,UTransform=function(o){function t(){var t=o.call(this)||this;return t._isInitedParent=!1,t._node=new Laya.Sprite,t._children=[],t._parent=null,t._localPosition=Vector3.ZERO.clone(),t._localScale=Vector3.ONE.clone(),t._localRotation=Vector3.ZERO.clone(),t._isDirty=0,t}return __extends(t,o),t.prototype.deserialize=function(t,e){var o=t.localPosition;this.setLocalPosition(new Vector3(o[0],o[1],o[2]));var i=t.localScale;this.setLocalScale(new Vector3(i[0],i[1],i[2]));var n=t.localRotation;this.setLocalRotation(new Vector3(n[0],n[1],n[2]))},t.prototype.serialize=function(t){var e=o.prototype.serialize.call(this,t);return e.localPosition=[this._localPosition.x,this._localPosition.y,this._localPosition.z],e.localScale=[this._localScale.x,this._localScale.y,this._localScale.z],e.localRotation=[this._localRotation.x,this._localRotation.y,this._localRotation.z],e},t.prototype._updateInternalNode=function(){if(null!=this._node&&0!=this._isDirty){var t=this._isDirty,e=this._node;t&DirtyFlags.Position&&e.pos(this._localPosition.x,this._localPosition.y),t&DirtyFlags.Scale&&e.scale(this._localScale.x,this._localScale.y),t&DirtyFlags.Rotation&&(e.rotation=this._localRotation.z),this._isDirty=0}},t.prototype.getInternalNode=function(){return this._node},t.prototype._initParent=function(t,e){void 0===e&&(e=null),this._isInitedParent?console.error("DO NOT CALL THIS!"):(this._isInitedParent=!0,null==(this._parent=t)?null==(this._scene=e)&&(this._scene=SceneMgr.instance.getActiveScene()):this._scene=t._scene,null==t?this._scene.onChildAdded(this):t._onChildAdded(this))},t.prototype.setParent=function(t){t!==this._parent&&(this._parent?this._parent._onChildRemoved(this):null==this._parent&&this._scene.onChildRemoved(this),null!=(this._parent=t)?(console.assert(t._scene==this._scene,"Changing scene is not supported a.t.m!"),t._onChildAdded(this)):this._scene.onChildAdded(this))},t.prototype.getParent=function(){return this._parent},t.prototype._onChildRemoved=function(t){t._node.removeSelf();var e=this._children.indexOf(t);-1<e&&this._children.splice(e)},t.prototype._onChildAdded=function(t){this._children.push(t),this._node.addChild(t._node)},t.prototype.setLocalPosition=function(t){t.cloneTo(this._localPosition),this._isDirty|=DirtyFlags.Position,this._updateInternalNode()},t.prototype.getLocalPosition=function(t){return t?(this._localPosition.cloneTo(t),t):this._localPosition.clone()},t.prototype.transformPoint=function(t){var e=new Laya.Point(t.x,t.y);return this._node.localToGlobal(e),this.getSceneRoot().globalToLocal(e),new Vector3(e.x,e.y,t.z)},t.prototype.inverseTransformPoint=function(t){var e=new Laya.Point(t.x,t.y);return this.getSceneRoot().localToGlobal(e),this._node.globalToLocal(e),new Vector3(e.x,e.y,t.z)},t.prototype.transformAngle=function(t){for(var e=t,o=this._node;null!=o;)o.scaleX<0?e-=o.rotation:e+=o.rotation,o=o.parent;return e},t.prototype.inverseTransformAngle=function(t){for(var e=t,o=this._node;null!=o;)o.scaleX<0?e+=o.rotation:e-=o.rotation,o=o.parent;return e},t.prototype.setLocalScale=function(t){t.cloneTo(this._localScale),this._isDirty|=DirtyFlags.Scale,this._updateInternalNode()},t.prototype.getLocalScale=function(t){return t?(this._localScale.cloneTo(t),t):this._localScale.clone()},t.prototype.getLocalRotation=function(t){return t?(this._localRotation.cloneTo(t),t):this._localRotation.clone()},t.prototype.setLocalRotation=function(t){t.cloneTo(this._localRotation),this._isDirty|=DirtyFlags.Rotation,this._updateInternalNode()},t.prototype.getChildCount=function(){return this._children.length},t.prototype.getChild=function(t){return this._children[t]},t.prototype.getChildren=function(){return this._children},t.prototype.getChildByName=function(t){for(var e=0;e<this._children.length;++e)if(this._children[e].name==t)return this._children[e];return null},t.prototype.find=function(t){return this.find2(t,0)},t.prototype.find2=function(t,e){if(-1==e)return this;var o,i=t.indexOf("/",e);o=-1==i?t.substring(e):t.substring(e,i);var n=this.getChildByName(o);return null==n?null:-1==i?n:n.find2(t,i+1)},t.prototype.addComponent=function(t){return this.gameObject.addComponent(t)},t.prototype.getComponent=function(t){return this.gameObject.getComponent(t)},t.prototype.getGlobalScale=function(){return new Vector2(this.getGlobalScaleX(),this.getGlobalScaleY())},t.prototype.getGlobalScaleX=function(){return this._node.globalScaleX/this.getSceneRoot().globalScaleX},t.prototype.getGlobalScaleY=function(){return this._node.globalScaleY/this.getSceneRoot().globalScaleY},t.prototype.transformAngleByVector=function(t,e){var o=this.transformPoint(e);return Math.atan2(o.y-t.y,o.x-t.x)/Math.PI*180},t.prototype.inverseTransformAngleByVector=function(t,e){var o=this.inverseTransformPoint(e);return Math.atan2(o.y-t.y,o.x-t.x)/Math.PI*180},t.prototype.transformFrom=function(t,e){return this.inverseTransformPoint(e.transformPoint(t))},Object.defineProperty(t.prototype,"position",{get:function(){return this.transformPoint(Vector3.ZERO)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"stagePosition",{get:function(){return this.transformToStage(Vector3.ZERO)},enumerable:!0,configurable:!0}),t.prototype.transformToStage=function(t){var e=this.transformPoint(t),o=this.getSceneRoot(),i=o.scrollRect;return new Vector2((e.x-i.x)*o.scaleX,(e.y-i.y)*o.scaleY)},t.prototype.transformToParent=function(t){var e=this._parent,o=this.transformPoint(t);return e?e.inverseTransformPoint(o):o},t.prototype.onDestroy=function(){this._node&&(this._node.destroy(),this._node=null),this._scene=null,o.prototype.onDestroy.call(this)},t.prototype.getScene=function(){return this._scene},t.prototype.getSceneRoot=function(){return this._scene.getRootNode()},t.prototype.getRelativePath=function(t){for(var e=[],o=this,i=t;o!=i&&null!=o;)e.push(o.name),o=o.getParent();return o!=i?null:(e.reverse(),e.join("/"))},t}(UComponent);__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),__decorate=this&&this.__decorate||function(t,e,o,i){var n,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,i);else for(var a=t.length-1;0<=a;a--)(n=t[a])&&(s=(r<3?n(s):3<r?n(e,o,s):n(e,o))||s);return 3<r&&s&&Object.defineProperty(e,o,s),s};!function(t){t[t.Blue=1]="Blue",t[t.Red=2]="Red",t[t.Yellow=3]="Yellow",t[t.Spark=4]="Spark",t[t.Tangent=5]="Tangent",t[t.Headshot=6]="Headshot"}(CollideEffectType||(CollideEffectType={}));var UOutlineStyle,UBodyPart=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t._maxHp=-1,t._hp=-1,t._hpMult=1,t._atk=-1,t._atkMult=1,t._isCritical=!1,t._isInvincible=!1,t._mass=-1,t.equip=null,t.disconnectOnDead=!1,t.entryId=0,t.equipTargets=[],t.bodyModel=null,t.partId=0,t.outlines=null,t.hitTargets=null,t._bodypartInfo=null,t.lastIHitWithBodyPart=null,t}return __extends(t,n),t.prototype.awake=function(){for(var t=0;t<this.equipTargets.length;t++){var e=this.equipTargets[t];null!=e&&(e.equip=this)}-1==this._hp?this._hp=this.getMaxHp():this._hp!=this.getMaxHp()&&this.updateOutlineColor(),this.hitTargets=[]},t.prototype.isItemDamage=function(t){var e=t.getSerializeClassName();return"Spike"===e||"BasketBall"===e},Object.defineProperty(t.prototype,"isHead",{get:function(){return 0<=this.gameObject.name.indexOf("head")},enumerable:!0,configurable:!0}),t.prototype.dealDamage=function(t,e){void 0===e&&(e=null);var o=SceneMgr.instance.getActiveScene();this.lastIHitWithBodyPart=t;var i=o instanceof SceneMission||o instanceof SceneChallenge;if(i&&o.isGameEnded())return 0;if(NO_DAMAGE||this.bodyModel.bNoDamage||this._isInvincible||!(t instanceof UComponent))return 0;var n=t.getAtk(),r=this.bodyModel.isAI,s=this.isItemDamage(t);i&&r&&s&&(n*=AI_ITEM_DAMAGE_RATIO),n*=SuiteMgr.instance.getBodyPartInjuredRatio(this.entryId),n-=this.bodyModel.getInjuryFreeDamage(n);var a=this.getBodyModel().getDamageRange();if(a&&!s){var l=this.getMaxHp(),c=a.min*l,p=a.max*l;n=JL.clamp(n,c,p)}n|=0;var h=this.subHp(n,!0);e&&e.addDamageCount(h);do{if(this.isDead()){this.performDead(t);break}i&&!r&&this.isHead&&this._hp<.5*this.getMaxHp()&&o.initPotion()}while(0);return-n},t.prototype.subHp=function(t,e){void 0===e&&(e=!1),console.assert(0<=t,"UbodyPart::subHp delta less than 0, deltaHp = ",t);var o=this.hp,i=Math.max(0,this.hp-t),n=Math.ceil(o-i);return this.setHP(i),this.getBodyModel().addInjuryCount(n),e&&(t=o-this._hp,this.getBodyModel().sp+=Math.round(DAMAGE_TO_SP_RATE*t/this.getMaxHp())),n},t.prototype.addHp=function(t){console.assert(0<=t),this.isCritical||this.setHP(Math.min(this.getMaxHp(),this._hp+t))},t.prototype.updateOutlineColor=function(){},t.prototype.performDead=function(t){void 0===t&&(t=null),this.bodyModel.onPartDead(this,t)},t.prototype.calcCollideEffectType=function(t,e){void 0===e&&(e=!1);var o=getApp().getPlayer().get_id();return this.bodyModel.charInfo.uid==o&&this.isInvincible?t.isInvincible?CollideEffectType.Spark:e?CollideEffectType.Headshot:CollideEffectType.Tangent:t.bodyModel.charInfo.uid==o&&t.isInvincible?this.isInvincible?CollideEffectType.Spark:e?CollideEffectType.Headshot:CollideEffectType.Tangent:this.isInvincible&&t.isInvincible?CollideEffectType.Blue:this.isInvincible||t.isInvincible?e?CollideEffectType.Headshot:CollideEffectType.Red:CollideEffectType.Yellow},t.prototype.playCollideSound=function(t,e){t==CollideEffectType.Headshot||t==CollideEffectType.Tangent||t==CollideEffectType.Red?e?getApp().playSound("battle_whitb2"):getApp().playSound("battle_whitb"):t==CollideEffectType.Spark||t==CollideEffectType.Blue?getApp().playSound("battle_whitw"):e?getApp().playSound("battle_bhitb2"):getApp().playSound("battle_bhitb")},t.prototype.onHitByBodyPart=function(t,e){var o=this.bodyModel,i=e.bodyModel;if(!this.isDead()&&o.teamId!=i.teamId){var n=t.otherCollider,r=t.collider,s=t.normal,a=t.getContactPoint(0),l=-1!=n.name.indexOf("head"),c=!l&&-1!=n.name.indexOf("weapon"),p=-1!=r.name.indexOf("head"),h=!p&&-1!=r.name.indexOf("weapon");if(l&&h||c&&p){(c&&getApp().isSelfUid(o.charInfo.uid)||h&&getApp().isSelfUid(i.charInfo.uid))&&EventDispatcher.event(EVENTS.CRITICIZE),getApp().getSdkMgr().vibrateLong(),UGameCameraController.instance.applyShake(CAM_SHAKE_AMP3);SceneMgr.instance.getActiveScene();0<COLLIDE_TIME_SCALE_DURATION&&Time.setTimeScale(COLLIDE_TIME_SCALE,COLLIDE_TIME_SCALE_DURATION)}c?o.sp+=WEAPON_HIT_SP:h&&(SceneMgr.instance.getActiveScene()instanceof SceneScuffle?i.sp+=2*WEAPON_HIT_SP:i.sp+=WEAPON_HIT_SP);var u=o.gameObject.getComponentT(UCharacterController);u.isAI()&&u.getAIControl().getCollided(),(u=i.gameObject.getComponentT(UCharacterController)).isAI()&&u.getAIControl().getCollided(),o.resetVelocity(),i.resetVelocity();var d=n.gameObject.getComponent(URigidbody2D),f=new Vector2(s.x*REBOUND_FORCE,s.y*REBOUND_FORCE),y=r.gameObject.getComponent(URigidbody2D),_=this;null==this.equip||this.equip.isDead()||(_=this.equip);var g=e;null==e.equip||e.equip.isDead()||(g=e.equip);var b=l&&h||c&&p,m=g.calcCollideEffectType(_,b);_.playCollideEffect(a.x,a.y,m),this.playCollideSound(m,l||p);var v=_.dealDamage(g,i),O=g.dealDamage(_,o);if(v<0){var C=_.getBodyModel().teamId==COMM_CONST.ROOM_TEAM.RED;this.playDamageNumberEffect(a.x-3*s.x,a.y-3*s.y,-v,s.x<0,C,b)}if(O<0){C=g.getBodyModel().teamId==COMM_CONST.ROOM_TEAM.RED;this.playDamageNumberEffect(a.x+3*s.x,a.y+3*s.y,-O,0<=s.x,C,b)}y.applyImpulse(f,a),f.x=-f.x,f.y=-f.y,d.applyImpulse(f,a),o.wasHit=!0,i.wasHit=!0,o.onPartCollide(_,v,g,O,a,s,m)}},t.prototype.onCollisionEnter2D=function(t){if(!this.isDead()&&this.bodyModel&&!this.bodyModel.wasHit){var e=t.otherCollider.gameObject;this.hitTargets.length=0,e.getComponents(UComponent,this.hitTargets);for(var o=0,i=this.hitTargets;o<i.length;o++){var n=i[o],r=n.onHitByBodyPart;r&&r.apply(n,[t,this])}}},t.prototype.playCollideEffect=function(t,e,o){var i,n,r=this.transform.getScene();switch(o){case CollideEffectType.Blue:i="Animations/effect_attack01.ani",n="res/atlas/effect/effect_01.atlas";break;case CollideEffectType.Yellow:i="Animations/effect_attack02.ani",n="res/atlas/effect/effect_02.atlas";break;case CollideEffectType.Red:i="Animations/effect_attack_03.ani",n="res/atlas/effect/effect_03.atlas";break;case CollideEffectType.Spark:i="Animations/attack02.ani",n="res/atlas/effect/attack02.atlas";break;case CollideEffectType.Tangent:i="Animations/attack01.ani",n="res/atlas/effect/attack01.atlas";break;case CollideEffectType.Headshot:i="Animations/attack03.ani",n="res/atlas/effect/attack03.atlas";break;default:return}r.playSfxOnce(i,n,t,e,3)},t.prototype.playDamageNumberEffect=function(t,e,o,i,n,r){void 0===r&&(r=!1);var s=Laya.Pool.getItemByClass(Gui.DamageNumberUIController.POOL_SIGN,Gui.DamageNumberUIController),a=this.transform.getScene().transformToStage(t,e);Laya.stage.addChild(s),s.pos(a.x,a.y),s.play(o,i,n,r)},t.prototype.deserialize=function(t,e){n.prototype.deserialize.call(this,t,e),this._isCritical=t.isCritical,this._isInvincible=t.isInvincible,this._isInvincible&&this._maxHp<=0&&(this._maxHp=1);for(var o=0;o<t.equipTargets.length;++o)this.equipTargets.push(null),e.resolve(this.equipTargets,o,t.equipTargets[o])},t.prototype.serialize=function(t){var e=n.prototype.serialize.call(this,t);e.isCritical=this._isCritical,e.isInvincible=this._isInvincible;for(var o=[],i=0;i<this.equipTargets.length;i++)o.push(t.getRefId(this.equipTargets[i]));return e.equipTargets=o,e},Object.defineProperty(t.prototype,"hp",{get:function(){return this.isCritical?this.bodyModel.modelHP:this._hp},set:function(t){this.isCritical&&(this.bodyModel.modelHP=t),this._hp=t},enumerable:!0,configurable:!0}),t.prototype.markDead=function(t){void 0===t&&(t=!1),0<this.hp&&(this.subHp(this.hp),t&&this.bodyModel.event("partDead",[this,this.lastIHitWithBodyPart]))},t.prototype.isDead=function(){return this.hp<=0},t.prototype.onDestroy=function(){this.bodyModel=null,this.equip=null,this.outlines=null,this.equipTargets=null,n.prototype.onDestroy.call(this)},t.prototype.isPartOf=function(t){return 0<=this.name.indexOf(t)},t.prototype.partNameToPartID=function(){return this.isPartOf("head")?"head":this.isPartOf("torso")?"torso":this.isPartOf("weapon")?"weapon":this.isPartOf("arm")||this.isPartOf("shoulder")?"arm":this.isPartOf("foot")||this.isPartOf("thigh")?"foot":null},Object.defineProperty(t.prototype,"bodyPartInfo",{get:function(){if(!this._bodypartInfo){var t=this.partNameToPartID(),e=SuiteMgr.instance.getBodyPart(this.entryId);if(e&&t){var o=this.bodyModel.charInfo.suite.partLevels[t]*SuiteMgr.instance.getBodyPartLvRatio(this.entryId)+1;e.hp=e.hp*o|0,e.atk=e.atk*o|0,this._bodypartInfo=e}}return this._bodypartInfo},enumerable:!0,configurable:!0}),t.prototype.setBodyModel=function(t,e){this.bodyModel=t,this.partId=e,this._hpMult=t.hpMult,this._atkMult=t.atkMult},t.prototype.getBodyModel=function(){return this.bodyModel},t.prototype.getEquip=function(){return this.equip},Object.defineProperty(t.prototype,"isInvincible",{get:function(){return this._isInvincible},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isCritical",{get:function(){return this._isCritical},enumerable:!0,configurable:!0}),t.prototype.getPartId=function(){return this.partId},t.prototype.getHP=function(){return this.isCritical?this.bodyModel.modelHP:this._hp},t.prototype.getMaxHp=function(){return this._maxHp<0&&(this._maxHp=1,this.bodyPartInfo&&(this._maxHp=this.bodyPartInfo.hp)),this.isCritical&&this.bodyModel?this.bodyModel.modelHPMax:Math.max(1,Math.floor(this._maxHp*this._hpMult))},t.prototype.setHP=function(t){this.hp=t,this.isCritical&&this.bodyModel&&this.bodyModel.HPBar&&this.bodyModel.HPBar.setHp(t),this.updateOutlineColor()},t.prototype.getAtk=function(){this._atk<0&&(this._atk=this.bodyPartInfo?this.bodyPartInfo.atk:1);var t=this._atk*this._atkMult;return t+=this.bodyModel.getATKRageDamage(t,this),Math.max(1,Math.floor(t))},t.prototype.getMass=function(){return this._mass<0&&(this._mass=this.bodyPartInfo?this.bodyPartInfo.mass:1),this._mass},t.prototype.addOutline=function(t){null==this.outlines?this.outlines=[t]:-1==this.outlines.indexOf(t)&&this.outlines.push(t)},t.prototype.getNickname=function(){return this.bodyModel?this.bodyModel.nikeName:""},__decorate([serialize],t.prototype,"disconnectOnDead",void 0),__decorate([serialize],t.prototype,"entryId",void 0),t}(UComponent),UBasketBall=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),__decorate=this&&this.__decorate||function(t,e,o,i){var n,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,i);else for(var a=t.length-1;0<=a;a--)(n=t[a])&&(s=(r<3?n(s):3<r?n(e,o,s):n(e,o))||s);return 3<r&&s&&Object.defineProperty(e,o,s),s},function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.passInBoundsCheck=!1,t.rb=null,t}return __extends(t,e),t.prototype.awake=function(){this.rb=this.gameObject.getComponent(URigidbody2D),this.spdScalar=Vector2.scalarLength(this.speed),this.bounds=new Vector4,this.sceneBoundsRef=this.transform.getScene().getBounds()},t.prototype.start=function(){var t=this.rb;t.setLinearVelocity(this.speed),this.isInBounds()?(t.setBodyType(URigidbody2D.BODY_TYPE_DYNAMIC),this.passInBoundsCheck=!0):(t.setBodyType(URigidbody2D.BODY_TYPE_KINEMATIC),this.passInBoundsCheck=!1)},t.prototype.onDestroy=function(){this.rb=null,this.sceneBoundsRef=null,e.prototype.onDestroy.call(this)},t.prototype.calcCollideEffectType=function(t){return t.isInvincible?CollideEffectType.Blue:CollideEffectType.Red},t.prototype.reboundForce=function(){return this.rb.bodyType==URigidbody2D.BODY_TYPE_KINEMATIC?this.speed:{x:REBOUND_FORCE,y:REBOUND_FORCE}},t.prototype.playCollideSound=function(t){t==CollideEffectType.Tangent||t==CollideEffectType.Red?getApp().playSound("battle_whitb"):t==CollideEffectType.Spark||t==CollideEffectType.Blue?getApp().playSound("battle_whitw"):getApp().playSound("battle_bhitb")},t.prototype.onHitByBodyPart=function(t,e){var o=t.collider,i=t.normal,n=t.getContactPoint(0),r=e.getBodyModel();r.resetVelocity();var s=this.reboundForce(),a=o.gameObject.getComponent(URigidbody2D),l=new Vector2(i.x*s.x,i.y*s.y),c=e,p=e.getEquip();null==p||p.isDead()||(c=p);var h=this.calcCollideEffectType(c);c.playCollideEffect(n.x,n.y,h),this.playCollideSound(h);var u=c.dealDamage(this);if(u<0){var d=c.getBodyModel().teamId==COMM_CONST.ROOM_TEAM.RED;c.playDamageNumberEffect(n.x+3*i.x,n.y+3*i.y,-u,0<=i.x,d)}a.applyImpulse(l,n),r.wasHit=!0,r.onPartCollide(c,u,null,0,n,i,h)},t.prototype.onCollisionEnter2D=function(t){if(this.passInBoundsCheck){var e=new Vector2(t.normal.x,t.normal.y);Vector2.normalize(e,e);var o=this.speed,i=e.x*o.x+e.y*o.y,n=o.x-2*i*e.x,r=o.y-2*i*e.y;o.x=n,o.y=r,this.rb.setLinearVelocity(o)}},t.prototype.update=function(){if(this.passInBoundsCheck){var t=this.rb.getLinearVelocity(this.speed),e=Vector2.scalarLength(t);JL.isZero(e-this.spdScalar)||(Vector2.scale(t,this.spdScalar/e,t),this.rb.setLinearVelocity(t))}else this.isInBounds()&&(this.passInBoundsCheck=!0,this.rb.setBodyType(URigidbody2D.BODY_TYPE_DYNAMIC))},t.prototype.isInBounds=function(){var t=this.rb.getBounds(this.bounds),e=this.sceneBoundsRef;return t.x>=e.x&&t.z<=e.z&&t.y>=e.y&&t.w<=e.w},t.prototype.getAtk=function(){return SceneMgr.instance.getActiveScene().getItemDamage()||this.atk},t.prototype.getNickname=function(){return GetLangText("TEXT_BASKETBALL")},__decorate([serialize],t.prototype,"atk",void 0),__decorate([autoSerialize(SerializeVector2)],t.prototype,"speed",void 0),t}(UComponent)),UBodyModel=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),__decorate=this&&this.__decorate||function(t,e,o,i){var n,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,i);else for(var a=t.length-1;0<=a;a--)(n=t[a])&&(s=(r<3?n(s):3<r?n(e,o,s):n(e,o))||s);return 3<r&&s&&Object.defineProperty(e,o,s),s},function(r){function t(){var t=null!==r&&r.apply(this,arguments)||this;return t.edges=null,t.inEdges=null,t.bodyParts=null,t.isDead=!1,t._wasHit=!1,t._mirrored=!1,t.hpBar=null,t.hpMult=1,t.scale=1,t.atkMult=1,t.spdMult=1,t.bNoDamage=!1,t._sp=0,t._isAI=void 0,t._modelHP=1,t._modelHPMax=1,t._nikeName=void 0,t.skillEffectives=[],t.damage_count=0,t.injury_count=0,t}return __extends(t,r),t.prototype.awake=function(){if(this.buildDAG(),this.setWings(),this.setMirrored(this.transform.getLocalScale().x<0),this.sceneBoundsRef=this.transform.getScene().getBounds(),this.skillIds){for(var t in this.skillIds)this.addSkill(this.skillIds[t]);if(this.charInfo.uid<0&&SceneMgr.instance.getActiveScene()instanceof SceneFakeRank&&(this._sp=25+25*Math.random()|0),0<this.skillEffectives.length){for(t=0;t<this.skillEffectives.length;t+=3){var e=t/3|0;this.setSkillBuff(e,this.skillEffectives[t],this.skillEffectives[t+1],this.skillEffectives[t+2])}this.skillEffectives.length=0}}},t.prototype.setDead=function(t){if(void 0===t&&(t=!1),!this.isDead){this.isDead=!0;for(var e=0;e<this.bodyParts.length;e++){var o=this.bodyParts[e];o&&!o.isDead()&&(o.gameObject.cameraTarget&&o.gameObject.cameraTarget.setDead(),o.disconnectOnDead?this.disconnect(e):o.markDead(t))}this.hpBar&&this.hpBar.hide()}},t.prototype.onPartDead=function(t,e){void 0===e&&(e=null),t.isCritical||QUICK_DEAD?this.setDead():this.disconnect(t.getPartId()),this.event("partDead",[t,e])},t.prototype.onPartCollide=function(t,e,o,i,n,r,s){this.event("partCollide",[t,e,o,i,n,r,s])},t.prototype.deserialize=function(t,e){r.prototype.deserialize.call(this,t,e);var o=t.rigidbodies,i=o.length;this.rigidbodies=[];for(var n=0;n<i;n++)this.rigidbodies.push(null),e.resolve(this.rigidbodies,n,o[n])},t.prototype.serialize=function(t){var e=r.prototype.serialize.call(this,t),o=[];for(var i in this.rigidbodies)o.push(t.getRefId(this.rigidbodies[i]));return e.rigidbodies=o,e.skills=this.skillIds,e},t.prototype.disconnect=function(t,e){void 0===e&&(e=!0);var o=this.rigidbodies[t].gameObject.getComponent(UBodyPart);if(o&&o.markDead(),e)for(var i=0;i<this.inEdges[t].length;i++){var n=this.inEdges[t][i];this.breakJoints(n,t)}this.inEdges[t]=[];for(var r=0;r<this.edges[t].length;r+=2){for(var s=this.edges[t][r],a=void 0;-1<(a=this.inEdges[s].indexOf(t));)this.inEdges[s].splice(a,1);if(0==this.inEdges[s].length)this.disconnect(s,!1);else{var l=this.edges[t][r+1];l&&l.break()}}this.edges[t]=[]},t.prototype.breakJoints=function(t,e){for(var o=this.edges[t],i=o.length-2;0<=i;i-=2){if(o[i]==e){var n=o[i+1];n&&n.break(),o.splice(i,2)}}},t.prototype.onDestroy=function(){for(var t in this.rigidbodies=null,this.edges=null,this.inEdges=null,this.hpBar=null,this.reviveLerp&&(this.reviveLerp.clear(),this.reviveLerp=null),this.skills)this.skills[t].destroy(),this.skills[t]=null;this.skills=null},t.prototype.fixedUpdate=function(){this.wasHit=!1,this.wingsAnimation&&!this.wingsAnimation.playing&&this.wingsAnimation.play(!0)},t.prototype.update=function(){var t=this;this.hpBar&&this.hpBar.update(),this.reviveLerp&&this.reviveLerp.update(Time.deltaTime),this.isInBounds()||Laya.timer.once(1e3,this,function(){if(!t.isInBounds()){t.setDead(!0)}})},Object.defineProperty(t.prototype,"wasHit",{get:function(){return this._wasHit},set:function(t){this._wasHit=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"canBeHit",{get:function(){return this.enabled&&!this._wasHit},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAI",{get:function(){return void 0===this._isAI&&(this._isAI=this.gameObject.getComponentT(UCharacterController).isAI()),this._isAI},enumerable:!0,configurable:!0}),t.prototype.resetLinearVelocity=function(){this.setOverallLinearVelocity(FrameAllocator.b2Vec2(0,0))},t.prototype.resetVelocity=function(){var t=FrameAllocator.b2Vec2(0,0);for(var e in this.rigidbodies){var o=this.bodyParts[e];if(o&&!o.isDead()){var i=this.rigidbodies[e].gameObject.getComponent(UCollider2D);i.linearVelocity=t,i.angularVelocity=0}}},t.prototype.setOverallLinearVelocity=function(t){for(var e in this.rigidbodies){var o=this.bodyParts[e];if(o&&!o.isDead())this.rigidbodies[e].gameObject.getComponent(UCollider2D).linearVelocity=t}},t.prototype.buildDAG=function(){this.bodyParts=[],this.edges=[],this.inEdges=[];for(var t=this.rigidbodies.length,e=0;e<t;e++){var o=this.rigidbodies[e];if(o){var i=o.gameObject.getComponent(UBodyPart);this.bodyParts.push(i),i&&i.setBodyModel(this,e)}else console.warn("rigid body null")}for(e=0;e<t;e++)this.inEdges.push([]),this.edges.push([]);for(e=0;e<t;e++)if(this.rigidbodies[e]){var n=this.rigidbodies[e].gameObject,r=[],s=this.inEdges[e];for(var a in n.getComponents(UJoint2D,r),r){var l=r[a],c=l.getConnectedRigidbody();if(c){var p=c.gameObject.getComponent(UBodyPart),h=void 0;h=p?p.getPartId():this.rigidbodies.indexOf(c),s.push(h),this.edges[h].push(e),this.edges[h].push(l)}}}else console.warn("rigid body null")},t.prototype.showIndicator=function(t,e,o){var i=this.transform.find(t);if(i){var n=getApp().getGuiMgr().findPanel(Gui.WNDID.PLAY);n&&n.createPlayerHead(i,o,e)}},t.prototype.showHpBar=function(t,e,o){var i=this.transform.find(t);if(i){var n=getApp().getGuiMgr().findPanel(Gui.WNDID.PLAY);if(n){var r=getApp().getPlayer().get_id()==this.charInfo.uid,s=i.getComponent(UBodyPart),a=n.createHpBar(i,e,decodestr(this.charInfo.name),s.getHP(),s.getMaxHp(),this.charInfo.lv,o,r);this.hpBar=a}}},t.prototype.createInteraction=function(t,e){var o=this.transform.find(t);if(o){var i=getApp().getGuiMgr().findPanel(Gui.WNDID.PLAY);if(i)i.createInteractionArea(o,e)}},Object.defineProperty(t.prototype,"HPBar",{get:function(){return this.hpBar},enumerable:!0,configurable:!0}),t.prototype.setMirrored=function(t){if(this._mirrored!=t){var e=[];this.gameObject.getComponentsInChildren(UHingeJoint2D,e);for(var o=0,i=e;o<i.length;o++){i[o].onMirrored()}this._mirrored=t}},t.prototype.isMirrored=function(){return this._mirrored},t.prototype.setCollisionGroup=function(t){var e=[];this.gameObject.getComponentsInChildren(UCollider2D,e);for(var o=0,i=e;o<i.length;o++){i[o].setCollisionGroup(t)}},t.prototype.getRigidbodies=function(){return this.rigidbodies},Object.defineProperty(t.prototype,"teamId",{get:function(){return null==this.charInfo?0:this.charInfo.teamId},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"modelHP",{get:function(){return this._modelHP},set:function(t){this._modelHP=Math.min(t,this.modelHPMax)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"modelHPMax",{get:function(){return this._modelHPMax},enumerable:!0,configurable:!0}),t.prototype.customize=function(t,e,o,i,n,r){void 0===n&&(n="res/unity_export/res/sfx/slash02_alpha.png"),void 0===r&&(r=!1),this.hpMult=e||1,this.atkMult=o||1,this.spdMult=i||1,this._modelHPMax=SuiteMgr.instance.getModelHP(this.charInfo.suite.suiteID);var s=this.charInfo.suite.partLevels.head*SuiteMgr.instance.getBodyPartLvRatio(SuiteMgr.instance.getEntryId(this.charInfo.suite.suiteID,"head"))+1;this._modelHPMax=this.modelHPMax*this.hpMult*s,this._modelHP=this._modelHPMax,console.log("this._modelHPMax ",this._modelHPMax);var a=[];this.gameObject.getComponentsInChildren(UTrailRenderer,a);for(var l=0,c=a;l<c.length;l++){c[l].setTexturePath(n,r)}for(var p=0,h=this.rigidbodies;p<h.length;p++){h[p].mass*=t}},t.prototype.startPerformRevive=function(t,e,o){for(var i=0,n=this.rigidbodies;i<n.length;i++){n[i].simulated=!1}var r=this;this.reviveLerp=new BodyModelLerp(this,t,e,function(){r.reviveLerp.clear(),r.reviveLerp=null,o()})},t.prototype.addHpByPercentage=function(t,e,o){void 0===e&&(e=0),void 0===o&&(o=0);for(var i=0,n=this.bodyParts;i<n.length;i++){var r=n[i],s=r.getMaxHp()*t;o&&(s=JL.clamp(s,e,o)),r.isDead()||r.addHp(s)}this.modelHP+=this.modelHPMax*t,this.hpBar.setHp(this.modelHP,this.modelHPMax)},t.prototype.setDamageRange=function(t){this.damageRange=t},t.prototype.getDamageRange=function(){return this.damageRange},t.prototype.addSkill=function(t){this.skills||(this.skills=[]);var e=!1;SceneMgr.instance.getActiveScene()instanceof SceneScuffle&&this.charInfo.uid==getApp().getPlayer().get_id()&&(e=!0);var o=Skill.Create(t,this,e);return!!o&&(this.skills.push(o),!0)},t.prototype.setSkillBuff=function(t,e,o,i){if(!this.skills||t<0||t>=this.skills.length)return this.skillEffectives[3*t+0]=e,this.skillEffectives[3*t+1]=o,void(this.skillEffectives[3*t+2]=i);this.skills[t].setTalentEffective(SkillEffectiveType.CD_CutOff,i),this.skills[t].setTalentEffective(SkillEffectiveType.SP_CutOff,o),this.skills[t].setTalentEffective(SkillEffectiveType.Strengthen,e)},Object.defineProperty(t.prototype,"sp",{get:function(){return this._sp},set:function(t){var e=this._sp;this._sp=JL.clamp(t,0,this.spMax),e!=this._sp&&this.charInfo.uid==getApp().getPlayer().get_id()&&EventDispatcher.event(EVENTS.ON_SP_CHANGED)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"spMax",{get:function(){return 100},enumerable:!0,configurable:!0}),t.prototype.inheritedFrom=function(t){this.sp=t.sp,this.injury_count=t.injuryCount,this.damage_count=t.damageCount},t.prototype.addInjuryCount=function(t){this.injury_count+=t},t.prototype.addDamageCount=function(t){this.damage_count+=t},Object.defineProperty(t.prototype,"damageCount",{get:function(){return this.damage_count},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"injuryCount",{get:function(){return this.injury_count},enumerable:!0,configurable:!0}),t.prototype.getSkillCD=function(t){return!this.skills||t<0||t>=this.skills.length?null:this.skills[t].cd},t.prototype.getSkillSP=function(t){return!this.skills||t<0||t>=this.skills.length?null:this.skills[t].sp},t.prototype.getSkillId=function(t){return!this.skills||t<0||t>=this.skills.length?"":this.skills[t].id},t.prototype.checkSP=function(t,e){return void 0===e&&(e=!1),e?this.sp>=COMM_CONST.SCUFFLE_SP:!!(this.skills&&0<=t&&t<this.skills.length)&&this.skills[t].sp<=this.sp},t.prototype.launchSkill=function(t,e){void 0===e&&(e=!1),(e||this.checkSP(t))&&this.skills[t].launch()},t.prototype.setInjuryFree=function(t){this.injuryFree!=t&&(this.injuryFree=t)},t.prototype.getInjuryFreeDamage=function(t){return this.injuryFree?this.injuryFree.getFreeDamage(t):0},t.prototype.setATKRage=function(t){this.rageEffect!=t&&(this.rageEffect=t)},t.prototype.getATKRageDamage=function(t,e){return this.rageEffect?this.rageEffect.getRageDamage(t,e):0},t.prototype.getPartRender=function(t,e){if(void 0===e&&(e=!1),!this.bodyParts)return null;var o=null;for(var i in this.bodyParts){var n=this.bodyParts[i];if(0<=n.name.indexOf(t)){o=n;break}}return!o||o.isDead()&&!e?null:o.transform.getComponent(USpriteRenderer)},t.prototype.findWingsComponent=function(){var t=[];for(var e in this.gameObject.getComponentsInChildren(USpriteAnimation,t),t){var o=t[e];if("base_wings"==o.name)return o}return null},t.prototype.setWings=function(){var t=this.charInfo.suite.wingsID;if(t){var e=this.findWingsComponent();if(e){var o=SuiteMgr.instance,i=Gui.GuiMgr.instance.getRes(o.getWingsSkin(t)),n=e.gameObject.getComponentT(USpriteRenderer).getPivot();n.x=.5*i.width|0,n.y=.5*i.height|0,e.setTexture(o.getWingsSkin(t,0),0),e.setTexture(o.getWingsSkin(t,1),1),e.setTexture(o.getWingsSkin(t,2),2),e.setTexture(o.getWingsSkin(t,1),3),this.wingsAnimation=e}}},t.prototype.getBodyParts=function(){return this.bodyParts},Object.defineProperty(t.prototype,"nikeName",{get:function(){return!this._nikeName&&this.charInfo&&(this._nikeName=this.charInfo.name,getApp().isSelfUid(this.charInfo.uid)&&(this._nikeName=GetLangText(TEXT.TEXT_YOU))),this._nikeName||""},enumerable:!0,configurable:!0}),t.prototype.isInBounds=function(){if(this.transform){var t=this.transform.find("base_torso").position,e=this.sceneBoundsRef;return t.x>=e.x&&t.x<=e.z&&t.y>=e.y&&t.y<=e.w}},__decorate([serialize],t.prototype,"_mirrored",void 0),__decorate([serialize],t.prototype,"skillIds",void 0),t}(UComponent)),BodyModelLerp=function(){function t(t,e,o,i){this.time=0,this.duration=o,this.callback=i,this.initState=[],this.srcTrans=[],this.srcTrans.push(t.transform),this.initState.push(t.transform.getLocalPosition(),t.transform.getLocalRotation());for(var n=0,r=t.rigidbodies;n<r.length;n++){var s=r[n].transform;this.srcTrans.push(s),this.initState.push(s.getLocalPosition(),s.getLocalRotation())}this.dstTrans=[],this.dstTrans.push(e.transform);for(var a=0,l=e.rigidbodies;a<l.length;a++){s=l[a].transform;this.dstTrans.push(s)}}return t.prototype.update=function(t){this.time+=t;var e=JL.clamp(this.time/this.duration,0,1);e=e*e*(3-2*e);for(var o=new Vector3,i=new Vector3,n=0,r=0;n<this.srcTrans.length;n++,r+=2){var s=this.initState[r],a=this.initState[r+1];Vector3.lerp(s,this.dstTrans[n].getLocalPosition(i),e,o),this.srcTrans[n].setLocalPosition(o),i=this.dstTrans[n].getLocalRotation(i),Vector3.lerp(a,this.dstTrans[n].getLocalRotation(i),e,o),this.srcTrans[n].setLocalRotation(o)}if(this.time>this.duration){var l=this.callback;this.clear(),l&&l()}},t.prototype.clear=function(){this.initState=null,this.srcTrans=null,this.dstTrans=null,this.callback=null},t}(),UCameraController=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.initViewPortNode=function(){this._node=this.transform.getSceneRoot()},e.prototype.getCurScaleY=function(){return this._node?this._node.scaleY:1},e}(UComponent)),UCameraTarget=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),function(e){function t(){var t=e.call(this)||this;return t.isDead=!1,t}return __extends(t,e),t.prototype.setDead=function(){this.isDead=!0},t.prototype.update=function(){if(!this.isDead){var t=UCameraController.main;t&&t.addPoint(this.gameObject.transform.transformPoint(Vector3.ZERO))}},t}(UComponent)),Keyboard=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),__decorate=this&&this.__decorate||function(t,e,o,i){var n,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,i);else for(var a=t.length-1;0<=a;a--)(n=t[a])&&(s=(r<3?n(s):3<r?n(e,o,s):n(e,o))||s);return 3<r&&s&&Object.defineProperty(e,o,s),s},Laya.Keyboard),KeyBoardManager=Laya.KeyBoardManager,UCharacterController=function(e){function t(){var t=e.call(this)||this;return t._aiEnabled=!1,t._aiControl=null,t.playerIndex=0,t.targetRigidbody=null,t.force=new Vector2(0,0),t}return __extends(t,e),t.prototype.initializeInput=function(){null==this._input&&(USE_KEYBOARD&&this.enabled?this._input=CharInput.getKeyboardInput(this.playerIndex):this._input=CharInput.getDummyInput())},t.prototype.awake=function(){this.initializeInput(),this._bodyModel=this.gameObject.getComponent(UBodyModel),this.onAIEnabledChanged()},t.prototype.setAIEnabled=function(t,e){void 0===e&&(e=1),t!=this._aiEnabled&&(this._aiEnabled=t,this.onAIEnabledChanged(e))},t.prototype.isAI=function(){return this._aiEnabled},t.prototype.onAIEnabledChanged=function(t){(void 0===t&&(t=1),this._aiEnabled)&&(null==this._aiControl&&((t+1)%5==0?.5<Math.random()?this._aiControl=new AIControlBoss(this.transform,t):this._aiControl=new AIControlSmarter(this.transform,t):Math.random()<Math.max(0,.3-.01*t)?this._aiControl=new AIControlLazy(this.transform,t):Math.random()>Math.sqrt(t)/10?this._aiControl=new AIControl(this.transform,t):this._aiControl=new AIControlSmarter(this.transform,t)))},t.prototype.fixedUpdate=function(){if(this.enabled&&this._bodyModel&&!this._bodyModel.isDead){if(this._aiEnabled)this._aiControl&&this._aiControl.calcForce(this.force);else{this._input.getDir(this.force);this.force.x*=MAX_FORCE,this.force.y*=MAX_FORCE}var t=Time.deltaTime,e=t*this._bodyModel.spdMult;this.force.x*=e,this.force.y*=e;var o=this.targetRigidbody;if(null!=o){o.applyForce(this.force);var i=-RECOVER_TORQUE;this._bodyModel.isMirrored()&&(i*=-1),JL.isZero(this.force.x)&&JL.isZero(this.force.y)||(i*=.5);for(var n=o.transform.getLocalRotation().z;n<-180;)n+=360;for(;180<n;)n-=360;var r=Math.abs(n);5<r&&(r<80&&(i*=r/80),n<0&&(i*=-1),o.applyTorque(i*t))}}},t.prototype.setInput=function(t){this._input=t},t.prototype.getAIControl=function(){return this._aiControl},t.prototype.getInput=function(){return this._input},t.prototype.onEnable=function(){null!=this._input&&(this._input.enabled=!0)},t.prototype.onDisable=function(){null!=this._input&&(this._input.enabled=!1)},t.prototype.onDestroy=function(){this._input=null,this.targetRigidbody=null,(this._bodyModel=null)!=this._aiControl&&(this._aiControl.onDestroy(),this._aiControl=null),e.prototype.onDestroy.call(this)},__decorate([serialize],t.prototype,"playerIndex",void 0),__decorate([autoSerialize(null,!0)],t.prototype,"targetRigidbody",void 0),t}(UComponent),UDebugMenu=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),function(e){function t(){var t=e.call(this)||this;return t.isDisconnected=!1,t.isEnabled=!1,t.enableCounter=0,IsMobile()||(t.isEnabled=!0),t}return __extends(t,e),t.prototype.awake=function(){Laya.stage.on(Laya.Event.KEY_PRESS,this,this.onKeyPressed)},t.prototype.addMenuItem=function(t,e){},t.prototype.showToast=function(t){getApp().getSdkMgr().showToast(t)},t.prototype.onKeyPressed=function(t){if(this.isEnabled)switch(t.keyCode){case Keyboard.SPACE:this.isDisconnected=!this.isDisconnected,this.isDisconnected?(pomelo.emit("heartbeat timeout"),pomelo.disconnect()):getApp().getNetMgr().doReconnect()}else t.keyCode==Keyboard.G?(this.enableCounter++,5<this.enableCounter&&(this.isEnabled=!0)):this.enableCounter=0},t.prototype.on_Display_FPS=function(t){},t}(UComponent)),UFixedCameraController=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),Keyboard=Laya.Keyboard,KeyBoardManager=Laya.KeyBoardManager,function(e){function t(){var t=e.call(this)||this;return UCameraController.main=t}return __extends(t,e),t.prototype.awake=function(){this.initViewPortNode(),this._updateParam()},t.prototype.addPoint=function(t){},t.prototype.setParam=function(t,e,o,i,n,r){this.x=t,this.y=e,this.width=o,this.height=i,this.sx=n,this.sy=r,this._node&&this._updateParam()},t.prototype._updateParam=function(){this._node.scrollRect.setTo(this.x,this.y,this.width,this.height),this._node.scaleX=this.sx,this._node.scaleY=this.sy},t}(UCameraController)),UFollowNode=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),__decorate=this&&this.__decorate||function(t,e,o,i){var n,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,i);else for(var a=t.length-1;0<=a;a--)(n=t[a])&&(s=(r<3?n(s):3<r?n(e,o,s):n(e,o))||s);return 3<r&&s&&Object.defineProperty(e,o,s),s},function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.target=null,t.relPosition=Vector3.ZERO,t.relAngle=0,t.relScale=1,t}return __extends(t,e),t.prototype.lateUpdate=function(){var t,e=this.transform,o=this.target,i=e.getParent(),n=o.transformPoint(this.relPosition);t=i?i.inverseTransformPoint(n):n;var r,s=o.transformAngle(this.relAngle);r=i?i.inverseTransformAngle(s):s;var a,l=o.getGlobalScaleX()*this.relScale;a=i?l/i.getGlobalScaleX():l,e.setLocalPosition(t),e.setLocalRotation(new Vector3(0,0,r)),e.setLocalScale(new Vector3(a,a,a))},t.prototype.setTarget=function(t){this.target=t,this._calculateRelative()},t.prototype._calculateRelative=function(){if(null!=this.target){this.transform.getParent();var t=this.transform.position;this.relPosition=this.target.inverseTransformPoint(t);var e=this.transform.transformAngle(0);this.relAngle=this.target.inverseTransformAngle(e);var o=this.transform.getGlobalScaleX();this.relScale=this.target.getGlobalScaleX()/o}},__decorate([autoSerialize(null,!0)],t.prototype,"target",void 0),__decorate([autoSerialize(SerializeVector3)],t.prototype,"relPosition",void 0),__decorate([serialize],t.prototype,"relAngle",void 0),__decorate([serialize],t.prototype,"relScale",void 0),t}(UComponent)),UForceField=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),__decorate=this&&this.__decorate||function(t,e,o,i){var n,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,i);else for(var a=t.length-1;0<=a;a--)(n=t[a])&&(s=(r<3?n(s):3<r?n(e,o,s):n(e,o))||s);return 3<r&&s&&Object.defineProperty(e,o,s),s},function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.affectedBodies={},t}return __extends(t,e),t.prototype.start=function(){this.animation=this.gameObject.getComponentT(USpriteAnimation)},t.prototype.onCollisionEnter2D=function(t){var e=t.otherCollider.gameObject.getComponent(URigidbody2D);if(null!=e){var o=util.getObjectID(e);this.affectedBodies[o]=e}},t.prototype.onCollisionExit2D=function(t){var e=t.otherCollider.gameObject.getComponent(URigidbody2D);if(null!=e){var o=util.getObjectID(e);o in this.affectedBodies&&delete this.affectedBodies[o]}},t.prototype.fixedUpdate=function(){for(var t in this.affectedBodies){this.affectedBodies[t].applyForce(this.force)}this.animation&&!this.animation.playing&&this.animation.play(!0)},t.prototype.onDestroy=function(){this.force=null,this.affectedBodies=null},__decorate([autoSerialize(SerializeVector2)],t.prototype,"force",void 0),t}(UComponent)),UFreeCameraController=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),Keyboard=Laya.Keyboard,KeyBoardManager=Laya.KeyBoardManager,function(e){function t(){var t=e.call(this)||this;return t.speed=1,UCameraController.main=t}return __extends(t,e),t.prototype.awake=function(){this.initViewPortNode()},t.prototype.update=function(){if(KeyBoardManager.hasKeyDown(Keyboard.H)&&(this._node.scrollRect.x-=this.speed),KeyBoardManager.hasKeyDown(Keyboard.K)&&(this._node.scrollRect.x+=this.speed),KeyBoardManager.hasKeyDown(Keyboard.U)&&(this._node.scrollRect.y-=this.speed),KeyBoardManager.hasKeyDown(Keyboard.J)&&(this._node.scrollRect.y+=this.speed),KeyBoardManager.hasKeyDown(Keyboard.I)){var t=this._node.scaleX;t+=.01,this._node.scale(t,t)}if(KeyBoardManager.hasKeyDown(Keyboard.Y)){t=this._node.scaleX;t=Math.max(0,t-.01),this._node.scale(t,t)}KeyBoardManager.hasKeyDown(Keyboard.SPACE)&&(console.log("scrollRect=[%s,%s,%s,%s]",this._node.scrollRect.x,this._node.scrollRect.y,this._node.scrollRect.width,this._node.scrollRect.height),console.log("scale=[%s,%s]",this._node.scaleX,this._node.scaleY))},t.prototype.addPoint=function(t){},t}(UCameraController)),UGameCameraController=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),__decorate=this&&this.__decorate||function(t,e,o,i){var n,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,i);else for(var a=t.length-1;0<=a;a--)(n=t[a])&&(s=(r<3?n(s):3<r?n(e,o,s):n(e,o))||s);return 3<r&&s&&Object.defineProperty(e,o,s),s},function(o){function e(){var t=o.call(this)||this;return t.lastX=NaN,t.lastY=NaN,t.lastScale=NaN,t.camShakeAmpRemain=0,t.shakeFlip=-1,t.scrollRectStyle=NaN,(UCameraController.main=t).isResizing=!1,t._boundPoints=[],t.padding=[100,100],t.setDampFactor(.4),t.battleState=e.BATTLE_STATE_READY,e.instance=t}return __extends(e,o),e.prototype.awake=function(){this.initViewPortNode(),EventDispatcher.on(EVENTS.ON_STAGE_RESIZE,this,this.onStageResize)},e.prototype.onEnable=function(){o.prototype.onEnable.call(this)},e.prototype.onDisable=function(){o.prototype.onDisable.call(this),EventDispatcher.off(EVENTS.ON_STAGE_RESIZE,this,this.onStageResize)},e.prototype.onDestroy=function(){o.prototype.onDestroy.call(this),EventDispatcher.off(EVENTS.ON_STAGE_RESIZE,this,this.onStageResize)},e.prototype.onStageResize=function(){this.isPhyiscsEnabled()||(this.isResizing=!0),this.updateCameraRectStyle()},e.prototype.updateCameraRectStyle=function(){var t=Gui.GuiMgr.instance.ScreenAspect,e=this.minScale,o=this.worldBound.height*t/DESIGN_RESOLUTION[0];this.scrollRectStyle=e<o?1:0},e.prototype.isPhyiscsEnabled=function(){var t=SceneMgr.instance.getActiveScene(),e=t?t.getPhyiscsWorld():null;return!!e&&e.isEnabled()},e.prototype.applyShake=function(t){this.camShakeAmpRemain=t,this.shakeFlip=-1},e.prototype.checkState=function(){return!!this.isResizing||(!!isNaN(this.lastScale)||this.isPhyiscsEnabled())},e.prototype.lateUpdate=function(){if(!(this._boundPoints.length<0)&&this.minSize&&this.worldBound&&this.checkState()){var t=1,e=1,o=1,i=this.lastX,n=this.lastY,r=this.lastScale,s=Gui.GuiMgr.instance.ScreenAspect;if(this.isPhyiscsEnabled()){var a=void 0,l=void 0,c=void 0,p=void 0,h=this._boundPoints[0];a=l=h.x,c=p=h.y;for(var u=1;u<this._boundPoints.length;u++){var d=this._boundPoints[u],f=d.x;f<a?a=f:l<f&&(l=f);var y=d.y;y<c?c=y:p<y&&(p=y)}if(a=1.05*a-this.padding[0],l=1.05*l+this.padding[0],c=1.05*c-this.padding[1],p=1.05*p+this.padding[1],(e=l-a)<this.minSize[0])a-=g=.5*(this.minSize[0]-e),l+=g,e=this.minSize[0];if((o=p-c)<this.minSize[1])c-=g=.5*(this.minSize[1]-o),p+=g,o=this.minSize[1];if(e<s*o){var _=o*s;a-=g=.5*(_-e),l+=g,e=_}else{var g,b=e/s;c-=g=.5*(b-o),p+=g,o=b}e>this.worldBound.width?(a=this.worldBound.x,l=this.worldBound.right,e=this.worldBound.width):a<this.worldBound.x?l=(a=this.worldBound.x)+e:l>this.worldBound.right&&(a=(l=this.worldBound.right)-e),o>this.worldBound.height?(c=this.worldBound.y,p=this.worldBound.bottom,o=this.worldBound.height):c<this.worldBound.y?p=(c=this.worldBound.y)+o:p>this.worldBound.bottom&&(c=(p=this.worldBound.bottom)-o);var m=.5*(a+l),v=.5*(c+p);t=o/DESIGN_RESOLUTION[1];var O=new Vector2(m-this.lastX,v-this.lastY),C=Math.min(1,Time.deltaTime/this._dampTime);Vector2.scale(O,C,O);var P=(t-this.lastScale)*C;i+=O.x,n+=O.y,r+=P}else(isNaN(this.lastScale)||this.isResizing)&&(i=n=0,e=(o=this.worldBound.height)*s,r=this.worldBound.height/DESIGN_RESOLUTION[1],this.updateCameraRectStyle());if(this.isResizing||this.lastScale!=r||this.lastX!=i||this.lastY!=n){this.lastY=n,this.lastX=i,this.lastScale=r;var T,S,D,x=1/this.lastScale+.01;this._node.scale(x,x),0<this.scrollRectStyle?T=(S=DESIGN_RESOLUTION[1]*this.lastScale)*s:S=(T=DESIGN_RESOLUTION[0]*this.lastScale)/s,0<this.camShakeAmpRemain?(D=this.shakeFlip*this.camShakeAmpRemain*this.lastScale,0,this._node.setScrollRect(this.lastX-.5*T+D,this.lastY-.5*S+0,T,S),this.camShakeAmpRemain=Math.max(0,this.camShakeAmpRemain-CAM_SHAKE_AMP_DAMP*Time.deltaTime),Math.abs(this.camShakeAmpRemain)<1e-4&&(this.camShakeAmpRemain=0),this.shakeFlip=-1*this.shakeFlip):this._node.setScrollRect(this.lastX-.5*T,this.lastY-.5*S,T,S),this._boundPoints=[],this.isResizing=!1}}},e.prototype.addPoint=function(t){this._boundPoints.push(t)},e.prototype.setDampFactor=function(t){this._dampTime=t},e.prototype.deserialize=function(t,e){o.prototype.deserialize.call(this,t,e),this.worldBound=new Laya.Rectangle(t.worldBound[0],t.worldBound[1],t.worldBound[2],t.worldBound[3])},e.prototype.serialize=function(t){var e=o.prototype.serialize.call(this,t);return e.dampTime=this._dampTime,e.worldBound=[this.worldBound.x,this.worldBound.y,this.worldBound.width,this.worldBound.height],e},Object.defineProperty(e.prototype,"minScale",{get:function(){return this.worldBound.height/DESIGN_RESOLUTION[1]},enumerable:!0,configurable:!0}),e.BATTLE_STATE_READY=0,e.BATTLE_STATE_FIGHTING=1,e.BATTLE_STATE_PAUSE=2,e.BATTLE_STATE_END=3,__decorate([serialize],e.prototype,"minSize",void 0),__decorate([serialize],e.prototype,"padding",void 0),e}(UCameraController)),UHealPotion=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),__decorate=this&&this.__decorate||function(t,e,o,i){var n,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,i);else for(var a=t.length-1;0<=a;a--)(n=t[a])&&(s=(r<3?n(s):3<r?n(e,o,s):n(e,o))||s);return 3<r&&s&&Object.defineProperty(e,o,s),s},function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.used=!1,t.passInBoundsCheck=!1,t.rb=null,t.hasHit=!1,t}return __extends(t,e),t.prototype.awake=function(){this.rb=this.gameObject.getComponent(URigidbody2D),this.spdScalar=Vector2.scalarLength(this.speed),this.bounds=new Vector4,this.sceneBoundsRef=this.transform.getScene().getBounds()},t.prototype.start=function(){var t=this.rb;t.setLinearVelocity(this.speed),this.isInBounds()?(t.setBodyType(URigidbody2D.BODY_TYPE_DYNAMIC),this.passInBoundsCheck=!0):(t.setBodyType(URigidbody2D.BODY_TYPE_KINEMATIC),this.passInBoundsCheck=!1),Joyluck.DataTracking.instance.trackingEvent("80001")},t.prototype.onDestroy=function(){this.rb=null},t.prototype.getAtk=function(){return 0},t.prototype.calcCollideEffectType=function(){return CollideEffectType.Blue},t.prototype.onHitByBodyPart=function(t,e){var o=e.getBodyModel();if(!o.charInfo.isRobot&&!o.isDead){var i=SceneMgr.instance.getActiveScene();if(i&&i.isPVE()){var n=i;if(!n.isGameEnded()){var r=n.getPhyiscsWorld();if(r){var s=this;n.stopCountDown(),r.setEnabledAs(!1);var a=function(){n.continueCountDown(),r.setEnabledAs(!0,!0)},l=function(){s.destroyGameObject(),a()},c=function(){s.onUse(t,e),a()},p=getApp().getPlayer(),h=COMM_CONST.SHARE.SCENE.PVE_POTION;p.randomWatchVideo();var u={btnYes:"show",btnNo:"show",btnClose:"show",autoClose:!0,imgNo3Icon:sprintf("com/common_icon_%s.png","video"),lblNo2:TEXT.TEXT_PVP_RANK_GUARD_VIDEO,lblYes2Num:COMM_CONST.RECOVER_DIAMOND_COST,imgYes2Icon:getApp().getIcon("diamond"),lblYes2:TEXT.TEXT_PVP_RANK_GUARD_DIAMONDS};if(!this.hasHit)return p.canWatchVideoAd(h,!1)?(this.hasHit=!0,void getApp().showMsgBox(TEXT.TEXT_PVE_POTION,function(){getApp().getNetMgr().PVERecover(function(){c()},function(){l()})},function(){if(IsChrome())c();else{var t=getApp().getSdkMgr().showRewardedVideoAd(VIDEO_AD.CURRENT_ID,s,function(t){t?c():l(),t&&Joyluck.DataTracking.instance.trackingEvent("81002")},s,function(t){"no advertisement"!=t?l():c()},h);Joyluck.DataTracking.instance.trackingEvent("81001"),t||c()}},l,u)):void c()}}}}},t.prototype.destroyGameObject=function(){this.gameObject&&(UGameObject.Destroy(this.gameObject),this.gameObject=null)},t.prototype.onUse=function(t,e){this.used||(this.used=!0,e.getBodyModel().addHpByPercentage(this.percent),getApp().getNetMgr().notifyUHealPotion(this.used),EventDispatcher.event(EVENTS.ON_ACHIEVEMENT_CHANGE),Gui.ToastUIController.show(TEXT.TEXT_RESTORE_HEALTH,2),this.destroyGameObject())},t.prototype.onCollisionEnter2D=function(t){if(this.passInBoundsCheck){var e=new Vector2(t.normal.x,t.normal.y);Vector2.normalize(e,e);var o=this.speed,i=e.x*o.x+e.y*o.y,n=o.x-2*i*e.x,r=o.y-2*i*e.y;o.x=n,o.y=r,this.rb.setLinearVelocity(o)}},t.prototype.update=function(){if(this.passInBoundsCheck){var t=this.rb.getLinearVelocity(this.speed),e=Vector2.scalarLength(t);JL.isZero(e-this.spdScalar)||(Vector2.scale(t,this.spdScalar/e,t),this.rb.setLinearVelocity(t))}else this.isInBounds()&&(this.passInBoundsCheck=!0,this.rb.setBodyType(URigidbody2D.BODY_TYPE_DYNAMIC))},t.prototype.isInBounds=function(){var t=this.rb.getBounds(this.bounds),e=this.sceneBoundsRef;return t.x>=e.x&&t.z<=e.z&&t.y>=e.y&&t.w<=e.w},t.prototype.getNickname=function(){return""},__decorate([serialize],t.prototype,"percent",void 0),__decorate([autoSerialize(SerializeVector2)],t.prototype,"speed",void 0),t}(UComponent)),UHideAtStart=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),function(o){function t(){return null!==o&&o.apply(this,arguments)||this}return __extends(t,o),t.prototype.deserialize=function(t,e){o.prototype.deserialize.call(this,t,e),this.transform.getComponent(USpriteRenderer).setColor(0,0,0,0)},t}(UComponent)),UNetAgentProxy=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._agent=null,t}return __extends(t,e),Object.defineProperty(t.prototype,"agent",{get:function(){return this._agent},set:function(t){this._agent=t},enumerable:!0,configurable:!0}),t.prototype.update=function(){null!=this.agent&&this.agent.update()},t.prototype.lateUpdate=function(){null!=this.agent&&this.agent.lateUpdate()},t.prototype.fixedUpdate=function(){null!=this.agent&&this.agent.fixedUpdate()},t}(UComponent));__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}();!function(t){t[t.Normal=1]="Normal",t[t.Friend=2]="Friend"}(UOutlineStyle||(UOutlineStyle={}));var UOutline=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.style=UOutlineStyle.Normal,t}return __extends(t,e),t.prototype.awake=function(){if(e.prototype.awake.call(this),this.target){var t=this.target.getComponent(UBodyPart);t&&t.addOutline(this)}this.style==UOutlineStyle.Friend&&this._setColorTint(0,0,1,1)},t.prototype.setColorTint=function(t,e,o,i){this.style==UOutlineStyle.Normal&&this._setColorTint(t,e,o,i)},t.prototype._setColorTint=function(t,e,o,i){var n=this.gameObject.getComponent(USpriteRenderer);null!=n&&n.setColor(t,e,o,i)},t}(UFollowNode),USoar=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),__decorate=this&&this.__decorate||function(t,e,o,i){var n,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,i);else for(var a=t.length-1;0<=a;a--)(n=t[a])&&(s=(r<3?n(s):3<r?n(e,o,s):n(e,o))||s);return 3<r&&s&&Object.defineProperty(e,o,s),s},function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.awake=function(){this.rb=this.gameObject.getComponentT(URigidbody2D),this.spdScalar=Vector2.scalarLength(this.speed),this.bounds=new Vector4,this.sceneBoundsRef=this.transform.getScene().getBounds()},e.prototype.start=function(){var t=this.rb;t.setLinearVelocity(this.speed),t.SetAngularVelocity(this.spinning)},e.prototype.onDestroy=function(){this.rb=null,this.sceneBoundsRef=null,t.prototype.onDestroy.call(this)},e.prototype.onCollisionEnter2D=function(t){},e.prototype.update=function(){if(this.rb&&this.rb.bodyType==URigidbody2D.BODY_TYPE_DYNAMIC){var t=this.rb.getLinearVelocity(this.speed),e=Vector2.scalarLength(t);JL.isZero(e-this.spdScalar)||(Vector2.scale(t,this.spdScalar/e,t),this.rb.setLinearVelocity(t))}},e.prototype.isDynamicRigidBody=function(){return!!this.rb&&this.rb.bodyType==URigidbody2D.BODY_TYPE_DYNAMIC},e.prototype.reboundForce=function(){return this.isDynamicRigidBody()?this.speed:{x:REBOUND_FORCE,y:REBOUND_FORCE}},__decorate([autoSerialize(SerializeVector2)],e.prototype,"speed",void 0),__decorate([serialize],e.prototype,"spinning",void 0),e}(UComponent)),USkillObject=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),__decorate=this&&this.__decorate||function(t,e,o,i){var n,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,i);else for(var a=t.length-1;0<=a;a--)(n=t[a])&&(s=(r<3?n(s):3<r?n(e,o,s):n(e,o))||s);return 3<r&&s&&Object.defineProperty(e,o,s),s},function(e){function o(){var t=null!==e&&e.apply(this,arguments)||this;return t.hitCount=0,t.skillDuration=-1,t.durationTimer=0,t.spriteAnimation=null,t}return __extends(o,e),Object.defineProperty(o.prototype,"isInvalid",{get:function(){return this.durationTimer<=0||(this.isBomb?this.bombCount>=this.bombTimes:this.isSummon?this.durationTimer<=this.FADEOUT_TIME:this.hitCount>=this.hitTimes)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"skillAttribute",{get:function(){return this._skillAttribute},set:function(t){this._skillAttribute=t},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"FADEOUT_TIME",{get:function(){return null!==this.fadeoutDuration&&void 0!==this.fadeoutDuration||(this.fadeoutDuration=1),1e3*this.fadeoutDuration|0},enumerable:!0,configurable:!0}),o.prototype.awake=function(){(e.prototype.awake.call(this),this.skillAttribute instanceof SkillAttributesBullet)&&(this.skillAttribute.attachSkill.owner.charInfo.teamId==COMM_CONST.ROOM_TEAM.BLUE&&(this.speed.x=-this.speed.x))},o.prototype.getObjectDuration=function(){return this.objectDuration?1e3*this.objectDuration:this.skillDuration},o.prototype.start=function(){if(this.hitCount=0,this.bombCount=0,this.durationTimer=this.getObjectDuration(),this.spriteAnimation=this.gameObject.getComponentT(USpriteAnimation),e.prototype.start.call(this),this.spriteAnimation.play(this.isSummon),this.objectActivated||(this.rb.simulated=!1,this.gameObject.setVisible(!1),this.rb.bodyType==URigidbody2D.BODY_TYPE_KINEMATIC&&(this.rb.SetAngularVelocity(0),this.rb.setLinearVelocity(new JL.Vector2(0,0))),this.spriteAnimation.stop()),this.isSummon&&this.rb.setActive(!1),this.nextSkillObjectName){var t=this.transform.getParent().getChildByName(this.nextSkillObjectName);this.nextSkillObject=t?t.gameObject.getComponentT(o):null}},o.prototype.setObjectActivated=function(t){!this.objectActivated&&t&&(this.objectActivated=!0,this.gameObject.setVisible(!0),this.rb.simulated=!0,this.rb.getInternalBody().SetPositionAndAngle(t,0),this.gameObject.getComponentT(UBoxCollider2D).updateTransform(!0),this.rb.bodyType==URigidbody2D.BODY_TYPE_KINEMATIC&&(this.rb.setLinearVelocity(this.speed),this.rb.SetAngularVelocity(this.spinning)),this.spriteAnimation.play(!this.isSummon))},o.prototype.onDestroy=function(){e.prototype.onDestroy.call(this)},o.prototype.calcCollideEffectType=function(t){return t.isInvincible?CollideEffectType.Blue:CollideEffectType.Red},o.prototype.playCollideSound=function(t){t!=CollideEffectType.Tangent&&t!=CollideEffectType.Red?t!=CollideEffectType.Spark&&t!=CollideEffectType.Blue?getApp().playSound("battle_bhitb"):getApp().playSound("battle_whitw"):getApp().playSound("battle_whitb")},o.prototype.onHitByBodyPart=function(t,e){if(this._skillAttribute&&!this.isInvalid&&this.objectActivated&&e.getBodyModel){var o=this._skillAttribute;if(e.getBodyModel()!=o.attachSkill.owner){this.hitCount++;var i=t.collider,n=t.normal,r=t.getContactPoint(0),s=e.getBodyModel();s.resetVelocity();var a=this.reboundForce(),l=i.gameObject.getComponent(URigidbody2D),c=new Vector2(n.x*a.x,n.y*a.y),p=e,h=e.getEquip();h&&!h.isDead()&&(p=h);var u=p.dealDamage(this),d=this.calcCollideEffectType(p);p.playCollideEffect(r.x,r.y,d),this.playCollideSound(d);if(u<0){var f=p.getBodyModel().teamId==COMM_CONST.ROOM_TEAM.RED;p.playDamageNumberEffect(r.x+3*n.x,r.y+3*n.y,-u,0<=n.x,f)}l.applyImpulse(c,r),s.wasHit=!0,s.onPartCollide(p,u,null,0,r,n,d),this.isInvalid&&this.durationTimer>this.FADEOUT_TIME&&(this.durationTimer=this.FADEOUT_TIME)}}},o.prototype.onCollisionEnter2D=function(t){if(this._skillAttribute&&this.objectActivated&&this.isDynamicRigidBody()&&this.spinning){var e=new Vector2(t.normal.x,t.normal.y);Vector2.normalize(e,e);var o=this.speed,i=e.x*o.x+e.y*o.y,n=o.x-2*i*e.x,r=o.y-2*i*e.y;o.x=n,o.y=r,this.rb.setLinearVelocity(o)}},o.prototype.getAtk=function(){return this._skillAttribute.setCurrentSkillObject(this),this._skillAttribute.getATK()},o.prototype.update=function(){if(this.objectActivated){if(this.durationTimer-=Laya.timer.delta,0<this.hitCount&&(this.isBomb?this.bombCount++:this.setBodyTypeInRebound()),this.nextSkillObject&&this.isInvalid&&(this.nextSkillObject.setObjectActivated(this.rb.getInternalBody().GetPosition()),this.nextSkillObject=null),this.durationTimer<=0)return this.enabled=!1,this.rb.simulated=!1,this.spriteAnimation.stop(),this.gameObject.setVisible(!1),void this.rb.setActive(!1);if(e.prototype.update.call(this),0<this.FADEOUT_TIME&&this.durationTimer<=this.FADEOUT_TIME)this.gameObject.getComponentT(USpriteRenderer).transform.getInternalNode().alpha=Math.max(0,this.durationTimer)/this.FADEOUT_TIME}},Object.defineProperty(o.prototype,"isBomb",{get:function(){return!!this.bombTimes&&!!this.bombForce},enumerable:!0,configurable:!0}),o.prototype.setBodyTypeInRebound=function(){this.isRebound&&this.rb.bodyType==URigidbody2D.BODY_TYPE_KINEMATIC&&this.rb.setBodyType(URigidbody2D.BODY_TYPE_DYNAMIC)},o.prototype.getCharUid=function(){var t=this._skillAttribute;return t&&t.attachSkill&&t.attachSkill.owner?t.attachSkill.owner.charInfo.uid:NaN},o.prototype.getNickname=function(){var t=this.getCharUid();return isNaN(t)?"":this._skillAttribute.attachSkill.owner.nikeName},o.prototype.reboundForce=function(){return this.isBomb?{x:this.bombForce,y:this.bombForce}:e.prototype.reboundForce.call(this)},__decorate([serialize],o.prototype,"objectActivated",void 0),__decorate([serialize],o.prototype,"objectDuration",void 0),__decorate([serialize],o.prototype,"hitTimes",void 0),__decorate([serialize],o.prototype,"isRebound",void 0),__decorate([serialize],o.prototype,"fadeoutDuration",void 0),__decorate([serialize],o.prototype,"bombForce",void 0),__decorate([serialize],o.prototype,"bombTimes",void 0),__decorate([serialize],o.prototype,"isSummon",void 0),__decorate([serialize],o.prototype,"nextSkillObjectName",void 0),o}(USoar)),USpike=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),__decorate=this&&this.__decorate||function(t,e,o,i){var n,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,i);else for(var a=t.length-1;0<=a;a--)(n=t[a])&&(s=(r<3?n(s):3<r?n(e,o,s):n(e,o))||s);return 3<r&&s&&Object.defineProperty(e,o,s),s},function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.calcCollideEffectType=function(t){return t.isInvincible?CollideEffectType.Blue:CollideEffectType.Red},e.prototype.playCollideSound=function(t){t==CollideEffectType.Tangent||t==CollideEffectType.Red?getApp().playSound("battle_whitb"):t==CollideEffectType.Spark||t==CollideEffectType.Blue?getApp().playSound("battle_whitw"):getApp().playSound("battle_bhitb")},e.prototype.onHitByBodyPart=function(t,e){t.otherCollider;var o=t.collider,i=t.normal,n=t.getContactPoint(0),r=e.getBodyModel();r.resetVelocity();var s=o.gameObject.getComponent(URigidbody2D),a=new Vector2(i.x*REBOUND_FORCE,i.y*REBOUND_FORCE),l=e,c=e.getEquip();null==c||c.isDead()||(l=c);var p=this.calcCollideEffectType(l);l.playCollideEffect(n.x,n.y,p),this.playCollideSound(p);var h=l.dealDamage(this);if(h<0){var u=l.getBodyModel().teamId==COMM_CONST.ROOM_TEAM.RED;l.playDamageNumberEffect(n.x+3*i.x,n.y+3*i.y,-h,0<=i.x,u)}s.applyImpulse(a,n),r.wasHit=!0,r.onPartCollide(l,h,null,0,n,i,p)},e.prototype.getAtk=function(){return SceneMgr.instance.getActiveScene().getItemDamage()||this.atk},e.prototype.getNickname=function(){return GetLangText("TEXT_SPIKE")},__decorate([serialize],e.prototype,"atk",void 0),e}(UComponent)),USpring=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.calcCollideEffectType=function(t){return CollideEffectType.Blue},e.prototype.onHitByBodyPart=function(t,e){var o=t.collider,i=t.normal,n=t.getContactPoint(0);e.getBodyModel().resetVelocity();var r=o.gameObject.getComponent(URigidbody2D),s=new Vector2(i.x*REBOUND_FORCE*SPRING_REBOUND_RATE,i.y*REBOUND_FORCE*SPRING_REBOUND_RATE);r.applyImpulse(s,n);var a=this.gameObject.getComponentT(USpriteAnimation);a&&a.play(),getApp().playSound("battle_bounce")},e.prototype.getAtk=function(){return 0},e.prototype.getNickname=function(){return""},e}(UComponent)),USpriteAnimation=(__extends=this&&this.__extends||function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};return function(t,e){function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),__decorate=this&&this.__decorate||function(t,e,o,i){var n,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,i);else for(var a=t.length-1;0<=a;a--)(n=t[a])&&(s=(r<3?n(s):3<r?n(e,o,s):n(e,o))||s);return 3<r&&s&&Object.defineProperty(e,o,s),s},function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),Object.defineProperty(e.prototype,"FPS",{get:function(){return this.fps||1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"playing",{get:function(){return this._playing},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"frameDelta",{get:function(){return this._frameDelta},enumerable:!0,configurable:!0}),e.prototype.awake=function(){},e.prototype.start=function(){this._dt=0,this._isLoop=!1,this._playing=!1,this._frameIndex=0,this._curDelay=0,this._frameDelta=1/this.FPS*1e3|0,this._renderer=this.gameObject.getComponentT(USpriteRenderer)},e.prototype.play=function(t){void 0===t&&(t=!1),this._renderer&&this.sprites&&!this.playing&&1<this.sprites.length&&(this._playing=!0,this._isLoop=t,this._curDelay=this.delay?1e3*this.delay:0)},e.prototype.gotoAndStop=function(t){void 0===t&&(t=0),this.playing&&(this.stop(),this._dt=0,this._frameIndex=Math.min(Math.max(0,t),this.sprites.length))},e.prototype.stop=function(){this.playing&&(this._isLoop=!1,this._playing=!1)},e.prototype.update=function(){if(this.playing){var t=this.sprites.length;if(0!==t){var e=Laya.timer.delta;0<this._curDelay?this._curDelay-=e:(this._dt+=e,this._dt<this.frameDelta||(this._dt=0,this._frameIndex=(this._frameIndex+1)%t,this._renderer.texture=this.sprites[this._frameIndex],0!==this._frameIndex||this._isLoop||this.stop()))}}},e.prototype.setTexture=function(t,e){e<0||e>this.sprites.length||(this.sprites[e]=t)},__decorate([serialize],e.prototype,"fps",void 0),__decorate([serialize],e.prototype,"delay",void 0),__decorate([serialize],e.prototype,"sprites",void 0),e}(UComponent));