diff --git a/P3D/Battle/Trainer.vb b/P3D/Battle/Trainer.vb
index 687162f2f..aca767edd 100644
--- a/P3D/Battle/Trainer.vb
+++ b/P3D/Battle/Trainer.vb
@@ -212,27 +212,30 @@ Public Class Trainer
If PokeData.StartsWith("{") = True And PokeData.EndsWith("}") = True Then
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
- If Core.Player.DifficultyMode = 1 Then
- addLevel = CInt(Math.Ceiling(level / 10))
- ElseIf Core.Player.DifficultyMode = 2 Then
- addLevel = CInt(Math.Ceiling(level / 5))
- End If
-
- 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
+ Dim addLevel As Integer = 0
+ If Core.Player.DifficultyMode = 0 Then
+ 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
+ addLevel = CInt(Math.Ceiling(level * CSng(GameModeManager.GetGameRuleValue("LevelMultiplier", "1.2")) - level))
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)
Else
Dim firstPart As String = ""
@@ -275,14 +278,19 @@ Public Class Trainer
End If
Dim addLevel As Integer = 0
- If Core.Player.DifficultyMode = 1 Then
- addLevel = CInt(Math.Ceiling(Level / 10))
+ If Core.Player.DifficultyMode = 0 Then
+ 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
- addLevel = CInt(Math.Ceiling(Level / 5))
+ addLevel = CInt(Math.Ceiling(Level * CSng(GameModeManager.GetGameRuleValue("LevelMultiplier", "1.2")) - Level))
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
Level += addLevel
diff --git a/P3D/Pokemon/Monster/Pokemon.vb b/P3D/Pokemon/Monster/Pokemon.vb
index 1c84203b1..ab7d6e8b4 100644
--- a/P3D/Pokemon/Monster/Pokemon.vb
+++ b/P3D/Pokemon/Monster/Pokemon.vb
@@ -10,7 +10,7 @@ Public Class Pokemon
Public Shared ReadOnly Property MasterShinyRate(Optional ByVal adjusted As Boolean = True) As Integer
Get
- Dim shinyRate As Integer = 4096
+ Dim shinyRate As Integer = GameModeManager.ActiveGameMode.MasterShinyRate '4096 by default
If adjusted Then
For Each mysteryEvent As MysteryEventScreen.MysteryEvent In MysteryEventScreen.ActivatedMysteryEvents
diff --git a/P3D/Pokemon/Wild/Spawner.vb b/P3D/Pokemon/Wild/Spawner.vb
index a8d5d7959..8ca9b8e52 100644
--- a/P3D/Pokemon/Wild/Spawner.vb
+++ b/P3D/Pokemon/Wild/Spawner.vb
@@ -170,10 +170,12 @@ Public Class Spawner
End If
Dim addLevel As Integer = 0
- If Core.Player.DifficultyMode = 1 Then
- addLevel = CInt(Math.Floor(level / 10))
+ If Core.Player.DifficultyMode = 0 Then
+ 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
- addLevel = CInt(Math.Floor(level / 5))
+ addLevel = CInt(Math.Ceiling(level * CSng(GameModeManager.GetGameRuleValue("LevelMultiplier", "1.2")) - level))
End If
level += addLevel
If level > CInt(GameModeManager.GetGameRuleValue("MaxLevel", "100")) Then
diff --git a/P3D/Resources/GameModeManager.vb b/P3D/Resources/GameModeManager.vb
index 0665544da..ee723544b 100644
--- a/P3D/Resources/GameModeManager.vb
+++ b/P3D/Resources/GameModeManager.vb
@@ -388,7 +388,7 @@ Public Class GameMode
''' The skin names for the new GameMode. Must be the same amount as SkinFiles and SkinColors.
''' The skin names for the new GameMode. Must be the same amount as SkinFiles and SkinColors.
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._description = Description
Me._version = Version
@@ -403,6 +403,7 @@ Public Class GameMode
Me._hardGameRules = HardGameRules
Me._superHardGameRules = SuperHardGameRules
Me._waterspeed = WaterSpeed
+ Me._masterShinyRate = MasterShinyRate
Me._startMap = StartMap
Me._startPosition = StartPosition
@@ -514,6 +515,8 @@ Public Class GameMode
End If
Case "waterspeed"
Me._waterspeed = CInt(Value)
+ Case "shinyrate"
+ Me._masterShinyRate = CInt(Value)
Case "startmap"
Me._startMap = Value
Case "startposition"
@@ -646,13 +649,17 @@ Public Class GameMode
gameRules.Add(New GameRule("CanForgetHM", "0"))
gameRules.Add(New GameRule("CoinCaseCap", "0"))
gameRules.Add(New GameRule("GainExpAfterCatch", "1"))
+ gameRules.Add(New GameRule("ShinyRate", "4096"))
+ gameRules.Add(New GameRule("LevelMultiplier", "1.0"))
gameMode._gameRules = gameRules
Dim hardGameRules As New List(Of GameRule)
hardGameRules.Add(New GameRule("OverworldPoison", "1"))
+ hardGameRules.Add(New GameRule("LevelMultiplier", "1.1"))
Dim superHardGameRules As New List(Of GameRule)
+ hardGameRules.Add(New GameRule("LevelMultiplier", "1.2"))
gameMode._hardGameRules = hardGameRules
gameMode._superHardGameRules = superHardGameRules
@@ -804,6 +811,7 @@ Public Class GameMode
Private _hardGameRules As New List(Of GameRule)
Private _superHardGameRules As New List(Of GameRule)
Private _waterspeed As Integer = 8
+ Private _masterShinyRate As Integer = 4096
'''
''' The name of this GameMode.
@@ -940,6 +948,17 @@ Public Class GameMode
Me._waterspeed = value
End Set
End Property
+ '''
+ ''' The master shiny rate
+ '''
+ Public Property MasterShinyRate As Integer
+ Get
+ Return Me._masterShinyRate
+ End Get
+ Set(value As Integer)
+ Me._masterShinyRate = value
+ End Set
+ End Property
'''