mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-28 00:04:33 +02:00
Fix Sleep Talk & Snore not working while asleep
This commit is contained in:
parent
4edb20faae
commit
0415df9ee3
@ -1212,15 +1212,19 @@
|
|||||||
op = BattleScreen.OppPokemon
|
op = BattleScreen.OppPokemon
|
||||||
pNPC = BattleScreen.OwnPokemonNPC
|
pNPC = BattleScreen.OwnPokemonNPC
|
||||||
opNPC = BattleScreen.OppPokemonNPC
|
opNPC = BattleScreen.OppPokemonNPC
|
||||||
BattleScreen.FieldEffects.OwnLastMove = moveUsed
|
If Not (own AndAlso BattleScreen.FieldEffects.OwnLastMove IsNot Nothing AndAlso BattleScreen.FieldEffects.OwnLastMove.ID = 214) Then
|
||||||
|
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
|
||||||
BattleScreen.FieldEffects.OppLastMove = moveUsed
|
If Not (Not own AndAlso BattleScreen.FieldEffects.OppLastMove IsNot Nothing AndAlso BattleScreen.FieldEffects.OppLastMove.ID = 214) Then
|
||||||
|
BattleScreen.FieldEffects.OppLastMove = moveUsed
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
If WildHasEscaped Then
|
If WildHasEscaped Then
|
||||||
WildHasEscaped = False
|
WildHasEscaped = False
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
@ -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,30 +1363,34 @@
|
|||||||
BattleScreen.FieldEffects.OppLastMove = moveUsed
|
BattleScreen.FieldEffects.OppLastMove = moveUsed
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
If sleepTurns > 0 Then
|
' If the used move is not Snore, do sleep animation or wake up
|
||||||
ChangeCameraAngle(1, own, BattleScreen)
|
If Not (sleepTurns > 0 AndAlso moveUsed.ID = 173) Then
|
||||||
'Sleep Animation
|
|
||||||
If Core.Player.ShowBattleAnimations <> 0 AndAlso BattleScreen.IsPVPBattle = False Then
|
|
||||||
Dim SleepAnimation As New AnimationQueryObject(pNPC, Not own)
|
|
||||||
|
|
||||||
SleepAnimation.AnimationPlaySound("Battle\Effects\Asleep", 0, 0)
|
If sleepTurns > 0 Then
|
||||||
Dim SleepEntity1 As Entity = SleepAnimation.SpawnEntity(New Vector3(0, 0.25, 0), TextureManager.GetTexture("Textures\Battle\StatusEffect\Asleep", New Rectangle(0, 0, 16, 16), ""), New Vector3(0.5F), 1, 0, 1)
|
ChangeCameraAngle(1, own, BattleScreen)
|
||||||
SleepAnimation.AnimationChangeTexture(SleepEntity1, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Asleep", New Rectangle(0, 16, 16, 16), ""), 1, 1)
|
'Sleep Animation
|
||||||
SleepAnimation.AnimationMove(SleepEntity1, True, 0, 0.5, 0.25, 0.01, False, False, 0, 0)
|
If Core.Player.ShowBattleAnimations <> 0 AndAlso BattleScreen.IsPVPBattle = False Then
|
||||||
|
Dim SleepAnimation As New AnimationQueryObject(pNPC, Not own)
|
||||||
|
|
||||||
Dim SleepEntity2 As Entity = SleepAnimation.SpawnEntity(New Vector3(0, 0.25, 0), TextureManager.GetTexture("Textures\Battle\StatusEffect\Asleep", New Rectangle(0, 0, 16, 16), ""), New Vector3(0.5F), 1, 1.5, 1)
|
SleepAnimation.AnimationPlaySound("Battle\Effects\Asleep", 0, 0)
|
||||||
|
Dim SleepEntity1 As Entity = SleepAnimation.SpawnEntity(New Vector3(0, 0.25, 0), TextureManager.GetTexture("Textures\Battle\StatusEffect\Asleep", New Rectangle(0, 0, 16, 16), ""), New Vector3(0.5F), 1, 0, 1)
|
||||||
|
SleepAnimation.AnimationChangeTexture(SleepEntity1, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Asleep", New Rectangle(0, 16, 16, 16), ""), 1, 1)
|
||||||
|
SleepAnimation.AnimationMove(SleepEntity1, True, 0, 0.5, 0.25, 0.01, False, False, 0, 0)
|
||||||
|
|
||||||
SleepAnimation.AnimationChangeTexture(SleepEntity2, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Asleep", New Rectangle(0, 16, 16, 16), ""), 2.5, 1)
|
Dim SleepEntity2 As Entity = SleepAnimation.SpawnEntity(New Vector3(0, 0.25, 0), TextureManager.GetTexture("Textures\Battle\StatusEffect\Asleep", New Rectangle(0, 0, 16, 16), ""), New Vector3(0.5F), 1, 1.5, 1)
|
||||||
SleepAnimation.AnimationMove(SleepEntity2, True, 0, 0.5, 0.25, 0.01, False, False, 2, 0)
|
|
||||||
|
|
||||||
BattleScreen.BattleQuery.Add(SleepAnimation)
|
SleepAnimation.AnimationChangeTexture(SleepEntity2, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Asleep", New Rectangle(0, 16, 16, 16), ""), 2.5, 1)
|
||||||
|
SleepAnimation.AnimationMove(SleepEntity2, True, 0, 0.5, 0.25, 0.01, False, False, 2, 0)
|
||||||
|
|
||||||
|
BattleScreen.BattleQuery.Add(SleepAnimation)
|
||||||
|
Else
|
||||||
|
BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("Battle\Effects\Asleep", False))
|
||||||
|
End If
|
||||||
|
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " is fast asleep."))
|
||||||
|
Exit Sub
|
||||||
Else
|
Else
|
||||||
BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("Battle\Effects\Asleep", False))
|
CureStatusProblem(own, own, BattleScreen, p.GetDisplayName() & " woke up!", "sleepturns")
|
||||||
End If
|
End If
|
||||||
BattleScreen.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " is fast asleep."))
|
|
||||||
Exit Sub
|
|
||||||
Else
|
|
||||||
CureStatusProblem(own, own, BattleScreen, p.GetDisplayName() & " woke up!", "sleepturns")
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user