Pokémon forms play the right cry in battle now

This commit is contained in:
JappaWakka 2023-11-04 15:16:25 +01:00
parent 6d83167a8d
commit 1e16a5dcc4
5 changed files with 40 additions and 26 deletions

View File

@ -5,22 +5,24 @@
Private soundfile As String Private soundfile As String
Private stopMusic As Boolean Private stopMusic As Boolean
Private IsPokemon As Boolean Private IsPokemon As Boolean
Private CrySuffix As String = ""
Public Sub New(ByVal sound As String, ByVal startDelay As Single, ByVal endDelay As Single, Optional ByVal stopMusic As Boolean = False, Optional ByVal IsPokemon As Boolean = False) Public Sub New(ByVal sound As String, ByVal startDelay As Single, ByVal endDelay As Single, Optional ByVal stopMusic As Boolean = False, Optional ByVal IsPokemon As Boolean = False, Optional ByVal CrySuffix As String = "")
MyBase.New(New Vector3(0.0F), TextureManager.DefaultTexture, New Vector3(1.0F), startDelay, endDelay) MyBase.New(New Vector3(0.0F), TextureManager.DefaultTexture, New Vector3(1.0F), startDelay, endDelay)
Me.Scale = New Vector3(1.0F) Me.Scale = New Vector3(1.0F)
soundfile = sound soundfile = sound
Me.Visible = False Me.Visible = False
Me.stopMusic = stopMusic Me.stopMusic = stopMusic
Me.IsPokemon = IsPokemon Me.IsPokemon = IsPokemon
Me.CrySuffix = CrySuffix
AnimationType = AnimationTypes.Sound AnimationType = AnimationTypes.Sound
End Sub End Sub
Public Overrides Sub DoActionActive() Public Overrides Sub DoActionActive()
If IsPokemon = True Then If IsPokemon = True Then
SoundManager.PlayPokemonCry(CInt(soundfile)) SoundManager.PlayPokemonCry(CInt(soundfile), Me.CrySuffix)
Else Else
SoundManager.PlaySound(soundfile, stopMusic) SoundManager.PlaySound(soundfile, stopMusic)
End If End If

View File

@ -2825,8 +2825,9 @@
If BattleScreen.IsTrainerBattle = False AndAlso Core.Player.ShowBattleAnimations <> 0 AndAlso BattleScreen.IsPVPBattle = False Then If BattleScreen.IsTrainerBattle = False AndAlso Core.Player.ShowBattleAnimations <> 0 AndAlso BattleScreen.IsPVPBattle = False Then
If own = False Then If own = False Then
Dim crySuffixOpp As String = PokemonForms.GetCrySuffix(BattleScreen.OppPokemon)
Dim FaintAnimation As AnimationQueryObject = New AnimationQueryObject(BattleScreen.OppPokemonNPC, True) Dim FaintAnimation As AnimationQueryObject = New AnimationQueryObject(BattleScreen.OppPokemonNPC, True)
FaintAnimation.AnimationPlaySound(CStr(BattleScreen.OppPokemon.Number), 0, 2, False, True) FaintAnimation.AnimationPlaySound(CStr(BattleScreen.OppPokemon.Number), 0, 2, False, True, crySuffixOpp)
FaintAnimation.AnimationMove(Nothing, False, 0, -1, 0, 0.05, False, False, 2, 2) FaintAnimation.AnimationMove(Nothing, False, 0, -1, 0, 0.05, False, False, 2, 2)
BattleScreen.BattleQuery.Add(FaintAnimation) BattleScreen.BattleQuery.Add(FaintAnimation)
End If End If
@ -7623,12 +7624,12 @@
Threading.Interlocked.Increment(SmokeSpawned) Threading.Interlocked.Increment(SmokeSpawned)
Loop While SmokeSpawned <= 38 Loop While SmokeSpawned <= 38
End If End If
Dim crySuffixOwn As String = PokemonForms.GetCrySuffix(BattleScreen.OwnPokemon)
If Core.Player.ShowBattleAnimations <> 0 AndAlso BattleScreen.IsPVPBattle = False Then If Core.Player.ShowBattleAnimations <> 0 AndAlso BattleScreen.IsPVPBattle = False Then
' Pokemon appears ' Pokemon appears
BallThrow.AnimationSetPosition(Nothing, False, 12, CSng(0.5), 13, 0, 0) BallThrow.AnimationSetPosition(Nothing, False, 12, CSng(0.5), 13, 0, 0)
BallThrow.AnimationFade(Nothing, False, 1, True, 1, 3, 0) BallThrow.AnimationFade(Nothing, False, 1, True, 1, 3, 0)
BallThrow.AnimationPlaySound(CStr(BattleScreen.OwnPokemon.Number), 4, 0,, True) BallThrow.AnimationPlaySound(CStr(BattleScreen.OwnPokemon.Number), 4, 0,, True, crySuffixOwn)
' Pokémon falls down ' Pokémon falls down
BallThrow.AnimationMove(Nothing, False, 0, -0.5F + PositionOffsetY, 0, 0.05F, False, False, 5, 0,,,, 3) BallThrow.AnimationMove(Nothing, False, 0, -0.5F + PositionOffsetY, 0, 0.05F, False, False, 5, 0,,,, 3)
@ -8068,11 +8069,11 @@
Else Else
BattleScreen.Battle.ChangeCameraAngle(1, False, BattleScreen) BattleScreen.Battle.ChangeCameraAngle(1, False, BattleScreen)
End If End If
Dim crySuffixOpp As String = PokemonForms.GetCrySuffix(BattleScreen.OppPokemon)
If Core.Player.ShowBattleAnimations <> 0 AndAlso BattleScreen.IsPVPBattle = False Then If Core.Player.ShowBattleAnimations <> 0 AndAlso BattleScreen.IsPVPBattle = False Then
' Pokemon appears ' Pokemon appears
BallThrow.AnimationFade(Nothing, False, 1, True, 1, 3, 0) BallThrow.AnimationFade(Nothing, False, 1, True, 1, 3, 0)
BallThrow.AnimationPlaySound(CStr(BattleScreen.OppPokemon.Number), 4, 0,, True) BallThrow.AnimationPlaySound(CStr(BattleScreen.OppPokemon.Number), 4, 0,, True, crySuffixOpp)
' Pokémon falls down ' Pokémon falls down
BallThrow.AnimationMove(Nothing, False, 0, -0.5F, 0, 0.05F, False, False, 5, 0) BallThrow.AnimationMove(Nothing, False, 0, -0.5F, 0, 0.05F, False, False, 5, 0)
BattleScreen.BattleQuery.Add(BallThrow) BattleScreen.BattleQuery.Add(BallThrow)

