Fixed item transferring/removing moves and abilities

This commit is contained in:
CaptainSegis 2016-12-19 14:51:17 -05:00
parent 157ce04583
commit 073e82aa81
11 changed files with 326 additions and 249 deletions

View File

@ -1879,128 +1879,156 @@
End If
'ABILITY SHIT GOES HERE:
Select Case op.Ability.Name.ToLower()
Case "color change"
If op.HP > 0 Then
If op.Type1.Type <> moveUsed.GetAttackType(own, BattleScreen).Type Or op.Type2.Type <> Element.Types.Blank Then
ChangeCameraAngel(2, own, BattleScreen)
op.OriginalType1 = op.Type1
op.OriginalType2 = op.Type2
op.Type1 = moveUsed.GetAttackType(own, BattleScreen)
op.Type2.Type = Element.Types.Blank
BattleScreen.BattleQuery.Add(New TextQueryObject(op.GetDisplayName() & " changed it's color!"))
End If
End If
Case "rough skin"
If moveUsed.MakesContact = True Then
ReduceHP(CInt(Math.Floor(p.MaxHP / 16)), own, Not own, BattleScreen, p.GetDisplayName() & " was harmed by Rough Skin.", "roughskin")
End If
Case "static"
If moveUsed.MakesContact = True And p.Status = Pokemon.StatusProblems.None Then
If Core.Random.Next(0, 100) < 30 Then
InflictParalysis(own, Not own, BattleScreen, op.GetDisplayName() & "'s Static affects " & p.GetDisplayName() & "!", "static")
End If
End If
Case "effect spore"
If moveUsed.MakesContact = True And p.Status = Pokemon.StatusProblems.None Then
Dim R As Integer = Core.Random.Next(0, 100)
If R < 30 Then
If R < 9 Then
InflictPoison(own, Not own, BattleScreen, False, op.GetDisplayName() & "'s Effect Spore affects " & p.GetDisplayName() & "!", "effectspore")
ElseIf R >= 9 And R < 19 Then
InflictParalysis(own, Not own, BattleScreen, op.GetDisplayName() & "'s Effect Spore affects " & p.GetDisplayName() & "!", "effectspore")
Else
InflictSleep(own, Not own, BattleScreen, -1, op.GetDisplayName() & "'s Effect Spore affects " & p.GetDisplayName() & "!", "effectspore")
End If
End If
End If
Case "poison point"
If moveUsed.MakesContact = True And p.Status = Pokemon.StatusProblems.None Then
If Core.Random.Next(0, 100) < 30 Then
InflictPoison(own, Not own, BattleScreen, False, op.GetDisplayName() & "'s Poison Point affects " & p.GetDisplayName() & "!", "poisonpoint")
End If
End If
Case "flame body"
If moveUsed.MakesContact = True And p.Status = Pokemon.StatusProblems.None Then
If Core.Random.Next(0, 100) < 30 Then
InflictBurn(own, Not own, BattleScreen, op.GetDisplayName() & "'s Flame Body affects " & p.GetDisplayName() & "!", "flamebody")
End If
End If
Case "cute charm"
If moveUsed.MakesContact = True And p.HasVolatileStatus(Pokemon.VolatileStatus.Infatuation) = False Then
If Core.Random.Next(0, 100) < 30 Then
InflictInfatuate(own, Not own, BattleScreen, op.GetDisplayName() & "'s Cute Charm affects " & p.GetDisplayName() & "!", "cutecharm")
End If
End If
Case "aftermath"
If moveUsed.MakesContact = True Then
If op.HP <= 0 Then
ReduceHP(CInt(p.MaxHP / 4), own, Not own, BattleScreen, "Aftermath caused damage!", "aftermath")
End If
End If
Case "iron barbs"
If moveUsed.MakesContact = True Then
ReduceHP(CInt(p.MaxHP / 8), own, Not own, BattleScreen, "Iron Barbs caused damage!", "ironbarbs")
End If
Case "cursed body"
If moveUsed.Disabled = 0 Then
If substitute = 0 Then
If Core.Random.Next(0, 100) < 30 Then
If BattleScreen.FieldEffects.CanUseAbility(Not own, BattleScreen) Then
Select Case op.Ability.Name.ToLower()
Case "color change"
If op.HP > 0 Then
If op.Type1.Type <> moveUsed.GetAttackType(own, BattleScreen).Type Or op.Type2.Type <> Element.Types.Blank Then
ChangeCameraAngel(2, own, BattleScreen)
BattleScreen.BattleQuery.Add(New TextQueryObject(op.GetDisplayName() & "'s Cursed Body disabled " & moveUsed.Name & "!"))
moveUsed.Disabled = Core.Random.Next(1, 6)
End If
End If
End If
Case "mummy"
If moveUsed.MakesContact = True Then
If p.Ability.Name.ToLower() <> "multitype" And p.Ability.Name.ToLower() <> "mummy" Then
p.OriginalAbility = p.Ability
p.Ability = Ability.GetAbilityByID(152)
ChangeCameraAngel(1, own, BattleScreen)
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & "'s ability changed to Mummy!"))
End If
End If
Case "justified"
If moveUsed.GetAttackType(own, BattleScreen).Type = Element.Types.Dark Then
RaiseStat(Not own, Not own, BattleScreen, "Attack", 1, op.GetDisplayName() & " became justified!", "justified")
End If
Case "rattled"
If moveUsed.GetAttackType(own, BattleScreen).Type = Element.Types.Dark Or moveUsed.GetAttackType(own, BattleScreen).Type = Element.Types.Bug Or moveUsed.GetAttackType(own, BattleScreen).Type = Element.Types.Ghost Then
RaiseStat(Not own, Not own, BattleScreen, "Speed", 1, op.GetDisplayName() & "'s Rattled affected it's clairaudience.", "rattled")
End If
Case "gooey"
If moveUsed.MakesContact = True Then
LowerStat(own, Not own, BattleScreen, "Speed", 1, "Gooey slowed down " & p.GetDisplayName() & "!", "gooey")
End If
End Select
op.OriginalType1 = op.Type1
op.OriginalType2 = op.Type2
Select Case p.Ability.Name.ToLower()
Case "poison touch"
If moveUsed.MakesContact = True And op.Status = Pokemon.StatusProblems.None Then
If Core.Random.Next(0, 100) < 30 Then
InflictPoison(Not own, own, BattleScreen, False, p.GetDisplayName() & "'s Poison Touch affects " & op.GetDisplayName() & "!", "poisontouch")
End If
End If
Case "pickpocket", "magician"
If moveUsed.MakesContact = True Then
If Not op.Item Is Nothing And p.Item Is Nothing And substitute = 0 Then
If RemoveHeldItem(Not own, own, BattleScreen, p.GetDisplayName() & " stole an item from " & op.GetDisplayName() & "!", "pickpocket") Then
p.Item = BattleScreen.FieldEffects.OppLostItem
op.Type1 = moveUsed.GetAttackType(own, BattleScreen)
op.Type2.Type = Element.Types.Blank
BattleScreen.BattleQuery.Add(New TextQueryObject(op.GetDisplayName() & " changed it's color!"))
End If
End If
End If
Case "moxie"
If KOED = True Then
RaiseStat(own, own, BattleScreen, "Attack", 1, p.GetDisplayName() & "'s Moxie got in effect!", "moxie")
End If
Case "weak armor"
If moveUsed.Category = Attack.Categories.Physical Then
RaiseStat(own, own, BattleScreen, "Speed", 1, "Weak Armor causes the Speed to increase!", "weakarmor")
LowerStat(own, own, BattleScreen, "Defense", 1, "Weak Armor causes the Defense to decrease!", "weakarmor")
End If
End Select
Case "rough skin"
If moveUsed.MakesContact = True Then
ReduceHP(CInt(Math.Floor(p.MaxHP / 16)), own, Not own, BattleScreen, p.GetDisplayName() & " was harmed by Rough Skin.", "roughskin")
End If
Case "static"
If moveUsed.MakesContact = True And p.Status = Pokemon.StatusProblems.None Then
If Core.Random.Next(0, 100) < 30 Then
InflictParalysis(own, Not own, BattleScreen, op.GetDisplayName() & "'s Static affects " & p.GetDisplayName() & "!", "static")
End If
End If
Case "effect spore"
If moveUsed.MakesContact = True And p.Status = Pokemon.StatusProblems.None Then
Dim R As Integer = Core.Random.Next(0, 100)
If R < 30 Then
If R < 9 Then
InflictPoison(own, Not own, BattleScreen, False, op.GetDisplayName() & "'s Effect Spore affects " & p.GetDisplayName() & "!", "effectspore")
ElseIf R >= 9 And R < 19 Then
InflictParalysis(own, Not own, BattleScreen, op.GetDisplayName() & "'s Effect Spore affects " & p.GetDisplayName() & "!", "effectspore")
Else
InflictSleep(own, Not own, BattleScreen, -1, op.GetDisplayName() & "'s Effect Spore affects " & p.GetDisplayName() & "!", "effectspore")
End If
End If
End If
Case "poison point"
If moveUsed.MakesContact = True And p.Status = Pokemon.StatusProblems.None Then
If Core.Random.Next(0, 100) < 30 Then
InflictPoison(own, Not own, BattleScreen, False, op.GetDisplayName() & "'s Poison Point affects " & p.GetDisplayName() & "!", "poisonpoint")
End If
End If
Case "flame body"
If moveUsed.MakesContact = True And p.Status = Pokemon.StatusProblems.None Then
If Core.Random.Next(0, 100) < 30 Then
InflictBurn(own, Not own, BattleScreen, op.GetDisplayName() & "'s Flame Body affects " & p.GetDisplayName() & "!", "flamebody")
End If
End If
Case "cute charm"
If moveUsed.MakesContact = True And p.HasVolatileStatus(Pokemon.VolatileStatus.Infatuation) = False Then
If Core.Random.Next(0, 100) < 30 Then
InflictInfatuate(own, Not own, BattleScreen, op.GetDisplayName() & "'s Cute Charm affects " & p.GetDisplayName() & "!", "cutecharm")
End If
End If
Case "aftermath"
If moveUsed.MakesContact = True Then
If op.HP <= 0 Then
ReduceHP(CInt(p.MaxHP / 4), own, Not own, BattleScreen, "Aftermath caused damage!", "aftermath")
End If
End If
Case "iron barbs"
If moveUsed.MakesContact = True Then
ReduceHP(CInt(p.MaxHP / 8), own, Not own, BattleScreen, "Iron Barbs caused damage!", "ironbarbs")
End If
Case "cursed body"
If moveUsed.Disabled = 0 Then
If substitute = 0 Then
If Core.Random.Next(0, 100) < 30 Then
ChangeCameraAngel(2, own, BattleScreen)
BattleScreen.BattleQuery.Add(New TextQueryObject(op.GetDisplayName() & "'s Cursed Body disabled " & moveUsed.Name & "!"))
moveUsed.Disabled = Core.Random.Next(1, 6)
End If
End If
End If
Case "mummy"
If moveUsed.MakesContact = True Then
If p.Ability.Name.ToLower() <> "multitype" And p.Ability.Name.ToLower() <> "mummy" Then
p.OriginalAbility = p.Ability
p.Ability = Ability.GetAbilityByID(152)
ChangeCameraAngel(1, own, BattleScreen)
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & "'s ability changed to Mummy!"))
End If
End If
Case "justified"
If moveUsed.GetAttackType(own, BattleScreen).Type = Element.Types.Dark Then
RaiseStat(Not own, Not own, BattleScreen, "Attack", 1, op.GetDisplayName() & " became justified!", "justified")
End If
Case "rattled"
If moveUsed.GetAttackType(own, BattleScreen).Type = Element.Types.Dark Or moveUsed.GetAttackType(own, BattleScreen).Type = Element.Types.Bug Or moveUsed.GetAttackType(own, BattleScreen).Type = Element.Types.Ghost Then
RaiseStat(Not own, Not own, BattleScreen, "Speed", 1, op.GetDisplayName() & "'s Rattled affected it's clairaudience.", "rattled")
End If
Case "gooey"
If moveUsed.MakesContact = True Then
LowerStat(own, Not own, BattleScreen, "Speed", 1, "Gooey slowed down " & p.GetDisplayName() & "!", "gooey")
End If
Case "weak armor"
If moveUsed.Category = Attack.Categories.Physical Then
RaiseStat(Not own, Not own, BattleScreen, "Speed", 1, "Weak Armor causes the Speed to increase!", "weakarmor")
LowerStat(Not own, Not own, BattleScreen, "Defense", 1, "Weak Armor causes the Defense to decrease!", "weakarmor")
End If
Case "pickpocket", "magician"
If moveUsed.MakesContact = True Then
If Not p.Item Is Nothing And op.Item Is Nothing And substitute = 0 Then
Dim canSteal As Boolean = True
If p.Item.IsMegaStone = True Then
canSteal = False
End If
If p.Ability.Name.ToLower() = "multitype" AndAlso p.Item.Name.ToLower().EndsWith(" plate") Then
canSteal = False
End If
If p.Item.Name.ToLower() = "griseous orb" And p.Number = 487 Then
canSteal = False
End If
If p.Item.Name.ToLower().EndsWith(" drive") = True AndAlso p.Number = 649 Then
canSteal = False
End If
If canSteal Then
Dim ItemID As Integer = p.Item.ID
p.OriginalItem = Item.GetItemByID(p.Item.ID)
p.OriginalItem.AdditionalData = p.Item.AdditionalData
If BattleScreen.Battle.RemoveHeldItem(own, Not own, BattleScreen, p.GetDisplayName() & " stole an item from " & op.GetDisplayName() & "!", op.Ability.Name.ToLower()) Then
If own = False Then
BattleScreen.FieldEffects.StolenItemIDs.Add(ItemID)
End If
op.Item = Item.GetItemByID(ItemID)
End If
End If
End If
End If
End Select
End If
If BattleScreen.FieldEffects.CanUseAbility(own, BattleScreen) Then
Select Case p.Ability.Name.ToLower()
Case "poison touch"
If moveUsed.MakesContact = True And op.Status = Pokemon.StatusProblems.None Then
If Core.Random.Next(0, 100) < 30 Then
InflictPoison(Not own, own, BattleScreen, False, p.GetDisplayName() & "'s Poison Touch affects " & op.GetDisplayName() & "!", "poisontouch")
End If
End If
Case "moxie"
If KOED = True Then
RaiseStat(own, own, BattleScreen, "Attack", 1, p.GetDisplayName() & "'s Moxie got in effect!", "moxie")
End If
End Select
End If
If substitute = 0 And op.HP > 0 Then
If Not op.Item Is Nothing Then
@ -3753,7 +3781,7 @@
Return False
End If
If p.Ability.Name.ToLower() = "sticky hold" And cause.StartsWith("berry:") = False Then
If BattleScreen.FieldEffects.CanUseAbility(own, BattleScreen) And p.Ability.Name.ToLower() = "sticky hold" And cause.StartsWith("berry:") = False Then
If TestFor = False Then
Me.ChangeCameraAngel(1, own, BattleScreen)
BattleScreen.BattleQuery.Add(New TextQueryObject("Sticky Hold prevented the item loss."))
@ -3765,10 +3793,12 @@
Dim ItemID As Integer = p.Item.ID
Dim lostItem As Item = Item.GetItemByID(ItemID)
If own = True Then
BattleScreen.FieldEffects.OwnLostItem = lostItem
Else
BattleScreen.FieldEffects.OppLostItem = lostItem
If from = own Then
If own = True Then
BattleScreen.FieldEffects.OwnConsumedItem = lostItem
Else
BattleScreen.FieldEffects.OppConsumedItem = lostItem
End If
End If
p.Item = Nothing

View File

@ -84,7 +84,7 @@
Public OwnInfestation As Integer = 0
Public OwnUsedMoves As New List(Of Integer)
Public OwnMagicCoat As Integer = 0
Public OwnLostItem As Item = Nothing
Public OwnConsumedItem As Item = Nothing
Public OwnPursuit As Boolean = False
Public OwnMegaEvolved As Boolean = False
Public OwnRoostUsed As Boolean = False 'If roost got used, this is true and will get set false and revert types at the end of a turn.
@ -194,7 +194,7 @@
Public OppPokemonDamagedThisTurn As Boolean = False
Public OppPokemonDamagedLastTurn As Boolean = False
Public OppMagicCoat As Integer = 0
Public OppLostItem As Item = Nothing
Public OppConsumedItem As Item = Nothing
Public OppPursuit As Boolean = False
Public OppMegaEvolved As Boolean = False
Public OppRoostUsed As Boolean = False

View File

@ -53,11 +53,31 @@
End Sub
Public Overrides Function GetBasePower(own As Boolean, BattleScreen As BattleScreen) As Integer
If BattleScreen.Battle.RemoveHeldItem(Not own, own, BattleScreen, "", "", True) = True Then
Return CInt(Me.Power * 1.5F)
Dim p As Pokemon = BattleScreen.OwnPokemon
Dim op As Pokemon = BattleScreen.OppPokemon
If own = False Then
p = BattleScreen.OppPokemon
op = BattleScreen.OwnPokemon
End If
Return Me.Power
'Conditions
If op.Item Is Nothing Then
Return Power
End If
If op.Item.IsMegaStone = True Then
Return Power
End If
If op.Ability.Name.ToLower() = "multitype" AndAlso op.Item.Name.ToLower().EndsWith(" plate") Then
Return Power
End If
If op.Item.Name.ToLower() = "griseous orb" And op.Number = 487 Then
Return Power
End If
If op.Item.Name.ToLower().EndsWith(" drive") = True AndAlso op.Number = 649 Then
Return Power
End If
Return CInt(Me.Power * 1.5F)
End Function
Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen)
@ -67,15 +87,28 @@
p = BattleScreen.OppPokemon
op = BattleScreen.OwnPokemon
End If
'Conditions
If op.Item Is Nothing Then
Exit Sub
End If
If op.Item.IsMegaStone = True Then
Exit Sub
End If
If BattleScreen.Battle.RemoveHeldItem(Not own, own, BattleScreen, "", "", True) = True Then
op.OriginalItem = Item.GetItemByID(op.Item.ID)
op.OriginalItem.AdditionalData = op.Item.AdditionalData
BattleScreen.Battle.RemoveHeldItem(Not own, own, BattleScreen, p.GetDisplayName() & " knocked off the " & op.GetDisplayName() & "'s " & op.OriginalItem.Name & "!", "move:knockoff")
If op.Ability.Name.ToLower() = "multitype" AndAlso op.Item.Name.ToLower().EndsWith(" plate") Then
Exit Sub
End If
If op.Item.Name.ToLower() = "griseous orb" And op.Number = 487 Then
Exit Sub
End If
If op.Item.Name.ToLower().EndsWith(" drive") = True AndAlso p.Number = 649 Then
Exit Sub
End If
op.OriginalItem = Item.GetItemByID(op.Item.ID)
op.OriginalItem.AdditionalData = op.Item.AdditionalData
BattleScreen.Battle.RemoveHeldItem(Not own, own, BattleScreen, p.GetDisplayName() & " knocked off the " & op.GetDisplayName() & "'s " & op.OriginalItem.Name & "!", "move:knockoff")
End Sub
End Class

