Prevent wild & trainer battles without pokémon
when the player has no Pokémon in their team, wild and trainer battle commands don't do anything
This commit is contained in:
parent
94247a7754
commit
daef33a886
|
@ -12,6 +12,7 @@
|
|||
|
||||
Select Case command.ToLower()
|
||||
Case "starttrainer"
|
||||
If Core.Player.Pokemons.Count > 0 Then
|
||||
Dim t As New Trainer(argument)
|
||||
If t.IsBeaten() = False Then
|
||||
If ScriptV2.started = False Then
|
||||
|
@ -50,7 +51,11 @@
|
|||
End If
|
||||
|
||||
CanContinue = False
|
||||
Else
|
||||
IsReady = True
|
||||
End If
|
||||
Case "trainer"
|
||||
If Core.Player.Pokemons.Count > 0 Then
|
||||
Dim ID As String = argument
|
||||
|
||||
If argument.CountSeperators(",") > 0 Then
|
||||
|
@ -86,13 +91,16 @@
|
|||
IsReady = True
|
||||
|
||||
CanContinue = False
|
||||
Else
|
||||
IsReady = True
|
||||
End If
|
||||
Case "wild"
|
||||
' ID, Level, [shiny], [musicloop], [introtype]
|
||||
' int int -1 or bool string int
|
||||
|
||||
' optional:
|
||||
' {pokemondata}, [musicloop], [introtype]
|
||||
|
||||
If Core.Player.Pokemons.Count > 0 Then
|
||||
Dim p As Pokemon = Nothing
|
||||
Dim musicLoop As String = ""
|
||||
Dim introType As Integer = Core.Random.Next(0, 10)
|
||||
|
@ -168,6 +176,9 @@
|
|||
IsReady = True
|
||||
|
||||
CanContinue = False
|
||||
Else
|
||||
IsReady = True
|
||||
End If
|
||||
Case "setvar"
|
||||
Dim varname As String = argument.GetSplit(0)
|
||||
Dim varvalue As String = argument.GetSplit(1)
|
||||
|
|
|
@ -849,7 +849,9 @@ Public Class Level
|
|||
Me._backdropRenderer.Update()
|
||||
|
||||
Me.UpdatePlayerWarp()
|
||||
If Core.Player.Pokemons.Count > 0 Then
|
||||
Me._pokemonEncounter.TriggerBattle()
|
||||
End If
|
||||
|
||||
' Reload map from file (Debug or Sandbox Mode):
|
||||
If GameController.IS_DEBUG_ACTIVE = True Or Core.Player.SandBoxMode = True Then
|
||||
|
|
Loading…
Reference in New Issue