mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-07 05:54:48 +02:00
Entering battle without pokémon triggers blackout
This commit is contained in:
parent
022597262c
commit
2f0cccb052
@ -77,10 +77,18 @@
|
|||||||
Screen.Level.World.Initialize(Screen.Level.EnvironmentType, Screen.Level.WeatherType)
|
Screen.Level.World.Initialize(Screen.Level.EnvironmentType, Screen.Level.WeatherType)
|
||||||
|
|
||||||
Dim positionString() As String = Core.Player.LastRestPlacePosition.Split(CChar(","))
|
Dim positionString() As String = Core.Player.LastRestPlacePosition.Split(CChar(","))
|
||||||
|
If PreScreen.Identification = Identifications.BattleScreen Then
|
||||||
CType(BattleScreen.SavedOverworld.Camera, OverworldCamera).YawLocked = False
|
CType(BattleScreen.SavedOverworld.Camera, OverworldCamera).YawLocked = False
|
||||||
|
Else
|
||||||
|
CType(Screen.Camera, OverworldCamera).YawLocked = False
|
||||||
|
End If
|
||||||
Screen.Camera.Yaw = MathHelper.Pi
|
Screen.Camera.Yaw = MathHelper.Pi
|
||||||
Screen.Camera.Position = New Vector3(CSng(positionString(0).Replace(".", GameController.DecSeparator)), CSng(positionString(1).Replace(".", GameController.DecSeparator)), CSng(positionString(2).Replace(".", GameController.DecSeparator)))
|
Screen.Camera.Position = New Vector3(CSng(positionString(0).Replace(".", GameController.DecSeparator)), CSng(positionString(1).Replace(".", GameController.DecSeparator)), CSng(positionString(2).Replace(".", GameController.DecSeparator)))
|
||||||
|
If PreScreen.Identification = Identifications.BattleScreen Then
|
||||||
CType(BattleScreen.SavedOverworld.OverworldScreen, OverworldScreen).ActionScript.Scripts.Clear()
|
CType(BattleScreen.SavedOverworld.OverworldScreen, OverworldScreen).ActionScript.Scripts.Clear()
|
||||||
|
Else
|
||||||
|
CType(PreScreen, OverworldScreen).ActionScript.Scripts.Clear()
|
||||||
|
End If
|
||||||
|
|
||||||
While Core.CurrentScreen.Identification <> Identifications.OverworldScreen
|
While Core.CurrentScreen.Identification <> Identifications.OverworldScreen
|
||||||
Core.SetScreen(Core.CurrentScreen.PreScreen)
|
Core.SetScreen(Core.CurrentScreen.PreScreen)
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
|
|
||||||
CanContinue = False
|
CanContinue = False
|
||||||
Else
|
Else
|
||||||
IsReady = True
|
Core.SetScreen(New TransitionScreen(Core.CurrentScreen, New BlackOutScreen(Core.CurrentScreen), Color.Black, False))
|
||||||
End If
|
End If
|
||||||
Case "trainer"
|
Case "trainer"
|
||||||
If Core.Player.Pokemons.Count > 0 Then
|
If Core.Player.Pokemons.Count > 0 Then
|
||||||
@ -92,7 +92,7 @@
|
|||||||
|
|
||||||
CanContinue = False
|
CanContinue = False
|
||||||
Else
|
Else
|
||||||
IsReady = True
|
Core.SetScreen(New TransitionScreen(Core.CurrentScreen, New BlackOutScreen(Core.CurrentScreen), Color.Black, False))
|
||||||
End If
|
End If
|
||||||
Case "wild"
|
Case "wild"
|
||||||
' ID, Level, [shiny], [musicloop], [introtype]
|
' ID, Level, [shiny], [musicloop], [introtype]
|
||||||
@ -177,7 +177,7 @@
|
|||||||
|
|
||||||
CanContinue = False
|
CanContinue = False
|
||||||
Else
|
Else
|
||||||
IsReady = True
|
Core.SetScreen(New TransitionScreen(Core.CurrentScreen, New BlackOutScreen(Core.CurrentScreen), Color.Black, False))
|
||||||
End If
|
End If
|
||||||
Case "setvar"
|
Case "setvar"
|
||||||
Dim varname As String = argument.GetSplit(0)
|
Dim varname As String = argument.GetSplit(0)
|
||||||
|
@ -849,9 +849,7 @@ Public Class Level
|
|||||||
Me._backdropRenderer.Update()
|
Me._backdropRenderer.Update()
|
||||||
|
|
||||||
Me.UpdatePlayerWarp()
|
Me.UpdatePlayerWarp()
|
||||||
If Core.Player.Pokemons.Count > 0 Then
|
|
||||||
Me._pokemonEncounter.TriggerBattle()
|
Me._pokemonEncounter.TriggerBattle()
|
||||||
End If
|
|
||||||
|
|
||||||
' Reload map from file (Debug or Sandbox Mode):
|
' Reload map from file (Debug or Sandbox Mode):
|
||||||
If GameController.IS_DEBUG_ACTIVE = True Or Core.Player.SandBoxMode = True Then
|
If GameController.IS_DEBUG_ACTIVE = True Or Core.Player.SandBoxMode = True Then
|
||||||
|
@ -116,6 +116,11 @@ Public Class PokemonEncounter
|
|||||||
Public Sub TriggerBattle()
|
Public Sub TriggerBattle()
|
||||||
' If the encounter check is true:
|
' If the encounter check is true:
|
||||||
If Me._levelReference.PokemonEncounterData.EncounteredPokemon = True And Core.CurrentScreen.Identification = Screen.Identifications.OverworldScreen Then
|
If Me._levelReference.PokemonEncounterData.EncounteredPokemon = True And Core.CurrentScreen.Identification = Screen.Identifications.OverworldScreen Then
|
||||||
|
If Core.Player.Pokemons.Count = 0 Then
|
||||||
|
Core.SetScreen(New TransitionScreen(Core.CurrentScreen, New BlackOutScreen(Core.CurrentScreen), Color.Black, False))
|
||||||
|
Me._levelReference.PokemonEncounterData.EncounteredPokemon = False
|
||||||
|
Exit Sub
|
||||||
|
Else
|
||||||
' If the player met the set position:
|
' If the player met the set position:
|
||||||
If Screen.Camera.Position.X = Me._levelReference.PokemonEncounterData.Position.X And Screen.Camera.Position.Z = Me._levelReference.PokemonEncounterData.Position.Z Then
|
If Screen.Camera.Position.X = Me._levelReference.PokemonEncounterData.Position.X And Screen.Camera.Position.Z = Me._levelReference.PokemonEncounterData.Position.Z Then
|
||||||
' Make the player stop and set encounter check to false:
|
' Make the player stop and set encounter check to false:
|
||||||
@ -174,6 +179,7 @@ Public Class PokemonEncounter
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
Loading…
x
Reference in New Issue
Block a user