mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-08-29 21:58:41 +02:00
* Replaced existing Gen 2 SFX with better sounding ones (no ugly reverb) Replaced MediaPlayer with NAudio(and NAudio.Vorbis) for playing music in order to fix random stopping issues. The game now directly loads .ogg files instead of the .wma/.xnb combination from before. ContentPacks are now able to replace Music and SFX again (I haven't added a menu yet for choosing ContentPacks). To make older GameModes work with current versions, you can add the GameMode property EnterType and set it to "1", this will make the game use the older 2D NewGameScreen. * Delete GameController.vb * Add gamecontroller.vb back * Fix sfx missing * Battleintro doodle now doesn't loop anymore (for no trainer) Changed the shutter sound (aka Large Door sound) to something more large door-y Made the enter sound slightly louder The enter sound now plays when going through any warp to or from an indoor map (including falling through holes) The flying sound effect is played earlier in the animation after selecting a location Changed played sound effect when using the Escape Rope to "teleport" instead of "destroy" The bump noise now also plays when bumping into something in first person Fixed small gap between the end of the intro song and the start of the main song Replaced some songs with better songs * Fixed some more intro issues * Forgot to change a thing * Fixed an error where the main music would play, ignoring the muted musicmanager. * fix indenting in musicmanager * The music player will now only start playback on a new song if the music player is not muted, fixed the end time calculation of the intro of a song after muting, Music can't be unmuted now as long as a sound effect plays that stops the music. * Fixed league restplace position, fixed sound effects sharing the volume slider of the music, sound effects are now also muted when pressing M, changed music on/off popup to audio on/off, removed bump delay in first person, added more control on whether played songs should be looping or not. * Fixed some more scripts that turn on thirdperson mode but don't check if it was on before or set it back to what it was before afterwards, also fixed a small error in creditsscreen.vb. * Fixed indenting error in musicmanager.vb, fixed an error of mine where the loopsong parameter would be seen as the playintro parameter. * Added more music commands, added quite some menu select noises, will add more later * More select sound effects! * Fix music not resuming after soundeffect * Trainer using item now plays the single_heal soundeffect * Pokémon cries now sound louder * Possibly fixing crash when playing Pokémon cry at volume higher than 0.71 * Added better quality Pokémon cries, made random overworld cries slightly less loud, added cries for 719 and 720. * Sound effects now sound louder * Revert "Added better quality Pokémon cries, made random overworld cries slightly less loud, added cries for 719 and 720." This reverts commit 8c9296ed1a82144d17f303a52c3f2e9e65a5bfea. * Fixed the cause of why the title screen music plays even when the game is muted * Tabs to spaces * Revert Co-authored-by: darkfire006 <blazer257@live.com> Co-authored-by: JappaWakkaP3D <66885565+JappaWakkaP3D@users.noreply.github.com> Co-authored-by: JappaWakkaP3D <jasper.speelman@outlook.com> Co-authored-by: Vitaly Mikhailov <personal@aragas.org>
165 lines
7.2 KiB
VB.net
165 lines
7.2 KiB
VB.net
Public Class BlackOutScreen
|
|
|
|
Inherits Screen
|
|
|
|
Dim BattleScreen As BattleSystem.BattleScreen
|
|
Dim index As Integer = 0
|
|
Dim textIndex As Integer = 0
|
|
Dim Text() As String = {Localization.GetString("black_out_screen_line1"), Environment.NewLine, " ", Localization.GetString("black_out_screen_line2"), Localization.GetString("black_out_screen_line3"), Localization.GetString("black_out_screen_line4"), Localization.GetString("black_out_screen_line5")}
|
|
Dim ready As Boolean = False
|
|
Dim delay As Single = 0.2F
|
|
|
|
Dim IsGameOver As Boolean = False
|
|
|
|
Dim FromBattle As Boolean = True
|
|
|
|
Public Sub New(ByVal BattleScreen As BattleSystem.BattleScreen)
|
|
Me.BattleScreen = BattleScreen
|
|
Me.Identification = Identifications.BlackOutScreen
|
|
|
|
Me.IsGameOver = CBool(GameModeManager.GetGameRuleValue("GameOverAt0Pokemon", "0"))
|
|
|
|
FromBattle = True
|
|
End Sub
|
|
|
|
Public Sub New(ByVal currentScreen As Screen)
|
|
Me.PreScreen = currentScreen
|
|
Me.Identification = Identifications.BlackOutScreen
|
|
|
|
Me.IsGameOver = CBool(GameModeManager.GetGameRuleValue("GameOverAt0Pokemon", "0"))
|
|
|
|
FromBattle = False
|
|
End Sub
|
|
|
|
Public Overrides Sub Update()
|
|
If Me.IsGameOver = True Then
|
|
If Controls.Accept(True, False) = True Then
|
|
SoundManager.PlaySound("select")
|
|
Core.SetScreen(New PressStartScreen())
|
|
Core.Player.loadedSave = False
|
|
End If
|
|
Else
|
|
If Me.ready = False Then
|
|
If delay > 0.0F Then
|
|
delay -= 0.1F
|
|
If delay <= 0.0F Then
|
|
delay = 0.2F
|
|
ProceedText()
|
|
End If
|
|
End If
|
|
Else
|
|
If Controls.Accept(True, True) = True Then
|
|
SoundManager.PlaySound("pokemon_heal")
|
|
|
|
If FromBattle = True Then
|
|
Core.Player.HealParty()
|
|
ChangeScreen()
|
|
|
|
ChangeFromSurfRideTexture()
|
|
|
|
Screen.Level.Load(Core.Player.LastRestPlace)
|
|
Screen.Level.OverworldPokemon.Visible = False
|
|
Screen.Level.World.Initialize(Screen.Level.EnvironmentType, Screen.Level.WeatherType)
|
|
Dim positionString() As String = Core.Player.LastRestPlacePosition.Split(CChar(","))
|
|
CType(BattleScreen.SavedOverworld.Camera, OverworldCamera).YawLocked = False
|
|
Screen.Camera.Yaw = MathHelper.Pi
|
|
Screen.Camera.Position = New Vector3(CSng(positionString(0).Replace(".", GameController.DecSeparator)), CSng(positionString(1).Replace(".", GameController.DecSeparator)), CSng(positionString(2).Replace(".", GameController.DecSeparator)))
|
|
CType(BattleScreen.SavedOverworld.OverworldScreen, OverworldScreen).ActionScript.Scripts.Clear()
|
|
|
|
Core.SetScreen(New TransitionScreen(Me, BattleScreen.SavedOverworld.OverworldScreen, Color.Black, False))
|
|
Else
|
|
Core.Player.HealParty()
|
|
|
|
ChangeFromSurfRideTexture()
|
|
|
|
Screen.Level.Load(Core.Player.LastRestPlace)
|
|
Screen.Level.OverworldPokemon.Visible = False
|
|
Screen.Level.World.Initialize(Screen.Level.EnvironmentType, Screen.Level.WeatherType)
|
|
|
|
Dim positionString() As String = Core.Player.LastRestPlacePosition.Split(CChar(","))
|
|
CType(BattleScreen.SavedOverworld.Camera, OverworldCamera).YawLocked = False
|
|
Screen.Camera.Yaw = MathHelper.Pi
|
|
Screen.Camera.Position = New Vector3(CSng(positionString(0).Replace(".", GameController.DecSeparator)), CSng(positionString(1).Replace(".", GameController.DecSeparator)), CSng(positionString(2).Replace(".", GameController.DecSeparator)))
|
|
CType(BattleScreen.SavedOverworld.OverworldScreen, OverworldScreen).ActionScript.Scripts.Clear()
|
|
|
|
While Core.CurrentScreen.Identification <> Identifications.OverworldScreen
|
|
Core.SetScreen(Core.CurrentScreen.PreScreen)
|
|
End While
|
|
End If
|
|
End If
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
Public Overrides Sub Draw()
|
|
Canvas.DrawRectangle(New Rectangle(0, 0, Core.windowSize.Width, Core.windowSize.Height), Color.Black)
|
|
|
|
If IsGameOver = True Then
|
|
Core.SpriteBatch.DrawString(FontManager.InGameFont, "GAME OVER", New Vector2(CInt(Core.windowSize.Width / 2) - CInt(FontManager.InGameFont.MeasureString("GAME OVER").X / 2), 100), Color.White)
|
|
Else
|
|
Dim f As SpriteFont = FontManager.MiniFont
|
|
Dim aText As String = ""
|
|
For i = 0 To textIndex
|
|
If i <> textIndex Then
|
|
aText &= Text(i) & Environment.NewLine
|
|
Else
|
|
If textIndex < Text.Count() Then
|
|
aText &= Text(i).Remove(index)
|
|
End If
|
|
End If
|
|
Next
|
|
|
|
Dim p As New Vector2(CSng(Core.windowSize.Width / 2 - f.MeasureString(aText).X / 2), CSng(Core.windowSize.Height / 2 - (f.MeasureString(aText).Y) / 2))
|
|
|
|
Core.SpriteBatch.DrawString(FontManager.MiniFont, aText, p, Color.White)
|
|
End If
|
|
|
|
If Me.IsGameOver = True Or Me.ready = True Then
|
|
Dim d As New Dictionary(Of Buttons, String)
|
|
d.Add(Buttons.A, "Accept")
|
|
DrawGamePadControls(d)
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub ChangeScreen()
|
|
Screen.Level = BattleScreen.SavedOverworld.Level
|
|
Screen.Camera = BattleScreen.SavedOverworld.Camera
|
|
Screen.Effect = BattleScreen.SavedOverworld.Effect
|
|
Screen.SkyDome = BattleScreen.SavedOverworld.SkyDome
|
|
Screen.Level.World.Initialize(Screen.Level.EnvironmentType, Screen.Level.WeatherType)
|
|
End Sub
|
|
|
|
Private Sub ProceedText()
|
|
If index >= Text(textIndex).Length - 1 Then
|
|
index = 0
|
|
textIndex += 1
|
|
If textIndex > Text.Count() - 1 Then
|
|
Me.ready = True
|
|
End If
|
|
Else
|
|
index += 1
|
|
End If
|
|
End Sub
|
|
|
|
Public Overrides Sub ChangeTo()
|
|
MusicManager.PlayNoMusic()
|
|
Core.Player.Inventory.RemoveItem(177) ' Remove all Park Balls (happens regardless of whether or not the player was currently in the Bug-Catching Contest).
|
|
PlayerStatistics.Track("Blackouts", 1)
|
|
End Sub
|
|
|
|
Private Sub ChangeFromSurfRideTexture()
|
|
If Screen.Level.Riding = True Then
|
|
Screen.Level.Riding = False
|
|
Screen.Level.OwnPlayer.SetTexture(Core.Player.TempRideSkin, True)
|
|
Core.Player.Skin = Core.Player.TempRideSkin
|
|
End If
|
|
If Screen.Level.Surfing = True Then
|
|
Screen.Level.Surfing = False
|
|
Screen.Level.OwnPlayer.SetTexture(Core.Player.TempSurfSkin, True)
|
|
Core.Player.Skin = Core.Player.TempSurfSkin
|
|
End If
|
|
Screen.Level.OverworldPokemon.warped = True
|
|
Screen.Level.OverworldPokemon.Visible = False
|
|
End Sub
|
|
|
|
End Class |