|
|
@@ -38,8 +38,8 @@ namespace DCGO.CardEffects.BT16
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
- #region When Attacking / When Digivolving
|
|
|
- if (timing == EffectTiming.OnAllyAttack || timing == EffectTiming.OnEnterFieldAnyone)
|
|
|
+ #region When Attacking
|
|
|
+ if (timing == EffectTiming.OnAllyAttack)
|
|
|
{
|
|
|
ActivateClass activateClass = new ActivateClass();
|
|
|
activateClass.SetUpICardEffect("You may choose a Digimon. Delete that Digimon and 1 opponent Digimon with less or equal DP.", CanUseCondition, card);
|
|
|
@@ -48,7 +48,7 @@ namespace DCGO.CardEffects.BT16
|
|
|
|
|
|
string EffectDiscription()
|
|
|
{
|
|
|
- return "[When Digivolving] [When Attacking] You may choose 1 of your Digimon. Delete 1 of your opponent's Digimon with DP less than or equal to that Digimon's DP and your chosen Digimon.";
|
|
|
+ return "[When Attacking] You may choose 1 of your Digimon. Delete 1 of your opponent's Digimon with DP less than or equal to that Digimon's DP and your chosen Digimon.";
|
|
|
}
|
|
|
|
|
|
bool CanSelectYourPermanentCondition(Permanent permanent)
|
|
|
@@ -58,7 +58,7 @@ namespace DCGO.CardEffects.BT16
|
|
|
|
|
|
bool CanUseCondition(Hashtable hashtable)
|
|
|
{
|
|
|
- return CardEffectCommons.CanTriggerOnAttack(hashtable,card) || CardEffectCommons.CanTriggerWhenDigivolving(hashtable,card);
|
|
|
+ return CardEffectCommons.CanTriggerOnAttack(hashtable,card);
|
|
|
}
|
|
|
|
|
|
bool CanActivateCondition(Hashtable hashtable)
|
|
|
@@ -98,6 +98,7 @@ namespace DCGO.CardEffects.BT16
|
|
|
IEnumerator SelectPermanentCoroutine(Permanent permanent)
|
|
|
{
|
|
|
selectedPermanent = permanent;
|
|
|
+ List<Permanent> destroyTargetPermanents = new List<Permanent>{selectedPermanent};
|
|
|
|
|
|
bool CanSelectOpponentPermanentCondition(Permanent permanent)
|
|
|
{
|
|
|
@@ -140,17 +141,124 @@ namespace DCGO.CardEffects.BT16
|
|
|
{
|
|
|
permanentToDelete = permanent;
|
|
|
|
|
|
- List<Permanent> destroyTargetPermanents = new List<Permanent>
|
|
|
+ yield return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(new DestroyPermanentsClass(destroyTargetPermanents, CardEffectCommons.CardEffectHashtable(activateClass)).Destroy());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region When Digivolving
|
|
|
+ if (timing == EffectTiming.OnEnterFieldAnyone)
|
|
|
+ {
|
|
|
+ ActivateClass activateClass = new ActivateClass();
|
|
|
+ activateClass.SetUpICardEffect("You may choose a Digimon. Delete that Digimon and 1 opponent Digimon with less or equal DP.", CanUseCondition, card);
|
|
|
+ activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
|
|
|
+ cardEffects.Add(activateClass);
|
|
|
+
|
|
|
+ string EffectDiscription()
|
|
|
+ {
|
|
|
+ return "[When Digivolving] You may choose 1 of your Digimon. Delete 1 of your opponent's Digimon with DP less than or equal to that Digimon's DP and your chosen Digimon.";
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanSelectYourPermanentCondition(Permanent permanent)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanActivateCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ if (CardEffectCommons.IsExistOnBattleArea(card))
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ Permanent selectedPermanent = null;
|
|
|
+
|
|
|
+ int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectYourPermanentCondition));
|
|
|
+
|
|
|
+ SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
|
|
|
+
|
|
|
+ selectPermanentEffect.SetUp(
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ canTargetCondition: CanSelectYourPermanentCondition,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ maxCount: maxCount,
|
|
|
+ canNoSelect: true,
|
|
|
+ canEndNotMax: false,
|
|
|
+ selectPermanentCoroutine: SelectPermanentCoroutine,
|
|
|
+ afterSelectPermanentCoroutine: null,
|
|
|
+ mode: SelectPermanentEffect.Mode.Custom,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon.", "The opponent is selecting 1 Digimon.");
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
+
|
|
|
+ IEnumerator SelectPermanentCoroutine(Permanent permanent)
|
|
|
+ {
|
|
|
+ selectedPermanent = permanent;
|
|
|
+ List<Permanent> destroyTargetPermanents = new List<Permanent> { selectedPermanent };
|
|
|
+
|
|
|
+ bool CanSelectOpponentPermanentCondition(Permanent permanent)
|
|
|
+ {
|
|
|
+ if (CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card))
|
|
|
+ {
|
|
|
+ if (permanent.TopCard.HasDP && permanent.TopCard.CardDP <= selectedPermanent.DP)
|
|
|
{
|
|
|
- selectedPermanent,
|
|
|
- permanentToDelete
|
|
|
- };
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (CardEffectCommons.HasMatchConditionPermanent(CanSelectOpponentPermanentCondition))
|
|
|
+ {
|
|
|
+ Permanent permanentToDelete = null;
|
|
|
+
|
|
|
+ int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectOpponentPermanentCondition));
|
|
|
+
|
|
|
+ SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
|
|
|
+
|
|
|
+ selectPermanentEffect.SetUp(
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ canTargetCondition: CanSelectOpponentPermanentCondition,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ maxCount: maxCount,
|
|
|
+ canNoSelect: true,
|
|
|
+ canEndNotMax: false,
|
|
|
+ selectPermanentCoroutine: SelectPermanentToDeleteCoroutine,
|
|
|
+ afterSelectPermanentCoroutine: null,
|
|
|
+ mode: SelectPermanentEffect.Mode.Custom,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon to delete.", "The opponent is selecting 1 Digimon to delete.");
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
|
|
|
+
|
|
|
+ IEnumerator SelectPermanentToDeleteCoroutine(Permanent permanent)
|
|
|
+ {
|
|
|
+ permanentToDelete = permanent;
|
|
|
|
|
|
- yield return ContinuousController.instance.StartCoroutine(new DestroyPermanentsClass(destroyTargetPermanents, CardEffectCommons.CardEffectHashtable(activateClass)).Destroy());
|
|
|
+ yield return null;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- yield return null;
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(new DestroyPermanentsClass(destroyTargetPermanents, CardEffectCommons.CardEffectHashtable(activateClass)).Destroy());
|
|
|
}
|
|
|
}
|
|
|
}
|