Upload from upload_mods.ps1
This commit is contained in:
28
Harmony/Harmony_Equipment.cs
Normal file
28
Harmony/Harmony_Equipment.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
namespace Harmony.EquipmentPatches
|
||||
{
|
||||
[HarmonyPatch(typeof(Equipment))]
|
||||
[HarmonyPatch("ModifyValue")]
|
||||
public class ModifyValuePatch
|
||||
{
|
||||
public static bool Prefix(Equipment __instance, ItemValue _originalItemValue, PassiveEffects _passiveEffect, ref float _base_val, ref float _perc_val, FastTags<TagGroup.Global> tags, bool _useDurability)
|
||||
{
|
||||
for (int index = 0; index < __instance.m_slots.Length; ++index)
|
||||
{
|
||||
ItemValue slot = __instance.m_slots[index];
|
||||
if (slot != null && !slot.Equals(_originalItemValue) && slot.ItemClass != null)
|
||||
{
|
||||
//Log.Out("EquipmentPatches-ModifyValue slot: " + slot.ItemClass.Name);
|
||||
//Log.Out("EquipmentPatches-ModifyValue PercentUsesLeft: " + slot.PercentUsesLeft);
|
||||
|
||||
if (slot.PercentUsesLeft > 0)
|
||||
{
|
||||
//Log.Out("EquipmentPatches-ModifyValue OVER ZERO");
|
||||
slot.ModifyValue(__instance.m_entity, _originalItemValue, _passiveEffect, ref _base_val, ref _perc_val, tags, _useDurability: !RebirthUtilities.ScenarioSkip());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user