View File

@ -62,47 +62,51 @@ Namespace BattleSystem.Moves.Dark
p = BattleScreen.OppPokemon
op = BattleScreen.OwnPokemon
End If
Dim CanSwitchItems As Boolean = True
If p.Item Is Nothing And op.Item Is Nothing Then
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
Else
If p.Ability.Name.ToLower() = "sticky hold" Or op.Ability.Name.ToLower() = "sticky hold" Then
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
Else
If Not p.Item Is Nothing AndAlso p.Item.Name.ToLower() = "griseous orb" AndAlso p.Number = 487 Then
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
Else
If Not op.Item Is Nothing AndAlso op.Item.Name.ToLower() = "griseous orb" AndAlso op.Number = 487 Then
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
Else
If CheckMultitypePlate(p, op) = False Then
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
Else
If Not p.Item Is Nothing AndAlso p.Item.Name.ToLower().EndsWith(" drive") = True AndAlso p.Number = 649 Then
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
Else
If Not op.Item Is Nothing AndAlso op.Item.Name.ToLower().EndsWith(" drive") = True AndAlso p.Number = 649 Then
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
If p.Item.IsMegaStone OrElse op.Item.IsMegaStone Then
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
Else
Dim i1 As Item = p.Item
Dim i2 As Item = op.Item
p.Item = i2
op.Item = i1
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " switched items with " & op.GetDisplayName() & "."))
End If
End If
End If
End If
End If
End If
CanSwitchItems = False
End If
If BattleScreen.FieldEffects.CanUseAbility(Not own, BattleScreen) AndAlso op.Ability.Name.ToLower() = "sticky hold" Then
CanSwitchItems = False
End If
If Not p.Item Is Nothing AndAlso p.Item.Name.ToLower() = "griseous orb" AndAlso p.Number = 487 Then
CanSwitchItems = False
End If
If Not op.Item Is Nothing AndAlso op.Item.Name.ToLower() = "griseous orb" AndAlso op.Number = 487 Then
CanSwitchItems = False
End If
If CheckMultitypePlate(p, op) = False Then
CanSwitchItems = False
End If
If Not p.Item Is Nothing AndAlso p.Item.Name.ToLower().EndsWith(" drive") = True AndAlso p.Number = 649 Then
CanSwitchItems = False
End If
If Not op.Item Is Nothing AndAlso op.Item.Name.ToLower().EndsWith(" drive") = True AndAlso op.Number = 649 Then
CanSwitchItems = False
End If
If (p.Item IsNot Nothing AndAlso p.Item.IsMegaStone) OrElse (op.Item IsNot Nothing AndAlso op.Item.IsMegaStone) Then
CanSwitchItems = False
End If
If CanSwitchItems Then
Dim i1 As Item = Nothing
Dim i2 As Item = Nothing
If p.Item IsNot Nothing Then
i1 = p.Item
End If
If op.Item IsNot Nothing Then
i2 = op.Item
End If
p.Item = i2
op.Item = i1
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " switched items with " & op.GetDisplayName() & "."))
Else
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
End If
End Sub
Private Function CheckMultitypePlate(ByVal p As Pokemon, ByVal op As Pokemon) As Boolean
If p.Ability.Name.ToLower() <> "multitype" And op.Ability.Name.ToLower() = "multitype" Then
If p.Ability.Name.ToLower() <> "multitype" And op.Ability.Name.ToLower() <> "multitype" Then
Return True
Else
If Not p.Item Is Nothing Then

