|
|
@@ -0,0 +1,192 @@
|
|
|
+using System.Collections;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Linq;
|
|
|
+
|
|
|
+namespace DCGO.CardEffects.ST19
|
|
|
+{
|
|
|
+ public class ShoeShoemon_ST19_08 : CEntity_Effect
|
|
|
+ {
|
|
|
+ public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
|
|
|
+ {
|
|
|
+ List<ICardEffect> cardEffects = new List<ICardEffect>();
|
|
|
+
|
|
|
+ #region Security Effect
|
|
|
+
|
|
|
+ if (timing == EffectTiming.SecuritySkill)
|
|
|
+ {
|
|
|
+ ActivateClass activateClass = new ActivateClass();
|
|
|
+ activateClass.SetUpICardEffect("Play a Digimon from your hand or trash.", CanUseCondition, card);
|
|
|
+ activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
|
|
|
+ activateClass.SetHashString("PlayDigimon_ST187_08");
|
|
|
+ cardEffects.Add(activateClass);
|
|
|
+
|
|
|
+ string EffectDescription()
|
|
|
+ {
|
|
|
+ return
|
|
|
+ "[Security] You may play 1 card with the [LIBERATOR] trait and a play cost of 4 or less from your hand or trash without paying the cost.";
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.CanTriggerSecurityEffect(hashtable, card);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanActivateCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsExistOnExecutingArea(card);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanSelectCardCondition(CardSource cardSource)
|
|
|
+ {
|
|
|
+ return (cardSource.ContainsTraits("Liberator") || cardSource.ContainsTraits("LIBERATOR")) &&
|
|
|
+ cardSource.HasPlayCost && cardSource.GetCostItself <= 4;
|
|
|
+ }
|
|
|
+
|
|
|
+ IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ bool canSelectHand = CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardCondition);
|
|
|
+ bool canSelectTrash = CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectCardCondition);
|
|
|
+
|
|
|
+ if (canSelectHand || canSelectTrash)
|
|
|
+ {
|
|
|
+ if (canSelectHand && canSelectTrash)
|
|
|
+ {
|
|
|
+ List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
|
|
|
+ {
|
|
|
+ new(message: $"From hand", value: true, spriteIndex: 0),
|
|
|
+ new(message: $"From trash", value: false, spriteIndex: 1),
|
|
|
+ };
|
|
|
+
|
|
|
+ string selectPlayerMessage = "From which area do you play a card?";
|
|
|
+ string notSelectPlayerMessage = "The opponent is choosing from which area to play a card.";
|
|
|
+
|
|
|
+ GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements,
|
|
|
+ selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage,
|
|
|
+ notSelectPlayerMessage: notSelectPlayerMessage);
|
|
|
+ }
|
|
|
+
|
|
|
+ else
|
|
|
+ {
|
|
|
+ GManager.instance.userSelectionManager.SetBool(canSelectHand);
|
|
|
+ }
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager
|
|
|
+ .WaitForEndSelect());
|
|
|
+
|
|
|
+ bool fromHand = GManager.instance.userSelectionManager.SelectedBoolValue;
|
|
|
+
|
|
|
+ List<CardSource> selectedCards = new List<CardSource>();
|
|
|
+
|
|
|
+ IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
+ {
|
|
|
+ selectedCards.Add(cardSource);
|
|
|
+
|
|
|
+ yield return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (fromHand)
|
|
|
+ {
|
|
|
+ SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
|
|
|
+
|
|
|
+ selectHandEffect.SetUp(
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ canTargetCondition: CanSelectCardCondition,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ maxCount: 1,
|
|
|
+ canNoSelect: true,
|
|
|
+ canEndNotMax: false,
|
|
|
+ isShowOpponent: true,
|
|
|
+ selectCardCoroutine: SelectCardCoroutine,
|
|
|
+ afterSelectCardCoroutine: null,
|
|
|
+ mode: SelectHandEffect.Mode.Custom,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ selectHandEffect.SetUpCustomMessage("Select 1 card to play.", "The opponent is selecting 1 card to play.");
|
|
|
+ selectHandEffect.SetUpCustomMessage_ShowCard("Played Card");
|
|
|
+
|
|
|
+ yield return StartCoroutine(selectHandEffect.Activate());
|
|
|
+ }
|
|
|
+
|
|
|
+ else
|
|
|
+ {
|
|
|
+ SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
+
|
|
|
+ selectCardEffect.SetUp(
|
|
|
+ canTargetCondition: CanSelectCardCondition,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ canNoSelect: () => true,
|
|
|
+ selectCardCoroutine: SelectCardCoroutine,
|
|
|
+ afterSelectCardCoroutine: null,
|
|
|
+ message: "Select 1 card to play.",
|
|
|
+ maxCount: 1,
|
|
|
+ canEndNotMax: false,
|
|
|
+ isShowOpponent: true,
|
|
|
+ mode: SelectCardEffect.Mode.Custom,
|
|
|
+ root: SelectCardEffect.Root.Custom,
|
|
|
+ customRootCardList: card.Owner.TrashCards,
|
|
|
+ canLookReverseCard: true,
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ selectCardEffect.SetUpCustomMessage("Select 1 trash card to play.",
|
|
|
+ "The opponent is selecting 1 trash card to play.");
|
|
|
+ selectCardEffect.SetUpCustomMessage_ShowCard("Played Card");
|
|
|
+
|
|
|
+ yield return StartCoroutine(selectCardEffect.Activate());
|
|
|
+ }
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
|
|
|
+ cardSources: selectedCards,
|
|
|
+ activateClass: activateClass,
|
|
|
+ payCost: false,
|
|
|
+ isTapped: false,
|
|
|
+ root: fromHand ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash,
|
|
|
+ activateETB: true));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region Overclock
|
|
|
+
|
|
|
+ if (timing == EffectTiming.OnEndTurn)
|
|
|
+ {
|
|
|
+ cardEffects.Add(CardEffectFactory.OverclockSelfEffect(trait: "Puppet", isInheritedEffect: false, card: card,
|
|
|
+ condition: null));
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region Your Turn - ESS
|
|
|
+
|
|
|
+ if (timing == EffectTiming.None)
|
|
|
+ {
|
|
|
+ bool CardCondition(CardSource cardSource)
|
|
|
+ {
|
|
|
+ return cardSource.Owner == card.Owner.Enemy;
|
|
|
+ }
|
|
|
+
|
|
|
+ bool Condition()
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
|
|
|
+ CardEffectCommons.IsOwnerTurn(card);
|
|
|
+ }
|
|
|
+
|
|
|
+ cardEffects.Add(CardEffectFactory.ChangeSecurityDigimonCardDPStaticEffect(
|
|
|
+ cardCondition: CardCondition,
|
|
|
+ changeValue: -3000,
|
|
|
+ isInheritedEffect: true,
|
|
|
+ card: card,
|
|
|
+ condition: Condition,
|
|
|
+ effectName: "Opponent's Security Digimon gains DP -3000"));
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ return cardEffects;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|