mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-30 01:05:22 +02:00
added night theme for wild battles
This commit is contained in:
parent
cee683452e
commit
7a920335d4
BIN
P3D/Content/Songs/intro/johto_wild_night.ogg
Normal file
BIN
P3D/Content/Songs/intro/johto_wild_night.ogg
Normal file
Binary file not shown.
BIN
P3D/Content/Songs/johto_wild_night.ogg
Normal file
BIN
P3D/Content/Songs/johto_wild_night.ogg
Normal file
Binary file not shown.
BIN
P3D/Content/Songs/johto_wild_night_intro.ogg
Normal file
BIN
P3D/Content/Songs/johto_wild_night_intro.ogg
Normal file
Binary file not shown.
@ -19,6 +19,15 @@
|
|||||||
Dim startTime As Date
|
Dim startTime As Date
|
||||||
Dim duration As TimeSpan
|
Dim duration As TimeSpan
|
||||||
|
|
||||||
|
Public Enum BattleType As Integer
|
||||||
|
PVP = 0
|
||||||
|
TRAINER = 1
|
||||||
|
SAFARI = 2
|
||||||
|
BUG_CATCHING = 3
|
||||||
|
ROAMING = 4
|
||||||
|
WILD = 5
|
||||||
|
End Enum
|
||||||
|
|
||||||
Public MusicLoop As String = ""
|
Public MusicLoop As String = ""
|
||||||
|
|
||||||
Public Sub New(ByVal OldScreen As Screen, ByVal NewScreen As Screen, ByVal IntroType As Integer)
|
Public Sub New(ByVal OldScreen As Screen, ByVal NewScreen As Screen, ByVal IntroType As Integer)
|
||||||
@ -33,6 +42,11 @@
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If World.IsNight() Then
|
||||||
|
musicLoop = Screen.Level.CurrentRegion.Split(CChar(","))(0) & "_wild_night_intro"
|
||||||
|
'musicLoop = "kanto_wild_intro"
|
||||||
|
End If
|
||||||
|
|
||||||
If MusicManager.SongExists(musicLoop) = False Then
|
If MusicManager.SongExists(musicLoop) = False Then
|
||||||
musicLoop = "johto_wild_intro"
|
musicLoop = "johto_wild_intro"
|
||||||
End If
|
End If
|
||||||
@ -51,6 +65,10 @@
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If World.IsNight() Then
|
||||||
|
MusicLoop = Screen.Level.CurrentRegion.Split(CChar(","))(0) & "_wild_night_intro"
|
||||||
|
End If
|
||||||
|
|
||||||
If MusicManager.SongExists(MusicLoop) = False Then
|
If MusicManager.SongExists(MusicLoop) = False Then
|
||||||
MusicLoop = "johto_wild_intro"
|
MusicLoop = "johto_wild_intro"
|
||||||
End If
|
End If
|
||||||
@ -550,29 +568,27 @@
|
|||||||
MusicManager.Playlist.Clear()
|
MusicManager.Playlist.Clear()
|
||||||
MusicManager.outputDevice.Stop()
|
MusicManager.outputDevice.Stop()
|
||||||
If BattleSystem.BattleScreen.CustomBattleMusic = "" OrElse MusicManager.SongExists(BattleSystem.BattleScreen.CustomBattleMusic) = False Then
|
If BattleSystem.BattleScreen.CustomBattleMusic = "" OrElse MusicManager.SongExists(BattleSystem.BattleScreen.CustomBattleMusic) = False Then
|
||||||
|
Dim battleType = BattleIntroScreen.BattleType.WILD
|
||||||
If b.IsPVPBattle = True Then
|
If b.IsPVPBattle = True Then
|
||||||
MusicManager.Play(MusicLoop, False, 0.0F, True, "pvp")
|
battleType = BattleIntroScreen.BattleType.PVP
|
||||||
Else
|
Else
|
||||||
If b.IsTrainerBattle = True Then
|
If b.IsTrainerBattle = True Then
|
||||||
MusicManager.Play(MusicLoop, False, 0.0F, True, Trainer.GetBattleMusicName())
|
battleType = BattleIntroScreen.BattleType.TRAINER
|
||||||
ElseIf Screen.Level.IsSafariZone = True Or Screen.Level.IsBugCatchingContest = True Then
|
ElseIf Screen.Level.IsSafariZone = True Then
|
||||||
If MusicManager.SongExists(Screen.Level.CurrentRegion.Split(CChar(","))(0) & "_wild") = True Then
|
battleType = BattleIntroScreen.BattleType.SAFARI
|
||||||
MusicManager.Play(MusicLoop, False, 0.0F, True, Screen.Level.CurrentRegion.Split(CChar(","))(0) & "_wild")
|
ElseIf Screen.Level.IsBugCatchingContest = True Then
|
||||||
Else
|
battleType = BattleIntroScreen.BattleType.BUG_CATCHING
|
||||||
MusicManager.Play(MusicLoop, False, 0.0F, True, "johto_wild")
|
|
||||||
End If
|
|
||||||
Else
|
Else
|
||||||
If BattleSystem.BattleScreen.RoamingBattle = True AndAlso BattleSystem.BattleScreen.RoamingPokemonStorage.MusicLoop <> "" AndAlso MusicManager.SongExists(BattleSystem.BattleScreen.RoamingPokemonStorage.MusicLoop) = True Then
|
If BattleSystem.BattleScreen.RoamingBattle = True Then
|
||||||
MusicManager.Play(MusicLoop, True, 0.0F, True, BattleSystem.BattleScreen.RoamingPokemonStorage.MusicLoop)
|
battleType = BattleIntroScreen.BattleType.ROAMING
|
||||||
Else
|
Else
|
||||||
If MusicManager.SongExists(Screen.Level.CurrentRegion.Split(CChar(","))(0) & "_wild") = True Then
|
battleType = BattleIntroScreen.BattleType.WILD
|
||||||
MusicManager.Play(MusicLoop, False, 0.0F, True, Screen.Level.CurrentRegion.Split(CChar(","))(0) & "_wild")
|
|
||||||
Else
|
|
||||||
MusicManager.Play(MusicLoop, False, 0.0F, True, "johto_wild")
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Dim loopSong = GetLoopSong(battleType)
|
||||||
|
MusicManager.Play(MusicLoop, True, 0.0F, True, loopSong)
|
||||||
Else
|
Else
|
||||||
MusicManager.Play(MusicLoop, True, 0.0F, True, BattleSystem.BattleScreen.CustomBattleMusic)
|
MusicManager.Play(MusicLoop, True, 0.0F, True, BattleSystem.BattleScreen.CustomBattleMusic)
|
||||||
End If
|
End If
|
||||||
@ -592,6 +608,55 @@
|
|||||||
Me.startTime = Date.Now
|
Me.startTime = Date.Now
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Function GetLoopSong(battleType As BattleIntroScreen.BattleType) As String
|
||||||
|
'pvp battle
|
||||||
|
'trainer battle
|
||||||
|
'safari zone
|
||||||
|
'bug catching contest
|
||||||
|
'roaming battle
|
||||||
|
'wild pokemon
|
||||||
|
Dim fallbackLoopSong = "johto_wild"
|
||||||
|
Dim loopSong = Screen.Level.CurrentRegion.Split(CChar(","))(0) & "_wild"
|
||||||
|
If battleType = BattleIntroScreen.BattleType.PVP Then
|
||||||
|
loopSong = "pvp"
|
||||||
|
ElseIf battleType = BattleIntroScreen.BattleType.TRAINER Then
|
||||||
|
fallbackLoopSong = Trainer.GetBattleMusicName()
|
||||||
|
loopSong = Trainer.GetBattleMusicName()
|
||||||
|
ElseIf battleType = BattleIntroScreen.BattleType.SAFARI Then
|
||||||
|
fallbackLoopSong = "johto_wild"
|
||||||
|
loopSong = Screen.Level.CurrentRegion.Split(CChar(","))(0) & "_wild"
|
||||||
|
If World.IsNight() Then
|
||||||
|
loopSong = Screen.Level.CurrentRegion.Split(CChar(","))(0) & "_wild_night"
|
||||||
|
fallbackLoopSong = "johto_wild_night"
|
||||||
|
End If
|
||||||
|
ElseIf battleType = BattleIntroScreen.BattleType.BUG_CATCHING Then
|
||||||
|
fallbackLoopSong = "johto_wild"
|
||||||
|
loopSong = Screen.Level.CurrentRegion.Split(CChar(","))(0) & "_wild"
|
||||||
|
If World.IsNight() Then
|
||||||
|
loopSong = Screen.Level.CurrentRegion.Split(CChar(","))(0) & "_wild_night"
|
||||||
|
fallbackLoopSong = "johto_wild_night"
|
||||||
|
End If
|
||||||
|
ElseIf battleType = BattleIntroScreen.BattleType.ROAMING Then
|
||||||
|
If BattleSystem.BattleScreen.RoamingPokemonStorage.MusicLoop <> "" Then
|
||||||
|
loopSong = BattleSystem.BattleScreen.RoamingPokemonStorage.MusicLoop
|
||||||
|
End If
|
||||||
|
ElseIf battleType = BattleIntroScreen.BattleType.WILD Then
|
||||||
|
fallbackLoopSong = "johto_wild"
|
||||||
|
loopSong = Screen.Level.CurrentRegion.Split(CChar(","))(0) & "_wild"
|
||||||
|
If World.IsNight() Then
|
||||||
|
loopSong = Screen.Level.CurrentRegion.Split(CChar(","))(0) & "_wild_night"
|
||||||
|
fallbackLoopSong = "johto_wild_night"
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
Console.WriteLine("Unknown Battle Type: " & battleType)
|
||||||
|
End If
|
||||||
|
|
||||||
|
If MusicManager.SongExists(loopSong) = True Then
|
||||||
|
Return loopSong
|
||||||
|
End If
|
||||||
|
Return fallbackLoopSong
|
||||||
|
End Function
|
||||||
|
|
||||||
Private Function SongOver() As Boolean
|
Private Function SongOver() As Boolean
|
||||||
Return startTime + duration < Date.Now
|
Return startTime + duration < Date.Now
|
||||||
End Function
|
End Function
|
||||||
|
@ -982,4 +982,9 @@ endsub:
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Public Shared Function IsNight() As Boolean
|
||||||
|
Dim currentTime = GetTime()
|
||||||
|
Return currentTime.Equals(DayTimes.Night) Or currentTime.Equals(DayTimes.Morning)
|
||||||
|
End Function
|
||||||
|
|
||||||
End Class
|
End Class
|
Loading…
x
Reference in New Issue
Block a user