Under Attack, Unit repaired, and what a unit says when it cannot comply - #37
Merged
Merged
Conversation
Three of the twenty-one unit voices never played. Where the original plays them was read out of the callers of the routine that plays a sound slot, and it turned out to have three entry points, a queue, and a table whose captions are mostly never seen. Under Attack, slot 2, has one call site: the tail of the return-fire routine, reached on every hit whatever the fire mode. It plays for damage from another side of any cause, for the unit's own side only on a weapon hit, and only for a unit that is not in the frame's draw list: it is the warning for what you cannot see. The damage event now carries the cause and the scene tests the view. Unit repaired, slot 10, plays from both ends of a repair job -- the repairer as it lands, and an aircraft on a pad as its hit points reach the maximum. A repaired event is raised at both. Cannot comply, slot 7, has forty-five sites and every one passes its own caption, so the table's "Cannot Comply" is never heard. An event carries the caption; four of the refusals RWE already makes raise it, and the notes carry the table of the other forty-one for when theirs exist. The original's voice queue holds one pending sound per slot, so a unit under sustained fire says Under Attack once per playback. RWE's single reserved voice channel drops a voice while it is busy, which comes to nearly the same thing and is left as it is. Issue: #27 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 #27. The first decode job done against the flat listing of the same binary the notes were read from (MD5 matches).
The decode (now in
docs/TOTALA-EXE.md§97, new subsection):0x47F780(unit, id, caption)has 82 direct callers. Two siblings add one gate each against the frame's draw list ("HOT UNITS", §18):0x47F7E0plays only for a unit on screen and is never called;0x47F850plays only for a unit off screen and has one caller.0x47FAD0keeps a queue of eight, one pending voice per slot id, in priority order from the table's third dword. That is the only throttle.underattack(slot 2, "Under Attack"): one site,0x4071D8, the tail of the return-fire routine, reached on every hit whatever the fire mode. Gates: last attacker's owner differs from the victim's, else the cause byte must be a weapon hit (so an own-side paralyser is silent); the victim's mission flags bit 7 clear (no setter found, treated as never set); through0x47F850, so off-screen units only.repair(slot 10): five sites, all with "Unit repaired":SELFREPAIRandVTOL_GetRepaired(the aircraft on a pad reaching full health),VTOL_RepairUnitand the ground repair body (the repairer as the job lands).cant(slot 7): 45 sites, every one passing its own caption, so "Cannot Comply" is never heard. Full table of captions and addresses in the notes.What changed.
UnitDamagedEventgainsparalyzer(the cause). The scene plays slot 2 and prints ": Under Attack" when the victim is the local player's, the attacker is another side or it was a weapon hit, and the unit fails the same view-cull test the renderer uses.UnitRepairedEvent, raised where the mending finishes indeployRepairArm(the repairer's voice) and inhandleLandOnAirBaseOrderwhen a parked aircraft reaches full health (the aircraft's). An order to repair a unit that is already whole says nothing. Slot 10 with "Unit repaired".UnitCannotComplyEvent{unit, message}, raised at the four refusals RWE already makes: the nanoframe capture ("That unit is a cloud of vapor and cannot be captured"), the Commander reclaim ("That unit cannot be reclaimed"), the taken pad ("Landing aborted: no pads available") and the vanished corpse ("Ressurection failed", the original's spelling). Slot 7 with the caption.Verified.
unitnotifications.test.cpp: the damage event carries the cause; a repairer says it exactly once and the voice is the repairer's; the nanoframe and Commander refusals raise the event with the right caption; a refusal that ends the order raises it once and ticking on is silent.rwe_test: all 557 test cases pass (71492 assertions), Linux gcc-14 Debug.🤖 Generated with Claude Code
https://claude.ai/code/session_01PJCbwC9MGZnM6erMDKptun