Fixes regarding battle system

This commit is contained in:
CaptainSegis 2018-12-22 15:02:02 -05:00
parent 3730ebbd10
commit 87edaa0ee6
7 changed files with 100 additions and 27 deletions

View File

@ -1424,8 +1424,9 @@
Dim NoTargetCheck As Boolean = True
If moveUsed.ProtectAffected = False Then
NoTargetCheck = False
'Moves that target other pokemon and can go through protect.
Select Case moveUsed.Name.ToLower
Case "accupressure", "confide", "feint", "hold hands", "hyperspace fury", "hyperspace hole", "phantom force", "psych up", "geomancy", "play nice", "roar", "role play", "shadow force", "sketch", "transform", "whirlwind"
Case "acupressure", "confide", "feint", "hold hands", "hyperspace fury", "hyperspace hole", "phantom force", "psych up", "play nice", "roar", "role play", "shadow force", "sketch", "transform", "whirlwind"
NoTargetCheck = True
End Select
End If
@ -1470,11 +1471,13 @@
DoesNotMiss = True
End If
'if the target pokemon can't be hit because of a two-turn move (Fly, for example)
Dim UseTwoTurnCheck As Boolean = True
If moveUsed.ProtectAffected = False Then
UseTwoTurnCheck = False
'Moves that target other pokemon and can go through protect.
Select Case moveUsed.Name.ToLower
Case "accupressure", "confide", "feint", "hold hands", "hyperspace fury", "hyperspace hole", "phantom force", "psych up", "geomancy", "play nice", "roar", "role play", "shadow force", "sketch", "transform", "whirlwind"
Case "acupressure", "confide", "feint", "hold hands", "hyperspace fury", "hyperspace hole", "phantom force", "psych up", "play nice", "roar", "role play", "shadow force", "sketch", "transform", "whirlwind"
UseTwoTurnCheck = True
End Select
End If

View File

@ -381,6 +381,10 @@
Return True
End If
If UsedAttack.GetUseAccEvasion(own, BattleScreen) = False Then
Return True
End If
Dim result As Single = 1.0F
Dim INIT As Integer = UsedAttack.GetAccuracy(own, BattleScreen)
@ -404,10 +408,6 @@
Dim ACCM As Single = GetMultiplierFromAccEvasion(ACC)
If UsedAttack.GetUseAccEvasion(own, BattleScreen) = False Then
ACCM = 1.0F
End If
result = INIT * ACCM
If Not op.Item Is Nothing And BattleScreen.FieldEffects.CanUseItem(Not own) = True Then
@ -572,10 +572,10 @@
If Core.Random.Next(0, chance) = 0 Then
Return True
End If
If UsedAttack.ID = 524 Then
If UsedAttack.ID = 524 Then 'frost breath
Return True
End If
If UsedAttack.ID = 480 Then
If UsedAttack.ID = 480 Then 'storm throw
Return True
End If
@ -1500,10 +1500,6 @@
DSM = 1.0F
End If
If Attack.ID = 663 Then 'Darkest Lariat
DSM = 1.0F
End If
If Attack.Name.ToLower() = "selfdestruct" Or Attack.Name.ToLower() = "explosion" Then
SX = 1.0F
End If
@ -1532,10 +1528,6 @@
DSM = 1.0F
End If
If Attack.ID = 663 Then 'Darkest Lariat
DSM = 1.0F
End If
If Op.Ability.Name.ToLower() = "flower gift" Then
If BattleScreen.FieldEffects.Weather = BattleWeather.WeatherTypes.Sunny Then
DMod = 1.5F

View File

@ -59,7 +59,7 @@
p = BattleScreen.OppPokemon
op = BattleScreen.OwnPokemon
End If
If op.HP = 0 Then
If op.HP <= 0 OrElse op.Status = Pokemon.StatusProblems.Fainted Then
BattleScreen.Battle.RaiseStat(own, own, BattleScreen, "Attack", 3, "", "move:fellstinger")
End If
End Sub

View File

@ -50,6 +50,8 @@
Me.IsOneHitKOMove = False
Me.IsWonderGuardAffected = True
Me.IsJawMove = True
Me.UseOppEvasion = False
Me.UseOppDefense = False
'#End
Me.AIField1 = AIField.Damage

View File

