mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-28 00:04:33 +02:00
Added Egg Hatch command
Format: @Pokemon.Hatch(PartyIndex,[CanRename],[Message]) Description: If the Pokémon specified in the PartyIndex argument is an egg, it hatches immediately Arguments: PartyIndex (int) - Index of a Pokémon in the player's party. Values can range from 0-5. CanRename (bool) - Optional. Whether the player can rename the Pokémon or not after it hatches. Message (str) - Optional. The message to display after the Pokémon hatches.
This commit is contained in:
parent
d1698db4ba
commit
b258139ee8
@ -10,18 +10,24 @@
|
|||||||
Dim delay As Single = 4.0F
|
Dim delay As Single = 4.0F
|
||||||
Dim size As Single = 0.0F
|
Dim size As Single = 0.0F
|
||||||
|
|
||||||
|
Dim CanRename As Boolean = True
|
||||||
|
Dim Message As String = ""
|
||||||
|
|
||||||
Dim cPokemon As Pokemon
|
Dim cPokemon As Pokemon
|
||||||
|
|
||||||
Public Sub New(ByVal currentScreen As Screen, ByVal Pokemon As List(Of Pokemon))
|
Public Sub New(ByVal currentScreen As Screen, ByVal Pokemon As List(Of Pokemon), Optional CanRename As Boolean = True, Optional Message As String = "")
|
||||||
Me.PreScreen = currentScreen
|
Me.PreScreen = currentScreen
|
||||||
PlayerStatistics.Track("Eggs hatched", 1)
|
PlayerStatistics.Track("Eggs hatched", 1)
|
||||||
|
|
||||||
Me.Identification = Identifications.HatchEggScreen
|
Me.Identification = Identifications.HatchEggScreen
|
||||||
Me.Pokemons = Pokemon
|
Me.Pokemons = Pokemon
|
||||||
|
|
||||||
Me.cPokemon = Me.Pokemons(0)
|
Me.cPokemon = Me.Pokemons(0)
|
||||||
cPokemon.EggSteps = 0
|
cPokemon.EggSteps = 0
|
||||||
Core.Player.Pokemons.Add(cPokemon)
|
Core.Player.Pokemons.Add(cPokemon)
|
||||||
|
|
||||||
|
Me.CanRename = CanRename
|
||||||
|
Me.Message = Message
|
||||||
If cPokemon.IsShiny = True Then
|
If cPokemon.IsShiny = True Then
|
||||||
Core.Player.PokedexData = Pokedex.ChangeEntry(Core.Player.PokedexData, cPokemon.Number, 3)
|
Core.Player.PokedexData = Pokedex.ChangeEntry(Core.Player.PokedexData, cPokemon.Number, 3)
|
||||||
Else
|
Else
|
||||||
@ -85,7 +91,14 @@
|
|||||||
cPokemon.PlayCry()
|
cPokemon.PlayCry()
|
||||||
SoundManager.PlaySound("success", True)
|
SoundManager.PlaySound("success", True)
|
||||||
Stage = 7
|
Stage = 7
|
||||||
TextBox.Show("Congratulations!~Your egg hatched into~a " & cPokemon.GetName() & "!*Do you want to give~a nickname to the freshly~hatched " & cPokemon.GetName() & "?%Yes|No%", AddressOf Me.ResultFunction, False, False, TextBox.DefaultColor)
|
If Message = "" Then
|
||||||
|
TextBox.Show("Congratulations!~Your egg hatched into~a " & cPokemon.GetName() & "!")
|
||||||
|
Else
|
||||||
|
TextBox.Show(Message)
|
||||||
|
End If
|
||||||
|
If CanRename = True Then
|
||||||
|
TextBox.Show("Do you want to give~a nickname to the freshly~hatched " & cPokemon.GetName() & "?%Yes|No%", AddressOf Me.ResultFunction, False, False, TextBox.DefaultColor)
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
ElseIf Stage = 7 Then
|
ElseIf Stage = 7 Then
|
||||||
If Me.IsCurrentScreen = True Then
|
If Me.IsCurrentScreen = True Then
|
||||||
|
@ -849,6 +849,24 @@
|
|||||||
If Core.Player.Pokemons.Count - 1 >= Index Then
|
If Core.Player.Pokemons.Count - 1 >= Index Then
|
||||||
Core.Player.Pokemons(Index).EggSteps = StepsToSet
|
Core.Player.Pokemons(Index).EggSteps = StepsToSet
|
||||||
End If
|
End If
|
||||||
|
Case "hatch"
|
||||||
|
' @Pokemon.Hatch(PartyIndex,[CanRename],[Message])
|
||||||
|
Dim Index As Integer = int(argument.GetSplit(0, ","))
|
||||||
|
Dim CanRename As Boolean = True
|
||||||
|
Dim Message As String = ""
|
||||||
|
Dim Pokemon As Pokemon = Nothing
|
||||||
|
If argument.Split(",").Count > 1 Then
|
||||||
|
CanRename = CBool(argument.GetSplit(1, ","))
|
||||||
|
If argument.Split(",").Count > 2 Then
|
||||||
|
Message = CStr(argument.GetSplit(2, ","))
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
If Core.Player.Pokemons.Count - 1 >= Index Then
|
||||||
|
Pokemon = Core.Player.Pokemons(Index)
|
||||||
|
End If
|
||||||
|
Screen.TextBox.Show("?")
|
||||||
|
SetScreen(New TransitionScreen(CType(CurrentScreen, OverworldScreen), New HatchEggScreen(CType(CurrentScreen, OverworldScreen), {Pokemon}.ToList, CanRename, Message), Color.White, False))
|
||||||
|
CanContinue = False
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
IsReady = True
|
IsReady = True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user