diff --git a/Project/Beacon.xojo_project b/Project/Beacon.xojo_project index 010e6e46b..bfa7f38e2 100644 --- a/Project/Beacon.xojo_project +++ b/Project/Beacon.xojo_project @@ -881,11 +881,11 @@ AppMenuBar=MainMenuBar MajorVersion=2 MinorVersion=0 SubVersion=0 -NonRelease=2 +NonRelease=3 Release=2 InfoVersion=Beacon -LongVersion=Beacon 2.0.0b2 ©2016-2023 The ZAZ Studios -ShortVersion=2.0.0b2 +LongVersion=Beacon 2.0.0b3 ©2016-2023 The ZAZ Studios +ShortVersion=2.0.0b3 WinCompanyName=The ZAZ Studios WinInternalName= WinProductName=Beacon diff --git a/Project/Modules/Game Support/Ark/Configs/LootDrops.xojo_code b/Project/Modules/Game Support/Ark/Configs/LootDrops.xojo_code index 93050e525..ac3d23f23 100644 --- a/Project/Modules/Game Support/Ark/Configs/LootDrops.xojo_code +++ b/Project/Modules/Game Support/Ark/Configs/LootDrops.xojo_code @@ -249,18 +249,18 @@ Implements Iterable Continue End If - Var Container As Ark.LootContainer + Var Override As Ark.LootDropOverride Try - Container = Ark.LootContainer.ImportFromConfig(Dictionary(Member.ObjectValue), Difficulty, ContentPacks) + Override = Ark.LootDropOverride.ImportFromConfig(Dictionary(Member.ObjectValue), Difficulty, ContentPacks) Catch Err As RuntimeException + App.Log(Err, CurrentMethodName, "Importing override from ini") Continue End Try - - If Container Is Nil Then + If Override Is Nil Then Continue End If - LootDrops.Add(Container) + LootDrops.Add(Override) Next If LootDrops.Count > 0 Then Return LootDrops diff --git a/Project/Modules/Game Support/Ark/LootContainer.xojo_code b/Project/Modules/Game Support/Ark/LootContainer.xojo_code index 90231e3ab..622ced142 100644 --- a/Project/Modules/Game Support/Ark/LootContainer.xojo_code +++ b/Project/Modules/Game Support/Ark/LootContainer.xojo_code @@ -322,66 +322,6 @@ Implements Ark.Blueprint,Beacon.Countable,Iterable,Beacon.Validateable,Beacon.Di End Function #tag EndMethod - #tag Method, Flags = &h0 - Shared Function ImportFromConfig(Dict As Dictionary, Difficulty As Double, ContentPacks As Beacon.StringList) As Ark.LootContainer - Var ClassString As String - If Dict.HasKey("SupplyCrateClassString") Then - ClassString = Dict.Value("SupplyCrateClassString") - End If - - Var Containers() As Ark.LootContainer = Ark.DataSource.Pool.Get(False).GetLootContainersByClass(ClassString, ContentPacks) - Var Container As Ark.MutableLootContainer - If Containers.Count > 0 Then - Container = New Ark.MutableLootContainer(Containers(0)) - Else - Var Path As String = Ark.UnknownBlueprintPath("LootContainers", ClassString) - Var UUID As String = Beacon.UUID.v5(Ark.UserContentPackId.Lowercase + ":" + Path.Lowercase) - Var UIColor As String = Dict.Lookup("UIColor", "FFFFFF00") - - Container = New Ark.MutableLootContainer(Path, UUID) - Container.Multipliers = New Beacon.Range(Dict.Lookup("Multiplier_Min", 1), Dict.Lookup("Multiplier_Max", 1)) - Container.Availability = Ark.Maps.UniversalMask - Container.UIColor = Color.RGB(Integer.FromHex(UIColor.Middle(0, 2)), Integer.FromHex(UIColor.Middle(2, 2)), Integer.FromHex(UIColor.Middle(4, 2)), Integer.FromHex(UIColor.Middle(6, 2))) - Container.SortValue = Dict.Lookup("SortValue", 999).IntegerValue - Container.Label = Dict.Lookup("Label", ClassString).StringValue - Container.RequiredItemSetCount = Dict.Lookup("RequiredItemSets", 1).IntegerValue - Container.Experimental = Dict.Lookup("Experimental", False).BooleanValue - Container.Notes = Dict.Lookup("Notes", "").StringValue - Container.ContentPackId = Ark.UserContentPackId - End If - - Var Children() As Dictionary - If Dict.HasKey("ItemSets") Then - Children = Dict.Value("ItemSets").DictionaryArrayValue - End If - Var AddedHashes As New Dictionary - For Each Child As Dictionary In Children - Var Set As Ark.LootItemSet = Ark.LootItemSet.ImportFromConfig(Child, Container.Multipliers, Difficulty, ContentPacks) - Var Hash As String = Set.Hash - If (Set Is Nil) = False And AddedHashes.HasKey(Hash) = False Then - Call Container.Add(Set) - AddedHashes.Value(Hash) = True - End If - Next - - If Dict.HasKey("MaxItemSets") Then - Container.MaxItemSets = Dict.Value("MaxItemSets") - End If - If Dict.HasKey("MinItemSets") Then - Container.MinItemSets = Dict.Value("MinItemSets") - End If - If Dict.HasKey("bSetsRandomWithoutReplacement") Then - Container.PreventDuplicates = Dict.Value("bSetsRandomWithoutReplacement") - End If - If Dict.HasKey("bAppendItemSets") Then - Container.AppendMode = Dict.Value("bAppendItemSets") - End If - - Container.Modified = False - Return Container - End Function - #tag EndMethod - #tag Method, Flags = &h0 Function IndexOf(ItemSet As Ark.LootItemSet) As Integer For Idx As Integer = 0 To Self.mItemSets.LastIndex diff --git a/Project/Modules/Game Support/Ark/LootDropOverride.xojo_code b/Project/Modules/Game Support/Ark/LootDropOverride.xojo_code index 787ad9a7e..e83aead60 100644 --- a/Project/Modules/Game Support/Ark/LootDropOverride.xojo_code +++ b/Project/Modules/Game Support/Ark/LootDropOverride.xojo_code @@ -203,6 +203,69 @@ Implements Beacon.Validateable,Iterable,Beacon.Countable,Beacon.NamedItem,Beacon End Function #tag EndMethod + #tag Method, Flags = &h0 + Shared Function ImportFromConfig(Dict As Dictionary, Difficulty As Double, ContentPacks As Beacon.StringList) As Ark.LootDropOverride + Var ClassString As String + If Dict.HasKey("SupplyCrateClassString") Then + ClassString = Dict.Value("SupplyCrateClassString") + End If + + Var Containers() As Ark.LootContainer = Ark.DataSource.Pool.Get(False).GetLootContainersByClass(ClassString, ContentPacks) + Var Container As Ark.LootContainer + If Containers.Count > 0 Then + Container = Containers(0) + Else + Var Path As String = Ark.UnknownBlueprintPath("LootContainers", ClassString) + Var UUID As String = Beacon.UUID.v5(Ark.UserContentPackId.Lowercase + ":" + Path.Lowercase) + Var UIColor As String = Dict.Lookup("UIColor", "FFFFFF00") + + Var Mutable As New Ark.MutableLootContainer(Path, UUID) + Mutable.Multipliers = New Beacon.Range(Dict.Lookup("Multiplier_Min", 1), Dict.Lookup("Multiplier_Max", 1)) + Mutable.Availability = Ark.Maps.UniversalMask + Mutable.UIColor = Color.RGB(Integer.FromHex(UIColor.Middle(0, 2)), Integer.FromHex(UIColor.Middle(2, 2)), Integer.FromHex(UIColor.Middle(4, 2)), Integer.FromHex(UIColor.Middle(6, 2))) + Mutable.SortValue = Dict.Lookup("SortValue", 999).IntegerValue + Mutable.Label = Dict.Lookup("Label", ClassString).StringValue + Mutable.RequiredItemSetCount = Dict.Lookup("RequiredItemSets", 1).IntegerValue + Mutable.Experimental = Dict.Lookup("Experimental", False).BooleanValue + Mutable.Notes = Dict.Lookup("Notes", "").StringValue + Mutable.ContentPackId = Ark.UserContentPackId + Container = Mutable + End If + + Var Override As New Ark.MutableLootDropOverride(Container) + + Var Children() As Dictionary + If Dict.HasKey("ItemSets") Then + Children = Dict.Value("ItemSets").DictionaryArrayValue + End If + Var AddedHashes As New Dictionary + For Each Child As Dictionary In Children + Var Set As Ark.LootItemSet = Ark.LootItemSet.ImportFromConfig(Child, Container.Multipliers, Difficulty, ContentPacks) + Var Hash As String = Set.Hash + If (Set Is Nil) = False And AddedHashes.HasKey(Hash) = False Then + Override.Add(Set) + AddedHashes.Value(Hash) = True + End If + Next + + If Dict.HasKey("MaxItemSets") Then + Override.MaxItemSets = Dict.Value("MaxItemSets") + End If + If Dict.HasKey("MinItemSets") Then + Override.MinItemSets = Dict.Value("MinItemSets") + End If + If Dict.HasKey("bSetsRandomWithoutReplacement") Then + Override.PreventDuplicates = Dict.Value("bSetsRandomWithoutReplacement") + End If + If Dict.HasKey("bAppendItemSets") Then + Override.AddToDefaults = Dict.Value("bAppendItemSets") + End If + + Override.Modified = False + Return Override.ImmutableVersion + End Function + #tag EndMethod + #tag Method, Flags = &h0 Function IndexOf(Set As Ark.LootItemSet) As Integer If Set Is Nil Then diff --git a/Project/Modules/Game Support/ArkSA/Configs/LootDrops.xojo_code b/Project/Modules/Game Support/ArkSA/Configs/LootDrops.xojo_code index 4fa8489fd..38d4da558 100644 --- a/Project/Modules/Game Support/ArkSA/Configs/LootDrops.xojo_code +++ b/Project/Modules/Game Support/ArkSA/Configs/LootDrops.xojo_code @@ -271,18 +271,18 @@ Implements Iterable Continue End If - Var Container As ArkSA.LootContainer + Var Override As ArkSA.LootDropOverride Try - Container = ArkSA.LootContainer.ImportFromConfig(Dictionary(Member.ObjectValue), Difficulty, ContentPacks) + Override = ArkSA.LootDropOverride.ImportFromConfig(Dictionary(Member.ObjectValue), Difficulty, ContentPacks) Catch Err As RuntimeException + App.Log(Err, CurrentMethodName, "Importing override from ini") Continue End Try - - If Container Is Nil Then + If Override Is Nil Then Continue End If - LootDrops.Add(Container) + LootDrops.Add(Override) Next If LootDrops.Count > 0 Then Return LootDrops diff --git a/Project/Modules/Game Support/ArkSA/LootContainer.xojo_code b/Project/Modules/Game Support/ArkSA/LootContainer.xojo_code index 6331cc4ea..59435e209 100644 --- a/Project/Modules/Game Support/ArkSA/LootContainer.xojo_code +++ b/Project/Modules/Game Support/ArkSA/LootContainer.xojo_code @@ -322,66 +322,6 @@ Implements ArkSA.Blueprint,Beacon.Countable,Iterable,Beacon.Validateable,Beacon. End Function #tag EndMethod - #tag Method, Flags = &h0 - Shared Function ImportFromConfig(Dict As Dictionary, Difficulty As Double, ContentPacks As Beacon.StringList) As ArkSA.LootContainer - Var ClassString As String - If Dict.HasKey("SupplyCrateClassString") Then - ClassString = Dict.Value("SupplyCrateClassString") - End If - - Var Containers() As ArkSA.LootContainer = ArkSA.DataSource.Pool.Get(False).GetLootContainersByClass(ClassString, ContentPacks) - Var Container As ArkSA.MutableLootContainer - If Containers.Count > 0 Then - Container = New ArkSA.MutableLootContainer(Containers(0)) - Else - Var Path As String = ArkSA.UnknownBlueprintPath("LootContainers", ClassString) - Var UUID As String = Beacon.UUID.v5(ArkSA.UserContentPackId.Lowercase + ":" + Path.Lowercase) - Var UIColor As String = Dict.Lookup("UIColor", "FFFFFF00") - - Container = New ArkSA.MutableLootContainer(Path, UUID) - Container.Multipliers = New Beacon.Range(Dict.Lookup("Multiplier_Min", 1), Dict.Lookup("Multiplier_Max", 1)) - Container.Availability = ArkSA.Maps.UniversalMask - Container.UIColor = Color.RGB(Integer.FromHex(UIColor.Middle(0, 2)), Integer.FromHex(UIColor.Middle(2, 2)), Integer.FromHex(UIColor.Middle(4, 2)), Integer.FromHex(UIColor.Middle(6, 2))) - Container.SortValue = Dict.Lookup("SortValue", 999).IntegerValue - Container.Label = Dict.Lookup("Label", ClassString).StringValue - Container.RequiredItemSetCount = Dict.Lookup("RequiredItemSets", 1).IntegerValue - Container.Experimental = Dict.Lookup("Experimental", False).BooleanValue - Container.Notes = Dict.Lookup("Notes", "").StringValue - Container.ContentPackId = ArkSA.UserContentPackId - End If - - Var Children() As Dictionary - If Dict.HasKey("ItemSets") Then - Children = Dict.Value("ItemSets").DictionaryArrayValue - End If - Var AddedHashes As New Dictionary - For Each Child As Dictionary In Children - Var Set As ArkSA.LootItemSet = ArkSA.LootItemSet.ImportFromConfig(Child, Container.Multipliers, Difficulty, ContentPacks) - Var Hash As String = Set.Hash - If (Set Is Nil) = False And AddedHashes.HasKey(Hash) = False Then - Call Container.Add(Set) - AddedHashes.Value(Hash) = True - End If - Next - - If Dict.HasKey("MaxItemSets") Then - Container.MaxItemSets = Dict.Value("MaxItemSets") - End If - If Dict.HasKey("MinItemSets") Then - Container.MinItemSets = Dict.Value("MinItemSets") - End If - If Dict.HasKey("bSetsRandomWithoutReplacement") Then - Container.PreventDuplicates = Dict.Value("bSetsRandomWithoutReplacement") - End If - If Dict.HasKey("bAppendItemSets") Then - Container.AppendMode = Dict.Value("bAppendItemSets") - End If - - Container.Modified = False - Return Container - End Function - #tag EndMethod - #tag Method, Flags = &h0 Function IndexOf(ItemSet As ArkSA.LootItemSet) As Integer For Idx As Integer = 0 To Self.mItemSets.LastIndex diff --git a/Project/Modules/Game Support/ArkSA/LootDropOverride.xojo_code b/Project/Modules/Game Support/ArkSA/LootDropOverride.xojo_code index d4d66076e..a5647b656 100644 --- a/Project/Modules/Game Support/ArkSA/LootDropOverride.xojo_code +++ b/Project/Modules/Game Support/ArkSA/LootDropOverride.xojo_code @@ -203,6 +203,69 @@ Implements Beacon.Validateable,Iterable,Beacon.Countable,Beacon.NamedItem,Beacon End Function #tag EndMethod + #tag Method, Flags = &h0 + Shared Function ImportFromConfig(Dict As Dictionary, Difficulty As Double, ContentPacks As Beacon.StringList) As ArkSA.LootDropOverride + Var ClassString As String + If Dict.HasKey("SupplyCrateClassString") Then + ClassString = Dict.Value("SupplyCrateClassString") + End If + + Var Containers() As ArkSA.LootContainer = ArkSA.DataSource.Pool.Get(False).GetLootContainersByClass(ClassString, ContentPacks) + Var Container As ArkSA.LootContainer + If Containers.Count > 0 Then + Container = Containers(0) + Else + Var Path As String = ArkSA.UnknownBlueprintPath("LootContainers", ClassString) + Var UUID As String = Beacon.UUID.v5(ArkSA.UserContentPackId.Lowercase + ":" + Path.Lowercase) + Var UIColor As String = Dict.Lookup("UIColor", "FFFFFF00") + + Var Mutable As New ArkSA.MutableLootContainer(Path, UUID) + Mutable.Multipliers = New Beacon.Range(Dict.Lookup("Multiplier_Min", 1), Dict.Lookup("Multiplier_Max", 1)) + Mutable.Availability = ArkSA.Maps.UniversalMask + Mutable.UIColor = Color.RGB(Integer.FromHex(UIColor.Middle(0, 2)), Integer.FromHex(UIColor.Middle(2, 2)), Integer.FromHex(UIColor.Middle(4, 2)), Integer.FromHex(UIColor.Middle(6, 2))) + Mutable.SortValue = Dict.Lookup("SortValue", 999).IntegerValue + Mutable.Label = Dict.Lookup("Label", ClassString).StringValue + Mutable.RequiredItemSetCount = Dict.Lookup("RequiredItemSets", 1).IntegerValue + Mutable.Experimental = Dict.Lookup("Experimental", False).BooleanValue + Mutable.Notes = Dict.Lookup("Notes", "").StringValue + Mutable.ContentPackId = ArkSA.UserContentPackId + Container = Mutable + End If + + Var Override As New ArkSA.MutableLootDropOverride(Container) + + Var Children() As Dictionary + If Dict.HasKey("ItemSets") Then + Children = Dict.Value("ItemSets").DictionaryArrayValue + End If + Var AddedHashes As New Dictionary + For Each Child As Dictionary In Children + Var Set As ArkSA.LootItemSet = ArkSA.LootItemSet.ImportFromConfig(Child, Container.Multipliers, Difficulty, ContentPacks) + Var Hash As String = Set.Hash + If (Set Is Nil) = False And AddedHashes.HasKey(Hash) = False Then + Override.Add(Set) + AddedHashes.Value(Hash) = True + End If + Next + + If Dict.HasKey("MaxItemSets") Then + Override.MaxItemSets = Dict.Value("MaxItemSets") + End If + If Dict.HasKey("MinItemSets") Then + Override.MinItemSets = Dict.Value("MinItemSets") + End If + If Dict.HasKey("bSetsRandomWithoutReplacement") Then + Override.PreventDuplicates = Dict.Value("bSetsRandomWithoutReplacement") + End If + If Dict.HasKey("bAppendItemSets") Then + Override.AddToDefaults = Dict.Value("bAppendItemSets") + End If + + Override.Modified = False + Return Override.ImmutableVersion + End Function + #tag EndMethod + #tag Method, Flags = &h0 Function IndexOf(Set As ArkSA.LootItemSet) As Integer If Set Is Nil Then