Improved Whirlpool Animation + Fixed BattleAnimations drawn behind Pokémon

This commit is contained in:
JappaWakka 2021-12-30 21:53:57 +01:00
parent 31e00f72d6
commit 35aa80b072
3 changed files with 37 additions and 11 deletions

View File

@ -5844,9 +5844,10 @@
'Whirlpool Animation 'Whirlpool Animation
If Core.Player.ShowBattleAnimations <> 0 Then If Core.Player.ShowBattleAnimations <> 0 Then
ChangeCameraAngle(1, True, BattleScreen) ChangeCameraAngle(1, True, BattleScreen)
Dim WhirlpoolAnimation As AnimationQueryObject = New AnimationQueryObject(.OwnPokemonNPC, False) Dim WhirlpoolAnimation As AnimationQueryObject = New AnimationQueryObject(.OwnPokemonNPC, False,, True)
WhirlpoolAnimation.AnimationPlaySound("Battle\Attacks\Water\Whirlpool", 0.0F, 0) WhirlpoolAnimation.AnimationPlaySound("Battle\Attacks\Water\Whirlpool", 0.0F, 0)
Dim WhirlpoolEntity As Entity = WhirlpoolAnimation.SpawnEntity(New Vector3(0), TextureManager.GetTexture("Textures\Battle\Water\Whirlpool"), New Vector3(0.0F), 1.0F, 0.0F, 0.0F) Dim WhirlpoolEntity As Entity = WhirlpoolAnimation.SpawnEntity(New Vector3(0, -0.3, 0), TextureManager.GetTexture("Textures\Battle\Water\Whirlpool"), New Vector3(0.0F), 1.0F, 0.0F, 0.0F)
WhirlpoolAnimation.AnimationRotate(WhirlpoolEntity, False, 4.71F, 0, 0, 4.71F, 0, 0, 0, 0, True, False, False, False)
WhirlpoolAnimation.AnimationRotate(WhirlpoolEntity, False, 0, 0, 0.2F, 0, 0, 10.0F, 0.0F, 0.0F, False, False, True, True) WhirlpoolAnimation.AnimationRotate(WhirlpoolEntity, False, 0, 0, 0.2F, 0, 0, 10.0F, 0.0F, 0.0F, False, False, True, True)
WhirlpoolAnimation.AnimationScale(WhirlpoolEntity, False, True, 1.0F, 1.0F, 1.0F, 0.025F, 0.0F, 0.0F) WhirlpoolAnimation.AnimationScale(WhirlpoolEntity, False, True, 1.0F, 1.0F, 1.0F, 0.025F, 0.0F, 0.0F)
WhirlpoolAnimation.AnimationScale(WhirlpoolEntity, True, False, 0.0F, 0.0F, 0.0F, 0.025F, 5.0F, 0.0F) WhirlpoolAnimation.AnimationScale(WhirlpoolEntity, True, False, 0.0F, 0.0F, 0.0F, 0.025F, 5.0F, 0.0F)
@ -6679,9 +6680,10 @@
'Whirlpool Animation 'Whirlpool Animation
If Core.Player.ShowBattleAnimations <> 0 Then If Core.Player.ShowBattleAnimations <> 0 Then
ChangeCameraAngle(1, False, BattleScreen) ChangeCameraAngle(1, False, BattleScreen)
Dim WhirlpoolAnimation As AnimationQueryObject = New AnimationQueryObject(.OppPokemonNPC, True) Dim WhirlpoolAnimation As AnimationQueryObject = New AnimationQueryObject(.OppPokemonNPC, True,, True)
WhirlpoolAnimation.AnimationPlaySound("Battle\Attacks\Water\Whirlpool", 0.0F, 0) WhirlpoolAnimation.AnimationPlaySound("Battle\Attacks\Water\Whirlpool", 0.0F, 0)
Dim WhirlpoolEntity As Entity = WhirlpoolAnimation.SpawnEntity(New Vector3(0), TextureManager.GetTexture("Textures\Battle\Water\Whirlpool"), New Vector3(0.0F), 1.0F, 0.0F, 0.0F) Dim WhirlpoolEntity As Entity = WhirlpoolAnimation.SpawnEntity(New Vector3(0, -0.3, 0), TextureManager.GetTexture("Textures\Battle\Water\Whirlpool"), New Vector3(0.0F), 1.0F, 0.0F, 0.0F)
WhirlpoolAnimation.AnimationRotate(WhirlpoolEntity, False, 4.71F, 0, 0, 4.71F, 0, 0, 0, 0, True, False, False, False)
WhirlpoolAnimation.AnimationRotate(WhirlpoolEntity, False, 0, 0, 0.2F, 0, 0, 10.0F, 0.0F, 0.0F, False, False, True, True) WhirlpoolAnimation.AnimationRotate(WhirlpoolEntity, False, 0, 0, 0.2F, 0, 0, 10.0F, 0.0F, 0.0F, False, False, True, True)
WhirlpoolAnimation.AnimationScale(WhirlpoolEntity, False, True, 1.0F, 1.0F, 1.0F, 0.025F, 0.0F, 0.0F) WhirlpoolAnimation.AnimationScale(WhirlpoolEntity, False, True, 1.0F, 1.0F, 1.0F, 0.025F, 0.0F, 0.0F)
WhirlpoolAnimation.AnimationScale(WhirlpoolEntity, True, False, 0.0F, 0.0F, 0.0F, 0.025F, 5.0F, 0.0F) WhirlpoolAnimation.AnimationScale(WhirlpoolEntity, True, False, 0.0F, 0.0F, 0.0F, 0.025F, 5.0F, 0.0F)

View File

