Added arg to force camera rotation (in 3rd person)

This commit is contained in:
JappaWakka 2022-11-02 11:49:46 +01:00
parent 9312aa18c3
commit ac5fa28483
3 changed files with 38 additions and 8 deletions

View File

@ -43,7 +43,7 @@
Throw New NotImplementedException()
End Sub
Public Overridable Sub Turn(ByVal turns As Integer)
Public Overridable Sub Turn(ByVal turns As Integer, Optional ForceCameraTurn As Boolean = False)
Throw New NotImplementedException()
End Sub

View File

@ -957,7 +957,7 @@ Public Class OverworldCamera
Return 0F
End Function
Public Overrides Sub Turn(ByVal turns As Integer)
Public Overrides Sub Turn(ByVal turns As Integer, Optional ForceCameraTurn As Boolean = False)
If turns > 0 Then
If _thirdPerson = True Then
_playerFacing += turns
@ -965,6 +965,17 @@ Public Class OverworldCamera
_playerFacing -= 4
End While
Screen.Level.OwnPlayer.Opacity = 1.0F
If ForceCameraTurn = True Then
Dim facing As Integer = GetFacingDirection()
facing += _playerFacing - GetFacingDirection()
While facing > 3
facing -= 4
End While
Turning = True
_aimDirection = facing
End If
Else
Dim facing As Integer = GetFacingDirection()
facing += turns

View File

@ -94,8 +94,13 @@
IsReady = True
Screen.Level.OverworldPokemon.Visible = False
Case "turn"
Dim TurnAmount As Integer = argument.GetSplit(0, ",")
Dim ForceCameraTurn As Boolean = False
If argument.Split(",").Count > 1 Then
ForceCameraTurn = CBool(argument.GetSplit(1, ","))
End If
If Started = False Then
Screen.Camera.Turn(int(argument))
Screen.Camera.Turn(int(TurnAmount), ForceCameraTurn)
Started = True
Screen.Level.OverworldPokemon.Visible = False
Else
@ -120,31 +125,45 @@
End If
End If
Case "turnasync"
Screen.Camera.Turn(int(argument))
Dim TurnAmount As Integer = argument.GetSplit(0, ",")
Dim ForceCameraTurn As Boolean = False
If argument.Split(",").Count > 1 Then
ForceCameraTurn = CBool(argument.GetSplit(1, ","))
End If
Screen.Camera.Turn(int(TurnAmount), ForceCameraTurn)
IsReady = True
Screen.Level.OverworldPokemon.Visible = False
Case "turntoasync"
Dim turns As Integer = int(argument) - Screen.Camera.GetPlayerFacingDirection()
Dim ForceCameraTurn As Boolean = False
If argument.Split(",").Count > 1 Then
ForceCameraTurn = CBool(argument.GetSplit(1, ","))
End If
Dim turns As Integer = int(argument.GetSplit(0, ",")) - Screen.Camera.GetPlayerFacingDirection()
If turns < 0 Then
turns = turns + 4
End If
If turns > 0 Then
Screen.Camera.Turn(turns)
Screen.Camera.Turn(turns, ForceCameraTurn)
Started = True
Screen.Level.OverworldPokemon.Visible = False
End If
IsReady = True
Case "turnto"
Dim ForceCameraTurn As Boolean = False
If argument.Split(",").Count > 1 Then
ForceCameraTurn = CBool(argument.GetSplit(1, ","))
End If
If Started = False Then
Dim turns As Integer = int(argument) - Screen.Camera.GetPlayerFacingDirection()
Dim turns As Integer = int(argument.GetSplit(0, ",")) - Screen.Camera.GetPlayerFacingDirection()
If turns < 0 Then
turns = turns + 4
End If
If turns > 0 Then
Screen.Camera.Turn(turns)
Screen.Camera.Turn(turns, ForceCameraTurn)
Started = True
Screen.Level.OverworldPokemon.Visible = False
Else