Prepared funcionality for sparkling mega stones

This commit is contained in:
CaptainSegis 2018-01-21 14:38:05 -05:00
parent f046a5ec1d
commit bc24c67bae
3 changed files with 57 additions and 34 deletions

View File

@ -12,6 +12,7 @@
Dim AnimationPath As String = ""
Dim X, Y, width, height, rows, columns, animationSpeed, startRow, startColumn As Integer
Dim CurrentRectangle As New Rectangle(0, 0, 0, 0)
Dim CanInteractWith As Boolean = True
Public Overloads Sub Initialize(Optional ByVal AnimationData As List(Of List(Of Integer)) = Nothing)
MyBase.Initialize()
@ -26,6 +27,7 @@
Me.Visible = False
Me.Collision = False
ElseIf Me.ActionValue = 2 Then
If Core.Player.Inventory.HasMegaBracelet() Then
Me.Visible = Visible
'sparkles
If AnimationData IsNot Nothing Then
@ -54,6 +56,12 @@
CreateAnimationTextureTemp()
Me.Animation = New Animation(TextureManager.GetTexture("Textures\Routes"), rows, columns, 16, 16, animationSpeed, startRow, startColumn)
Else
Me.Visible = False
Me.Collision = False
CanInteractWith = False
End If
End If
Me.NeedsUpdate = True
@ -130,6 +138,7 @@
End Sub
Public Overrides Sub ClickFunction()
If CanInteractWith Then
RemoveItem(Me)
SoundManager.PlaySound("item_found", True)
Screen.TextBox.TextColor = TextBox.PlayerColor
@ -138,6 +147,7 @@
PlayerStatistics.Track("Items found", 1)
Core.Player.AddPoints(1, "Found an item.")
End If
End Sub
Public Overrides Sub Render()

View File

@ -144,6 +144,19 @@ Public Class PlayerInventory
End Get
End Property
''' <summary>
''' If the player has the Mega Bracelet in their inventory.
''' </summary>
Public ReadOnly Property HasMegaBracelet() As Boolean
Get
If Me.GetItemAmount(576) > 0 Then
Return True
End If
Return False
End Get
End Property
''' <summary>
''' Returns a message that displays the event of putting an item into the inventory.
''' </summary>

Binary file not shown.