Card Effect Commons ‐ Game Context Determination - DCGO2/DCGO-Card-Scripts GitHub Wiki

Card Related Examples

The following examples are game states related to an individual card.

Whether the card is on the field

public static bool IsExistOnField(CardSource card)
  • card - reference to the card being checked

Whether the card is in the Breeding Area

public static bool IsExistOnBattleAreaDigimon(CardSource card)
  • card - reference to the card being checked

Whether the card is a Digimon in the Breeding Area

public static bool IsExistOnBreedingAreaDigimon(CardSource card)
  • card - reference to the card being checked

Whether the card is in the Battle Area

public static bool IsExistOnBattleArea(CardSource card)
  • card - reference to the card being checked

Whether the card is a Digimon in the Battle Area

public static bool IsExistOnBattleAreaDigimon(CardSource card)
  • card - reference to the card being checked

Whether the card is in Hand

public static bool IsExistOnHand(CardSource card)
  • card - reference to the card being checked

Whether the card is Linked

public static bool IsExistLinked(CardSource card)
  • card - reference to the card being checked

Whether the card is in Trash

public static bool IsExistOnTrash(CardSource card)
  • card - reference to the card being checked

Whether the card is in the Executing Area (Executing Area is the in between of Security and Field)

public static bool IsExistOnExecutingArea(CardSource card)
  • card - reference to the card being checked

Whether the cared is in Security

public static bool IsExistInSecurity(CardSource card, bool isFlipped = false)
  • card - reference to the card being checked
  • isFlipped - is the card in security face up/face down (false/Face up is default) - optional

Whether the card Can be played as a new permanent

public static bool CanPlayAsNewPermanent(
CardSource cardSource,
bool payCost,
ICardEffect cardEffect,
SelectCardEffect.Root root = SelectCardEffect.Root.Hand,
bool isBreedingArea = false,
bool isPlayOption = false,
int fixedCost = -1)
  • cardSource - reference to the card being checked
  • payCost- will you be paying the cost to play the card
  • cardEffect - reference to the effect
  • root - enum referencing the area the card being played is coming from (Hand is default) - Optional
  • isBreedingArea - should this effect include the breeding area (false is default) - Optional
  • isPlayOption - you are attempting to play an option card (false is default) - Optional
  • fixedCost - the fixed cost of this played card (-1 is default) - Optional

Permanent Related Examples

The following examples are game states related to an Permanent or stack.

Whether the permanent is in the Battle Area

public static bool IsPermanentExistsOnBattleArea(Permanent permanent)

  • permanent- reference to the permanent being checked

Whether the permanent is in the Breeding Area

public static bool IsPermanentExistsOnBreedingArea(Permanent permanent)

  • permanent- reference to the permanent being checked

Whether the permanent is card's owner's

public static bool IsOwnerPermanent(Permanent permanent, CardSource card)

  • permanent - reference to the permanent being checked
  • card - reference to the card to find the owner

Whether the permanent is card's owner's opponent's

public static bool IsOpponentPermanent(Permanent permanent, CardSource card)

  • permanent - reference to the permanent being checked
  • card - reference to the card to find the owner

Whether the permanent is in the card's owner's Battle Area

public static bool IsPermanentExistsOnOwnerBattleArea(Permanent permanent, CardSource card)

  • permanent - reference to the permanent being checked
  • card - reference to the card to find the owner

WWhether the permanent is in the card's owner's opponent's Battle Area

public static bool IsPermanentExistsOnOpponentBattleArea(Permanent permanent, CardSource card)

  • permanent - reference to the permanent being checked
  • card - reference to the card to find the owner

Whether the permanent is in the card's owner's Breeding Area

public static bool IsPermanentExistsOnOwnerBreedingArea(Permanent permanent, CardSource card)

  • permanent - reference to the permanent being checked
  • card - reference to the card to find the owner

Whether the permanent is in the card's owner's opponent's Breeding Area

public static bool IsPermanentExistsOnOpponentBreedingArea(Permanent permanent, CardSource card)

  • permanent - reference to the permanent being checked
  • card - reference to the card to find the owner

Whether the permanent is Digimon and in the Battle Area

public static bool IsPermanentExistsOnBattleAreaDigimon(Permanent permanent)

  • permanent - reference to the permanent being checked

Whether the permanent is Digimon and in the card's owner's Battle Area

public static bool IsPermanentExistsOnOwnerBattleAreaDigimon(Permanent permanent, CardSource card)

  • permanent - reference to the permanent being checked
  • card - reference to the card to find the owner

Whether the permanent is Digimon and in the card's owner's opponent's Battle Area

public static bool IsPermanentExistsOnOpponentBattleAreaDigimon(Permanent permanent, CardSource card)

  • permanent - reference to the permanent being checked
  • card - reference to the card to find the owner

Match Condition Examples

The following examples are game states related to finding specific matching conditions within the game.

How many permanents there are in the Battle Area that satisfy the condition

