Fixed trick/item duplication and protean

This commit is contained in:
JappaWakka 2023-01-18 20:06:21 +01:00
parent 686cef84fe
commit 7e7dae0d20
2 changed files with 15 additions and 9 deletions

View File

@ -2006,11 +2006,15 @@
'Protean Ability: 'Protean Ability:
If p.Ability.Name.ToLower() = "protean" Then If p.Ability.Name.ToLower() = "protean" Then
If p.Type1.Type <> moveUsed.Type.Type Or p.Type2.Type <> Element.Types.Blank Then If p.Type1.Type <> moveUsed.Type.Type Then
p.OriginalType1.Type = p.Type1.Type If p.OriginalType1 Is Nothing Then
p.OriginalType1 = p.Type1
End If
p.Type1.Type = moveUsed.Type.Type p.Type1.Type = moveUsed.Type.Type
If p.Type2.Type <> Element.Types.Blank Then If p.Type2.Type <> Element.Types.Blank Then
p.OriginalType2.Type = p.Type2.Type If p.OriginalType2 Is Nothing Then
p.OriginalType2 = p.Type2
End If
p.Type2.Type = Element.Types.Blank p.Type2.Type = Element.Types.Blank
End If End If
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & "'s type changed to " & p.Type1.ToString() & " due to Protean.")) BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & "'s type changed to " & p.Type1.ToString() & " due to Protean."))

View File

@ -1246,16 +1246,18 @@ nextIndex:
End If End If
Else Else
If Not p.OriginalItem Is Nothing Then If Not p.OriginalItem Is Nothing Then
If p.Item IsNot Nothing Then If p.Item Is Nothing Then
Core.Player.Inventory.AddItem(p.OriginalItem.ID, 1)
SoundManager.PlaySound("item_found", True)
Screen.TextBox.Show(Core.Player.Name & " found~" & p.OriginalItem.Name & "!*" & Core.Player.Inventory.GetMessageReceive(p.OriginalItem, 1))
p.OriginalItem = Nothing
Else
p.Item = P3D.Item.GetItemByID(p.OriginalItem.ID) p.Item = P3D.Item.GetItemByID(p.OriginalItem.ID)
p.Item.AdditionalData = p.OriginalItem.AdditionalData p.Item.AdditionalData = p.OriginalItem.AdditionalData
Screen.TextBox.Show(Core.Player.Name & " found~" & p.OriginalItem.Name & "*and gave it back to~" & p.GetDisplayName) Screen.TextBox.Show(Core.Player.Name & " found~" & p.OriginalItem.Name & "*and gave it back to~" & p.GetDisplayName)
p.OriginalItem = Nothing p.OriginalItem = Nothing
Else
Core.Player.Inventory.AddItem(p.Item.ID, 1)
SoundManager.PlaySound("item_found", True)
Screen.TextBox.Show(Core.Player.Name & " found~" & p.Item.Name & "!*" & Core.Player.Inventory.GetMessageReceive(p.Item, 1))
p.Item = p.OriginalItem
p.Item.AdditionalData = p.OriginalItem.AdditionalData
p.OriginalItem = Nothing
End If End If
End If End If
End If End If