View File

@ -279,7 +279,8 @@
Dim q As CameraQueryObject = New CameraQueryObject(New Vector3(13, 0, 15), New Vector3(21, 0, 15), 0.05F, 0.05F, -0.8F, 1.4F, 0.0F, 0.0F, 0.016F, 0.016F) Dim q As CameraQueryObject = New CameraQueryObject(New Vector3(13, 0, 15), New Vector3(21, 0, 15), 0.05F, 0.05F, -0.8F, 1.4F, 0.0F, 0.0F, 0.016F, 0.016F)
q.PassThis = True q.PassThis = True
Dim q1 As New PlaySoundQueryObject(OppPokemon.Number.ToString(), True, 5.0F) Dim crySuffixOpp As String = PokemonForms.GetCrySuffix(OppPokemon)
Dim q1 As New PlaySoundQueryObject(OppPokemon.Number.ToString(), True, 5.0F, crySuffixOpp)
If OppPokemon.IsShiny = True Then If OppPokemon.IsShiny = True Then
q1 = New PlaySoundQueryObject("Battle\shiny", False, 5.0F) q1 = New PlaySoundQueryObject("Battle\shiny", False, 5.0F)
End If End If
@ -291,7 +292,8 @@
Dim q3 As CameraQueryObject = New CameraQueryObject(New Vector3(14, 0, 11), New Vector3(14, 0, 15), 0.01F, 0.01F, MathHelper.PiOver2, MathHelper.PiOver2, 0.0F, 0.0F) Dim q3 As CameraQueryObject = New CameraQueryObject(New Vector3(14, 0, 11), New Vector3(14, 0, 15), 0.01F, 0.01F, MathHelper.PiOver2, MathHelper.PiOver2, 0.0F, 0.0F)
q3.PassThis = True q3.PassThis = True
Dim q31 As New PlaySoundQueryObject(OwnPokemon.Number.ToString(), True, 3.0F) Dim crySuffixOwn As String = PokemonForms.GetCrySuffix(OwnPokemon)
Dim q31 As New PlaySoundQueryObject(OwnPokemon.Number.ToString(), True, 3.0F, crySuffixOwn)
Dim q4 As TextQueryObject = New TextQueryObject("Go, " & Me.OwnPokemon.GetDisplayName() & "!") Dim q4 As TextQueryObject = New TextQueryObject("Go, " & Me.OwnPokemon.GetDisplayName() & "!")
Me.BattleQuery.AddRange({cq, q1, q, q2, q22, q3, q31, q4}) Me.BattleQuery.AddRange({cq, q1, q, q2, q22, q3, q31, q4})
@ -462,7 +464,7 @@
' Ball is thrown ' Ball is thrown
Dim BallThrowOpp As AnimationQueryObject = New AnimationQueryObject(OppPokemonNPC, False) Dim BallThrowOpp As AnimationQueryObject = New AnimationQueryObject(OppPokemonNPC, False)
Dim crySuffixOpp As String = PokemonForms.GetCrySuffix(OppPokemon)
If Core.Player.ShowBattleAnimations <> 0 AndAlso IsPVPBattle = False Then If Core.Player.ShowBattleAnimations <> 0 AndAlso IsPVPBattle = False Then
BallThrowOpp.AnimationPlaySound("Battle\Pokeball\Throw", 0, 0) BallThrowOpp.AnimationPlaySound("Battle\Pokeball\Throw", 0, 0)
BallThrowOpp.AnimationSetPosition(Nothing, False, 15, CSng(0.5 + OppEntityOffsetY), 13, 0, 0) BallThrowOpp.AnimationSetPosition(Nothing, False, 15, CSng(0.5 + OppEntityOffsetY), 13, 0, 0)
@ -488,9 +490,9 @@
' Pokemon appears ' Pokemon appears
BallThrowOpp.AnimationFade(Nothing, False, 1, True, 1, 3, 0) BallThrowOpp.AnimationFade(Nothing, False, 1, True, 1, 3, 0)
BallThrowOpp.AnimationPlaySound(CStr(Me.OppPokemon.Number), 4, 0,, True) BallThrowOpp.AnimationPlaySound(CStr(Me.OppPokemon.Number), 4, 0,, True, crySuffixOpp)
Else Else
BallThrowOpp.AnimationPlaySound(CStr(Me.OppPokemon.Number), 0, 0,, True) BallThrowOpp.AnimationPlaySound(CStr(Me.OppPokemon.Number), 0, 0,, True, crySuffixOpp)
End If End If
@ -500,17 +502,18 @@
BallThrowOpp.AnimationMove(Nothing, False, 0, -0.5F, 0, 0.05F, False, False, 4, 0,,,, 3) BallThrowOpp.AnimationMove(Nothing, False, 0, -0.5F, 0, 0.05F, False, False, 4, 0,,,, 3)
End If End If
Dim crySuffixOwn As String = PokemonForms.GetCrySuffix(OwnPokemon)
Dim q2 As CameraQueryObject = New CameraQueryObject(New Vector3(14, 0, 15), New Vector3(13, 0, 15), 0.05F, 0.05F, MathHelper.PiOver2, -0.8F, 0.0F, 0.0F, 0.05F, 0.05F) Dim q2 As CameraQueryObject = New CameraQueryObject(New Vector3(14, 0, 15), New Vector3(13, 0, 15), 0.05F, 0.05F, MathHelper.PiOver2, -0.8F, 0.0F, 0.0F, 0.05F, 0.05F)
Dim q3 As CameraQueryObject = New CameraQueryObject(New Vector3(14, 0, 11), New Vector3(14, 0, 15), 0.01F, 0.01F, MathHelper.PiOver2, MathHelper.PiOver2, 0.0F, 0.0F) Dim q3 As CameraQueryObject = New CameraQueryObject(New Vector3(14, 0, 11), New Vector3(14, 0, 15), 0.01F, 0.01F, MathHelper.PiOver2, MathHelper.PiOver2, 0.0F, 0.0F)
q3.PassThis = True q3.PassThis = True
Dim q31 As New PlaySoundQueryObject(OwnPokemon.Number.ToString(), True, 3.0F)
Dim q31 As New PlaySoundQueryObject(OwnPokemon.Number.ToString(), True, 3.0F, crySuffixOwn)
Dim q4 As TextQueryObject = New TextQueryObject("Go," & " " & Me.OwnPokemon.GetDisplayName() & "!") Dim q4 As TextQueryObject = New TextQueryObject("Go," & " " & Me.OwnPokemon.GetDisplayName() & "!")
Me.BattleQuery.AddRange({cq, q, q1, q11, BallThrowOpp, q2, q3, q31, q4})
If IsPVPBattle = True AndAlso Core.Player.ShowBattleAnimations <> 0 AndAlso IsPVPBattle = False Then If IsPVPBattle = True AndAlso Core.Player.ShowBattleAnimations <> 0 AndAlso IsPVPBattle = False Then
Me.BattleQuery.AddRange({cq, q, q1, q11, BallThrowOpp, q2, q3, q4})
' Ball is thrown ' Ball is thrown
Dim BallThrowOwn As AnimationQueryObject = New AnimationQueryObject(Me.OwnPokemonNPC, False) Dim BallThrowOwn As AnimationQueryObject = New AnimationQueryObject(Me.OwnPokemonNPC, False)
@ -541,11 +544,14 @@
' Pokemon appears ' Pokemon appears
BallThrowOwn.AnimationFade(Nothing, False, 1, True, 1, 3, 0) BallThrowOwn.AnimationFade(Nothing, False, 1, True, 1, 3, 0)
BallThrowOwn.AnimationPlaySound(CStr(Me.OwnPokemon.Number), 4, 0,, True) BallThrowOwn.AnimationPlaySound(CStr(Me.OwnPokemon.Number), 4, 0,, True, crySuffixOwn)
' Pokémon falls down ' Pokémon falls down
BallThrowOwn.AnimationMove(Nothing, False, 0, -0.5F, 0, 0.05F, False, False, 5, 0,,,, 3) BallThrowOwn.AnimationMove(Nothing, False, 0, -0.5F, 0, 0.05F, False, False, 5, 0,,,, 3)
Me.BattleQuery.Add(BallThrowOwn) Me.BattleQuery.Add(BallThrowOwn)
Else
Me.BattleQuery.AddRange({cq, q, q1, q11, BallThrowOpp, q2, q3, q31, q4})
End If End If
Dim q5 As ToggleMenuQueryObject = New ToggleMenuQueryObject(Me.BattleMenu.Visible) Dim q5 As ToggleMenuQueryObject = New ToggleMenuQueryObject(Me.BattleMenu.Visible)
@ -681,7 +687,8 @@
Dim q As CameraQueryObject = New CameraQueryObject(New Vector3(13, 0, 15), New Vector3(21, 0, 15), 0.05F, 0.05F, -0.8F, 1.4F, 0.0F, 0.0F, 0.016F, 0.016F) Dim q As CameraQueryObject = New CameraQueryObject(New Vector3(13, 0, 15), New Vector3(21, 0, 15), 0.05F, 0.05F, -0.8F, 1.4F, 0.0F, 0.0F, 0.016F, 0.016F)
q.PassThis = True q.PassThis = True
Dim q1 As New PlaySoundQueryObject(OppPokemon.Number.ToString(), True, 5.0F) Dim crySuffixOpp As String = PokemonForms.GetCrySuffix(OppPokemon)
Dim q1 As New PlaySoundQueryObject(OppPokemon.Number.ToString(), True, 5.0F, crySuffixOpp)
Dim q2 As TextQueryObject = New TextQueryObject("Wild " & OppPokemon.GetDisplayName() & " appeared!") Dim q2 As TextQueryObject = New TextQueryObject("Wild " & OppPokemon.GetDisplayName() & " appeared!")
Dim q5 As ToggleMenuQueryObject = New ToggleMenuQueryObject(Me.BattleMenu.Visible) Dim q5 As ToggleMenuQueryObject = New ToggleMenuQueryObject(Me.BattleMenu.Visible)
@ -803,7 +810,8 @@
Dim q As CameraQueryObject = New CameraQueryObject(New Vector3(13, 0, 15), New Vector3(21, 0, 15), 0.05F, 0.05F, -0.8F, 1.4F, 0.0F, 0.0F, 0.016F, 0.016F) Dim q As CameraQueryObject = New CameraQueryObject(New Vector3(13, 0, 15), New Vector3(21, 0, 15), 0.05F, 0.05F, -0.8F, 1.4F, 0.0F, 0.0F, 0.016F, 0.016F)
q.PassThis = True q.PassThis = True
Dim q1 As New PlaySoundQueryObject(OppPokemon.Number.ToString(), True, 5.0F) Dim crySuffixOpp As String = PokemonForms.GetCrySuffix(OppPokemon)
Dim q1 As New PlaySoundQueryObject(OppPokemon.Number.ToString(), True, 5.0F, crySuffixOpp)
Dim q2 As TextQueryObject = New TextQueryObject("Wild " & OppPokemon.GetDisplayName() & " appeared!") Dim q2 As TextQueryObject = New TextQueryObject("Wild " & OppPokemon.GetDisplayName() & " appeared!")
Dim q22 As CameraQueryObject = New CameraQueryObject(New Vector3(14, 0, 15), New Vector3(13, 0, 15), 0.05F, 0.05F, MathHelper.PiOver2, -0.8F, 0.0F, 0.0F, 0.05F, 0.05F) Dim q22 As CameraQueryObject = New CameraQueryObject(New Vector3(14, 0, 15), New Vector3(13, 0, 15), 0.05F, 0.05F, MathHelper.PiOver2, -0.8F, 0.0F, 0.0F, 0.05F, 0.05F)
@ -811,7 +819,8 @@
Dim q3 As CameraQueryObject = New CameraQueryObject(New Vector3(14, 0, 11), New Vector3(14, 0, 15), 0.01F, 0.01F, MathHelper.PiOver2, MathHelper.PiOver2, 0.0F, 0.0F) Dim q3 As CameraQueryObject = New CameraQueryObject(New Vector3(14, 0, 11), New Vector3(14, 0, 15), 0.01F, 0.01F, MathHelper.PiOver2, MathHelper.PiOver2, 0.0F, 0.0F)
q3.PassThis = True q3.PassThis = True
Dim q31 As New PlaySoundQueryObject(OwnPokemon.Number.ToString(), True, 3.0F) Dim crySuffixOwn As String = PokemonForms.GetCrySuffix(OwnPokemon)
Dim q31 As New PlaySoundQueryObject(OwnPokemon.Number.ToString(), True, 3.0F, crySuffixOwn)
Dim q4 As TextQueryObject = New TextQueryObject("Go, " & Me.OwnPokemon.GetDisplayName() & "!") Dim q4 As TextQueryObject = New TextQueryObject("Go, " & Me.OwnPokemon.GetDisplayName() & "!")
Me.BattleQuery.AddRange({cq, q1, q, q2, q22, q3, q4}) Me.BattleQuery.AddRange({cq, q1, q, q2, q22, q3, q4})

