mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-31 01:35:20 +02:00
Add confusion to gamemode move functions
This commit is contained in:
parent
6305acfdb5
commit
e78cabb598
Binary file not shown.
@ -32,6 +32,16 @@
|
|||||||
Dim Success As Boolean = False
|
Dim Success As Boolean = False
|
||||||
For t = 0 To Triggers.Count - 1
|
For t = 0 To Triggers.Count - 1
|
||||||
Select Case Triggers(t).ToLower()
|
Select Case Triggers(t).ToLower()
|
||||||
|
Case "confuse"
|
||||||
|
If Target = True Then
|
||||||
|
If BattleScreen.OppPokemon.HasVolatileStatus(Pokemon.VolatileStatus.Confusion) = True Then
|
||||||
|
Success = True
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
If BattleScreen.OwnPokemon.HasVolatileStatus(Pokemon.VolatileStatus.Confusion) = True Then
|
||||||
|
Success = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
Case "burn"
|
Case "burn"
|
||||||
If Target = True Then
|
If Target = True Then
|
||||||
If BattleScreen.OppPokemon.Status = Pokemon.StatusProblems.Burn Then
|
If BattleScreen.OppPokemon.Status = Pokemon.StatusProblems.Burn Then
|
||||||
@ -102,6 +112,16 @@
|
|||||||
Success = True
|
Success = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
Case "noconfuse"
|
||||||
|
If Target = True Then
|
||||||
|
If BattleScreen.OppPokemon.HasVolatileStatus(Pokemon.VolatileStatus.Confusion) = False Then
|
||||||
|
Success = True
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
If BattleScreen.OwnPokemon.HasVolatileStatus(Pokemon.VolatileStatus.Confusion) = False Then
|
||||||
|
Success = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
Case "noburn"
|
Case "noburn"
|
||||||
If Target = True Then
|
If Target = True Then
|
||||||
If BattleScreen.OppPokemon.Status <> Pokemon.StatusProblems.Burn Then
|
If BattleScreen.OppPokemon.Status <> Pokemon.StatusProblems.Burn Then
|
||||||
@ -356,17 +376,15 @@
|
|||||||
Freeze(Move, own, BattleScreen, CInt(fSub))
|
Freeze(Move, own, BattleScreen, CInt(fSub))
|
||||||
Case "sleep"
|
Case "sleep"
|
||||||
Sleep(Move, own, BattleScreen, CInt(fSub))
|
Sleep(Move, own, BattleScreen, CInt(fSub))
|
||||||
|
Case "confuse"
|
||||||
|
Confuse(Move, own, BattleScreen, CInt(fSub))
|
||||||
End Select
|
End Select
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Shared Function GetEffectChanceResult(ByVal move As Attack, ByVal chance As Integer) As Boolean
|
Private Shared Function GetEffectChanceResult(ByVal move As Attack, ByVal chance As Integer) As Boolean
|
||||||
If move.Category = Attack.Categories.Special Then
|
Return Core.Random.Next(0, 100) <= chance
|
||||||
Return True
|
|
||||||
Else
|
|
||||||
Return Core.Random.Next(0, 100) <= chance
|
|
||||||
End If
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Shared Sub Paralyze(ByVal Move As Attack, ByVal own As Boolean, ByVal BattleScreen As BattleScreen, Chance As Integer)
|
Private Shared Sub Paralyze(ByVal Move As Attack, ByVal own As Boolean, ByVal BattleScreen As BattleScreen, Chance As Integer)
|
||||||
@ -376,6 +394,13 @@
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
Private Shared Sub Confuse(ByVal Move As Attack, ByVal own As Boolean, ByVal BattleScreen As BattleScreen, Chance As Integer)
|
||||||
|
If GetEffectChanceResult(Move, Chance) = True Then
|
||||||
|
If BattleScreen.Battle.InflictConfusion(Not own, own, BattleScreen, "", "move:" & Move.Name.ToLower()) = False Then
|
||||||
|
If Move.Category = Attack.Categories.Status Then BattleScreen.BattleQuery.Add(New TextQueryObject(Move.Name & " failed!"))
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Shared Sub Burn(ByVal Move As Attack, ByVal own As Boolean, ByVal BattleScreen As BattleScreen, Chance As Integer)
|
Private Shared Sub Burn(ByVal Move As Attack, ByVal own As Boolean, ByVal BattleScreen As BattleScreen, Chance As Integer)
|
||||||
If GetEffectChanceResult(Move, Chance) = True Then
|
If GetEffectChanceResult(Move, Chance) = True Then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user