P3D-Legacy/P3D/Pokemon/Attacks/Grass/Strength Sap.vb

95 lines
3.6 KiB
VB.net

Namespace BattleSystem.Moves.Grass
Public Class StrengthSap
Inherits Attack
Public Sub New()
'#Definitions
Me.Type = New Element(Element.Types.Grass)
Me.ID = 668
Me.OriginalPP = 10
Me.CurrentPP = 10
Me.MaxPP = 10
Me.Power = 0
Me.Accuracy = 100
Me.Category = Categories.Status
Me.ContestCategory = ContestCategories.Smart
Me.Name = "Strength Sap"
Me.Description = "The user restores its HP by the same amount as the target's Attack stat. It also lowers the target's Attack stat."
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 = True
Me.KingsrockAffected = False
Me.CounterAffected = False
Me.DisabledWhileGravity = False
Me.UseEffectiveness = False
Me.ImmunityAffected = False
Me.HasSecondaryEffect = False
Me.RemovesFrozen = False
Me.IsHealingMove = True
Me.IsRecoilMove = False
Me.IsPunchingMove = False
Me.IsDamagingMove = False
Me.IsProtectMove = False
Me.IsSoundMove = False
Me.IsAffectedBySubstitute = True
Me.IsOneHitKOMove = False
Me.IsWonderGuardAffected = True
'#End
End Sub
Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen)
Dim p As Pokemon = BattleScreen.OwnPokemon
Dim op As Pokemon = BattleScreen.OppPokemon
If own = False Then
p = BattleScreen.OppPokemon
op = BattleScreen.OwnPokemon
End If
Dim b As Boolean = BattleScreen.Battle.LowerStat(Not own, own, BattleScreen, "Attack", 1, "", "move:strengthsap")
Dim op_Attack As Integer = BattleCalculation.DetermineBattleAttack(Not own, BattleScreen)
Dim heal As Integer = op_Attack
If b = True Then
If op.Ability.Name.ToLower() = "liquid ooze" And BattleScreen.FieldEffects.CanUseAbility(Not own, BattleScreen) = True Then
BattleScreen.Battle.ReduceHP(heal, own, own, BattleScreen, "Liquid Ooze damaged " & p.GetDisplayName() & "!", "liquidooze")
Else
If Not p.Item Is Nothing Then
If p.Item.Name.ToLower() = "big root" And BattleScreen.FieldEffects.CanUseItem(own) = True And BattleScreen.FieldEffects.CanUseOwnItem(own, BattleScreen) = True Then
heal = CInt(Math.Ceiling(heal * (130 / 100)))
End If
End If
Dim healBlock As Integer = BattleScreen.FieldEffects.OppHealBlock
If own = False Then
healBlock = BattleScreen.FieldEffects.OwnHealBlock
End If
If healBlock = 0 Then
BattleScreen.Battle.GainHP(heal, own, own, BattleScreen, op.GetDisplayName() & " had its energy drained!", "move:strengthsap")
End If
End If
End If
If b = False Then
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
End If
End Sub
End Class
End Namespace