|
|
@@ -9,34 +9,336 @@ namespace DCGO.CardEffects.LM
|
|
|
{
|
|
|
List<ICardEffect> cardEffects = new List<ICardEffect>();
|
|
|
|
|
|
+ #region Alternate Digivolution
|
|
|
+
|
|
|
if (timing == EffectTiming.None)
|
|
|
+ {
|
|
|
+ bool PermanentCondition(Permanent targetPermanent)
|
|
|
+ {
|
|
|
+ return targetPermanent.TopCard.EqualsCardName("Sakuyamon");
|
|
|
+ }
|
|
|
+
|
|
|
+ cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition,
|
|
|
+ digivolutionCost: 1, ignoreDigivolutionRequirement: true, 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 CanSelectCardConditionShared(CardSource cardSource)
|
|
|
+ {
|
|
|
+ return (cardSource.IsTamer && cardSource.CardColors.Contains(CardColor.Yellow)) ||
|
|
|
+ (cardSource.IsOption && cardSource.CardColors.Count == 1 && cardSource.GetCostItself <= 5);
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region On Play
|
|
|
+
|
|
|
+ if (timing == EffectTiming.OnEnterFieldAnyone)
|
|
|
+ {
|
|
|
+ ActivateClass activateClass = new ActivateClass();
|
|
|
+ activateClass.SetUpICardEffect("Place 1 card from your hand on top of your security stack", CanUseCondition, card);
|
|
|
+ activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
|
|
|
+ cardEffects.Add(activateClass);
|
|
|
+
|
|
|
+ string EffectDescription()
|
|
|
+ {
|
|
|
+ return
|
|
|
+ "[On Play] You may place 1 yellow Tamer card or 1-color Option card with a cost of 5 or less from your hand on top of your security stack.";
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanActivateCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
|
|
|
+ CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardConditionShared) &&
|
|
|
+ card.Owner.CanAddSecurity(activateClass);
|
|
|
+ }
|
|
|
+
|
|
|
+ IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ List<CardSource> selectedCards = new List<CardSource>();
|
|
|
+
|
|
|
+ SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
|
|
|
+
|
|
|
+ selectHandEffect.SetUp(
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ canTargetCondition: CanSelectCardConditionShared,
|
|
|
+ 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 place at the top of security.",
|
|
|
+ "The opponent is selecting 1 card to place at the top of security.");
|
|
|
+ selectHandEffect.SetUpCustomMessage_ShowCard("Security Top Card");
|
|
|
+
|
|
|
+ yield return StartCoroutine(selectHandEffect.Activate());
|
|
|
+
|
|
|
+ IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
+ {
|
|
|
+ selectedCards.Add(cardSource);
|
|
|
+
|
|
|
+ yield return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ foreach (CardSource cardSource in selectedCards)
|
|
|
+ {
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(
|
|
|
+ CardObjectController.AddSecurityCard(cardSource, toTop: true));
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>()
|
|
|
+ .CreateRecoveryEffect(cardSource.Owner));
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(new IAddSecurity(cardSource.Owner).AddSecurity());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region When Digivolving
|
|
|
+
|
|
|
+ if (timing == EffectTiming.OnEnterFieldAnyone)
|
|
|
+ {
|
|
|
+ ActivateClass activateClass = new ActivateClass();
|
|
|
+ activateClass.SetUpICardEffect("Place 1 card from your hand on top of your security stack", CanUseCondition, card);
|
|
|
+ activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
|
|
|
+ cardEffects.Add(activateClass);
|
|
|
+
|
|
|
+ string EffectDescription()
|
|
|
+ {
|
|
|
+ return
|
|
|
+ "[When Digivolving] You may place 1 yellow Tamer card or 1-color Option card with a cost of 5 or less from your hand on top of your security stack.";
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanActivateCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
|
|
|
+ CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectCardConditionShared) &&
|
|
|
+ card.Owner.CanAddSecurity(activateClass);
|
|
|
+ }
|
|
|
+
|
|
|
+ IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ List<CardSource> selectedCards = new List<CardSource>();
|
|
|
+
|
|
|
+ SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
|
|
|
+
|
|
|
+ selectHandEffect.SetUp(
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ canTargetCondition: CanSelectCardConditionShared,
|
|
|
+ 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 place at the top of security.",
|
|
|
+ "The opponent is selecting 1 card to place at the top of security.");
|
|
|
+ selectHandEffect.SetUpCustomMessage_ShowCard("Security Top Card");
|
|
|
+
|
|
|
+ yield return StartCoroutine(selectHandEffect.Activate());
|
|
|
+
|
|
|
+ IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
+ {
|
|
|
+ selectedCards.Add(cardSource);
|
|
|
+
|
|
|
+ yield return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ foreach (CardSource cardSource in selectedCards)
|
|
|
+ {
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(
|
|
|
+ CardObjectController.AddSecurityCard(cardSource, toTop: true));
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>()
|
|
|
+ .CreateRecoveryEffect(cardSource.Owner));
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(new IAddSecurity(cardSource.Owner).AddSecurity());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region All Turns
|
|
|
+
|
|
|
+ if (timing == EffectTiming.OnUseOption)
|
|
|
{
|
|
|
ActivateClass activateClass = new ActivateClass();
|
|
|
- activateClass.SetUpICardEffect("", CanUseCondition, card);
|
|
|
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
|
|
|
+ activateClass.SetUpICardEffect("1 of your opponent’s Digimon gets -6000 DP for the turn", CanUseCondition, card);
|
|
|
+ activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
|
|
|
+ activateClass.SetHashString("AllTurns_LM_023");
|
|
|
cardEffects.Add(activateClass);
|
|
|
|
|
|
- string EffectDiscription()
|
|
|
+ string EffectDescription()
|
|
|
{
|
|
|
- return "";
|
|
|
+ return
|
|
|
+ "[All Turns] (Once Per Turn) When an Option card is used, or when a card is added to a security stack, 1 of your opponent’s Digimon gets -6000 DP for the turn.";
|
|
|
}
|
|
|
|
|
|
bool CanUseCondition(Hashtable hashtable)
|
|
|
{
|
|
|
- return true;
|
|
|
+ return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
|
|
|
+ CardEffectCommons.CanTriggerWhenOwnerUseOption(hashtable, null, null, card);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanSelectPermanentCondition(Permanent permanent)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
|
|
|
}
|
|
|
|
|
|
bool CanActivateCondition(Hashtable hashtable)
|
|
|
{
|
|
|
- return true;
|
|
|
+ return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
|
|
|
+ CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition);
|
|
|
}
|
|
|
|
|
|
IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
{
|
|
|
- yield return null;
|
|
|
+ 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 DP -6000.",
|
|
|
+ "The opponent is selecting 1 Digimon that will get DP -6000.");
|
|
|
+
|
|
|
+ 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.ChangeDigimonDP(
|
|
|
+ targetPermanent: selectedPermanent, changeValue: -6000, effectDuration: EffectDuration.UntilEachTurnEnd,
|
|
|
+ activateClass: activateClass));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (timing == EffectTiming.OnAddSecurity)
|
|
|
+ {
|
|
|
+ ActivateClass activateClass = new ActivateClass();
|
|
|
+ activateClass.SetUpICardEffect("1 of your opponent’s Digimon gets -6000 DP for the turn", CanUseCondition, card);
|
|
|
+ activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, false, EffectDescription());
|
|
|
+ activateClass.SetHashString("AllTurns_LM_023");
|
|
|
+ cardEffects.Add(activateClass);
|
|
|
+
|
|
|
+ string EffectDescription()
|
|
|
+ {
|
|
|
+ return
|
|
|
+ "[All Turns] (Once Per Turn) When an Option card is used, or when a card is added to a security stack, 1 of your opponent’s Digimon gets -6000 DP for the turn.";
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
|
|
|
+ CardEffectCommons.CanTriggerWhenAddSecurity(hashtable, null);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanSelectPermanentCondition(Permanent permanent)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanActivateCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
|
|
|
+ CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition);
|
|
|
+ }
|
|
|
+
|
|
|
+ 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 DP -6000.",
|
|
|
+ "The opponent is selecting 1 Digimon that will get DP -6000.");
|
|
|
+
|
|
|
+ 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.ChangeDigimonDP(
|
|
|
+ targetPermanent: selectedPermanent, changeValue: -6000, effectDuration: EffectDuration.UntilEachTurnEnd,
|
|
|
+ activateClass: activateClass));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
return cardEffects;
|
|
|
}
|
|
|
}
|