Battle Bugfixes

Fixed buggy throwing animation of the opponent trainer
Fixed a bug related to the trainer sprite in the vs trainer intro that made the trainer texture buggy if it wasn't 32x32
This commit is contained in:
JappaWakka 2022-01-10 20:45:28 +01:00
parent 5b7a6fc9ab
commit 667671e16f
3 changed files with 16 additions and 12 deletions

View File

@ -7363,7 +7363,7 @@
BallThrow.AnimationPlaySound("Battle\Pokeball\Throw", 0, 0) BallThrow.AnimationPlaySound("Battle\Pokeball\Throw", 0, 0)
Dim BallThrowEntity As Entity = BallThrow.SpawnEntity(New Vector3(-2, -0.15, 0), BattleScreen.OwnPokemon.CatchBall.Texture, New Vector3(0.3F), 1.0F) Dim BallThrowEntity As Entity = BallThrow.SpawnEntity(New Vector3(-2, -0.15, 0), BattleScreen.OwnPokemon.CatchBall.Texture, New Vector3(0.3F), 1.0F)
BallThrow.AnimationMove(BallThrowEntity, True, 0, 0.35, 0, 0.1, False, True, 0F, 0.5F,, 0.3,, 0.025F) BallThrow.AnimationMove(BallThrowEntity, True, 0, 0.35, 0, 0.1, False, True, 0F, 0.5F,, -0.3,, 0.025F)
' Ball Opens ' Ball Opens
BallThrow.AnimationPlaySound("Battle\Pokeball\Open", 3, 0) BallThrow.AnimationPlaySound("Battle\Pokeball\Open", 3, 0)
@ -7783,12 +7783,12 @@
BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(True, ToggleEntityQueryObject.BattleEntities.OppPokemon, 1, -1, -1, -1, -1)) BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(True, ToggleEntityQueryObject.BattleEntities.OppPokemon, 1, -1, -1, -1, -1))
BattleScreen.BattleQuery.Add(New TextQueryObject(BattleScreen.Trainer.Name & ": ""Go, " & BattleScreen.OppPokemon.GetDisplayName() & "!""")) BattleScreen.BattleQuery.Add(New TextQueryObject(BattleScreen.Trainer.Name & ": ""Go, " & BattleScreen.OppPokemon.GetDisplayName() & "!"""))
Dim BallThrow As AnimationQueryObject = New AnimationQueryObject(BattleScreen.OppPokemonNPC, True, BattleScreen.OppPokemonModel) Dim BallThrow As AnimationQueryObject = New AnimationQueryObject(BattleScreen.OppPokemonNPC, False, BattleScreen.OppPokemonModel)
If Core.Player.ShowBattleAnimations <> 0 Then If Core.Player.ShowBattleAnimations <> 0 Then
' Ball is thrown ' Ball is thrown
BallThrow.AnimationPlaySound("Battle\Pokeball\Throw", 0, 0) BallThrow.AnimationPlaySound("Battle\Pokeball\Throw", 0, 0)
Dim BallThrowEntity = BallThrow.SpawnEntity(New Vector3(-2, -0.15, 0), BattleScreen.OppPokemon.CatchBall.Texture, New Vector3(0.3F), 1.0F) Dim BallThrowEntity = BallThrow.SpawnEntity(New Vector3(2, -0.15, 0), BattleScreen.OppPokemon.CatchBall.Texture, New Vector3(0.3F), 1.0F)
BallThrow.AnimationMove(BallThrowEntity, True, 0, 0.35, 0, 0.1, False, True, 0F, 0.5F,, 0.3,, 0.025F) BallThrow.AnimationMove(BallThrowEntity, True, 0, 0.35, 0, 0.1, False, True, 0F, 0.5F,, 0.3,, 0.025F)
' Ball opens ' Ball opens

View File

