Added eventType enum

This commit is contained in:
Chomp
2025-01-29 20:03:31 +00:00
parent 83bc0c4448
commit 73b2924cf2
4 changed files with 25 additions and 13 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
using Core.Models.Eft.Common.Tables;
using Core.Models.Eft.Hideout;
using Core.Models.Enums;
namespace Core.Models.Eft.Common;
@@ -538,7 +539,7 @@ public record Config
public BTRSettings? BTRSettings { get; set; }
[JsonPropertyName("EventType")]
public List<string> EventType { get; set; }
public List<EventType> EventType { get; set; }
[JsonPropertyName("WalkSpeed")]
public XYZ? WalkSpeed { get; set; }
+10
View File
@@ -0,0 +1,10 @@
namespace Core.Models.Enums
{
public enum EventType
{
None,
Halloween,
Christmas,
HalloweenIllumination
}
}
+12 -12
View File
@@ -471,9 +471,9 @@ public class SeasonalEventService(
{
_halloweenEventActive = true;
globalConfig.EventType = globalConfig.EventType.Where((x) => x != "None").ToList();
globalConfig.EventType.Add("Halloween");
globalConfig.EventType.Add("HalloweenIllumination");
globalConfig.EventType = globalConfig.EventType.Where((x) => x != EventType.None).ToList();
globalConfig.EventType.Add(EventType.Halloween);
globalConfig.EventType.Add(EventType.HalloweenIllumination);
globalConfig.Health.ProfileHealthSettings.DefaultStimulatorBuff = "Buffs_Halloween";
AddEventGearToBots(eventType.Type);
AdjustZryachiyMeleeChance();
@@ -513,8 +513,8 @@ public class SeasonalEventService(
if (eventType.Settings?.EnableChristmasHideout ?? false)
{
globalConfig.EventType = globalConfig.EventType.Where((x) => x != "None").ToList();
globalConfig.EventType.Add("Christmas");
globalConfig.EventType = globalConfig.EventType.Where((x) => x != EventType.None).ToList();
globalConfig.EventType.Add(EventType.Christmas);
}
AddEventGearToBots(eventType.Type);
@@ -539,8 +539,8 @@ public class SeasonalEventService(
if (eventType.Settings?.EnableChristmasHideout ?? false)
{
globalConfig.EventType = globalConfig.EventType.Where((x) => x != "None").ToList();
globalConfig.EventType.Add("Christmas");
globalConfig.EventType = globalConfig.EventType.Where((x) => x != EventType.None).ToList();
globalConfig.EventType.Add(EventType.Christmas);
}
AddEventGearToBots(SeasonalEventType.Christmas);
@@ -1032,14 +1032,14 @@ public class SeasonalEventService(
protected void HandleModEvent(SeasonalEvent seasonalEvent, Config globalConfig)
{
if (seasonalEvent.Settings?.EnableChristmasHideout ?? false) {
globalConfig.EventType = globalConfig.EventType.Where((x) => x != "None").ToList();
globalConfig.EventType.Add("Christmas");
globalConfig.EventType = globalConfig.EventType.Where((x) => x != EventType.None).ToList();
globalConfig.EventType.Add(EventType.Christmas);
}
if (seasonalEvent.Settings?.EnableHalloweenHideout ?? false) {
globalConfig.EventType = globalConfig.EventType.Where((x) => x != "None").ToList();
globalConfig.EventType.Add("Halloween");
globalConfig.EventType.Add("HalloweenIllumination");
globalConfig.EventType = globalConfig.EventType.Where((x) => x != EventType.None).ToList();
globalConfig.EventType.Add(EventType.Halloween);
globalConfig.EventType.Add(EventType.HalloweenIllumination);
}
if (seasonalEvent.Settings?.AddEventGearToBots ?? false) {
+1
View File
@@ -42,6 +42,7 @@ public class JsonUtil
new EftEnumConverter<DamageEffectType>(),
new EftEnumConverter<RepairStrategyType>(),
new EftEnumConverter<ThrowWeapType>(),
new EftEnumConverter<EventType>(),
new BaseInteractionRequestDataConverter()
}
};