mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-27 15:54:25 +02:00
Make ShinyRate & LevelMultiplier GameRules
This commit is contained in:
parent
f346a32495
commit
25bcc154a2
@ -212,27 +212,30 @@ Public Class Trainer
|
|||||||
If PokeData.StartsWith("{") = True And PokeData.EndsWith("}") = True Then
|
If PokeData.StartsWith("{") = True And PokeData.EndsWith("}") = True Then
|
||||||
Dim p As Pokemon = Pokemon.GetPokemonByData(PokeData)
|
Dim p As Pokemon = Pokemon.GetPokemonByData(PokeData)
|
||||||
|
|
||||||
If Core.Player.DifficultyMode > 0 Then
|
Dim level As Integer = p.Level
|
||||||
Dim level As Integer = p.Level
|
|
||||||
|
|
||||||
Dim addLevel As Integer = 0
|
Dim addLevel As Integer = 0
|
||||||
If Core.Player.DifficultyMode = 1 Then
|
If Core.Player.DifficultyMode = 0 Then
|
||||||
addLevel = CInt(Math.Ceiling(level / 10))
|
addLevel = CInt(Math.Ceiling(level * CSng(GameModeManager.GetGameRuleValue("LevelMultiplier", "1.0")) - level))
|
||||||
ElseIf Core.Player.DifficultyMode = 2 Then
|
ElseIf Core.Player.DifficultyMode = 1 Then
|
||||||
addLevel = CInt(Math.Ceiling(level / 5))
|
addLevel = CInt(Math.Ceiling(level * CSng(GameModeManager.GetGameRuleValue("LevelMultiplier", "1.1")) - level))
|
||||||
End If
|
ElseIf Core.Player.DifficultyMode = 2 Then
|
||||||
|
addLevel = CInt(Math.Ceiling(level * CSng(GameModeManager.GetGameRuleValue("LevelMultiplier", "1.2")) - level))
|
||||||
If level + addLevel > CInt(GameModeManager.GetGameRuleValue("MaxLevel", "100")) Then
|
|
||||||
addLevel = CInt(GameModeManager.GetGameRuleValue("MaxLevel", "100")) - level
|
|
||||||
End If
|
|
||||||
|
|
||||||
While level + addLevel > p.Level
|
|
||||||
p.LevelUp(False)
|
|
||||||
p.Experience = p.NeedExperience(p.Level)
|
|
||||||
End While
|
|
||||||
p.HP = p.MaxHP
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If level + addLevel > CInt(GameModeManager.GetGameRuleValue("MaxLevel", "100")) Then
|
||||||
|
addLevel = CInt(GameModeManager.GetGameRuleValue("MaxLevel", "100")) - level
|
||||||
|
End If
|
||||||
|
If addLevel <= 0 Then
|
||||||
|
addLevel = 0
|
||||||
|
End If
|
||||||
|
|
||||||
|
While level + addLevel > p.Level
|
||||||
|
p.LevelUp(False)
|
||||||
|
p.Experience = p.NeedExperience(p.Level)
|
||||||
|
End While
|
||||||
|
p.HP = p.MaxHP
|
||||||
|
|
||||||
Pokemons.Add(p)
|
Pokemons.Add(p)
|
||||||
Else
|
Else
|
||||||
Dim firstPart As String = ""
|
Dim firstPart As String = ""
|
||||||
@ -275,14 +278,19 @@ Public Class Trainer
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Dim addLevel As Integer = 0
|
Dim addLevel As Integer = 0
|
||||||
If Core.Player.DifficultyMode = 1 Then
|
If Core.Player.DifficultyMode = 0 Then
|
||||||
addLevel = CInt(Math.Ceiling(Level / 10))
|
addLevel = CInt(Math.Ceiling(Level * CSng(GameModeManager.GetGameRuleValue("LevelMultiplier", "1.0")) - Level))
|
||||||
|
ElseIf Core.Player.DifficultyMode = 1 Then
|
||||||
|
addLevel = CInt(Math.Ceiling(Level * CSng(GameModeManager.GetGameRuleValue("LevelMultiplier", "1.1")) - Level))
|
||||||
ElseIf Core.Player.DifficultyMode = 2 Then
|
ElseIf Core.Player.DifficultyMode = 2 Then
|
||||||
addLevel = CInt(Math.Ceiling(Level / 5))
|
addLevel = CInt(Math.Ceiling(Level * CSng(GameModeManager.GetGameRuleValue("LevelMultiplier", "1.2")) - Level))
|
||||||
End If
|
End If
|
||||||
If Level + addLevel > CInt(GameModeManager.GetGameRuleValue("MaxLevel", "100")) Then
|
If Level + addLevel > CInt(GameModeManager.GetGameRuleValue("MaxLevel", "100")) Then
|
||||||
addLevel = CInt(GameModeManager.GetGameRuleValue("MaxLevel", "100")) - Level
|
addLevel = CInt(GameModeManager.GetGameRuleValue("MaxLevel", "100")) - Level
|
||||||
End If
|
End If
|
||||||
|
If addLevel <= 0 Then
|
||||||
|
addLevel = 0
|
||||||
|
End If
|
||||||
|
|
||||||
Level += addLevel
|
Level += addLevel
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ Public Class Pokemon
|
|||||||
|
|
||||||
Public Shared ReadOnly Property MasterShinyRate(Optional ByVal adjusted As Boolean = True) As Integer
|
Public Shared ReadOnly Property MasterShinyRate(Optional ByVal adjusted As Boolean = True) As Integer
|
||||||
Get
|
Get
|
||||||
Dim shinyRate As Integer = 4096
|
Dim shinyRate As Integer = GameModeManager.ActiveGameMode.MasterShinyRate '4096 by default
|
||||||
|
|
||||||
If adjusted Then
|
If adjusted Then
|
||||||
For Each mysteryEvent As MysteryEventScreen.MysteryEvent In MysteryEventScreen.ActivatedMysteryEvents
|
For Each mysteryEvent As MysteryEventScreen.MysteryEvent In MysteryEventScreen.ActivatedMysteryEvents
|
||||||
|
@ -170,10 +170,12 @@ Public Class Spawner
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Dim addLevel As Integer = 0
|
Dim addLevel As Integer = 0
|
||||||
If Core.Player.DifficultyMode = 1 Then
|
If Core.Player.DifficultyMode = 0 Then
|
||||||
addLevel = CInt(Math.Floor(level / 10))
|
addLevel = CInt(Math.Ceiling(level * CSng(GameModeManager.GetGameRuleValue("LevelMultiplier", "1.0")) - level))
|
||||||
|
ElseIf Core.Player.DifficultyMode = 1 Then
|
||||||
|
addLevel = CInt(Math.Ceiling(level * CSng(GameModeManager.GetGameRuleValue("LevelMultiplier", "1.1")) - level))
|
||||||
ElseIf Core.Player.DifficultyMode = 2 Then
|
ElseIf Core.Player.DifficultyMode = 2 Then
|
||||||
addLevel = CInt(Math.Floor(level / 5))
|
addLevel = CInt(Math.Ceiling(level * CSng(GameModeManager.GetGameRuleValue("LevelMultiplier", "1.2")) - level))
|
||||||
End If
|
End If
|
||||||
level += addLevel
|
level += addLevel
|
||||||
If level > CInt(GameModeManager.GetGameRuleValue("MaxLevel", "100")) Then
|
If level > CInt(GameModeManager.GetGameRuleValue("MaxLevel", "100")) Then
|
||||||
|
@ -388,7 +388,7 @@ Public Class GameMode
|
|||||||
''' <param name="SkinNames">The skin names for the new GameMode. Must be the same amount as SkinFiles and SkinColors.</param>
|
''' <param name="SkinNames">The skin names for the new GameMode. Must be the same amount as SkinFiles and SkinColors.</param>
|
||||||
''' <param name="SkinGenders">The skin names for the new GameMode. Must be the same amount as SkinFiles and SkinColors.</param>
|
''' <param name="SkinGenders">The skin names for the new GameMode. Must be the same amount as SkinFiles and SkinColors.</param>
|
||||||
Public Sub New(ByVal Name As String, ByVal Description As String, ByVal Version As String, ByVal Author As String, ByVal MapPath As String, ByVal ScriptPath As String, ByVal PokeFilePath As String, ByVal PokemonDataPath As String, ByVal ContentPath As String, ByVal LocalizationsPath As String, ByVal GameRules As List(Of GameRule), ByVal HardGameRules As List(Of GameRule), ByVal SuperHardGameRules As List(Of GameRule),
|
Public Sub New(ByVal Name As String, ByVal Description As String, ByVal Version As String, ByVal Author As String, ByVal MapPath As String, ByVal ScriptPath As String, ByVal PokeFilePath As String, ByVal PokemonDataPath As String, ByVal ContentPath As String, ByVal LocalizationsPath As String, ByVal GameRules As List(Of GameRule), ByVal HardGameRules As List(Of GameRule), ByVal SuperHardGameRules As List(Of GameRule),
|
||||||
ByVal StartMap As String, ByVal StartPosition As Vector3, ByVal StartRotation As Single, ByVal StartLocationName As String, ByVal StartDialogue As String, ByVal StartColor As Color, ByVal PokemonAppear As String, ByVal IntroMusic As String, ByVal IntroType As String, ByVal SkinColors As List(Of Color), ByVal SkinFiles As List(Of String), ByVal SkinNames As List(Of String), ByVal SkinGenders As List(Of String), Optional WaterSpeed As Integer = 8)
|
ByVal StartMap As String, ByVal StartPosition As Vector3, ByVal StartRotation As Single, ByVal StartLocationName As String, ByVal StartDialogue As String, ByVal StartColor As Color, ByVal PokemonAppear As String, ByVal IntroMusic As String, ByVal IntroType As String, ByVal SkinColors As List(Of Color), ByVal SkinFiles As List(Of String), ByVal SkinNames As List(Of String), ByVal SkinGenders As List(Of String), Optional WaterSpeed As Integer = 8, Optional MasterShinyRate As Integer = 4096)
|
||||||
Me._name = Name
|
Me._name = Name
|
||||||
Me._description = Description
|
Me._description = Description
|
||||||
Me._version = Version
|
Me._version = Version
|
||||||
@ -403,6 +403,7 @@ Public Class GameMode
|
|||||||
Me._hardGameRules = HardGameRules
|
Me._hardGameRules = HardGameRules
|
||||||
Me._superHardGameRules = SuperHardGameRules
|
Me._superHardGameRules = SuperHardGameRules
|
||||||
Me._waterspeed = WaterSpeed
|
Me._waterspeed = WaterSpeed
|
||||||
|
Me._masterShinyRate = MasterShinyRate
|
||||||
|
|
||||||
Me._startMap = StartMap
|
Me._startMap = StartMap
|
||||||
Me._startPosition = StartPosition
|
Me._startPosition = StartPosition
|
||||||
@ -514,6 +515,8 @@ Public Class GameMode
|
|||||||
End If
|
End If
|
||||||
Case "waterspeed"
|
Case "waterspeed"
|
||||||
Me._waterspeed = CInt(Value)
|
Me._waterspeed = CInt(Value)
|
||||||
|
Case "shinyrate"
|
||||||
|
Me._masterShinyRate = CInt(Value)
|
||||||
Case "startmap"
|
Case "startmap"
|
||||||
Me._startMap = Value
|
Me._startMap = Value
|
||||||
Case "startposition"
|
Case "startposition"
|
||||||
@ -646,13 +649,17 @@ Public Class GameMode
|
|||||||
gameRules.Add(New GameRule("CanForgetHM", "0"))
|
gameRules.Add(New GameRule("CanForgetHM", "0"))
|
||||||
gameRules.Add(New GameRule("CoinCaseCap", "0"))
|
gameRules.Add(New GameRule("CoinCaseCap", "0"))
|
||||||
gameRules.Add(New GameRule("GainExpAfterCatch", "1"))
|
gameRules.Add(New GameRule("GainExpAfterCatch", "1"))
|
||||||
|
gameRules.Add(New GameRule("ShinyRate", "4096"))
|
||||||
|
gameRules.Add(New GameRule("LevelMultiplier", "1.0"))
|
||||||
|
|
||||||
gameMode._gameRules = gameRules
|
gameMode._gameRules = gameRules
|
||||||
|
|
||||||
Dim hardGameRules As New List(Of GameRule)
|
Dim hardGameRules As New List(Of GameRule)
|
||||||
hardGameRules.Add(New GameRule("OverworldPoison", "1"))
|
hardGameRules.Add(New GameRule("OverworldPoison", "1"))
|
||||||
|
hardGameRules.Add(New GameRule("LevelMultiplier", "1.1"))
|
||||||
|
|
||||||
Dim superHardGameRules As New List(Of GameRule)
|
Dim superHardGameRules As New List(Of GameRule)
|
||||||
|
hardGameRules.Add(New GameRule("LevelMultiplier", "1.2"))
|
||||||
|
|
||||||
gameMode._hardGameRules = hardGameRules
|
gameMode._hardGameRules = hardGameRules
|
||||||
gameMode._superHardGameRules = superHardGameRules
|
gameMode._superHardGameRules = superHardGameRules
|
||||||
@ -804,6 +811,7 @@ Public Class GameMode
|
|||||||
Private _hardGameRules As New List(Of GameRule)
|
Private _hardGameRules As New List(Of GameRule)
|
||||||
Private _superHardGameRules As New List(Of GameRule)
|
Private _superHardGameRules As New List(Of GameRule)
|
||||||
Private _waterspeed As Integer = 8
|
Private _waterspeed As Integer = 8
|
||||||
|
Private _masterShinyRate As Integer = 4096
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' The name of this GameMode.
|
''' The name of this GameMode.
|
||||||
@ -940,6 +948,17 @@ Public Class GameMode
|
|||||||
Me._waterspeed = value
|
Me._waterspeed = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
''' <summary>
|
||||||
|
''' The master shiny rate
|
||||||
|
''' </summary>
|
||||||
|
Public Property MasterShinyRate As Integer
|
||||||
|
Get
|
||||||
|
Return Me._masterShinyRate
|
||||||
|
End Get
|
||||||
|
Set(value As Integer)
|
||||||
|
Me._masterShinyRate = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user