Expand description
Pet Facets / Team Die v0 — the die, the bookkeeping keys and the arithmetic.
The orchestration is crate::logic::pet_facets.
Per-fight facet state lives in the player entity’s attributes, the same
idiom the stones and laws runtimes use. Keys are namespaced pet.* so they
cannot collide with a stat code
(crate::mechanics::fight::get_entity_stat composes <code>,
<code>.bonus and <code>.mod) nor with stone.* / law.*.
Structs§
- Rolled
Facet - One rolled outcome: the facet the die landed on and the level of the pet it belongs to (rank scales the numbers of that facet and nothing else).
Constants§
- APPLYING
1while a facet outcome is being applied. The recursion guard of “a facet-generated repeat cannot repeat itself”.- BUDGET_
CASTS PET-02 Budget Plan: remaining original casts that pay the reduced Mana Cost, and the multiplier they pay it at (permyriad,7_500= ×0.75).- BUDGET_
MULT - DREAM_
READER PET-10 Dream Reader: share the chosen hidden Law runs at (permyriad) on the next suitable Core event, with its single charge.- DREAM_
READER_ CHARGES - FIRST_
SPELL PET-09 First Spell: strength of the one repeat of the phase’s first ordinary gear Effect (permyriad), with its single charge.- FIRST_
SPELL_ CHARGES - LAST_
ROLL - The facet the die last landed on, as
PetFacetordinal + 1 (0= the die has not been rolled this fight). Presentation and tests read it; the runtime arms the outcome directly. - LEAD_
READING_ BONUS - LEAD_
READING_ CHARGES PET-06 Lead Reading: remaining activations of the chosen source Law that bank extra Resonance, and the bonus they bank (permyriad).- LIFE_
BLOOM PET-11 Life Bloom: share of the player’s landed Core damage healed back, permyriad, for as long as the window is open.- LUCKY_
STAR PET-05 Lucky Star: derived burst owed on the next Core CRITICAL hit, permyriad of Attack, with its charge.- LUCKY_
STAR_ CHARGES - NEXT_
SKILL_ BONUS - Payload bonus armed by
Open Tabfor the cast it overpaid on, permyriad of the hit’s own damage. Spent by the pet hook on that cast’s landed Core hit. - NEXT_
SKILL_ BONUS_ CHARGES - NEXT_
SKILL_ ECHO PET-01 Second Spark: derived repeat of the next original Skill, permyriad of Attack, with its charge.- NEXT_
SKILL_ ECHO_ CHARGES - OPEN_
TAB_ CHARGES PET-02 Open Tab: armed for exactly one original cast.SURCHARGEis the share of the cost it may overpay (permyriad),PAYLOAD_SHAREhow much of that surcharge becomes payload (permyriad).- OPEN_
TAB_ PAYLOAD_ SHARE - OPEN_
TAB_ SURCHARGE - PHASE_
SCOPED_ KEYS - Every key a flip must clear, because it describes ONE phase rather than one fight. Everything else (the armed “next N casts” charges) belongs to the player and survives the flip that armed it.
- PREPARED_
SLOTS PET-09 Prepared Slots: the strength the first proc of each gear slot runs at this phase (permyriad,14_000= 140%). Per-slot spend marker below.- RETALIATION
PET-04 Retaliation: derived area burst owed on the next Core hit TAKEN, permyriad of Attack, with its charge.- RETALIATION_
CHARGES - RISING_
GATE_ MULT - RISING_
GATE_ PROCS PET-08 Rising Gate(BAL-014): remaining gear Trigger procs of this phase whose Gauge award is multiplied, and the multiplier itself (hundredths, so 200 is x2).- ROLL_
REVISION - Flip revision + 1 the die last rolled on, so one flip rolls exactly once
however many times
GlobalFlipreaches the hook. - SOUVENIR_
CHARGES PET-10 Souvenir: remaining Trigger procs that also run the paired hidden Effect, and the share they run it at (permyriad).- SOUVENIR_
SHARE - WILD_
READING_ BONUS - WILD_
READING_ UNTIL PET-06 Wild Reading: tick + 1 the chosen active Law’s Effect bonus expires at, and the bonus itself (permyriad). A tick rather than a scheduled inverse because the multiplier is read, not stored on a stat.
Functions§
- armed
- The magnitude of a
(magnitude, charges)pair, orNonewhen it is spent. - attr
- Raw attribute read; a missing key is zero.
- clear_
phase_ state - Clears every phase-scoped key. Called by the flip, before the incoming
phase’s own facet arms anything — a Real phase must not inherit the previous
Real phase’s
Prepared Slots. - eligible_
facets - The eligible face set of one side: one facet per equipped pet, in slot order.
- permyriad
- A whole-percent magnitude, rank-scaled, as permyriad (
35.0at rank 1 →3_500). - prepared_
slot_ key - Per-slot “this slot has already spent its
Prepared Slotsbonus this phase” marker. Holds flip revision + 1, so an untouched attribute reads as “not this phase” even at revision 0 — the same shapeVA-04 Opening Fiveuses. - roll_
team_ die - Rolls the Team Die: a uniform 1-of-N pick over the incoming side’s faces.
- spend_
charge - Spends one charge of a
(magnitude, charges)pair, clearing the magnitude with the last one so a stale value can never apply for free. - ticks
- A tick magnitude, rank-scaled (
Head Start’s 1.2 s is a number the rank raises, not a rule it changes).