mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-25 14:54:48 +02:00
Battle Updates
* Shift Battlestyle Implemented * Bugs related to switching Pokémon with Battle Animations off fixed
This commit is contained in:
parent
e7d20185f3
commit
d934a947aa
@ -5341,11 +5341,11 @@
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
ChangeCameraAngle(0, True, BattleScreen)
|
|
||||||
|
|
||||||
Dim cq1 As ScreenFadeQueryObject = New ScreenFadeQueryObject(ScreenFadeQueryObject.FadeTypes.Vertical, Color.Black, True, 16)
|
Dim cq1 As ScreenFadeQueryObject = New ScreenFadeQueryObject(ScreenFadeQueryObject.FadeTypes.Vertical, Color.Black, True, 16)
|
||||||
Dim cq2 As ScreenFadeQueryObject = New ScreenFadeQueryObject(ScreenFadeQueryObject.FadeTypes.Vertical, Color.Black, False, 16)
|
Dim cq2 As ScreenFadeQueryObject = New ScreenFadeQueryObject(ScreenFadeQueryObject.FadeTypes.Vertical, Color.Black, False, 16)
|
||||||
|
|
||||||
|
|
||||||
cq2.PassThis = True
|
cq2.PassThis = True
|
||||||
|
|
||||||
BattleScreen.BattleQuery.AddRange({cq1, cq2})
|
BattleScreen.BattleQuery.AddRange({cq1, cq2})
|
||||||
@ -7415,13 +7415,16 @@
|
|||||||
Loop While SmokeSpawned <= 38
|
Loop While SmokeSpawned <= 38
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Pokemon appears
|
|
||||||
BallThrow.AnimationFade(Nothing, False, 1, True, 1, 3, 0)
|
|
||||||
BallThrow.AnimationPlaySound(CStr(BattleScreen.OwnPokemon.Number), 4, 0,, True)
|
|
||||||
|
|
||||||
If Core.Player.ShowBattleAnimations <> 0 Then
|
If Core.Player.ShowBattleAnimations <> 0 Then
|
||||||
|
' Pokemon appears
|
||||||
|
BallThrow.AnimationFade(Nothing, False, 1, True, 1, 3, 0)
|
||||||
|
BallThrow.AnimationPlaySound(CStr(BattleScreen.OwnPokemon.Number), 4, 0,, True)
|
||||||
' Pokémon falls down
|
' Pokémon falls down
|
||||||
BallThrow.AnimationMove(Nothing, False, 0, 0, 0, 0.05F, False, False, 5, 0,,, 3)
|
BallThrow.AnimationMove(Nothing, False, 0, 0, 0, 0.05F, False, False, 5, 0,,, 3)
|
||||||
|
Else
|
||||||
|
' Pokemon appears
|
||||||
|
BallThrow.AnimationFade(Nothing, False, 1, True, 1, 0, 0)
|
||||||
|
BallThrow.AnimationPlaySound(CStr(BattleScreen.OwnPokemon.Number), 0, 0,, True)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
BattleScreen.AddToQuery(InsertIndex, BallThrow)
|
BattleScreen.AddToQuery(InsertIndex, BallThrow)
|
||||||
@ -7804,7 +7807,11 @@
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Dim oppModel As String = BattleScreen.GetModelName(False)
|
Dim oppModel As String = BattleScreen.GetModelName(False)
|
||||||
|
'Switch BattleStyle
|
||||||
|
If Core.Player.BattleStyle <> 1 Then
|
||||||
|
BattleScreen.BattleQuery.Add(New SwitchPokemonQueryObject(BattleScreen, BattleScreen.OppPokemon))
|
||||||
|
ChangeCameraAngle(1, False, BattleScreen)
|
||||||
|
End If
|
||||||
If oppModel = "" Then
|
If oppModel = "" Then
|
||||||
BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(True, ToggleEntityQueryObject.BattleEntities.OppPokemon, PokemonForms.GetOverworldSpriteName(BattleScreen.OppPokemon), -1, -1, 0, 1))
|
BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(True, ToggleEntityQueryObject.BattleEntities.OppPokemon, PokemonForms.GetOverworldSpriteName(BattleScreen.OppPokemon), -1, -1, 0, 1))
|
||||||
Else
|
Else
|
||||||
@ -7839,14 +7846,19 @@
|
|||||||
Threading.Interlocked.Increment(SmokeSpawned)
|
Threading.Interlocked.Increment(SmokeSpawned)
|
||||||
Loop While SmokeSpawned <= 38
|
Loop While SmokeSpawned <= 38
|
||||||
End If
|
End If
|
||||||
' Pokemon appears
|
|
||||||
BallThrow.AnimationFade(Nothing, False, 1, True, 1, 3, 0)
|
|
||||||
BallThrow.AnimationPlaySound(CStr(BattleScreen.OppPokemon.Number), 4, 0,, True)
|
|
||||||
If Core.Player.ShowBattleAnimations <> 0 Then
|
If Core.Player.ShowBattleAnimations <> 0 Then
|
||||||
|
' Pokemon appears
|
||||||
|
BallThrow.AnimationFade(Nothing, False, 1, True, 1, 3, 0)
|
||||||
|
BallThrow.AnimationPlaySound(CStr(BattleScreen.OppPokemon.Number), 4, 0,, True)
|
||||||
' Pokémon falls down
|
' Pokémon falls down
|
||||||
BallThrow.AnimationMove(Nothing, False, 0, 0, 0, 0.05F, False, False, 5, 0)
|
BallThrow.AnimationMove(Nothing, False, 0, 0, 0, 0.05F, False, False, 5, 0)
|
||||||
BattleScreen.BattleQuery.Add(BallThrow)
|
Else
|
||||||
|
' Pokemon appears
|
||||||
|
BallThrow.AnimationFade(Nothing, False, 1, True, 1, 0, 0)
|
||||||
|
BallThrow.AnimationPlaySound(CStr(BattleScreen.OppPokemon.Number), 0, 0,, True)
|
||||||
End If
|
End If
|
||||||
|
BattleScreen.BattleQuery.Add(BallThrow)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
With BattleScreen
|
With BattleScreen
|
||||||
|
@ -442,8 +442,11 @@
|
|||||||
|
|
||||||
' Pokemon appears
|
' Pokemon appears
|
||||||
BallThrowOpp.AnimationFade(Nothing, False, 1, True, 1, 3, 0)
|
BallThrowOpp.AnimationFade(Nothing, False, 1, True, 1, 3, 0)
|
||||||
|
BallThrowOpp.AnimationPlaySound(CStr(Me.OppPokemon.Number), 4, 0,, True)
|
||||||
|
Else
|
||||||
|
BallThrowOpp.AnimationPlaySound(CStr(Me.OppPokemon.Number), 0, 0,, True)
|
||||||
End If
|
End If
|
||||||
BallThrowOpp.AnimationPlaySound(CStr(Me.OppPokemon.Number), 4, 0,, True)
|
|
||||||
|
|
||||||
' Pokémon falls down
|
' Pokémon falls down
|
||||||
If Core.Player.ShowBattleAnimations <> 0 Then
|
If Core.Player.ShowBattleAnimations <> 0 Then
|
||||||
@ -873,7 +876,7 @@
|
|||||||
If ForegroundEntities.Count > 0 Then
|
If ForegroundEntities.Count > 0 Then
|
||||||
ForegroundEntities = (From f In ForegroundEntities Order By f.CameraDistance Descending).ToList()
|
ForegroundEntities = (From f In ForegroundEntities Order By f.CameraDistance Descending).ToList()
|
||||||
End If
|
End If
|
||||||
Level.Draw()
|
Level.Draw()
|
||||||
|
|
||||||
World.DrawWeather(Screen.Level.World.CurrentMapWeather)
|
World.DrawWeather(Screen.Level.World.CurrentMapWeather)
|
||||||
|
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
Dim _text As String = ""
|
Dim _text As String = ""
|
||||||
Dim _textColor As Color = Color.White
|
Dim _textColor As Color = Color.White
|
||||||
Dim _TextReady As Boolean = False
|
|
||||||
|
|
||||||
Dim _textIndex As Integer = 0
|
Dim _textIndex As Integer = 0
|
||||||
Dim _textDelay As Single = 0.015F
|
Dim _textDelay As Single = 0.015F
|
||||||
@ -31,6 +30,7 @@
|
|||||||
Me._text = Me._text.Replace("~", " ")
|
Me._text = Me._text.Replace("~", " ")
|
||||||
Me._text = Me._text.Replace("<player.name>", Core.Player.Name)
|
Me._text = Me._text.Replace("<player.name>", Core.Player.Name)
|
||||||
Me._text = Me._text.Replace("<playername>", Core.Player.Name)
|
Me._text = Me._text.Replace("<playername>", Core.Player.Name)
|
||||||
|
Me._text = Me._text.Replace("<rival.name>", Core.Player.RivalName)
|
||||||
Me._text = Me._text.Replace("<rivalname>", Core.Player.RivalName)
|
Me._text = Me._text.Replace("<rivalname>", Core.Player.RivalName)
|
||||||
Me._text = Me._text.Replace("[POKE]", "Poké")
|
Me._text = Me._text.Replace("[POKE]", "Poké")
|
||||||
End Sub
|
End Sub
|
||||||
@ -45,10 +45,6 @@
|
|||||||
If Controls.Accept(True, True) = True And Me._textIndex > 2 Then
|
If Controls.Accept(True, True) = True And Me._textIndex > 2 Then
|
||||||
Me._textIndex = Me._text.Length
|
Me._textIndex = Me._text.Length
|
||||||
End If
|
End If
|
||||||
Else
|
|
||||||
If Controls.Accept(True, True) = True Then
|
|
||||||
Me._TextReady = True
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@ -80,7 +76,17 @@
|
|||||||
Dim _chooseIndex As Integer = 0
|
Dim _chooseIndex As Integer = 0
|
||||||
|
|
||||||
Private Sub UpdateChoose()
|
Private Sub UpdateChoose()
|
||||||
|
If Controls.Accept(True, True, True) = True Then
|
||||||
|
If _chooseIndex = 0 Then
|
||||||
|
Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), AddressOf ChoosePokemon, Localization.GetString("battle_main_choose_pokemon"), False) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True}
|
||||||
|
AddHandler selScreen.SelectedObject, AddressOf ChoosePokemonHandler
|
||||||
|
SoundManager.PlaySound("select")
|
||||||
|
Core.SetScreen(selScreen)
|
||||||
|
Else
|
||||||
|
SoundManager.PlaySound("select")
|
||||||
|
_ready = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub DrawChoose()
|
Private Sub DrawChoose()
|
||||||
@ -99,25 +105,14 @@
|
|||||||
|
|
||||||
If _chooseIndex = 0 Then
|
If _chooseIndex = 0 Then
|
||||||
Canvas.DrawRectangle(New Rectangle(Core.windowSize.Width - 213, Core.windowSize.Height - 438, 80, 50), Color.White)
|
Canvas.DrawRectangle(New Rectangle(Core.windowSize.Width - 213, Core.windowSize.Height - 438, 80, 50), Color.White)
|
||||||
Core.SpriteBatch.DrawString(FontManager.InGameFont, "Yes", New Vector2(Core.windowSize.Width - 200, Core.windowSize.Height - 430), Color.Black)
|
Core.SpriteBatch.DrawString(FontManager.InGameFont, Localization.GetString("global_yes"), New Vector2(Core.windowSize.Width - 200, Core.windowSize.Height - 430), Color.Black)
|
||||||
Core.SpriteBatch.DrawString(FontManager.InGameFont, "No", New Vector2(Core.windowSize.Width - 200, Core.windowSize.Height - 370), Color.White)
|
Core.SpriteBatch.DrawString(FontManager.InGameFont, Localization.GetString("global_no"), New Vector2(Core.windowSize.Width - 200, Core.windowSize.Height - 370), Color.White)
|
||||||
Else
|
Else
|
||||||
Canvas.DrawRectangle(New Rectangle(Core.windowSize.Width - 213, Core.windowSize.Height - 378, 80, 50), Color.White)
|
Canvas.DrawRectangle(New Rectangle(Core.windowSize.Width - 213, Core.windowSize.Height - 378, 80, 50), Color.White)
|
||||||
Core.SpriteBatch.DrawString(FontManager.InGameFont, "Yes", New Vector2(Core.windowSize.Width - 200, Core.windowSize.Height - 430), Color.White)
|
Core.SpriteBatch.DrawString(FontManager.InGameFont, Localization.GetString("global_yes"), New Vector2(Core.windowSize.Width - 200, Core.windowSize.Height - 430), Color.White)
|
||||||
Core.SpriteBatch.DrawString(FontManager.InGameFont, "No", New Vector2(Core.windowSize.Width - 200, Core.windowSize.Height - 370), Color.Black)
|
Core.SpriteBatch.DrawString(FontManager.InGameFont, Localization.GetString("global_no"), New Vector2(Core.windowSize.Width - 200, Core.windowSize.Height - 370), Color.Black)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Controls.Accept(True, True, True) = True Then
|
|
||||||
If _chooseIndex = 0 Then
|
|
||||||
Dim selScreen = New PartyScreen(Core.CurrentScreen, Item.GetItemByID(5), AddressOf ChoosePokemon, "Choose Pokémon to battle!", False) With {.Mode = Screens.UI.ISelectionScreen.ScreenMode.Selection, .CanExit = True}
|
|
||||||
AddHandler selScreen.SelectedObject, AddressOf ChoosePokemonHandler
|
|
||||||
SoundManager.PlaySound("select")
|
|
||||||
Core.SetScreen(selScreen)
|
|
||||||
Else
|
|
||||||
SoundManager.PlaySound("select")
|
|
||||||
_ready = True
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Dim TempScreen As BattleScreen
|
Dim TempScreen As BattleScreen
|
||||||
@ -127,20 +122,49 @@
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ChoosePokemon(ByVal PokeIndex As Integer)
|
Private Sub ChoosePokemon(ByVal PokeIndex As Integer)
|
||||||
TempScreen.Battle.SwitchOutOwn(TempScreen, PokeIndex, insertIndex)
|
Dim Pokemon As Pokemon = Core.Player.Pokemons(PokeIndex)
|
||||||
Me._ready = True
|
If PokeIndex = TempScreen.OwnPokemonIndex Then
|
||||||
|
Screen.TextBox.Show(Pokemon.GetDisplayName() & " is already~in battle!", {}, True, False)
|
||||||
|
Else
|
||||||
|
If Pokemon.IsEgg() = False Then
|
||||||
|
If Pokemon.Status <> P3D.Pokemon.StatusProblems.Fainted Then
|
||||||
|
If BattleCalculation.CanSwitch(TempScreen, True) = False Then
|
||||||
|
Screen.TextBox.Show("Cannot switch out.", {}, True, False)
|
||||||
|
Else
|
||||||
|
Dim TempQuery = TempScreen.BattleQuery.ToArray
|
||||||
|
If TempScreen.OwnPokemonIndex <> PokeIndex Then
|
||||||
|
If TempScreen.IsRemoteBattle = True And TempScreen.IsHost = False Then
|
||||||
|
TempScreen.OppFaint = False
|
||||||
|
TempScreen.OwnStatistics.Switches += 1
|
||||||
|
TempScreen.BattleQuery.Clear()
|
||||||
|
TempScreen.Battle.SwitchOutOwn(TempScreen, PokeIndex, TempScreen.BattleQuery.Count)
|
||||||
|
TempScreen.BattleQuery.Reverse()
|
||||||
|
TempScreen.BattleQuery.AddRange(TempQuery)
|
||||||
|
Else
|
||||||
|
TempScreen.BattleQuery.Clear()
|
||||||
|
TempScreen.Battle.SwitchOutOwn(TempScreen, PokeIndex, TempScreen.BattleQuery.Count)
|
||||||
|
TempScreen.BattleQuery.Reverse()
|
||||||
|
TempScreen.BattleQuery.AddRange(TempQuery)
|
||||||
|
End If
|
||||||
|
Me._ready = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
Screen.TextBox.Show(Pokemon.GetDisplayName() & " is fainted!", {}, True, False)
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
Screen.TextBox.Show("Cannot switch in~the egg!", {}, True, False)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Dim insertIndex As Integer = 0
|
|
||||||
|
|
||||||
Public Sub New(ByVal BattleScreen As BattleScreen, ByVal NewPokemon As Pokemon)
|
Public Sub New(ByVal BattleScreen As BattleScreen, ByVal NewPokemon As Pokemon)
|
||||||
MyBase.New(QueryTypes.SwitchPokemon)
|
MyBase.New(QueryTypes.SwitchPokemon)
|
||||||
|
|
||||||
Me.insertIndex = BattleScreen.BattleQuery.Count
|
|
||||||
Me.TempScreen = BattleScreen
|
Me.TempScreen = BattleScreen
|
||||||
TransformText(BattleScreen.Trainer.Name & " is about to send out a " & NewPokemon.GetDisplayName() & "! Do you want to switch your Pokémon?")
|
TransformText(BattleScreen.Trainer.Name & " " & Localization.GetString("battle_main_trainer_sent_out_3") & " " & NewPokemon.GetDisplayName() & Localization.GetString("battle_main_trainer_sent_out_4"))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Dim delay As Single = 3.0F
|
Dim delay As Single = 3.0F
|
||||||
@ -161,9 +185,11 @@
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Overrides Sub Draw(BV2Screen As BattleScreen)
|
Public Overrides Sub Draw(BV2Screen As BattleScreen)
|
||||||
DrawText(BV2Screen)
|
If Me._ready = False Then
|
||||||
If TextReady = True Then
|
DrawText(BV2Screen)
|
||||||
DrawChoose()
|
If TextReady = True Then
|
||||||
|
DrawChoose()
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user