Skip to content

Rage and the tail-cut gate as behaviour blocks - #67

Merged
sp00ktober merged 34 commits into
mainfrom
moveset/rage
Oct 13, 2026
Merged

sp00ktober merged 34 commits into
mainfrom
moveset/rage

Conversation

@sp00ktober

Copy link
Copy Markdown
Contributor

Phase 4 of the moveset editor: rage and the tail cut become building blocks. Stacked on #66.

  • Effects:
    • Enrage: sets FLAGS 0x400 unless the monster is enraged; the engine runs its own rage start on the next AI frame, roar included.
    • Calm down: sets RAGE_TIMER = 1 while enraged; the engine runs its own rage end.
    • Lua: port:enrage() and port:calm(), queued on the board and applied by the brain.
  • The tail-cut gate:
    • [parts.tail] sever_below = 50 lets the tail be cut only below 50 % HP, set from the Parts dock.
    • It wraps the species' cut gate (OBJ_VTABLE.CUT_GATE, vt+0xE0, the same gate that holds Akantor's tail until 25 %), refuses above the line, and still calls the native gate below it.
    • A refused cut puts the counter back to 1, so the tail keeps flinching and taking damage, and the first cutting hit below the line cuts.
  • Natural rage: [behaviour] natural_rage = false (a Behaviour dock checkbox) raises ANGER_THRESHOLD to 32767 once per monster, and turning it back on restores the species value.
  • Framework API 5:
    • mhfu.em_sever_gate, em_natural_rage, em_rage;
    • addresses.toml gains RAGE_START, RAGE_END, ANGER_ADD, the rage fields and CUT_GATE.
  • The Zinogre demo:
    • The 2nd flinch → charge up, then enrage as the charge ends, so the native roar follows it.
    • The tail can only be cut below 50 %.

Live, lane 3 (native Tigrex for the levers, the Zinogre for the rest):

  • Enrage and calm land within one AI frame, with the enraged and calmed events.
  • A second enrage does not restart the timer.
  • The gate refused 3 cuts at 52–97 % HP and cut on the hit that crossed 50 %, on 2 monsters.
  • Natural rage off: +2520 anger with no rage, and back on, rage again.
  • The charge plays 121 of 125 frames, then the roar.
  • A 191 s soak with no crash.

Tests: 2985 passed with game data on macOS; CI's test job passes on Linux 3.11 and 3.14 (2397 passed).

🤖 Generated with Claude Code

sp00ktober and others added 30 commits October 10, 2026 02:27
RAGE_START, RAGE_END, ANGER_ADD, ENTITY.RAGE_TIMER/ANGER/ANGER_THRESHOLD, FLAGS 0x400,
OBJ_VTABLE.CUT_GATE, and the enrage and calm effects, measured live on em75 in a lane.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ral rage

The brain writes the engine's own rage levers from its thread: enrage sets FLAGS 0x400 unless
the monster is enraged, calm leaves one frame on RAGE_TIMER while it is, and Lua's request
(mhfu_em_rage) waits on the board for the brain. mhfu_em_natural_rage raises the species' anger
threshold once per monster and restores it. mhfu_em_sever_gate wraps the species' CUT_GATE
through the wrap builder (a vtable swap, claimed with the rest): the tail cuts only below an HP
percent, and the species' own gate runs on every cut it allows. The block grows by one wrapper
(128 bytes). Lua API version 5.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…port:enrage and port:calm

_arm_native sets the tail cut's gate (sever_below) and natural rage from the moves module or the
define spec, every time it arms; the quest's end drops both. port:enrage() and port:calm() queue
the rage on the board.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
….natural_rage

The moves module gains top-level sever_below and natural_rage (left out at their defaults). The
Zinogre enrages on its charge and cuts its tail only below 50% HP.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… the Behaviour dock

A rename keeps a part severable, with its HP percent. The new tests skip
until the package has Part.sever_below and Behaviour.natural_rage.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Zinogre tests follow phase 4

The loader's refusals reach the Parts dock unchanged: the studio no longer checks a
severable part or a percent range itself.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	framework/src/core/em_vhook.cpp
#	framework/tests/test_em_brain.py
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tions, effects and holds

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…tarts

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
set_rage writes EM_BOARD.RAGE, the request Lua's mhfu.em_rage queues; the brain applies it in
the monster's next AI frame through the engine's own start or end.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
sp00ktober and others added 4 commits October 13, 2026 20:04
…lmed trigger

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ns if the monster already is

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…er leaves the window 1512 px

With Watch the game and Fire in it the Behaviour header made the window 1586 px wide.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@sp00ktober
sp00ktober changed the base branch from moveset/rules to main October 13, 2026 19:28
@sp00ktober
sp00ktober merged commit a5013d3 into main Oct 13, 2026
5 checks passed
@sp00ktober
sp00ktober deleted the moveset/rage branch October 13, 2026 19:28
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.

1 participant