Type improvements to Item

This commit is contained in:
Chomp
2025-01-29 19:56:30 +00:00
parent bad242da31
commit 83bc0c4448
11 changed files with 110 additions and 24 deletions
@@ -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<DamageEffectType>(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;
@@ -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);