diff --git a/P3D/Player/Player.vb b/P3D/Player/Player.vb index e475ef3c5..46dbaed38 100644 --- a/P3D/Player/Player.vb +++ b/P3D/Player/Player.vb @@ -1891,6 +1891,14 @@ 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 <= 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 + ElseIf CInt(GameModeManager.GetGameRuleValue("OverworldPoison", "0")) = 2 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 @@ -1900,14 +1908,6 @@ Core.SetScreen(New TransitionScreen(Core.CurrentScreen, New BlackOutScreen(Core.CurrentScreen), Color.Black, False)) 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 diff --git a/P3D/Resources/GameModeManager.vb b/P3D/Resources/GameModeManager.vb index cf3299656..11f4035c0 100644 --- a/P3D/Resources/GameModeManager.vb +++ b/P3D/Resources/GameModeManager.vb @@ -142,6 +142,7 @@ Public Class GameModeManager Return ActiveGameMode.GameRules End Function + ''' ''' Returns the Value of a chosen GameRule from the currently active GameMode. ''' @@ -383,7 +384,7 @@ Public Class GameMode ''' The skin files for the new GameMode. Must be the same amount as SkinColors and SkinNames. ''' 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), + 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 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)) Me._name = Name Me._description = Description @@ -396,6 +397,7 @@ Public Class GameMode Me._contentPath = ContentPath Me._localizationsPath = LocalizationsPath Me._gameRules = GameRules + Me._hardGameRules = HardGameRules Me._startMap = StartMap Me._startPosition = StartPosition @@ -455,6 +457,22 @@ Public Class GameMode rule = rule.Remove(0, 1) _gameRules.Add(New GameRule(rule.GetSplit(0, "|"), rule.GetSplit(1, "|"))) + _hardGameRules.Add(New GameRule(rule.GetSplit(0, "|"), rule.GetSplit(1, "|"))) + End If + Next + End If + Case "hardgamerules" + If Value <> "" And Value.Contains("(") And Value.Contains(")") And Value.Contains("|") = True Then + Dim rules() As String = Value.Split(CChar(")")) + For Each rule As String In rules + If rule.StartsWith("(") = True Then + rule = rule.Remove(0, 1) + For Each HardRule As GameRule In _hardGameRules + If HardRule.RuleName.ToLower = rule.GetSplit(0, "|").ToLower Then + _hardGameRules.Remove(HardRule) + End If + Next + _hardGameRules.Add(New GameRule(rule.GetSplit(0, "|"), rule.GetSplit(1, "|"))) End If Next End If @@ -568,7 +586,7 @@ Public Class GameMode Dim SkinNames As List(Of String) = {"Ethan", "Lyra", "Nate", "Rosa", "Hilbert", "Hilda"}.ToList() Dim SkinGenders As List(Of String) = {"Male", "Female", "Male", "Female", "Male", "Female"}.ToList() - Dim gameMode As New GameMode("Kolben", "The normal game mode.", GameController.GAMEVERSION, "Kolben Games", "\Content\Data\maps\", "\Content\Data\Scripts\", "\Content\Data\maps\poke\", "\Content\Pokemon\Data\", "\Content\", "\Content\Localization\", New List(Of GameRule), + Dim gameMode As New GameMode("Kolben", "The normal game mode.", GameController.GAMEVERSION, "Kolben Games", "\Content\Data\maps\", "\Content\Data\Scripts\", "\Content\Data\maps\poke\", "\Content\Pokemon\Data\", "\Content\", "\Content\Localization\", New List(Of GameRule), New List(Of GameRule), "newgame\intro0.dat", New Vector3(1.0F, 0.1F, 3.0F), MathHelper.PiOver2, "Your Room", "", New Color(59, 123, 165), "0", "welcome", "1", SkinColors, SkinFiles, SkinNames, SkinGenders) gameMode.StartScript = "startscript\main" @@ -587,8 +605,12 @@ Public Class GameMode gameRules.Add(New GameRule("OverworldPoison", "0")) gameRules.Add(New GameRule("SavingDisabled", "0")) - gameMode.GameRules = gameRules + gameMode._gameRules = gameRules + Dim hardGameRules As New List(Of GameRule) + hardGameRules.Add(New GameRule("OverworldPoison", "1")) + + gameMode._hardGameRules = hardGameRules Return gameMode End Function @@ -719,6 +741,7 @@ Public Class GameMode Private _localizationsPath As String = "" Private _contentPath As String = "" Private _gameRules As New List(Of GameRule) + Private _hardGameRules As New List(Of GameRule) ''' ''' The name of this GameMode. @@ -845,10 +868,18 @@ Public Class GameMode ''' Public Property GameRules() As List(Of GameRule) Get - Return Me._gameRules + If Core.Player.DifficultyMode > 0 Then + Return Me._hardGameRules + Else + Return Me._gameRules + End If End Get Set(value As List(Of GameRule)) - Me._gameRules = value + If Core.Player.DifficultyMode > 0 Then + Me._hardGameRules = value + Else + Me._gameRules = value + End If End Set End Property