diff --git a/Libraries/Core/Controllers/HealthController.cs b/Libraries/Core/Controllers/HealthController.cs index d791402e..a3e059a9 100644 --- a/Libraries/Core/Controllers/HealthController.cs +++ b/Libraries/Core/Controllers/HealthController.cs @@ -97,10 +97,9 @@ public class HealthController( foreach (var effectKey in effectsOnBodyPart) { // Check if healing item removes the effect on limb - var matchingEffectFromHealingItem = healItemEffectDetails.GetValueOrDefault(effectKey); - if (matchingEffectFromHealingItem is null) + if (!healItemEffectDetails.TryGetValue(Enum.Parse(effectKey), out var matchingEffectFromHealingItem)) { - // Healing item doesnt have matching effect, it doesnt remove the effect + // Healing item doesn't have matching effect, it doesn't remove the effect continue; } @@ -180,10 +179,10 @@ public class HealthController( foreach (var (key, effectProps) in foodItemEffectDetails) switch (key) { - case "Hydration": + case HealthFactor.Hydration: ApplyEdibleEffect(pmcData.Health.Hydration, effectProps, foodIsSingleUse, request); break; - case "Energy": + case HealthFactor.Energy: ApplyEdibleEffect(pmcData.Health.Energy, effectProps, foodIsSingleUse, request); break; diff --git a/Libraries/Core/Controllers/HideoutController.cs b/Libraries/Core/Controllers/HideoutController.cs index f55b473e..6bde6ce1 100644 --- a/Libraries/Core/Controllers/HideoutController.cs +++ b/Libraries/Core/Controllers/HideoutController.cs @@ -695,7 +695,7 @@ public class HideoutController( return; } - // Variables for managemnet of skill + // Variables for management of skill var craftingExpAmount = 0; var counterHoursCrafting = GetHoursCraftingTaskConditionCounter(pmcData, recipe); diff --git a/Libraries/Core/Models/Eft/Common/Tables/BotBase.cs b/Libraries/Core/Models/Eft/Common/Tables/BotBase.cs index 1cc6f631..6b0c80d3 100644 --- a/Libraries/Core/Models/Eft/Common/Tables/BotBase.cs +++ b/Libraries/Core/Models/Eft/Common/Tables/BotBase.cs @@ -1,5 +1,4 @@ using System.Text.Json.Serialization; -using Core.Models.Eft.ItemEvent; using Core.Models.Eft.Notes; using Core.Models.Eft.Ragfair; using Core.Models.Enums; @@ -254,7 +253,7 @@ public record BotBaseHealth public record BodyPartHealth { public CurrentMinMax? Health { get; set; } - public Dictionary? Effects { get; set; } + public Dictionary? Effects { get; set; } // TODO: change key to DamageEffectType enum } public record BodyPartEffectProperties diff --git a/Libraries/Core/Models/Eft/Common/Tables/TemplateItem.cs b/Libraries/Core/Models/Eft/Common/Tables/TemplateItem.cs index dab585e2..606fbd4b 100644 --- a/Libraries/Core/Models/Eft/Common/Tables/TemplateItem.cs +++ b/Libraries/Core/Models/Eft/Common/Tables/TemplateItem.cs @@ -207,7 +207,7 @@ public record Props public string? UnlootableFromSlot { get; set; } [JsonPropertyName("UnlootableFromSide")] - public List? UnlootableFromSide { get; set; } + public List? UnlootableFromSide { get; set; } // Type confirmed via client [JsonPropertyName("AnimationVariantsNumber")] @@ -216,8 +216,9 @@ public record Props [JsonPropertyName("DiscardingBlock")] public bool? DiscardingBlock { get; set; } + [JsonConverter(typeof(JsonStringEnumConverter))] [JsonPropertyName("DropSoundType")] - public string? DropSoundType { get; set; } + public ItemDropSoundType? DropSoundType { get; set; } [JsonPropertyName("RagFairCommissionModifier")] public double? RagFairCommissionModifier { get; set; } @@ -251,7 +252,7 @@ public record Props public bool? CanPutIntoDuringTheRaid { get; set; } [JsonPropertyName("CantRemoveFromSlotsDuringRaid")] - public List? CantRemoveFromSlotsDuringRaid { get; set; } + public List? CantRemoveFromSlotsDuringRaid { get; set; } [JsonPropertyName("KeyIds")] public List? KeyIds { get; set; } @@ -992,12 +993,12 @@ public record Props [JsonPropertyName("effects_health")] [JsonConverter(typeof(ArrayToObjectFactoryConverter))] [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - public Dictionary? EffectsHealth { get; set; } + public Dictionary? EffectsHealth { get; set; } [JsonPropertyName("effects_damage")] [JsonConverter(typeof(ArrayToObjectFactoryConverter))] [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - public Dictionary? EffectsDamage { get; set; } + public Dictionary? EffectsDamage { get; set; } // Confirmed in client [JsonPropertyName("MaximumNumberOfUsage")] @@ -1015,11 +1016,13 @@ public record Props [JsonPropertyName("knifeHitRadius")] public double? KnifeHitRadius { get; set; } + // Confirmed on client [JsonPropertyName("knifeHitSlashDam")] - public double? KnifeHitSlashDam { get; set; } + public int? KnifeHitSlashDam { get; set; } + // Confirmed on client [JsonPropertyName("knifeHitStabDam")] - public double? KnifeHitStabDam { get; set; } + public int? KnifeHitStabDam { get; set; } [JsonPropertyName("knifeDurab")] public double? KnifeDurab { get; set; } @@ -1030,11 +1033,13 @@ public record Props [JsonPropertyName("SecondryDistance")] public double? SecondryDistance { get; set; } + // Confirmed on client [JsonPropertyName("SlashPenetration")] - public double? SlashPenetration { get; set; } + public int? SlashPenetration { get; set; } + // Confirmed on client [JsonPropertyName("StabPenetration")] - public double? StabPenetration { get; set; } + public int? StabPenetration { get; set; } [JsonPropertyName("PrimaryConsumption")] public double? PrimaryConsumption { get; set; } @@ -1055,7 +1060,7 @@ public record Props public bool? DisplayOnModel { get; set; } [JsonPropertyName("AdditionalAnimationLayer")] - public double? AdditionalAnimationLayer { get; set; } + public int? AdditionalAnimationLayer { get; set; } [JsonPropertyName("StaminaBurnRate")] public double? StaminaBurnRate { get; set; } @@ -1066,8 +1071,9 @@ public record Props [JsonPropertyName("ConfigPathStr")] public string? ConfigPathStr { get; set; } + // Confirmed on client [JsonPropertyName("MaxMarkersCount")] - public double? MaxMarkersCount { get; set; } + public int? MaxMarkersCount { get; set; } [JsonPropertyName("scaleMin")] public double? ScaleMin { get; set; } @@ -1101,6 +1107,7 @@ public record Props [JsonPropertyName("MaxRepairResource")] public int? MaxRepairResource { get; set; } + // Confirmed on client - MongoId [JsonPropertyName("TargetItemFilter")] public List? TargetItemFilter { get; set; } @@ -1159,11 +1166,13 @@ public record Props [JsonPropertyName("MisfireChance")] public double? MisfireChance { get; set; } + // Confirmed in client [JsonPropertyName("MinFragmentsCount")] - public double? MinFragmentsCount { get; set; } + public int? MinFragmentsCount { get; set; } + // Confirmed in client [JsonPropertyName("MaxFragmentsCount")] - public double? MaxFragmentsCount { get; set; } + public int? MaxFragmentsCount { get; set; } [JsonPropertyName("ammoShiftChance")] public double? AmmoShiftChance { get; set; } @@ -1246,8 +1255,9 @@ public record Props [JsonPropertyName("MaxExplosionDistance")] public double? MaxExplosionDistance { get; set; } + // Confirmed in client [JsonPropertyName("FragmentsCount")] - public double? FragmentsCount { get; set; } + public int? FragmentsCount { get; set; } [JsonPropertyName("FragmentType")] public string? FragmentType { get; set; } @@ -1307,7 +1317,7 @@ public record Props public double? Rate { get; set; } [JsonPropertyName("ThrowType")] - public string? ThrowType { get; set; } + public ThrowWeapType? ThrowType { get; set; } [JsonPropertyName("ExplDelay")] public double? ExplDelay { get; set; } @@ -1355,7 +1365,7 @@ public record Props public bool? RemoveShellAfterFire { get; set; } [JsonPropertyName("RepairStrategyTypes")] - public List? RepairStrategyTypes { get; set; } + public List? RepairStrategyTypes { get; set; } [JsonPropertyName("IsEncoded")] public bool? IsEncoded { get; set; } diff --git a/Libraries/Core/Models/Enums/DamageEffectType.cs b/Libraries/Core/Models/Enums/DamageEffectType.cs new file mode 100644 index 00000000..f89d84a7 --- /dev/null +++ b/Libraries/Core/Models/Enums/DamageEffectType.cs @@ -0,0 +1,15 @@ +namespace Core.Models.Enums +{ + public enum DamageEffectType + { + HeavyBleeding, + LightBleeding, + Fracture, + Contusion, + Intoxication, + LethalIntoxication, + RadExposure, + Pain, + DestroyedPart + } +} diff --git a/Libraries/Core/Models/Enums/HealthFactor.cs b/Libraries/Core/Models/Enums/HealthFactor.cs new file mode 100644 index 00000000..7e50dd54 --- /dev/null +++ b/Libraries/Core/Models/Enums/HealthFactor.cs @@ -0,0 +1,14 @@ +namespace Core.Models.Enums +{ + public enum HealthFactor + { + None, + Health, + Hydration, + Energy, + Radiation, + Temperature, + Poisoning, + Effect + } +} diff --git a/Libraries/Core/Models/Enums/ItemDropSoundType.cs b/Libraries/Core/Models/Enums/ItemDropSoundType.cs new file mode 100644 index 00000000..d7296ce1 --- /dev/null +++ b/Libraries/Core/Models/Enums/ItemDropSoundType.cs @@ -0,0 +1,10 @@ +namespace Core.Models.Enums +{ + public enum ItemDropSoundType + { + None, + Pistol, + SubMachineGun, + Rifle + } +} diff --git a/Libraries/Core/Models/Enums/PlayerSideMask.cs b/Libraries/Core/Models/Enums/PlayerSideMask.cs new file mode 100644 index 00000000..33c45431 --- /dev/null +++ b/Libraries/Core/Models/Enums/PlayerSideMask.cs @@ -0,0 +1,12 @@ +namespace Core.Models.Enums +{ + public enum PlayerSideMask + { + None, + Usec, + Bear, + Savage, + Pmc, + All + } +} diff --git a/Libraries/Core/Models/Enums/RepairStrategyType.cs b/Libraries/Core/Models/Enums/RepairStrategyType.cs new file mode 100644 index 00000000..fb0e53e5 --- /dev/null +++ b/Libraries/Core/Models/Enums/RepairStrategyType.cs @@ -0,0 +1,9 @@ +namespace Core.Models.Enums +{ + public enum RepairStrategyType + { + MeleeWeapon, + Firearms, + Armor + } +} diff --git a/Libraries/Core/Models/Enums/ThrowWeapType.cs b/Libraries/Core/Models/Enums/ThrowWeapType.cs new file mode 100644 index 00000000..e7dd4825 --- /dev/null +++ b/Libraries/Core/Models/Enums/ThrowWeapType.cs @@ -0,0 +1,13 @@ +namespace Core.Models.Enums +{ + public enum ThrowWeapType + { + frag_grenade, + flash_grenade, + stun_grenade, + smoke_grenade, + gas_grenade, + incendiary_grenade, + sonar + } +} diff --git a/Libraries/Core/Utils/JsonUtil.cs b/Libraries/Core/Utils/JsonUtil.cs index 29429f95..9d81ed63 100644 --- a/Libraries/Core/Utils/JsonUtil.cs +++ b/Libraries/Core/Utils/JsonUtil.cs @@ -37,6 +37,11 @@ public class JsonUtil new EftEnumConverter(), new EftEnumConverter(), new EftEnumConverter(), + new EftEnumConverter(), + new EftEnumConverter(), + new EftEnumConverter(), + new EftEnumConverter(), + new EftEnumConverter(), new BaseInteractionRequestDataConverter() } };