I was not halfway done

I've updated Poison Sting, through which I realized I hadn't taken some usage cases into consideration, so the system should be more robust and useful now
I've also updated the animation for Switching In your own Pokémon
and I've added an animation for when the Pokémon breaks out of the ball when you're trying to catch it
This commit is contained in:
JappaWakka 2021-10-14 17:50:44 +02:00 committed by JappaWakkaP3D
parent 7ff7f96a47
commit 168a855ed0
20 changed files with 777 additions and 1032 deletions

View File

@ -0,0 +1,67 @@
Public Class BAEntityColor
Inherits BattleAnimation3D
Public TargetEntity As Entity
Public TransitionSpeed As Single = 0.01F
Public FadeIn As Boolean = False
Public ColorTo As Vector3 = New Vector3(1.0F, 1.0F, 1.0F)
Public Sub New(ByVal Entity As Entity, ByVal TransitionSpeed As Single, ByVal startDelay As Single, ByVal endDelay As Single, ByVal ColorTo As Color, Optional ByVal ColorFrom As Color = Nothing)
MyBase.New(New Vector3(0.0F), TextureManager.DefaultTexture, New Vector3(1.0F), startDelay, endDelay)
Me.TransitionSpeed = TransitionSpeed
Me.TargetEntity = Entity
If Not ColorFrom = Nothing Then
TargetEntity.Color = ColorFrom.ToVector3
End If
Me.ColorTo = ColorTo.ToVector3
Me.Visible = False
Me.AnimationType = AnimationTypes.Transition
End Sub
Public Overrides Sub DoActionActive()
If TargetEntity.Color.X > ColorTo.X Then
TargetEntity.Color.X -= CByte(Me.TransitionSpeed)
If TargetEntity.Color.X <= ColorTo.X Then
TargetEntity.Color.X = ColorTo.X
End If
ElseIf TargetEntity.Color.X < ColorTo.X Then
TargetEntity.Color.X += CByte(Me.TransitionSpeed)
If TargetEntity.Color.X >= ColorTo.X Then
TargetEntity.Color.X = ColorTo.X
End If
End If
If TargetEntity.Color.Y > ColorTo.Y Then
TargetEntity.Color.Y -= CByte(Me.TransitionSpeed)
If TargetEntity.Color.Y <= ColorTo.Y Then
TargetEntity.Color.Y = ColorTo.Y
End If
ElseIf TargetEntity.Color.Y < ColorTo.Y Then
TargetEntity.Color.Y += CByte(Me.TransitionSpeed)
If TargetEntity.Color.Y >= ColorTo.Y Then
TargetEntity.Color.Y = ColorTo.Y
End If
End If
If TargetEntity.Color.Z > ColorTo.Z Then
TargetEntity.Color.Z -= CByte(Me.TransitionSpeed)
If TargetEntity.Color.Z <= ColorTo.Z Then
TargetEntity.Color.Z = ColorTo.Z
End If
ElseIf TargetEntity.Color.Z < ColorTo.Z Then
TargetEntity.Color.Z += CByte(Me.TransitionSpeed)
If TargetEntity.Color.Z >= ColorTo.Z Then
TargetEntity.Color.Z = ColorTo.Z
End If
End If
If TargetEntity.Color = ColorTo Then
Me.Ready = True
End If
End Sub
End Class

View File

@ -6,7 +6,7 @@
Public EndSize As Vector3
Public SizeSpeed As Single = 0.01F
Public TargetEntity As Entity
Public Anchors As String
Public Anchors As String '1 = Bottom, 2 = Top, 3 = Left, 4 = Right. Combinations are possible.
Public Change As New Vector3(1)

View File

