using SptCommon.Annotations; using Core.DI; using Core.Helpers; using Core.Models.Eft.Common.Tables; using Core.Models.Eft.Profile; namespace Core.Routers.SaveLoad; [Injectable(InjectableTypeOverride = typeof(SaveLoadRouter))] public class HealthSaveLoadRouter() : SaveLoadRouter { protected override List GetHandledRoutes() { return [new HandledRoute("spt-health", false)]; } 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 { { "Head", new BodyPartHealth { Health = new CurrentMinMax { Current = 0 }, Effects = new Dictionary() } }, { "Chest", new BodyPartHealth { Health = new CurrentMinMax { Current = 0 }, Effects = new Dictionary() } }, { "Stomach", new BodyPartHealth { Health = new CurrentMinMax { Current = 0 }, Effects = new Dictionary() } }, { "LeftArm", new BodyPartHealth { Health = new CurrentMinMax { Current = 0 }, Effects = new Dictionary() } }, { "RightArm", new BodyPartHealth { Health = new CurrentMinMax { Current = 0 }, Effects = new Dictionary() } }, { "LeftLeg", new BodyPartHealth { Health = new CurrentMinMax { Current = 0 }, Effects = new Dictionary() } }, { "RightLeg", new BodyPartHealth { Health = new CurrentMinMax { Current = 0 }, Effects = new Dictionary() } } }; } }