Made it possible for custom moves to end a battle

Also made the text message MoveHitsFunction only appear if there's a message to display.
This commit is contained in:
JappaWakka 2022-02-27 15:28:45 +01:00
parent 4cca56097e
commit dc5b439baf
2 changed files with 11 additions and 4 deletions

View File

@ -1951,7 +1951,7 @@
''' <param name="BattleScreen">Reference to the BattleScreen.</param> ''' <param name="BattleScreen">Reference to the BattleScreen.</param>
Public Overridable Sub MoveHits(ByVal own As Boolean, ByVal BattleScreen As BattleScreen) Public Overridable Sub MoveHits(ByVal own As Boolean, ByVal BattleScreen As BattleScreen)
If Me.IsGameModeMove = True Then If Me.IsGameModeMove = True Then
AttackSpecialFunctions.ExecuteAttackFunction(Me, own, BattleScreen) AttackSpecialFunctions.ExecuteMoveHitsFunction(Me, own, BattleScreen)
Else Else
'DO NOTHING HERE (will do secondary effect if moves overrides it) 'DO NOTHING HERE (will do secondary effect if moves overrides it)
End If End If

View File

@ -11,7 +11,7 @@
''' <param name="Move">The move containing the attack function.</param> ''' <param name="Move">The move containing the attack function.</param>
''' <param name="own">Own toggle.</param> ''' <param name="own">Own toggle.</param>
''' <param name="BattleScreen">Reference to the BattleScreen.</param> ''' <param name="BattleScreen">Reference to the BattleScreen.</param>
Public Shared Sub ExecuteAttackFunction(ByVal Move As Attack, ByVal own As Boolean, ByVal BattleScreen As BattleScreen) Public Shared Sub ExecuteMoveHitsFunction(ByVal Move As Attack, ByVal own As Boolean, ByVal BattleScreen As BattleScreen)
Dim functions() As String = Move.GameModeFunction.Split(CChar("|")) Dim functions() As String = Move.GameModeFunction.Split(CChar("|"))
For i = 0 To functions.Count - 1 For i = 0 To functions.Count - 1
Dim f As String = functions(i) Dim f As String = functions(i)
@ -22,6 +22,7 @@
Select Case fMain.ToLower() Select Case fMain.ToLower()
Case "message" Case "message"
fSub = Localization.GetString(f.GetSplit(1, ","), f.GetSplit(1, ",")) fSub = Localization.GetString(f.GetSplit(1, ","), f.GetSplit(1, ","))
BattleScreen.BattleQuery.Add(New TextQueryObject(fSub))
Case "reducehp", "drainhp", "damage" Case "reducehp", "drainhp", "damage"
Dim HPAmount As Integer = CInt(fSub.GetSplit(0, ",")) Dim HPAmount As Integer = CInt(fSub.GetSplit(0, ","))
Dim Message As String = "" Dim Message As String = ""
@ -44,11 +45,19 @@
End If End If
End If End If
BattleScreen.Battle.GainHP(HPAmount, Target, Target, BattleScreen, Message, Move.Name.ToLower) BattleScreen.Battle.GainHP(HPAmount, Target, Target, BattleScreen, Message, Move.Name.ToLower)
Case "endbattle"
Dim Blackout As Boolean = False
If fSub.Split(CChar(",")).Count > 1 Then
Blackout = CBool(fSub.GetSplit(1, ","))
End If
BattleScreen.EndBattle(Blackout)
Case Else Case Else
fSub = CInt(f.GetSplit(1, ",")).Clamp(0, 100).ToString fSub = CInt(f.GetSplit(1, ",")).Clamp(0, 100).ToString
End Select End Select
Else Else
Select Case f.ToLower() Select Case f.ToLower()
Case "endbattle"
BattleScreen.EndBattle(False)
Case "freeze" Case "freeze"
fSub = "15" fSub = "15"
Case "poison" Case "poison"
@ -61,8 +70,6 @@
End If End If
Select Case fMain.ToLower() Select Case fMain.ToLower()
Case "message"
BattleScreen.BattleQuery.Add(New TextQueryObject(fSub))
Case "paralyze" Case "paralyze"
Paralyze(Move, own, BattleScreen, CInt(fSub)) Paralyze(Move, own, BattleScreen, CInt(fSub))
Case "poison" Case "poison"