public static int MatchConditionPermanentCount(Func<Permanent, bool> CanSelectPermanentCondition, bool isContainBreedingArea = false)
  • CanSelectPermanentCondition - Func representing the condition that needs to be met
  • isContainBreedingArea - Should this also check the breeding area (default is false) - Optional

How many permanents there are in the owner's Battle Area that satisfy the condition

public static int MatchConditionOwnersPermanentCount(CardSource card, Func<Permanent, bool> CanSelectPermanentCondition)
  • card - reference to the card, in order to find the owner
  • CanSelectPermanentCondition - Func representing the condition that needs to be met

How many permanents there are in the owner's opponent's Battle Area that satisfy the condition

public static int MatchConditionOpponentsPermanentCount(CardSource card, Func<Permanent, bool> CanSelectPermanentCondition)
  • card - reference to the card, in order to find the owner
  • CanSelectPermanentCondition - Func representing the condition that needs to be met

Whether there is at least 1 permanent in the Battle Area that satisfies the condition

public static bool HasMatchConditionPermanent(Func<Permanent, bool> CanSelectPermanentCondition, bool isContainBreedingArea = false)
  • CanSelectPermanentCondition - Func representing the condition that needs to be met
  • isContainBreedingArea - Should this also check the breeding area (default is false) - Optional

Whether there is at least 1 card in the owner's hand that satisfies the condition

public static bool HasMatchConditionOwnersHand(CardSource card, Func<CardSource, bool> CanSelectCardCondition)
  • card - reference to the card, in order to find the owner
  • CanSelectCardCondition - Func representing the condition that needs to be met

How many cards there are in the owner's hand that satisfy the condition

public static bool MatchConditionOwnersCardCountInHand(CardSource card, Func<CardSource, bool> CanSelectCardCondition)
  • card - reference to the card, in order to find the owner
  • CanSelectCardCondition - Func representing the condition that needs to be met

Whether there is at least 1 permanent in the owner's Battle Area that satisfies the condition

public static bool HasMatchConditionOwnersPermanent(CardSource card, Func<CardSource, bool> CanSelectCardCondition)
  • card - reference to the card, in order to find the owner
  • CanSelectCardCondition - Func representing the condition that needs to be met

Whether there is at least 1 permanent in the owner's opponent's Battle Area that satisfies the condition

public static bool HasMatchConditionOpponentsPermanent(CardSource card, Func<CardSource, bool> CanSelectCardCondition)
  • card - reference to the card, in order to find the owner
  • CanSelectCardCondition - Func representing the condition that needs to be met

Whether there is at least 1 permanent in the owner's Security Area that satisfies the condition

public static bool HasMatchConditionOwnersSecurity(CardSource card, Func<CardSource, bool> CanSelectPermanentCondition, bool flipped = true)
  • card - reference to the card, in order to find the owner
  • CanSelectCardCondition - Func representing the condition that needs to be met
  • flipped - is the card face up/face down (true/Face down) is default

How many cards there are in the owner's trash that satisfy the condition

public static int MatchConditionOwnersCardCountInTrash(CardSource card, Func<CardSource, bool> CanSelectCardCondition)
  • card - reference to the card, in order to find the owner
  • CanSelectCardCondition - Func representing the condition that needs to be met

How many cards there are in the owner's opponent's trash that satisfy the condition

public static int MatchConditionOpponentsCardCountInTrash(CardSource card, Func<CardSource, bool> CanSelectCardCondition)
  • card - reference to the card, in order to find the owner
  • CanSelectCardCondition - Func representing the condition that needs to be met

Whether there is at least 1 card in the owner's trash that satisfies the condition

public static int HasMatchConditionOwnersCardInTrash(CardSource card, Func<CardSource, bool> CanSelectCardCondition)
  • card - reference to the card, in order to find the owner
  • CanSelectCardCondition - Func representing the condition that needs to be met

Whether there is at least 1 card in the owner's opponent's trash that satisfies the condition

public static int HasMatchConditionOpponentsCardInTrash(CardSource card, Func<CardSource, bool> CanSelectCardCondition)
  • card - reference to the card, in order to find the owner
  • CanSelectCardCondition - Func representing the condition that needs to be met

Other

The following examples are game states related to various less used items.

Whether the list has no elements

public static bool HasNoElement(List list)

  • list - the list to be checked

Whether it is the owners turn

public static bool IsOwnerTurn(CardSource card)
  • card- checks if it is the card owners turn

Whether it is the opponent's turn

public static bool IsOpponentTurn(CardSource card)
  • card- checks if it is the card owners turn

Whether the effect is your effect

public static bool IsOwnerEffect(ICardEffect cardEffect, CardSource card)
  • cardEffect - reference to the effect being checked
  • card - the card checking, used to determine the owner

Whether the effect is your Opponent's

public static bool IsOwnerEffect(ICardEffect cardEffect, CardSource card)
  • cardEffect - reference to the effect being checked
  • card - the card checking, used to determine the owner
⚠️ **GitHub.com Fallback** ⚠️