Skip to content

A blast hurts any feature that is not indestructible - #46

Merged
CubeB merged 1 commit into
revivalfrom
45-scenery-blast-gate
Sep 11, 2026
Merged

CubeB merged 1 commit into
revivalfrom
45-scenery-blast-gate

Conversation

@HectorBailey

Copy link
Copy Markdown
Collaborator

Closes #45. Both facts the issue asked for, read out of the listing, plus two more the same routine settles.

The decode (docs/TOTALA-EXE.md §24, new subsection "What a blast does to a feature"):

  • The area walkers call 0x4244B0(cell, x, z, wdef) per map square. Gates: the console-toggle word's bit 3 (the command is TreeDeath, on by default), a feature in the square, and the definition not indestructible. Nothing else. blocking and reclaimable are never read.
  • A flammable feature hit by a weapon with non-zero firestarter is set alight instead of damaged, with no chance roll on the way in.
  • Otherwise the weapon's default damage (wdef+0xD4, the default key) is added to what the feature has taken, with no distance falloff, and at the definition's damage the feature breaks to its featuredead.
  • The default for a missing damage is zero: the parser passes one zeroed register as the default for the whole block (0x4226F4), and damage lands straight in featdef+0xEA from it.

What changed.

  • doProjectileImpact: the gate is !indestructible; the damage is the unscaled default; the feature breaks when damage reaches what it has left; a feature stood up by the blast in progress is skipped by the same blast (replaceFeature now returns the replacement's id), which is what the original's cell-by-cell walk does by construction.
  • parseFeatureTdf: damage defaults to 0, not 1.
  • Not changed: ignition. RWE's tryIgniteFeaturesInRadius keeps its chance roll; the decoded "ignite instead of damage" branch is written up for its own pass.

Verified, with the shipped data's shapes.

  • wreckage.test.cpp: a scar decal modelled on Sl-RockScar (damage 20000, neither blocking nor reclaimable) loses the shell's damage; a decal with no damage key goes on the first hit; the whole default damage lands off-centre; indestructible still shrugs it off; the existing rock-to-rubble cases still pass, including the rubble surviving the shell that made it.
  • io.test.cpp: the reader's default is 0.
  • rwe_test: all 572 test cases pass (71601 assertions), Linux gcc-14 Debug.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PJCbwC9MGZnM6erMDKptun

The original's blast-on-feature routine (0x4244B0) asks one thing of the
feature: that it is not indestructible. Blocking, reclaimable and the
rest never enter into it, so a scar decal or a bush takes a hit like a
wreck does. RWE's gate had asked for blocking or reclaimable as well,
which came from the wreckage pass and kept 523 shipped features immune.

Three more things the routine settles. The damage added is the weapon's
default damage, unscaled by distance; the feature breaks to its
featuredead the moment what it has taken reaches the definition's
damage; and the feature parser defaults a missing damage key to zero,
so a feature that names none goes on the first hit. RWE's reader had
defaulted it to 1.

One consequence of the walk is kept the original's way: a feature stood
up by the blast in progress lands on the cell just walked and is not
met again by it, so a heap that names no damage does not go in the
same shell that made it.

The fire branch, where a firestarter weapon sets a flammable feature
alight instead of damaging it, is written up and left for its own
pass. The console command that switches all of this off turns out to
be TreeDeath.

Issue: #45

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PJCbwC9MGZnM6erMDKptun
@CubeB
CubeB merged commit d768792 into revival Sep 11, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scenery that is neither blocking nor reclaimable takes no blast damage

2 participants