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

76 lines
3.1 KiB
VB.net
Raw Normal View History

Namespace Items.KeyItems
2016-09-07 18:50:38 +02:00
<Item(6, "Bicycle")>
2016-09-07 18:50:38 +02:00
Public Class Bicycle
2016-09-20 06:03:05 +02:00
Inherits KeyItem
Public Overrides ReadOnly Property CanBeUsed As Boolean = True
2016-09-20 06:03:05 +02:00
Public Overrides ReadOnly Property Description As String = "A folding Bicycle that enables much faster movement than the Running Shoes."
2016-09-07 18:50:38 +02:00
2016-09-20 06:03:05 +02:00
Public Sub New()
_textureRectangle = New Rectangle(120, 0, 24, 24)
2016-09-07 18:50:38 +02:00
End Sub
Public Overrides Sub Use()
If GameModeManager.ActiveGameMode.IsDefaultGamemode = False AndAlso Core.Player.IsGameJoltSave = False Then
If Screen.Level.Riding = True Then
Screen.Level.Riding = False
Screen.Level.OwnPlayer.SetTexture(Core.Player.TempRideSkin, True)
Core.Player.Skin = Core.Player.TempRideSkin
2023-08-05 13:26:48 +02:00
Screen.TextBox.Show("<player.name> stepped~off the Bicycle.")
While Core.CurrentScreen.Identification <> Screen.Identifications.OverworldScreen
Core.CurrentScreen = Core.CurrentScreen.PreScreen
End While
If Screen.Level.IsRadioOn = False OrElse GameJolt.PokegearScreen.StationCanPlay(Screen.Level.SelectedRadioStation) = False Then
MusicManager.Play(Screen.Level.MusicLoop)
End If
Else
If Screen.Level.Surfing = False AndAlso Screen.Level.Riding = False AndAlso Screen.Camera.IsMoving() = False AndAlso Screen.Camera.Turning = False And Screen.Level.CanRide() = True Then
Dim BikeSkin As String = Core.Player.Skin & "_Bike"
If File.Exists(GameController.GamePath & GameModeManager.ActiveGameMode.ContentPath & "Textures\NPC\" & BikeSkin & ".png") = True Then
Core.Player.TempRideSkin = Core.Player.Skin
Screen.Level.Riding = True
Screen.Level.OwnPlayer.SetTexture(BikeSkin, False)
Core.Player.Skin = BikeSkin
Dim s As Screen = CurrentScreen
While s.Identification <> Screen.Identifications.OverworldScreen
s = s.PreScreen
End While
If s.Identification = Screen.Identifications.OverworldScreen Then
Core.SetScreen(s)
If GameModeManager.ContentFileExists("Sounds\Bicycle.wav") OrElse GameModeManager.ContentFileExists("Sounds\Bicycle.xnb") Then
SoundManager.PlaySound("Bicycle")
End If
Dim RideMusicPath As String = "Songs\" & "Ride_" & Screen.Level.CurrentRegion
If GameModeManager.ContentFileExists(RideMusicPath & ".ogg") OrElse GameModeManager.ContentFileExists(RideMusicPath & ".mp3") OrElse GameModeManager.ContentFileExists(RideMusicPath & ".wma") Then
MusicManager.Play("Ride_" & Screen.Level.CurrentRegion, True)
Else
MusicManager.Play("Ride", True)
End If
Else
Screen.TextBox.Show("Now is not the time~to use that.", {}, True, True)
End If
Else
Screen.TextBox.Show("You can't use this item~without a bicycle skin.*Its name should be the~same as your current one,~but with ""_bike"" at the end.", {}, True, False)
End If
Else
Screen.TextBox.Show("Now is not the time~to use that.", {}, True, True)
End If
End If
Else
Screen.TextBox.Show("This item can't be used~on this GameMode.", {}, True, True)
End If
End Sub
End Class
2016-09-07 18:50:38 +02:00
End Namespace