P3D-Legacy/P3D/Pokemon/Items/KeyItems/ItemFinder.vb

43 lines
1.3 KiB
VB.net
Raw Normal View History

Namespace Items.KeyItems
2016-09-07 18:50:38 +02:00
<Item(55, "Itemfinder")>
2016-09-07 18:50:38 +02:00
Public Class ItemFinder
2016-09-20 06:03:05 +02:00
Inherits KeyItem
2016-09-07 18:50:38 +02:00
2016-09-20 06:03:05 +02:00
Public Overrides ReadOnly Property Description As String = "It checks for unseen items in the area and makes noise and lights when it finds something."
Public Overrides ReadOnly Property CanBeUsed As Boolean = True
2016-09-07 18:50:38 +02:00
2016-09-20 06:03:05 +02:00
Public Sub New()
_textureRectangle = New Rectangle(192, 48, 24, 24)
2016-09-07 18:50:38 +02:00
End Sub
Public Overrides Sub Use()
Dim found As Boolean = False
For Each e As Entity In Screen.Level.Entities
If e.EntityID = "ItemObject" Then
Dim i As ItemObject = CType(e, ItemObject)
If i.IsHiddenItem() = True Then
i.Opacity = 1.0F
i.Visible = True
found = True
End If
End If
Next
While Core.CurrentScreen.Identification <> Screen.Identifications.OverworldScreen
Core.SetScreen(Core.CurrentScreen.PreScreen)
End While
If found = False Then
Screen.TextBox.Show("No hidden items.", {}, True, False)
Else
SoundManager.PlaySound("itemfinder", False)
End If
End Sub
End Class
End Namespace