Entry 540
Bosses as defs, step two: one runner over a def's steps, the systems as objects, Skeith made of them
28mbattle
Files9 in 6 directories
Mentioned inplans/rust-cleanup.md:427
Section 2's "Bosses as defs and systems" (plans/rust-cleanup.md), its
second step: the runner and the shared systems, with Skeith, the
simplest class, made of them so nothing lands unused.
The runner
piney_battle::boss::systems. A def names its systems
(BossDef::systems, each a Kind) and four step lists in the game's
order: order (its Main), affect (its Affect), pass (the effect
manager's pass before the blur and the task) and hand_over (the task's
step after Main). A Step is one of ccBoss::Main's blocks on the
shared ccBoss members (TickEffects, Prologue, TickStop,
LockParty, Move, ForwardAndDraw, ClearHold, BaseAffect),
Live(steps) for what ccBoss::Main's early return guards (checked once,
as the game does), or Run(kind, hook), a system's own step (Think,
Action, PreDraw, Late, Affect, Pass, HandOver). Boss::main,
affect, effects_pass and hand_over each walk one list; Boss::show
is the draw pass: ccBoss::Draw's body (BossBase::body_draw), then
each system's draw into the Output in the def's order, then the parts'.
- A system is an object:
Systemis one enum over the systems' types (boxed, onematcha call, generated with theKindenum bysystems!), each type aBossSystemimpl with its steps, its draw and its hand-over.Systems::of(kinds)builds them as their class's constructor starts them (each type'sDefault). - Siblings: a system steps with
&mut BossBase,&mut Others(the list without itself) and theCx; a boss's module reaches a sibling by its kind through a private accessor (skeith::wave). Tests and probes read a system by kind (Systems::get::<T>()); the field never does, it reads theOutputand theOuts. ccBoss::Main's blocks moved tosystems::frame, the pattern runner (Patterns,BaseActs,base_exec_pattern_index,base_change_next_pattern) tosystems::patterns.class.rskeeps only what the classes not yet converted run:BASE_BOSS'sStep::Class(hook)hands theirMain,Affect, pass and hand-over toClass::with_rulesuntil each lands, and theirshowdraws over the base's body.- The wave (
m_anmw, a member of each class that has one, not ofccBoss: Infection's DWARF puts it atccBoss01+0x29358) is a shared system,systems::wave::Wave: its clip, drawn as its pose.
Skeith
SKEITH's systems are his wave and his own (skeith::Skeith: his
spell's force and ice effects, his death's effect and fades, the stage
effect, m_patMode, m_actDirc, started as ccBoss01::ccBoss01 does).
His frame:
order: TickEffects, Live[Prologue, TickStop, Skeith.Think, Skeith.Action,
LockParty, Move, Skeith.PreDraw, ForwardAndDraw], ClearHold, Skeith.Late
affect: Skeith.Affect
draw: ccBoss::Draw's body, Wave (its pose), Skeith (the cross's trail)
PreDraw is ccBoss01::PreDrawAnm's wave speed, Late DrawCross's
first step and the PP count. His tables are views of tables::combat's
(skeith::words, anims, alike on every volume), so BossData and
Class lose his field and variant.
Checks
- The pins: 290 recorded
battle_probecalls replayed against the new release probe, none differ. - Against the game: the eleven
test_battle_*_rson their volumes,test_boss_effect_rson all four,test_bosscam_rson Infection, Mutation and Quarantine. - The golden boss shots: every PNG byte for byte as at worklog 537.
- piney-battle's, piney-world's, piney-effect's, piney-data's and
piney-event's tests, piney-game's suite (release);
too_many_arguments150 as before. piney-gen gen --check, clippy with all features, fmt,cairns check,tools/docs.py check.
nothing this step opened; the item goes on with each boss's own systems (Fidchell next), then Class, each_class!, BossData and the Innis slave's base_main out.