Card Effect Commons ‐ Can Use Effects - DCGO2/DCGO-Card-Scripts GitHub Wiki

Can Trigger "On Play" effects

There are different functions for playing this card vs playing any card. You will find all the examples below.

Can trigger [On Play] effect

public static bool CanTriggerOnPlay(Hashtable hashtable, CardSource card, Func<SelectCardEffect.Root, bool> rootCondition = null)
  • hashtable - information about the card being played
  • card - reference to the card being played
  • rootCondition - conditions about where the card is being played from

Can trigger "When permanent is played" effect

public static bool CanTriggerOnPermanentPlay(
Hashtable hashtable,
Func<Permanent, bool> permanentCondition,
Func<SelectCardEffect.Root, bool> rootCondition = null)
  • hashtable - information about the card being played
  • permanentCondition - conditions for the permanent that was played
  • rootCondition - conditions about where the card is being played from

Can Trigger "When Digivolving" effects

There are different functions for digivolving this card vs digivolving any card. You will find all the examples below.

Can trigger [When Digivolving] effect

public static bool CanTriggerWhenDigivolving(Hashtable hashtable, CardSource card, Func<SelectCardEffect.Root, bool> rootCondition = null)
  • hashtable - information about the card being digivolved
  • card - reference to the card being digivolved
  • rootCondition - conditions about where the card is being digivolved from

Can trigger "When permanent digivolves" effect

public static bool CanTriggerWhenPermanentDigivolving(
Hashtable hashtable,
Func<Permanent, bool> permanentCondition,
Func<SelectCardEffect.Root, bool> rootCondition = null)
  • hashtable - information about the card being digivolved
  • permanentCondition - conditions for the permanent that was digivolved
  • rootCondition - conditions about where the card is being digivolved from

Can trigger one of [On Play] effect or [When Digivolving] effect

There are different functions for playing/digivolving this card vs playing/digivolving any card. You will find all the examples below.

Can trigger [When Digivolving] effect

static bool CanTriggerOnEnterField(Hashtable hashtable, CardSource card, bool isEvolution, Func<SelectCardEffect.Root, bool> rootCondition = null)
  • hashtable - information about the card entering battle area
  • card - reference to the card entering battle area
  • isEvolution - is played or is digivolved
  • rootCondition - conditions about where the card entering battle area from

Can trigger "When permanent is played or digivolves" effect

static bool CanTriggerOnPermanentEnterField(
Hashtable hashtable,
Func<Permanent, bool> permanentCondition,
bool isEvolution,
Func<SelectCardEffect.Root, bool> rootCondition = null)
  • hashtable - information about the card entering battle area
  • permanentCondition - conditions for the card entering battle area
  • isEvolution - is played or is digivolved
  • rootCondition - conditions about where the card entering battle area from

Can Suspend for cost functions

public static bool CanActivateSuspendCostEffect(CardSource card, bool includeBreeding = false)
public static bool CanActivatePermanentSuspendCostEffect(Permanent permanent, bool includeBreeding = false)
  • card - reference to the card attempting to suspend (used on individual card effects to check if they can be suspended themselves)
  • permanent - reference to the permanent attempting to be suspended (used when target is not the card using the effect)
  • includeBreeding - determines if the breeding area should be included in the functions conditions

Can Unsuspend for cost functions

public static bool CanUnsuspend(Permanent permanent)
  • permanent - reference to the permanent attempting to be unsuspended

Can Ignore Security battle

public static bool CanUseIgnoreBattle(Hashtable hashtable, CardSource card)
  • hashtable - contains information about the security card
  • card - reference to the card attempting to use this function

Was a card meeting conditions added as a digivolution source

public static bool CanTriggerOnAddDigivolutionCard(
Hashtable hashtable, 
Func<Permanent, bool> permanentCondition, 
Func<ICardEffect, bool> cardEffectCondition, 
Func<CardSource, bool> cardCondition)
  • hashtable - contains information about the card added as a source (card added, card added to, effect used)
  • permanentCondition - conditions that need to be met for the permanent of the added source
  • cardEffectCondition - conditions that need to be met for the effect used to add the source
  • cardCondition - conditions that need to be met for the card that was added

Can Trigger When Attacking effect functions

