Root-Block_Rebalence icon

Block Rebalence

Makes block slightly more balenced

By Root
Last updated 2 weeks ago
Total downloads 260
Total rating 0 
Categories Gameplay Patch
Dependency string Root-Block_Rebalence-0.1.0
Dependants 0 other packages depend on this package

This mod requires the following mods to function

willis81808-UnboundLib-3.2.14 icon
willis81808-UnboundLib

This is a helpful utility for ROUNDS modders aimed at simplifying common tasks.

Preferred version: 3.2.14

README

using BepInEx;
using HarmonyLib;
using System.Reflection;

[assembly: AssemblyVersion(BlockRebalence.Main.Version)]
namespace BlockRebalence {
    [BepInDependency("com.willis.rounds.unbound")]
    [BepInPlugin(ModId,ModName,Version)]
    [BepInProcess("Rounds.exe")]
    public class Main:BaseUnityPlugin {
        private const string ModId = "Systems.R00t.BlockRebalance";
        private const string ModName = "Block Rebalance";
        public const string Version = "0.1.0";

        void Awake() {
            new Harmony(ModId).PatchAll();
        }
    }

    [HarmonyPatch(typeof(Block),nameof(Block.Cooldown))]
    [HarmonyPriority(Priority.Last)]
    public static class BlockCooldownMinPatch{
        static void Postfix(ref float __result) {
            if(__result<0.3f) __result=0.3f;
        }
    }

    [HarmonyPatch(typeof(Block),nameof(Block.Update))]
    public static class BlockCooldownWaitTillDoneBlockingPatch {
        static void Prefix(Block __instance) {
            if(__instance.input && __instance.IsBlocking()) __instance.counter=-TimeHandler.deltaTime;
        }
        
    }

    [HarmonyPatch(typeof(Block),nameof(Block.Start))]
    public static class BlockStopEchoBlockOverlap {
        static void Prefix(Block __instance) {
            __instance.timeBetweenBlocks=0.45f;
        }
    }
}