From 50c7125f714b1370dbbc4911de9bd87ec5d33a65 Mon Sep 17 00:00:00 2001 From: JappaWakka Date: Wed, 24 Jan 2024 17:27:59 +0100 Subject: [PATCH] Added Exp calc changing GM Item property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ExpMultiplier|sng,[bool] optional second argument overrides the exp boost pokémon get when traded if set to true/1 --- .../BattleSystemV2/BattleCalculation.vb | 23 ++++++++++++++++--- P3D/Pokemon/Items/GameModeItem.vb | 2 ++ P3D/Pokemon/Items/GameModeItemLoader.vb | 5 ++++ 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/P3D/Battle/BattleSystemV2/BattleCalculation.vb b/P3D/Battle/BattleSystemV2/BattleCalculation.vb index 68c4434d0..493850bc0 100644 --- a/P3D/Battle/BattleSystemV2/BattleCalculation.vb +++ b/P3D/Battle/BattleSystemV2/BattleCalculation.vb @@ -1002,8 +1002,25 @@ Dim b As Double = op.BaseExperience Dim t As Double = 1D - If p.OT <> Core.Player.OT Then - t = 1.5D + If p.Item.IsGameModeItem = True Then + If CType(p.Item, GameModeItem).gmExpMultiplier <> -1D AndAlso CType(p.Item, GameModeItem).gmOverrideTradeExp = True Then + t = CType(p.Item, GameModeItem).gmExpMultiplier + Else + If p.OT <> Core.Player.OT Then + t = 1.5D + End If + End If + Else + If p.OT <> Core.Player.OT Then + t = 1.5D + End If + End If + + Dim gm As Double = 1D + If p.Item.IsGameModeItem = True Then + If CType(p.Item, GameModeItem).gmExpMultiplier <> -1D AndAlso CType(p.Item, GameModeItem).gmOverrideTradeExp = False Then + gm = CType(p.Item, GameModeItem).gmExpMultiplier + End If End If Dim e As Double = 1D @@ -1037,7 +1054,7 @@ End If End If - Dim EXP As Integer = CInt((((a * b * L) / (5 * s)) * (((2 * L + 10) ^ 2.5D) / ((L + Lp + 10) ^ 2.5D)) + 1) * t * e * 1) + Dim EXP As Integer = CInt((((a * b * L) / (5 * s)) * (((2 * L + 10) ^ 2.5D) / ((L + Lp + 10) ^ 2.5D)) + 1) * t * e * gm * 1) If EXP < 2 Then EXP = 2 diff --git a/P3D/Pokemon/Items/GameModeItem.vb b/P3D/Pokemon/Items/GameModeItem.vb index 225eeb7c5..345a90842 100644 --- a/P3D/Pokemon/Items/GameModeItem.vb +++ b/P3D/Pokemon/Items/GameModeItem.vb @@ -21,6 +21,8 @@ Public Class GameModeItem Public gmCanBeUsedInBattle As Boolean = True Public gmCanBeTossed As Boolean = True Public gmBattleSelectPokemon As Boolean = True + Public gmExpMultiplier As Double = -1D + Public gmOverrideTradeExp As Boolean = False Public gmSortValue As Integer = 0 diff --git a/P3D/Pokemon/Items/GameModeItemLoader.vb b/P3D/Pokemon/Items/GameModeItemLoader.vb index d86a402ba..66968ae64 100644 --- a/P3D/Pokemon/Items/GameModeItemLoader.vb +++ b/P3D/Pokemon/Items/GameModeItemLoader.vb @@ -114,6 +114,11 @@ Public Class GameModeItemLoader item.gmBattlePointsPrice = CInt(value) Case "catchmultiplier" item.gmCatchMultiplier = CSng(value.ReplaceDecSeparator) + Case "expmultiplier" + If value.Split(",").Count > 1 Then + item.gmOverrideTradeExp = CBool(value.GetSplit(1, ",")) + End If + item.gmExpMultiplier = CDbl(value.GetSplit(0, ",").ReplaceDecSeparator) Case "maxstack" item.gmMaxStack = CInt(value) Case "flingdamage"