Skip to content

ChainLink

Represents a particular link of the combat chain.

Note

The following table describes the combat order and "owner" of each of the attributes of this object. Each of these attributes may correspond to a particular "step" in the link. See Chapter 7 of the Comprehensive Rules document for more information about these steps.

Order Attribute Owner Allowed Card Types Associated Step
0 pre_attack Both Action (for attacker), Instant Layer
1 attack Attacker Attack, Weapon Attack
3 pre_defenses Both Instant Attack/Defend
4 defenses Defender (cards with defense) Defend
6 pre_attack_reaction Both Instant Reaction
7 attack_reaction Attacker Attack Reaction Reaction
9 pre_defense_reaction Both Instant Reaction
10 defense_reaction Defender Defense Reaction Reaction
11 post_defense_reaction Both Instant Reaction

Those attributes owned by both players take the form of an optional list of tuples, where the first element of each tuple is a str representing the owner of the card in the second element, being either attacker or defender.

Attributes:

Name Type Description
attack Optional[Card]

The attack action card played in this the link.

attack_reactions Optional[Card]

Any attack reaction cards played in this link.

defense_reactions Optional[Card]

Any defense reaction cards played in this link.

defenses Optional[CardList]

Any defending cards played in this link.

post_defense_reaction Optional[list[tuple[str, Card]]]

Any cards played after the defense reaction phase.

pre_attack Optional[list[tuple[str, Card]]]

Any cards played prior to the attacker playing an Attack or Weapon card.

pre_attack_reaction Optional[list[tuple[str, Card]]]

Any cards played by after the defending phase and prior to the attack reaction phase.

pre_defense_reaction Optional[list[tuple[str, Card]]]

Any cards played after the attack reaction phase and prior to the defense reaction phase.

pre_defenses Optional[list[tuple[str, Card]]]

Any cards played after the attack phase and prior to the defending phase.

Source code in fab/chain.py
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
@dataclasses.dataclass
class ChainLink:
    '''
    Represents a particular link of the combat chain.

    Note:
      The following table describes the combat order and "owner" of each of the
      attributes of this object. Each of these attributes may correspond to a
      particular "step" in the link. See Chapter 7 of the _Comprehensive Rules_
      document for more information about these steps.

      | Order | Attribute               | Owner    | Allowed Card Types                  | Associated Step |
      |-------|-------------------------|----------|-------------------------------------|-----------------|
      | 0     | `pre_attack`            | Both     | _Action_ (for attacker), _Instant_  | Layer           |
      | 1     | `attack`                | Attacker | _Attack_, _Weapon_                  | Attack          |
      | 3     | `pre_defenses`          | Both     | _Instant_                           | Attack/Defend   |
      | 4     | `defenses`              | Defender | (cards with defense)                | Defend          |
      | 6     | `pre_attack_reaction`   | Both     | _Instant_                           | Reaction        |
      | 7     | `attack_reaction`       | Attacker | _Attack Reaction_                   | Reaction        |
      | 9     | `pre_defense_reaction`  | Both     | _Instant_                           | Reaction        |
      | 10    | `defense_reaction`      | Defender | _Defense Reaction_                  | Reaction        |
      | 11    | `post_defense_reaction` | Both     | _Instant_                           | Reaction        |

      Those attributes owned by both players take the form of an optional `list`
      of `tuple`s, where the first element of each `tuple` is a `str`
      representing the owner of the card in the second element, being either
      `attacker` or `defender`.

    Attributes:
      attack: The attack action card played in this the link.
      attack_reactions: Any attack reaction cards played in this link.
      defense_reactions: Any defense reaction cards played in this link.
      defenses: Any defending cards played in this link.
      post_defense_reaction: Any cards played after the defense reaction phase.
      pre_attack: Any cards played prior to the attacker playing an _Attack_ or _Weapon_ card.
      pre_attack_reaction: Any cards played by after the defending phase and prior to the attack reaction phase.
      pre_defense_reaction: Any cards played after the attack reaction phase and prior to the defense reaction phase.
      pre_defenses: Any cards played after the attack phase and prior to the defending phase.
    '''
    attack: Optional[Card] = None
    attack_reaction: Optional[Card] = None
    defense_reaction: Optional[Card] = None
    defenses: Optional[CardList] = None
    post_defense_reaction: Optional[list[tuple[str, Card]]] = None
    pre_attack: Optional[list[tuple[str, Card]]] = None
    pre_attack_reaction: Optional[list[tuple[str, Card]]] = None
    pre_defense_reaction: Optional[list[tuple[str, Card]]] = None
    pre_defenses: Optional[list[tuple[str, Card]]] = None