Fix for Trick and Recycle

This commit is contained in:
JappaWakka 2023-01-15 11:40:43 +01:00
parent 678cd35fde
commit cdccbfcc67
3 changed files with 18 additions and 7 deletions

View File

@ -1250,12 +1250,13 @@ nextIndex:
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.AdditionalData = p.OriginalItem.AdditionalData
Screen.TextBox.Show(Core.Player.Name & " found~" & p.OriginalItem.Name & "*and gave it back to~" & p.GetDisplayName)
p.OriginalItem = Nothing
End If
p.OriginalItem = Nothing
End If
End If
p.ResetTemp()
@ -1310,13 +1311,14 @@ nextIndex:
If p.Item IsNot 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))
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.AdditionalData = p.OriginalItem.AdditionalData
Screen.TextBox.Show(Core.Player.Name & " found~" & p.OriginalItem.Name & "*and gave it back to~" & p.GetDisplayName)
p.OriginalItem = Nothing
End If
p.OriginalItem = Nothing
End If
End If
p.ResetTemp()

View File

@ -58,9 +58,11 @@
Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen)
If own = True Then
Dim p As Pokemon = BattleScreen.OwnPokemon
If Not BattleScreen.FieldEffects.OwnConsumedItem Is Nothing Then
p.Item = BattleScreen.FieldEffects.OwnConsumedItem
If p.OriginalItem IsNot Nothing Then
p.OriginalItem = Nothing
End If
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " found one " & p.Item.Name & "!"))
Else
BattleScreen.BattleQuery.Add(New TextQueryObject("Recycle failed!"))
@ -70,6 +72,9 @@
If Not BattleScreen.FieldEffects.OppConsumedItem Is Nothing Then
p.Item = BattleScreen.FieldEffects.OppConsumedItem
If p.OriginalItem IsNot Nothing Then
p.OriginalItem = Nothing
End If
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " found one " & p.Item.Name & "!"))
Else
BattleScreen.BattleQuery.Add(New TextQueryObject("Recycle failed!"))

View File

@ -106,10 +106,14 @@ Namespace BattleSystem.Moves.Psychic
If CanSwitchItems Then
Dim i1 As Item = Nothing
Dim i2 As Item = Nothing
If own = True Then
p.OriginalItem = p.Item
If own = True Then
If p.Item IsNot Nothing Then
p.OriginalItem = p.Item
End If
Else
op.OriginalItem = op.Item
If op.Item IsNot Nothing Then
op.OriginalItem = op.Item
End If
End If
If p.Item IsNot Nothing Then
i1 = p.Item