mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-31 01:35:20 +02:00
Ported Battle Animation Code Ported Battle Animations for Tackle, Pound, Growl, Ember and Poison Sting Normalized all SFX by Perceived Loudness (-11.0 LUFS) Renamed and moved a bunch of the SFX so they make more sense Added a jingle when you register a Phone Number Added a soundeffect for when an elevator reaches its destination
106 lines
3.3 KiB
VB.net
106 lines
3.3 KiB
VB.net
Public Class BASize
|
|
|
|
Inherits BattleAnimation3D
|
|
|
|
Public Grow As Boolean = False
|
|
Public EndSize As Vector3
|
|
Public SizeSpeed As Single = 0.01F
|
|
Public Anchors As String
|
|
|
|
Public Change As New Vector3(1)
|
|
|
|
Public Sub New(ByVal Position As Vector3, ByVal Texture As Texture2D, 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)
|
|
MyBase.New(Position, Texture, Scale, startDelay, endDelay)
|
|
|
|
Me.Anchors = Anchors
|
|
Me.Grow = Grow
|
|
Me.EndSize = EndSize
|
|
Me.SizeSpeed = SizeSpeed
|
|
|
|
Me.AnimationType = AnimationTypes.Size
|
|
End Sub
|
|
|
|
Public Overrides Sub DoActionActive()
|
|
Dim saveScale As Vector3 = Me.Scale
|
|
|
|
Dim changeX As Single = SizeSpeed * Change.X
|
|
Dim changeY As Single = SizeSpeed * Change.Y
|
|
Dim changeZ As Single = SizeSpeed * Change.Z
|
|
|
|
If Grow = True Then
|
|
If Me.Scale.X < Me.EndSize.X Then
|
|
Me.Scale.X += changeX
|
|
|
|
If Me.Scale.X >= Me.EndSize.X Then
|
|
Me.Scale.X = Me.EndSize.X
|
|
End If
|
|
End If
|
|
If Me.Scale.Y < Me.EndSize.Y Then
|
|
Me.Scale.Y += changeY
|
|
|
|
If Me.Scale.Y >= Me.EndSize.Y Then
|
|
Me.Scale.Y = Me.EndSize.Y
|
|
End If
|
|
End If
|
|
If Me.Scale.Z < Me.EndSize.Z Then
|
|
Me.Scale.Z += changeZ
|
|
|
|
If Me.Scale.Z >= Me.EndSize.Z Then
|
|
Me.Scale.Z = Me.EndSize.Z
|
|
End If
|
|
End If
|
|
Else
|
|
If Me.Scale.X > Me.EndSize.X Then
|
|
Me.Scale.X -= changeX
|
|
|
|
If Me.Scale.X <= Me.EndSize.X Then
|
|
Me.Scale.X = Me.EndSize.X
|
|
End If
|
|
End If
|
|
If Me.Scale.Y > Me.EndSize.Y Then
|
|
Me.Scale.Y -= changeY
|
|
|
|
If Me.Scale.Y <= Me.EndSize.Y Then
|
|
Me.Scale.Y = Me.EndSize.Y
|
|
End If
|
|
End If
|
|
If Me.Scale.Z > Me.EndSize.Z Then
|
|
Me.Scale.Z -= changeZ
|
|
|
|
If Me.Scale.Z <= Me.EndSize.Z Then
|
|
Me.Scale.Z = Me.EndSize.Z
|
|
End If
|
|
End If
|
|
End If
|
|
|
|
'Bottom
|
|
If Anchors.Contains("1") = True Then
|
|
Dim diffY As Single = saveScale.Y - Me.Scale.Y
|
|
Me.Position.Y -= diffY / 2
|
|
End If
|
|
'Top
|
|
If Anchors.Contains("2") = True Then
|
|
Dim diffY As Single = saveScale.Y - Me.Scale.Y
|
|
Me.Position.Y += diffY / 2
|
|
End If
|
|
'Left
|
|
If Anchors.Contains("3") = True Then
|
|
Dim diffX As Single = saveScale.X - Me.Scale.X
|
|
Me.Position.X -= diffX / 2
|
|
End If
|
|
'Right
|
|
If Anchors.Contains("4") = True Then
|
|
Dim diffX As Single = saveScale.X - Me.Scale.X
|
|
Me.Position.X += diffX / 2
|
|
End If
|
|
|
|
If Me.EndSize = Me.Scale Then
|
|
Me.Ready = True
|
|
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
|
|
|
|
End Class |