@ -1,194 +0,0 @@
Public Class BAMove
Inherits BattleAnimation3D
Public Destination As Vector3
Public MoveSpeed As Single
Public SpinX As Boolean = False
Public SpinZ As Boolean = False
Public InterpolationSpeed As Single
Public SpinSpeedX As Single = 0.1F
Public SpinSpeedZ As Single = 0.1F
Public MovementCurve As Integer = 3
Private EasedIn As Boolean = False
Private EasedOut As Boolean = False
Public Enum Curves As Integer
EaseIn
EaseOut
EaseInAndOut
Linear
End Enum
Public Sub New(ByVal Position As Vector3, ByVal Texture As Texture2D, ByVal Scale As Vector3, ByVal Destination As Vector3, ByVal Speed As Single, ByVal SpinX As Boolean, ByVal SpinZ As Boolean, ByVal startDelay As Single, ByVal endDelay As Single, Optional ByVal SpinXSpeed As Single = 0.1F, Optional ByVal SpinZSpeed As Single = 0.1F, Optional MovementCurve As Integer = 2)
MyBase.New(Position, Texture, Scale, startDelay, endDelay)
Me.Position = Position
Me.Destination = Destination
Me.MovementCurve = CType(MovementCurve, Curves)
Me.MoveSpeed = Speed
Me.Scale = Scale
Me.SpinSpeedX = SpinXSpeed
Me.SpinSpeedZ = SpinZSpeed
Me.SpinX = SpinX
Me.SpinZ = SpinZ
Select Case MovementCurve
Case Curves.EaseIn
InterpolationSpeed = 0.0F
Case Curves.EaseOut
InterpolationSpeed = MoveSpeed
Case Curves.EaseInAndOut
InterpolationSpeed = 0.0F
Case Curves.Linear
InterpolationSpeed = MoveSpeed
End Select
Me.AnimationType = AnimationTypes.Move
End Sub
Public Sub New(ByVal Position As Vector3, ByVal Texture As Texture2D, ByVal Scale As Vector3, ByVal Destination As Vector3, ByVal Speed As Single, ByVal startDelay As Single, ByVal endDelay As Single)
Me.New(Position, Texture, Scale, Destination, Speed, False, False, startDelay, endDelay, 0.1, 0.1, 2)
End Sub
Public Overrides Sub DoActionUpdate()
Spin()
End Sub
Public Overrides Sub DoActionActive()
Move()
End Sub
Private Sub Spin()
If Me.SpinX = True Then
Me.Rotation.X += SpinSpeedX
End If
If Me.SpinZ = True Then
Me.Rotation.Z += SpinSpeedZ
End If
End Sub
Private Sub Move()
Select Case MovementCurve
Case Curves.EaseIn
If EasedIn = False Then
If InterpolationSpeed < MoveSpeed Then
InterpolationSpeed += MoveSpeed / 10
Else
EasedIn = True
InterpolationSpeed = MoveSpeed
End If
End If
Case Curves.EaseOut
If EasedOut = False Then
If InterpolationSpeed > 0 Then
InterpolationSpeed -= MoveSpeed / 10
Else
EasedOut = True
InterpolationSpeed = 0
End If
End If
Case Curves.EaseInAndOut
If EasedIn = False Then
If InterpolationSpeed < MoveSpeed Then
InterpolationSpeed += MoveSpeed / 10
Else
EasedIn = True
InterpolationSpeed = MoveSpeed
End If
Else
If EasedOut = False Then
If InterpolationSpeed > 0 Then
InterpolationSpeed -= MoveSpeed / 10
Else
EasedOut = True
InterpolationSpeed = 0
End If
End If
End If
End Select
If MovementCurve = Curves.Linear Then
If Me.Position.X < Me.Destination.X Then
Me.Position.X += Me.MoveSpeed
If Me.Position.X >= Me.Destination.X Then
Me.Position.X = Me.Destination.X
End If
ElseIf Me.Position.X > Me.Destination.X Then
Me.Position.X -= Me.MoveSpeed
If Me.Position.X <= Me.Destination.X Then
Me.Position.X = Me.Destination.X
End If
End If
If Me.Position.Y < Me.Destination.Y Then
Me.Position.Y += Me.MoveSpeed
If Me.Position.Y >= Me.Destination.Y Then
Me.Position.Y = Me.Destination.Y
End If
ElseIf Me.Position.Y > Me.Destination.Y Then
Me.Position.Y -= Me.MoveSpeed
If Me.Position.Y <= Me.Destination.Y Then
Me.Position.Y = Me.Destination.Y
End If
End If
If Me.Position.Z < Me.Destination.Z Then
Me.Position.Z += Me.MoveSpeed
If Me.Position.Z >= Me.Destination.Z Then
Me.Position.Z = Me.Destination.Z
End If
ElseIf Me.Position.Z > Me.Destination.Z Then
Me.Position.Z -= Me.MoveSpeed
If Me.Position.Z <= Me.Destination.Z Then
Me.Position.Z = Me.Destination.Z
End If
End If
Else
If Me.Position.X < Me.Destination.X Then
Me.Position.X = MathHelper.Lerp(Me.Position.X, Me.Destination.X, Me.InterpolationSpeed)
If Me.Position.X > Me.Destination.X - 0.05 Then
Me.Position.X = Me.Destination.X
End If
ElseIf Me.Position.X > Me.Destination.X Then
Me.Position.X = MathHelper.Lerp(Me.Position.X, Me.Destination.X, Me.InterpolationSpeed)
If Me.Position.X < Me.Destination.X + 0.05 Then
Me.Position.X = Me.Destination.X
End If
End If
If Me.Position.Y < Me.Destination.Y Then
Me.Position.Y = MathHelper.Lerp(Me.Position.Y, Me.Destination.Y, Me.InterpolationSpeed)
If Me.Position.Y > Me.Destination.Y - 0.05 Then
Me.Position.Y = Me.Destination.Y
End If
ElseIf Me.Position.Y > Me.Destination.Y Then
Me.Position.Y = MathHelper.Lerp(Me.Position.Y, Me.Destination.Y, Me.InterpolationSpeed)
If Me.Position.Y < Me.Destination.Y + 0.05 Then
Me.Position.Y = Me.Destination.Y
End If
End If
If Me.Position.Z < Me.Destination.Z Then
Me.Position.Z = MathHelper.Lerp(Me.Position.Z, Me.Destination.Z, Me.InterpolationSpeed)
If Me.Position.Z > Me.Destination.Z - 0.05 Then
Me.Position.Z = Me.Destination.Z
End If
ElseIf Me.Position.Z > Me.Destination.Z Then
Me.Position.Z = MathHelper.Lerp(Me.Position.Z, Me.Destination.Z, Me.InterpolationSpeed)
If Me.Position.Z < Me.Destination.Z + 0.05 Then
Me.Position.Z = Me.Destination.Z
End If
End If
End If
If Me.Position = Destination Then
Me.Ready = True
End If
End Sub
End Class

View File

@ -1,41 +0,0 @@
Public Class BAOpacity
Inherits BattleAnimation3D
Public TransitionSpeed As Single = 0.01F
Public FadeIn As Boolean = False
Public EndState As Single = 0.0F
Public Sub New(ByVal Position As Vector3, ByVal Texture As Texture2D, ByVal Scale As Vector3, ByVal TransitionSpeed As Single, ByVal FadeIn As Boolean, ByVal EndState As Single, ByVal startDelay As Single, ByVal endDelay As Single, Optional ByVal StartState As Single = 1.0F)
MyBase.New(Position, Texture, Scale, startDelay, endDelay)
MyBase.Opacity = StartState
Me.EndState = EndState
Me.FadeIn = FadeIn
Me.TransitionSpeed = TransitionSpeed
Me.AnimationType = AnimationTypes.Transition
End Sub
Public Overrides Sub DoActionActive()
If Me.FadeIn = True Then
If Me.EndState > Me.Opacity Then
Me.Opacity += Me.TransitionSpeed
If Me.Opacity >= Me.EndState Then
Me.Opacity = Me.EndState
End If
End If
Else
If Me.EndState < Me.Opacity Then
Me.Opacity -= Me.TransitionSpeed
If Me.Opacity <= Me.EndState Then
Me.Opacity = Me.EndState
End If
End If
End If
If Me.Opacity = Me.EndState Then
Me.Ready = True
End If
End Sub
End Class

View File

