You are viewing a potentially older version of this package. View all versions.
PierreMarais-PeglinBalatroScore-1.1.0 icon

PeglinBalatroScore

A Balatro-style pegs x damage score for every shot, with flames that grow as you close in on the act boss's HP and a bomb chest that pays out every bomb.

Date uploaded 2 days ago
Version 1.1.0
Download link PierreMarais-PeglinBalatroScore-1.1.0.zip
Downloads 11
Dependency string PierreMarais-PeglinBalatroScore-1.1.0

This mod requires the following mods to function

BepInEx-BepInExPack_Peglin-5.4.2100 icon
BepInEx-BepInExPack_Peglin

BepInEx pack for Peglin. Preconfigured and ready to go.

Preferred version: 5.4.2100

README

PeglinBalatroScore

Watch every shot add up, Balatro style. A pegs × damage score counts up as your orb bounces and catches fire as the shot closes in on the boss's HP, and a bomb chest behind Peglin pays out every bomb you set off.

A shot counting up

An overkill

The bomb chest paying out

Features

  • Pegs × damage, live. The green box is what the pegs you've hit are worth (relics that make a hit worth more count). The yellow box is your orb's damage per peg, jumping to its crit damage when you trigger a crit, and every increase lands with a jolt.
  • The real total. When the balls stop, the boxes give way to the damage the game actually deals, bonuses and multipliers included (even the ones added as Peglin attacks, like Echo), for 3 seconds of real time (game speed doesn't cut it short). Fire again and you're straight back to 0 × 0.
  • Flames. The closer a shot gets to the act boss's max HP, the bigger the fire, and it bursts when you pass it. The target follows the boss's real HP, Cruciball included.
  • OVERKILL! A burning stamp when a shot beats the boss's max HP, or a green OVERHEAL! when a heal goes past yours.
  • Bomb chest. A see-through chest behind Peglin catches a bomb the moment each one is lit, while your orb is still bouncing. It's sized for 10 bombs; extra ones heap up and spill over the sides.
  • The bomb payout. The instant Peglin's last thrown bomb explodes, the chest goes off with it: every bomb inside explodes, the chest blows apart into planks, and the bombs' total damage (each bomb counted once, after relics) bursts out of the wreckage, then shatters.
  • Fonts. The score and the bomb chest's total draw in the game's own font, or whatever font PeglinFonts is using, hotkey changes included.
  • Hover for help. Mouse over the score for a plain explanation and your last shot's damage or healing.
  • Fits the game's UI. Tooltips draw over the score, and in boss fights the boss health bar and enemy scroll slide down to make room.

For mod authors

Other mods can work with the score through BalatroScoreApi, found by its simple type name, so you need no reference to this plugin. Add [BepInDependency("PeglinBalatroScore", BepInDependency.DependencyFlags.SoftDependency)] to your plugin so it loads after this one; otherwise the lookup below finds nothing when your Awake runs first.

using System;
using System.Linq;
using BepInEx.Bootstrap;

static void RegisterScoreTarget(string myGuid, Func<long> currentBossMaxHp)
{
    if (!Chainloader.PluginInfos.TryGetValue("PeglinBalatroScore", out var info) || info.Instance == null) return;
    Type api = info.Instance.GetType().Assembly.GetTypes().FirstOrDefault(t => t.Name == "BalatroScoreApi");
    var version = api?.GetProperty("ApiVersion")?.GetValue(null) as int?;
    if (version == null || version < 1) return;
    api.GetMethod("SetTargetProvider")?.Invoke(null, new object[] { myGuid, currentBossMaxHp });
}
  • ApiVersion is 1.
  • SetTargetProvider(string guid, Func<long> provider) sets the HP the flames and OVERKILL aim at, asked at the start of every damaging shot. A value above 0 is used exactly as given (lower than the boss's normal HP is fine); 0 or less means no opinion. The first mod with an opinion, in registration order, wins. Healing shots always aim at the player's max HP.
  • SetHudSuppressor(string guid, Func<string, bool> suppress) hides parts of the HUD. It is asked often (up to every frame; don't rely on when) for each part by name: "score" (the score, with its OVERKILL stamp), "overkill" (only the OVERKILL/OVERHEAL stamp) and "bomb_chest" (the bomb chest; one in progress is dropped without its burst and stays gone until that turn's bombs are all thrown). True from any mod hides that part. New parts may be added, so return false for names you don't know unless you mean to hide everything. Scoring and listeners carry on while hidden. Keep it cheap.
  • SetScoreListener(string guid, Action<string, long, long> listener) is told once for each scored result, after its final total is known: the kind, the total and the target it was measured against. Kinds are "shot" (a damaging shot: the damage the attack goes out with, told as the attack goes out, or when the next shot is fired or the battle ends if there is no attack), "heal" (a healing shot; the target is the player's max HP) and "bombs" (Peglin's thrown bombs for a turn: each bomb's damage after relics, counted once however many enemies it hits, told when the next shot is fired or the battle ends; the target is the latest damaging shot's). New kinds may be added, so ignore ones you don't know. It is told whether or not the HUD is showing; a shot is not told if the battle disappears while it is in play (quitting to the menu).
  • CurrentTarget is the target the score is using, as of the latest shot.
  • RemoveAll(string guid) removes everything your GUID registered.
  • Every member follows the same rules: registering again with the same GUID replaces the old callback, a null callback removes it, and a null or empty GUID is ignored. A callback that throws is logged once and ignored.

Installation

With a mod manager (recommended):

  1. Install r2modman or the Thunderstore Mod Manager.
  2. Search for PeglinBalatroScore and install it. BepInEx is installed for you.
  3. Launch Peglin.

Manually:

  1. Install BepInExPack_Peglin.
  2. Put PeglinBalatroScore.dll in Peglin/BepInEx/plugins/.
  3. Start the game once to create the config file.

Settings

Change these in BepInEx/config/PeglinBalatroScore.cfg (start the game once to create it). Restart the game after changing them.

Setting Default What it does
ShowScore true Show the score above the enemy scroll in battles
ResultSeconds 3 How long the final total stays up, in real seconds (0.5 to 10)
EnableLogging true Write the boss HP target and layout notes to BepInEx/LogOutput.log
ShowFlames true Flames behind the score as it closes in on the boss's HP
ShakeNumbers true The numbers shake harder as the score heats up
ShowOverkill true The OVERKILL / OVERHEAL stamp
Scale 1 Size of the score (0.5 to 2)
OffsetX 0 Move the score left (negative) or right (positive), in pixels at 1920×1080
OffsetY 0 Move the score down (negative) or up (positive), in pixels at 1920×1080
ShowBombChest true The bomb chest behind Peglin
ChestScale 1 Size of the chest relative to Peglin (0.5 to 2)

Compatibility

Good to know

  • The target is the act's boss in every fight of the act, not the enemies in front of you, so early shots rarely get big flames. Flames light at 5% of the boss's HP on an act's first floor and at 10% from the second. Where there is no map to read the boss from, the toughest enemy on screen is the target.
  • In the Mole fight the target is the tree's HP, the toughest thing on the field.
  • The bomb total counts Peglin's thrown bombs, each once however many enemies it hits. Turn the chest off with ShowBombChest and the bombs still go off as normal; only the chest is gone.
  • Your save is untouched. The mod writes only its own config file, and its shaking numbers never use the game's random rolls, so a seed plays out the same with or without it.

Some of my other mods

Check out all my Peglin mods

Please consider buying me a coffee ☕

CHANGELOG

Changelog

1.1.0

  • New BalatroScoreApi for other mods: a mod can give the HP the flames and OVERKILL aim at (a value it gives is used exactly, so a boss with lowered HP works too), hide the score, the OVERKILL stamp or the bomb chest, and be told the total and target of every shot and of each turn's bombs. With no mod registered, nothing changes.
  • When an act's boss fight has no enemy flagged as a boss, Cruciball 6 to 9 now uses the higher HP the game gives those enemies (it was only applied from Cruciball 10).
  • The score's shake and the OVERKILL wobble use the mod's own random numbers instead of the game's, so the mod never changes how a seed plays out.
  • Fixed the real total missing the damage Peglin's attack adds as it goes out (Echo orbs, Echo Chamber, attack-only bonuses).
  • A shot that kills every enemy before it finishes now shows its total instead of vanishing.
  • A bomb with no enemy to hit no longer counts towards the bomb chest's total.
  • Turning the bomb chest off during a turn's bombs keeps it gone until they're all thrown, instead of bringing back a half-empty chest.

1.0.2

  • A see-through bomb chest behind Peglin catches a bomb the moment each one is lit, while the orb is still bouncing. It holds about ten, and bombs beyond that heap up and spill over the sides. When the last bomb Peglin throws detonates, the chest bursts on that same frame: every bomb left inside goes off, the chest blows apart into planks, and the bombs' total damage (each bomb's damage after relics, added up) bursts out of the wreckage and shatters.
  • The score HUD follows PeglinFonts' current font, including when the font is changed with its hotkey.
  • Fixed the boss HP target on fights with a barricade (the Mole's tree) by ignoring the barricade's health.
  • Pausing the game freezes the bomb chest instead of letting bombs drop and burst behind the pause menu.

1.0.1

  • Repackaged 1.0.0; no changes to the mod.

1.0.0

  • First release: a Balatro-style pegs x damage score for each shot, the game's real total at the end, flames that grow against the act boss's max HP with no upper limit, a flaming OVERKILL (or green OVERHEAL) stamp, and a hover tooltip explaining the maths.