Fix Sleep Talk & Snore not working while asleep

This commit is contained in:
JappaWakka 2024-11-30 11:39:21 +01:00
parent 4edb20faae
commit 0415df9ee3
2 changed files with 31 additions and 22 deletions

View File

@ -1212,14 +1212,18 @@
op = BattleScreen.OppPokemon op = BattleScreen.OppPokemon
pNPC = BattleScreen.OwnPokemonNPC pNPC = BattleScreen.OwnPokemonNPC
opNPC = BattleScreen.OppPokemonNPC opNPC = BattleScreen.OppPokemonNPC
If Not (own AndAlso BattleScreen.FieldEffects.OwnLastMove IsNot Nothing AndAlso BattleScreen.FieldEffects.OwnLastMove.ID = 214) Then
BattleScreen.FieldEffects.OwnLastMove = moveUsed BattleScreen.FieldEffects.OwnLastMove = moveUsed
End If
Else Else
p = BattleScreen.OppPokemon p = BattleScreen.OppPokemon
op = BattleScreen.OwnPokemon op = BattleScreen.OwnPokemon
pNPC = BattleScreen.OppPokemonNPC pNPC = BattleScreen.OppPokemonNPC
opNPC = BattleScreen.OwnPokemonNPC opNPC = BattleScreen.OwnPokemonNPC
If Not (Not own AndAlso BattleScreen.FieldEffects.OppLastMove IsNot Nothing AndAlso BattleScreen.FieldEffects.OppLastMove.ID = 214) Then
BattleScreen.FieldEffects.OppLastMove = moveUsed BattleScreen.FieldEffects.OppLastMove = moveUsed
End If End If
End If
If WildHasEscaped Then If WildHasEscaped Then
WildHasEscaped = False WildHasEscaped = False
Exit Sub Exit Sub
@ -1351,6 +1355,7 @@
Exit Sub Exit Sub
End If End If
Else Else
' If the last move was Sleep Talk, don't do sleep animation
If (own AndAlso BattleScreen.FieldEffects.OwnLastMove IsNot Nothing AndAlso BattleScreen.FieldEffects.OwnLastMove.ID = 214) OrElse (Not own AndAlso BattleScreen.FieldEffects.OppLastMove IsNot Nothing AndAlso BattleScreen.FieldEffects.OppLastMove.ID = 214) Then If (own AndAlso BattleScreen.FieldEffects.OwnLastMove IsNot Nothing AndAlso BattleScreen.FieldEffects.OwnLastMove.ID = 214) OrElse (Not own AndAlso BattleScreen.FieldEffects.OppLastMove IsNot Nothing AndAlso BattleScreen.FieldEffects.OppLastMove.ID = 214) Then
If own Then If own Then
BattleScreen.FieldEffects.OwnLastMove = moveUsed BattleScreen.FieldEffects.OwnLastMove = moveUsed
@ -1358,6 +1363,9 @@
BattleScreen.FieldEffects.OppLastMove = moveUsed BattleScreen.FieldEffects.OppLastMove = moveUsed
End If End If
Else Else
' If the used move is not Snore, do sleep animation or wake up
If Not (sleepTurns > 0 AndAlso moveUsed.ID = 173) Then
If sleepTurns > 0 Then If sleepTurns > 0 Then
ChangeCameraAngle(1, own, BattleScreen) ChangeCameraAngle(1, own, BattleScreen)
'Sleep Animation 'Sleep Animation
@ -1386,6 +1394,7 @@
End If End If
End If End If
End If End If
End If
If p.Ability.Name.ToLower() = "truant" Then If p.Ability.Name.ToLower() = "truant" Then
Dim truantTurn As Integer = BattleScreen.FieldEffects.OwnTruantRound Dim truantTurn As Integer = BattleScreen.FieldEffects.OwnTruantRound

View File

@ -56,7 +56,7 @@
End Sub End Sub
Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen) Public Overrides Sub MoveHits(own As Boolean, BattleScreen As BattleScreen)
Dim disabledMoves() As Integer = {214, 274, 117, 340, 448, 383, 91, 291, 19, 264, 382, 118, 119, 467, 166, 130, 214, 143, 76, 13, 253} Dim disabledMoves() As Integer = {214, 274, 117, 340, 448, 383, 91, 291, 19, 264, 382, 118, 119, 467, 166, 130, 143, 76, 13, 253}
Dim p As Pokemon = BattleScreen.OwnPokemon Dim p As Pokemon = BattleScreen.OwnPokemon
If own = False Then If own = False Then