View File

@ -59,31 +59,35 @@
p = BattleScreen.OppPokemon
op = BattleScreen.OwnPokemon
End If
'Conditions
If op.Item Is Nothing Then
Exit Sub
End If
If op.Item.IsMegaStone = True Then
Exit Sub
End If
Dim canSteal As Boolean = True
If op.Ability.Name.ToLower() = "multitype" Then
canSteal = False
If op.Ability.Name.ToLower() = "multitype" AndAlso op.Item.Name.ToLower().EndsWith(" plate") Then
Exit Sub
End If
If Not op.Item Is Nothing AndAlso op.Item.Name.ToLower() = "griseous orb" And op.Number = 487 Then
canSteal = False
If op.Item.Name.ToLower() = "griseous orb" And op.Number = 487 Then
Exit Sub
End If
If op.Item.Name.ToLower().EndsWith(" drive") = True AndAlso op.Number = 649 Then
Exit Sub
End If
If canSteal = True Then
If p.Item Is Nothing And Not op.Item Is Nothing Then
Dim ItemID As Integer = op.Item.ID
If p.Item Is Nothing Then
Dim ItemID As Integer = op.Item.ID
op.OriginalItem = Item.GetItemByID(op.Item.ID)
op.OriginalItem.AdditionalData = op.Item.AdditionalData
op.OriginalItem = Item.GetItemByID(op.Item.ID)
op.OriginalItem.AdditionalData = op.Item.AdditionalData
If BattleScreen.Battle.RemoveHeldItem(Not own, own, BattleScreen, "Thief stole the item " & op.Item.Name & " from " & op.GetDisplayName() & "!", "move:thief") = True Then
If own = False Then
BattleScreen.FieldEffects.StolenItemIDs.Add(ItemID)
End If
p.Item = Item.GetItemByID(ItemID)
If BattleScreen.Battle.RemoveHeldItem(Not own, own, BattleScreen, "Thief stole the item " & op.Item.Name & " from " & op.GetDisplayName() & "!", "move:thief") Then
If own = False Then
BattleScreen.FieldEffects.StolenItemIDs.Add(ItemID)
End If
p.Item = Item.GetItemByID(ItemID)
End If
End If
End Sub

