Skip to content

Commit e1bca8b

Browse files
Added two new articles to wiki
1 parent 7ca8fcb commit e1bca8b

File tree

5 files changed

+167
-15
lines changed

5 files changed

+167
-15
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
- Fixed error when trying to create cards that evolve/transform in 4 or more turns
33
- Fixed Fledgling and Transformer sigil appearing as black boxes when a card evolves/transform in 4 or more turns
44
- Fixed Part2VanillaCardCost event not being invoked
5-
- Evolve and Transformer icons now show support cards that evolve in 4 or more turns
65
- Added 'UpdatePlayableCardCosts' event to community patch's Part1CardCostRender and Part2CardCostRender classes
76
- Added extension methods for PlayableCard and CardInfo: ProvidesBlueGem, ProvidesGreenGem, ProvidesOrangeGem
7+
- Evolve and Transformer icons now support cards that evolve in 4 or more turns
8+
- Wiki: added articles 'Other Features' and 'Triggers and the Order of Operations'
9+
- Wiki: modified starting section of 'Custom Triggers' article
10+
- Documentation: fixed description for IPostCardGettingAttacked stating it triggers before CardGettingAttacked
811

912
# 2.23.1
1013
- Fixed non-CardModificationInfo shields not breaking

docs/wiki/other_features.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## Other Features
2+
Listed here are various miscellaneous features that the API adds that aren't covered in other articles, or aren't covered in much detail.
3+
4+
## Negative and Self-Damage
5+
With the API, it is now possible to make cards deal damage to their owner.
6+
This is done by reducing the value of CombatPhaseManager.DamageDealtThisPhase so it becomes negative.
7+
8+
## Vanilla Shield Stacking
9+
With the introduction of the ShieldManager, the Nano Armour (Armoured) sigil can now stack, providing multiple shields.
10+
11+
To minimise inteference with the vanilla game, some interactions have been altered as well;
12+
certain vanilla items and sigils that reset shields will now add an additional shield instead, provided a given card doesn't already have a shield.

