← Devlog ·
47 objects, zero lines of combat code
The problem
Every new object that edits the combat code makes the next one harder. By object ten you're afraid to touch anything.
The rule I set
Items never modify the combat or the turn flow. They only subscribe to an event bus. When something happens (an attack, damage, a kill, a piece dying, a room starting), the bus announces it. An object can listen and change the payload: reduce the damage, cancel the attack, add a status.
An example
The Thimble Helmet ("absorbs 2 damage from every hit received") is one small file. It listens for "damage about to be dealt" and subtracts 2. The Pin Spur ("moving costs no AP") listens for movement and gives the AP back. Neither knows the other exists.
The inventory
The game has 47 objects: 20 for a single piece, 13 global, 7 consumables, 6 dyes (special relics only found in the Painting Gallery, one per piece) and 1 trophy. Adding one means adding one file.
What can go wrong
Two objects can interact in ways I didn't plan. That is the point, and also the risk.
Unlocked
Swift Moth. Fast and fragile. Moves far and attacks diagonally.
Next
Devlog 003: the bot that couldn't beat the Garden Gnome.