|
|
@@ -23,121 +23,117 @@ namespace DCGO.CardEffects.ST24
|
|
|
&& (permanent.IsDigimon || permanent.IsTamer);
|
|
|
}
|
|
|
}
|
|
|
- #endregion
|
|
|
-
|
|
|
- #region Main/Security Shared
|
|
|
- string SharedEffectName = "Play 1 [DATA SQUAD] card with a play cost of 4 or less from hand or trash for free, place this card in battle area";
|
|
|
+ #endregion
|
|
|
|
|
|
- string SharedEffectDescription(string tag) => $"[{tag}] You may play 1 [DATA SQUAD] trait card with a play cost of 4 or less from your hand or trash without paying the cost. Then, place this card in the battle area.";
|
|
|
-
|
|
|
- IEnumerator SharedActivateCoroutine(Hashtable hashtable, ActivateClass activateClass)
|
|
|
+ #region Main
|
|
|
+ if (timing == EffectTiming.OptionSkill)
|
|
|
{
|
|
|
- bool CanSelectPlayCondition(CardSource cardSource)
|
|
|
+ ActivateClass activateClass = new ActivateClass();
|
|
|
+ activateClass.SetUpICardEffect("Play 1 [DATA SQUAD] card with a play cost of 4 or less from hand or trash for free, place this card in battle area", CanUseCondition, card);
|
|
|
+ activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDescription());
|
|
|
+ cardEffects.Add(activateClass);
|
|
|
+
|
|
|
+ string EffectDescription()
|
|
|
{
|
|
|
- return (cardSource.IsDigimon
|
|
|
- || cardSource.IsTamer)
|
|
|
- && cardSource.EqualsTraits("DATA SQUAD")
|
|
|
- && cardSource.GetCostItself <= 4
|
|
|
- && CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass);
|
|
|
+ return "[Main] You may play 1 [DATA SQUAD] trait card with a play cost of 4 or less from your hand or trash without paying the cost. Then, place this card in the battle area.";
|
|
|
}
|
|
|
|
|
|
- bool canSelectHand = CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectPlayCondition);
|
|
|
- bool canSelectTrash = CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectPlayCondition);
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
|
|
|
+ }
|
|
|
|
|
|
- if (canSelectHand || canSelectTrash)
|
|
|
+ IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
{
|
|
|
- #region Setup Location Selection
|
|
|
- List<SelectionElement<int>> selectionElements = new List<SelectionElement<int>>();
|
|
|
- if (canSelectHand)
|
|
|
- {
|
|
|
- selectionElements.Add(new(message: $"From hand", value: 1, spriteIndex: 0));
|
|
|
- }
|
|
|
- if (canSelectTrash)
|
|
|
+ bool CanSelectPlayCondition(CardSource cardSource)
|
|
|
{
|
|
|
- selectionElements.Add(new(message: $"From trash", value: 2, spriteIndex: 0));
|
|
|
+ return (cardSource.IsDigimon
|
|
|
+ || cardSource.IsTamer)
|
|
|
+ && cardSource.HasPlayCost
|
|
|
+ && cardSource.EqualsTraits("DATA SQUAD")
|
|
|
+ && cardSource.GetCostItself <= 4
|
|
|
+ && CardEffectCommons.CanPlayAsNewPermanent(cardSource: cardSource, payCost: false, cardEffect: activateClass);
|
|
|
}
|
|
|
- selectionElements.Add(new(message: $"Do not play", value: 3, spriteIndex: 1));
|
|
|
-
|
|
|
- string selectPlayerMessage = "From which area do you select a card?";
|
|
|
- string notSelectPlayerMessage = "The opponent is choosing from which area to select a card.";
|
|
|
-
|
|
|
- GManager.instance.userSelectionManager.SetIntSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
|
|
|
-
|
|
|
- yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
|
|
|
- #endregion
|
|
|
|
|
|
- bool doPlay = GManager.instance.userSelectionManager.SelectedIntValue != 3;
|
|
|
- bool fromHand = GManager.instance.userSelectionManager.SelectedIntValue == 1;
|
|
|
+ bool canSelectHand = CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectPlayCondition);
|
|
|
+ bool canSelectTrash = CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectPlayCondition);
|
|
|
|
|
|
- if (doPlay)
|
|
|
+ if (canSelectHand || canSelectTrash)
|
|
|
{
|
|
|
- #region Hand/Trash Card Selection & Play
|
|
|
- if (fromHand)
|
|
|
+ #region Setup Location Selection
|
|
|
+ List<SelectionElement<int>> selectionElements = new List<SelectionElement<int>>();
|
|
|
+ if (canSelectHand)
|
|
|
{
|
|
|
- SelectHandEffect selectHandEffect2 = GManager.instance.GetComponent<SelectHandEffect>();
|
|
|
-
|
|
|
- selectHandEffect2.SetUp(
|
|
|
- selectPlayer: card.Owner,
|
|
|
- canTargetCondition: CanSelectPlayCondition,
|
|
|
- canTargetCondition_ByPreSelecetedList: null,
|
|
|
- canEndSelectCondition: null,
|
|
|
- maxCount: 1,
|
|
|
- canNoSelect: true,
|
|
|
- canEndNotMax: false,
|
|
|
- isShowOpponent: true,
|
|
|
- selectCardCoroutine: null,
|
|
|
- afterSelectCardCoroutine: null,
|
|
|
- mode: SelectHandEffect.Mode.PlayForFree,
|
|
|
- cardEffect: activateClass);
|
|
|
-
|
|
|
- yield return StartCoroutine(selectHandEffect2.Activate());
|
|
|
+ selectionElements.Add(new(message: $"From hand", value: 1, spriteIndex: 0));
|
|
|
}
|
|
|
- else
|
|
|
+ if (canSelectTrash)
|
|
|
{
|
|
|
- SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
-
|
|
|
- selectCardEffect.SetUp(
|
|
|
- canTargetCondition: CanSelectPlayCondition,
|
|
|
- canTargetCondition_ByPreSelecetedList: null,
|
|
|
- canEndSelectCondition: null,
|
|
|
- canNoSelect: () => true,
|
|
|
- selectCardCoroutine: null,
|
|
|
- afterSelectCardCoroutine: null,
|
|
|
- message: "Select 1 card to play.",
|
|
|
- maxCount: 1,
|
|
|
- canEndNotMax: false,
|
|
|
- isShowOpponent: true,
|
|
|
- mode: SelectCardEffect.Mode.PlayForFree,
|
|
|
- root: SelectCardEffect.Root.Trash,
|
|
|
- customRootCardList: null,
|
|
|
- canLookReverseCard: true,
|
|
|
- selectPlayer: card.Owner,
|
|
|
- cardEffect: activateClass);
|
|
|
-
|
|
|
- yield return StartCoroutine(selectCardEffect.Activate());
|
|
|
+ selectionElements.Add(new(message: $"From trash", value: 2, spriteIndex: 0));
|
|
|
}
|
|
|
+ selectionElements.Add(new(message: $"Do not play", value: 3, spriteIndex: 1));
|
|
|
+
|
|
|
+ string selectPlayerMessage = "From which area do you select a card?";
|
|
|
+ string notSelectPlayerMessage = "The opponent is choosing from which area to select a card.";
|
|
|
+
|
|
|
+ GManager.instance.userSelectionManager.SetIntSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
|
|
|
#endregion
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- #endregion
|
|
|
|
|
|
- #region Main
|
|
|
- if (timing == EffectTiming.OptionSkill)
|
|
|
- {
|
|
|
- ActivateClass activateClass = new ActivateClass();
|
|
|
- activateClass.SetUpICardEffect(SharedEffectName, CanUseCondition, card);
|
|
|
- activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, SharedEffectDescription("Main"));
|
|
|
- cardEffects.Add(activateClass);
|
|
|
+ bool doPlay = GManager.instance.userSelectionManager.SelectedIntValue != 3;
|
|
|
+ bool fromHand = GManager.instance.userSelectionManager.SelectedIntValue == 1;
|
|
|
|
|
|
- bool CanUseCondition(Hashtable hashtable)
|
|
|
- {
|
|
|
- return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
|
|
|
- }
|
|
|
+ if (doPlay)
|
|
|
+ {
|
|
|
+ #region Hand/Trash Card Selection & Play
|
|
|
+ if (fromHand)
|
|
|
+ {
|
|
|
+ SelectHandEffect selectHandEffect2 = GManager.instance.GetComponent<SelectHandEffect>();
|
|
|
+
|
|
|
+ selectHandEffect2.SetUp(
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ canTargetCondition: CanSelectPlayCondition,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ maxCount: 1,
|
|
|
+ canNoSelect: true,
|
|
|
+ canEndNotMax: false,
|
|
|
+ isShowOpponent: true,
|
|
|
+ selectCardCoroutine: null,
|
|
|
+ afterSelectCardCoroutine: null,
|
|
|
+ mode: SelectHandEffect.Mode.PlayForFree,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ yield return StartCoroutine(selectHandEffect2.Activate());
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
+
|
|
|
+ selectCardEffect.SetUp(
|
|
|
+ canTargetCondition: CanSelectPlayCondition,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ canNoSelect: () => true,
|
|
|
+ selectCardCoroutine: null,
|
|
|
+ afterSelectCardCoroutine: null,
|
|
|
+ message: "Select 1 card to play.",
|
|
|
+ maxCount: 1,
|
|
|
+ canEndNotMax: false,
|
|
|
+ isShowOpponent: true,
|
|
|
+ mode: SelectCardEffect.Mode.PlayForFree,
|
|
|
+ root: SelectCardEffect.Root.Trash,
|
|
|
+ customRootCardList: null,
|
|
|
+ canLookReverseCard: true,
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ yield return StartCoroutine(selectCardEffect.Activate());
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
- {
|
|
|
- yield return ContinuousController.instance.StartCoroutine(SharedActivateCoroutine(hashtable, activateClass));
|
|
|
yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlaceDelayOptionCards(card: card, cardEffect: activateClass));
|
|
|
}
|
|
|
}
|
|
|
@@ -146,22 +142,10 @@ namespace DCGO.CardEffects.ST24
|
|
|
#region Security
|
|
|
if (timing == EffectTiming.SecuritySkill)
|
|
|
{
|
|
|
- ActivateClass activateClass = new ActivateClass();
|
|
|
- activateClass.SetUpICardEffect(SharedEffectName, CanUseCondition, card);
|
|
|
- activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, SharedEffectDescription("Security"));
|
|
|
- activateClass.SetIsSecurityEffect(true);
|
|
|
- cardEffects.Add(activateClass);
|
|
|
-
|
|
|
- bool CanUseCondition(Hashtable hashtable)
|
|
|
- {
|
|
|
- return CardEffectCommons.CanTriggerSecurityEffect(hashtable, card);
|
|
|
- }
|
|
|
-
|
|
|
- IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
- {
|
|
|
- yield return ContinuousController.instance.StartCoroutine(SharedActivateCoroutine(hashtable, activateClass));
|
|
|
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlaceDelayOptionCards(card: card, cardEffect: activateClass));
|
|
|
- }
|
|
|
+ CardEffectCommons.AddActivateMainOptionSecurityEffect(
|
|
|
+ card: card,
|
|
|
+ cardEffects: ref cardEffects,
|
|
|
+ effectName: "[Security] [Main] You may play 1 [DATA SQUAD] trait card with a play cost of 4 or less from your hand or trash without paying the cost. Then, place this card in the battle area.");
|
|
|
}
|
|
|
#endregion
|
|
|
|