docs/wiki/toc.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@ items:
1515
- name: Abilities
1616
href: ability_management.md
1717
items:
18-
- name: Triggers and Interfaces
18+
- name: Custom Triggers
1919
href: triggers.md
20-
- name: Slot Modification
21-
href: slots.md
22-
- name: DamageShieldBehaviour
23-
href: shield.md
2420
- name: Custom Sniper Logic
2521
href: sniper.md
22+
- name: DamageShieldBehaviour
23+
href: shield.md
24+
- name: Slot Modifications
25+
href: slots.md
26+
- name: Trigger Order
27+
href: triggers_priority.md
2628
- name: Custom Properties
2729
href: custom_properties.md
2830
- name: Ascension (Kaycee's Mod)
@@ -47,4 +49,6 @@ items:
4749
- name: Sound
4850
href: sound.md
4951
- name: Localisation
50-
href: localisation.md
52+
href: localisation.md
53+
- name: Other Features
54+
href: other_features.md

docs/wiki/triggers.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
## Triggers and Interfaces
1+
## Custom Triggers
22
---
3-
The API adds a number of interfaces you can use to add additional functionality to your ability.
4-
It also adds a new class: `ExtendedAbilityBehaviour`, which has all the interfaces already implemented for immediate use, saving you time.
3+
To give modders finer control over when abilities activate, the API adds a large number of custom triggers that you can add to your abilities or other trigger receivers via interfaces.
54

6-
### Passive Attack and Health Buffs
7-
To do this, you need to override GetPassiveAttackBuff(PlayableCard target) or GetPassiveAttackBuff(PlayableCard target) to calculate the appropriate buffs.
8-
These return an int representing the buff to give to 'target'.
5+
It also adds a new class: `ExtendedAbilityBehaviour`, which has several of these interfaces already implemented.
96

10-
In battle, the game will iterate across all cards on the board and check whether they should receive the buffs; this is what 'target' refers to; the current card being checked.
11-
You will need to write the logic for determining what cards should get the buff, as well as what buff they should receive.
7+
For comprehensive information on all custom triggers added by the API, refer to the documentation. If you want to understand the order all these triggers are called, look at the article
8+
9+
### Passive Stat Buffs
10+
Stat icons are a unique type of ability that modify a card's attack or health. Ants are the quintessential example of stat icons in use, and with the API you can add your very own.
11+
12+
To do this, implement the IPassiveAttackBuff or IPassiveHealthBuff and implement the required methods. `GetPassiveAttackBuff(PlayableCard target)` or `GetPassiveAttackBuff(PlayableCard target)` are the methods you will use to calculate attack and health buffs respectively.
13+
14+
In battle, the game will iterate across all cards on the board and check whether they should receive the buffs; this is what `target` refers to: the current card being checked, and NOT just the card with the custom sigil.
15+
16+
You will need to write the logic for determining what cards should get the buff, as well as what buff they should receive. For example, if you want the buff to only be given to the card with the custom sigil, you will need to check that `target` equals the base card.
1217

1318
Note: you need to be very careful about how complicated the logic is in GetPassiveAttackBuffs and GetPassiveHealthBuffs.
1419
These methods will be called *every frame* for *every instance of the ability!!*

docs/wiki/triggers_priority.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
## Triggers and Order of Operations
2+
This article is for modders looking for specific information on the order triggers are called in various contexts.
3+
The information presented here is fairly technical and dry, and assumes you have an understanding of how Inscryption's code works.
4+
5+
Triggers are listed in the order they are called, with the first entry being the first trigger called and the last entry being the last trigger called.
6+
7+
Custom triggers start with the letter 'I' and are implemented via interfaces, and the rest are vanilla triggers.
8+
9+
## Card Damage
10+
Handled by `PlayableCard.TakeDamage`, `ShieldManager.TriggerBreakShield`, and `ShieldManager.BreakShield`.
11+
12+
Cards with shields only call the first four triggers listed.
13+
14+
|Trigger|Additional information|
15+
|:-|:-|
16+
|IModifyDamageTaken|Sets the damage amount to the returned value|
17+
|IPreTakeDamage|Called before shields are checked|
18+
|IShieldPreventedDamage|Only called when a card has a shield|
19+
|IShieldPreventedDamageInHand|Only called when a card has a shield <br><br> Called on cards in the player's hand|
20+
|OnTakeDamage|Called for cards without shields|
21+
|OtherCardDealtDamage|Called after `PlayableCard.Die`|
22+
|IOnOtherCardDealtDamageInHand|Called on card's in the player's hand|
23+
24+
## Card Death
25+
Handled by `PlayableCard.Die`.
26+
27+
|Trigger|Additional information|
28+
|:-|:-|
29+
|OnPreDeathAnimation||
30+
|OnOtherCardPreDeath||
31+
|IOnOtherCardPreDeathInHand|Called on cards in the player's hand|
32+
|OnOtherCardDie||
33+
|IOnOtherCardDieInHand|Called on cards in the player's hand|
34+
35+
## Card Drawing
36+
Handled by `PlayerHand.AddCardToHand`.
37+
38+
|Trigger|Additional information|
39+
|:-|:-|
40+
|OnDrawn|Called before a card is added to `cardsInHand`|
41+
|OnOtherCardDrawn|Called before a card is added to `cardsInHand`|
42+
|IOnAddedToHand|Called after a card is added to `cardsInHand`|
43+
|IOtherCardAddedToHand|Called after a card is added to `cardsInHand`|
44+
45+
## Card Playing
46+
Handled by `BoardManager.TransitionAndResolveCreatedCard`, `BoardManager.ResolveCardOnBoard`, and `BoardManager.AssignCardToSlot`.
47+
48+
|Trigger|Additional information|
49+
|:-|:-|
50+
|OnOtherCardAssignedToSlot||
51+
|IOnCardAssignedToSlotContext|Provides information on new and old slot|
52+
|IOnOtherCardAssignedToSlotInHand|Called on cards in the player's hand|
53+
|IOnCardAssignedToSlotNoResolve|Only called if assigned card was already resolved|
54+
|OnResolveOnBoard|Called when a card is played from the hand or queue|
55+
|OnOtherCardResolve|Called when a card is played from the hand or queue|
56+
|IOnOtherCardResolveInHand|Called on cards in the player's hand <br><br> Called when a card is played from the hand or queue|
57+
58+
## Combat Phase
59+
Handled by `CombatPhaseManager.DoCombatPhase`, `CombatPhaseManager.SlotAttackSequence`, and `CombatPhaseManager.SlotAttackSlot`.
60+
61+
`SlotAttackSequence` is called for every attacking card, then `SlotAttackSlot` is called for every time a card attacks.
62+
63+
|Trigger|Additional information|
64+
|:-|:-|
65+
|IOnBellRun|Called before `DoCombatPhase`|
66+
|IOnPreSlotAttackSequence|Called before `SlotAttackSequence`|
67+
|IGetAttackingSlots|Adds return value to current list of attacking slots, can modify current list within the method|
68+
|ISetupAttackSequence|Replaces current list of targeted slots with return value<br><br>Called with priority `ReplacesDefaultOpposingSlot`|
69+
|IGetOpposingSlots|Adds return value to current list of targeted slots, can modify current list within the method|
70+
|ISetupAttackSequence|Replaces current list of targeted slots with return value<br><br>Called with priority `Normal`|
71+
|ISetupAttackSequence|Replaces current list of targeted slots with return value<br><br>Called with priority `BringsBackOpposingSlot`|
72+
|ISetupAttackSequence|Replaces current list of targeted slots with return value<br><br>Called with priority `PostAdditionModification`|
73+
|OnSlotTargetedForAttack||
74+
|IModifyDirectDamage|Called only if direct damage is being dealt<br><br>Sets the damage being dealt to the returned value|
75+
|OnDealDamageDirectly||
76+
|IOnCardDealtDamageDirectly|Called for every card on the board|
77+
|OnCardGettingAttacked|Called only if a card is being attacked|
78+
|IPostCardGettingAttacked||
79+
|IOnPostSingularSlotAttackSlot|Called after `SlotAttackSlot`|
80+
|OnAttackEnded|Called after all cards have finished attacking|
81+
|IOnPostSlotAttackSequence|Called after `SlotAttackSequence`|
82+
83+
## Consumable Items
84+
Handled by `ConsumableItemSlot.ConsumeItem` and each ConsumableItem's `ActivateSequence`.
85+
86+
|Trigger|Additional information|
87+
|:-|:-|
88+
|IItemCanBeUsed|Can stop items from being used|
89+
|IOnItemPreventedFromUse|Called if `IItemCanBeUsed` stopped an item from being used|
90+
|IOnPreItemUsed|Called before `ConsumeItem` and `ActivateSequence`|
91+
|IOnPostItemUsed|Called after `ConsumeItem` and `ActivateSequence`|
92+
93+
## Passive Stat Buffs
94+
Handled by `PlayableCard.GetPassiveAttackBuffs` and `PlayableCard.GetPassiveHealthBuffs`.
95+
96+
These patches are called every frame.
97+
98+
|Trigger|Additional information|
99+
|:-|:-|
100+
|IOnCardPassiveAttackBuffs|Sets attack buff to returned value|
101+
|IPassiveAttackBuffs|Adds to attack buff with returned value|
102+
103+
|Trigger|Additional information|
104+
|:-|:-|
105+
|IOnCardPassiveHealthBuffs|Sets health buff to returned value|
106+
|IPassiveHealthBuffs|Adds to health buff with returned value|
107+
108+
## Scale Damage
109+
Handled by `LifeManager.ShowDamageSequence`.
110+
111+
|Trigger|Additional information|
112+
|:-|:-|
113+
|IOnPreScalesChangedRef|Modifies the damage being dealt and weights being added to the physical scale|
114+
|IOnPreScalesChanged|Called before `ShowDamageSequence`|
115+
|IOnPostScalesChanged|Called after `ShowDamageSequence`|
116+
117+
## Turn Sequence
118+
Handled by `TurnManager.GameSequence`, `TurnManager.PlayerTurn`, `TurnManager.OpponentTurn`, `TurnManager.DoUpkeepPhase`.
119+
120+
Triggers for the opponent's turn are not called if their turn is skipped.
121+
122+
|Trigger|Additional information|
123+
|:-|:-|
124+
|OnUpkeep||
125+
|IOnUpkeepInHand|Called on cards in the player's hand|
126+
|OnTurnEnd|Called after `DoCombatPhase`|
127+
|IOnTurnEndInQueue|Called on cards in the opponent's queue|
128+
|IOnTurnEndInHand|Called on cards in the player's hand|

0 commit comments

Comments
 (0)