@ -57,14 +57,93 @@ Namespace BattleSystem.Moves.Fairy
End Sub
Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen)
Dim b As Boolean = BattleScreen.Battle.RaiseStat(own, own, BattleScreen, "Special Attack", 2, "", "move:geomancy")
Dim d As Boolean = BattleScreen.Battle.RaiseStat(own, own, BattleScreen, "Special Defense", 2, "", "move:geomancy")
Dim f As Boolean = BattleScreen.Battle.RaiseStat(own, own, BattleScreen, "Speed", 2, "", "move:geomancy")
If b = False And d = False And f = False Then
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
BattleScreen.Battle.RaiseStat(own, own, BattleScreen, "Special Attack", 2, "", "move:geomancy")
BattleScreen.Battle.RaiseStat(own, own, BattleScreen, "Special Defense", 2, "", "move:geomancy")
BattleScreen.Battle.RaiseStat(own, own, BattleScreen, "Speed", 2, "", "move:geomancy")
End Sub
Public Overrides Function MoveFailBeforeAttack(Own As Boolean, BattleScreen As BattleScreen) As Boolean
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 geomancy As Integer = BattleScreen.FieldEffects.OwnGeomancyCounter
If Own = False Then
geomancy = BattleScreen.FieldEffects.OppGeomancyCounter
End If
If Not p.Item Is Nothing Then
If p.Item.Name.ToLower() = "power herb" And BattleScreen.FieldEffects.CanUseItem(Own) = True And BattleScreen.FieldEffects.CanUseOwnItem(Own, BattleScreen) = True Then
If BattleScreen.Battle.RemoveHeldItem(Own, Own, BattleScreen, "Power Herb pushed the use of Geomancy!", "move:geomancy") = True Then
geomancy = 1
End If
End If
End If
If geomancy = 0 Then
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " is absorbing power!"))
If Own = True Then
BattleScreen.FieldEffects.OwnGeomancyCounter = 1
Else
BattleScreen.FieldEffects.OppGeomancyCounter = 1
End If
Return True
Else
If Own = True Then
BattleScreen.FieldEffects.OwnGeomancyCounter = 0
Else
BattleScreen.FieldEffects.OppGeomancyCounter = 0
End If
Return False
End If
End Function
Public Overrides Sub MoveSelected(own As Boolean, BattleScreen As BattleScreen)
If own = True Then
BattleScreen.FieldEffects.OwnGeomancyCounter = 0
Else
BattleScreen.FieldEffects.OppGeomancyCounter = 0
End If
End Sub
Public Overrides Function DeductPP(own As Boolean, BattleScreen As BattleScreen) As Boolean
Dim geomancy As Integer = BattleScreen.FieldEffects.OwnGeomancyCounter
If own = False Then
geomancy = BattleScreen.FieldEffects.OppGeomancyCounter
End If
If geomancy = 0 Then
Return False
Else
Return True
End If
End Function
Private Sub MoveFails(own As Boolean, BattleScreen As BattleScreen)
If own = True Then
BattleScreen.FieldEffects.OwnGeomancyCounter = 0
Else
BattleScreen.FieldEffects.OppGeomancyCounter = 0
End If
End Sub
Public Overrides Sub InflictedFlinch(own As Boolean, BattleScreen As BattleScreen)
MoveFails(own, BattleScreen)
End Sub
Public Overrides Sub IsSleeping(own As Boolean, BattleScreen As BattleScreen)
MoveFails(own, BattleScreen)
End Sub
Public Overrides Sub HurtItselfInConfusion(own As Boolean, BattleScreen As BattleScreen)
MoveFails(own, BattleScreen)
End Sub
Public Overrides Sub IsAttracted(own As Boolean, BattleScreen As BattleScreen)
MoveFails(own, BattleScreen)
End Sub
End Class
End Namespace

View File

@ -53,11 +53,8 @@
End Sub
Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen)
Dim b As Boolean = BattleScreen.Battle.LowerStat(own, own, BattleScreen, "Defense", 1, "", "move:dragonascent")
Dim d As Boolean = BattleScreen.Battle.LowerStat(own, own, BattleScreen, "Special Defense", 1, "", "move:dragonascent")
If b = False And d = False Then
BattleScreen.BattleQuery.Add(New TextQueryObject(Me.Name & " failed!"))
End If
BattleScreen.Battle.LowerStat(own, own, BattleScreen, "Defense", 1, "", "move:dragonascent")
BattleScreen.Battle.LowerStat(own, own, BattleScreen, "Special Defense", 1, "", "move:dragonascent")
End Sub
End Class

Binary file not shown.