From fabab5e32e5965b17c5445a099f99d9a7ea27b13 Mon Sep 17 00:00:00 2001 From: JappaWakka Date: Thu, 2 Feb 2023 14:58:33 +0100 Subject: [PATCH] Finally fixed protean not resetting types --- P3D/Battle/BattleSystemV2/Battle.vb | 4 ++-- P3D/Pokemon/Monster/Pokemon.vb | 20 ++++++++------------ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/P3D/Battle/BattleSystemV2/Battle.vb b/P3D/Battle/BattleSystemV2/Battle.vb index 6d4b05b84..1582cca42 100644 --- a/P3D/Battle/BattleSystemV2/Battle.vb +++ b/P3D/Battle/BattleSystemV2/Battle.vb @@ -2008,12 +2008,12 @@ If p.Ability.Name.ToLower() = "protean" Then If p.Type1.Type <> moveUsed.Type.Type Then If p.OriginalType1 Is Nothing Then - p.OriginalType1 = p.Type1 + p.OriginalType1 = New Element(p.Type1.Type) End If p.Type1.Type = moveUsed.Type.Type If p.Type2.Type <> Element.Types.Blank Then If p.OriginalType2 Is Nothing Then - p.OriginalType2 = p.Type2 + p.OriginalType2 = New Element(p.Type2.Type) End If p.Type2.Type = Element.Types.Blank End If diff --git a/P3D/Pokemon/Monster/Pokemon.vb b/P3D/Pokemon/Monster/Pokemon.vb index f818dabee..4e7b1bea7 100644 --- a/P3D/Pokemon/Monster/Pokemon.vb +++ b/P3D/Pokemon/Monster/Pokemon.vb @@ -1002,14 +1002,14 @@ Public Class Pokemon Me._originalItem = Nothing End If - If Not _originalType1 Is Nothing Then - Me.Type1.Type = _originalType1.Type - _originalType1 = Nothing + If OriginalType1 IsNot Nothing Then + Me.Type1.Type = OriginalType1.Type + OriginalType1 = Nothing End If - If Not _originalType2 Is Nothing Then - Me.Type2.Type = _originalType2.Type - _originalType2 = Nothing + If OriginalType2 IsNot Nothing Then + Me.Type2.Type = OriginalType2.Type + OriginalType2 = Nothing End If If _originalStats(0) > -1 Then @@ -1084,9 +1084,7 @@ Public Class Pokemon Return Me._originalType1 End Get Set(value As Element) - If Me._originalType1 Is Nothing Then - Me._originalType1 = value - End If + Me._originalType1 = value End Set End Property @@ -1098,9 +1096,7 @@ Public Class Pokemon Return Me._originalType2 End Get Set(value As Element) - If Me._originalType2 Is Nothing Then - Me._originalType2 = value - End If + Me._originalType2 = value End Set End Property