@ -875,7 +875,7 @@
If ForegroundEntities.Count > 0 Then If ForegroundEntities.Count > 0 Then
ForegroundEntities = (From f In ForegroundEntities Order By f.CameraDistance Descending).ToList() ForegroundEntities = (From f In ForegroundEntities Order By f.CameraDistance Descending).ToList()
End If End If
Level.Draw() Level.Draw()
World.DrawWeather(Screen.Level.World.CurrentMapWeather) World.DrawWeather(Screen.Level.World.CurrentMapWeather)
@ -890,6 +890,7 @@
End If End If
Dim ForegroundAnimationList As New List(Of AnimationQueryObject) Dim ForegroundAnimationList As New List(Of AnimationQueryObject)
Dim BackgroundAnimationList As New List(Of AnimationQueryObject)
If BattleQuery.Count > 0 Then If BattleQuery.Count > 0 Then
Dim cIndex As Integer = 0 Dim cIndex As Integer = 0
Dim cQuery As New List(Of QueryObject) Dim cQuery As New List(Of QueryObject)
@ -898,7 +899,9 @@ nextIndex:
Dim cQueryObject As QueryObject = BattleQuery(cIndex) Dim cQueryObject As QueryObject = BattleQuery(cIndex)
If cQueryObject.QueryType = QueryObject.QueryTypes.MoveAnimation Then If cQueryObject.QueryType = QueryObject.QueryTypes.MoveAnimation Then
If CType(cQueryObject, AnimationQueryObject).DrawBeforeEntities = True Then If CType(cQueryObject, AnimationQueryObject).DrawBeforeEntities = True Then
cQuery.Add(cQueryObject) BackgroundAnimationList.Add(CType(cQueryObject, AnimationQueryObject))
cIndex += 1
GoTo nextIndex
Else Else
ForegroundAnimationList.Add(CType(cQueryObject, AnimationQueryObject)) ForegroundAnimationList.Add(CType(cQueryObject, AnimationQueryObject))
cIndex += 1 cIndex += 1
@ -915,19 +918,39 @@ nextIndex:
End If End If
End If End If
cQuery.Reverse()
If cQuery.Count > 0 Then
For Each cQueryObject As QueryObject In cQuery
cQueryObject.Draw(Me)
Next
End If
End If
If BackgroundAnimationList.Count > 0 Then
Dim cIndex As Integer = 0
Dim cQuery As New List(Of QueryObject)
nextIndexBackground:
If BackgroundAnimationList.Count > cIndex Then
Dim cQueryObject As QueryObject = BackgroundAnimationList(cIndex)
cQuery.Add(cQueryObject)
If cQueryObject.PassThis = True Then
cIndex += 1
GoTo nextIndexBackground
End If
End If
cQuery.Reverse() cQuery.Reverse()
For Each cQueryObject As QueryObject In cQuery For Each cQueryObject As QueryObject In cQuery
cQueryObject.Draw(Me) cQueryObject.Draw(Me)
Next Next
End If
If ForegroundAnimationList.Count > 0 Then
For i = 0 To ForegroundEntities.Count - 1 For i = 0 To ForegroundEntities.Count - 1
ForegroundEntities(i).Render() ForegroundEntities(i).Render()
DebugDisplay.MaxVertices += ForegroundEntities(i).VertexCount DebugDisplay.MaxVertices += ForegroundEntities(i).VertexCount
Next Next
End If
If ForegroundAnimationList.Count > 0 Then
Dim cIndex As Integer = 0 Dim cIndex As Integer = 0
Dim cQuery As New List(Of QueryObject) Dim cQuery As New List(Of QueryObject)
nextIndexForeground: nextIndexForeground:

View File

@ -100,9 +100,10 @@ Namespace BattleSystem.Moves.Water
End If End If
End Sub End Sub
Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity) Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal BattleFlip As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity)
Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, BattleFlip) Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, BattleFlip,, True)
MoveAnimation.AnimationPlaySound("Battle\Attacks\Water\Whirlpool", 0.0F, 0) MoveAnimation.AnimationPlaySound("Battle\Attacks\Water\Whirlpool", 0.0F, 0)
Dim WhirlpoolEntity As Entity = MoveAnimation.SpawnEntity(New Vector3(0), TextureManager.GetTexture("Textures\Battle\Water\Whirlpool"), New Vector3(0.0F), 1.0F, 0.0F, 0.0F) Dim WhirlpoolEntity As Entity = MoveAnimation.SpawnEntity(New Vector3(0, -0.3F, 0), TextureManager.GetTexture("Textures\Battle\Water\Whirlpool"), New Vector3(0.0F), 1.0F, 0.0F, 0.0F)
MoveAnimation.AnimationRotate(WhirlpoolEntity, False, 4.71F, 0, 0, 4.71F, 0, 0, 0, 0, True, False, False, False)
MoveAnimation.AnimationRotate(WhirlpoolEntity, False, 0, 0, 0.2F, 0, 0, 10.0F, 0.0F, 0.0F, False, False, True, True) MoveAnimation.AnimationRotate(WhirlpoolEntity, False, 0, 0, 0.2F, 0, 0, 10.0F, 0.0F, 0.0F, False, False, True, True)
MoveAnimation.AnimationScale(WhirlpoolEntity, False, True, 1.0F, 1.0F, 1.0F, 0.025F, 0.0F, 0.0F) MoveAnimation.AnimationScale(WhirlpoolEntity, False, True, 1.0F, 1.0F, 1.0F, 0.025F, 0.0F, 0.0F)
MoveAnimation.AnimationScale(WhirlpoolEntity, True, False, 0.0F, 0.0F, 0.0F, 0.025F, 5.0F, 0.0F) MoveAnimation.AnimationScale(WhirlpoolEntity, True, False, 0.0F, 0.0F, 0.0F, 0.025F, 5.0F, 0.0F)