Birdoggydog's Builds

Adding a Juice Injector and edible monster bodies in Godot

A vat that sells ranks, healing and resurrection for juice, and monster bodies that can be searched, then eaten for a quarter of the kill's experience again.

The pink juice vat in the first dungeon is now a shop. It has a sign that says JUICE INJECTOR, and the party can spend juice there on ranks, on healing and on bringing a dead member back. I also made monster bodies edible, so once you’ve searched one empty you can eat it for more juice. Both started as notes I drew on screenshots while playing.

59 seconds in the first dungeon: the sign on the vat, a rank bought on the character sheet, a hurt member healed, a dead member raised, then a monster killed, searched, eaten and gone.

How do you turn a vat into a shop?

My note circled the vat and said it should be a place to spend juice to level up, heal or raise a dead character. The vat was already a machine in the dungeon, so I didn’t build a model. A row in content/machines.json now says "use": "juice_injector", and the machine builder calls JuiceInjector.fit() on it, which is one added line.

fit() puts a node 1.33 m in front of the vat. The node adds the sign (amber letters on a dark plate, the same look as the other signs on the site), takes E presses, and adds a 7 by 4 by 7 m safe house around the vat. That house is the trick. Ranks were already sold at safe houses, so I didn’t write a second rule for buying them. The vat just stands in one, and its Ranks button opens the normal character sheet on that member.

Heal and Raise are the new parts. The screen is a row per member with their health, their juice and the buttons. While it’s open, the game clock is stopped and mouse look is off, and both go back to how they were when it closes. Every price is on the screen before you pay, and a refused action says why in the status line.

What do healing and raising cost?

All the numbers live in one file, InjectorRules, and they’re placeholders:

const HEALTH_PER_JUICE := 2     # heal: 1 juice per 2 health, rounded up
const RAISE_PRICE := 200        # raise: the same price as the Recall spell
const RAISE_HEALTH := 0.25      # a raised member comes back at a quarter health

Healing puts a member back to full, and the price is the missing health divided by two, rounded up. A downed member’s health is below zero, so healing them costs more than a full bar. Raising costs 200 and brings the member back at a quarter of their maximum. I left out the Freezer Burn penalty because that belongs to the Recall spell, not the vat.

Juice is personal in this game, so one member pays out of their own pool. By default it’s the patient if they’re standing, and otherwise whoever is standing with the most juice. The downed and the dead can’t pay, which means a dead member’s own juice can’t raise them. I picked that rule myself, and it’s open for me to change.

I split the rules from the screen on purpose. InjectorRules is all static functions with no UI in them, so the test calls them directly and the screen is a thin layer on top.

How does a body get eaten?

My other note said all the corpses should have an option to eat them. The subjects on the tables already could be eaten for 160 juice, but monster bodies only offered Search.

BodyMeal works out what a body is worth when it first enters the world: a quarter of what the kill paid, and at least 1. A Meat Sack’s body is worth 25 and a Gristle Spitter’s 40. The value is saved with the body. Search comes first, and Eat only appears once the body has been searched and is empty, so eating can never throw away loot. Eating hands the juice to the party through the same call a kill uses, so it’s shared out and floats over the cards, then the body sinks away. An eaten body leaves the group that gets saved, so it doesn’t come back at a load, and the Second Shift spell can’t raise it.

That changed one old behavior. An emptied body used to disappear by itself. Now it stays where it fell until its monster respawns at the week’s turn, which is what a body left full always did. It also means you can still raise an emptied body until you eat it.

Bodies that lie dead from the start of a dungeon needed a rule too. If the file doesn’t say what to eat them as, they count as a Gristle Spitter, 160 juice. A file can say "eat_as": "none" to keep a body uneaten. A character who dies in the story, like Carl, is only edible if the file says so, because eating sets a fate that a story can read.

What is still open?

The prices are guesses, and I haven’t decided who should pay at the injector. I also haven’t decided whether emptied bodies should stay. And the first dungeon’s locks were tuned on the idea that you couldn’t spend juice there. Now a party can come back to the vat with kill juice and buy Pick Locks ranks before the harder doors, so I may need to retune them.

The new test has 56 checks and passes. I changed five older tests whose expectations assumed bodies vanish and that juice couldn’t be spent in the site.