Card Effect Commons ‐ Game Context Determination - DCGO2/DCGO-Card-Scripts GitHub Wiki
The following examples are game states related to an individual card.
public static bool IsExistOnField(CardSource card)
- card - reference to the card being checked
public static bool IsExistOnBattleAreaDigimon(CardSource card)
- card - reference to the card being checked
public static bool IsExistOnBreedingAreaDigimon(CardSource card)
- card - reference to the card being checked
public static bool IsExistOnBattleArea(CardSource card)
- card - reference to the card being checked
public static bool IsExistOnBattleAreaDigimon(CardSource card)
- card - reference to the card being checked
public static bool IsExistOnHand(CardSource card)
- card - reference to the card being checked
public static bool IsExistLinked(CardSource card)
- card - reference to the card being checked
public static bool IsExistOnTrash(CardSource card)
- card - reference to the card being checked
public static bool IsExistOnExecutingArea(CardSource card)
- card - reference to the card being checked
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
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
The following examples are game states related to an Permanent or stack.
public static bool IsPermanentExistsOnBattleArea(Permanent permanent)
- permanent- reference to the permanent being checked
public static bool IsPermanentExistsOnBreedingArea(Permanent permanent)
- permanent- reference to the permanent being checked
public static bool IsOwnerPermanent(Permanent permanent, CardSource card)
- permanent - reference to the permanent being checked
- card - reference to the card to find the owner
public static bool IsOpponentPermanent(Permanent permanent, CardSource card)
- permanent - reference to the permanent being checked
- card - reference to the card to find the owner
public static bool IsPermanentExistsOnOwnerBattleArea(Permanent permanent, CardSource card)
- permanent - reference to the permanent being checked
- card - reference to the card to find the owner
public static bool IsPermanentExistsOnOpponentBattleArea(Permanent permanent, CardSource card)
- permanent - reference to the permanent being checked
- card - reference to the card to find the owner
public static bool IsPermanentExistsOnOwnerBreedingArea(Permanent permanent, CardSource card)
- permanent - reference to the permanent being checked
- card - reference to the card to find the owner
public static bool IsPermanentExistsOnOpponentBreedingArea(Permanent permanent, CardSource card)
- permanent - reference to the permanent being checked
- card - reference to the card to find the owner
public static bool IsPermanentExistsOnBattleAreaDigimon(Permanent permanent)
- permanent - reference to the permanent being checked
public static bool IsPermanentExistsOnOwnerBattleAreaDigimon(Permanent permanent, CardSource card)
- permanent - reference to the permanent being checked
- card - reference to the card to find the owner
public static bool IsPermanentExistsOnOpponentBattleAreaDigimon(Permanent permanent, CardSource card)
- permanent - reference to the permanent being checked
- card - reference to the card to find the owner
The following examples are game states related to finding specific matching conditions within the game.
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
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
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
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
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
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
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
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
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
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
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
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
The following examples are game states related to various less used items.
public static bool HasNoElement(List list)
- list - the list to be checked
public static bool IsOwnerTurn(CardSource card)
- card- checks if it is the card owners turn
public static bool IsOpponentTurn(CardSource card)
- card- checks if it is the card owners turn
public static bool IsOwnerEffect(ICardEffect cardEffect, CardSource card)
- cardEffect - reference to the effect being checked
- card - the card checking, used to determine the owner
public static bool IsOwnerEffect(ICardEffect cardEffect, CardSource card)
- cardEffect - reference to the effect being checked
- card - the card checking, used to determine the owner