mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-27 07:44:31 +02:00
Added GameRule "OverworldPoison"
if set to 0, no overworld poison (default) if set to 1, overworld poison until fainted if set to 2, overworld poison until 1 hp, then it's cured
This commit is contained in:
parent
a1a84bbe40
commit
728739760d
@ -168,6 +168,14 @@
|
|||||||
_daycareSteps = value
|
_daycareSteps = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
Public Property PoisonSteps() As Integer
|
||||||
|
Get
|
||||||
|
Return _poisonSteps
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
_poisonSteps = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
Public Property GameMode() As String
|
Public Property GameMode() As String
|
||||||
Get
|
Get
|
||||||
@ -393,6 +401,7 @@
|
|||||||
Private _repelSteps As Integer = 0
|
Private _repelSteps As Integer = 0
|
||||||
Private _saveCreated As String = "Pre 0.21"
|
Private _saveCreated As String = "Pre 0.21"
|
||||||
Private _daycareSteps As Integer = 0
|
Private _daycareSteps As Integer = 0
|
||||||
|
Private _poisonSteps As Integer = 0
|
||||||
Private _gameMode As String = "Kolben"
|
Private _gameMode As String = "Kolben"
|
||||||
Private _skin As String = "Hilbert"
|
Private _skin As String = "Hilbert"
|
||||||
Private _visitedMaps As String = ""
|
Private _visitedMaps As String = ""
|
||||||
@ -1730,6 +1739,8 @@
|
|||||||
Screen.Level.WalkedSteps += 1
|
Screen.Level.WalkedSteps += 1
|
||||||
Temp.MapSteps += 1
|
Temp.MapSteps += 1
|
||||||
DaycareSteps += stepAmount
|
DaycareSteps += stepAmount
|
||||||
|
StepEventPoison(stepAmount)
|
||||||
|
|
||||||
PlayerStatistics.Track("Steps taken", stepAmount)
|
PlayerStatistics.Track("Steps taken", stepAmount)
|
||||||
|
|
||||||
'Daycare cycle:
|
'Daycare cycle:
|
||||||
@ -1862,6 +1873,42 @@
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
Private Sub StepEventPoison(ByVal stepAmount As Integer)
|
||||||
|
If CanFireStepEvent() = True Then
|
||||||
|
If CInt(GameModeManager.GetGameRuleValue("OverworldPoison", "0")) > 0 Then
|
||||||
|
Dim PoisonAmount As Integer = 0
|
||||||
|
PoisonSteps += stepAmount
|
||||||
|
If PoisonSteps >= 3 Then
|
||||||
|
PoisonAmount += 1
|
||||||
|
PoisonSteps -= 4
|
||||||
|
End If
|
||||||
|
If PoisonAmount > 0 Then
|
||||||
|
For i = 0 To Core.Player.Pokemons.Count - 1
|
||||||
|
If Core.Player.Pokemons(i).Status = Pokemon.StatusProblems.Poison OrElse Core.Player.Pokemons(i).Status = Pokemon.StatusProblems.BadPoison Then
|
||||||
|
If Core.Player.Pokemons(i).Ability IsNot Ability.GetAbilityByID(17) Then
|
||||||
|
Core.Player.Pokemons(i).HP -= 1 * PoisonAmount
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
If CInt(GameModeManager.GetGameRuleValue("OverworldPoison", "0")) = 1 Then
|
||||||
|
For i = 0 To Core.Player.Pokemons.Count - 1
|
||||||
|
If Core.Player.Pokemons(i).HP <= 0 Then
|
||||||
|
Core.Player.Pokemons(i).Status = Pokemon.StatusProblems.Fainted
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
ElseIf CInt(GameModeManager.GetGameRuleValue("OverworldPoison", "0")) = 2 Then
|
||||||
|
For i = 0 To Core.Player.Pokemons.Count - 1
|
||||||
|
If Core.Player.Pokemons(i).HP <= 1 Then
|
||||||
|
Core.Player.Pokemons(i).Status = Pokemon.StatusProblems.None
|
||||||
|
Core.Player.Pokemons(i).HP = 1
|
||||||
|
Screen.TextBox.Show(Core.Player.Pokemons(i).GetDisplayName & "was cured of Poison")
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub StepEventPokegearCall()
|
Private Sub StepEventPokegearCall()
|
||||||
If CanFireStepEvent() = True Then
|
If CanFireStepEvent() = True Then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user