EnemyOrbMerge
【Host Only MOD】Merges touching enemy orbs into one orb with indestructible-priority selection and optimized contact processing. enemy オーブ同士を无氕き Priorityと軽quantificationされたcontact processingで1つにまとめる MOD
About this mod Author’s original text
COMPATIBLE WITH COSMETICS UPDATE V0.4.0.
EnemyOrbMerge
This mod is a host-only mod that merges touching enemy drop orbs into one orb, transfers the combined value to the surviving orb, prioritizes indestructible-effect orbs, and reduces merge-check load with contact-queue processing.
Overview
Enemy drop orbs created from defeated enemies can combine with each other when they touch.
The host decides the merge result, updates the surviving orb value, and removes the losing orb over the network.
Participants do not need to install the mod to see the merged result.
The latest version changes the merge decision order and performance model.
The surviving orb is now selected by indestructible effect first, then player-held state, then higher value.
The merge scan is also optimized so normal operation uses queued contact pairs instead of repeatedly checking every tracked orb against every other tracked orb.
Main behavior
- Targets enemy drop orbs only
- Ignores normal valuables and unrelated objects
- Merges touching enemy orbs into one surviving orb
- Adds the losing orb value into the surviving orb
- Deletes the losing orb over the network
- Reapplies vanilla-style invincibility to the surviving orb after a successful merge
- Suppresses orb-to-orb breakage during contact checks
- Uses host-authoritative processing
Priority rules
The surviving orb is selected with the following order.
- An orb currently affected by an indestructible orb or indestructible drone survives
- If only one orb is being held by a player, the held orb survives
- If both have the same priority state, the higher value orb survives
- If the values are equal, the lower internal sort token survives
This means an indestructible-protected orb is kept even if the other orb is being held or has a higher value.
Performance improvements
The original merge scan checked tracked orbs as broad pair candidates.
This version keeps the same merge behavior while reducing unnecessary work.
Contact queue processing
Orb-to-orb collision callbacks enqueue only the touching pair.
The merge loop then processes queued pairs up to a configured limit per tick.
This avoids expensive full-pair checks during normal contact-heavy situations.
Low-frequency fallback scan
A fallback all-pair scan is still available for rare cases where Unity collision callbacks do not enqueue a pair.
This fallback is slower, but it runs at a lower configurable frequency.
Indestructible target cache
Indestructible orb and indestructible drone targets are cached for a short interval.
This avoids repeated scene-wide searches during every priority comparison.
Limit rules
Two independent limit systems are included.
Value cap
If MaxOrbValue is set to 0, value is unlimited.
If it is set to 1 or higher, that number becomes the maximum allowed value for a merged orb.
A merge is rejected when either condition is true.
- One of the touching orbs is already at or above the configured cap
- The merged result would exceed the configured cap
When this happens, the orbs do not merge.
Both orbs only receive invincibility again so they do not immediately break from the attempted impact.
No merge-success effect is played in this case.
Merge-count cap
If MaxOrbMergeCount is set to 0, merge count is unlimited.
If it is set to 1 or higher, an orb lineage that has already reached that many successful merges can no longer merge again.
Merge count starts at 0 on a fresh orb.
After a successful merge, the resulting orb stores max(left lineage, right lineage) + 1.
This prevents bypassing the cap by forcing survival onto a lower-count orb.
When the merge-count cap blocks a merge, both orbs only receive invincibility again and no success effect is played.
Visual behavior
Merge success effect
A built-in network-visible impact effect can be played at the merge position.
This is a success-only effect.
If a merge is rejected by a cap, this effect is not played.
Invincibility electricity effect
A built-in electricity v
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.
Install these first, or the mod will not work: