Allow for script determined roamer shinyness

This commit is contained in:
darkfire006 2021-09-30 10:16:26 -05:00
parent 08955ddcf3
commit 6f5d34f0b5
5 changed files with 22 additions and 10 deletions

View File

@ -1055,10 +1055,18 @@
Dim newP As Pokemon = Pokemon.GetPokemonByID(CInt(data(0))) Dim newP As Pokemon = Pokemon.GetPokemonByID(CInt(data(0)))
newP.Generate(CInt(data(1)), True) newP.Generate(CInt(data(1)), True)
RoamingPokemonData &= newP.Number.ToString() & "|" & newP.Level.ToString() & "|" & data(2) & "|" & data(3) & "||" & newP.GetSaveData() RoamingPokemonData &= newP.Number.ToString() & "|" & newP.Level.ToString() & "|" & data(2) & "|" & data(3) & "||" & newP.IsShiny.ToNumberString() & "|" & newP.GetSaveData()
Else
If line.CountSeperators("|") < 6 Then
'Update to include shiny
Dim data() As String = line.Split(CChar("|"))
Dim newP As Pokemon = Pokemon.GetPokemonByData(data(5))
RoamingPokemonData &= data(0) & "|" & data(1) & "|" & data(2) & "|" & data(3) & "|" & data(4) & "|" & newP.IsShiny.ToNumberString() & "|" & data(5)
Else Else
RoamingPokemonData &= line RoamingPokemonData &= line
End If End If
End If
Next Next
End If End If
End If End If

View File

@ -28,7 +28,7 @@ Public Class RoamingPokemon
Dim newData As String = "" Dim newData As String = ""
For Each line As String In Core.Player.RoamingPokemonData.SplitAtNewline() For Each line As String In Core.Player.RoamingPokemonData.SplitAtNewline()
If line <> "" And line.CountSeperators("|") >= 5 Then If line <> "" And line.CountSeperators("|") >= 6 Then
Dim data() As String = line.Split(CChar("|")) Dim data() As String = line.Split(CChar("|"))
If newData <> "" Then If newData <> "" Then
@ -54,8 +54,8 @@ Public Class RoamingPokemon
nextIndex = 0 nextIndex = 0
End If End If
'PokémonID,Level,regionID,startLevelFile,MusicLoop,PokemonData 'PokémonID,Level,regionID,startLevelFile,MusicLoop,Shiny,PokemonData
newData &= data(0) & "|" & data(1) & "|" & CInt(data(2)).ToString() & "|" & levelList(nextIndex) & "|" & data(4) & "|" & data(5) newData &= data(0) & "|" & data(1) & "|" & CInt(data(2)).ToString() & "|" & levelList(nextIndex) & "|" & data(4) & "|" & data(5) & "|" & data(6)
Else Else
newData &= line newData &= line
End If End If
@ -98,7 +98,7 @@ Public Class RoamingPokemon
If line.StartsWith(compareData) = False Then If line.StartsWith(compareData) = False Then
newData &= line newData &= line
Else Else
newData &= p.PokemonReference.Number & "|" & p.PokemonReference.Level & "|" & p.WorldID.ToString() & "|" & p.LevelFile & "|" & p.MusicLoop & "|" & p.PokemonReference.GetSaveData() newData &= p.PokemonReference.Number & "|" & p.PokemonReference.Level & "|" & p.WorldID.ToString() & "|" & p.LevelFile & "|" & p.MusicLoop & "|" & p.PokemonReference.IsShiny & "|" & p.PokemonReference.GetSaveData()
End If End If
Next Next

View File

@ -108,7 +108,7 @@ Public Class Spawner
Dim possibleEncounters As New List(Of String) Dim possibleEncounters As New List(Of String)
For Each cLine As String In roamingData For Each cLine As String In roamingData
If cLine <> "" And cLine.CountSeperators("|") = 5 Then If cLine <> "" And cLine.CountSeperators("|") = 6 Then
possibleEncounters.Add(cLine) possibleEncounters.Add(cLine)
End If End If
Next Next

View File

@ -233,7 +233,7 @@
If Not String.IsNullOrWhiteSpace(Core.Player.RoamingPokemonData) Then If Not String.IsNullOrWhiteSpace(Core.Player.RoamingPokemonData) Then
If Core.Player.RoamingPokemonData.Length > 0 AndAlso Core.Player.RoamingPokemonData.Contains("|") Then If Core.Player.RoamingPokemonData.Length > 0 AndAlso Core.Player.RoamingPokemonData.Contains("|") Then
For Each Pokes As String In Core.Player.RoamingPokemonData.SplitAtNewline For Each Pokes As String In Core.Player.RoamingPokemonData.SplitAtNewline
' PokémonID,Level,regionID,startLevelFile,MusicLoop,PokemonData ' PokémonID,Level,regionID,startLevelFile,MusicLoop,Shiny,PokemonData
Dim TempData() As String = Pokes.Split("|") Dim TempData() As String = Pokes.Split("|")
Dim MapFiles() As String = Tags("mapfiles").Split(",") Dim MapFiles() As String = Tags("mapfiles").Split(",")
Dim PokeCurrentLocation As String = TempData(3) Dim PokeCurrentLocation As String = TempData(3)

View File

@ -599,16 +599,20 @@
Core.Player.Pokemons(Index).CatchLocation = place Core.Player.Pokemons(Index).CatchLocation = place
End If End If
Case "newroaming" Case "newroaming"
' PokémonID,Level,regionID,startLevelFile,MusicLoop ' PokémonID,Level,regionID,startLevelFile,MusicLoop,[Shiny]
Dim data() As String = argument.Split(CChar(",")) Dim data() As String = argument.Split(CChar(","))
Dim p As Pokemon = Pokemon.GetPokemonByID(CInt(data(0))) Dim p As Pokemon = Pokemon.GetPokemonByID(CInt(data(0)))
p.Generate(CInt(data(1)), True) p.Generate(CInt(data(1)), True)
If data.Length > 5 AndAlso data(5) <> "" AndAlso data(5) <> "-1" Then
p.IsShiny = CBool(data(5))
End If
If Core.Player.RoamingPokemonData <> "" Then If Core.Player.RoamingPokemonData <> "" Then
Core.Player.RoamingPokemonData &= Environment.NewLine Core.Player.RoamingPokemonData &= Environment.NewLine
End If End If
Core.Player.RoamingPokemonData &= data(0) & "|" & data(1) & "|" & data(2) & "|" & data(3) & "|" & data(4) & "|" & p.GetSaveData() Core.Player.RoamingPokemonData &= data(0) & "|" & data(1) & "|" & data(2) & "|" & data(3) & "|" & data(4) & "|" & data(5) & "|" & p.GetSaveData()
Case "evolve" Case "evolve"
Dim args() As String = argument.Split(CChar(",")) Dim args() As String = argument.Split(CChar(","))
Dim triggerStr As String = "level" Dim triggerStr As String = "level"