View File

@ -62,35 +62,38 @@ Namespace BattleSystem.Moves.Normal
p = BattleScreen.OppPokemon
op = BattleScreen.OwnPokemon
End If
'Conditions
If op.Item Is Nothing Then
Exit Sub
End If
If op.Item.IsMegaStone = True Then
Exit Sub
End If
Dim canSteal As Boolean = True
If op.Ability.Name.ToLower() = "multitype" Then
canSteal = False
If op.Ability.Name.ToLower() = "multitype" AndAlso op.Item.Name.ToLower().EndsWith(" plate") Then
Exit Sub
End If
If Not op.Item Is Nothing AndAlso op.Item.Name.ToLower() = "griseous orb" And op.Number = 487 Then
canSteal = False
If op.Item.Name.ToLower() = "griseous orb" And op.Number = 487 Then
Exit Sub
End If
If op.Item.Name.ToLower().EndsWith(" drive") = True AndAlso op.Number = 649 Then
Exit Sub
End If
If canSteal = True Then
If p.Item Is Nothing And Not op.Item Is Nothing Then
Dim ItemID As Integer = op.Item.ID
If p.Item Is Nothing Then
Dim ItemID As Integer = op.Item.ID
op.OriginalItem = Item.GetItemByID(op.Item.ID)
op.OriginalItem.AdditionalData = op.Item.AdditionalData
op.OriginalItem = Item.GetItemByID(op.Item.ID)
op.OriginalItem.AdditionalData = op.Item.AdditionalData
If BattleScreen.Battle.RemoveHeldItem(Not own, own, BattleScreen, "Covet stole the item " & op.Item.Name & " from " & op.GetDisplayName() & "!", "move:covet") = True Then
If own = False Then
BattleScreen.FieldEffects.StolenItemIDs.Add(ItemID)
End If
p.Item = Item.GetItemByID(ItemID)
If BattleScreen.Battle.RemoveHeldItem(Not own, own, BattleScreen, "Covet stole the item " & op.Item.Name & " from " & op.GetDisplayName() & "!", "move:covet") Then
If own = False Then
BattleScreen.FieldEffects.StolenItemIDs.Add(ItemID)
End If
p.Item = Item.GetItemByID(ItemID)
End If
End If
End Sub
End Class
End Namespace