public static bool CanTriggerOnAttack(Hashtable hashtable, CardSource card)
public static bool CanTriggerOnPermanentAttack(Hashtable hashtable, Func<Permanent, bool> permanentCondition)
  • hashtable - contains information about the attack (attacking permanent, defending permanent)
  • card - reference to the card itself that is attacking
  • permanentConditions - conditions that need to be met for the attacking permanent

Can trigger "when attack target switched" effect

public static bool CanTriggerOnAttackTargetSwitch(Hashtable hashtable, CardSource card)
public static bool CanTriggerOnPermanentAttackTargetSwitch(Hashtable hashtable, Func<Permanent, bool> permanentCondition)
  • hashtable - contains information about the attack
  • card - reference to the card itself that is attacking and was switched
  • permanentConditions - conditions that need to be met for the attacking permanent

Can trigger "an effect adds a card to 1 player's hand" effect

public static bool CanTriggerOnHandAdded(Hashtable hashtable, Player player, Func<ICardEffect, bool> cardEffectCondition)
  • hashtable - contains information about the card added
  • player - player in which the card was added
  • cardEffectCondition - conditions for the effect used to add the card

Can trigger "When cards return to hand from trash" effects

public static bool CanTriggerWhenOwnerCardsReturnToHandFromTrash(Hashtable hashtable, Func<CardSource, bool> cardCondition, CardSource card)
public static bool CanTriggerWhenCardsReturnToHandFromTrash(Hashtable hashtable, Func<CardSource, bool> cardCondition, CardSource card)
  • hashtable - information about the card that was added from trash
  • cardCondtion - conditions for the card being returned to hand
  • card - reference to the card using the effect

Can trigger "When cards return to library from trash" effects

public static bool CanTriggerWhenOwnerCardsReturnToLibraryFromTrash(Hashtable hashtable, Func<CardSource, bool> cardCondition, CardSource card)
public static bool CanTriggerWhenCardsReturnToLibraryFromTrash(Hashtable hashtable, Func<CardSource, bool> cardCondition, CardSource card)
  • hashtable - information about the card that was added from trash
  • cardCondtion - conditions for the card being returned to hand
  • card - reference to the card using the effect

Trigger of On Deletion effects

There are many differences to on deletion effects based on how they are deleted or what you are checking for. You will find all the examples below.

Can trigger [On Deletion] effect

public static bool CanTriggerOnDeletion(Hashtable hashtable, CardSource card)
  • hashtable - contains information about the deletion (what and how)
  • card - reference to the card checking for the trigger of the on deletion

Can trigger "when permanent is deleted" effect

public static bool CanTriggerOnPermanentDeleted(Hashtable hashtable, Func<Permanent, bool> permanentCondition)
  • hashtable - contains information about the deletion (what and how)
  • permanentCondition - conditions for the permanent that was deleted

Can trigger "when permanent is deleted by battle" effects

public static bool IsByBattle(Hashtable hashtable)
  • hashtable - contains information about the deletion (what and how)

Can trigger "when permanent is deleted by Effect" effects

public static bool IsByEffect(Hashtable hashtable, Func<ICardEffect, bool> cardEffectCondition)
  • hashtable - contains information about the deletion (what and how)
  • cardEffectCondition - conditions for the permanent that was deleted

Activation of On Deletion effects

There are many differences to on deletion effects based on how they are deleted or what you are checking for. You will find all the examples below.

Can activate [On Deletion] effect(non ESS)

public static bool CanActivateOnDeletion(CardSource card)
  • card - the card attempting to activate its On Deletion

Can activate [On Deletion] effect(ESS)

public static bool CanActivateOnDeletionInherited(Hashtable hashtable, CardSource card)
  • hashtable - contains information about the deletion (what and how)
  • card - the card attempting to activate its On Deletion

Whether TopCard is in trash when check [On Deletion] effect

public static bool IsTopCardInTrashOnDeletion(Hashtable hashtable)
  • hashtable - contains information about the deletion (what and how)

Whether the card that uses the effect and the top card belonged to the same permanent

public static bool IsTopCardSamePermanent(Hashtable hashtable, CardSource card)
  • hashtable - contains information about the deletion (what and how)
  • card - the card attempting to activate its On Deletion

Can activate [On Deletion] effect that can activate if the permanent contains specific name

