public void CopyData(ref MoveBulletDurationContext r) { this.length = r.length; this.targetId = r.targetId; this.destId = r.destId; this.MoveType = r.MoveType; this.targetPosition = r.targetPosition; this.offsetDir = r.offsetDir; this.velocity = r.velocity; this.acceleration = r.acceleration; this.distance = r.distance; this.gravity = r.gravity; this.bMoveRotate = r.bMoveRotate; this.bAdjustSpeed = r.bAdjustSpeed; this.bBulletUseDir = r.bBulletUseDir; this.bUseIndicatorDir = r.bUseIndicatorDir; this.bReachDestStop = r.bReachDestStop; this.bResetMoveDistance = r.bResetMoveDistance; this.skillContext = r.skillContext; this.destPosition = r.destPosition; this.lastTime = r.lastTime; this.hitHeight = r.hitHeight; this.tarActor = r.tarActor; this.moveActor = r.moveActor; this.gravityControler = r.gravityControler; this.stopCondtion = r.stopCondtion; this.moveDirection = r.moveDirection; this.lerpDirection = r.lerpDirection; this.lastVelocity = r.lastVelocity; this.lastLerpVelocity = r.lastLerpVelocity; }
public void Leave(Action _action, Track _track) { if (this.moveActor != 0) { this.moveActor.handle.ObjLinker.RmvCustomMoveLerp(new CustomMoveLerpFunc(this.ActionMoveLerp)); } this.skillContext = null; this.tarActor.Release(); this.moveActor.Release(); this.gravityControler = null; }
public void Leave(AGE.Action _action, Track _track) { if (this.moveActor != 0) { this.moveActor.handle.ObjLinker.RmvCustomMoveLerp(new CustomMoveLerpFunc(this.ActionMoveLerp)); this.moveActor.handle.gameObject.transform.position = (Vector3)this.moveActor.handle.location; } this.skillContext = null; this.tarActor.Release(); this.moveActor.Release(); this.gravityControler = null; }
public override void OnUse() { base.OnUse(); this.tarActor.Release(); this.moveActor.Release(); this.attackActor.Release(); this.gravityControler = null; this.effectCountMap.Clear(); this.destPosition = VInt3.zero; this.stopCondtion = false; this.lastTime = 0; this.curEffectCount = 0; }
public override void OnUse() { base.OnUse(); this.targetId = 0; this.height = 0; this.gravity = -10; this.actor_.Release(); this.done_ = false; this.lastTime_ = 0; this.totalTime = 0; this.bMotionControl = false; this.movement = null; this.motionControler = null; }
public void CopyData(ref MoveBulletDurationContext r) { this.length = r.length; this.targetId = r.targetId; this.destId = r.destId; this.MoveType = r.MoveType; this.targetPosition = r.targetPosition; this.offsetDir = r.offsetDir; this.velocity = r.velocity; this.acceleration = r.acceleration; this.distance = r.distance; this.gravity = r.gravity; this.bMoveRotate = r.bMoveRotate; this.bAdjustSpeed = r.bAdjustSpeed; this.bBulletUseDir = r.bBulletUseDir; this.bUseIndicatorDir = r.bUseIndicatorDir; this.bReachDestStop = r.bReachDestStop; this.bResetMoveDistance = r.bResetMoveDistance; this.skillContext = r.skillContext; this.destPosition = r.destPosition; this.lastTime = r.lastTime; this.hitHeight = r.hitHeight; this.tarActor = r.tarActor; this.originateActor = r.originateActor; this.moveActor = r.moveActor; this.gravityControler = r.gravityControler; this.stopCondtion = r.stopCondtion; this.moveDirection = r.moveDirection; this.lerpDirection = r.lerpDirection; this.lastVelocity = r.lastVelocity; this.lastLerpVelocity = r.lastLerpVelocity; this.zCurPosition = r.zCurPosition; this.xDirection = r.xDirection; this.bMoveOnXAxis = r.bMoveOnXAxis; this.distanceZ0 = r.distanceZ0; this.distanceZ1 = r.distanceZ1; this.distanceX = r.distanceX; this.zDirection = r.zDirection; this.xDestPosition = r.xDestPosition; this.rotateBodyDegreeSpeed = r.rotateBodyDegreeSpeed; this.rotateBodyRadius = r.rotateBodyRadius; this.rotateBodyHeight = r.rotateBodyHeight; this.rotateBodyFindEnemyLatency = r.rotateBodyFindEnemyLatency; this.rotateBodyFindEnemyRadius = r.rotateBodyFindEnemyRadius; this.rotateBodyFindEnemyCd = r.rotateBodyFindEnemyCd; this.rotateBodyBulletCount = r.rotateBodyBulletCount; this.bFindTargetByRotateBodyBullet = r.bFindTargetByRotateBodyBullet; this.rotateBodyCurDirDegreeAngle = r.rotateBodyCurDirDegreeAngle; this.lerpRotateBodyCurDirDegreeAngle = r.lerpRotateBodyCurDirDegreeAngle; }
protected override void CopyData(BaseEvent src) { base.CopyData(src); PickFlyDuration duration = src as PickFlyDuration; this.targetId = duration.targetId; this.height = duration.height; this.gravity = duration.gravity; this.actor_ = duration.actor_; this.done_ = duration.done_; this.lastTime_ = duration.lastTime_; this.totalTime = duration.totalTime; this.bMotionControl = duration.bMotionControl; this.movement = duration.movement; this.motionControler = duration.motionControler; }
private void Init(Action _action) { this.moveActor = _action.GetActorHandle(this.targetId); if (!this.moveActor) { this.stopCondtion = true; return; } this.tarActor = _action.GetActorHandle(this.destId); this.attackActor = _action.GetActorHandle(this.attackId); if (!this.tarActor || !this.attackActor) { this.stopCondtion = true; return; } this.gravityControler = new AccelerateMotionControler(); this.moveActor.get_handle().ObjLinker.AddCustomMoveLerp(new CustomMoveLerpFunc(this.ActionMoveLerp)); }
public override void Enter(Action _action, Track _track) { this.done_ = false; base.Enter(_action, _track); this.actor_ = _action.GetActorHandle(this.targetId); if (this.actor_ != 0) { if (!this.actor_.handle.isMovable) { this.actor_.Release(); this.done_ = true; } else { this.actor_.handle.ActorControl.TerminateMove(); this.actor_.handle.ActorControl.AddNoAbilityFlag(ObjAbilityType.ObjAbility_Move); this.lastTime_ = 0; this.movement = this.actor_.handle.MovementComponent as PlayerMovement; this.motionControler = new AccelerateMotionControler(); if (this.movement != null) { int motionControlerCount = this.movement.GravityMode.GetMotionControlerCount(); if (motionControlerCount < 3) { if (motionControlerCount == 0) { this.motionControler.InitMotionControler(base.length, 0, this.gravity); } else if (motionControlerCount == 1) { this.motionControler.InitMotionControler(base.length, 0, IntMath.Divide((int)(this.gravity * 6), 10)); } else if (motionControlerCount == 2) { this.motionControler.InitMotionControler(base.length, 0, IntMath.Divide((int)(this.gravity * 4), 10)); } this.movement.GravityMode.AddMotionControler(this.motionControler); this.movement.isFlying = true; this.bMotionControl = true; } } } } }
public override void OnUse() { base.OnUse(); this.attackerId = 0; this.targetId = 0; this.attackerPos = VInt3.zero; this.initSpeed = 0x3e8; this.accelerateSpeed = 0x3e8; this.enableRotate = true; this.rotationTime = 0; this.dirType = BeatBackDirType.Position; this.atteDistance = 0; this.done_ = false; this.moveDirection = VInt3.zero; this.fromRot = Quaternion.identity; this.toRot = Quaternion.identity; this.lastTime_ = 0; this.motionControler = null; }
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; }
private void Init(Action _action) { this.moveActor = _action.GetActorHandle(this.targetId); if (this.moveActor == 0) { this.stopCondtion = true; } else { this.tarActor = _action.GetActorHandle(this.destId); this.attackActor = _action.GetActorHandle(this.attackId); if ((this.tarActor == 0) || (this.attackActor == 0)) { this.stopCondtion = true; } else { this.gravityControler = new AccelerateMotionControler(); this.moveActor.handle.ObjLinker.AddCustomMoveLerp(new CustomMoveLerpFunc(this.ActionMoveLerp)); } } }
public void Enter(Action _action) { this.skillContext = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext"); this.lastTime = 0; this.lastVelocity = (this.lastLerpVelocity = this.velocity); this.stopCondtion = false; this.moveActor = _action.GetActorHandle(this.targetId); if (!this.moveActor) { return; } this.gravityControler = new AccelerateMotionControler(); this.moveActor.get_handle().ObjLinker.AddCustomMoveLerp(new CustomMoveLerpFunc(this.ActionMoveLerp)); if (this.MoveType == ActorMoveType.Target) { this.tarActor = _action.GetActorHandle(this.destId); if (!this.tarActor) { return; } this.destPosition = this.tarActor.get_handle().location; CActorInfo charInfo = this.tarActor.get_handle().CharInfo; if (charInfo != null) { 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; } else if (this.MoveType == ActorMoveType.Directional) { VInt3 vInt2 = VInt3.one; if (this.skillContext == null) { return; } PoolObjHandle <ActorRoot> originator = this.skillContext.Originator; if (!originator) { return; } if (this.bBulletUseDir) { _action.refParams.GetRefParam("_BulletUseDir", ref vInt2); } else if (this.bUseIndicatorDir) { SkillUseContext refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext"); VInt3 vInt3; if (refParamObject != null && refParamObject.CalcAttackerDir(out vInt3, originator)) { vInt2 = vInt3; } else { vInt2 = originator.get_handle().forward; } } else { vInt2 = originator.get_handle().forward; } vInt2 = vInt2.RotateY(this.offsetDir.y); if (this.bResetMoveDistance) { int num = 0; _action.refParams.GetRefParam("_BulletRealFlyingTime", ref num); int num2 = num * this.velocity / 1000; this.distance = ((num2 <= 0) ? this.distance : num2); } this.destPosition = this.moveActor.get_handle().location + vInt2.NormalizeTo(this.distance); this.destPosition.y = this.moveActor.get_handle().location.y; } else if (this.MoveType == ActorMoveType.Position) { if (this.bReachDestStop) { this.destPosition = this.targetPosition; } else { VInt3 vInt4 = this.targetPosition - this.moveActor.get_handle().location; vInt4.y = 0; vInt4 = vInt4.NormalizeTo(1000); this.destPosition = this.moveActor.get_handle().location + vInt4 * (this.length * this.velocity / 1000); VInt vInt5; if (PathfindingUtility.GetGroundY(this.destPosition, out vInt5)) { this.destPosition.y = vInt5.i; } } } if (this.bAdjustSpeed) { VInt3 vInt6 = this.destPosition - this.moveActor.get_handle().location; int num3 = this.length - 100; num3 = ((num3 > 0) ? num3 : this.length); this.velocity = (int)IntMath.Divide((long)vInt6.get_magnitude2D() * 1000L, (long)num3); } if (this.gravity < 0) { if (this.velocity == 0) { this.stopCondtion = true; return; } VInt3 vInt7 = this.destPosition - this.moveActor.get_handle().location; int num4; if (!this.shouldUseAcceleration) { num4 = (int)IntMath.Divide((long)vInt7.get_magnitude2D() * 1000L, (long)this.velocity); } else { long num5 = (long)this.velocity; long num6 = (long)this.acceleration; long num7 = (long)vInt7.get_magnitude2D(); long num8 = num5 * num5 + 2L * num6 * num7; num4 = (int)IntMath.Divide(((long)IntMath.Sqrt(num8) - num5) * 1000L, num6); this.lastVelocity = (this.lastLerpVelocity = this.velocity); } if (num4 == 0) { this.stopCondtion = true; return; } VInt vInt8; if (PathfindingUtility.GetGroundY(this.destPosition, out vInt8)) { this.gravityControler.InitMotionControler(num4, vInt8.i - this.moveActor.get_handle().location.y, this.gravity); } else { this.gravityControler.InitMotionControler(num4, 0, this.gravity); } } }
public override void Enter(Action _action, Track _track) { PoolObjHandle <ActorRoot> actorHandle = new PoolObjHandle <ActorRoot>(null); this.done_ = false; this.lastTime_ = 0; base.Enter(_action, _track); VInt3 attackerPos = this.attackerPos; if (this.attackerId != -1) { if (_action.GetGameObject(this.attackerId) == null) { return; } actorHandle = _action.GetActorHandle(this.attackerId); if (actorHandle == 0) { return; } attackerPos = actorHandle.handle.location; } this.actor_ = _action.GetActorHandle(this.targetId); if (this.actor_ != 0) { if (!this.actor_.handle.isMovable) { this.actor_.Release(); this.done_ = true; } else { if (this.dirType == BeatBackDirType.Position) { VInt3 num2 = this.actor_.handle.location - attackerPos; num2.y = 0; this.moveDirection = num2.NormalizeTo(0x3e8); } else if (this.dirType == BeatBackDirType.Directional) { if (actorHandle == 0) { this.done_ = true; return; } this.moveDirection = actorHandle.handle.forward; } if (this.enableRotate) { this.fromRot = this.actor_.handle.rotation; this.actor_.handle.MovementComponent.SetRotate(-this.moveDirection, true); if (this.rotationTime > 0) { this.toRot = Quaternion.LookRotation((Vector3)this.actor_.handle.forward); } else { this.actor_.handle.rotation = Quaternion.LookRotation((Vector3)this.actor_.handle.forward); } } int initSpeed = this.initSpeed; this.motionControler = new AccelerateMotionControler(); if (this.atteDistance > 0) { VInt3 num4 = this.actor_.handle.location - attackerPos; VInt num5 = num4.magnitude2D; if (num5.i > this.atteDistance) { initSpeed = 0; } else { initSpeed = ((this.atteDistance - num5.i) * this.initSpeed) / this.atteDistance; } } this.motionControler.InitMotionControler(initSpeed, this.accelerateSpeed); this.actor_.handle.ObjLinker.AddCustomMoveLerp(new CustomMoveLerpFunc(this.ActionMoveLerp)); } } }
public void Enter(AGE.Action _action) { this.skillContext = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext"); this.lastTime = 0; this.lastVelocity = this.lastLerpVelocity = this.velocity; this.stopCondtion = false; this.moveActor = _action.GetActorHandle(this.targetId); if (this.moveActor != 0) { this.gravityControler = new AccelerateMotionControler(); this.moveActor.handle.ObjLinker.AddCustomMoveLerp(new CustomMoveLerpFunc(this.ActionMoveLerp)); if (this.MoveType == ActorMoveType.Target) { this.tarActor = _action.GetActorHandle(this.destId); if (this.tarActor == 0) { return; } this.destPosition = this.tarActor.handle.location; CActorInfo charInfo = this.tarActor.handle.CharInfo; if (charInfo != null) { this.hitHeight = charInfo.iBulletHeight; VInt3 a = this.moveActor.handle.location - this.destPosition; a.y = 0; a = a.NormalizeTo(0x3e8); this.destPosition += IntMath.Divide(a, (long)charInfo.iCollisionSize.x, 0x3e8L); } this.destPosition.y += this.hitHeight; } else if (this.MoveType == ActorMoveType.Directional) { VInt3 one = VInt3.one; if (this.skillContext == null) { return; } PoolObjHandle <ActorRoot> originator = this.skillContext.Originator; if (originator == 0) { return; } one = originator.handle.forward.RotateY(this.offsetDir.y); this.destPosition = this.moveActor.handle.location + one.NormalizeTo(this.distance); this.destPosition.y = this.moveActor.handle.location.y; } else if (this.MoveType == ActorMoveType.Position) { this.destPosition = this.targetPosition; } if (this.bAdjustSpeed) { VInt3 num3 = this.destPosition - this.moveActor.handle.location; int num4 = this.length - 100; num4 = (num4 > 0) ? num4 : this.length; this.velocity = (int)IntMath.Divide((long)(num3.magnitude2D * 0x3e8L), (long)num4); } if (this.gravity < 0) { if (this.velocity == 0) { this.stopCondtion = true; } else { VInt3 num5 = this.destPosition - this.moveActor.handle.location; int num6 = 0; if (!this.shouldUseAcceleration) { num6 = (int)IntMath.Divide((long)(num5.magnitude2D * 0x3e8L), (long)this.velocity); } else { long velocity = this.velocity; long acceleration = this.acceleration; long num9 = num5.magnitude2D; long num10 = (velocity * velocity) + ((2L * acceleration) * num9); num6 = (int)IntMath.Divide((long)((IntMath.Sqrt(num10) - velocity) * 0x3e8L), acceleration); this.lastVelocity = this.lastLerpVelocity = this.velocity; } if (num6 == 0) { this.stopCondtion = true; } else { VInt num11; if (PathfindingUtility.GetGroundY(this.destPosition, out num11)) { this.gravityControler.InitMotionControler(num6, num11.i - this.moveActor.handle.location.y, this.gravity); } else { this.gravityControler.InitMotionControler(num6, 0, this.gravity); } } } } } }
public override void Enter(Action _action, Track _track) { PoolObjHandle <ActorRoot> actorHandle = new PoolObjHandle <ActorRoot>(null); this.done_ = false; this.lastTime_ = 0; base.Enter(_action, _track); VInt3 location = this.attackerPos; if (this.attackerId != -1) { GameObject gameObject = _action.GetGameObject(this.attackerId); if (gameObject == null) { return; } actorHandle = _action.GetActorHandle(this.attackerId); if (!actorHandle) { return; } location = actorHandle.get_handle().location; } this.actor_ = _action.GetActorHandle(this.targetId); if (!this.actor_) { return; } if (!this.actor_.get_handle().isMovable) { this.actor_.Release(); this.done_ = true; return; } if (this.dirType == BeatBackDirType.Position) { VInt3 vInt = this.actor_.get_handle().location - location; vInt.y = 0; this.moveDirection = vInt.NormalizeTo(1000); } else if (this.dirType == BeatBackDirType.Directional) { if (!actorHandle) { this.done_ = true; return; } this.moveDirection = actorHandle.get_handle().forward; } if (this.enableRotate) { this.fromRot = this.actor_.get_handle().rotation; this.actor_.get_handle().MovementComponent.SetRotate(-this.moveDirection, true); if (this.rotationTime > 0) { this.toRot = Quaternion.LookRotation((Vector3)this.actor_.get_handle().forward); } else { this.actor_.get_handle().rotation = Quaternion.LookRotation((Vector3)this.actor_.get_handle().forward); } } int motionSpeed = this.initSpeed; this.motionControler = new AccelerateMotionControler(); if (this.atteDistance > 0) { VInt vInt2 = (this.actor_.get_handle().location - location).get_magnitude2D(); if (vInt2.i > this.atteDistance) { motionSpeed = 0; } else { motionSpeed = (this.atteDistance - vInt2.i) * this.initSpeed / this.atteDistance; } } this.motionControler.InitMotionControler(motionSpeed, this.accelerateSpeed); this.actor_.get_handle().ObjLinker.AddCustomMoveLerp(new CustomMoveLerpFunc(this.ActionMoveLerp)); }
public void Enter(Action _action) { this.skillContext = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext"); this.lastTime = 0; this.lastVelocity = (this.lastLerpVelocity = this.velocity); this.stopCondtion = false; this.moveActor = _action.GetActorHandle(this.targetId); if (!this.moveActor) { return; } this.gravityControler = new AccelerateMotionControler(); this.xControler = new xAxisAccelerateMotionControler(); this.moveActor.handle.ObjLinker.AddCustomMoveLerp(new CustomMoveLerpFunc(this.ActionMoveLerp)); if (this.MoveType == ActorMoveType.Target) { if (this.bFindTargetByRotateBodyBullet) { _action.refParams.GetRefParam("FindEnemyActor", ref this.tarActor); } else { this.tarActor = _action.GetActorHandle(this.destId); } if (!this.tarActor) { return; } this.destPosition = this.tarActor.handle.location; CActorInfo charInfo = this.tarActor.handle.CharInfo; if (charInfo != null) { 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; } else if (this.MoveType == ActorMoveType.Directional) { VInt3 vInt = VInt3.one; if (this.skillContext == null) { return; } PoolObjHandle <ActorRoot> originator = this.skillContext.Originator; if (!originator) { return; } if (this.bBulletUseDir) { _action.refParams.GetRefParam("_BulletUseDir", ref vInt); } else if (this.bUseIndicatorDir) { SkillUseContext refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext"); VInt3 vInt2; if (refParamObject != null && refParamObject.CalcAttackerDir(out vInt2, originator)) { vInt = vInt2; } else { vInt = originator.handle.forward; } } else { vInt = originator.handle.forward; } this.moveActor.handle.forward = vInt; this.moveActor.handle.rotation = Quaternion.LookRotation((Vector3)vInt); vInt = vInt.RotateY(this.offsetDir.y); if (this.bResetMoveDistance) { int num = 0; _action.refParams.GetRefParam("_BulletRealFlyingTime", ref num); int num2 = num * this.velocity / 1000; this.distance = ((num2 > 0) ? num2 : this.distance); } this.destPosition = this.moveActor.handle.location + vInt.NormalizeTo(this.distance); this.destPosition.y = this.moveActor.handle.location.y; } else if (this.MoveType == ActorMoveType.Position) { if (this.bReachDestStop) { this.destPosition = this.targetPosition; } else { VInt3 lhs = this.targetPosition - this.moveActor.handle.location; lhs.y = 0; lhs = lhs.NormalizeTo(1000); this.destPosition = this.moveActor.handle.location + lhs * (this.length * this.velocity / 1000); VInt vInt3; if (PathfindingUtility.GetGroundY(this.destPosition, out vInt3)) { this.destPosition.y = vInt3.i; } } } else if (this.MoveType == ActorMoveType.RotateBody) { this.originateActor = this.skillContext.Originator; if (!this.originateActor) { DebugHelper.Assert(false, "产生子弹的originateActor不能为空!!!"); return; } this.rotateBodyBulletCount = Mathf.Clamp(this.rotateBodyBulletCount, 1, 360); this.rotateBodyCurDirDegreeAngle = 360 / this.rotateBodyBulletCount * this.skillContext.BulletPos.x; VInt3 vInt4 = this.moveActor.handle.forward.RotateY(-this.rotateBodyCurDirDegreeAngle); this.moveActor.handle.forward = vInt4; this.moveActor.handle.rotation = Quaternion.LookRotation((Vector3)vInt4); } if (this.bAdjustSpeed) { VInt3 vInt5 = this.destPosition - this.moveActor.handle.location; int num3 = this.length - 100; num3 = ((num3 <= 0) ? this.length : num3); this.velocity = (int)IntMath.Divide((long)vInt5.magnitude2D * 1000L, (long)num3); } if (this.gravity < 0) { if (this.velocity == 0) { this.stopCondtion = true; return; } VInt3 vInt6 = this.destPosition - this.moveActor.handle.location; int num4; if (!this.shouldUseAcceleration) { num4 = (int)IntMath.Divide((long)vInt6.magnitude2D * 1000L, (long)this.velocity); } else { long num5 = (long)this.velocity; long num6 = (long)this.acceleration; long num7 = (long)vInt6.magnitude2D; long a2 = num5 * num5 + 2L * num6 * num7; num4 = (int)IntMath.Divide(((long)IntMath.Sqrt(a2) - num5) * 1000L, num6); this.lastVelocity = (this.lastLerpVelocity = this.velocity); } if (num4 == 0) { this.stopCondtion = true; return; } VInt vInt7; if (PathfindingUtility.GetGroundY(this.destPosition, out vInt7)) { this.gravityControler.InitMotionControler(num4, vInt7.i - this.moveActor.handle.location.y, this.gravity); } else { this.gravityControler.InitMotionControler(num4, 0, this.gravity); } } if (this.bMoveOnXAxis) { this.zDirection = this.destPosition - this.moveActor.handle.location; this.xDirection = VInt3.Cross(VInt3.up, this.zDirection); this.zCurPosition = this.moveActor.handle.location; if (this.bReachDestStop) { int[] array = new int[3]; VInt3[] array2 = new VInt3[] { default(VInt3), default(VInt3), this.destPosition - this.moveActor.handle.location }; array2[0] = array2[2]; array2[1] = array2[2]; array2[0].NormalizeTo(this.distanceZ0); array2[1].NormalizeTo(this.distanceZ1); for (int i = 0; i < array.Length; i++) { if (!this.shouldUseAcceleration) { array[i] = (int)IntMath.Divide((long)array2[i].magnitude2D * 1000L, (long)this.velocity); } else { long num8 = (long)this.velocity; long num9 = (long)this.acceleration; long num10 = (long)array2[i].magnitude2D; long a3 = num8 * num8 + 2L * num9 * num10; array[i] = (int)IntMath.Divide(((long)IntMath.Sqrt(a3) - num8) * 1000L, num9); } } if (array[2] > array[1] && array[1] > array[0] && array[0] > 0) { this.xControler.InitMotionControler(array[0], array[1], array[2], this.distanceZ0, this.distanceZ1, this.distanceX); int desPostion = this.xControler.getDesPostion(); this.xDestPosition = this.xDirection; this.xDestPosition.NormalizeTo(Math.Abs(desPostion)); if (desPostion < 0) { this.xDestPosition = -this.xDestPosition; } } else { this.bMoveOnXAxis = false; } } } }