Added negative Place/Env.Type evo conditions

This commit is contained in:
JappaWakka 2023-12-04 18:01:15 +01:00
parent bd36bbfad0
commit 1c7ce33a73
1 changed files with 24 additions and 0 deletions

View File

@ -6,6 +6,7 @@ Public Class EvolutionCondition
Item Item
HoldItem HoldItem
Place Place
NotPlace
Trade Trade
Gender Gender
AtkDef AtkDef
@ -19,6 +20,7 @@ Public Class EvolutionCondition
Region Region
Status Status
EnvironmentType EnvironmentType
NotEnvironmentType
End Enum End Enum
Public Structure Condition Public Structure Condition
@ -47,6 +49,8 @@ Public Class EvolutionCondition
c.ConditionType = ConditionTypes.HoldItem c.ConditionType = ConditionTypes.HoldItem
Case "location", "place" Case "location", "place"
c.ConditionType = ConditionTypes.Place c.ConditionType = ConditionTypes.Place
Case "notlocation", "notplace"
c.ConditionType = ConditionTypes.NotPlace
Case "friendship" Case "friendship"
c.ConditionType = ConditionTypes.Friendship c.ConditionType = ConditionTypes.Friendship
Case "trade" Case "trade"
@ -75,6 +79,8 @@ Public Class EvolutionCondition
c.ConditionType = ConditionTypes.Status c.ConditionType = ConditionTypes.Status
Case "environmenttype" Case "environmenttype"
c.ConditionType = ConditionTypes.EnvironmentType c.ConditionType = ConditionTypes.EnvironmentType
Case "notenvironmenttype"
c.ConditionType = ConditionTypes.NotEnvironmentType
End Select End Select
Me.Conditions.Add(c) Me.Conditions.Add(c)
End Sub End Sub
@ -252,6 +258,18 @@ Public Class EvolutionCondition
If PlaceMatch = False Then If PlaceMatch = False Then
canEvolve = False canEvolve = False
End If End If
Case ConditionTypes.NotPlace
Dim places As List(Of String) = c.Argument.Split(CChar(";")).ToList()
Dim PlaceMatch As Boolean = False
For i = 0 To places.Count - 1
If places(i).ToLower = Screen.Level.MapName.ToLower() Then
PlaceMatch = True
Exit For
End If
Next
If PlaceMatch = True Then
canEvolve = False
End If
Case ConditionTypes.Trade Case ConditionTypes.Trade
If StringHelper.IsNumeric(c.Argument) Then If StringHelper.IsNumeric(c.Argument) Then
If CInt(c.Argument) > 0 Then If CInt(c.Argument) > 0 Then
@ -308,6 +326,12 @@ Public Class EvolutionCondition
If environments.Contains(CStr(Screen.Level.EnvironmentType)) = False Then If environments.Contains(CStr(Screen.Level.EnvironmentType)) = False Then
canEvolve = False canEvolve = False
End If End If
Case ConditionTypes.NotEnvironmentType
Dim environments As List(Of String) = c.Argument.Split(CChar(";")).ToList()
If environments.Contains(CStr(Screen.Level.EnvironmentType)) = True Then
canEvolve = False
End If
End Select End Select
Next Next
End If End If