View File

@ -59,8 +59,8 @@
If own = True Then
Dim p As Pokemon = BattleScreen.OwnPokemon
If Not BattleScreen.FieldEffects.OwnLostItem Is Nothing Then
p.Item = BattleScreen.FieldEffects.OwnLostItem
If Not BattleScreen.FieldEffects.OwnConsumedItem Is Nothing Then
p.Item = BattleScreen.FieldEffects.OwnConsumedItem
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " found one " & p.Item.Name & "!"))
Else
BattleScreen.BattleQuery.Add(New TextQueryObject("Recycle failed!"))
@ -68,8 +68,8 @@
Else
Dim p As Pokemon = BattleScreen.OppPokemon
If Not BattleScreen.FieldEffects.OppLostItem Is Nothing Then
p.Item = BattleScreen.FieldEffects.OppLostItem
If Not BattleScreen.FieldEffects.OppConsumedItem Is Nothing Then
p.Item = BattleScreen.FieldEffects.OppConsumedItem
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " found one " & p.Item.Name & "!"))
Else
BattleScreen.BattleQuery.Add(New TextQueryObject("Recycle failed!"))

View File

@ -62,48 +62,51 @@ Namespace BattleSystem.Moves.Psychic
p = BattleScreen.OppPokemon
op = BattleScreen.OwnPokemon
End If
Dim CanSwitchItems As Boolean = True
If p.Item Is Nothing And op.Item Is Nothing Then
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
Else
If p.Ability.Name.ToLower() = "sticky hold" Or op.Ability.Name.ToLower() = "sticky hold" Then
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
Else
If Not p.Item Is Nothing AndAlso p.Item.Name.ToLower() = "griseous orb" AndAlso p.Number = 487 Then
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
Else
If Not op.Item Is Nothing AndAlso op.Item.Name.ToLower() = "griseous orb" AndAlso op.Number = 487 Then
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
Else
If CheckMultitypePlate(p, op) = False Then
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
Else
If Not p.Item Is Nothing AndAlso p.Item.Name.ToLower().EndsWith(" drive") = True AndAlso p.Number = 649 Then
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
Else
If Not op.Item Is Nothing AndAlso op.Item.Name.ToLower().EndsWith(" drive") = True AndAlso p.Number = 649 Then
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
Else
If p.Item.IsMegaStone OrElse op.Item.IsMegaStone Then
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
Else
Dim i1 As Item = p.Item
Dim i2 As Item = op.Item
p.Item = i2
op.Item = i1
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " switched items with " & op.GetDisplayName() & "."))
End If
End If
End If
End If
End If
End If
CanSwitchItems = False
End If
If BattleScreen.FieldEffects.CanUseAbility(Not own, BattleScreen) AndAlso op.Ability.Name.ToLower() = "sticky hold" Then
CanSwitchItems = False
End If
If Not p.Item Is Nothing AndAlso p.Item.Name.ToLower() = "griseous orb" AndAlso p.Number = 487 Then
CanSwitchItems = False
End If
If Not op.Item Is Nothing AndAlso op.Item.Name.ToLower() = "griseous orb" AndAlso op.Number = 487 Then
CanSwitchItems = False
End If
If CheckMultitypePlate(p, op) = False Then
CanSwitchItems = False
End If
If Not p.Item Is Nothing AndAlso p.Item.Name.ToLower().EndsWith(" drive") = True AndAlso p.Number = 649 Then
CanSwitchItems = False
End If
If Not op.Item Is Nothing AndAlso op.Item.Name.ToLower().EndsWith(" drive") = True AndAlso op.Number = 649 Then
CanSwitchItems = False
End If
If (p.Item IsNot Nothing AndAlso p.Item.IsMegaStone) OrElse (op.Item IsNot Nothing AndAlso op.Item.IsMegaStone) Then
CanSwitchItems = False
End If
If CanSwitchItems Then
Dim i1 As Item = Nothing
Dim i2 As Item = Nothing
If p.Item IsNot Nothing Then
i1 = p.Item
End If
If op.Item IsNot Nothing Then
i2 = op.Item
End If
p.Item = i2
op.Item = i1
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " switched items with " & op.GetDisplayName() & "."))
Else
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
End If
End Sub
Private Function CheckMultitypePlate(ByVal p As Pokemon, ByVal op As Pokemon) As Boolean
If p.Ability.Name.ToLower() <> "multitype" And op.Ability.Name.ToLower() = "multitype" Then
If p.Ability.Name.ToLower() <> "multitype" And op.Ability.Name.ToLower() <> "multitype" Then
Return True
Else
If Not p.Item Is Nothing Then

