yasuki_core.engine.rules.triggers#

Classes

AdjustCounter(card_id, counter, delta)

Effect: add delta to a counter on a card (floored at zero by the card).

BanishTopFate(seat)

Effect: banish the top card of seat's Fate deck; a no-op if the deck is empty.

Bow(card_id)

Effect: bow a card.

Choose(seat, candidates, minimum, maximum, ...)

Effect: pause the cascade so seat picks between minimum and maximum of candidates; the chosen ids feed the registered resolver, whose effects apply on resume.

Destroy(card_id)

Effect: destroy a card, sending it to its owner's discard by side.

DrawCard(seat)

Effect: seat draws a card from its fate deck.

GainGold(seat, amount)

Effect: add amount gold to seat's pool — gold produced outside a payment (a card that produces gold on entry), transient and cleared at the end of the phase.

GrantModifier(source_id, target_id, stat, ...)

Effect: record a continuous stat modifier — the source card grants target a change of amount to stat for duration.

IgnoreHonorRequirements(seat)

Effect: grant seat the standing waiver of every Personality's Honor Requirement when recruiting.

Straighten(card_id)

Effect: straighten (unbow) a card.

TriggerContext(game, card, event)

What a trigger reads: the live game, the card whose trigger is firing, and the event.

Functions

apply_effect(game, effect)

Commit one effect and return the events it raises, for the fixpoint walk to drain.

at_cap(card, counter, cap)

Whether card already holds cap or more of counter — a shared trigger guard.

caused_by(ctx, seat)

Whether seat's own action caused the event — the "if the action was yours" guard.

choice_resolver(key)

Register the decorated function as the choice resolver named key.

fire(game, event)

Resolve event and the cascade it triggers, running the worklist to a fixpoint.

on(event_type, printed_id)

Register the decorated function as printed_id's trigger for event_type.

once_per_turn(game, card, tag)

Claim a once-per-turn use for card's tag: True the first time this turn, then False.

province_holdings(game, seat)

The seat's face-up Holdings still in a Province — the recruitable targets of a targeted recruit ability.

resolve_effects(game, effects)

Apply effects — an ability's or a choice resolver's output — and run the derived-event cascade the same way fire() does, so a triggered reaction to those effects still resolves.

resume_cascade(game, item, produced)

Continue a cascade a choice paused, with produced — the effects the answered choice produced — spliced in where the Choose stood, ahead of the effects, triggers, and events the pause stashed.

sincerity_seed_targets(game, seat)

The seat's face-up Sincerity cards still in a Province with no Sincerity tokens — the legal recipients of a seeded Sincerity token.