|
|
@@ -1,8 +1,7 @@
|
|
|
-using System;
|
|
|
using System.Collections;
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
-namespace DCGO.CardEffects
|
|
|
+namespace DCGO.CardEffects.BT20
|
|
|
{
|
|
|
public class BT20_079 : CEntity_Effect
|
|
|
{
|
|
|
@@ -11,10 +10,13 @@ namespace DCGO.CardEffects
|
|
|
List<ICardEffect> cardEffects = new List<ICardEffect>();
|
|
|
|
|
|
#region Security attack +1
|
|
|
+
|
|
|
if (timing == EffectTiming.None)
|
|
|
{
|
|
|
- cardEffects.Add(CardEffectFactory.ChangeSelfSAttackStaticEffect(changeValue: 1, isInheritedEffect: false, card: card, condition: null));
|
|
|
+ cardEffects.Add(CardEffectFactory.ChangeSelfSAttackStaticEffect(changeValue: 1, isInheritedEffect: false, card: card,
|
|
|
+ condition: null));
|
|
|
}
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region Execute
|
|
|
@@ -34,6 +36,11 @@ namespace DCGO.CardEffects
|
|
|
return CardEffectCommons.IsMinLevel(permanent, card.Owner.Enemy);
|
|
|
}
|
|
|
|
|
|
+ bool CanActivateConditionShared(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
|
|
|
+ CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentConditionShared);
|
|
|
+ }
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
@@ -42,8 +49,8 @@ namespace DCGO.CardEffects
|
|
|
if (timing == EffectTiming.OnEnterFieldAnyone)
|
|
|
{
|
|
|
ActivateClass activateClass = new ActivateClass();
|
|
|
- activateClass.SetUpICardEffect("Delete 1 of your oponent's Digimon", CanUseCondition, card);
|
|
|
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
|
|
|
+ activateClass.SetUpICardEffect("Delete 1 of your opponent's Digimon", CanUseCondition, card);
|
|
|
+ activateClass.SetUpActivateClass(CanActivateConditionShared, ActivateCoroutine, -1, false, EffectDescription());
|
|
|
cardEffects.Add(activateClass);
|
|
|
|
|
|
string EffectDescription()
|
|
|
@@ -56,39 +63,24 @@ namespace DCGO.CardEffects
|
|
|
return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
|
|
|
}
|
|
|
|
|
|
- bool CanActivateCondition(Hashtable hashtable)
|
|
|
+ IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
{
|
|
|
- if (CardEffectCommons.IsExistOnBattleArea(card))
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
+ SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
|
|
|
|
|
|
- return false;
|
|
|
- }
|
|
|
+ selectPermanentEffect.SetUp(
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ canTargetCondition: CanSelectPermanentConditionShared,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ maxCount: 1,
|
|
|
+ canNoSelect: false,
|
|
|
+ canEndNotMax: false,
|
|
|
+ selectPermanentCoroutine: null,
|
|
|
+ afterSelectPermanentCoroutine: null,
|
|
|
+ mode: SelectPermanentEffect.Mode.Destroy,
|
|
|
+ cardEffect: activateClass);
|
|
|
|
|
|
- IEnumerator ActivateCoroutine(Hashtable _hashtable)
|
|
|
- {
|
|
|
- if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentConditionShared))
|
|
|
- {
|
|
|
- int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentConditionShared));
|
|
|
-
|
|
|
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
|
|
|
-
|
|
|
- selectPermanentEffect.SetUp(
|
|
|
- selectPlayer: card.Owner,
|
|
|
- canTargetCondition: CanSelectPermanentConditionShared,
|
|
|
- canTargetCondition_ByPreSelecetedList: null,
|
|
|
- canEndSelectCondition: null,
|
|
|
- maxCount: maxCount,
|
|
|
- canNoSelect: false,
|
|
|
- canEndNotMax: false,
|
|
|
- selectPermanentCoroutine: null,
|
|
|
- afterSelectPermanentCoroutine: null,
|
|
|
- mode: SelectPermanentEffect.Mode.Destroy,
|
|
|
- cardEffect: activateClass);
|
|
|
-
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
- }
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -99,8 +91,8 @@ namespace DCGO.CardEffects
|
|
|
if (timing == EffectTiming.OnEnterFieldAnyone)
|
|
|
{
|
|
|
ActivateClass activateClass = new ActivateClass();
|
|
|
- activateClass.SetUpICardEffect("Delete 1 of your oponent's Digimon", CanUseCondition, card);
|
|
|
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
|
|
|
+ activateClass.SetUpICardEffect("Delete 1 of your opponent's Digimon", CanUseCondition, card);
|
|
|
+ activateClass.SetUpActivateClass(CanActivateConditionShared, ActivateCoroutine, -1, false, EffectDescription());
|
|
|
cardEffects.Add(activateClass);
|
|
|
|
|
|
string EffectDescription()
|
|
|
@@ -113,39 +105,24 @@ namespace DCGO.CardEffects
|
|
|
return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
|
|
|
}
|
|
|
|
|
|
- bool CanActivateCondition(Hashtable hashtable)
|
|
|
+ IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
{
|
|
|
- if (CardEffectCommons.IsExistOnBattleArea(card))
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
+ SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
|
|
|
|
|
|
- return false;
|
|
|
- }
|
|
|
+ selectPermanentEffect.SetUp(
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ canTargetCondition: CanSelectPermanentConditionShared,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ maxCount: 1,
|
|
|
+ canNoSelect: false,
|
|
|
+ canEndNotMax: false,
|
|
|
+ selectPermanentCoroutine: null,
|
|
|
+ afterSelectPermanentCoroutine: null,
|
|
|
+ mode: SelectPermanentEffect.Mode.Destroy,
|
|
|
+ cardEffect: activateClass);
|
|
|
|
|
|
- IEnumerator ActivateCoroutine(Hashtable _hashtable)
|
|
|
- {
|
|
|
- if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentConditionShared))
|
|
|
- {
|
|
|
- int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentConditionShared));
|
|
|
-
|
|
|
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
|
|
|
-
|
|
|
- selectPermanentEffect.SetUp(
|
|
|
- selectPlayer: card.Owner,
|
|
|
- canTargetCondition: CanSelectPermanentConditionShared,
|
|
|
- canTargetCondition_ByPreSelecetedList: null,
|
|
|
- canEndSelectCondition: null,
|
|
|
- maxCount: maxCount,
|
|
|
- canNoSelect: false,
|
|
|
- canEndNotMax: false,
|
|
|
- selectPermanentCoroutine: null,
|
|
|
- afterSelectPermanentCoroutine: null,
|
|
|
- mode: SelectPermanentEffect.Mode.Destroy,
|
|
|
- cardEffect: activateClass);
|
|
|
-
|
|
|
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
- }
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -162,41 +139,26 @@ namespace DCGO.CardEffects
|
|
|
|
|
|
string EffectDescriptionShared()
|
|
|
{
|
|
|
- return "[On Play] You may play 1 level 5 or lower Digimon card with the [Ghost] trait from your trash without paying the cost.";
|
|
|
+ return
|
|
|
+ "[On Play] You may play 1 level 5 or lower Digimon card with the [Ghost] trait from your trash without paying the cost.";
|
|
|
}
|
|
|
|
|
|
- bool CanActivateCondition(Hashtable hashtable)
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
{
|
|
|
- if (CardEffectCommons.IsExistOnBattleArea(card))
|
|
|
- {
|
|
|
- if (CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, HasCorrectTrait))
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
+ return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
|
|
|
}
|
|
|
|
|
|
- bool CanUseCondition(Hashtable hashtable)
|
|
|
+ bool CanActivateCondition(Hashtable hashtable)
|
|
|
{
|
|
|
- return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
|
|
|
+ return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
|
|
|
+ CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, HasCorrectTrait);
|
|
|
}
|
|
|
|
|
|
bool HasCorrectTrait(CardSource cardSource)
|
|
|
{
|
|
|
- if (cardSource.EqualsTraits("Ghost"))
|
|
|
- {
|
|
|
- if (cardSource.HasLevel && cardSource.Level <= 5)
|
|
|
- {
|
|
|
- if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass))
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
+ return cardSource.IsDigimon && cardSource.EqualsTraits("Ghost") &&
|
|
|
+ cardSource.HasLevel && cardSource.Level <= 5 &&
|
|
|
+ CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass);
|
|
|
}
|
|
|
|
|
|
IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
@@ -223,7 +185,8 @@ namespace DCGO.CardEffects
|
|
|
selectPlayer: card.Owner,
|
|
|
cardEffect: activateClass);
|
|
|
|
|
|
- selectCardEffect.SetUpCustomMessage("Select 1 Digimon card to play.", "The opponent is selecting 1 Digimon card to play.");
|
|
|
+ selectCardEffect.SetUpCustomMessage("Select 1 Digimon card to play.",
|
|
|
+ "The opponent is selecting 1 Digimon card to play.");
|
|
|
selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
|
|
|
|
|
|
yield return StartCoroutine(selectCardEffect.Activate());
|
|
|
@@ -244,6 +207,7 @@ namespace DCGO.CardEffects
|
|
|
activateETB: true));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region On Deletion
|
|
|
@@ -257,34 +221,26 @@ namespace DCGO.CardEffects
|
|
|
|
|
|
string EffectDescriptionShared()
|
|
|
{
|
|
|
- return "[On Deletion] You may play 1 level 5 or lower Digimon card with the [Ghost] trait from your trash without paying the cost.";
|
|
|
+ return
|
|
|
+ "[On Deletion] You may play 1 level 5 or lower Digimon card with the [Ghost] trait from your trash without paying the cost.";
|
|
|
}
|
|
|
|
|
|
- bool CanActivateCondition(Hashtable hashtable)
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
{
|
|
|
- return CardEffectCommons.CanActivateOnDeletion(card) &&
|
|
|
- CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, HasCorrectTrait);
|
|
|
+ return CardEffectCommons.CanTriggerOnDeletion(hashtable, card);
|
|
|
}
|
|
|
|
|
|
- bool CanUseCondition(Hashtable hashtable)
|
|
|
+ bool CanActivateCondition(Hashtable hashtable)
|
|
|
{
|
|
|
- return CardEffectCommons.CanTriggerOnDeletion(hashtable, card);
|
|
|
+ return CardEffectCommons.CanActivateOnDeletion(card) &&
|
|
|
+ CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, HasCorrectTrait);
|
|
|
}
|
|
|
|
|
|
bool HasCorrectTrait(CardSource cardSource)
|
|
|
{
|
|
|
- if (cardSource.EqualsTraits("Ghost"))
|
|
|
- {
|
|
|
- if (cardSource.HasLevel && cardSource.Level <= 5)
|
|
|
- {
|
|
|
- if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass))
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
+ return cardSource.IsDigimon && cardSource.EqualsTraits("Ghost") &&
|
|
|
+ cardSource.HasLevel && cardSource.Level <= 5 &&
|
|
|
+ CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass);
|
|
|
}
|
|
|
|
|
|
IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
@@ -311,7 +267,8 @@ namespace DCGO.CardEffects
|
|
|
selectPlayer: card.Owner,
|
|
|
cardEffect: activateClass);
|
|
|
|
|
|
- selectCardEffect.SetUpCustomMessage("Select 1 Digimon card to play.", "The opponent is selecting 1 Digimon card to play.");
|
|
|
+ selectCardEffect.SetUpCustomMessage("Select 1 Digimon card to play.",
|
|
|
+ "The opponent is selecting 1 Digimon card to play.");
|
|
|
selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
|
|
|
|
|
|
yield return StartCoroutine(selectCardEffect.Activate());
|
|
|
@@ -332,6 +289,7 @@ namespace DCGO.CardEffects
|
|
|
activateETB: true));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
return cardEffects;
|