Split The code is public; the app answers only to the crew.
A drop from anywhere is free: `fallDamage` is written, tested and called by nothing #228
Check · Review · Land · Live done — Landed and live in production.
Falls now cost health: `fallDamage` is called on the tick a fall ends, instead of being dead code that only its own test used. On `de_forge` and `de_cinder` it never costs anything. The tallest floor anyone can stand on is a 128-unit crate, which lands at about 452 u/s, under the 580 u/s threshold. A drop needs about 210 units before it hurts. This is here so the simulation is whole and taller geo…
shipped merged
Sign in to join this conversation.
Falls now cost health:
fallDamageis called on the tick a fall ends, instead of being dead code that only its own test used. Onde_forgeandde_cinderit never costs anything. The tallest floor anyone can stand on is a 128-unit crate, which lands at about 452 u/s, under the 580 u/s threshold. A drop needs about 210 units before it hurts. This is here so the simulation is whole and taller geometry gets it for free. The README's What is real and what is not section says so.Physics (
physics.ts):Bodyhas a newlandSpeedfield.movewrites it on every call: the downward speed on the tick a fall ends, 0 on every other tick. That speed is read before the floor zeroesvel[2], so standing still can never count one landing twice. It allocates nothing.World (
world.ts): right aftermove,applyInputcalls a newland. It takesMath.round(fallDamage(landSpeed)), whole points like all other damage here, and armour doesn't reduce it. It uses the bomb's path:hurt, thenrecordDamagewithENVIRONMENT, thenonKillwith the victim as their own killer. The feed'sweaponfield is now aCause, which is aWeaponIdor"fall". I didn't add afallrow toWEAPONS, because other code iterates that list and it would stop being only things you can hold. A fall kill pays nobody.How it reads:
ENVIRONMENTis one ledger row shared by the bomb and falls. The report calls it "the bomb" in a round where the bomb went off, and "a fall" otherwise.Tests:
ENVIRONMENT, counts as the kill indamageTaken, shows as a fall in the feed and pays no money. A bot falling takes the same damage but gets nohurteffect.applyInputremoved, the three world tests where damage is expected fail.bomb.state = "detonated". The naming depends on that state now; the test wasn't wrong.bun run checkpasses: 810 tests, and the RL arena tests are untouched. Nothing on either map can show this in the preview. The quickest way to try it isbun test src/client/world.test.ts -t fall.🤖 Generated with Claude Code
Closes #190