@ -1,129 +0,0 @@
Public Class BARotation
Inherits BattleAnimation3D
Dim RotationVector As Vector3
Dim EndRotation As Vector3
Dim DoReturn As Boolean = False
Dim ReturnVector As Vector3
Dim hasReturned As Boolean = False
Dim DoRotation As Vector3 = New Vector3(1.0F)
Public Sub New(ByVal Position As Vector3, ByVal Texture As Texture2D, ByVal Scale As Vector3, ByVal RotationVector As Vector3, ByVal EndRotation As Vector3, ByVal startDelay As Single, ByVal endDelay As Single)
MyBase.New(Position, Texture, Scale, startDelay, endDelay)
Me.RotationVector = RotationVector
Me.EndRotation = EndRotation
Me.ReturnVector = Me.Rotation
End Sub
Public Sub New(ByVal Position As Vector3, ByVal Texture As Texture2D, ByVal Scale As Vector3, ByVal RotationVector As Vector3, ByVal EndRotation As Vector3, ByVal startDelay As Single, ByVal endDelay As Single, ByVal DoXRotation As Boolean, ByVal DoYRotation As Boolean, ByVal DoZRotation As Boolean)
Me.New(Position, Texture, Scale, RotationVector, EndRotation, startDelay, endDelay)
If DoXRotation = False Then
DoRotation.X = 0.0F
End If
If DoYRotation = False Then
DoRotation.Y = 0.0F
End If
If DoZRotation = False Then
DoRotation.Z = 0.0F
End If
End Sub
Public Sub New(ByVal Position As Vector3, ByVal Texture As Texture2D, ByVal Scale As Vector3, ByVal RotationVector As Vector3, ByVal EndRotation As Vector3, ByVal startDelay As Single, ByVal endDelay As Single, ByVal DoXRotation As Boolean, ByVal DoYRotation As Boolean, ByVal DoZRotation As Boolean, ByVal DoReturn As Boolean)
Me.New(Position, Texture, Scale, RotationVector, EndRotation, startDelay, endDelay, DoXRotation, DoYRotation, DoZRotation)
Me.DoReturn = DoReturn
End Sub
Public Overrides Sub DoActionActive()
If VectorReached() = False Then
If DoRotation.X = 1.0F Then
If Me.Rotation.X > Me.EndRotation.X Then
Me.Rotation.X += Me.RotationVector.X
If Me.Rotation.X <= Me.EndRotation.X Then
Me.Rotation.X = Me.EndRotation.X
End If
ElseIf Me.Rotation.X < Me.EndRotation.X Then
Me.Rotation.X += Me.RotationVector.X
If Me.Rotation.X >= Me.EndRotation.X Then
Me.Rotation.X = Me.EndRotation.X
End If
End If
End If
If DoRotation.Y = 1.0F Then
If Me.Rotation.Y > Me.EndRotation.Y Then
Me.Rotation.Y += Me.RotationVector.Y
If Me.Rotation.Y <= Me.EndRotation.Y Then
Me.Rotation.Y = Me.EndRotation.Y
End If
ElseIf Me.Rotation.Y < Me.EndRotation.Y Then
Me.Rotation.Y += Me.RotationVector.Y
If Me.Rotation.Y >= Me.EndRotation.Y Then
Me.Rotation.Y = Me.EndRotation.Y
End If
End If
End If
If DoRotation.Z = 1.0F Then
If Me.Rotation.Z > Me.EndRotation.Z Then
Me.Rotation.Z += Me.RotationVector.Z
If Me.Rotation.Z <= Me.EndRotation.Z Then
Me.Rotation.Z = Me.EndRotation.Z
End If
ElseIf Me.Rotation.Z < Me.EndRotation.Z Then
Me.Rotation.Z += Me.RotationVector.Z
If Me.Rotation.Z >= Me.EndRotation.Z Then
Me.Rotation.Z = Me.EndRotation.Z
End If
End If
End If
If VectorReached() = True Then
RotationReady()
End If
Else
RotationReady()
End If
End Sub
Private Sub RotationReady()
If Me.DoReturn = True And Me.hasReturned = False Then
Me.hasReturned = True
Me.EndRotation = Me.ReturnVector
Me.RotationVector = New Vector3(Me.RotationVector.X * -1, Me.RotationVector.Y * -1, Me.RotationVector.Z * -1)
Else
Me.Ready = True
End If
End Sub
Private Function VectorReached() As Boolean
If DoRotation.X = 1.0F Then
If EndRotation.X <> Me.Rotation.X Then
Return False
End If
End If
If DoRotation.Y = 1.0F Then
If EndRotation.Y <> Me.Rotation.Y Then
Return False
End If
End If
If DoRotation.Z = 1.0F Then
If EndRotation.Z <> Me.Rotation.Z Then
Return False
End If
End If
Return True
End Function
End Class

View File

@ -1,28 +0,0 @@
Public Class BASound
Inherits BattleAnimation3D
Private soundfile As String
Private stopMusic As Boolean
Private IsPokemon As Boolean
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)
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
AnimationType = AnimationTypes.Sound
End Sub
Public Overrides Sub DoActionActive()
If IsPokemon = True Then
SoundManager.PlayPokemonCry(CInt(soundfile))
Else
SoundManager.PlaySound(soundfile, stopMusic)
End If
Me.Ready = True
End Sub
End Class

View File