public static bool CanActivateSelfOnDeletionWithContainingCardName(Hashtable hashtable, string name, CardSource card)
  • hashtable - contains information about the deletion (what and how)
  • name - name the card must contain to activate its On Deletion
  • card - the card attempting to activate its On Deletion

Can activate [On Deletion] effect that can activate if the permanent contains specific trait

public static bool CanActivateSelfOnDeletionWithContainingTrait(Hashtable hashtable, string name, CardSource card)
  • hashtable - contains information about the deletion (what and how)
  • name - trait the card must contain to activate its On Deletion
  • card - the card attempting to activate its On Deletion

Can activate [On Deletion] effect that can activate if the permanent has specific colors

public static bool CanActivateSelfOnDeletionWithCardColors(Hashtable hashtable, Func<List<CardColor>, bool> cardColorCondition, CardSource card)
  • hashtable - contains information about the deletion (what and how)
  • cardColorCondition - conditions for card color that must be met to activate its On Deletion
  • card - the card attempting to activate its On Deletion

Can activate [On Deletion] effect that can activate if the permanent has Save text

public static bool CanActivateSelefOnDeletionWithSaveText(Hashtable hashtable, CardSource card)
  • hashtable - contains information about the deletion (what and how)
  • card - the card attempting to activate its On Deletion

Can trigger [On End Attack] effect

public static bool CanTriggerOnEndAttack(Hashtable hashtable, CardSource card)
  • hashtable - contains information about the Attack
  • card - reference to the card attempting to use End of Attack

Can trigger "when permanent moves" effect (moved refers to going from raising to battle area and visa versa)

public static bool CanTriggerOnMove(Hashtable hashtable, Func<Permanent, bool> permanentCondition)
  • hashtable - contains information about the cards being moved
  • permanentCondition - conditions for the card being moved

Can trigger "When card is returned to library bottom from this permanent due to effect" effect

public static bool CanTriggerOnReturnToLibraryBottomDigivolutionCard(Hashtable hashtable, Func<CardSource, bool> cardCondition, CardSource card)
  • hashtable - contains information about the cards being moved
  • cardCondition - conditions for the card being returned
  • card - the specific card being returned

Can trigger "when this permanent suspends" effect

public static bool CanTriggerWhenSelfPermanentSuspends(Hashtable hashtable, CardSource card)
  • hashtable - contains information about the cards being suspended
  • card - reference to the card being suspended

Can trigger "when permanent suspends" effect

public static bool CanTriggerWhenPermanentSuspends(Hashtable hashtable, Func<Permanent, bool> permanentCondition)
  • hashtable - contains information about the cards being suspended
  • permanentCondition- conditions for the permanent being suspended

Can trigger "When this digivolution card is trashed due to activating this Digimon's " effect

public static bool CanTriggerOnTrashBySelfDigiBurst(Hashtable hashtable, CardSource card)
  • hashtable - contains information about the cards being trashed
  • card - reference to the card being trashed

Can trigger "When this digivolution card is trashed" effect

public static bool CanTriggerOnTrashSelfDigivolutionCard(Hashtable hashtable, Func<ICardEffect, bool> cardEffectCondition, CardSource card)
  • hashtable - contains information about the cards being trashed
  • cardEffectCondition - conditions for the effect that trashed cards
  • card - reference to the card being trashed

Can trigger "When this digivolution card is trashed due to effect" effect

public static bool CanTriggerOnTrashDigivolutionCard(
Hashtable hashtable, 
Func<Permanent, bool> permanentCondition, 
Func<ICardEffect, bool> cardEffectCondition, 
Func<CardSource, bool> cardCondition)
  • hashtable - contains information about the cards being trashed
  • permanentCondition - conditions for the permanent being trashed from
  • cardEffectCondition - conditions for the effect that trashed cards
  • cardCondition- conditions for the cards being trashed

Can trigger "When this hand card is trashed due to effect" effect

public static bool CanTriggerOnTrashSelfHand(Hashtable hashtable, Func<ICardEffect, bool> cardEffectCondition, CardSource card)
  • hashtable - contains information about the cards being trashed
  • cardEffectCondition - conditions for the effect that trashed cards
  • card - reference to the card being trashed

Can trigger "When hand card is trashed due to effect" effect

