|
|
@@ -258,167 +258,10 @@ namespace DCGO.CardEffects.BT23
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- #region Security
|
|
|
+ #region Security Effect
|
|
|
if (timing == EffectTiming.SecuritySkill)
|
|
|
{
|
|
|
- // Ugh, I don't like doing this, but I think in order to delete the digimon played after the security battle, I have to be able to
|
|
|
- // activate the deletion effect from within the ActivateCoroutine of the function. Instead of calling CardEffectFactory.PlaySelfDigimonAfterBattleSecurityEffect,
|
|
|
- // I need to copy the code from that function here, then modify the necessary sections...
|
|
|
- ActivateClass activateClass = new ActivateClass();
|
|
|
- activateClass.SetUpICardEffect("Play this card at the end of the battle", CanUseCondition, card);
|
|
|
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
|
|
|
- activateClass.SetIsSecurityEffect(true);
|
|
|
-
|
|
|
- string EffectDiscription()
|
|
|
- {
|
|
|
- return "[Security] At the end of the battle, play this card without paying its memory cost.";
|
|
|
- }
|
|
|
-
|
|
|
- bool CanUseCondition(Hashtable hashtable)
|
|
|
- {
|
|
|
- return CardEffectCommons.CanTriggerSecurityEffect(hashtable, card);
|
|
|
- }
|
|
|
-
|
|
|
- bool CanActivateCondition(Hashtable hashtable)
|
|
|
- {
|
|
|
- if (CardEffectCommons.IsExistOnExecutingArea(card))
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- IEnumerator ActivateCoroutine(Hashtable _hashtable)
|
|
|
- {
|
|
|
- yield return null;
|
|
|
-
|
|
|
- ContinuousController.instance.PlaySE(GManager.instance.GetComponent<Effects>().BuffSE);
|
|
|
-
|
|
|
- ActivateClass activateClass1 = new ActivateClass();
|
|
|
- activateClass1.SetUpICardEffect("Play this card", CanUseCondition1, card);
|
|
|
- activateClass1.SetUpActivateClass(CanActivateCondition1, ActivateCoroutine1, -1, false, EffectDiscription1());
|
|
|
- card.Owner.UntilEndBattleEffects.Add(GetCardEffect1);
|
|
|
-
|
|
|
- string EffectDiscription1()
|
|
|
- {
|
|
|
- return "Play this card without paying its memory cost.";
|
|
|
- }
|
|
|
-
|
|
|
- bool CanUseCondition1(Hashtable hashtable)
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- bool CanActivateCondition1(Hashtable hashtable)
|
|
|
- {
|
|
|
- if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: card, payCost: false, cardEffect: activateClass1, root: SelectCardEffect.Root.Security))
|
|
|
- {
|
|
|
- if (!card.Owner.LibraryCards.Contains(card) && !card.Owner.SecurityCards.Contains(card))
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- ICardEffect GetCardEffect1(EffectTiming _timing)
|
|
|
- {
|
|
|
- if (_timing == EffectTiming.OnEndBattle)
|
|
|
- {
|
|
|
- return activateClass1;
|
|
|
- }
|
|
|
-
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- IEnumerator ActivateCoroutine1(Hashtable _hashtable1)
|
|
|
- {
|
|
|
- if (CardEffectCommons.CanPlayAsNewPermanent(cardSource: card, payCost: false, cardEffect: activateClass1, root: SelectCardEffect.Root.Security))
|
|
|
- {
|
|
|
- if (!card.Owner.LibraryCards.Contains(card) && !card.Owner.SecurityCards.Contains(card))
|
|
|
- {
|
|
|
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
|
|
|
- cardSources: new List<CardSource>() { card },
|
|
|
- activateClass: activateClass1,
|
|
|
- payCost: false,
|
|
|
- isTapped: false,
|
|
|
- root: SelectCardEffect.Root.Security,
|
|
|
- activateETB: true));
|
|
|
-
|
|
|
- #region Delete Played Digimon
|
|
|
- Permanent selectedPermanent = card.PermanentOfThisCard();
|
|
|
-
|
|
|
- ActivateClass activateClassDeleteSelf = new ActivateClass();
|
|
|
- activateClassDeleteSelf.SetUpICardEffect("Delete this Digimon", CanUseDeleteSelfCondition, selectedPermanent.TopCard);
|
|
|
- activateClassDeleteSelf.SetUpActivateClass(CanActivateDeleteSelfCondition, ActivateDeleteSelfCoroutine, -1, false, EffectDiscription2());
|
|
|
- activateClassDeleteSelf.SetEffectSourcePermanent(selectedPermanent);
|
|
|
- selectedPermanent.UntilOwnerTurnEndEffects.Add(GetDeleteSelfCardEffect);
|
|
|
-
|
|
|
- if (!selectedPermanent.TopCard.CanNotBeAffected(activateClass1))
|
|
|
- {
|
|
|
- yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateDebuffEffect(selectedPermanent));
|
|
|
- }
|
|
|
-
|
|
|
- string EffectDiscription2()
|
|
|
- {
|
|
|
- return "[End of Your Turn] Delete this Digimon.";
|
|
|
- }
|
|
|
-
|
|
|
- bool CanUseDeleteSelfCondition(Hashtable hashtable2)
|
|
|
- {
|
|
|
- if (CardEffectCommons.IsOpponentTurn(card))
|
|
|
- {
|
|
|
- if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(selectedPermanent, selectedPermanent.TopCard))
|
|
|
- {
|
|
|
- if (CardEffectCommons.CanTriggerOnEndAttack(hashtable2, selectedPermanent.TopCard))
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- bool CanActivateDeleteSelfCondition(Hashtable hashtable2)
|
|
|
- {
|
|
|
- if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent))
|
|
|
- {
|
|
|
- if (!selectedPermanent.TopCard.CanNotBeAffected(activateClass1))
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- IEnumerator ActivateDeleteSelfCoroutine(Hashtable _hashtable2)
|
|
|
- {
|
|
|
- if (CardEffectCommons.IsPermanentExistsOnBattleArea(selectedPermanent))
|
|
|
- {
|
|
|
- yield return ContinuousController.instance.StartCoroutine(new DestroyPermanentsClass(
|
|
|
- new List<Permanent>() { selectedPermanent },
|
|
|
- CardEffectCommons.CardEffectHashtable(activateClassDeleteSelf)).Destroy());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- ICardEffect GetDeleteSelfCardEffect(EffectTiming _timing)
|
|
|
- {
|
|
|
- if (_timing == EffectTiming.OnEndTurn)
|
|
|
- {
|
|
|
- return activateClassDeleteSelf;
|
|
|
- }
|
|
|
-
|
|
|
- return null;
|
|
|
- }
|
|
|
- #endregion
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ cardEffects.Add(CardEffectFactory.PlaySelfDigimonAfterBattleSecurityEffect(card: card));
|
|
|
}
|
|
|
#endregion
|
|
|
|