@ -24,14 +24,19 @@
Public Ready As Boolean = False
Public startDelay As Single
Public endDelay As Single
Public SpawnedEntity As Entity = Nothing
Public Sub New(ByVal Position As Vector3, ByVal Texture As Texture2D, ByVal Scale As Vector3, ByVal startDelay As Single, ByVal endDelay As Single)
Public Sub New(ByVal Position As Vector3, ByVal Texture As Texture2D, ByVal Scale As Vector3, ByVal startDelay As Single, ByVal endDelay As Single, Optional SpawnedEntity As Entity = Nothing)
MyBase.New(Position.X, Position.Y, Position.Z, "BattleAnimation", {Texture}, {0, 0}, False, 0, Scale, BaseModel.BillModel, 0, "", New Vector3(1.0F))
Me.Visible = Visible
Me.startDelay = startDelay
Me.endDelay = endDelay
If SpawnedEntity IsNot Nothing Then
Me.SpawnedEntity = SpawnedEntity
End If
Me.CreateWorldEveryFrame = True
Me.DropUpdateUnlessDrawn = False
End Sub
@ -56,6 +61,9 @@
startDelay = 0.0F
End If
Else
If SpawnedEntity IsNot Nothing Then
Ready = True
End If
DoActionActive()
End If
End If

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@
Public AnimationStarted As Boolean = False
Public AnimationEnded As Boolean = False
Public BAFlipped As Boolean
Public BattleFlipped As Boolean = Nothing
Public AnimationSequence As List(Of BattleAnimation3D)
Public SpawnedEntities As List(Of Entity)
Public CurrentEntity As Entity
@ -17,10 +17,12 @@
End Get
End Property
Public Sub New(ByVal entity As Entity, ByVal BAFlipped As Boolean, Optional ByVal model As ModelEntity = Nothing)
Public Sub New(ByVal entity As Entity, ByVal BattleFlipped As Boolean, Optional ByVal model As ModelEntity = Nothing)
MyBase.New(QueryTypes.MoveAnimation)
Me.AnimationSequence = New List(Of BattleAnimation3D)
Me.BAFlipped = BAFlipped
If BattleFlipped <> Nothing Then
Me.BattleFlipped = BattleFlipped
End If
Me.CurrentEntity = entity
Me.CurrentModel = model
AnimationSequenceBegin()
@ -48,6 +50,9 @@
i -= 1
AnimationSequence.Remove(a)
Else
If a.SpawnedEntity IsNot Nothing And a.Ready = True Then
SpawnedEntities.Add(a.SpawnedEntity)
End If
a.Update()
End If
End If
@ -70,32 +75,32 @@
End Sub
Public Sub AnimationSequenceEnd()
If CurrentEntity Is Nothing Then
Logger.Log(Logger.LogTypes.Warning, "ATTEMPT TO USE AnimationSequenceEnd OUTSIDE OF ATTACK ANIMATION DELEGATE")
ElseIf Not AnimationStarted Then
Logger.Log(Logger.LogTypes.Warning, "ATTEMPT TO USE AnimationSequenceEnd BEFORE CALLING AnimationSequenceBegin")
Else
AnimationEnded = True
End If
AnimationEnded = True
End Sub
Public Function SpawnEntity(ByVal Position As Vector3, ByVal Texture As Texture2D, ByVal Scale As Vector3, ByVal Opacity As Single) As Entity
Dim SpawnedEntity As Entity = New Entity(Position.X, Position.Y, Position.Z, "BattleAnimation", {Texture}, {0, 0}, False, 0, Scale, BaseModel.BillModel, 0, "", New Vector3(1.0F))
SpawnedEntity.Opacity = Opacity
If SpawnedEntity.Opacity > 0 Then
SpawnedEntity.Visible = True
Else
SpawnedEntity.Visible = False
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
If Not BattleFlipped = Nothing Then
If BattleFlipped = True Then
Position.X = CurrentEntity.Position.X - Position.X * 2.0F
Position.Z = CurrentEntity.Position.Z - Position.Z * 2.0F
Else
Position.X = CurrentEntity.Position.X + Position.X * 2.0F
Position.Z = CurrentEntity.Position.Z + Position.Z * 2.0F
End If
End If
SpawnedEntities.Add(SpawnedEntity)
Dim SpawnedEntity As Entity = New Entity(Position.X, Position.Y, Position.Z, "BattleAnimation", {Texture}, {0, 0}, False, 0, Scale, BaseModel.BillModel, 0, "", New Vector3(1.0F))
SpawnedEntity.Opacity = Opacity
Dim SpawnDelayEntity As BattleAnimation3D = New BattleAnimation3D(New Vector3(0.0F), TextureManager.DefaultTexture, New Vector3(1.0F), startDelay, endDelay, SpawnedEntity)
AnimationSequence.Add(SpawnDelayEntity)
Return SpawnedEntity
End Function
Public Sub RemoveEntity(Entity As Entity)
SpawnedEntities.Remove(Entity)
End Sub
Public Sub AnimationChangeTexture(ByVal Entity As Entity, ByVal Texture As Texture2D, ByVal startDelay As Single, ByVal endDelay As Single)
Public Sub ChangeEntityTexture(ByVal Entity As Entity, RemoveEntityAfter As Boolean, ByVal Texture As Texture2D, ByVal startDelay As Single, ByVal endDelay As Single)
Dim TextureChangeEntity As Entity
If Entity Is Nothing Then
@ -106,19 +111,29 @@
Dim baEntityTextureChange As BAEntityTextureChange = New BAEntityTextureChange(TextureChangeEntity, Texture, startDelay, endDelay)
AnimationSequence.Add(baEntityTextureChange)
If RemoveEntityAfter = True Then
If baEntityTextureChange.CanRemove = True Then
RemoveEntity(Entity)
End If
End If
End Sub
Public Sub AnimationMoveEntity(ByVal Entity As Entity, ByVal DestinationX As Single, ByVal DestinationY As Single, ByVal DestinationZ As Single, ByVal Speed As Single, ByVal SpinX As Boolean, ByVal SpinZ As Boolean, ByVal startDelay As Single, ByVal endDelay As Single, Optional ByVal SpinXSpeed As Single = 0.1F, Optional ByVal SpinZSpeed As Single = 0.1F, Optional MovementCurve As Integer = 3)
Public Sub MoveEntity(ByVal Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal DestinationX As Single, ByVal DestinationY As Single, ByVal DestinationZ As Single, ByVal Speed As Single, ByVal SpinX As Boolean, ByVal SpinZ As Boolean, ByVal startDelay As Single, ByVal endDelay As Single, Optional ByVal SpinXSpeed As Single = 0.1F, Optional ByVal SpinZSpeed As Single = 0.1F, Optional MovementCurve As Integer = 3)
Dim MoveEntity As Entity
Dim Destination As Vector3
If Entity Is Nothing Then
MoveEntity = CurrentEntity
If BAFlipped Then
If Not BattleFlipped = Nothing Then
If BattleFlipped = True Then
DestinationX -= DestinationX * 2.0F
DestinationZ -= DestinationZ * 2.0F
Destination = New Vector3(CurrentEntity.Position.X + DestinationX, CurrentEntity.Position.Y + DestinationY, CurrentEntity.Position.Z + DestinationZ)
End If
If Entity Is Nothing Then
MoveEntity = CurrentEntity
Else
MoveEntity = Entity
End If
Destination = CurrentEntity.Position + New Vector3(DestinationX, DestinationY, DestinationZ)
Else
MoveEntity = Entity
Destination = New Vector3(DestinationX, DestinationY, DestinationZ)
@ -131,9 +146,15 @@
Dim baModelMove As BAEntityMove = New BAEntityMove(CType(CurrentModel, Entity), Destination, Speed, SpinX, SpinZ, startDelay, endDelay, SpinXSpeed, SpinZSpeed, MovementCurve)
AnimationSequence.Add(baModelMove)
End If
If RemoveEntityAfter = True Then
If baEntityMove.CanRemove = True Then
RemoveEntity(Entity)
End If
End If
End Sub
Public Sub AnimationFadeEntity(ByVal Entity As Entity, ByVal TransitionSpeed As Single, ByVal FadeIn As Boolean, ByVal EndState As Single, ByVal startDelay As Single, ByVal endDelay As Single, Optional ByVal startState As Single = -1.0F)
Public Sub FadeEntity(ByVal Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal TransitionSpeed As Single, ByVal FadeIn As Boolean, ByVal EndState As Single, ByVal startDelay As Single, ByVal endDelay As Single, Optional ByVal startState As Single = -1.0F)
Dim FadeEntity As Entity
If Entity Is Nothing Then
FadeEntity = CurrentEntity
@ -148,8 +169,14 @@
Dim baModelOpacity As BAEntityOpacity = New BAEntityOpacity(CType(CurrentModel, Entity), TransitionSpeed, FadeIn, EndState, startDelay, endDelay, startState)
AnimationSequence.Add(baModelOpacity)
End If
If RemoveEntityAfter = True Then
If baEntityOpacity.CanRemove = True Then
RemoveEntity(Entity)
End If
End If
End Sub
Public Sub AnimationRotateEntity(Entity As Entity, ByVal RotationSpeedX As Single, ByVal RotationSpeedY As Single, ByVal RotationSpeedZ As Single, ByVal EndRotationX As Single, ByVal EndRotationY As Single, ByVal EndRotationZ As Single, ByVal startDelay As Single, ByVal endDelay As Single, ByVal DoXRotation As Boolean, ByVal DoYRotation As Boolean, ByVal DoZRotation As Boolean, ByVal DoReturn As Boolean)
Public Sub RotateEntity(Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal RotationSpeedX As Single, ByVal RotationSpeedY As Single, ByVal RotationSpeedZ As Single, ByVal EndRotationX As Single, ByVal EndRotationY As Single, ByVal EndRotationZ As Single, ByVal startDelay As Single, ByVal endDelay As Single, ByVal DoXRotation As Boolean, ByVal DoYRotation As Boolean, ByVal DoZRotation As Boolean, ByVal DoReturn As Boolean)
Dim RotateEntity As Entity
If Entity Is Nothing Then
RotateEntity = CurrentEntity
@ -161,8 +188,13 @@
Dim EndRotation As Vector3 = New Vector3(EndRotationX, EndRotationY, EndRotationZ)
Dim baEntityRotate As BAEntityRotate = New BAEntityRotate(RotateEntity, RotationSpeedVector, EndRotation, startDelay, endDelay, DoXRotation, DoYRotation, DoZRotation, DoReturn)
AnimationSequence.Add(baEntityRotate)
If RemoveEntityAfter = True Then
If baEntityRotate.CanRemove = True Then
RemoveEntity(Entity)
End If
End If
End Sub
Public Sub AnimationScaleEntity(ByVal Entity As Entity, ByVal Grow As Boolean, ByVal EndSizeX As Single, ByVal EndSizeY As Single, ByVal EndSizeZ As Single, ByVal SizeSpeed As Single, ByVal startDelay As Single, ByVal endDelay As Single, Optional ByVal Anchors As String = "1")
Public Sub ScaleEntity(ByVal Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal Grow As Boolean, ByVal EndSizeX As Single, ByVal EndSizeY As Single, ByVal EndSizeZ As Single, ByVal SizeSpeed As Single, ByVal startDelay As Single, ByVal endDelay As Single, Optional ByVal Anchors As String = "1")
Dim ScaleEntity As Entity
If Entity Is Nothing Then
ScaleEntity = CurrentEntity
@ -175,6 +207,11 @@
Dim EndSize As Vector3 = New Vector3(EndSizeX, EndSizeY, EndSizeZ)
Dim baBillSize As BAEntityScale = New BAEntityScale(ScaleEntity, Scale, Grow, EndSize, SizeSpeed, startDelay, endDelay, Anchors)
AnimationSequence.Add(baBillSize)
If RemoveEntityAfter = True Then
If baBillSize.CanRemove = True Then
RemoveEntity(Entity)
End If
End If
End Sub
Public Sub AnimationSpawnFadingEntity(ByVal PositionX As Single, ByVal PositionY As Single, ByVal PositionZ As Single, ByVal Texture As String, ByVal ScaleX As Single, ByVal ScaleY As Single, ByVal ScaleZ As Single, ByVal TransitionSpeed As Single, ByVal FadeIn As Boolean, ByVal EndState As Single, ByVal startDelay As Single, ByVal endDelay As Single, Optional ByVal startState As Single = 1.0F)
@ -193,7 +230,7 @@
texture2D = TextureManager.GetTexture(stringArray(0), r, "")
End If
If BAFlipped Then
If BattleFlipped Then
PositionX -= PositionX * 2.0F
PositionZ -= PositionZ * 2.0F
End If
@ -222,7 +259,7 @@
texture2D = TextureManager.GetTexture(stringArray(0), r, "")
End If
If BAFlipped Then
If BattleFlipped Then
PositionX -= PositionX * 2.0F
PositionZ -= PositionZ * 2.0F
DestinationX -= DestinationX * 2.0F
@ -239,7 +276,7 @@
AnimationSequence.Add(baMove)
End If
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 PlaySound(ByVal sound As String, ByVal startDelay As Single, ByVal endDelay As Single, Optional ByVal stopMusic As Boolean = False, Optional ByVal IsPokemon As Boolean = False)
If CurrentEntity Is Nothing Then
Logger.Log(Logger.LogTypes.Warning, "ATTEMPT TO USE AnimationPlaySound OUTSIDE OF ATTACK ANIMATION DELEGATE")
ElseIf Not AnimationStarted Then

