diff --git a/P3D/Battle/BattleAnimations/BABackground.vb b/P3D/Battle/BattleAnimations/BABackground.vb index 3b6072033..c9c1eddb3 100644 --- a/P3D/Battle/BattleAnimations/BABackground.vb +++ b/P3D/Battle/BattleAnimations/BABackground.vb @@ -2,23 +2,20 @@ Inherits BattleAnimation3D - Public Duration As Single = 2.0F - Public FadeInSpeed As Single = 0.01F - Public FadeOutSpeed As Single = 0.01F - Public BackgroundOpacity As Single = 0.0F - Public Texture As Texture2D - Public DoTile As Boolean = False - Public AnimationWidth As Integer = -1 - Public AnimationLength As Integer = 1 - Public AnimationSpeed As Integer = 16 - Public AfterFadeInOpacity As Single = 1.0F - Public FadeProgress As FadeSteps = FadeSteps.FadeIn - Private DurationDate As Date - Private DurationWhole As Single - Private DurationFraction As Single - Private BackgroundAnimation As Animation - Private CurrentRectangle As New Rectangle(0, 0, 0, 0) - Private TextureScale As Integer = 4 + Dim FadeInSpeed As Single = 0.01F + Dim FadeOutSpeed As Single = 0.01F + Dim BackgroundOpacity As Single = 0.0F + Dim Texture As Texture2D + Dim DoTile As Boolean = False + Dim AnimationWidth As Integer = -1 + Dim AfterFadeInOpacity As Single = 1.0F + Dim FadeProgress As FadeSteps = FadeSteps.FadeIn + Dim DurationDate As Date + Dim DurationWhole As Single + Dim DurationFraction As Single + Dim BackgroundAnimation As Animation + Dim CurrentRectangle As New Rectangle(0, 0, 0, 0) + Dim TextureScale As Integer = 4 Public Enum FadeSteps As Integer FadeIn @@ -29,13 +26,11 @@ Public Sub New(ByVal Texture As Texture2D, ByVal startDelay As Single, ByVal endDelay As Single, ByVal Duration As Single, Optional ByVal AfterFadeInOpacity As Single = 1.0F, Optional ByVal FadeInSpeed As Single = 0.125F, Optional ByVal FadeOutSpeed As Single = 0.125F, Optional ByVal DoTile As Boolean = False, Optional ByVal AnimationLength As Integer = 1, Optional ByVal AnimationSpeed As Integer = 2, Optional TextureScale As Integer = 4) MyBase.New(New Vector3(0.0F), TextureManager.DefaultTexture, New Vector3(1.0F), startDelay, endDelay) Me.Texture = Texture - Me.Duration = Duration Me.AfterFadeInOpacity = AfterFadeInOpacity Me.FadeInSpeed = FadeInSpeed Me.FadeOutSpeed = FadeOutSpeed Me.DoTile = DoTile Me.AnimationWidth = CInt(Texture.Width / AnimationLength) - Me.AnimationLength = AnimationLength DurationWhole = CSng(Math.Truncate(CDbl(Duration / 6.0F))) DurationFraction = CSng((Duration / 6.0F - DurationWhole) * 1000) Me.TextureScale = TextureScale diff --git a/P3D/Battle/BattleAnimations/BACameraChangeAngle.vb b/P3D/Battle/BattleAnimations/BACameraChangeAngle.vb index 266b9d965..106ac894d 100644 --- a/P3D/Battle/BattleAnimations/BACameraChangeAngle.vb +++ b/P3D/Battle/BattleAnimations/BACameraChangeAngle.vb @@ -4,8 +4,8 @@ Public Class BACameraChangeAngle Inherits BattleAnimation3D - Public CameraAngleID As Integer - Public BV2Screen As BattleSystem.BattleScreen + Dim CameraAngleID As Integer + Dim BV2Screen As BattleSystem.BattleScreen Public Sub New(ByRef Battlescreen As BattleSystem.BattleScreen, ByVal CameraAngleID As Integer, ByVal startDelay As Single, ByVal endDelay As Single) MyBase.New(New Vector3(0.0F), TextureManager.DefaultTexture, New Vector3(1.0F), startDelay, endDelay) diff --git a/P3D/Battle/BattleAnimations/BACameraOscillateMove.vb b/P3D/Battle/BattleAnimations/BACameraOscillateMove.vb index f2f96915a..76d545c5c 100644 --- a/P3D/Battle/BattleAnimations/BACameraOscillateMove.vb +++ b/P3D/Battle/BattleAnimations/BACameraOscillateMove.vb @@ -2,20 +2,19 @@ Inherits BattleAnimation3D - Public StartPosition As Vector3 - Public ReturnToStart As Vector3 - Public HalfDistance As New Vector3(0.0F) - Public DestinationDistance As New Vector3(0.0F) - Public CurrentDistance As New Vector3(0.0F) - Public MoveSpeed As Single - Public MoveBothWays As Boolean = True - Public MovementCurve As Integer = 0 - Public RemoveEntityAfter As Boolean - Public Duration As TimeSpan - Public ReadyTime As Date - Public ReadyAxis As New Vector3(0) - Public InterpolationSpeed As Vector3 - Public InterpolationDirection As Boolean = True + Dim StartPosition As Vector3 + Dim ReturnToStart As Vector3 + Dim HalfDistance As New Vector3(0.0F) + Dim DestinationDistance As New Vector3(0.0F) + Dim CurrentDistance As New Vector3(0.0F) + Dim MoveSpeed As Single + Dim MoveBothWays As Boolean = True + Dim MovementCurve As Integer = 0 + Dim Duration As TimeSpan + Dim ReadyTime As Date + Dim ReadyAxis As New Vector3(0) + Dim InterpolationSpeed As Vector3 + Dim InterpolationDirection As Boolean = True Public Enum Curves As Integer Linear Smooth diff --git a/P3D/Battle/BattleAnimations/BAEntityColor.vb b/P3D/Battle/BattleAnimations/BAEntityColor.vb index 01df268a4..2dc9952fc 100644 --- a/P3D/Battle/BattleAnimations/BAEntityColor.vb +++ b/P3D/Battle/BattleAnimations/BAEntityColor.vb @@ -2,18 +2,17 @@ Inherits BattleAnimation3D - Public TargetEntity As Entity - Public TransitionSpeed As Single = 0.01F - Public TransitionSpeedOut As Single = 0.01F - Public FadeIn As Boolean = False - Public ReturnToFromWhenDone As Boolean = False - Public RemoveEntityAfter As Boolean = False - Public InitialColorSet As Boolean = False - Public IsReturning As Boolean = False - Public ColorTo As Vector3 = New Vector3(1.0F, 1.0F, 1.0F) - Public ColorFrom As Vector3 = New Vector3(1.0F, 1.0F, 1.0F) + Dim TargetEntity As Entity + Dim TransitionSpeed As Single = 0.01F + Dim TransitionSpeedOut As Single = 0.01F + Dim ReturnToFromWhenDone As Boolean = False + Dim RemoveEntityAfter As Boolean = False + Dim InitialColorSet As Boolean = False + Dim IsReturning As Boolean = False + Dim ColorTo As Vector3 = New Vector3(1.0F, 1.0F, 1.0F) + Dim ColorFrom As Vector3 = New Vector3(1.0F, 1.0F, 1.0F) - Public Sub New(ByVal Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal TransitionSpeedIn As Single, ByVal ReturnToFromWhenDone As Boolean, ByVal startDelay As Single, ByVal endDelay As Single, ByVal ColorTo As Vector3, Optional ByVal ColorFrom As Vector3 = Nothing, Optional TransitionSpeedOut As Single = -1) + Public Sub New(ByRef Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal TransitionSpeedIn As Single, ByVal ReturnToFromWhenDone As Boolean, ByVal startDelay As Single, ByVal endDelay As Single, ByVal ColorTo As Vector3, Optional ByVal ColorFrom As Vector3 = Nothing, Optional TransitionSpeedOut As Single = -1) MyBase.New(New Vector3(0.0F), TextureManager.DefaultTexture, New Vector3(1.0F), startDelay, endDelay) Me.RemoveEntityAfter = RemoveEntityAfter If TransitionSpeedOut = -1 Then diff --git a/P3D/Battle/BattleAnimations/BAEntityFaceRotate.vb b/P3D/Battle/BattleAnimations/BAEntityFaceRotate.vb index aab1a19c9..23c2086e7 100644 --- a/P3D/Battle/BattleAnimations/BAEntityFaceRotate.vb +++ b/P3D/Battle/BattleAnimations/BAEntityFaceRotate.vb @@ -9,7 +9,7 @@ Dim TurnTime As Single = 0.0F Dim TurnDelay As Single = 0.0F - Public Sub New(ByVal TargetEntity As NPC, ByVal TurnSteps As Integer, ByVal startDelay As Single, ByVal endDelay As Single, Optional ByVal EndFaceRotation As Integer = -1, Optional ByVal TurnSpeed As Integer = 1, Optional ByVal TurnDelay As Single = 0.25F) + Public Sub New(ByRef TargetEntity As NPC, ByVal TurnSteps As Integer, ByVal startDelay As Single, ByVal endDelay As Single, Optional ByVal EndFaceRotation As Integer = -1, Optional ByVal TurnSpeed As Integer = 1, Optional ByVal TurnDelay As Single = 0.25F) MyBase.New(New Vector3(0.0F), TextureManager.DefaultTexture, New Vector3(1.0F), startDelay, endDelay) If EndFaceRotation = -1 Then Me.EndFaceRotation = TargetEntity.faceRotation diff --git a/P3D/Battle/BattleAnimations/BAEntityMove.vb b/P3D/Battle/BattleAnimations/BAEntityMove.vb index 873aa8bfb..e8122838d 100644 --- a/P3D/Battle/BattleAnimations/BAEntityMove.vb +++ b/P3D/Battle/BattleAnimations/BAEntityMove.vb @@ -2,21 +2,21 @@ Inherits BattleAnimation3D - Public StartPosition As Vector3 - Public TargetEntity As Entity - Public Destination As Vector3 - Public MoveDistance As New Vector3(0.0F) - Public MoveSpeed As Single - Public MoveYSpeed As Single - Public InterpolationSpeed As Single - Public InterpolationYSpeed As Single - Public SpinX As Boolean = False - Public SpinZ As Boolean = False - 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 + Dim StartPosition As Vector3 + Dim TargetEntity As Entity + Dim Destination As Vector3 + Dim MoveDistance As New Vector3(0.0F) + Dim MoveSpeed As Single + Dim MoveYSpeed As Single + Dim InterpolationSpeed As Single + Dim InterpolationYSpeed As Single + Dim SpinX As Boolean = False + Dim SpinZ As Boolean = False + Dim SpinSpeedX As Single = 0.1F + Dim SpinSpeedZ As Single = 0.1F + Dim MovementCurve As Integer = 3 + Dim EasedIn As Boolean = False + Dim EasedOut As Boolean = False Public RemoveEntityAfter As Boolean Dim ReadyAxis As Vector3 = New Vector3(0.0F) Public Enum Curves As Integer diff --git a/P3D/Battle/BattleAnimations/BAEntityOpacity.vb b/P3D/Battle/BattleAnimations/BAEntityOpacity.vb index 0ab014d35..3e1b35cb3 100644 --- a/P3D/Battle/BattleAnimations/BAEntityOpacity.vb +++ b/P3D/Battle/BattleAnimations/BAEntityOpacity.vb @@ -2,13 +2,13 @@ Inherits BattleAnimation3D - Public TargetEntity As Entity - Public TransitionSpeed As Single = 0.01F - Public FadeIn As Boolean = False - Public EndState As Single = 0.0F - Public RemoveEntityAfter As Boolean + Dim TargetEntity As Entity + Dim TransitionSpeed As Single = 0.01F + Dim FadeIn As Boolean = False + Dim EndState As Single = 0.0F + Dim RemoveEntityAfter As Boolean - Public Sub New(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) + Public Sub New(ByRef 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) MyBase.New(New Vector3(0.0F), TextureManager.DefaultTexture, New Vector3(1.0F), startDelay, endDelay) Me.RemoveEntityAfter = RemoveEntityAfter Me.EndState = EndState diff --git a/P3D/Battle/BattleAnimations/BAEntityOscillateMove.vb b/P3D/Battle/BattleAnimations/BAEntityOscillateMove.vb index 1dafdff5e..3fec0b358 100644 --- a/P3D/Battle/BattleAnimations/BAEntityOscillateMove.vb +++ b/P3D/Battle/BattleAnimations/BAEntityOscillateMove.vb @@ -2,21 +2,21 @@ Inherits BattleAnimation3D - Public StartPosition As Vector3 - Public ReturnToStart As Vector3 - Public TargetEntity As Entity - Public HalfDistance As New Vector3(0.0F) - Public DestinationDistance As New Vector3(0.0F) - Public CurrentDistance As New Vector3(0.0F) - Public MoveSpeed As Single - Public MoveBothWays As Boolean = True - Public MovementCurve As Integer = 0 - Public RemoveEntityAfter As Boolean - Public Duration As TimeSpan - Public ReadyTime As Date - Public ReadyAxis As New Vector3(0) - Public InterpolationSpeed As Vector3 - Public InterpolationDirection As Boolean = True + Dim StartPosition As Vector3 + Dim ReturnToStart As Vector3 + Dim TargetEntity As Entity + Dim HalfDistance As New Vector3(0.0F) + Dim DestinationDistance As New Vector3(0.0F) + Dim CurrentDistance As New Vector3(0.0F) + Dim MoveSpeed As Single + Dim MoveBothWays As Boolean = True + Dim MovementCurve As Integer = 0 + Dim RemoveEntityAfter As Boolean + Dim Duration As TimeSpan + Dim ReadyTime As Date + Dim ReadyAxis As New Vector3(0) + Dim InterpolationSpeed As Vector3 + Dim InterpolationDirection As Boolean = True Public Enum Curves As Integer Linear Smooth diff --git a/P3D/Battle/BattleAnimations/BAEntityRotate.vb b/P3D/Battle/BattleAnimations/BAEntityRotate.vb index 97359b09a..654696016 100644 --- a/P3D/Battle/BattleAnimations/BAEntityRotate.vb +++ b/P3D/Battle/BattleAnimations/BAEntityRotate.vb @@ -11,9 +11,9 @@ Dim DoRotation As Vector3 = New Vector3(1.0F) Dim AmountRotated As Vector3 = New Vector3(0.0F) Dim ReadyAxis As Vector3 = New Vector3(0.0F) - Public RemoveEntityAfter As Boolean = False + Dim RemoveEntityAfter As Boolean = False - Public Sub New(ByVal Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal RotationSpeedVector As Vector3, ByVal EndRotation As Vector3, ByVal startDelay As Single, ByVal endDelay As Single) + Public Sub New(ByRef Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal RotationSpeedVector As Vector3, ByVal EndRotation As Vector3, ByVal startDelay As Single, ByVal endDelay As Single) MyBase.New(New Vector3(0.0F), TextureManager.DefaultTexture, New Vector3(1.0F), startDelay, endDelay) Me.RemoveEntityAfter = RemoveEntityAfter Me.RotationSpeedVector = RotationSpeedVector @@ -24,7 +24,7 @@ Me.AnimationType = AnimationTypes.Rotation End Sub - Public Sub New(ByVal Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal RotationSpeedVector 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) + Public Sub New(ByRef Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal RotationSpeedVector 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(Entity, RemoveEntityAfter, RotationSpeedVector, EndRotation, startDelay, endDelay) If DoXRotation = False Then @@ -41,7 +41,7 @@ End If End Sub - Public Sub New(ByVal Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal RotationSpeedVector 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) + Public Sub New(ByRef Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal RotationSpeedVector 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(Entity, RemoveEntityAfter, RotationSpeedVector, EndRotation, startDelay, endDelay, DoXRotation, DoYRotation, DoZRotation) Me.DoReturn = DoReturn diff --git a/P3D/Battle/BattleAnimations/BAEntityScale.vb b/P3D/Battle/BattleAnimations/BAEntityScale.vb index d48dc96a0..bcf372442 100644 --- a/P3D/Battle/BattleAnimations/BAEntityScale.vb +++ b/P3D/Battle/BattleAnimations/BAEntityScale.vb @@ -2,16 +2,16 @@ Inherits BattleAnimation3D - Public Grow As Boolean = False - Public EndSize As Vector3 - Public SizeSpeed As Single = 0.01F - Public TargetEntity As Entity - Public Anchors As String '1 = Bottom, 2 = Top, 3 = Left, 4 = Right. Combinations are possible. + Dim Grow As Boolean = False + Dim EndSize As Vector3 + Dim SizeSpeed As Single = 0.01F + Dim TargetEntity As Entity + Dim Anchors As String '1 = Bottom, 2 = Top, 3 = Left, 4 = Right. Combinations are possible. - Public Change As New Vector3(1) - Public RemoveEntityAfter As Boolean + Dim SpeedMultiplier As Vector3 + Dim RemoveEntityAfter As Boolean - Public Sub New(ByVal Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal Scale As Vector3, ByVal Grow As Boolean, ByVal EndSize As Vector3, ByVal SizeSpeed As Single, ByVal startDelay As Single, ByVal endDelay As Single, ByVal Anchors As String) + Public Sub New(ByRef Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal Scale As Vector3, ByVal Grow As Boolean, ByVal EndSize As Vector3, ByVal SizeSpeed As Single, ByVal startDelay As Single, ByVal endDelay As Single, ByVal Anchors As String, Optional SpeedMultiplier As Vector3 = Nothing) MyBase.New(New Vector3(0.0F), TextureManager.DefaultTexture, Scale, startDelay, endDelay) Me.RemoveEntityAfter = RemoveEntityAfter Me.Anchors = Anchors @@ -19,6 +19,11 @@ Me.EndSize = EndSize Me.SizeSpeed = SizeSpeed Me.TargetEntity = Entity + If SpeedMultiplier <> Nothing Then + Me.SpeedMultiplier = SpeedMultiplier + Else + Me.SpeedMultiplier = New Vector3(1) + End If Me.AnimationType = AnimationTypes.Size End Sub @@ -26,9 +31,9 @@ Public Overrides Sub DoActionActive() Dim saveScale As Vector3 = TargetEntity.Scale - Dim changeX As Single = SizeSpeed * Change.X - Dim changeY As Single = SizeSpeed * Change.Y - Dim changeZ As Single = SizeSpeed * Change.Z + Dim changeX As Single = SizeSpeed * SpeedMultiplier.X + Dim changeY As Single = SizeSpeed * SpeedMultiplier.Y + Dim changeZ As Single = SizeSpeed * SpeedMultiplier.Z If Grow = True Then If TargetEntity.Scale.X < Me.EndSize.X Then @@ -102,9 +107,6 @@ End If End Sub - Public Sub SetChange(ByVal changeX As Single, ByVal changeY As Single, ByVal changeZ As Single) - Me.Change = New Vector3(changeX, changeY, changeZ) - End Sub Public Overrides Sub DoRemoveEntity() If Me.RemoveEntityAfter = True Then TargetEntity.CanBeRemoved = True diff --git a/P3D/Battle/BattleAnimations/BAEntitySetPosition.vb b/P3D/Battle/BattleAnimations/BAEntitySetPosition.vb index 1e14f5d1a..274dc8d55 100644 --- a/P3D/Battle/BattleAnimations/BAEntitySetPosition.vb +++ b/P3D/Battle/BattleAnimations/BAEntitySetPosition.vb @@ -2,9 +2,9 @@ Inherits BattleAnimation3D - Public TargetEntity As Entity - Public SetPosition As Vector3 - Public RemoveEntityAfter As Boolean + Dim TargetEntity As Entity + Dim SetPosition As Vector3 + Dim RemoveEntityAfter As Boolean Public Sub New(ByRef Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal SetPosition As Vector3, ByVal startDelay As Single, ByVal endDelay As Single) MyBase.New(New Vector3(0.0F), TextureManager.DefaultTexture, New Vector3(1.0F), startDelay, endDelay) diff --git a/P3D/Battle/BattleAnimations/BAEntityTextureChange.vb b/P3D/Battle/BattleAnimations/BAEntityTextureChange.vb index e116bcd32..4ecd166e5 100644 --- a/P3D/Battle/BattleAnimations/BAEntityTextureChange.vb +++ b/P3D/Battle/BattleAnimations/BAEntityTextureChange.vb @@ -2,11 +2,11 @@ Inherits BattleAnimation3D - Public Texture As Texture2D - Public TargetEntity As Entity - Public RemoveEntityAfter As Boolean + Dim Texture As Texture2D + Dim TargetEntity As Entity + Dim RemoveEntityAfter As Boolean - Public Sub New(ByVal Entity As Entity, ByVal RemoveEntityAfter As Boolean, Texture As Texture2D, ByVal startDelay As Single, ByVal endDelay As Single) + Public Sub New(ByRef Entity As Entity, ByVal RemoveEntityAfter As Boolean, Texture As Texture2D, ByVal startDelay As Single, ByVal endDelay As Single) MyBase.New(New Vector3(0.0F), TextureManager.DefaultTexture, New Vector3(1.0F), startDelay, endDelay) Me.RemoveEntityAfter = RemoveEntityAfter Me.TargetEntity = Entity diff --git a/P3D/Battle/BattleAnimations/BAPlaySound.vb b/P3D/Battle/BattleAnimations/BAPlaySound.vb index 022ca6b19..07cc8684a 100644 --- a/P3D/Battle/BattleAnimations/BAPlaySound.vb +++ b/P3D/Battle/BattleAnimations/BAPlaySound.vb @@ -2,10 +2,10 @@ Inherits BattleAnimation3D - Private soundfile As String - Private stopMusic As Boolean - Private IsPokemon As Boolean - Private CrySuffix As String = "" + Dim soundfile As String + Dim stopMusic As Boolean + Dim IsPokemon As Boolean + Dim 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, Optional ByVal CrySuffix As String = "") diff --git a/P3D/Battle/BattleAnimations/BattleAnimation3D.vb b/P3D/Battle/BattleAnimations/BattleAnimation3D.vb index 4e0c2eb2c..17a344e9c 100644 --- a/P3D/Battle/BattleAnimations/BattleAnimation3D.vb +++ b/P3D/Battle/BattleAnimations/BattleAnimation3D.vb @@ -24,14 +24,14 @@ Public Ready As Boolean = False Public startDelay As Date Public endDelay As Date - Public SpawnedEntity As Boolean = False - Public Started As Boolean = False - Private DelayDivide As Single = 6.0F - Private StartDelayWhole As Single - Private StartDelayFraction As Single - Private EndDelayWhole As Single - Private EndDelayFraction As Single - Private hasStartedEndDelay As Boolean = False + Dim SpawnedEntity As Boolean = False + Dim Started As Boolean = False + Dim DelayDivide As Single = 6.0F + Dim StartDelayWhole As Single + Dim StartDelayFraction As Single + Dim EndDelayWhole As Single + Dim EndDelayFraction As Single + Dim hasStartedEndDelay As Boolean = False 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 Boolean = False) MyBase.New(Position.X, Position.Y, Position.Z, "BattleAnimation", {Texture}, {0, 0}, False, 0, Scale, BaseModel.BillModel, 0, "", New Vector3(1.0F)) diff --git a/P3D/Battle/BattleSystemV2/BattleScreen.vb b/P3D/Battle/BattleSystemV2/BattleScreen.vb index 7afab12c9..4279c797b 100644 --- a/P3D/Battle/BattleSystemV2/BattleScreen.vb +++ b/P3D/Battle/BattleSystemV2/BattleScreen.vb @@ -1047,6 +1047,8 @@ nextIndexBackground: World.DrawWeather(Screen.Level.World.CurrentMapWeather) Core.SpriteBatch.Draw(BackgroundTarget, windowSize, Color.White) Core.SpriteBatch.Draw(NPCTarget, windowSize, Color.White) + NPCTarget.Dispose() + BackgroundTarget.Dispose() Else SkyDome.Draw(45.0F) Level.Draw() @@ -1090,6 +1092,8 @@ nextIndexForeground: If DrawColoredScreen = True Then Canvas.DrawRectangle(Core.windowSize, Me.ColorOverlay) End If + ForegroundAnimationList.Clear() + BackgroundAnimationList.Clear() End Sub Public Overrides Sub Update() diff --git a/P3D/Battle/BattleSystemV2/QueryObjects/AnimationQueryObject.vb b/P3D/Battle/BattleSystemV2/QueryObjects/AnimationQueryObject.vb index 08f6e942f..4a0ea25ac 100644 --- a/P3D/Battle/BattleSystemV2/QueryObjects/AnimationQueryObject.vb +++ b/P3D/Battle/BattleSystemV2/QueryObjects/AnimationQueryObject.vb @@ -5,44 +5,47 @@ Namespace BattleSystem Public Class AnimationQueryObject Inherits QueryObject - Public AnimationStarted As Boolean = False - Public AnimationEnded As Boolean = False - Public BattleFlipped As Boolean = Nothing - Public AnimationSequence As List(Of BattleAnimation3D) - Public SpawnedEntities As List(Of Entity) - Public CurrentEntity As Entity - Public StartPosition As New Vector3(0) + Dim AnimationStarted As Boolean = False + Dim AnimationEnded As Boolean = False + Dim BattleFlipped As Boolean = Nothing + Dim AnimationSequence As List(Of BattleAnimation3D) + Dim SpawnedEntities As List(Of Entity) + Dim CurrentEntity As Entity Public DrawBeforeEntities As Boolean + Dim Backgrounds As List(Of Entity) + Dim RenderObjects As List(Of Entity) + Public Overrides ReadOnly Property IsReady As Boolean Get Return AnimationEnded End Get End Property - Public Sub New(ByVal entity As Entity, ByVal BattleFlipped As Boolean, Optional DrawBeforeEntities As Boolean = False) + Public Sub New(ByVal Entity As Entity, ByVal BattleFlipped As Boolean, Optional DrawBeforeEntities As Boolean = False) MyBase.New(QueryTypes.MoveAnimation) Me.AnimationSequence = New List(Of BattleAnimation3D) Me.SpawnedEntities = New List(Of Entity) Me.DrawBeforeEntities = DrawBeforeEntities Me.BattleFlipped = BattleFlipped - If entity IsNot Nothing Then - Me.CurrentEntity = entity - Me.StartPosition = entity.Position + Me.Backgrounds = New List(Of Entity) + Me.RenderObjects = New List(Of Entity) + + If Entity IsNot Nothing Then + Me.CurrentEntity = Entity End If AnimationSequenceBegin() End Sub Public Overrides Sub Draw(ByVal BV2Screen As BattleScreen) - Dim Backgrounds As New List(Of Entity) - - Dim RenderObjects As New List(Of Entity) For Each a As BattleAnimation3D In Me.AnimationSequence - If a.AnimationType = BattleAnimation3D.AnimationTypes.Background Then + If Backgrounds.Contains(a) = False AndAlso a.AnimationType = BattleAnimation3D.AnimationTypes.Background Then Backgrounds.Add(a) End If Next For Each entity As BattleAnimation3D In Me.SpawnedEntities - RenderObjects.Add(entity) + If RenderObjects.Contains(entity) = False Then + RenderObjects.Add(entity) + End If Next If RenderObjects.Count > 0 Then RenderObjects = (From r In RenderObjects Order By r.CameraDistance Descending).ToList() @@ -54,6 +57,8 @@ Namespace BattleSystem [Object].UpdateModel() [Object].Render() Next + RenderObjects.Clear() + Backgrounds.Clear() End Sub Public Overrides Sub Update(BV2Screen As BattleScreen) @@ -98,6 +103,9 @@ Namespace BattleSystem End Sub Public Sub AnimationSequenceEnd() + SpawnedEntities.Clear() + Backgrounds.Clear() + RenderObjects.Clear() AnimationEnded = True End Sub @@ -194,7 +202,7 @@ Namespace BattleSystem AnimationSequence.Add(baEntityMove) End Sub - Public Sub AnimationOscillateMove(ByRef Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal Distance As Vector3, ByVal Speed As Single, ByVal BothWays As Boolean, ByVal Duration As Single, ByVal startDelay As Single, ByVal endDelay As Single, Optional MovementCurve As Integer = 0, Optional ReturnToStart As Vector3 = Nothing) + Public Sub AnimationOscillateMove(ByVal Entity As Entity, ByVal RemoveEntityAfter As Boolean, ByVal Distance As Vector3, ByVal Speed As Single, ByVal BothWays As Boolean, ByVal Duration As Single, ByVal startDelay As Single, ByVal endDelay As Single, Optional MovementCurve As Integer = 0, Optional ReturnToStart As Vector3 = Nothing) Dim MoveEntity As Entity Dim ReturnPosition As New Vector3(0) @@ -306,7 +314,7 @@ Namespace BattleSystem AnimationSequence.Add(BAEntityFaceRotate) End Sub - Public Sub AnimationScale(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 = "") + Public Sub AnimationScale(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 = "", Optional SpeedMultiplier As Vector3 = Nothing) Dim ScaleEntity As Entity If Entity Is Nothing Then ScaleEntity = CurrentEntity @@ -322,7 +330,7 @@ Namespace BattleSystem Dim Scale As Vector3 = ScaleEntity.Scale Dim EndSize As Vector3 = New Vector3(EndSizeX, EndSizeY, EndSizeZ) - Dim baEntityScale As BAEntityScale = New BAEntityScale(ScaleEntity, RemoveEntityAfter, Scale, Grow, EndSize, SizeSpeed, startDelay, endDelay, Anchors) + Dim baEntityScale As BAEntityScale = New BAEntityScale(ScaleEntity, RemoveEntityAfter, Scale, Grow, EndSize, SizeSpeed, startDelay, endDelay, Anchors, SpeedMultiplier) AnimationSequence.Add(baEntityScale) End Sub