View File

@ -321,8 +321,8 @@ Namespace BattleSystem
AnimationSequence.Add(baEntityScale) AnimationSequence.Add(baEntityScale)
End Sub End Sub
Public Sub AnimationPlaySound(ByVal sound As String, ByVal startDelay As Single, ByVal endDelay As Single, Optional ByVal stopMusic As Boolean = False, Optional ByVal IsPokemon As Boolean = False) Public Sub AnimationPlaySound(ByVal sound As String, ByVal startDelay As Single, ByVal endDelay As Single, Optional ByVal stopMusic As Boolean = False, Optional ByVal IsPokemon As Boolean = False, Optional ByVal CrySuffix As String = "")
Dim baSound As BAPlaySound = New BAPlaySound(sound, startDelay, endDelay, stopMusic, IsPokemon) Dim baSound As BAPlaySound = New BAPlaySound(sound, startDelay, endDelay, stopMusic, IsPokemon, CrySuffix)
AnimationSequence.Add(baSound) AnimationSequence.Add(baSound)
End Sub End Sub

View File

@ -6,17 +6,19 @@
Dim _sound As String = "" Dim _sound As String = ""
Dim _isPokemonSound As Boolean = False Dim _isPokemonSound As Boolean = False
Dim _crySuffix As String = ""
Dim _delay As Single = 0.0F Dim _delay As Single = 0.0F
Public Sub New(ByVal sound As String, ByVal isPokemonSound As Boolean) Public Sub New(ByVal sound As String, ByVal isPokemonSound As Boolean, Optional ByVal CrySuffix As String = "")
Me.New(sound, isPokemonSound, 0.0F) Me.New(sound, isPokemonSound, 0.0F, CrySuffix)
End Sub End Sub
Public Sub New(ByVal sound As String, ByVal isPokemonSound As Boolean, ByVal delay As Single) Public Sub New(ByVal sound As String, ByVal isPokemonSound As Boolean, ByVal delay As Single, Optional ByVal CrySuffix As String = "")
MyBase.New(QueryTypes.PlaySound) MyBase.New(QueryTypes.PlaySound)
Me._sound = sound Me._sound = sound
Me._isPokemonSound = isPokemonSound Me._isPokemonSound = isPokemonSound
Me._crySuffix = CrySuffix
Me._delay = delay Me._delay = delay
Me.PassThis = True Me.PassThis = True
End Sub End Sub
@ -34,7 +36,7 @@
Private Sub InternalPlaySound() Private Sub InternalPlaySound()
If _isPokemonSound = True Then If _isPokemonSound = True Then
SoundManager.PlayPokemonCry(CInt(_sound)) SoundManager.PlayPokemonCry(CInt(_sound), _crySuffix)
Else Else
SoundManager.PlaySound(Me._sound, False) SoundManager.PlaySound(Me._sound, False)
End If End If