A blast hurts any feature that is not indestructible - #46
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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"):0x4244B0(cell, x, z, wdef)per map square. Gates: the console-toggle word's bit 3 (the command isTreeDeath, on by default), a feature in the square, and the definition notindestructible. Nothing else.blockingandreclaimableare never read.firestarteris set alight instead of damaged, with no chance roll on the way in.wdef+0xD4, thedefaultkey) is added to what the feature has taken, with no distance falloff, and at the definition'sdamagethe feature breaks to itsfeaturedead.damageis zero: the parser passes one zeroed register as the default for the whole block (0x4226F4), anddamagelands straight infeatdef+0xEAfrom 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 (replaceFeaturenow returns the replacement's id), which is what the original's cell-by-cell walk does by construction.parseFeatureTdf:damagedefaults to 0, not 1.tryIgniteFeaturesInRadiuskeeps 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 onSl-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