0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 01:30:45 -05:00

remove unneeded models and patches we no longer use

This commit is contained in:
CWX 2024-07-12 15:20:19 +01:00
parent 67cafd4ded
commit 946ae3655f
8 changed files with 1 additions and 198 deletions

View File

@ -1,29 +0,0 @@
using SPT.Reflection.Patching;
using EFT.Interactive;
using HarmonyLib;
using System.Reflection;
using UnityEngine;
namespace SPT.Custom.Patches
{
/// <summary>
/// On death some bots have a habit of flying upwards. We have found this occurs when the velocity y and magnitude match
/// </summary>
public class ClampRagdollPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(Corpse), nameof(Corpse.method_16));
}
[PatchPrefix]
private static void PatchPreFix(ref Vector3 velocity)
{
if (velocity.magnitude == velocity.y && velocity.y > 5)
{
// Probably flying upwards
velocity.y = 1;
}
}
}
}

View File

@ -7,7 +7,7 @@ using UnityEngine;
namespace SPT.Custom.Patches
{
public class DisablePvEPatch : ModulePatch
public class DisableGamemodeButtonPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{

View File

@ -1,48 +0,0 @@
using System.Collections.Generic;
namespace SPT.SinglePlayer.Models.Healing
{
public class BodyPartHealth
{
private readonly Dictionary<EBodyPartEffect, float> _effects = new Dictionary<EBodyPartEffect, float>();
public float Maximum { get; private set; }
public float Current { get; private set; }
public IReadOnlyDictionary<EBodyPartEffect, float> Effects => _effects;
public void Initialize(float current, float maximum)
{
Maximum = maximum;
Current = current;
}
public void ChangeHealth(float diff)
{
Current += diff;
}
public void AddEffect(EBodyPartEffect bodyPartEffect, float time = -1)
{
_effects[bodyPartEffect] = time;
}
public void UpdateEffect(EBodyPartEffect bodyPartEffect, float time)
{
_effects[bodyPartEffect] = time;
}
public void RemoveAllEffects()
{
_effects.Clear();
}
public void RemoveEffect(EBodyPartEffect bodyPartEffect)
{
if (_effects.ContainsKey(bodyPartEffect))
{
_effects.Remove(bodyPartEffect);
}
}
}
}

View File

@ -1,12 +0,0 @@
namespace SPT.SinglePlayer.Models.Healing
{
public enum EBodyPartEffect
{
Fracture,
LightBleeding,
HeavyBleeding,
MildMusclePain,
SevereMusclePain,
Unknown
}
}

View File

@ -1,29 +0,0 @@
using System.Collections.Generic;
namespace SPT.SinglePlayer.Models.Healing
{
public class PlayerHealth
{
private readonly Dictionary<EBodyPart, BodyPartHealth> _health;
public IReadOnlyDictionary<EBodyPart, BodyPartHealth> Health => _health;
public bool IsAlive { get; set; }
public float Hydration { get; set; }
public float Energy { get; set; }
public float Temperature { get; set; }
public PlayerHealth()
{
IsAlive = true;
_health = new Dictionary<EBodyPart, BodyPartHealth>()
{
{ EBodyPart.Head, new BodyPartHealth() },
{ EBodyPart.Chest, new BodyPartHealth() },
{ EBodyPart.Stomach, new BodyPartHealth() },
{ EBodyPart.LeftArm, new BodyPartHealth() },
{ EBodyPart.RightArm, new BodyPartHealth() },
{ EBodyPart.LeftLeg, new BodyPartHealth() },
{ EBodyPart.RightLeg, new BodyPartHealth() }
};
}
}
}

View File

@ -1,31 +0,0 @@
using Newtonsoft.Json;
using EFT;
using System.Collections.Generic;
using SPT.SinglePlayer.Models.Healing;
using SPT.SinglePlayer.Models.RaidFix;
namespace SPT.SinglePlayer.Models.Progression
{
public class SaveProfileRequest
{
[JsonProperty("exit")]
public string Exit;
[JsonProperty("profile")]
public Profile Profile;
[JsonProperty("isPlayerScav")]
public bool IsPlayerScav;
[JsonProperty("health")]
public PlayerHealth Health;
[JsonProperty("insurance")]
public List<SPTInsuredItemClass> Insurance;
public SaveProfileRequest()
{
Exit = "left";
}
}
}

View File

@ -1,11 +0,0 @@
namespace SPT.SinglePlayer.Models.RaidFix
{
public class SPTInsuredItemClass
{
public string id;
public float? durability = null;
public float? maxDurability = null;
public byte? hits = null;
public bool usedInQuest = false;
}
}

View File

@ -1,37 +0,0 @@
using EFT;
using HarmonyLib;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace SPT.SinglePlayer.Utils.Progression
{
public class NotesJsonConverter : JsonConverter
{
private static Type _targetType;
public NotesJsonConverter()
{
_targetType = typeof(AbstractGame).Assembly.GetTypes().First(t =>
t.GetProperty("TransactionInProcess", BindingFlags.Instance | BindingFlags.Public) != null);
}
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
var valueToSerialize = Traverse.Create(_targetType).Field<List<object>>("Notes").Value;
serializer.Serialize(writer, $"{{\"Notes\":{JsonConvert.SerializeObject(valueToSerialize)}}}");
}
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
throw new NotImplementedException();
}
public override bool CanConvert(Type objectType)
{
return objectType == _targetType;
}
}
}