Fix season forms

This commit is contained in:
JappaWakka 2023-07-07 10:56:16 +02:00
parent a90ef6e6d8
commit e1be26284f
1 changed files with 60 additions and 14 deletions

View File

@ -182,6 +182,16 @@ Public Class PokemonForms
End If End If
Return "" Return ""
End Function End Function
Public Shared Function GetSeasonFormMatch(ByVal P As Pokemon) As String
If _pokemonList.Count > 0 Then
For Each listP In _pokemonList
If listP.IsNumber(P.Number) = True AndAlso listP.GetSeasonFormMatch() <> "nomatch" Then
Return listP.GetSeasonFormMatch()
End If
Next
End If
Return ""
End Function
''' <summary> ''' <summary>
@ -193,7 +203,7 @@ Public Class PokemonForms
If listP.IsNumber(P.Number) = True Then If listP.IsNumber(P.Number) = True Then
Dim TypeAddition As String = GetTypeAdditionFromItem(P) Dim TypeAddition As String = GetTypeAdditionFromItem(P)
If GetTypeAdditionFromItem(P) <> "" OrElse (listP.TypeChange = Element.Types.Blank AndAlso listP.ValueMatch(P.AdditionalData) = True) Then If GetTypeAdditionFromItem(P) <> "" OrElse listP.GetSeasonFormMatch() = "match" OrElse (listP.GetSeasonFormMatch() = "" AndAlso listP.TypeChange = Element.Types.Blank AndAlso listP.ValueMatch(P.AdditionalData) = True) Then
Return listP.GetAnimationName(P).ToLower Return listP.GetAnimationName(P).ToLower
End If End If
End If End If
@ -209,9 +219,11 @@ Public Class PokemonForms
Public Shared Function GetCrySuffix(ByVal P As Pokemon) As String Public Shared Function GetCrySuffix(ByVal P As Pokemon) As String
If _pokemonList.Count > 0 Then If _pokemonList.Count > 0 Then
For Each listP In _pokemonList For Each listP In _pokemonList
If listP.IsNumber(P.Number) = True AndAlso listP.ValueMatch(P.AdditionalData) Then If listP.IsNumber(P.Number) = True Then
If listP.GetSeasonFormMatch() = "match" OrElse (listP.GetSeasonFormMatch() = "" AndAlso listP.ValueMatch(P.AdditionalData)) Then
Return listP.GetCrySuffix(P) Return listP.GetCrySuffix(P)
End If End If
End If
Next Next
End If End If
Return "" Return ""
@ -223,9 +235,11 @@ Public Class PokemonForms
Public Shared Function GetFormName(ByVal P As Pokemon) As String Public Shared Function GetFormName(ByVal P As Pokemon) As String
If _pokemonList.Count > 0 Then If _pokemonList.Count > 0 Then
For Each listP In _pokemonList For Each listP In _pokemonList
If listP.IsNumber(P.Number) = True AndAlso listP.ValueMatch(P.AdditionalData) Then If listP.IsNumber(P.Number) = True Then
If listP.GetSeasonFormMatch() = "match" OrElse (listP.GetSeasonFormMatch() = "" AndAlso listP.ValueMatch(P.AdditionalData)) Then
Return listP.GetFormName(P) Return listP.GetFormName(P)
End If End If
End If
Next Next
End If End If
Return "" Return ""
@ -234,7 +248,7 @@ Public Class PokemonForms
If _pokemonList.Count > 0 Then If _pokemonList.Count > 0 Then
For Each listP In _pokemonList For Each listP In _pokemonList
If listP.IsNumber(P.Number) = True Then If listP.IsNumber(P.Number) = True Then
If GetTypeAdditionFromItem(P) <> "" OrElse (listP.TypeChange = Element.Types.Blank AndAlso listP.ValueMatch(P.AdditionalData) = True) Then If GetTypeAdditionFromItem(P) <> "" OrElse listP.GetSeasonFormMatch() = "match" OrElse (listP.GetSeasonFormMatch() = "" AndAlso listP.TypeChange = Element.Types.Blank AndAlso listP.ValueMatch(P.AdditionalData) = True) Then
Return listP.GetFrontBackSpriteFileSuffix(P) Return listP.GetFrontBackSpriteFileSuffix(P)
End If End If
End If End If
@ -250,7 +264,7 @@ Public Class PokemonForms
If _pokemonList.Count > 0 Then If _pokemonList.Count > 0 Then
For Each listP In _pokemonList For Each listP In _pokemonList
If listP.IsNumber(P.Number) = True Then If listP.IsNumber(P.Number) = True Then
If GetTypeAdditionFromItem(P) <> "" OrElse (listP.TypeChange = Element.Types.Blank AndAlso listP.ValueMatch(P.AdditionalData) = True) Then If GetTypeAdditionFromItem(P) <> "" OrElse listP.GetSeasonFormMatch() = "match" OrElse (listP.GetSeasonFormMatch() = "" AndAlso listP.TypeChange = Element.Types.Blank AndAlso listP.ValueMatch(P.AdditionalData) = True) Then
Return listP.GetSheetName(P) Return listP.GetSheetName(P)
End If End If
End If End If
@ -285,7 +299,7 @@ Public Class PokemonForms
If _pokemonList.Count > 0 Then If _pokemonList.Count > 0 Then
For Each listP In _pokemonList For Each listP In _pokemonList
If listP.IsNumber(P.Number) = True Then If listP.IsNumber(P.Number) = True Then
If GetTypeAdditionFromItem(P) <> "" OrElse (listP.TypeChange = Element.Types.Blank AndAlso listP.ValueMatch(P.AdditionalData) = True) Then If GetTypeAdditionFromItem(P) <> "" OrElse listP.GetSeasonFormMatch() = "match" OrElse (listP.GetSeasonFormMatch() = "" AndAlso listP.TypeChange = Element.Types.Blank AndAlso listP.ValueMatch(P.AdditionalData) = True) Then
Return listP.GetMenuImagePosition(P) Return listP.GetMenuImagePosition(P)
End If End If
End If End If
@ -348,7 +362,7 @@ Public Class PokemonForms
For Each listP In _pokemonList For Each listP In _pokemonList
If listP.IsNumber(P.Number) = True Then If listP.IsNumber(P.Number) = True Then
If GetTypeAdditionFromItem(P) <> "" OrElse (listP.TypeChange = Element.Types.Blank AndAlso listP.ValueMatch(P.AdditionalData) = True) Then If GetTypeAdditionFromItem(P) <> "" OrElse listP.GetSeasonFormMatch() = "match" OrElse (listP.GetSeasonFormMatch() = "" AndAlso listP.TypeChange = Element.Types.Blank AndAlso listP.ValueMatch(P.AdditionalData) = True) Then
Return listP.GetOverworldAddition(P) Return listP.GetOverworldAddition(P)
End If End If
End If End If
@ -446,9 +460,13 @@ Public Class PokemonForms
Return AdditionalValue Return AdditionalValue
End If End If
ElseIf trigger(0).ToLower = "season" Then ElseIf trigger(0).ToLower = "season" Then
If World.CurrentSeason = CType(CInt(trigger(1)), World.Seasons) Then If GetSeasonFormMatch(true) = "match" Then
If TypeChange <> Element.Types.Blank Then
Return TypeChange.ToString
Else
Return AdditionalValue Return AdditionalValue
End If End If
End If
ElseIf trigger(0).ToLower = "environment" Then ElseIf trigger(0).ToLower = "environment" Then
Dim environmentlist As New List(Of World.EnvironmentTypes) Dim environmentlist As New List(Of World.EnvironmentTypes)
For e = 1 To trigger.Count - 1 For e = 1 To trigger.Count - 1
@ -478,7 +496,7 @@ Public Class PokemonForms
End If End If
End If End If
ElseIf trigger(0).ToLower = "season" Then ElseIf trigger(0).ToLower = "season" Then
If World.CurrentSeason = CType(CInt(trigger(1)), World.Seasons) Then If GetSeasonFormMatch() = "match" Then
If TypeChange <> Element.Types.Blank Then If TypeChange <> Element.Types.Blank Then
Return TypeChange.ToString Return TypeChange.ToString
Else Else
@ -543,14 +561,42 @@ Public Class PokemonForms
End If End If
End If End If
End If End If
ElseIf trigger(1) = "-1" Then
Return CStr("default")
End If End If
End If End If
Next Next
End If End If
Return "" Return ""
End Function End Function
Public Function GetSeasonFormMatch(Optional ByVal initial As Boolean = False) As String
If initial = False Then
If InPartyFormTriggers.Count > 0 Then
For i = 0 To InPartyFormTriggers.Count - 1
Dim trigger() As String = InPartyFormTriggers(i).Split(";")
If trigger(0).ToLower = "season" Then
If World.CurrentSeason = CType(CInt(trigger(1)), World.Seasons) Then
Return "match"
Else
Return "nomatch"
End If
End If
Next
End If
Else
If WildFormTriggers.Count > 0 Then
For i = 0 To WildFormTriggers.Count - 1
Dim trigger() As String = WildFormTriggers(i).Split(";")
If trigger(0).ToLower = "season" Then
If World.CurrentSeason = CType(CInt(trigger(1)), World.Seasons) Then
Return "match"
Else
Return "nomatch"
End If
End If
Next
End If
End If
Return ""
End Function
Public Overridable Function GetAnimationName(ByVal P As Pokemon) As String Public Overridable Function GetAnimationName(ByVal P As Pokemon) As String
Return CStr(P.Number & OverworldSpriteFileSuffix) Return CStr(P.Number & OverworldSpriteFileSuffix)
End Function End Function