public void Leave(Action _action, Track _track) { if (this.moveActor) { this.moveActor.get_handle().ObjLinker.RmvCustomMoveLerp(new CustomMoveLerpFunc(this.ActionMoveLerp)); this.moveActor.get_handle().myTransform.position = (Vector3)this.moveActor.get_handle().location; if (this.moveActor.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Bullet) { BulletWrapper bulletWrapper = this.moveActor.get_handle().ActorControl as BulletWrapper; if (bulletWrapper != null && bulletWrapper.GetMoveCollisiong()) { bulletWrapper.SetMoveDelta(0); } } } this.skillContext = null; this.tarActor.Release(); this.moveActor.Release(); this.gravityControler = null; }
public void ConditionalUpdateShape() { if (this.dirty) { ActorRoot handle = this.owner.handle; if (this.isBox && handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Bullet) { BulletWrapper bulletWrapper = handle.ActorControl as BulletWrapper; if (bulletWrapper != null && bulletWrapper.GetMoveCollisiong()) { this.UpdateShape(handle.location, handle.forward, bulletWrapper.GetMoveDelta()); } else { this.UpdateShape(handle.location, handle.forward); } } else { this.UpdateShape(handle.location, handle.forward); } } }
public void ProcessInner(Action _action, Track _track, int delta) { VInt3 location = this.moveActor.get_handle().location; if (this.MoveType == ActorMoveType.Target && this.tarActor) { this.destPosition = this.tarActor.get_handle().location; if (this.tarActor && this.tarActor.get_handle().CharInfo != null) { CActorInfo charInfo = this.tarActor.get_handle().CharInfo; this.hitHeight = charInfo.iBulletHeight; VInt3 vInt = this.moveActor.get_handle().location - this.destPosition; vInt.y = 0; vInt = vInt.NormalizeTo(1000); this.destPosition += IntMath.Divide(vInt, (long)charInfo.iCollisionSize.x, 1000L); } this.destPosition.y = this.destPosition.y + this.hitHeight; } this.moveDirection = this.destPosition - location; this.lerpDirection = this.moveDirection; if (this.bMoveRotate) { this.RotateMoveBullet(this.moveDirection); } int num; if (!this.shouldUseAcceleration) { num = this.velocity * delta / 1000; } else { long num2 = (long)this.lastVelocity * (long)delta + (long)this.acceleration * (long)delta * (long)delta / 2L / 1000L; num2 /= 1000L; num = (int)num2; this.lastVelocity += this.acceleration * delta / 1000; } if ((long)num * (long)num >= this.moveDirection.get_sqrMagnitudeLong2D() && this.bReachDestStop) { int magnitude2D = (this.destPosition - this.moveActor.get_handle().location).get_magnitude2D(); this.moveActor.get_handle().location = this.destPosition; this.stopCondtion = true; if (this.moveActor.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Bullet) { BulletWrapper bulletWrapper = this.moveActor.get_handle().ActorControl as BulletWrapper; if (bulletWrapper != null && bulletWrapper.GetMoveCollisiong()) { bulletWrapper.SetMoveDelta(magnitude2D); } } } else { VInt3 location2; if (this.gravity < 0) { this.moveDirection.y = 0; location2 = location + this.moveDirection.NormalizeTo(num); location2.y += this.gravityControler.GetMotionDeltaDistance(delta); VInt vInt2; if (PathfindingUtility.GetGroundY(this.destPosition, out vInt2) && location2.y < vInt2.i) { location2.y = vInt2.i; } } else { location2 = location + this.moveDirection.NormalizeTo(num); } if (this.moveActor.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Bullet) { BulletWrapper bulletWrapper2 = this.moveActor.get_handle().ActorControl as BulletWrapper; if (bulletWrapper2 != null && bulletWrapper2.GetMoveCollisiong()) { bulletWrapper2.SetMoveDelta(num); } } this.moveActor.get_handle().location = location2; } SkillUseContext refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext"); if (refParamObject != null) { refParamObject.EffectPos = this.moveActor.get_handle().location; refParamObject.EffectDir = this.moveDirection; } }
public void ProcessInner(Action _action, Track _track, int delta) { if (this.MoveType == ActorMoveType.RotateBody) { int num = this.rotateBodyDegreeSpeed * delta / 1000; VInt3 vInt = this.moveActor.handle.forward.RotateY(-num); this.moveActor.handle.forward = vInt; this.moveActor.handle.rotation = Quaternion.LookRotation((Vector3)vInt); this.rotateBodyCurDirDegreeAngle += num; this.rotateBodyCurDirDegreeAngle %= 360; long nom = (long)((float)this.rotateBodyCurDirDegreeAngle * 0.0174532924f * 1000f); VFactor f; VFactor f2; IntMath.sincos(out f, out f2, nom, 1000L); this.destPosition.x = this.originateActor.handle.location.x + this.rotateBodyRadius * f2; this.destPosition.y = this.rotateBodyHeight; this.destPosition.z = this.originateActor.handle.location.z + this.rotateBodyRadius * f; this.moveDirection = this.destPosition - this.moveActor.handle.location; this.lerpDirection = this.moveDirection; this.moveActor.handle.location = this.destPosition; } else { VInt3 location = this.moveActor.handle.location; if (this.MoveType == ActorMoveType.Target && this.tarActor) { this.destPosition = this.tarActor.handle.location; if (this.tarActor && this.tarActor.handle.CharInfo != null) { CActorInfo charInfo = this.tarActor.handle.CharInfo; this.hitHeight = charInfo.iBulletHeight; VInt3 a = this.moveActor.handle.location - this.destPosition; a.y = 0; a = a.NormalizeTo(1000); this.destPosition += IntMath.Divide(a, (long)charInfo.iCollisionSize.x, 1000L); } this.destPosition.y = this.destPosition.y + this.hitHeight; } if (this.bMoveOnXAxis) { this.moveDirection = this.destPosition - this.zCurPosition; } else { this.moveDirection = this.destPosition - location; } this.lerpDirection = this.moveDirection; if (this.bMoveRotate && !this.bMoveOnXAxis) { this.RotateMoveBullet(this.moveDirection); } int num2; if (!this.shouldUseAcceleration) { num2 = this.velocity * delta / 1000; } else { long num3 = (long)this.lastVelocity * (long)delta + (long)this.acceleration * (long)delta * (long)delta / 2L / 1000L; num3 /= 1000L; num2 = (int)num3; this.lastVelocity += this.acceleration * delta / 1000; } if ((long)num2 * (long)num2 >= this.moveDirection.sqrMagnitudeLong2D && this.bReachDestStop) { int magnitude2D = (this.destPosition - this.moveActor.handle.location).magnitude2D; if (this.bMoveOnXAxis) { this.destPosition += this.xDestPosition; } this.moveActor.handle.location = this.destPosition; this.stopCondtion = true; if (this.moveActor.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Bullet) { BulletWrapper bulletWrapper = this.moveActor.handle.ActorControl as BulletWrapper; if (bulletWrapper != null && bulletWrapper.GetMoveCollisiong()) { bulletWrapper.SetMoveDelta(magnitude2D); } } } else { VInt3 vInt2; if (this.gravity < 0) { this.moveDirection.y = 0; vInt2 = location + this.moveDirection.NormalizeTo(num2); vInt2.y += this.gravityControler.GetMotionDeltaDistance(delta); VInt vInt3; if (PathfindingUtility.GetGroundY(this.destPosition, out vInt3) && vInt2.y < vInt3.i) { vInt2.y = vInt3.i; } } else { vInt2 = location + this.moveDirection.NormalizeTo(num2); } if (this.bMoveOnXAxis) { this.zCurPosition += this.moveDirection.NormalizeTo(num2); int motionDeltaDistance = this.xControler.GetMotionDeltaDistance(delta); VInt3 vInt4 = this.xDirection; vInt4.NormalizeTo(Math.Abs(motionDeltaDistance)); if (motionDeltaDistance < 0) { vInt4 = -vInt4; } vInt2 += vInt4; if (this.bMoveRotate) { VInt3 dir = vInt2 - location; this.RotateMoveBullet(dir); } } if (this.moveActor.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Bullet) { BulletWrapper bulletWrapper2 = this.moveActor.handle.ActorControl as BulletWrapper; if (bulletWrapper2 != null && bulletWrapper2.GetMoveCollisiong()) { bulletWrapper2.SetMoveDelta(num2); } } this.moveActor.handle.location = vInt2; } } SkillUseContext refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext"); if (refParamObject != null) { refParamObject.EffectPos = this.moveActor.handle.location; refParamObject.EffectDir = this.moveDirection; } }