Wired up transit whitelist system for use in Khorvod event
This commit is contained in:
@@ -9930,7 +9930,8 @@
|
||||
"adjustBotAppearances": true,
|
||||
"enableChristmasHideout": true,
|
||||
"enableSanta": true,
|
||||
"enableRundansEvent": true
|
||||
"enableRundansEvent": true,
|
||||
"enableKhorvodEvent": true
|
||||
},
|
||||
"startDay": "13",
|
||||
"startMonth": "12",
|
||||
@@ -9944,6 +9945,7 @@
|
||||
"settings": {
|
||||
"adjustBotAppearances": true,
|
||||
"enableChristmasHideout": true,
|
||||
"enableKhorvodEvent": true,
|
||||
"enableSanta": true
|
||||
},
|
||||
"startDay": "1",
|
||||
@@ -13997,5 +13999,8 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"khorvodEventTransitWhitelist": {
|
||||
"bigmap": [9]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,9 @@ public record SeasonalEventConfig : BaseConfig
|
||||
[JsonPropertyName("hostilitySettingsForEvent")]
|
||||
public required Dictionary<string, Dictionary<string, List<AdditionalHostilitySettings>>> HostilitySettingsForEvent { get; set; }
|
||||
|
||||
[JsonPropertyName("khorvodEventTransitWhitelist")]
|
||||
public required Dictionary<string, List<int>> KhorvodEventTransitWhitelist { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Ids of containers on locations that only have Christmas loot
|
||||
/// </summary>
|
||||
@@ -143,6 +146,9 @@ public record SeasonalEventSettings
|
||||
|
||||
[JsonPropertyName("enableRundansEvent")]
|
||||
public bool? EnableRundansEvent { get; set; }
|
||||
|
||||
[JsonPropertyName("enableKhorvodEvent")]
|
||||
public bool? EnableKhorvodEvent { get; set; }
|
||||
}
|
||||
|
||||
public record ZombieSettings
|
||||
|
||||
@@ -519,9 +519,35 @@ public class SeasonalEventService(
|
||||
EnableRunnansEvent(databaseService.GetGlobals());
|
||||
}
|
||||
|
||||
if (eventType.Settings?.EnableKhorvodEvent ?? false)
|
||||
{
|
||||
AdjustTransitsToKhorvodEvent();
|
||||
}
|
||||
|
||||
ChangeBtrToTarColaSkin();
|
||||
}
|
||||
|
||||
protected void AdjustTransitsToKhorvodEvent()
|
||||
{
|
||||
var locations = databaseService.GetLocations().GetDictionary();
|
||||
|
||||
foreach (var (locationName, locationBase) in locations)
|
||||
{
|
||||
if (LocationConfig.NonMaps.Contains(locationName))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var matchingTransitWhitelist = SeasonalEventConfig.KhorvodEventTransitWhitelist.GetValueOrDefault(locationBase.Base.Id, null);
|
||||
if (matchingTransitWhitelist is null )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
locationBase.Base.Transits = locationBase.Base.Transits.Where(t => matchingTransitWhitelist.Contains(t.Id.Value)).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
protected void EnableRunnansEvent(Globals globals)
|
||||
{
|
||||
globals.Configuration.RunddansSettings.Active = true;
|
||||
|
||||
Reference in New Issue
Block a user