View File

Before

Width:  |  Height:  |  Size: 537 B

After

Width:  |  Height:  |  Size: 537 B

View File

@ -22,6 +22,7 @@
Public Visible As Boolean = True
Public Shader As New Vector3(1.0F)
Public Shaders As New List(Of Vector3)
Public Color As Vector3 = New Vector3(1.0F)
Public CameraDistanceDelta As Single = 0.0F

View File

@ -15403,6 +15403,9 @@
<Content Include="Content\Textures\Battle\Poison\Stinger.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Textures\Battle\Smoke.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Textures\chess.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@ -26269,9 +26272,6 @@
<Content Include="Content\Textures\battletower.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Textures\Battle\Cloud.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Textures\Battle\Fighting\forcepalmhand.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@ -27545,6 +27545,7 @@
<Content Include="credits.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Compile Include="Battle\BattleAnimations\BAEntityColor.vb" />
<Compile Include="Battle\BattleAnimations\BAEntityRotate.vb" />
<Compile Include="Battle\BattleAnimations\BAEntityMove.vb" />
<Compile Include="Battle\BattleAnimations\BAEntityOpacity.vb" />

View File

@ -66,7 +66,7 @@
Public Overrides Sub InternalUserPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal own As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity)
Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, own)
MoveAnimation.AnimationSpawnMovingEntity(0.0, 0, 0.0, "Textures\Battle\Fire\FireBall", 0.5, 0.5, 0.5, 2.0, 0.0, 0.0, 0.05, False, True, 0.0, 0.0,, -0.5, 0)
MoveAnimation.AnimationPlaySound("Battle\Attacks\Fire\Ember_Start", 0, 0)
MoveAnimation.PlaySound("Battle\Attacks\Fire\Ember_Start", 0, 0)
For i = 0 To 12
MoveAnimation.AnimationSpawnFadingEntity(CSng(i * 0.2), 0.0, 0.0, "Textures\Battle\Fire\Smoke", 0.2, 0.2, 0.2, 0.02, False, 0.0, CSng(i * 0.2), 0.0)
i += 1
@ -82,7 +82,7 @@
MoveAnimation.AnimationSpawnFadingEntity(CSng(3.0 - i * 0.2), 0.0, 0.0, "Textures\Battle\Fire\Smoke", 0.2, 0.2, 0.2, 0.02, False, 0.0, CSng(i * 0.2), 0.0)
i += 1
Next
MoveAnimation.AnimationPlaySound("Battle\Attacks\Fire\Ember_Hit", 2, 0)
MoveAnimation.PlaySound("Battle\Attacks\Fire\Ember_Hit", 2, 0)
MoveAnimation.AnimationSpawnFadingEntity(-0.25, -0.25, -0.25, "Textures\Battle\Fire\Ember,0,0,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 1, 1)
MoveAnimation.AnimationSpawnFadingEntity(0.25, -0.25, 0.25, "Textures\Battle\Fire\Ember,0,0,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 1, 1)
MoveAnimation.AnimationSpawnFadingEntity(0.25, -0.25, -0.25, "Textures\Battle\Fire\Ember,0,0,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 1, 1)

View File

@ -96,7 +96,7 @@
Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, own)
Dim maxAmount As Integer = 8
Dim currentAmount As Integer = 0
MoveAnimation.AnimationPlaySound("Battle\Attacks\Grass\Absorb", 0, 0)
MoveAnimation.PlaySound("Battle\Attacks\Grass\Absorb", 0, 0)
While currentAmount <= maxAmount
Dim yPos As Single = CSng(Random.NextDouble() * 0.5)
Dim zPos As Single = CSng(Random.Next(-5, 5) * 0.15)

View File

@ -64,7 +64,7 @@
Public Overrides Sub InternalUserPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal own As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity)
Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, own)
MoveAnimation.AnimationPlaySound(CStr(CurrentPokemon.Number), 0, 0,, True)
MoveAnimation.PlaySound(CStr(CurrentPokemon.Number), 0, 0,, True)
MoveAnimation.AnimationSpawnFadingEntity(0.25, -0.25, -0.25, "Textures\Battle\Normal\Growl,0,0,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 0, 1)
MoveAnimation.AnimationSpawnFadingEntity(0.25, -0.25, -0.25, "Textures\Battle\Normal\Growl,0,32,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 1, 1)
MoveAnimation.AnimationSpawnFadingEntity(0.25, -0.25, -0.25, "Textures\Battle\Normal\Growl,0,0,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 2, 1)

View File

@ -57,7 +57,7 @@
Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal own As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity)
Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, own)
MoveAnimation.AnimationPlaySound("Battle\Attacks\Pound", 0.5, 2.5)
MoveAnimation.PlaySound("Battle\Attacks\Pound", 0.5, 2.5)
MoveAnimation.AnimationSpawnFadingEntity(0, -0.25, 0, "Textures\Battle\Normal\Pound", 0.5, 0.5, 0.5, 0.02, False, 1.0, 0, 3)
BattleScreen.BattleQuery.Add(MoveAnimation)
End Sub

View File

@ -54,15 +54,16 @@
Public Overrides Sub InternalUserPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal own As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity)
Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, own, CurrentModel)
MoveAnimation.AnimationMoveEntity(Nothing, 0.5, 0, 0, 0.3, False, False, 0, 0,,, 2)
MoveAnimation.AnimationMoveEntity(Nothing, 0, 0, 0, 0.3, False, False, 1, 0,,, 2)
MoveAnimation.MoveEntity(Nothing, False, 0.5, 0, 0, 0.3, False, False, 0, 0,,, 2)
MoveAnimation.MoveEntity(Nothing, False, 0, 0, 0, 0.3, False, False, 1, 0,,, 2)
BattleScreen.BattleQuery.Add(MoveAnimation)
End Sub
Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal own As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity)
Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, own)
MoveAnimation.AnimationPlaySound("Battle\Attacks\Normal\Tackle", 0, 2)
MoveAnimation.AnimationSpawnFadingEntity(0, -0.25, 0, "Textures\Battle\Normal\Tackle", 0.5, 0.5, 0.5, 0.02, False, 1.0, 0, 2)
MoveAnimation.PlaySound("Battle\Attacks\Normal\Tackle", 0, 2)
Dim SpawnEntity = MoveAnimation.SpawnEntity(New Vector3(0, -0.25, 0), TextureManager.GetTexture("Textures\Battle\Normal\Tackle"), New Vector3(1.0F), 1.0F)
MoveAnimation.FadeEntity(SpawnEntity, True, 0.02, False, 1.0F, 0, 2)
BattleScreen.BattleQuery.Add(MoveAnimation)
End Sub
End Class

