Upload from upload_mods.ps1
This commit is contained in:
36
Harmony/Harmony_Recipe.cs
Normal file
36
Harmony/Harmony_Recipe.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
namespace Harmony.RecipePatches
|
||||
{
|
||||
[HarmonyPatch(typeof(Recipe))]
|
||||
[HarmonyPatch("IsUnlocked")]
|
||||
public class IsUnlockedPatch
|
||||
{
|
||||
public static void Postfix(Recipe __instance, ref bool __result, EntityPlayer _ep)
|
||||
{
|
||||
string recipeName = __instance.GetName();
|
||||
|
||||
//Log.Out("RecipePatches-IsUnlocked itemClassName: " + recipeName);
|
||||
if (_ep.Buffs.GetCustomVar(recipeName) == 1f)
|
||||
{
|
||||
//Log.Out("RecipePatches-IsUnlocked KNOWN itemClassName: " + recipeName);
|
||||
__result = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(Recipe))]
|
||||
[HarmonyPatch("GetCraftingTier")]
|
||||
public class GetCraftingTierPatch
|
||||
{
|
||||
public static bool Prefix(Recipe __instance, ref int __result, EntityPlayer _ep)
|
||||
{
|
||||
__result = (int)EffectManager.GetValue(PassiveEffects.CraftingTier, _originalValue: 1f, _entity: (EntityAlive)_ep, _recipe: __instance, tags: __instance.tags);
|
||||
|
||||
if (__result > 5)
|
||||
{
|
||||
__result = 5;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user