| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- namespace DCGO.CardEffects.EX8
- {
- public class HerculesKabuterimonAce_EX8_044 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region Alternate Digivolution
- if (timing == EffectTiming.None)
- {
- bool PermanentCondition(Permanent targetPermanent)
- {
- return targetPermanent.TopCard.IsLevel5 && targetPermanent.TopCard.EqualsTraits("NSp");
- }
- cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
- permanentCondition: PermanentCondition,
- digivolutionCost: 3,
- ignoreDigivolutionRequirement: false,
- card: card,
- condition: null)
- );
- }
- #endregion
- #region Ace - Blast Digivolve
- if (timing == EffectTiming.OnCounterTiming)
- {
- cardEffects.Add(CardEffectFactory.BlastDigivolveEffect(card: card, condition: null));
- }
- #endregion
- #region On Play/ When Digivolving Shared
- bool CanSelectPermanentConditionShared(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(permanent);
- }
- bool CanActivateConditionShared(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
- }
- #endregion
- #region On Play
- if (timing == EffectTiming.OnEnterFieldAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Suspend 3 Digimon", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateConditionShared, ActivateCoroutine, -1, false, EffectDescription());
- cardEffects.Add(activateClass);
- string EffectDescription()
- {
- return
- "[On Play] You may suspend up to 3 Digimon. For each of your opponent's Digimon suspended by this effect, gain 1 memory.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CanSelectPermanentConditionShared,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: Math.Min(3, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentConditionShared)),
- canNoSelect: true,
- canEndNotMax: true,
- selectPermanentCoroutine: null,
- afterSelectPermanentCoroutine: AfterSelectPermanentCoroutine,
- mode: SelectPermanentEffect.Mode.Custom,
- cardEffect: activateClass);
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- IEnumerator AfterSelectPermanentCoroutine(List<Permanent> permanents)
- {
- foreach (var selectedPermanent in permanents.Where(selectedPermanent =>
- selectedPermanent != null &&
- selectedPermanent.TopCard &&
- !selectedPermanent.TopCard.CanNotBeAffected(activateClass) &&
- !selectedPermanent.IsSuspended && selectedPermanent.CanSuspend))
- {
- yield return ContinuousController.instance.StartCoroutine(
- new SuspendPermanentsClass(new List<Permanent>() { selectedPermanent },
- CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
- if (selectedPermanent.IsSuspended && CardEffectCommons.IsOpponentPermanent(selectedPermanent, card))
- {
- yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
- }
- }
- }
- }
- }
- #endregion
- #region When Digivolving
- if (timing == EffectTiming.OnEnterFieldAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Suspend 3 Digimon", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateConditionShared, ActivateCoroutine, -1, false, EffectDescription());
- cardEffects.Add(activateClass);
- string EffectDescription()
- {
- return
- "[When Digivolving] You may suspend up to 3 Digimon. For each of your opponent's Digimon suspended by this effect, gain 1 memory.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CanSelectPermanentConditionShared,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: Math.Min(3, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentConditionShared)),
- canNoSelect: true,
- canEndNotMax: true,
- selectPermanentCoroutine: null,
- afterSelectPermanentCoroutine: AfterSelectPermanentCoroutine,
- mode: SelectPermanentEffect.Mode.Custom,
- cardEffect: activateClass);
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- IEnumerator AfterSelectPermanentCoroutine(List<Permanent> permanents)
- {
- foreach (var selectedPermanent in permanents.Where(selectedPermanent =>
- selectedPermanent != null &&
- selectedPermanent.TopCard &&
- !selectedPermanent.TopCard.CanNotBeAffected(activateClass) &&
- !selectedPermanent.IsSuspended && selectedPermanent.CanSuspend))
- {
- yield return ContinuousController.instance.StartCoroutine(
- new SuspendPermanentsClass(new List<Permanent>() { selectedPermanent },
- CardEffectCommons.CardEffectHashtable(activateClass)).Tap());
- if (selectedPermanent.IsSuspended && CardEffectCommons.IsOpponentPermanent(selectedPermanent, card))
- {
- yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
- }
- }
- }
- }
- }
- #endregion
- #region All Turns
- if (timing == EffectTiming.OnTappedAnyone)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Give 1 of your Digimon Piercing and +3000 DP.", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
- activateClass.SetHashString("Buff_EX8_044");
- cardEffects.Add(activateClass);
- string EffectDescription()
- {
- return
- "[All Turns] (Once Per Turn) When this Digimon becomes suspended, 1 of your Digimon gains <Piercing> and gets +3000 DP until the end of your opponent's turn.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerWhenSelfPermanentSuspends(hashtable, card);
- }
- bool CanSelectPermanentCondition(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- return CardEffectCommons.IsExistOnBattleAreaDigimon(card);
- }
- IEnumerator ActivateCoroutine(Hashtable hashtable)
- {
- Permanent selectedPermanent = null;
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CanSelectPermanentCondition,
- canTargetCondition_ByPreSelecetedList: null,
- canEndSelectCondition: null,
- maxCount: 1,
- canNoSelect: false,
- canEndNotMax: false,
- selectPermanentCoroutine: SelectPermanentCoroutine,
- afterSelectPermanentCoroutine: null,
- mode: SelectPermanentEffect.Mode.Custom,
- cardEffect: activateClass);
- selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get Piercing and +3000 DP.",
- "The opponent is selecting 1 Digimon that will get Piercing and +3000 DP.");
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- IEnumerator SelectPermanentCoroutine(Permanent permanent)
- {
- selectedPermanent = permanent;
- yield return null;
- }
- if (selectedPermanent != null)
- {
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainPierce(
- targetPermanent: selectedPermanent,
- effectDuration: EffectDuration.UntilOpponentTurnEnd,
- activateClass: activateClass));
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(
- targetPermanent: selectedPermanent,
- changeValue: 3000,
- effectDuration: EffectDuration.UntilOpponentTurnEnd,
- activateClass: activateClass));
- }
- }
- }
- #endregion
- return cardEffects;
- }
- }
- }
|