Remove unused profile property VitalityData

This commit is contained in:
Chomp
2025-06-29 15:55:55 +01:00
parent 14e875f199
commit 4d39a4c819
4 changed files with 0 additions and 176 deletions
@@ -1,79 +0,0 @@
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
using SPTarkov.Server.Core.Models.Eft.Profile;
namespace SPTarkov.Server.Core.Extensions
{
public static class VitalityExtensions
{
public static void SetDefaults(this Vitality? vitality)
{
vitality ??= new Vitality
{
Health = null,
Energy = 0,
Temperature = 0,
Hydration = 0,
};
vitality.Health = new Dictionary<string, BodyPartHealth>
{
{
"Head",
new BodyPartHealth
{
Health = new CurrentMinMax { Current = 0 },
Effects = new Dictionary<string, BodyPartEffectProperties>(),
}
},
{
"Chest",
new BodyPartHealth
{
Health = new CurrentMinMax { Current = 0 },
Effects = new Dictionary<string, BodyPartEffectProperties>(),
}
},
{
"Stomach",
new BodyPartHealth
{
Health = new CurrentMinMax { Current = 0 },
Effects = new Dictionary<string, BodyPartEffectProperties>(),
}
},
{
"LeftArm",
new BodyPartHealth
{
Health = new CurrentMinMax { Current = 0 },
Effects = new Dictionary<string, BodyPartEffectProperties>(),
}
},
{
"RightArm",
new BodyPartHealth
{
Health = new CurrentMinMax { Current = 0 },
Effects = new Dictionary<string, BodyPartEffectProperties>(),
}
},
{
"LeftLeg",
new BodyPartHealth
{
Health = new CurrentMinMax { Current = 0 },
Effects = new Dictionary<string, BodyPartEffectProperties>(),
}
},
{
"RightLeg",
new BodyPartHealth
{
Health = new CurrentMinMax { Current = 0 },
Effects = new Dictionary<string, BodyPartEffectProperties>(),
}
},
};
}
}
}
@@ -34,9 +34,6 @@ public record SptProfile
[JsonPropertyName("spt")]
public Spt? SptData { get; set; }
[JsonPropertyName("vitality")]
public Vitality? VitalityData { get; set; }
[JsonPropertyName("inraid")]
public Inraid? InraidData { get; set; }
@@ -514,24 +511,6 @@ public record ReceivedGift
public int? Current { get; set; }
}
public record Vitality
{
[JsonExtensionData]
public Dictionary<string, object>? ExtensionData { get; set; }
[JsonPropertyName("Hydration")]
public double? Hydration { get; set; }
[JsonPropertyName("Energy")]
public double? Energy { get; set; }
[JsonPropertyName("Temperature")]
public double? Temperature { get; set; }
[JsonPropertyName("Health")] // This now does health and effects to each bodypart
public Dictionary<string, BodyPartHealth>? Health { get; set; }
}
public record Inraid
{
[JsonExtensionData]
@@ -1,6 +1,5 @@
using SPTarkov.DI.Annotations;
using SPTarkov.Server.Core.DI;
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
using SPTarkov.Server.Core.Models.Eft.Profile;
namespace SPTarkov.Server.Core.Routers.SaveLoad;
@@ -15,79 +14,6 @@ public class HealthSaveLoadRouter : SaveLoadRouter
public override SptProfile HandleLoad(SptProfile profile)
{
DefaultVitality(profile.VitalityData);
return profile;
}
public void DefaultVitality(Vitality? vitality)
{
vitality ??= new Vitality
{
Health = null,
Energy = 0,
Temperature = 0,
Hydration = 0,
};
vitality.Health = new Dictionary<string, BodyPartHealth>
{
{
"Head",
new BodyPartHealth
{
Health = new CurrentMinMax { Current = 0 },
Effects = new Dictionary<string, BodyPartEffectProperties>(),
}
},
{
"Chest",
new BodyPartHealth
{
Health = new CurrentMinMax { Current = 0 },
Effects = new Dictionary<string, BodyPartEffectProperties>(),
}
},
{
"Stomach",
new BodyPartHealth
{
Health = new CurrentMinMax { Current = 0 },
Effects = new Dictionary<string, BodyPartEffectProperties>(),
}
},
{
"LeftArm",
new BodyPartHealth
{
Health = new CurrentMinMax { Current = 0 },
Effects = new Dictionary<string, BodyPartEffectProperties>(),
}
},
{
"RightArm",
new BodyPartHealth
{
Health = new CurrentMinMax { Current = 0 },
Effects = new Dictionary<string, BodyPartEffectProperties>(),
}
},
{
"LeftLeg",
new BodyPartHealth
{
Health = new CurrentMinMax { Current = 0 },
Effects = new Dictionary<string, BodyPartEffectProperties>(),
}
},
{
"RightLeg",
new BodyPartHealth
{
Health = new CurrentMinMax { Current = 0 },
Effects = new Dictionary<string, BodyPartEffectProperties>(),
}
},
};
}
}
@@ -13,7 +13,6 @@ using SPTarkov.Server.Core.Routers;
using SPTarkov.Server.Core.Servers;
using SPTarkov.Server.Core.Utils;
using SPTarkov.Server.Core.Utils.Cloners;
using Vitality = SPTarkov.Server.Core.Models.Eft.Profile.Vitality;
namespace SPTarkov.Server.Core.Services;
@@ -114,7 +113,6 @@ public class CreateProfileService(
UserBuildData = profileTemplateClone.UserBuilds,
DialogueRecords = profileTemplateClone.Dialogues,
SptData = _profileHelper.GetDefaultSptDataObject(),
VitalityData = new Vitality(),
InraidData = new Inraid(),
InsuranceList = [],
BtrDeliveryList = [],