@ -376,7 +376,7 @@
Screen.Level.Entities.Add(OwnPokemonModel) Screen.Level.Entities.Add(OwnPokemonModel)
Dim InitiallyVisibleOpp As Integer = 1 Dim InitiallyVisibleOpp As Integer = 1
If IsPVPBattle = True AndAlso Core.Player.ShowBattleAnimations <> 0 Then If Core.Player.ShowBattleAnimations <> 0 Then
InitiallyVisibleOpp = 0 InitiallyVisibleOpp = 0
End If End If
@ -414,12 +414,12 @@
Dim q1 As TextQueryObject = New TextQueryObject(Trainer.Name & " wants to battle!") Dim q1 As TextQueryObject = New TextQueryObject(Trainer.Name & " wants to battle!")
' Ball is thrown ' Ball is thrown
Dim BallThrowOpp As AnimationQueryObject = New AnimationQueryObject(OppPokemonNPC, True, OppPokemonModel) Dim BallThrowOpp As AnimationQueryObject = New AnimationQueryObject(OppPokemonNPC, False, OppPokemonModel)
If Core.Player.ShowBattleAnimations <> 0 Then If Core.Player.ShowBattleAnimations <> 0 Then
BallThrowOpp.AnimationPlaySound("Battle\Pokeball\Throw", 0, 0) BallThrowOpp.AnimationPlaySound("Battle\Pokeball\Throw", 0, 0)
BallThrowOpp.AnimationMove(Nothing, False, 0, 0.5, 0, 0.5, False, False, 2, 0,,, 3) BallThrowOpp.AnimationMove(Nothing, False, 0, 0.5, 0, 0.5, False, False, 2, 0,,, 3)
Dim BallThrowEntity As Entity = BallThrowOpp.SpawnEntity(New Vector3(-2, -0.15, 0), Me.OppPokemon.CatchBall.Texture, New Vector3(0.3F), 1.0F) Dim BallThrowEntity As Entity = BallThrowOpp.SpawnEntity(New Vector3(2, -0.15, 0), Me.OppPokemon.CatchBall.Texture, New Vector3(0.3F), 1.0F)
BallThrowOpp.AnimationMove(BallThrowEntity, True, 0, 0.35, 0, 0.1, False, True, 0F, 0.5F,, 0.3,, 0.025F) BallThrowOpp.AnimationMove(BallThrowEntity, True, 0, 0.35, 0, 0.1, False, True, 0F, 0.5F,, 0.3,, 0.025F)
' Ball Opens ' Ball Opens

View File

