====== Card Actions ======
Card Actions are effects that can happen at the start of a battle, at the start of a turn, or when you play a Card or use an Item. These effects can be used in sequence to create more versatile effects.
In place of a number in all Card Actions, you can also use \V[x] to use a Game Variable, just like with message boxes.
Example:
Draw \v[4]
Will draw 3 cards if Game Variable 4 is set to 3, 1 card if Game Variable 4 is set to 1, and so on.
===== Skills/Items =====
**Card Actions** can be added to a Skill or Item by using the following notetag format:
Action
Action
Action
The actions will execute in the order they are listed for the User of the Card.
**Card Target Actions** execute actions for the Target of the skill/item using the following notetag format:
Action
Action
Action
These can be used for example to have an ally draw cards as part of a Card effect.
**Note**: Since Enemies do not have Cards or Decks (as of [[plugin-core|MYTH_CGC_CoreEngine]] v1.6.0), they can't process Card Target Actions. This feature is currently limited to an Actor and their allied Party members.
===== Battle Start/Turn Start =====
{{https://img.itch.zone/aW1nLzE1NDk2OTI4LnBuZw==/original/tRkguc.png?nolink}}
Using the **Battle Start Actions** parameter, Card Actions can be executed at the start of a battle. Simply input each command on a new line like so:
Shuffle Deck
Draw 5
This example will shuffle the deck at the start of the battle and draw 5 cards to the player.
**Turn Start Actions** works the same way, except that these Card Actions are executed at the beginning of every turn except for the first turn:
Discard Until 0
Draw 5
This example will cause the player to discard their entire hand and draw 5 new cards.
The Battle Start Actions will execute on turn 0, and the Turn Start Actions will execute at the start of every turn after that.
===== Card Actions on Empty =====
Each Zone has a parameter called Card Actions on Empty which is a list of Card Actions that execute automatically when that zone is made empty.
The default Card Actions on Empty for the Discard zone are as follows:
Move all from discard to deck
shuffle deck
No other zones have default Card Actions on Empty.
These Card Actions are added to the beginning of the current list of Card Actions, effectively interrupting them so that the effect of the zone can be resolved first. For instance, if you play a card with the Draw 4 Card Action while there were 3 cards in the Deck, the game would draw the 3 remaining cards, execute the Deck's Card Actions on Empty, and then attempt to draw 1.
===== List of All Card Actions =====
Below is a list of every Card Action sorted by which plugin provides it.
==== Core Engine ====
The list of Actions available in the [[plugin-core|Core Plugin]] are as follows:
| Draw X
| Where X is a number, target draws that many cards from Hand. |
| Draw Until X
| Where X is a number, draw until your Hand size reaches that number. |
| Discard X
| Where X is a number, discard that many cards |
| Discard Until X
| Where X is a number, discard until your hand size reaches that number. |
| Remove X
| Where X is a number, remove that many cards from play. These cards are only removed for the current battle. |
| Remove Until X
| Where X is a number, remove until your hand size reaches that number. |
| Add [skillID] to [zoneName]
| Adds a card directly to a zone. For example, ""Add 7 to hand"" will create a card of Skill ID 7 in your Hand. |
| Mill X
| Moves X cards from the deck directly to the discard |
| Move X from [zoneName] to [zoneName]
| A generic form of Draw/Discard/Mill where you can specify any zone. For example "Move 3 from Discard to Hand" will return 3 cards to the hand. |
| Search For X
| Where X is either a Skill ID or the name of a Skill/Card, it will find that card in your deck and draw it if it is present. |
| Wait X
| Where X is the amount of frames to wait before executing the next Card Action or moving on. This basically adds buffer time between actions. Note that this Action does not execute during Battle Start Actions or Turn Start Actions. |
| Shuffle Deck
| Shuffles the target's deck |
| Eval [expression]
| Everything after the word “eval” is executed as code.\\ \\ eval $gameVariables.setValue(4, user.handSize);
This gets the user of the card’s handSize variable and stores it in Game Variable 4. |
| if [expression]
| This will evaluate the expression, and if it's true, it will execute the next Card Action. If false, it will skip that action. The expression is code just like the Eval Card Action. |
| label [labelName]
| This will define a label, which is important for the jump to Action. |
| jump to [labelName]
| This will search for the label with the same name, and move to that label. If the label is after this Card Action, it will skip all Card Actions between the two. If the label is before this Card Action, it will execute the Card Actions between the two a second time. |
Example of how these Card Actions can be used:
label start
if (user.handSize >= 10)
jump to end
draw 1
wait 5
jump to start
label end
These card actions will draw 1 card, wait 5 frames, and then repeat until the player has 10 cards in their hand.
==== Card Types ====
If you’re using [[plugin-card-types|Card Types]] plugin, you also have access to these Card Actions:
| Draw X Type Y
| Where X is a number and Y is the name of a Card Type, the game will search the player’s deck for cards of type Y and draw the first X amount of them. |
| Discard X Type Y
| Where X is a number and Y is the name of a Card Type, the game will search the player's deck for cards of type Y and discard the first X amount of them. |
| Remove X Type Y
| Where X is a number and Y is the name of a Card Type, the game will search the player's deck for cards of type Y and remove the first X amount of them. |
| Mill Until Type X
| Where X is the name of a Card Type, the game will discard the top card of the player’s deck until a card of card type Y is on the top of the deck. It will not draw or discard this card - these actions would be a separate notetag. |
**Note**: As of 1.6.2, card type names are no longer case-sensitive.
==== Action Pack 1 ====
If you are using the plugin [[plugin-card-action-pack-1|Action Pack 1]], you also have access to these Card Actions:
**Selection Card Actions**
| Select X from zoneName
|Replace 'X' with a number or game variable, and replace 'zoneName' with 'deck', 'discard' or 'hand'. This opens the Card Selection Window and makes the player choose X cards from the specified zone. |
| Select X of Y from zoneName location
|Replace 'X' with a number, 'Y' with another number,'zoneName' with a zone, and a 'location'.\\ \\ This makes the player choose X cards from a selection of Y cards from the specified zone. Replace 'zoneName' with 'deck', 'discard' or 'hand'. Replace 'location' with 'Top', 'Bottom', 'Random'. If 'Top', The pool of cards will be grabbed from the top Y cards. If 'Bottom', the bottom. If 'random', cards will be grabbed randomly from the zone. |
| Select X from skills Y, Z, A, B
|Replace X, Y, Z, etc with numbers.This makes the player choose X cards from a list of Skill IDs. The list of IDs can be any size. |
| Select All from zoneName
|Selects all Cards in the specified zone. |
| Select X Type typeName from zoneName
|Requires CardTypes. Replace X with a number, typeName with the name of a Card Type, and zoneName with a zone. This makes the player choose X cards from the specified zone filtered to only include the specified Card Type. |
| Select X of Y Type typename from zoneName location
|Requires CardTypes. This makes the player choose X cards from the specified zone, filtered to only include the specified Card Type, with a pool size of Y grabbed from the top/bottom or grabbed randomly from the zone. |
**Movement Card Actions**
| Move selected to zoneName
|Replace 'zoneName' with a zone. This will move the selected cards from their previous zone to the specified zone. |
| Remove selected
|This will remove the selected cards from play. |
| Add selected to zoneName
|Replace 'zoneName' with a zone. This will add a copy of each selected card to the specified zone. Note that this is the only Movement Card Action that works when using the Card Action "Select from Skills" because it's the only one that does not require a zone of origin. |
**Clear Card Actions**
| Clear Selected
Clear Selection
|Clears the current list of selected Cards for future Selection Card Actions. \\ \\ Each Selection Card Action adds to the list of selected cards, so one Movement Card Action could be performed on cards from several Selection Card Actions until this is called. |
==== Action Pack 2 ====
If you are using the plugin [[plugin-card-action-pack-2|Action Pack 2]], you also have access to these Card Actions:
| Shuffle zoneName
| Replace 'zoneName' with a zone. This will shuffle the specified zone. |
| Transform X into Y
| Replace X with a number, and Y with a skill ID.\\ This will make the player select X cards from their hand, and the selected cards will transform into a card with the specified Skill ID.\\ The card will then have all of the Actions and Passives of the new Skill ID.\\ If you're using Independent Card Variables, the transformed card will still have access to its old Var values. |
| Transform This into X
| Replace X with a skillID.\\ This will transform the card currently being used into a card with the specified Skill ID. |
| Transform Selected into X
| Replace X with a skillID.\\ When used in conjunction with ActionPack1, this will transform cards selected through a Select Card Action into cards with the specified Skill ID. |
| Copy X to zoneName
| Replace X with a number and 'zoneName' with a zone.\\ This will make the player select X cards from their hand, and the selected cards will be copied into the specified zone.\\ This is a duplication effect, which means unlike Add, which creates a whole new card, the new copy has all of the Var values from the original. |
| Copy Selected to zoneName
| Replace 'zoneName' with a zone.\\ When used in conjunction with [[plugin-card-action-pack-1|ActionPack1]], this will copy the cards selected through a Select Card Action into the specified zone. |
| Copy This to zoneName
| Replace 'zoneName' with a zone.\\ This will copy the card currently being used into the specified zone. |
| Draw X from zoneName
| Replace X with a number and 'zoneName' with a zone.\\ This will take a card from the top of the specified zone and add it to the Hand. It works just like "Move X from zoneName to Hand" |
In addition, you have access to [[plugin-card-action-pack-2#modifiers|Card Action Modifiers]].
==== Independent Card Variables ====
If you are using the plugin [[plugin-icv|Independent Card Variables]], you also have access to these Card Actions:
| Var(X) set Y
| This sets the specified Var of this card to the value supplied in Y.\\ Replace X with the Var index\\ Replace Y with the value you wish the Var index to contain |
| Var(X) mod [+/-]Y
| Modifies the specified Var of this card by the value of Y. Adds or subtracts Y to/from Var. \\ Replace X with the Var index\\ Replace [+/-]Y with a positive or negative number |
| All Skill [skillID] Var(X) set Y
All Skill [skillID] Var(X) mod [+/-]Y
| These Card Actions modify the Var of all cards belonging to that actor of the specified Skill ID. |
| All Skill [skillID] Var(X) set Y in [zoneName]
All Skill [skillID] Var(X) mod [+/-]Y in [zoneName]
| These Card Actions modify the Var of all cards belonging to that actor's specific zone.\\ \\ Replace [zoneName] with "Deck", "Discard" or "Hand". |
| Selected Var(X) set Y
Selected Var(X) mod [+/-]Y
| Requires [[plugin-card-action-pack-1|Card Action Pack 1]] plugin to use.\\ \\ These Card Actions act on all Selected cards instead of the card containing the Card Actions. |
==== Card Summons ====
| Select X from unitName Field
|Replace 'X' with a number or game variable, and replace 'unitName' with 'Ally', 'Opponent', 'Party', or 'Troop'. This activates the respective Field to select the specified number of Cards. |
| Select X Type typeName from unitName Field
|Replace 'X' with a number or game variable, and replace 'unitName' with 'Ally', 'Opponent', 'Party', or 'Troop'. Replace 'typeName' with a Card Type. This activates the respective Field to select the specified number of Cards, only being able to select the specified Type. |
| Use Skill X on Selected
|Replace 'X' with a number or game variable. This performs a skill matching the ID of X on any Creatures selected using the above Select actions, using the Battler performing this Card Action as the subject for damage calculation. |
| Battle Log: message
|Replace 'message' with text. This will push that text to the Battle Log. |