|
|
@@ -0,0 +1,193 @@
|
|
|
+using System;
|
|
|
+using System.Collections;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Linq;
|
|
|
+
|
|
|
+namespace DCGO.CardEffects.BT18
|
|
|
+{
|
|
|
+ public class TakuyaKanbaraAndKojiMinamoto_BT18_088 : CEntity_Effect
|
|
|
+ {
|
|
|
+ public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
|
|
|
+ {
|
|
|
+ List<ICardEffect> cardEffects = new List<ICardEffect>();
|
|
|
+
|
|
|
+ #region Security Skill
|
|
|
+
|
|
|
+ if (timing == EffectTiming.SecuritySkill)
|
|
|
+ {
|
|
|
+ cardEffects.Add(CardEffectFactory.PlaySelfTamerSecurityEffect(card));
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region Start of Your Turn
|
|
|
+
|
|
|
+ if (timing == EffectTiming.OnStartTurn)
|
|
|
+ {
|
|
|
+ cardEffects.Add(CardEffectFactory.SetMemoryTo3TamerEffect(card));
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region Start of Your Main Phase
|
|
|
+
|
|
|
+ if (timing == EffectTiming.OnStartMainPhase)
|
|
|
+ {
|
|
|
+ ActivateClass activateClass = new ActivateClass();
|
|
|
+ activateClass.SetUpICardEffect("Place [Hybrid] trait cards from your trash under this Tamer", CanUseCondition, card);
|
|
|
+ activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
|
|
|
+ cardEffects.Add(activateClass);
|
|
|
+
|
|
|
+ string EffectDescription()
|
|
|
+ {
|
|
|
+ return
|
|
|
+ "[Start of Your Main Phase] You may place up to 1 [Hybrid] trait card with different names from your trash under this Tamer. For each of your other Tamers, add 2 to the maximum number this effect may place.";
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsExistOnBattleArea(card) &&
|
|
|
+ CardEffectCommons.IsOwnerTurn(card);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool HasHybridInTrait(CardSource cardSource)
|
|
|
+ {
|
|
|
+ return cardSource.HasHybridTenWarriorsTraits;
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanActivateCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsExistOnBattleArea(card) &&
|
|
|
+ CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, HasHybridInTrait);
|
|
|
+ }
|
|
|
+
|
|
|
+ IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ List<CardSource> selectedCards = new List<CardSource>();
|
|
|
+
|
|
|
+ int maxCount =
|
|
|
+ Math.Min(
|
|
|
+ 1 + 2 * card.Owner.GetFieldPermanents()
|
|
|
+ .Count(permanent => permanent != card.PermanentOfThisCard() && permanent.IsTamer),
|
|
|
+ CardEffectCommons.MatchConditionOwnersCardCountInTrash(card, HasHybridInTrait));
|
|
|
+
|
|
|
+ SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
+
|
|
|
+ selectCardEffect.SetUp(
|
|
|
+ canTargetCondition: HasHybridInTrait,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ canNoSelect: () => true,
|
|
|
+ selectCardCoroutine: SelectCardCoroutine,
|
|
|
+ afterSelectCardCoroutine: null,
|
|
|
+ message: "Select cards to place under your Tamer.",
|
|
|
+ maxCount: maxCount,
|
|
|
+ canEndNotMax: false,
|
|
|
+ isShowOpponent: true,
|
|
|
+ mode: SelectCardEffect.Mode.Custom,
|
|
|
+ root: SelectCardEffect.Root.Trash,
|
|
|
+ customRootCardList: null,
|
|
|
+ canLookReverseCard: true,
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ selectCardEffect.SetUpCustomMessage_ShowCard("Digivolution Card");
|
|
|
+ selectCardEffect.SetUpCustomMessage("Select 1 card to place under your Tamer.",
|
|
|
+ "The opponent is selecting 1 card to place under their Tamer.");
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
|
+
|
|
|
+ IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
+ {
|
|
|
+ selectedCards.Add(cardSource);
|
|
|
+
|
|
|
+ yield return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (selectedCards.Count >= 1)
|
|
|
+ {
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(card.PermanentOfThisCard()
|
|
|
+ .AddDigivolutionCardsBottom(selectedCards, activateClass));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region Rule Text
|
|
|
+
|
|
|
+ if (timing == EffectTiming.None)
|
|
|
+ {
|
|
|
+ ChangeCardNamesClass changeCardNamesClass = new ChangeCardNamesClass();
|
|
|
+ changeCardNamesClass.SetUpICardEffect("Also treated as [Takuya Kanbara]/[Koji Minamoto]", _ => true, card);
|
|
|
+ changeCardNamesClass.SetUpChangeCardNamesClass(changeCardNames: ChangeCardNames);
|
|
|
+ cardEffects.Add(changeCardNamesClass);
|
|
|
+
|
|
|
+ List<string> ChangeCardNames(CardSource cardSource, List<string> cardNames)
|
|
|
+ {
|
|
|
+ if (cardSource == card)
|
|
|
+ {
|
|
|
+ cardNames.Add("Takuya Kanbara");
|
|
|
+ cardNames.Add("TakuyaKanbara");
|
|
|
+ cardNames.Add("Koji Minamoto");
|
|
|
+ cardNames.Add("KojiMinamoto");
|
|
|
+ }
|
|
|
+
|
|
|
+ return cardNames;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region End of Your Turn
|
|
|
+
|
|
|
+ if (timing == EffectTiming.OnEndTurn)
|
|
|
+ {
|
|
|
+ ActivateClass activateClass = new ActivateClass();
|
|
|
+ activateClass.SetUpICardEffect("This Digimon can attack a player", CanUseCondition, card);
|
|
|
+ activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDescription());
|
|
|
+ activateClass.SetHashString("Attack_BT18_088");
|
|
|
+ cardEffects.Add(activateClass);
|
|
|
+
|
|
|
+ string EffectDescription()
|
|
|
+ {
|
|
|
+ return
|
|
|
+ "[End of Your Turn] (Once Per Turn) This Digimon with the [Hybrid]/[Ten Warriors] trait may attack a player.";
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsExistOnBattleArea(card) && CardEffectCommons.IsOwnerTurn(card);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanActivateCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsExistOnBattleArea(card) &&
|
|
|
+ card.PermanentOfThisCard().TopCard.HasHybridTenWarriorsTraits;
|
|
|
+ }
|
|
|
+
|
|
|
+ IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ Permanent thisPermanent = card.PermanentOfThisCard();
|
|
|
+
|
|
|
+ if (thisPermanent.CanAttack(activateClass))
|
|
|
+ {
|
|
|
+ SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent<SelectAttackEffect>();
|
|
|
+
|
|
|
+ selectAttackEffect.SetUp(
|
|
|
+ attacker: thisPermanent,
|
|
|
+ canAttackPlayerCondition: () => true,
|
|
|
+ defenderCondition: _ => false,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ return cardEffects;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|