public static bool CanTriggerOnTrashHand(Hashtable hashtable, Func<ICardEffect, bool> cardEffectCondition, Func<CardSource, bool> cardCondition)
  • hashtable - contains information about the cards being trashed
  • cardEffectCondition - conditions for the effect that trashed cards
  • cardCondition- conditions for the cards being trashed

Can trigger "when this permanent unsuspends" effect

public static bool CanTriggerWhenSelfPermanentUnsuspends(Hashtable hashtable, CardSource card)
  • hashtable - contains information about the cards being unsuspended
  • card - reference to the card being unsuspended

Can trigger "when permanent unsuspends" effect

public static bool CanTriggerWhenPermanentUnsuspends(Hashtable hashtable, Func<Permanent, bool> permanentCondition)
  • hashtable - contains information about the cards being unsuspended
  • permanentCondition- conditions for the permanent that is unsuspended

Can trigger option [Main] effect

public static bool CanTriggerOptionMainEffect(Hashtable hashtable, CardSource card)
  • hashtable - contains information about the cards being played
  • card - reference to the card being played

Can trigger [Security] effect

public static bool CanTriggerSecurityEffect(Hashtable hashtable, CardSource card)    
  • hashtable - contains information about the effect being triggered
  • card - reference to the card being triggering the effect

Can trigger "when hand cards added" effect

public static bool CanTriggerWhenAddHand(Hashtable hashtable, Func<Player, bool> playerCondition, Func<ICardEffect, bool> cardEffectCondition)
  • hashtable - contains information about the card being added
  • playerCondition - conditions for the player adding a card
  • cardEffectCondition - conditions for the card being added

Can trigger "when security cards added" effect

public static bool CanTriggerWhenAddSecurity(Hashtable hashtable, Func<Player, bool> playerCondition)
  • hashtable - contains information about the card being added
  • playerCondition - conditions for the player adding a card

Can trigger "when a Digimon deletes opponent's Digimon" effect

public static bool CanTriggerWhenDeleteOpponentDigimon(
Hashtable hashtable,
Func<Permanent, bool> winnerCondition,
Func<Permanent, bool> loserCondition)
  • hashtable - contains information about the card being deleted
  • winnerCondition - conditions for the card that deleted the other
  • loserCondition - conditions for the card that was deleted

Can trigger "when a Digimon deletes opponent's Digimon by battle" effect

public static bool CanTriggerWhenDeleteOpponentDigimonByBattle(
Hashtable hashtable,
Func<Permanent, bool> winnerCondition,
Func<Permanent, bool> loserCondition,
bool isOnlyWinnerSurvive,
Func<Permanent, bool> winnerRealCondition = null,
Func<Permanent, bool> loserRealCondition = null)
  • hashtable - contains information about the card being deleted
  • winnerCondition - conditions for the card that deleted the other
  • loserCondition - conditions for the card that was deleted
  • isOnlyWinnerSurvive - whether or not the "winning" digimon can be the only survivor
  • winnerRealCondition - conditions for the card that deleted the other, after other effect - OPTIONAL
  • loserRealCondition - conditions for the card that was deleted, after other effect - OPTIONAL

Can trigger "when a card is trashed from deck" effect

There are different functions for trashing your own deck vs a card is trashed from any deck. You will find all the examples below.

Can trigger "when this card is trashed from deck" effect

public static bool CanTriggerWhenSelfDiscardLibrary(Hashtable hashtable, CardSource card)
  • hashtable - contains information about the card being trashed
  • card - reference to the card triggering effect

Can trigger "when a card is trashed from deck" effect

public static bool CanTriggerWhenDiscardLibrary(Hashtable hashtable, Func<CardSource, bool> cardCondition)
  • hashtable - contains information about the card being trashed
  • cardCondition - condition for the card being trashed

Can trigger "when card is trashed from security" effect

There are different functions for trashing your own security vs a card is trashed from any security. You will find all the examples below.

Can trigger "When this security card is trashed due to effect" effect

public static bool CanTriggerOnTrashSelfSecurity(Hashtable hashtable, Func<ICardEffect, bool> cardEffectCondition, CardSource card)
  • hashtable - contains information about the card being trashed
  • cardEffectCondition - condition for the effect doing the trashing
  • card - reference to the card triggering effect

Can trigger "When security card is trashed due to effect" effect

