Merge pull request #64 from JappaWakkaP3D/permanent_item_loss_fix
Permanent item loss caused by attacks fix
This commit is contained in:
commit
8160838230
|
@ -1174,8 +1174,6 @@ nextIndex:
|
||||||
End If
|
End If
|
||||||
TempPokeFile = ""
|
TempPokeFile = ""
|
||||||
|
|
||||||
OwnPokemon.ResetTemp()
|
|
||||||
|
|
||||||
If IsRemoteBattle = False Then
|
If IsRemoteBattle = False Then
|
||||||
If ConnectScreen.Connected = True Then
|
If ConnectScreen.Connected = True Then
|
||||||
If Battle.Won = False Then
|
If Battle.Won = False Then
|
||||||
|
@ -1219,6 +1217,11 @@ nextIndex:
|
||||||
If p.hasLeveledUp = True Then
|
If p.hasLeveledUp = True Then
|
||||||
hasLevelUp = True
|
hasLevelUp = True
|
||||||
End If
|
End If
|
||||||
|
If IsRemoteBattle = True Or IsTrainerBattle = True Then
|
||||||
|
p.Item = P3D.Item.GetItemByID(p.OriginalItem.ID)
|
||||||
|
p.Item.AdditionalData = p.OriginalItem.AdditionalData
|
||||||
|
Screen.TextBox.Show(Core.Player.Name & " received" & p.OriginalItem.Name & "*and gave it back to~" & p.GetDisplayName)
|
||||||
|
End If
|
||||||
p.ResetTemp()
|
p.ResetTemp()
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
@ -1261,6 +1264,14 @@ nextIndex:
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Else
|
Else
|
||||||
|
For Each p As Pokemon In Core.Player.Pokemons
|
||||||
|
If IsRemoteBattle = True Or IsTrainerBattle = True Then
|
||||||
|
p.Item = P3D.Item.GetItemByID(p.OriginalItem.ID)
|
||||||
|
p.Item.AdditionalData = p.OriginalItem.AdditionalData
|
||||||
|
Screen.TextBox.Show(Core.Player.Name & " received~" & p.OriginalItem.Name & "*and gave it back to~" & p.GetDisplayName)
|
||||||
|
End If
|
||||||
|
p.ResetTemp()
|
||||||
|
Next
|
||||||
ResetVars()
|
ResetVars()
|
||||||
Core.SetScreen(New TransitionScreen(Me, New BlackOutScreen(Me), Color.Black, False))
|
Core.SetScreen(New TransitionScreen(Me, New BlackOutScreen(Me), Color.Black, False))
|
||||||
End If
|
End If
|
||||||
|
|
|
@ -106,6 +106,11 @@ Namespace BattleSystem.Moves.Psychic
|
||||||
If CanSwitchItems Then
|
If CanSwitchItems Then
|
||||||
Dim i1 As Item = Nothing
|
Dim i1 As Item = Nothing
|
||||||
Dim i2 As Item = Nothing
|
Dim i2 As Item = Nothing
|
||||||
|
If own = True Then
|
||||||
|
p.OriginalItem = p.Item
|
||||||
|
Else
|
||||||
|
op.OriginalItem = op.Item
|
||||||
|
End If
|
||||||
If p.Item IsNot Nothing Then
|
If p.Item IsNot Nothing Then
|
||||||
i1 = p.Item
|
i1 = p.Item
|
||||||
End If
|
End If
|
||||||
|
|
|
@ -1035,11 +1035,18 @@ Public Class Pokemon
|
||||||
|
|
||||||
Me.Ability = Me._originalAbility
|
Me.Ability = Me._originalAbility
|
||||||
|
|
||||||
'If Not Me._originalItem Is Nothing Then
|
If Not Me._originalItem Is Nothing Then
|
||||||
' Me.Item = P3D.Item.GetItemByID(Me._originalItem.ID)
|
If Me.Item IsNot Nothing Then
|
||||||
' Me.Item.AdditionalData = Me._originalItem.AdditionalData
|
Core.Player.Inventory.AddItem(Me._originalItem.ID, 1)
|
||||||
' Me._originalItem = Nothing
|
SoundManager.PlaySound("item_found", True)
|
||||||
'End If
|
Screen.TextBox.Show(Core.Player.Name & " found~" & Me._originalItem.Name & "!*" & Core.Player.Inventory.GetMessageReceive(_originalItem, 1))
|
||||||
|
Else
|
||||||
|
Me.Item = P3D.Item.GetItemByID(Me._originalItem.ID)
|
||||||
|
Me.Item.AdditionalData = Me._originalItem.AdditionalData
|
||||||
|
Screen.TextBox.Show(Core.Player.Name & " found~" & Me._originalItem.Name & "*and gave it back to~" & Me.GetDisplayName)
|
||||||
|
End If
|
||||||
|
Me._originalItem = Nothing
|
||||||
|
End If
|
||||||
|
|
||||||
Me.IsTransformed = False
|
Me.IsTransformed = False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue