From 3bdc124a997e34e94505b042f0a18f4b0c08e8a0 Mon Sep 17 00:00:00 2001 From: JappaWakkaP3D <31563291+JappaWakka@users.noreply.github.com> Date: Fri, 26 Nov 2021 21:56:38 +0100 Subject: [PATCH] Bugfixes & Tweaks * Growl displays correctly now * The sound played with stat change animations is now timed correctly * Stat change particles now fall straight down as intended * Fixed incorrect texture for Confusion * Stat Down texture is now blue and Stat Up texture is now orange/yellow --- P3D/Battle/BattleSystemV2/Battle.vb | 82 +++++++++--------- .../QueryObjects/AnimationQueryObject.vb | 12 ++- .../Textures/Battle/StatChange/statDown.png | Bin 234 -> 241 bytes .../Textures/Battle/StatChange/statUp.png | Bin 241 -> 234 bytes P3D/Pokemon/Attacks/Normal/Growl.vb | 8 +- 5 files changed, 55 insertions(+), 47 deletions(-) diff --git a/P3D/Battle/BattleSystemV2/Battle.vb b/P3D/Battle/BattleSystemV2/Battle.vb index 84eb2270d..b1f6a348f 100644 --- a/P3D/Battle/BattleSystemV2/Battle.vb +++ b/P3D/Battle/BattleSystemV2/Battle.vb @@ -3348,41 +3348,37 @@ Dim ConfusionAnimation As New AnimationQueryObject(pNPC, Not own) ConfusionAnimation.AnimationPlaySound("Battle\Effects\Confused", 0, 0) - Dim DuckEntity1 As Entity = ConfusionAnimation.SpawnEntity(New Vector3(-0.25, 0.25, -0.25), TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 0, 16, 16), ""), New Vector3(0.5F), 1, 0, 1) - Dim DuckEntity2 As Entity = ConfusionAnimation.SpawnEntity(New Vector3(0.25, 0.25, 0.25), TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 0, 16, 16), ""), New Vector3(0.5F), 1, 0, 1) - Dim DuckEntity3 As Entity = ConfusionAnimation.SpawnEntity(New Vector3(0.25, 0.25, -0.25), TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 0, 16, 16), ""), New Vector3(0.5F), 1, 0, 1) + Dim DuckEntity1 As Entity = ConfusionAnimation.SpawnEntity(New Vector3(-0.25, 0.25, -0.25), TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 0, 16, 16), ""), New Vector3(0.5F), 1, 0, 0.5) + Dim DuckEntity2 As Entity = ConfusionAnimation.SpawnEntity(New Vector3(0.25, 0.25, 0.25), TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 0, 16, 16), ""), New Vector3(0.5F), 1, 0, 0.5) + Dim DuckEntity3 As Entity = ConfusionAnimation.SpawnEntity(New Vector3(0.25, 0.25, -0.25), TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 0, 16, 16), ""), New Vector3(0.5F), 1, 0, 0.5) - ConfusionAnimation.AnimationChangeTexture(DuckEntity1, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 16, 16, 16), ""), 0.5, 1) - ConfusionAnimation.AnimationChangeTexture(DuckEntity2, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 16, 16, 16), ""), 0.5, 1) - ConfusionAnimation.AnimationChangeTexture(DuckEntity3, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 16, 16, 16), ""), 0.5, 1) + ConfusionAnimation.AnimationChangeTexture(DuckEntity1, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 16, 16, 16), ""), 0.5, 0.5) + ConfusionAnimation.AnimationChangeTexture(DuckEntity2, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 16, 16, 16), ""), 0.5, 0.5) + ConfusionAnimation.AnimationChangeTexture(DuckEntity3, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 16, 16, 16), ""), 0.5, 0.5) - ConfusionAnimation.AnimationChangeTexture(DuckEntity1, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 32, 16, 16), ""), 1.5F, 1) - ConfusionAnimation.AnimationChangeTexture(DuckEntity2, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 32, 16, 16), ""), 1.5F, 1) - ConfusionAnimation.AnimationChangeTexture(DuckEntity3, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 32, 16, 16), ""), 1.5F, 1) + ConfusionAnimation.AnimationChangeTexture(DuckEntity1, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 32, 16, 16), ""), 1.5F, 0.5) + ConfusionAnimation.AnimationChangeTexture(DuckEntity2, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 32, 16, 16), ""), 1.5F, 0.5) + ConfusionAnimation.AnimationChangeTexture(DuckEntity3, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 32, 16, 16), ""), 1.5F, 0.5) - ConfusionAnimation.AnimationChangeTexture(DuckEntity1, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 48, 16, 16), ""), 1.5F, 1) - ConfusionAnimation.AnimationChangeTexture(DuckEntity2, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 48, 16, 16), ""), 1.5F, 1) - ConfusionAnimation.AnimationChangeTexture(DuckEntity3, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 48, 16, 16), ""), 1.5F, 1) + ConfusionAnimation.AnimationChangeTexture(DuckEntity1, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 48, 16, 16), ""), 1.5F, 0.5) + ConfusionAnimation.AnimationChangeTexture(DuckEntity2, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 48, 16, 16), ""), 1.5F, 0.5) + ConfusionAnimation.AnimationChangeTexture(DuckEntity3, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 48, 16, 16), ""), 1.5F, 0.5) - ConfusionAnimation.AnimationChangeTexture(DuckEntity1, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 64, 16, 16), ""), 2, 1) - ConfusionAnimation.AnimationChangeTexture(DuckEntity2, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 64, 16, 16), ""), 2, 1) - ConfusionAnimation.AnimationChangeTexture(DuckEntity3, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 64, 16, 16), ""), 2, 1) + ConfusionAnimation.AnimationChangeTexture(DuckEntity1, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 0, 16, 16), ""), 2.0F, 0.5) + ConfusionAnimation.AnimationChangeTexture(DuckEntity2, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 0, 16, 16), ""), 2.0F, 0.5) + ConfusionAnimation.AnimationChangeTexture(DuckEntity3, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 0, 16, 16), ""), 2.0F, 0.5) - ConfusionAnimation.AnimationChangeTexture(DuckEntity1, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 16, 16, 16), ""), 2.5F, 1) - ConfusionAnimation.AnimationChangeTexture(DuckEntity2, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 16, 16, 16), ""), 2.5F, 1) - ConfusionAnimation.AnimationChangeTexture(DuckEntity3, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 16, 16, 16), ""), 2.5F, 1) + ConfusionAnimation.AnimationChangeTexture(DuckEntity1, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 16, 16, 16), ""), 2.5F, 0.5) + ConfusionAnimation.AnimationChangeTexture(DuckEntity2, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 16, 16, 16), ""), 2.5F, 0.5) + ConfusionAnimation.AnimationChangeTexture(DuckEntity3, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 16, 16, 16), ""), 2.5F, 0.5) - ConfusionAnimation.AnimationChangeTexture(DuckEntity1, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 32, 16, 16), ""), 3, 1) - ConfusionAnimation.AnimationChangeTexture(DuckEntity2, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 32, 16, 16), ""), 3, 1) - ConfusionAnimation.AnimationChangeTexture(DuckEntity3, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 32, 16, 16), ""), 3, 1) + ConfusionAnimation.AnimationChangeTexture(DuckEntity1, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 32, 16, 16), ""), 3, 0.5) + ConfusionAnimation.AnimationChangeTexture(DuckEntity2, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 32, 16, 16), ""), 3, 0.5) + ConfusionAnimation.AnimationChangeTexture(DuckEntity3, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 32, 16, 16), ""), 3, 0.5) - ConfusionAnimation.AnimationChangeTexture(DuckEntity1, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 48, 16, 16), ""), 3.5F, 1) - ConfusionAnimation.AnimationChangeTexture(DuckEntity2, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 48, 16, 16), ""), 3.5F, 1) - ConfusionAnimation.AnimationChangeTexture(DuckEntity3, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 48, 16, 16), ""), 3.5F, 1) - - ConfusionAnimation.AnimationChangeTexture(DuckEntity1, True, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 64, 16, 16), ""), 4, 1) - ConfusionAnimation.AnimationChangeTexture(DuckEntity2, True, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 64, 16, 16), ""), 4, 1) - ConfusionAnimation.AnimationChangeTexture(DuckEntity3, True, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 64, 16, 16), ""), 4, 1) + ConfusionAnimation.AnimationChangeTexture(DuckEntity1, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 48, 16, 16), ""), 3.5F, 0.5) + ConfusionAnimation.AnimationChangeTexture(DuckEntity2, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 48, 16, 16), ""), 3.5F, 0.5) + ConfusionAnimation.AnimationChangeTexture(DuckEntity3, False, TextureManager.GetTexture("Textures\Battle\StatusEffect\Confused", New Rectangle(0, 48, 16, 16), ""), 3.5F, 0.5) BattleScreen.BattleQuery.Add(ConfusionAnimation) End If @@ -3533,7 +3529,7 @@ '***STAT INCREASE ANIMATION*** If Core.Player.ShowBattleAnimations <> 0 Then - Dim StatAnimation As AnimationQueryObject = New AnimationQueryObject(pNPC, Not own) + Dim StatAnimation As AnimationQueryObject = New AnimationQueryObject(Nothing, Not own) Dim maxAmount As Integer = 20 * val Dim currentAmount As Integer = 0 While currentAmount <= maxAmount @@ -3542,19 +3538,19 @@ Dim zPos = CSng((Random.NextDouble() - 0.5) * 1.2) Dim Position As New Vector3(xPos, -0.4, zPos) - Dim Destination As New Vector3(xPos, 0.8, zPos) + Dim Destination As New Vector3(xPos, 1.2, zPos) Dim Scale As New Vector3(0.2F) Dim startDelay As Double = 5.0 * Random.NextDouble() - Dim StatEntity As Entity = StatAnimation.SpawnEntity(Position, Texture, Scale, 1.0F, CSng(startDelay)) - + Dim StatEntity As Entity = StatAnimation.SpawnEntity(pNPC.Position + Position, Texture, Scale, 1.0F, CSng(startDelay)) StatAnimation.AnimationMove(StatEntity, True, Destination.X, Destination.Y, Destination.Z, 0.05F, False, True, CSng(startDelay), 0.0F) Threading.Interlocked.Increment(currentAmount) End While + StatAnimation.AnimationPlaySound("Battle\Effects\Stat_Raise", 0, 0) BattleScreen.BattleQuery.Add(StatAnimation) + Else + BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("Battle\Effects\Stat_Raise", False)) End If - BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("Battle\Effects\Stat_Raise", False)) - Dim printMessage As String = p.GetDisplayName() & "'s " & statString Select Case val Case 2 @@ -3816,7 +3812,7 @@ End If '***STAT DECREASE ANIMATION*** If Core.Player.ShowBattleAnimations <> 0 Then - Dim StatAnimation As AnimationQueryObject = New AnimationQueryObject(pNPC, Not own) + Dim StatAnimation As AnimationQueryObject = New AnimationQueryObject(Nothing, Not own) Dim maxAmount As Integer = 20 * val Dim currentAmount As Integer = 0 While currentAmount <= maxAmount @@ -3825,18 +3821,18 @@ Dim zPos = CSng((Random.NextDouble() - 0.5) * 1.2) Dim Position As New Vector3(xPos, 0.8, zPos) - Dim Destination As New Vector3(xPos, -0.4, zPos) + Dim Destination As New Vector3(0, -1.2, 0) Dim Scale As New Vector3(0.2F) Dim startDelay As Double = 5.0 * Random.NextDouble() - Dim StatEntity As Entity = StatAnimation.SpawnEntity(Position, Texture, Scale, 1.0F, CSng(startDelay)) - - + Dim StatEntity As Entity = StatAnimation.SpawnEntity(pNPC.Position + Position, Texture, Scale, 1.0F, CSng(startDelay)) StatAnimation.AnimationMove(StatEntity, True, Destination.X, Destination.Y, Destination.Z, 0.05F, False, True, CSng(startDelay), 0.0F) Threading.Interlocked.Increment(currentAmount) End While + StatAnimation.AnimationPlaySound("Battle\Effects\Stat_Lower", 0, 0) BattleScreen.BattleQuery.Add(StatAnimation) + Else + BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("Battle\Effects\Stat_Lower", False)) End If - BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("Battle\Effects\Stat_Lower", False)) Dim printMessage As String = p.GetDisplayName() & "'s " & statString Select Case val Case 2 @@ -4103,14 +4099,14 @@ Dim startDelay As Double = 5.0 * Random.NextDouble() Dim HealEntity As Entity = HealAnimation.SpawnEntity(Position, Texture, Scale, 1.0F, CSng(startDelay)) - HealAnimation.AnimationMove(HealEntity, True, Destination.X, Destination.Y, Destination.Z, 0.05F, False, True, CSng(startDelay), 0.0F) Threading.Interlocked.Increment(currentAmount) End While + HealAnimation.AnimationPlaySound("Battle\Effects\Heal", 0, 0) BattleScreen.BattleQuery.Add(HealAnimation) + Else + BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("Battle\Effects\Heal", False)) End If - BattleScreen.BattleQuery.Add(New PlaySoundQueryObject("Battle\Effects\Heal", False)) - If message <> "" Then BattleScreen.BattleQuery.Add(New TextQueryObject(message)) End If diff --git a/P3D/Battle/BattleSystemV2/QueryObjects/AnimationQueryObject.vb b/P3D/Battle/BattleSystemV2/QueryObjects/AnimationQueryObject.vb index 5dda41573..b40f6f933 100644 --- a/P3D/Battle/BattleSystemV2/QueryObjects/AnimationQueryObject.vb +++ b/P3D/Battle/BattleSystemV2/QueryObjects/AnimationQueryObject.vb @@ -103,9 +103,17 @@ Public Function SpawnEntity(ByVal Position As Vector3, ByVal Texture As Texture2D, ByVal Scale As Vector3, ByVal Opacity As Single, Optional ByVal startDelay As Single = 0.0F, Optional ByVal endDelay As Single = 0.0F) As Entity Dim NewPosition As Vector3 If Not Position = Nothing Then - NewPosition = CurrentEntity.Position + Position + If CurrentEntity IsNot Nothing Then + NewPosition = CurrentEntity.Position + Position + Else + NewPosition = Position + End If Else - NewPosition = CurrentEntity.Position + If CurrentEntity IsNot Nothing Then + NewPosition = CurrentEntity.Position + Else + NewPosition = New Vector3(0, 0, 0) + End If End If Dim SpawnedEntity = New BattleAnimation3D(NewPosition, Texture, Scale, startDelay, endDelay, False) SpawnedEntity.Opacity = Opacity diff --git a/P3D/Content/Textures/Battle/StatChange/statDown.png b/P3D/Content/Textures/Battle/StatChange/statDown.png index 44e7ba0409242e345a0af8a67b1a45622c3b066c..5b4326ff03cc65211babc811b91090390e76dc75 100644 GIT binary patch delta 153 zcmV;K0A~N{0r3HlV1Il`L_t(I%VYfi|33pIfRUyKcsB0*zrEg_k!%ApH{Sd|-CunG z4LJDn=YM-~cJd6!+<5bUfrA3WgaZ#4@VNrT0MEvq{}l`r7$Phb7$i6t7!)`d7#{p! zV0iI^fnmjo2MiA`JYYZ%RO-5bs$noVqLJd1IPjT?7ytm2&=PCmj2|la00000NkvXX Hu0mjf7xF<% delta 146 zcmV;D0B!&A0qOyeV1IQE=0|9l_~ zIH>ra-Tpp#2K<~T`JW*pfq`Mh0tS4pKr!H_A?JUF1OWyH0}ciTiwFh=h6V^ev4Vl& z!Vd<91s@pD1C_ciplTQll4ztfB@TRMA_f2exvOU3-CD-d01E&B07*qoM6N<$f&x@K A?EnA( diff --git a/P3D/Content/Textures/Battle/StatChange/statUp.png b/P3D/Content/Textures/Battle/StatChange/statUp.png index 5b4326ff03cc65211babc811b91090390e76dc75..44e7ba0409242e345a0af8a67b1a45622c3b066c 100644 GIT binary patch delta 146 zcmV;D0B!&A0qOyeV1IQE=0|9l_~ zIH>ra-Tpp#2K<~T`JW*pfq`Mh0tS4pKr!H_A?JUF1OWyH0}ciTiwFh=h6V^ev4Vl& z!Vd<91s@pD1C_ciplTQll4ztfB@TRMA_f2exvOU3-CD-d01E&B07*qoM6N<$f&x@K A?EnA( delta 153 zcmV;K0A~N{0r3HlV1Il`L_t(I%VYfi|33pIfRUyKcsB0*zrEg_k!%ApH{Sd|-CunG z4LJDn=YM-~cJd6!+<5bUfrA3WgaZ#4@VNrT0MEvq{}l`r7$Phb7$i6t7!)`d7#{p! zV0iI^fnmjo2MiA`JYYZ%RO-5bs$noVqLJd1IPjT?7ytm2&=PCmj2|la00000NkvXX Hu0mjf7xF<% diff --git a/P3D/Pokemon/Attacks/Normal/Growl.vb b/P3D/Pokemon/Attacks/Normal/Growl.vb index 9558524c9..7ab2ed77b 100644 --- a/P3D/Pokemon/Attacks/Normal/Growl.vb +++ b/P3D/Pokemon/Attacks/Normal/Growl.vb @@ -66,8 +66,12 @@ Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, BattleFlip) MoveAnimation.AnimationPlaySound(CStr(CurrentPokemon.Number), 0, 0,, True) - Dim SoundwaveEntity = MoveAnimation.SpawnEntity(New Vector3(0.25, -0.25, -0.25), TextureManager.GetTexture("Textures\Battle\Normal\Growl", New Rectangle(0, 0, 32, 32), ""), New Vector3(0.5F), 1, 0, 1) - + Dim SoundwaveEntity As Entity + If BattleFlip = False Then + SoundwaveEntity = MoveAnimation.SpawnEntity(New Vector3(0.25, -0.25, 0), TextureManager.GetTexture("Textures\Battle\Normal\Growl", New Rectangle(0, 0, 32, 32), ""), New Vector3(0.5F), 1, 0, 1) + Else + SoundwaveEntity = MoveAnimation.SpawnEntity(New Vector3(-0.25, -0.25, 0), TextureManager.GetTexture("Textures\Battle\Normal\Growl", New Rectangle(0, 0, 32, 32), ""), New Vector3(0.5F), 1, 0, 1) + End If MoveAnimation.AnimationChangeTexture(SoundwaveEntity, False, TextureManager.GetTexture("Textures\Battle\Normal\Growl", New Rectangle(0, 32, 32, 32), ""), 1, 1) MoveAnimation.AnimationChangeTexture(SoundwaveEntity, False, TextureManager.GetTexture("Textures\Battle\Normal\Growl", New Rectangle(0, 0, 32, 32), ""), 2, 1) MoveAnimation.AnimationChangeTexture(SoundwaveEntity, True, TextureManager.GetTexture("Textures\Battle\Normal\Growl", New Rectangle(0, 32, 32, 32), ""), 3, 1)