View File

@ -1017,11 +1017,11 @@ Public Class Pokemon
Me._originalAbility = Nothing
End If
If Not Me._originalItem Is Nothing Then
Me.Item = net.Pokemon3D.Game.Item.GetItemByID(Me._originalItem.ID)
Me.Item.AdditionalData = Me._originalItem.AdditionalData
Me._originalItem = Nothing
End If
'If Not Me._originalItem Is Nothing Then
' Me.Item = net.Pokemon3D.Game.Item.GetItemByID(Me._originalItem.ID)
' Me.Item.AdditionalData = Me._originalItem.AdditionalData
' Me._originalItem = Nothing
'End If
Me.IsTransformed = False

View File

@ -6,8 +6,8 @@
Shared _valid As Boolean = False
Const RUNVALIDATION As Boolean = False
Const EXPECTEDSIZE As Integer = 42289864
Const METAHASH As String = "ODk4NUU5QTZGMTdDNzZDMDc3RkZGODUwRDAzNzkxRTQ="
Const EXPECTEDSIZE As Integer = 42289870
Const METAHASH As String = "OTEzQTRBRURFMjU2RkUyNDgxRjU0MEJDODMwMjk3Mzc="
Public Shared ReadOnly Property IsValid(ByVal ForceResult As Boolean) As Boolean
Get

File diff suppressed because one or more lines are too long