private void RefreshPlayerDirection() { if (this.PlayerManager.Action != ActionType.SideClimbingLadder) { return; } this.PlayerManager.LookingDirection = ClimbingApproachExtensions.AsDirection(this.currentApproach); }
private void RefreshPlayerDirection(bool force) { if (!force && this.InputManager.Movement == Vector2.Zero) { return; } if (this.PlayerManager.Action == ActionType.SideClimbingVine) { this.PlayerManager.LookingDirection = ClimbingApproachExtensions.AsDirection(this.currentApproach); } else { this.PlayerManager.LookingDirection = FezMath.DirectionFromMovement(this.InputManager.Movement.X); } }
protected override void TestConditions() { switch (this.PlayerManager.Action) { case ActionType.Teetering: case ActionType.IdlePlay: case ActionType.IdleSleep: case ActionType.IdleLookAround: case ActionType.GrabCornerLedge: case ActionType.GrabLedgeBack: case ActionType.IdleYawn: case ActionType.Idle: case ActionType.LookingLeft: case ActionType.LookingRight: case ActionType.LookingUp: case ActionType.LookingDown: case ActionType.Walking: case ActionType.Running: case ActionType.Jumping: case ActionType.Lifting: case ActionType.Falling: case ActionType.Bouncing: case ActionType.Flying: case ActionType.Dropping: case ActionType.Sliding: case ActionType.Landing: TrileInstance trileInstance = this.IsOnVine(out this.currentApproach); if (this.currentApproach == ClimbingApproach.None || (!FezButtonStateExtensions.IsDown(this.InputManager.Up) || ActionTypeExtensions.IsOnLedge(this.PlayerManager.Action)) && (this.PlayerManager.Grounded || this.currentApproach != ClimbingApproach.Left && this.currentApproach != ClimbingApproach.Right || Math.Sign(this.InputManager.Movement.X) != FezMath.Sign(ClimbingApproachExtensions.AsDirection(this.currentApproach))) && (!ActionTypeExtensions.IsOnLedge(this.PlayerManager.Action) || !FezButtonStateExtensions.IsDown(this.InputManager.Down)) || trileInstance == this.lastGrabbed) { break; } this.PlayerManager.HeldInstance = trileInstance; switch (this.currentApproach) { case ClimbingApproach.Right: case ClimbingApproach.Left: this.PlayerManager.NextAction = ActionType.SideClimbingVine; break; case ClimbingApproach.Back: this.PlayerManager.NextAction = ActionType.BackClimbingVine; break; case ClimbingApproach.Front: this.PlayerManager.NextAction = ActionType.FrontClimbingVine; break; } if (ActionTypeExtensions.IsOnLedge(this.PlayerManager.Action)) { this.PlayerManager.Action = this.PlayerManager.NextAction; this.PlayerManager.NextAction = ActionType.None; break; } else { this.PlayerManager.Action = this.currentApproach == ClimbingApproach.Back ? ActionType.JumpToClimb : ActionType.JumpToSideClimb; this.PlayerManager.Velocity = Vector3.Zero; if (this.currentApproach != ClimbingApproach.Left && this.currentApproach != ClimbingApproach.Right) { break; } this.PlayerManager.LookingDirection = ClimbingApproachExtensions.AsDirection(this.currentApproach); break; } } }
protected override void TestConditions() { switch (this.PlayerManager.Action) { case ActionType.Teetering: case ActionType.IdlePlay: case ActionType.IdleSleep: case ActionType.IdleLookAround: case ActionType.IdleYawn: case ActionType.Idle: case ActionType.LookingLeft: case ActionType.LookingRight: case ActionType.LookingUp: case ActionType.LookingDown: case ActionType.Walking: case ActionType.Running: case ActionType.Jumping: case ActionType.Lifting: case ActionType.Falling: case ActionType.Bouncing: case ActionType.Flying: case ActionType.Dropping: case ActionType.Sliding: case ActionType.Landing: TrileInstance trileInstance1 = this.IsOnLadder(out this.currentApproach); if (this.currentApproach == ClimbingApproach.None) { break; } bool flag = false; if (FezButtonStateExtensions.IsDown(this.InputManager.Down) && this.PlayerManager.Grounded) { TrileInstance trileInstance2 = this.LevelManager.NearestTrile(trileInstance1.Center - Vector3.UnitY).Surface; flag = trileInstance2 != null && trileInstance2.Trile.ActorSettings.Type == ActorType.Ladder; } FezButtonState fezButtonState = this.PlayerManager.Grounded ? FezButtonState.Pressed : FezButtonState.Down; if (!flag && this.InputManager.Up != fezButtonState && (this.PlayerManager.Grounded || this.currentApproach != ClimbingApproach.Left && this.currentApproach != ClimbingApproach.Right || Math.Sign(this.InputManager.Movement.X) != FezMath.Sign(ClimbingApproachExtensions.AsDirection(this.currentApproach))) || this.lastGrabbed != null && (trileInstance1 == this.lastGrabbed || trileInstance1.Position == this.lastGrabbed.Position + Vector3.UnitY || trileInstance1.Position == this.lastGrabbed.Position - Vector3.UnitY)) { break; } this.PlayerManager.HeldInstance = trileInstance1; switch (this.currentApproach) { case ClimbingApproach.Right: case ClimbingApproach.Left: this.PlayerManager.NextAction = ActionType.SideClimbingLadder; break; case ClimbingApproach.Back: this.PlayerManager.NextAction = ActionType.BackClimbingLadder; break; case ClimbingApproach.Front: this.PlayerManager.NextAction = ActionType.FrontClimbingLadder; break; } if (this.PlayerManager.Grounded) { ActionType actionType = this.currentApproach == ClimbingApproach.Back ? ActionType.IdleToClimb : (this.currentApproach == ClimbingApproach.Front ? ActionType.IdleToFrontClimb : (this.currentApproach == ClimbingApproach.Back ? ActionType.IdleToClimb : ActionType.IdleToSideClimb)); if (this.CollisionManager.CollidePoint(this.GetDestination(), Vector3.Down, QueryOptions.None, 0.0f, this.CameraManager.Viewpoint).Collided) { this.WalkTo.Destination = new Func <Vector3>(this.GetDestination); this.WalkTo.NextAction = actionType; this.PlayerManager.Action = ActionType.WalkingTo; } else { this.PlayerManager.Action = actionType; this.PlayerManager.Position -= 0.15f * Vector3.UnitY; } } else { this.PlayerManager.Action = this.currentApproach == ClimbingApproach.Back ? ActionType.JumpToClimb : ActionType.JumpToSideClimb; } if (this.currentApproach != ClimbingApproach.Left && this.currentApproach != ClimbingApproach.Right) { break; } this.PlayerManager.LookingDirection = ClimbingApproachExtensions.AsDirection(this.currentApproach); break; } }