@my-swu/simulator-client / TargetGroupPurpose
Type Alias: TargetGroupPurpose
TargetGroupPurpose = {
amount?:number|null;kind:"dealDamage"; } | {amount?:number|null;kind:"heal"; } | {amount?:number|null;kind:"giveShield"; } | {kind:"removeShield"; } | {count?:number|null;kind:"giveExperience"; } | {kind:"moveExperience"; } | {count?:number|null;kind:"giveAdvantage"; } | {count?:number|null;kind:"createToken"; } | {kind:"modifyStats"; } | {kind:"defeat"; } | {kind:"defeatUpgrade"; } | {kind:"capture"; } | {kind:"rescueCaptured"; } | {kind:"discardCaptured"; } | {kind:"playCaptured"; } | {kind:"returnToHand"; } | {kind:"returnUpgradeToHand"; } | {kind:"returnToDeck"; } | {kind:"attachUpgrade"; } | {kind:"exhaust"; } | {amount:number;kind:"payToAvoidExhaust"; } | {kind:"ready"; } | {kind:"attack"; } | {kind:"moveUnit"; } | {kind:"moveUpgrade"; } | {kind:"takeControl"; } | {kind:"reveal"; } | {kind:"drawCards"; } | {kind:"discard"; } | {kind:"choosePlayer"; } | {kind:"chooseBase"; } | {kind:"grantKeyword"; } | {kind:"removeAbility"; } | {kind:"restrict"; } | {kind:"grantBounty"; } | {kind:"grantTrigger"; } | {kind:"preventDamage"; } | {kind:"redirectDamage"; } | {kind:"rememberTarget"; } | {kind:"chooseTarget"; } | {kind:"copyUnit"; } | {kind:"distribute"; } | {kind:"other"; }
Defined in: packages/ts-sdk/src/generated/types/common.ts:5987
Structural, localization-friendly description of what a target-selection group is for.
The engine builds target groups positionally from typed effect variants. The purpose carries the rules-meaning of each group so a UI can render a localized per-clause label (e.g. "Choose a unit to deal 2 damage to") without regex-parsing printed card text.
One variant exists for each meaningful targeting action a triggered effect can request. Useful structural parameters are carried where they are known at group-construction time (e.g. the fixed damage amount). Dynamic amounts (e.g. "damage equal to this unit's power") carry None. [Self::Other] is reserved for genuinely unclassifiable targeting and is intentionally rare.
Example:
import type { TargetGroupPurpose } from '@my-swu/simulator-client'
const targetGroupPurpose: TargetGroupPurpose = {
"kind": "dealDamage",
}
console.log(targetGroupPurpose)