Files
2025-09-22 12:27:28 +02:00

80 lines
3.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Whack (Megabonk IL2CPP Godmode)
BepInEx plugin for **Megabonk** (Unity 2023, **IL2CPP**) that enables **player godmode** by intercepting the `PlayerHealth` damage pipeline.
> **Status:** Only **HARD** godmode (skip damage) is implemented and confirmed working. A “soft” mode (zeroing damage but keeping effects) is **not** tested in this repo.
---
## BepInEx & Tooling
- **BepInEx:** **6.0.0-be.735 (IL2CPP)** recommended (matches dev logs). Other recent bleeding-edge BepInEx 6 IL2CPP builds will likely work.
- **Unity Runtime:** 2023.2.x (game specific)
- **.NET SDK:** .NET 6
- **IDE:** Visual Studio 2022
---
## Manual references (add these in VS)
Because the `.csproj` uses **absolute** `HintPath`s, you must manually add references on your machine:
- **0Harmony** — `...\Megabonk\BepInEx\core\0Harmony.dll`
- **BepInEx.Core** — `...\Megabonk\BepInEx\core\BepInEx.Core.dll`
- **BepInEx.Preloader.Core** — `...\Megabonk\BepInEx\core\BepInEx.Preloader.Core.dll`
- **BepInEx.Unity.Common** — `...\Megabonk\BepInEx\core\BepInEx.Unity.Common.dll`
- **BepInEx.Unity.IL2CPP** — `...\Megabonk\BepInEx\core\BepInEx.Unity.IL2CPP.dll`
- **Assembly-CSharp (DummyDll)** — `...\Il2CppDumper\DummyDll\Assembly-CSharp.dll` (from your Il2CppDumper output)
> In **Properties** for each reference, set **Copy Local = False**. The DummyDll is **compile-time only** (do not ship it).
If your BepInEx install uses a different folder structure, point the references to your actual files.
---
## Build (Visual Studio 2022)
1. Install **BepInEx 6 IL2CPP** into the game folder and run the game once.
2. In VS, open **`Whack.sln`**.
3. Add the **manual references** listed above (rightclick project → Add → Reference → Browse).
4. Ensure **Target Framework** is **.NET 6.0** (`net6.0`).
5. Select **Release | Any CPU** (or Debug).
6. Build → **Build Solution**.
7. Output DLL: `Whack\bin\Release\net6.0\Whack.dll`
---
## Install
1. Copy `Whack.dll` to the games **`BepInEx\plugins\`** folder:
```
...\Megabonk\BepInEx\plugins\Whack.dll
```
2. Launch the game.
3. Verify in `BepInEx\LogOutput.log` that the plugin loads (look for “Whack loaded” and Harmony patches).
---
## How it works (HARD mode)
The plugin patches `PlayerHealth.Damage(DamageContainer dc, bool ignoreShield)` to **skip** the original method, preventing any HP loss. It also guards common external damage entry points where applicable.
- Pros: Simple and robust godmode.
- Cons: Any effects performed **inside** the original `Damage()` (e.g., specific shakes/counters) wont run.
---
## Troubleshooting
- **“0 plugins to load”** → Ensure your main class has `[BepInPlugin("com.apfelteesaft.megabonk.whack", "Whack", "1.0.0")]` and the DLL is in `BepInEx\plugins\`.
- **Missing types at compile time** → Add **Assembly-CSharp (DummyDll)** from Il2CppDumper.
- **Missing types at runtime** → Do **not** ship DummyDlls. Only the plugin DLL goes in `plugins\`.
- **Wrong BepInEx** → Use the **IL2CPP** build of BepInEx 6.
- **Blocked DLL** → Rightclick the DLL → Properties → **Unblock**.
---
## License
None (no license specified). Use privately at your own discretion.