Skip to content

@my-swu/simulator-client


@my-swu/simulator-client / AbilityWindow

Type Alias: AbilityWindow ​

AbilityWindow = "AfterPlayOrDeploy" | "WhenActionPhaseStarts" | "WhenFirstActionPhaseStarts" | "WhenYouDrawCardsDuringActionPhase" | "WhenAnOpponentDrawsCardsDuringActionPhase" | "WhenAPlayerDrawsCardsDuringActionPhase" | "WhenYouTakeInitiative" | "WhenYouDeployLeader" | "WhenEntersPlay" | "OnAttack" | "OnDefense" | "WhenFriendlyUnitAttacks" | "WhenThisUnitIsAttacked" | "WhenThisUnitReadies" | "WhenDamageIsDealtToThisUnit" | "WhenCombatDamageIsDealtToThisUnit" | "WhenThisUnitIsHealed" | "WhenDamageIsDealtToYourBase" | "WhenFriendlyUnitDealsDamageToEnemyUnit" | "WhenEnemyUnitAttacks" | "WhenEnemyUnitAttacksYourBase" | "WhenPilotAttachesToThisUnit" | "WhenFriendlyUnitIsDefeated" | "WhenThisUnitDealsCombatDamageToBase" | "WhenThisUnitDealsCombatDamageToUnit" | "WhenFriendlyUnitDealsCombatDamageToBase" | "WhenEnemyUnitDealsCombatDamageToYourBase" | "WhenAttackEnds" | "WhenFriendlyUnitAttackEnds" | "WhenCaptured" | "WhenDefeated" | "WhenEnemyUnitDefeated" | "WhenIndirectDamageDealtToUnit" | "WhenYouDealNonCombatDamage" | "WhenRevealOrDiscardFromHand" | "WhenAPlayerDiscardsFromHand" | "WhenOpponentPlaysCard" | "WhenOpponentPlaysEvent" | "WhenOpponentPlaysSecondCardEachPhase" | "WhenYouUseTheForce" | "WhenRegroupPhaseStarts" | "WhenFriendlyForceUnitAttacks" | "AtStartOfTurn" | "AtEndOfTurn" | "WhenYouDrawCards" | "WhenEnemyLeaderDeploys" | "WhenFriendlyUnitAttacksMoreExpensiveUnit" | "WhenEnemyUnitReadiesDuringActionPhase" | "WhenDamageIsDealtToThisUnitAndSurvives" | { WhenFriendlyUnitDealtDamage: unknown; } | "WhenFriendlyUnitDealtDamageAndSurvives" | { WhenFriendlyUnitDealtCombatDamageAndSurvives: unknown; } | "WhenEnemyGroundUnitAttacksYourBase" | { WhenAnotherFriendlyTraitUnitAttacks: string; } | "WhenUpgradeAttachesToThisUnit" | "WhenAnotherFriendlyUnitIsDefeated" | "WhenFriendlyUpgradeIsDefeated" | { WhenYouUseTriggeredAbility: AbilityWindow; } | "WhenYouDealDamageToEnemyBase" | { WhenFriendlyTraitUnitAttackEnds: string; } | "WhenThisUnitWouldBeCaptured" | { WhenUnitDefeated: unknown; } | { WhenUnitLeavesPlay: RelationFilter; } | { WhenYouDealDamageAtLeast: number; } | "WhenNonCombatDamageDealtToFriendlyUnitOrBase" | "WhenYouReadyCardsDuringRegroup" | "WhenFriendlyUnitAttacksAndDefeats" | "WhenFriendlyUnitDefeatedWhileAttacking" | "WhenYouPlayEvent" | "WhenYouPlayAUnit" | "WhenYouPlayOrCreateAUnit" | "WhenFriendlyUnitEntersPlay" | "WhenAnyUnitEntersPlay" | "WhenYouPlayAnotherUnit" | "WhenYouPlayAnUpgrade" | "WhenYouCollectABounty" | "WhenYouDiscardFromDeck"

Defined in: packages/ts-sdk/src/generated/types/common.ts:92

Trigger window for a parsed ability. Identifies WHEN the ability fires; the WHAT is carried by TriggeredEffect.

This type is on the public SDK schema — it reaches GameState through PendingAbilityView.window and GameEvent — but only ever server to client: no GameCommand carries one, so a consumer reads it and never constructs it. The two variants that carry a [crate::effect::UnitFilter] are therefore exported opaquely, the way MatchSavePayload::state is: the variant discriminant stays on the wire so a UI can still switch on the window, while the engine filter behind it does not pin ~60 internal fields and their whole reference closure into the SDK type surface.

Example:

ts
import type { AbilityWindow } from '@my-swu/simulator-client'

const abilityWindow: AbilityWindow = "AfterPlayOrDeploy"

console.log(abilityWindow)

Released under the MIT License.