public static bool CanTriggerOnTrashSecurity(Hashtable hashtable, Func<ICardEffect, bool> cardEffectCondition, Func<CardSource, bool> cardCondition)
  • hashtable - contains information about the card being trashed
  • cardEffectCondition - condition for the effect doing the trashing
  • cardCondition - condition for the card being trashed

Can trigger "When this card is linked" effect

public static bool CanTriggerWhenLinking(Hashtable hashtable, Func<Permanent, bool> permanentCondition, CardSource card)
  • hashtable - contains information about the card being linked
  • permanentCondition - condition for the permanent being linked
  • card - reference to the card triggering effect

Can trigger "When a card gets linked" effect

public static bool CanTriggerWhenLinked(Hashtable hashtable, Func<Permanent, bool> permanentCondition, Func<CardSource, bool> sourcecCondition)
  • hashtable - contains information about the card being linked
  • permanentCondition - condition for the permanent being linked
  • sourcecCondition - condition for the card being linked

Can trigger "when a security cards is lost" effect

public static bool CanTriggerWhenLoseSecurity(Hashtable hashtable, Func<Player, bool> playerCondition)
  • hashtable - contains information about the card being removed
  • playerCondition - condition for the player losing security

Can trigger "when permanent would digivolve" effect

There are different functions for digivolving your own digimon vs digivolving any digimon. You will find all the examples below.

Can trigger "When card would digivolve" effects of 1 permanent

public static bool CanTriggerWhenPermanentWouldDigivolveOfCard(Hashtable hashtable, Func<CardSource, bool> cardCondition, CardSource card)
  • hashtable - contains information about the card being digivolved
  • cardCondition - condition for the card digivolving
  • card - reference to the card using effect

Can trigger when "1 Digimon would digivolve into 1 card" effect

public static bool CanTriggerWhenPermanentWouldDigivolve(
Hashtable hashtable, 
Func<Permanent, bool> permanentCondition,
Func<CardSource, bool> cardCondition)
  • hashtable - contains information about the card being digivolved
  • permanentCondition - condition for the permanent being digivolved
  • cardCondition - condition for the card digivolving

Can trigger "When permanent would be played" effects of 1 permanent

public static bool CanTriggerWhenPermanentWouldPlay(Hashtable hashtable, Func<CardSource, bool> cardCondition)
  • hashtable - contains information about the card being played
  • cardCondition - condition for the card being played

Can trigger "when permanent would leave the battle area" effect

There are different functions for this permanent leaving the battle area vs any permanent. You will find all the examples below.

Can trigger "When this permanent would leave the battle area" effects of 1 card

public static bool CanTriggerWhenRemoveField(Hashtable hashtable, CardSource card)
  • hashtable - contains information about the card being removed
  • card - reference to the card using effect

Can trigger "When this permanent would leave the battle area" effects of 1 permanent

public static bool CanTriggerWhenPermanentRemoveField(Hashtable hashtable, Func<Permanent, bool> permanentCondition)
  • hashtable - contains information about the card being removed
  • permanentCondition - condition for the permanent being removed

Can trigger "When permanent uses Digi-Burst" effects

public static bool CanTriggerWhenUseDigiBurst(
Hashtable hashtable, 
Func<Permanent, bool> permanentCondition, 
Func<ICardEffect, bool> cardEffectCondition)
  • hashtable - contains information about the Digi-Burst
  • permanentCondition - condition for the permanent using Digi-Burst
  • cardEffectCondition - condition for the card being trashed

Can trigger "when use an option card" effect

There are different functions for using your option card vs any option card. You will find all the examples below.

Can trigger "When you use an Option card" effects

public static bool CanTriggerWhenOwnerUseOption(
Hashtable hashtable, 
Func<CardSource, bool> cardCondition, 
Func<int, bool> constCondition, 
CardSource card)
  • hashtable - contains information about the card being used
  • cardCondition - conditions for the card being used
  • constCondition - conditions for the cost of card being used
  • card - reference to the card using effect

Can trigger "When you or the opponent use an Option card" effects

public static bool CanTriggerWhenOwnerUseOption(
Hashtable hashtable, 
Func<CardSource, bool> cardCondition, 
Func<int, bool> constCondition, 
CardSource card)
  • hashtable - contains information about the card being used
  • cardCondition - conditions for the card being used
  • constCondition - conditions for the cost of card being used
  • card - reference to the card using effect
⚠️ **GitHub.com Fallback** ⚠️