View File

@ -67,30 +67,38 @@
Public Overrides Sub InternalUserPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal own As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity)
Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, own)
MoveAnimation.AnimationSpawnMovingEntity(0.0, 0, 0.0, "Textures\Battle\Poison\Stinger", 0.5, 0.5, 0.5, 2.0, 0.0, 0.0, 0.05, False, False, 0.0, 0.0,,, 0)
MoveAnimation.AnimationPlaySound("Battle\Attacks\Poison\PoisonSting_Start", 0, 0)
Dim StingerEntity As Entity = MoveAnimation.SpawnEntity(CurrentEntity.Position, TextureManager.GetTexture("Textures\Battle\Poison\Stinger"), New Vector3(0.5F), 1.0F)
MoveAnimation.PlaySound("Battle\Attacks\Poison\PoisonSting_Start", 0, 0)
MoveAnimation.MoveEntity(StingerEntity, True, 2.0, 0.0, 0.0, 0.05, False, False, 0.0, 0.0,,, 0)
BattleScreen.BattleQuery.Add(MoveAnimation)
End Sub
Public Overrides Sub InternalOpponentPokemonMoveAnimation(ByVal BattleScreen As BattleScreen, ByVal own As Boolean, ByVal CurrentPokemon As Pokemon, ByVal CurrentEntity As NPC, ByVal CurrentModel As ModelEntity)
Dim MoveAnimation As AnimationQueryObject = New AnimationQueryObject(CurrentEntity, own)
MoveAnimation.AnimationSpawnMovingEntity(2.0, 0, 0.0, "Textures\Battle\Poison\Stinger", 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.05, False, False, 0.0, 0.0,,, 0)
Dim StingerEntity As Entity = MoveAnimation.SpawnEntity(New Vector3(2.0, 0, 0.0), TextureManager.GetTexture("Textures\Battle\Poison\Stinger"), New Vector3(0.5F), 1)
MoveAnimation.AnimationPlaySound("Battle\Attacks\Poison\PoisonSting_Hit", 1, 0)
MoveAnimation.AnimationSpawnFadingEntity(-0.25, -0.25, -0.25, "Textures\Battle\Poison\Bubble,0,0,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 1, 1)
MoveAnimation.MoveEntity(StingerEntity, True, 0.0, 0.0, 0.0, 0.05, False, False, 0.0, 0.0,,, 0)
MoveAnimation.AnimationSpawnFadingEntity(-0.25, -0.25, -0.25, "Textures\Battle\Poison\Bubble,0,32,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 2, 1)
MoveAnimation.AnimationSpawnFadingEntity(0.25, -0.25, 0.25, "Textures\Battle\Poison\Bubble,0,0,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 2, 1)
MoveAnimation.PlaySound("Battle\Attacks\Poison\PoisonSting_Hit", 1, 0)
MoveAnimation.AnimationSpawnFadingEntity(-0.25, -0.25, -0.25, "Textures\Battle\Poison\Bubble,0,64,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 3, 1)
MoveAnimation.AnimationSpawnFadingEntity(0.25, -0.25, 0.25, "Textures\Battle\Poison\Bubble,0,32,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 3, 1)
MoveAnimation.AnimationSpawnFadingEntity(0.25, -0.25, -0.25, "Textures\Battle\Poison\Bubble,0,0,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 3, 1)
Dim BubbleEntity1 As Entity = MoveAnimation.SpawnEntity(New Vector3(-0.25, -0.25, -0.25), TextureManager.GetTexture("Textures\Battle\Poison\Bubble", New Rectangle(0, 0, 32, 32)), New Vector3(0.5F), 1, 1, 1)
MoveAnimation.AnimationSpawnFadingEntity(0.25, -0.25, 0.25, "Textures\Battle\Poison\Bubble,0,64,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 4, 1)
MoveAnimation.AnimationSpawnFadingEntity(0.25, -0.25, -0.25, "Textures\Battle\Poison\Bubble,0,32,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 4, 1)
MoveAnimation.ChangeEntityTexture(BubbleEntity1, False, TextureManager.GetTexture("Textures\Battle\Poison\Bubble", New Rectangle(0, 32, 32, 32)), 2, 1)
MoveAnimation.AnimationSpawnFadingEntity(0.25, -0.25, -0.25, "Textures\Battle\Poison\Bubble,0,64,32,32", 0.5, 0.5, 0.5, 0.02, False, 1.0, 5, 2)
Dim BubbleEntity2 As Entity = MoveAnimation.SpawnEntity(New Vector3(0.25, -0.25, 0.25), TextureManager.GetTexture("Textures\Battle\Poison\Bubble", New Rectangle(0, 0, 32, 32)), New Vector3(0.5F), 1, 2, 1)
MoveAnimation.ChangeEntityTexture(BubbleEntity1, True, TextureManager.GetTexture("Textures\Battle\Poison\Bubble", New Rectangle(0, 64, 32, 32)), 3, 1)
MoveAnimation.ChangeEntityTexture(BubbleEntity2, False, TextureManager.GetTexture("Textures\Battle\Poison\Bubble", New Rectangle(0, 32, 32, 32)), 3, 1)
Dim BubbleEntity3 As Entity = MoveAnimation.SpawnEntity(New Vector3(0.25, -0.25, -0.25), TextureManager.GetTexture("Textures\Battle\Poison\Bubble", New Rectangle(0, 0, 32, 32)), New Vector3(0.5F), 1, 3, 1)
MoveAnimation.ChangeEntityTexture(BubbleEntity2, True, TextureManager.GetTexture("Textures\Battle\Poison\Bubble", New Rectangle(0, 64, 32, 32)), 4, 1)
MoveAnimation.ChangeEntityTexture(BubbleEntity3, False, TextureManager.GetTexture("Textures\Battle\Poison\Bubble", New Rectangle(0, 32, 32, 32)), 4, 1)
MoveAnimation.ChangeEntityTexture(BubbleEntity3, True, TextureManager.GetTexture("Textures\Battle\Poison\Bubble", New Rectangle(0, 64, 32, 32)), 5, 1)
BattleScreen.BattleQuery.Add(MoveAnimation)
End Sub

View File

@ -15,7 +15,7 @@
Screen.Effect.TextureEnabled = True
Screen.Effect.Alpha = Entity.Opacity
Screen.Effect.DiffuseColor = effectDiffuseColor * Entity.Shader
Screen.Effect.DiffuseColor = effectDiffuseColor * Entity.Shader * Entity.Color
If Screen.Level.IsDark = True Then
Screen.Effect.DiffuseColor *= New Vector3(0.5, 0.5, 0.5)
@ -70,7 +70,9 @@
End If
Screen.Effect.DiffuseColor = effectDiffuseColor
If DebugDisplay.MaxDistance < Entity.CameraDistance Then DebugDisplay.MaxDistance = CInt(Entity.CameraDistance)
If DebugDisplay.MaxDistance < Entity.CameraDistance Then
DebugDisplay.MaxDistance = CInt(Entity.CameraDistance)
End If
End Sub
Private Sub ApplyTexture(ByVal texture As Texture2D)

View File

@ -4,9 +4,11 @@
Dim Ball As Item
Dim Animations As BattleSystem.AnimationQueryObject = New BattleSystem.AnimationQueryObject(Nothing, False, Nothing)
Dim BallStartPosition As Vector3 = New Vector3(Camera.Position.X - 1.0F, Camera.Position.Y, Camera.Position.Z - 0.5F) + BattleScreen.BattleMapOffset
Dim BallEntity As Entity = Animations.SpawnEntity(BallStartPosition, Ball.Texture, New Vector3(0.3F), 1.0F)
Dim Animations As BattleSystem.AnimationQueryObject = New BattleSystem.AnimationQueryObject(BattleScreen.OppPokemonNPC, Nothing, BattleScreen.OppPokemonModel)
Dim BallStartPosition As Vector3 = New Vector3(Camera.Position.X - 1.0F, Camera.Position.Y, Camera.Position.Z - 1.0F) + BattleScreen.BattleMapOffset
Dim BallEntity As Entity = Nothing
Dim PokemonScale As Vector3
Dim AnimationStarted As Boolean = False
Dim caught As Boolean = False
@ -104,15 +106,15 @@
If TextBox.Showing = False Then
If Me._playIntroSound = False Then
Me._playIntroSound = True
SoundManager.PlaySound("Battle\Pokeball\throw")
End If
UpdateAnimations()
If Me.IsCurrentScreen() = True Then
If AnimationStarted = False Then
If Me._playIntroSound = False Then
Me._playIntroSound = True
SoundManager.PlaySound("Battle\Pokeball\throw")
End If
BallEntity = Animations.SpawnEntity(BallStartPosition, Ball.Texture, New Vector3(0.3F), 1.0F)
SetupAnimation()
Else
Select Case Me.AnimationIndex
@ -131,7 +133,7 @@
SoundManager.PlaySound("Battle\Pokeball\shake")
AnimationIndex += 1
Else
SoundManager.PlaySound("Battle\Pokeball\open")
SoundManager.PlaySound("Battle\Pokeball\break")
AnimationIndex = 21
InBall = False
End If
@ -177,7 +179,7 @@
ResetVisibility()
Core.SetScreen(Me.PreScreen)
Case 21 ' After Break
ResetVisibility()
SetupAnimation()
Core.SetScreen(Me.PreScreen)
CType(Core.CurrentScreen, BattleSystem.BattleScreen).Battle.InitializeRound(CType(Core.CurrentScreen, BattleSystem.BattleScreen), New BattleSystem.Battle.RoundConst() With {.StepType = BattleSystem.Battle.RoundConst.StepTypes.Text, .Argument = "It broke free!"})
End Select
@ -255,52 +257,68 @@
Select Case Me.AnimationIndex
Case 0
Animations.AnimationMoveEntity(BallEntity, BattleScreen.OppPokemonNPC.Position.X - 0.05F, 0.0F, BattleScreen.OppPokemonNPC.Position.Z, 0.04F, True, True, 1.0F, 0.0F,,, 3)
PokemonScale = BattleScreen.OppPokemonNPC.Scale
Animations.MoveEntity(BallEntity, False, BattleScreen.OppPokemonNPC.Position.X - 0.05F, 0.0F, BattleScreen.OppPokemonNPC.Position.Z, 0.1, False, True, 0F, 0F,, 0.3)
Case 1
Dim SmokeReturned As Integer = 0
Dim SmokeParticles As Integer = 0
Do
Dim SmokePosition = New Vector3(CSng(Random.Next(-10, 10) / 10), CSng(Random.Next(-10, 10) / 10), CSng(Random.Next(-10, 10) / 10))
Dim SmokeDestination = New Vector3(0, 0, 0)
Dim SmokePosition = BattleScreen.OwnPokemonNPC.Position + New Vector3(CSng(Random.Next(-10, 10) / 10), CSng(Random.Next(-10, 10) / 10), CSng(Random.Next(-10, 10) / 10))
Dim SmokeDestination = BattleScreen.OwnPokemonNPC.Position
Dim SmokeTexture As Texture2D = TextureManager.GetTexture("Textures\Battle\Cloud")
Dim SmokeTexture As Texture2D = TextureManager.GetTexture("Textures\Battle\Smoke")
Dim SmokeScale = New Vector3(CSng(Random.Next(2, 6) / 10))
Dim SmokeSpeed = CSng(Random.Next(1, 3) / 10.0F)
Dim SmokeEntity As Entity = Animations.SpawnEntity(SmokePosition, SmokeTexture, SmokeScale, 1.0F)
Animations.AnimationMoveEntity(SmokeEntity, SmokeDestination.X, SmokeDestination.Y, SmokeDestination.Z, SmokeSpeed, False, False, 0.0F, 0.0F)
If SmokeEntity.Position = SmokeDestination Then
Animations.RemoveEntity(SmokeEntity)
End If
Threading.Interlocked.Increment(SmokeReturned)
Loop While SmokeReturned <= 38
Animations.MoveEntity(SmokeEntity, True, SmokeDestination.X, SmokeDestination.Y, SmokeDestination.Z, SmokeSpeed, False, False, 0.0F, 0.0F)
Animations.AnimationMoveEntity(BallEntity, BattleScreen.OppPokemonNPC.Position.X - 0.05F, 0.0F, BattleScreen.OppPokemonNPC.Position.Z, 0.01F, False, False, 0.0F, 6.0F,,, 3)
Threading.Interlocked.Increment(SmokeParticles)
Loop While SmokeParticles <= 38
Animations.AnimationScaleEntity(BattleScreen.OppPokemonNPC, False, 0.05F, 0.05F, 0.05F, 0.02F, 0.0F, 0.0F, "1")
Animations.AnimationFadeEntity(BattleScreen.OppPokemonNPC, 1, False, 0.0F, 0.0F, 0.0F)
Animations.MoveEntity(BallEntity, False, BattleScreen.OppPokemonNPC.Position.X, BattleScreen.OwnPokemonNPC.Position.Y, BattleScreen.OppPokemonNPC.Position.Z, 0.01F, False, False, 0.0F, 6.0F,,, 3)
Animations.ScaleEntity(Nothing, False, False, 0.05F, 0.05F, 0.05F, 0.02F, 0.0F, 0.0F, "1")
Animations.FadeEntity(Nothing, False, 1, False, 0.0F, 0.0F, 0.0F)
Case 2
Animations.AnimationMoveEntity(BallEntity, BattleScreen.OppPokemonNPC.Position.X - 0.05F, -0.35F, BattleScreen.OppPokemonNPC.Position.Z, 0.02F, False, False, 0.0F, 6.0F,,, 3)
Animations.MoveEntity(BallEntity, False, BattleScreen.OppPokemonNPC.Position.X, BattleScreen.OwnPokemonNPC.Position.Y - 0.35F, BattleScreen.OppPokemonNPC.Position.Z, 0.02F, False, False, 0.0F, 6.0F,,, 3)
Case 3, 5
Animations.AnimationRotateEntity(BallEntity, 0, 0, 0.05F, 0, 0, 1.0F, 0.0F, 4.0F, False, False, True, True)
Animations.RotateEntity(BallEntity, False, 0, 0, 0.05F, 0, 0, 1.0F, 0.0F, 4.0F, False, False, True, True)
Case 4, 6
Animations.AnimationRotateEntity(BallEntity, 0, 0, -0.05F, 0, 0, -1.0F, 0.0F, 4.0F, False, False, True, True)
Animations.RotateEntity(BallEntity, False, 0, 0, -0.05F, 0, 0, -1.0F, 0.0F, 4.0F, False, False, True, True)
Case 7 ' Catch Animation
For i = 0 To 2
Dim StarPosition As Vector3 = New Vector3(BattleScreen.OppPokemonNPC.Position.X - 0.05F, -0.35F, BattleScreen.OppPokemonNPC.Position.Z)
Dim StarDestination As Vector3 = New Vector3(StarPosition.X, StarPosition.Y + 0.4F, StarPosition.Z - ((1 - i) * 0.4F))
Dim StarEntity As Entity = Animations.SpawnEntity(StarPosition, TextureManager.GetTexture("Textures\Battle\BallCatchStar"), New Vector3(0.1F), 1.0F)
Animations.AnimationMoveEntity(StarEntity, StarDestination.X, StarDestination.Y, StarDestination.Z, 0.01F, False, False, 0.0F, 0.0F,,, 3)
If StarEntity.Position = StarDestination Then
Animations.RemoveEntity(StarEntity)
End If
Animations.MoveEntity(StarEntity, True, StarDestination.X, StarDestination.Y, StarDestination.Z, 0.01F, False, False, 0.0F, 0.0F,,, 3)
Next
Animations.AnimationMoveEntity(BallEntity, BattleScreen.OppPokemonNPC.Position.X - 0.05F, -0.35F, BattleScreen.OppPokemonNPC.Position.Z, 0.02F, False, False, 0.0F, 6.0F,,, 3)
Animations.MoveEntity(BallEntity, False, BattleScreen.OppPokemonNPC.Position.X, BattleScreen.OwnPokemonNPC.Position.Y - 0.35F, BattleScreen.OppPokemonNPC.Position.Z, 0.02F, False, False, 0.0F, 6.0F,,, 3)
Case 8
Animations.AnimationFadeEntity(BallEntity, 0.01F, False, 0.0F, 0.0F, 0.0F)
Animations.FadeEntity(BallEntity, True, 0.01F, False, 0.0F, 0.0F, 0.0F)
Case 21 ' Break Animation
' Ball Opens
Dim SmokeParticles As Integer = 0
Do
Dim SmokePosition = BattleScreen.OwnPokemonNPC.Position
Dim SmokeDestination = BattleScreen.OwnPokemonNPC.Position + New Vector3(CSng(Random.Next(-10, 10) / 10), CSng(Random.Next(-10, 10) / 10), CSng(Random.Next(-10, 10) / 10))
Dim SmokeTexture As Texture2D = TextureManager.GetTexture("Textures\Battle\Smoke")
Dim SmokeScale = New Vector3(CSng(Random.Next(2, 6) / 10))
Dim SmokeSpeed = CSng(Random.Next(1, 3) / 10.0F)
Dim SmokeEntity As Entity = Animations.SpawnEntity(SmokePosition, SmokeTexture, SmokeScale, 1.0F)
Animations.MoveEntity(SmokeEntity, True, SmokeDestination.X, SmokeDestination.Y, SmokeDestination.Z, SmokeSpeed, False, False, 0.0F, 0.0F)
Threading.Interlocked.Increment(SmokeParticles)
Loop While SmokeParticles <= 38
' Pokemon appears
Animations.FadeEntity(Nothing, False, 1, False, 1, 0.0F, 0.0F)
Animations.ScaleEntity(Nothing, False, True, PokemonScale.X, PokemonScale.Y, PokemonScale.Z, 0.02F, 0.0F, 0.0F, "1")
End Select
End Sub