@ -172,6 +172,7 @@
Private Sub DrawTrainerIntro() Private Sub DrawTrainerIntro()
Dim barPosition As Vector2 = New Vector2(Trainer.BarImagePosition.X * 128, Trainer.BarImagePosition.Y * 128) Dim barPosition As Vector2 = New Vector2(Trainer.BarImagePosition.X * 128, Trainer.BarImagePosition.Y * 128)
Dim VSPosition As Vector2 = New Vector2(Trainer.VSImagePosition.X * 128, Trainer.VSImagePosition.Y * 128 + 64) Dim VSPosition As Vector2 = New Vector2(Trainer.VSImagePosition.X * 128, Trainer.VSImagePosition.Y * 128 + 64)
Dim TrainerFrameSize As Size = New Size(CInt(TextureManager.GetTexture("Textures\NPC\" & Trainer.SpriteName).Width / 3), CInt(TextureManager.GetTexture("Textures\NPC\" & Trainer.SpriteName).Height / 4))
If Trainer.VSImageOrigin <> "VSIntro" Then If Trainer.VSImageOrigin <> "VSIntro" Then
VSPosition.Y -= 64 VSPosition.Y -= 64
@ -179,17 +180,18 @@
Dim t1 As Texture2D = TextureManager.GetTexture("GUI\Intro\VSIntro", New Rectangle(CInt(barPosition.X), CInt(barPosition.Y), 128, 64), "") Dim t1 As Texture2D = TextureManager.GetTexture("GUI\Intro\VSIntro", New Rectangle(CInt(barPosition.X), CInt(barPosition.Y), 128, 64), "")
Dim t2 As Texture2D = TextureManager.GetTexture("GUI\Intro\" & Trainer.VSImageOrigin, New Rectangle(CInt(VSPosition.X), CInt(VSPosition.Y), Trainer.VSImageSize.Width, Trainer.VSImageSize.Height), "") Dim t2 As Texture2D = TextureManager.GetTexture("GUI\Intro\" & Trainer.VSImageOrigin, New Rectangle(CInt(VSPosition.X), CInt(VSPosition.Y), Trainer.VSImageSize.Width, Trainer.VSImageSize.Height), "")
Dim t3 As Texture2D = TextureManager.GetTexture("NPC\" & Trainer.SpriteName, New Rectangle(0, 64, 32, 32)) Dim t3 As Texture2D = TextureManager.GetTexture("NPC\" & Trainer.SpriteName, New Rectangle(0, TrainerFrameSize.Height * 2, TrainerFrameSize.Width, TrainerFrameSize.Height))
Dim t4 As Texture2D = Nothing Dim t4 As Texture2D = Nothing
If Trainer.DoubleTrainer = True Then If Trainer.DoubleTrainer = True Then
t4 = TextureManager.GetTexture("NPC\" & Trainer.SpriteName2, New Rectangle(0, 64, 32, 32)) Dim Trainer2FrameSize As Size = New Size(CInt(TextureManager.GetTexture("Textures\NPC\" & Trainer.SpriteName2).Width / 3), CInt(TextureManager.GetTexture("Textures\NPC\" & Trainer.SpriteName2).Height / 4))
t4 = TextureManager.GetTexture("NPC\" & Trainer.SpriteName2, New Rectangle(0, Trainer2FrameSize.Height * 2, Trainer2FrameSize.Width, Trainer2FrameSize.Height))
End If End If
If Trainer.GameJoltID <> "" Then If Trainer.GameJoltID <> "" Then
If GameJolt.Emblem.HasDownloadedSprite(Trainer.GameJoltID) = True Then If GameJolt.Emblem.HasDownloadedSprite(Trainer.GameJoltID) = True Then
Dim t As Texture2D = GameJolt.Emblem.GetOnlineSprite(Trainer.GameJoltID) Dim t As Texture2D = GameJolt.Emblem.GetOnlineSprite(Trainer.GameJoltID)
If Not t Is Nothing Then If Not t Is Nothing Then
Dim spriteSize As New Vector2(t.Width / 3.0F, t.Height / 4.0F) Dim spriteSize As New Vector2(CInt(t.Width / 3), CInt(t.Height / 4))
t3 = TextureManager.GetTexture(t, New Rectangle(0, CInt(spriteSize.Y * 2), CInt(spriteSize.X), CInt(spriteSize.Y))) t3 = TextureManager.GetTexture(t, New Rectangle(0, CInt(spriteSize.Y * 2), CInt(spriteSize.X), CInt(spriteSize.Y)))
End If End If
End If End If
@ -238,20 +240,22 @@
Private Sub DrawFaceshotIntro() Private Sub DrawFaceshotIntro()
Dim barPosition As Vector2 = New Vector2(Trainer.BarImagePosition.X * 128, Trainer.BarImagePosition.Y * 128) Dim barPosition As Vector2 = New Vector2(Trainer.BarImagePosition.X * 128, Trainer.BarImagePosition.Y * 128)
Dim VSPosition As Vector2 = New Vector2(Trainer.VSImagePosition.X * 128, Trainer.VSImagePosition.Y * 128 + 64) Dim VSPosition As Vector2 = New Vector2(Trainer.VSImagePosition.X * 128, Trainer.VSImagePosition.Y * 128 + 64)
Dim TrainerFrameSize As Size = New Size(CInt(TextureManager.GetTexture("Textures\NPC\" & Trainer.SpriteName).Width / 3), CInt(TextureManager.GetTexture("Textures\NPC\" & Trainer.SpriteName).Height / 4))
Dim t1 As Texture2D = TextureManager.GetTexture("GUI\Intro\VSIntro", New Rectangle(CInt(barPosition.X), CInt(barPosition.Y), 128, 64), "") Dim t1 As Texture2D = TextureManager.GetTexture("GUI\Intro\VSIntro", New Rectangle(CInt(barPosition.X), CInt(barPosition.Y), 128, 64), "")
Dim t2 As Texture2D = TextureManager.GetTexture("GUI\Intro\VSIntro", New Rectangle(CInt(VSPosition.X), CInt(VSPosition.Y), 61, 54), "") Dim t2 As Texture2D = TextureManager.GetTexture("GUI\Intro\VSIntro", New Rectangle(CInt(VSPosition.X), CInt(VSPosition.Y), 61, 54), "")
Dim t3 As Texture2D = TextureManager.GetTexture("NPC\" & Trainer.SpriteName, New Rectangle(0, 64, 32, 32)) Dim t3 As Texture2D = TextureManager.GetTexture("NPC\" & Trainer.SpriteName, New Rectangle(0, TrainerFrameSize.Height * 2, TrainerFrameSize.Width, TrainerFrameSize.Height))
Dim t4 As Texture2D = Nothing Dim t4 As Texture2D = Nothing
If Trainer.DoubleTrainer = True Then If Trainer.DoubleTrainer = True Then
t4 = TextureManager.GetTexture("NPC\" & Trainer.SpriteName2, New Rectangle(0, 64, 32, 32)) Dim Trainer2FrameSize As Size = New Size(CInt(TextureManager.GetTexture("Textures\NPC\" & Trainer.SpriteName2).Width / 3), CInt(TextureManager.GetTexture("Textures\NPC\" & Trainer.SpriteName2).Height / 4))
t4 = TextureManager.GetTexture("NPC\" & Trainer.SpriteName2, New Rectangle(0, Trainer2FrameSize.Height * 2, Trainer2FrameSize.Width, Trainer2FrameSize.Height))
End If End If
If Trainer.GameJoltID <> "" Then If Trainer.GameJoltID <> "" Then
If GameJolt.Emblem.HasDownloadedSprite(Trainer.GameJoltID) = True Then If GameJolt.Emblem.HasDownloadedSprite(Trainer.GameJoltID) = True Then
Dim t As Texture2D = GameJolt.Emblem.GetOnlineSprite(Trainer.GameJoltID) Dim t As Texture2D = GameJolt.Emblem.GetOnlineSprite(Trainer.GameJoltID)
If Not t Is Nothing Then If Not t Is Nothing Then
Dim spriteSize As New Vector2(t.Width / 3.0F, t.Height / 4.0F) Dim spriteSize As New Vector2(CInt(t.Width / 3), CInt(t.Height / 4))
t3 = TextureManager.GetTexture(t, New Rectangle(0, CInt(spriteSize.Y * 2), CInt(spriteSize.X), CInt(spriteSize.Y))) t3 = TextureManager.GetTexture(t, New Rectangle(0, CInt(spriteSize.Y * 2), CInt(spriteSize.X), CInt(spriteSize.Y)))
End If End If
End If End If