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 End If
'ABILITY SHIT GOES HERE: 'ABILITY SHIT GOES HERE:
Select Case op.Ability.Name.ToLower() If BattleScreen.FieldEffects.CanUseAbility(Not own, BattleScreen) Then
Case "color change" Select Case op.Ability.Name.ToLower()
If op.HP > 0 Then Case "color change"
If op.Type1.Type <> moveUsed.GetAttackType(own, BattleScreen).Type Or op.Type2.Type <> Element.Types.Blank Then If op.HP > 0 Then
ChangeCameraAngel(2, own, BattleScreen) If op.Type1.Type <> moveUsed.GetAttackType(own, BattleScreen).Type Or op.Type2.Type <> Element.Types.Blank Then
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
ChangeCameraAngel(2, own, BattleScreen) ChangeCameraAngel(2, own, BattleScreen)
BattleScreen.BattleQuery.Add(New TextQueryObject(op.GetDisplayName() & "'s Cursed Body disabled " & moveUsed.Name & "!")) op.OriginalType1 = op.Type1
moveUsed.Disabled = Core.Random.Next(1, 6) op.OriginalType2 = op.Type2
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
Select Case p.Ability.Name.ToLower() op.Type1 = moveUsed.GetAttackType(own, BattleScreen)
Case "poison touch" op.Type2.Type = Element.Types.Blank
If moveUsed.MakesContact = True And op.Status = Pokemon.StatusProblems.None Then BattleScreen.BattleQuery.Add(New TextQueryObject(op.GetDisplayName() & " changed it's color!"))
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
End If End If
End If End If
End If Case "rough skin"
Case "moxie" If moveUsed.MakesContact = True Then
If KOED = True Then ReduceHP(CInt(Math.Floor(p.MaxHP / 16)), own, Not own, BattleScreen, p.GetDisplayName() & " was harmed by Rough Skin.", "roughskin")
RaiseStat(own, own, BattleScreen, "Attack", 1, p.GetDisplayName() & "'s Moxie got in effect!", "moxie") End If
End If Case "static"
Case "weak armor" If moveUsed.MakesContact = True And p.Status = Pokemon.StatusProblems.None Then
If moveUsed.Category = Attack.Categories.Physical Then If Core.Random.Next(0, 100) < 30 Then
RaiseStat(own, own, BattleScreen, "Speed", 1, "Weak Armor causes the Speed to increase!", "weakarmor") InflictParalysis(own, Not own, BattleScreen, op.GetDisplayName() & "'s Static affects " & p.GetDisplayName() & "!", "static")
LowerStat(own, own, BattleScreen, "Defense", 1, "Weak Armor causes the Defense to decrease!", "weakarmor") End If
End If End If
End Select 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 substitute = 0 And op.HP > 0 Then
If Not op.Item Is Nothing Then If Not op.Item Is Nothing Then
@ -3753,7 +3781,7 @@
Return False Return False
End If 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 If TestFor = False Then
Me.ChangeCameraAngel(1, own, BattleScreen) Me.ChangeCameraAngel(1, own, BattleScreen)
BattleScreen.BattleQuery.Add(New TextQueryObject("Sticky Hold prevented the item loss.")) BattleScreen.BattleQuery.Add(New TextQueryObject("Sticky Hold prevented the item loss."))
@ -3765,10 +3793,12 @@
Dim ItemID As Integer = p.Item.ID Dim ItemID As Integer = p.Item.ID
Dim lostItem As Item = Item.GetItemByID(ItemID) Dim lostItem As Item = Item.GetItemByID(ItemID)
If own = True Then If from = own Then
BattleScreen.FieldEffects.OwnLostItem = lostItem If own = True Then
Else BattleScreen.FieldEffects.OwnConsumedItem = lostItem
BattleScreen.FieldEffects.OppLostItem = lostItem Else
BattleScreen.FieldEffects.OppConsumedItem = lostItem
End If
End If End If
p.Item = Nothing p.Item = Nothing

View File

@ -84,7 +84,7 @@
Public OwnInfestation As Integer = 0 Public OwnInfestation As Integer = 0
Public OwnUsedMoves As New List(Of Integer) Public OwnUsedMoves As New List(Of Integer)
Public OwnMagicCoat As Integer = 0 Public OwnMagicCoat As Integer = 0
Public OwnLostItem As Item = Nothing Public OwnConsumedItem As Item = Nothing
Public OwnPursuit As Boolean = False Public OwnPursuit As Boolean = False
Public OwnMegaEvolved 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. 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 OppPokemonDamagedThisTurn As Boolean = False
Public OppPokemonDamagedLastTurn As Boolean = False Public OppPokemonDamagedLastTurn As Boolean = False
Public OppMagicCoat As Integer = 0 Public OppMagicCoat As Integer = 0
Public OppLostItem As Item = Nothing Public OppConsumedItem As Item = Nothing
Public OppPursuit As Boolean = False Public OppPursuit As Boolean = False
Public OppMegaEvolved As Boolean = False Public OppMegaEvolved As Boolean = False
Public OppRoostUsed As Boolean = False Public OppRoostUsed As Boolean = False

View File

@ -53,11 +53,31 @@
End Sub End Sub
Public Overrides Function GetBasePower(own As Boolean, BattleScreen As BattleScreen) As Integer Public Overrides Function GetBasePower(own As Boolean, BattleScreen As BattleScreen) As Integer
If BattleScreen.Battle.RemoveHeldItem(Not own, own, BattleScreen, "", "", True) = True Then Dim p As Pokemon = BattleScreen.OwnPokemon
Return CInt(Me.Power * 1.5F) Dim op As Pokemon = BattleScreen.OppPokemon
If own = False Then
p = BattleScreen.OppPokemon
op = BattleScreen.OwnPokemon
End If 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 End Function
Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen) Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen)
@ -67,15 +87,28 @@
p = BattleScreen.OppPokemon p = BattleScreen.OppPokemon
op = BattleScreen.OwnPokemon op = BattleScreen.OwnPokemon
End If End If
'Conditions
If op.Item Is Nothing Then
Exit Sub
End If
If op.Item.IsMegaStone = True Then If op.Item.IsMegaStone = True Then
Exit Sub Exit Sub
End If End If
If BattleScreen.Battle.RemoveHeldItem(Not own, own, BattleScreen, "", "", True) = True Then If op.Ability.Name.ToLower() = "multitype" AndAlso op.Item.Name.ToLower().EndsWith(" plate") Then
op.OriginalItem = Item.GetItemByID(op.Item.ID) Exit Sub
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 If 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 Sub
End Class End Class

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

File diff suppressed because one or more lines are too long