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 stopMusic 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)
Me.Scale = New Vector3(1.0F)
soundfile = sound
Me.Visible = False
Me.stopMusic = stopMusic
Me.IsPokemon = IsPokemon
Me.CrySuffix = CrySuffix
AnimationType = AnimationTypes.Sound
End Sub
Public Overrides Sub DoActionActive()
If IsPokemon = True Then
SoundManager.PlayPokemonCry(CInt(soundfile))
SoundManager.PlayPokemonCry(CInt(soundfile), Me.CrySuffix)
Else
SoundManager.PlaySound(soundfile, stopMusic)
End If

View File

@ -2825,8 +2825,9 @@
If BattleScreen.IsTrainerBattle = False AndAlso Core.Player.ShowBattleAnimations <> 0 AndAlso BattleScreen.IsPVPBattle = False Then
If own = False Then
Dim crySuffixOpp As String = PokemonForms.GetCrySuffix(BattleScreen.OppPokemon)
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)
BattleScreen.BattleQuery.Add(FaintAnimation)
End If
@ -7623,12 +7624,12 @@
Threading.Interlocked.Increment(SmokeSpawned)
Loop While SmokeSpawned <= 38
End If
Dim crySuffixOwn As String = PokemonForms.GetCrySuffix(BattleScreen.OwnPokemon)
If Core.Player.ShowBattleAnimations <> 0 AndAlso BattleScreen.IsPVPBattle = False Then
' Pokemon appears
BallThrow.AnimationSetPosition(Nothing, False, 12, CSng(0.5), 13, 0, 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
BallThrow.AnimationMove(Nothing, False, 0, -0.5F + PositionOffsetY, 0, 0.05F, False, False, 5, 0,,,, 3)
@ -8068,11 +8069,11 @@
Else
BattleScreen.Battle.ChangeCameraAngle(1, False, BattleScreen)
End If
Dim crySuffixOpp As String = PokemonForms.GetCrySuffix(BattleScreen.OppPokemon)
If Core.Player.ShowBattleAnimations <> 0 AndAlso BattleScreen.IsPVPBattle = False Then
' Pokemon appears
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
BallThrow.AnimationMove(Nothing, False, 0, -0.5F, 0, 0.05F, False, False, 5, 0)
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)
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
q1 = New PlaySoundQueryObject("Battle\shiny", False, 5.0F)
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)
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() & "!")
Me.BattleQuery.AddRange({cq, q1, q, q2, q22, q3, q31, q4})
@ -462,7 +464,7 @@
' Ball is thrown
Dim BallThrowOpp As AnimationQueryObject = New AnimationQueryObject(OppPokemonNPC, False)
Dim crySuffixOpp As String = PokemonForms.GetCrySuffix(OppPokemon)
If Core.Player.ShowBattleAnimations <> 0 AndAlso IsPVPBattle = False Then
BallThrowOpp.AnimationPlaySound("Battle\Pokeball\Throw", 0, 0)
BallThrowOpp.AnimationSetPosition(Nothing, False, 15, CSng(0.5 + OppEntityOffsetY), 13, 0, 0)
@ -488,9 +490,9 @@
' Pokemon appears
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
BallThrowOpp.AnimationPlaySound(CStr(Me.OppPokemon.Number), 0, 0,, True)
BallThrowOpp.AnimationPlaySound(CStr(Me.OppPokemon.Number), 0, 0,, True, crySuffixOpp)
End If
@ -500,17 +502,18 @@
BallThrowOpp.AnimationMove(Nothing, False, 0, -0.5F, 0, 0.05F, False, False, 4, 0,,,, 3)
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 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
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() & "!")
Me.BattleQuery.AddRange({cq, q, q1, q11, BallThrowOpp, q2, q3, q31, q4})
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
Dim BallThrowOwn As AnimationQueryObject = New AnimationQueryObject(Me.OwnPokemonNPC, False)
@ -541,11 +544,14 @@
' Pokemon appears
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
BallThrowOwn.AnimationMove(Nothing, False, 0, -0.5F, 0, 0.05F, False, False, 5, 0,,,, 3)
Me.BattleQuery.Add(BallThrowOwn)
Else
Me.BattleQuery.AddRange({cq, q, q1, q11, BallThrowOpp, q2, q3, q31, q4})
End If
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)
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 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)
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 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)
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() & "!")
Me.BattleQuery.AddRange({cq, q1, q, q2, q22, q3, q4})

View File

@ -321,8 +321,8 @@ Namespace BattleSystem
AnimationSequence.Add(baEntityScale)
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)
Dim baSound As BAPlaySound = New BAPlaySound(sound, startDelay, endDelay, stopMusic, IsPokemon)
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, CrySuffix)
AnimationSequence.Add(baSound)
End Sub

View File

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