| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340 |
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- // Shinegreymon: Burst Mode // Final Shining Burst
- namespace DCGO.CardEffects.BT25
- {
- public class BT25_104 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- #region Digimon Effects
- #region Alt Digivolution
- if (timing == EffectTiming.None)
- {
- bool PermanentCondition(Permanent permanent)
- {
- return permanent.TopCard.EqualsTraits("DATA SQUAD");
- }
- cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(PermanentCondition, 5, true, card, null, level: 6));
- }
- #endregion
- #region Burst Digivolution
- if (timing == EffectTiming.None)
- {
- AddBurstDigivolutionConditionClass addBurstDigivolutionConditionClass = new AddBurstDigivolutionConditionClass();
- addBurstDigivolutionConditionClass.SetUpICardEffect($"Burst Digivolution", CanUseCondition, card);
- addBurstDigivolutionConditionClass.SetUpAddBurstDigivolutionConditionClass(getBurstDigivolutionCondition: GetBurstDigivolution);
- addBurstDigivolutionConditionClass.SetNotShowUI(true);
- cardEffects.Add(addBurstDigivolutionConditionClass);
- bool CanUseCondition(Hashtable hashtable)
- {
- return true;
- }
- BurstDigivolutionCondition GetBurstDigivolution(CardSource cardSource)
- {
- if (cardSource == card)
- {
- bool tamerCondition(Permanent permanent)
- {
- return permanent != null
- && permanent.TopCard != null
- && permanent.TopCard.Owner == card.Owner
- && permanent.TopCard.Owner.GetBattleAreaPermanents().Contains(permanent)
- && !permanent.CannotReturnToHand(null)
- && permanent.TopCard.EqualsCardName("Marcus Damon");
- }
- bool digimonCondition(Permanent permanent)
- {
- return permanent != null
- && permanent.TopCard != null
- && permanent.TopCard.Owner == card.Owner
- && permanent.TopCard.Owner.GetFieldPermanents().Contains(permanent)
- && !card.CanNotEvolve(permanent)
- && permanent.TopCard.EqualsCardName("ShineGreymon");
- }
- BurstDigivolutionCondition burstDigivolutionCondition = new BurstDigivolutionCondition(
- tamerCondition: tamerCondition,
- selectTamerMessage: "1 [Marcus Damon]",
- digimonCondition: digimonCondition,
- selectDigimonMessage: "1 [ShineGreymon]",
- cost: 0);
- return burstDigivolutionCondition;
- }
- return null;
- }
- }
- #endregion
- #region Raid
- if (timing == EffectTiming.OnAllyAttack)
- {
- cardEffects.Add(CardEffectFactory.RaidSelfEffect(isInheritedEffect: false, card: card, condition: null));
- }
- #endregion
- #region Piercing
- if (timing == EffectTiming.OnDetermineDoSecurityCheck)
- {
- cardEffects.Add(CardEffectFactory.PierceSelfEffect(isInheritedEffect: false, card: card, condition: null));
- }
- #endregion
- #region Security Attack +1
- if (timing == EffectTiming.None)
- {
- cardEffects.Add(CardEffectFactory.ChangeSelfSAttackStaticEffect(changeValue: 1, isInheritedEffect: false, card: card, condition: null));
- }
- #endregion
- #region Blocker
- if (timing == EffectTiming.None)
- {
- cardEffects.Add(CardEffectFactory.BlockerSelfStaticEffect(isInheritedEffect: false, card: card, condition: null));
- }
- #endregion
- #region Barrier
- if (timing == EffectTiming.WhenPermanentWouldBeDeleted)
- {
- cardEffects.Add(CardEffectFactory.BarrierSelfEffect(false, card, null));
- }
- #endregion
- #region Shared WD / WA
- string SharedHashString = "BT25_104_WD_WA";
-
- string SharedEffectName = "As an option effect, 1 Enemy Digimon gets -15k DP, play 1 tamer.";
- string SharedEffectDescription(string tag) => $"[{tag}] [Once Per Turn] Activate 1 [Main] effect on this card's Option side.";
- IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
- {
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ActivateMainOfOptionSide(card, activateClass));
- }
- CardEffectFactory.ActivateClassesForSharedEffects
- (ref cardEffects, timing, card,
- SharedEffectName,
- SharedActivateCoroutine,
- SharedEffectDescription,
- optional: false,
- maxCountPerTurn: 1,
- hashValue: SharedHashString,
- whenDigivolving: true,
- whenAttacking: true);
- #endregion
- #region Your Turn
- //All your Marcus Damon
- bool IsMarcusDamon(Permanent permanent)
- {
- return CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card)
- && permanent.TopCard.EqualsCardName("Marcus Damon");
- }
- bool MakeDigimonCondition()
- {
- return CardEffectCommons.IsExistOnBattleArea(card)
- && CardEffectCommons.IsOwnerTurn(card);
- }
- IEnumerator MarcusActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
- {
- #region are also treated as Digimon
- TreatAsDigimonClass treatAsDigimonClass = CardEffectFactory.TreatAsDigimonStaticEffect(
- permanentCondition: IsMarcusDamon,
- isInheritedEffect: false,
- card: card,
- condition: MakeDigimonCondition);//Granted effect continues checking that Burst mode is on field and is idempotent, so does not have to be remove when it leaves play
- ICardEffect GetEffect(EffectTiming timing)
- {
- if (timing == EffectTiming.None)
- {
- return treatAsDigimonClass;
- }
- return null;
- }
- card.Owner.UntilEachTurnEndEffects.Add(GetEffect);
- #endregion
- yield return null;
- }
- if (timing == EffectTiming.OnMove) // For the gigachad that evoes into it in raising
- {
- ActivateClass activateClass = CardEffectFactory.WhenMovingClass(
- card,
- "[Marcus Damon] are treated as Digimon",
- MarcusActivateCoroutine,
- "[Marcus Damon] are treated as Digimon",
- false
- );
- activateClass.SetIsBackgroundProcess(true);//Run in background at start of your turn to add effect to player
- cardEffects.Add(activateClass);
- }
- if (timing == EffectTiming.OnStartTurn)
- {
- ActivateClass activateClass = CardEffectFactory.StartOfYourTurnClass(
- card,
- "[Marcus Damon] are treated as Digimon",
- MarcusActivateCoroutine,
- "[Marcus Damon] are treated as Digimon",
- false
- );
- activateClass.SetIsBackgroundProcess(true);//Run in background at start of your turn to add effect to player
- cardEffects.Add(activateClass);
- }
- //To anyone copying this effect: If this were not a dual card it would also need a matching On Play effect
- if(timing == EffectTiming.OnEnterFieldAnyone)
- {
- ActivateClass activateClass = CardEffectFactory.WhenDigivolvingClass(
- card,
- "[Marcus Damon] are treated as Digimon",
- MarcusActivateCoroutine,
- "[Marcus Damon] are treated as Digimon",
- false
- );
- activateClass.SetIsBackgroundProcess(true);//Run in background when digivolve into this to add effect to player
- cardEffects.Add(activateClass);
- }
- if (timing == EffectTiming.None)
- {
- #region with 12000 DP
- ChangeBaseDPClass changeBaseDPClass = CardEffectFactory.ChangeBaseDPGlobalEffect(
- permanentCondition: IsMarcusDamon,
- changeValue: 12000,
- isInheritedEffect: false,
- card: card,
- condition: MakeDigimonCondition);
- changeBaseDPClass.SetActivatedTime(card.Owner.TurnStartTime, card.ChangedLocationTime);
- cardEffects.Add(changeBaseDPClass);
- #endregion
- #region and gain Rush
- RushClass rushClass = CardEffectFactory.RushStaticEffect(
- permanentCondition: IsMarcusDamon,
- isInheritedEffect: false,
- card: card,
- condition: MakeDigimonCondition);
- cardEffects.Add(rushClass);
- #endregion
- }
- #endregion
- #endregion
-
- #region Option Effects
- #region Ignore Colour Requirement
- if (timing == EffectTiming.None)
- {
- cardEffects.Add(CardEffectFactory.UseRequirements(card, CardCondition));
- bool CardCondition(CardSource cardSource)
- {
- return cardSource.EqualsTraits("DATA SQUAD");
- }
- }
- #endregion
- #region Main
- if (timing == EffectTiming.OptionSkill)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect(SharedEffectName, CanUseCondition, card);
- activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
- cardEffects.Add(activateClass);
- string EffectDiscription()
- => "[Main] 1 of your opponent's Digimon gets -15000 DP for the turn. Then, you may play 1 Tamer card from your hand without paying the cost.";
- bool CanUseCondition(Hashtable hashtable)
- => CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
- bool CanSelectDPMinusPermanentCondition(Permanent permanent)
- => CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
- bool CanSelectTamerCondition(CardSource cardSource)
- {
- return cardSource.IsTamer
- && CardEffectCommons.CanPlayAsNewPermanent(cardSource, false, activateClass);
- }
- IEnumerator ActivateCoroutine(Hashtable _hashtable)
- {
- if (CardEffectCommons.HasMatchConditionOpponentsPermanent(card, CanSelectDPMinusPermanentCondition))
- {
- SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
- selectPermanentEffect.SetUp(
- selectPlayer: card.Owner,
- canTargetCondition: CanSelectDPMinusPermanentCondition,
- 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 DP -15000.", "The opponent is selecting 1 Digimon that will get DP -15000.");
- yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
- IEnumerator SelectPermanentCoroutine(Permanent permanent)
- {
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: -15000, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
- }
- }
- if (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectTamerCondition))
- {
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayByEffect(
- canTargetCondition: CanSelectTamerCondition,
- SelectCardEffect.Root.Hand,
- activateClass,
- payCost: false
- ));
- }
- }
- }
- #endregion
- #region Arts Digivolution
- if (timing == EffectTiming.None)
- {
- cardEffects.Add(CardEffectFactory.ArtsDigivolveEffect(card));
- }
- #endregion
- #endregion
- return cardEffects;
- }
- }
- }
|