P3D-Legacy/P3D/Pokemon/Attacks/Ghost/Spite.vb

90 lines
2.9 KiB
VB.net

Namespace BattleSystem.Moves.Ghost
Public Class Spite
Inherits Attack
Public Sub New()
'#Definitions
Me.Type = New Element(Element.Types.Ghost)
Me.ID = 180
Me.OriginalPP = 10
Me.CurrentPP = 10
Me.MaxPP = 10
Me.Power = 0
Me.Accuracy = 100
Me.Category = Categories.Status
Me.ContestCategory = ContestCategories.Tough
Me.Name = Localization.GetString("move_name_" & Me.ID,"Spite")
Me.Description = "The user unleashes its grudge on the move last used by the target by cutting 4 PP from it."
Me.CriticalChance = 0
Me.IsHMMove = False
Me.Target = Targets.OneAdjacentTarget
Me.Priority = 0
Me.TimesToAttack = 1
'#End
'#SpecialDefinitions
Me.MakesContact = False
Me.ProtectAffected = True
Me.MagicCoatAffected = True
Me.SnatchAffected = False
Me.MirrorMoveAffected = False
Me.KingsrockAffected = False
Me.CounterAffected = False
Me.DisabledWhileGravity = False
Me.UseEffectiveness = False
Me.ImmunityAffected = True
Me.HasSecondaryEffect = False
Me.RemovesOwnFrozen = False
Me.IsHealingMove = False
Me.IsRecoilMove = False
Me.IsDamagingMove = False
Me.IsProtectMove = False
Me.IsAffectedBySubstitute = True
Me.IsOneHitKOMove = False
Me.IsWonderGuardAffected = True
'#End
Me.AIField1 = AIField.Support
Me.AIField2 = AIField.Nothing
End Sub
Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen)
Dim lastMove As Attack = BattleScreen.FieldEffects.OppLastMove
If own = False Then
lastMove = BattleScreen.FieldEffects.OwnLastMove
End If
Dim op As Pokemon = BattleScreen.OppPokemon
If own = False Then
op = BattleScreen.OwnPokemon
End If
If Not lastMove Is Nothing Then
If lastMove.CurrentPP > 0 Then
Dim reduce As Integer = 4
If lastMove.CurrentPP - reduce < 0 Then
reduce = lastMove.CurrentPP
End If
lastMove.CurrentPP -= reduce
BattleScreen.BattleQuery.Add(New TextQueryObject("It reduced the PP of the " & op.GetDisplayName() & "'s " & lastMove.Name & " by " & reduce & "!"))
Else
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
End If
Else
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
End If
End Sub
End Class
End Namespace