Fixed Encore & make disabled moves gray in menu

This commit is contained in:
JappaWakka 2024-03-05 11:31:33 +01:00
parent 67b2d55e85
commit de102f4aa7
3 changed files with 41 additions and 12 deletions
P3D
Battle/BattleSystemV2
Pokemon/Attacks/Normal

@ -24,8 +24,8 @@
Dim Argument As Object
End Structure
Public OwnStep As RoundConst
Public OppStep As RoundConst
Public Shared OwnStep As RoundConst
Public Shared OppStep As RoundConst
''' <summary>
''' Returns the move of a Pokémon with a specified ID.
@ -631,8 +631,8 @@
Exit Sub
End If
Dim OppStep = GetOppStep(BattleScreen, OwnStep)
Me.OwnStep = OwnStep
Me.OppStep = OppStep
Battle.OwnStep = OwnStep
Battle.OppStep = OppStep
BattleScreen.OwnFaint = False '''
BattleScreen.OppFaint = False '''
If OwnStep.StepType = RoundConst.StepTypes.Move Then
@ -2815,6 +2815,20 @@
End If
moveUsed.MoveMisses(own, BattleScreen)
End If
''Own Pokémon Encore
Dim attackIndex As Integer = -1
If own = True AndAlso BattleScreen.FieldEffects.OwnEncore > 0 Then
For a = 0 To BattleScreen.OwnPokemon.Attacks.Count - 1
If BattleScreen.OwnPokemon.Attacks(a).ID = BattleScreen.FieldEffects.OwnEncoreMove.ID Then
attackIndex = a
End If
Next
If attackIndex <> -1 AndAlso BattleScreen.OwnPokemon.Attacks(attackIndex).CurrentPP = 0 Then
BattleScreen.FieldEffects.OwnEncoreMove = Nothing
BattleScreen.FieldEffects.OwnEncore = 0
BattleScreen.BattleQuery.Add(New TextQueryObject(BattleScreen.OwnPokemon.GetDisplayName() & "'s encore stopped."))
End If
End If
End Sub
''' <summary>

@ -479,13 +479,17 @@
extraExtended = SelExtended
End If
Core.SpriteBatch.Draw(Me.Texture, New Rectangle(Core.ScreenSize.Width - (AllExtended + extraExtended), 116 + Index * 96, 80, 80), New Rectangle(16, 16, 16, 16), New Color(255, 255, 255, 255 - deductAlpha))
Core.SpriteBatch.Draw(Me.Texture, New Rectangle(Core.ScreenSize.Width - (AllExtended + extraExtended) + 80, 116 + Index * 96, AllExtended + extraExtended - 80, 80), New Rectangle(32, 16, 16, 16), New Color(255, 255, 255, 255 - deductAlpha))
Dim BackgroundDrawColor As Color = Color.White
If Move.Disabled > 0 OrElse BattleScreen.FieldEffects.OwnEncore > 0 AndAlso BattleScreen.FieldEffects.OwnEncoreMove.ID <> Move.ID Then
BackgroundDrawColor = New Color(210, 210, 210)
End If
Core.SpriteBatch.Draw(Me.Texture, New Rectangle(Core.ScreenSize.Width - (AllExtended + extraExtended), 116 + Index * 96, 80, 80), New Rectangle(16, 16, 16, 16), New Color(BackgroundDrawColor.R, BackgroundDrawColor.G, BackgroundDrawColor.B, 255 - deductAlpha))
Core.SpriteBatch.Draw(Me.Texture, New Rectangle(Core.ScreenSize.Width - (AllExtended + extraExtended) + 80, 116 + Index * 96, AllExtended + extraExtended - 80, 80), New Rectangle(32, 16, 16, 16), New Color(BackgroundDrawColor.R, BackgroundDrawColor.G, BackgroundDrawColor.B, 255 - deductAlpha))
Core.SpriteBatch.Draw(TextureManager.GetTexture("GUI\Menus\Types", Me.Move.Type.GetElementImage(), ""), New Rectangle(Core.ScreenSize.Width - (AllExtended + extraExtended) + 28, 132 + Index * 96, 48, 16), New Color(255, 255, 255, 255 - deductAlpha))
If isSelected = True Then
If Move.Disabled > 0 Then
If Move.Disabled > 0 OrElse BattleScreen.FieldEffects.OwnEncore > 0 AndAlso BattleScreen.FieldEffects.OwnEncoreMove.ID <> Move.ID Then
Core.SpriteBatch.DrawString(FontManager.MainFont, "Disabled!", New Vector2(CInt(Core.ScreenSize.Width - (AllExtended + extraExtended) + 28), CInt(152 + Index * 96)), Color.Black)
Else
Dim ppColor As Color = GetPPColor()
@ -522,7 +526,7 @@
If Controls.Accept(False, True, True) = True And isSelected = True Then
SoundManager.PlaySound("select")
If Me.Move.Disabled = 0 Then
If Me.Move.Disabled = 0 AndAlso BattleScreen.FieldEffects.OwnEncore = 0 OrElse BattleScreen.FieldEffects.OwnEncoreMove.ID = Move.ID Then
Me.ClickAction(BattleScreen)
End If
End If
@ -530,7 +534,7 @@
If MouseHandler.IsInRectangle(New Rectangle(Core.ScreenSize.Width - 255, 116 + Index * 96, 255, 80)) = True Then
If isSelected = True Then
SoundManager.PlaySound("select")
If Me.Move.Disabled = 0 Then
If Me.Move.Disabled = 0 AndAlso BattleScreen.FieldEffects.OwnEncore = 0 OrElse BattleScreen.FieldEffects.OwnEncoreMove.ID = Move.ID Then
Me.ClickAction(BattleScreen)
End If
Else

@ -61,9 +61,20 @@
op = BattleScreen.OwnPokemon
End If
Dim lastMove As Attack = BattleScreen.FieldEffects.OppLastMove
If own = False Then
lastMove = BattleScreen.FieldEffects.OwnLastMove
Dim lastMove As Attack
If own = True Then
If (BattleScreen.FieldEffects.OppLastMove Is Nothing AndAlso Battle.OppStep.StepType = Battle.RoundConst.StepTypes.Move) OrElse Battle.OppStep.StepType = Battle.RoundConst.StepTypes.Move AndAlso CType(Battle.OppStep.Argument, Attack).ID <> BattleScreen.FieldEffects.OppLastMove.ID Then
lastMove = CType(Battle.OppStep.Argument, Attack)
Else
lastMove = BattleScreen.FieldEffects.OppLastMove
End If
Else
If (BattleScreen.FieldEffects.OwnLastMove Is Nothing AndAlso Battle.OwnStep.StepType = Battle.RoundConst.StepTypes.Move) OrElse Battle.OwnStep.StepType = Battle.RoundConst.StepTypes.Move AndAlso CType(Battle.OwnStep.Argument, Attack).ID <> BattleScreen.FieldEffects.OwnLastMove.ID Then
lastMove = CType(Battle.OwnStep.Argument, Attack)
Else
lastMove = BattleScreen.FieldEffects.OwnLastMove
End If
End If
If Not lastMove Is Nothing Then