|
|
@@ -11,6 +11,25 @@ namespace DCGO.CardEffects.P
|
|
|
{
|
|
|
List<ICardEffect> cardEffects = new List<ICardEffect>();
|
|
|
|
|
|
+ #region Alternate Digivolution Requirement
|
|
|
+
|
|
|
+ if (timing == EffectTiming.None)
|
|
|
+ {
|
|
|
+ bool PermanentCondition(Permanent targetPermanent)
|
|
|
+ {
|
|
|
+ if (targetPermanent.TopCard.EqualsCardName("Justimon: Blitz Arm") || targetPermanent.TopCard.EqualsCardName("Justimon: Accel Arm"))
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 1, ignoreDigivolutionRequirement: false, card: card, condition: null));
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
#region Reduce Digivolution Cost
|
|
|
|
|
|
if (timing == EffectTiming.None)
|
|
|
@@ -32,74 +51,86 @@ namespace DCGO.CardEffects.P
|
|
|
cardEffects.Add(activateClass);
|
|
|
|
|
|
string EffectDiscription()
|
|
|
- => "When Digivolving] By placing 1 Option card with the [Device] trait from your hand or trash into the battle area, this Digimon gets +3000 DP until your opponent's turn ends.";
|
|
|
+ => "[When Digivolving] By placing 1 Option card with the [Device] trait from your hand or trash into the battle area, this Digimon gets +3000 DP until your opponent's turn ends.";
|
|
|
|
|
|
bool CanSelectOption(CardSource cardSource)
|
|
|
=> cardSource.IsOption && cardSource.HasDeviceTraits;
|
|
|
|
|
|
bool CanUseCondition(Hashtable hashtable)
|
|
|
- => CardEffectCommons.IsExistOnBattleAreaDigimon(card);
|
|
|
+ => CardEffectCommons.IsExistOnBattleAreaDigimon(card) &&
|
|
|
+ CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
|
|
|
|
|
|
bool CanActivateCondition(Hashtable hashtable)
|
|
|
=> CardEffectCommons.IsExistOnBattleAreaDigimon(card)
|
|
|
- && CardEffectCommons.CanTriggerWhenDigivolving(hashtable, card);
|
|
|
+ && (CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectOption) || CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectOption));
|
|
|
|
|
|
IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
{
|
|
|
CardSource selectedDevice = null;
|
|
|
- SelectCardEffect SharedSelectCardEffect(SelectCardEffect.Root root)
|
|
|
- {
|
|
|
- SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
- selectCardEffect.SetUp(
|
|
|
- canTargetCondition: CanSelectOption,
|
|
|
- canTargetCondition_ByPreSelecetedList: null,
|
|
|
- canEndSelectCondition: null,
|
|
|
- canNoSelect: () => true,
|
|
|
- selectCardCoroutine: SelectCardCoroutine,
|
|
|
- afterSelectCardCoroutine: null,
|
|
|
- message: "Select Device to play",
|
|
|
- maxCount: 1,
|
|
|
- canEndNotMax: true,
|
|
|
- isShowOpponent: true,
|
|
|
- mode: SelectCardEffect.Mode.Custom,
|
|
|
- root: root,
|
|
|
- customRootCardList: null,
|
|
|
- canLookReverseCard: true,
|
|
|
- selectPlayer: card.Owner,
|
|
|
- cardEffect: activateClass);
|
|
|
+ bool optionInHand = CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectOption);
|
|
|
+ bool optionInTrash = CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectOption);
|
|
|
+ SelectCardEffect.Root root = SelectCardEffect.Root.Hand;
|
|
|
|
|
|
- return selectCardEffect;
|
|
|
- IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
+ if (optionInHand && optionInTrash)
|
|
|
+ {
|
|
|
+ List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
|
|
|
{
|
|
|
- yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
|
|
|
- cardSources: new List<CardSource> { cardSource },
|
|
|
- activateClass: activateClass,
|
|
|
- payCost: false,
|
|
|
- isTapped: false,
|
|
|
- root: SelectCardEffect.Root.Trash,
|
|
|
- activateETB: true));
|
|
|
- selectedDevice = cardSource;
|
|
|
- }
|
|
|
- }
|
|
|
+ new(message: "From hand", value: true, spriteIndex: 0),
|
|
|
+ new(message: "From trash", value: false, spriteIndex: 1)
|
|
|
+ };
|
|
|
+
|
|
|
+ string selectPlayerMessage = "Choose option location";
|
|
|
+ string notSelectPlayerMessage = "The opponent is choosing the option location.";
|
|
|
+
|
|
|
+ GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner,
|
|
|
+ selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
|
|
|
|
|
|
- List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
|
|
|
+
|
|
|
+ root = GManager.instance.userSelectionManager.SelectedBoolValue ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash;
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- new(message: "From hand", value: true, spriteIndex: 0),
|
|
|
- new(message: "From trash", value: false, spriteIndex: 1)
|
|
|
- };
|
|
|
+ root = optionInHand ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash;
|
|
|
+ }
|
|
|
+
|
|
|
+ SelectCardEffect selectCardEffect = GManager.instance.GetComponent<SelectCardEffect>();
|
|
|
+ selectCardEffect.SetUp(
|
|
|
+ canTargetCondition: CanSelectOption,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ canNoSelect: () => true,
|
|
|
+ selectCardCoroutine: SelectCardCoroutine,
|
|
|
+ afterSelectCardCoroutine: null,
|
|
|
+ message: "Select Device to play",
|
|
|
+ maxCount: 1,
|
|
|
+ canEndNotMax: true,
|
|
|
+ isShowOpponent: true,
|
|
|
+ mode: SelectCardEffect.Mode.Custom,
|
|
|
+ root: root,
|
|
|
+ customRootCardList: null,
|
|
|
+ canLookReverseCard: true,
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ cardEffect: activateClass);
|
|
|
|
|
|
- string selectPlayerMessage = "Choose option location";
|
|
|
- string notSelectPlayerMessage = "The opponent is choosing the option location.";
|
|
|
+ IEnumerator SelectCardCoroutine(CardSource cardSource)
|
|
|
+ {
|
|
|
+ selectedDevice = cardSource;
|
|
|
+ yield return null;
|
|
|
+ }
|
|
|
|
|
|
- GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner,
|
|
|
- selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
|
|
|
- yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(selectCardEffect.Activate());
|
|
|
|
|
|
- SelectCardEffect.Root root = GManager.instance.userSelectionManager.SelectedBoolValue ? SelectCardEffect.Root.Hand : SelectCardEffect.Root.Trash;
|
|
|
- if (root == SelectCardEffect.Root.Hand && CardEffectCommons.HasMatchConditionOwnersHand(card, CanSelectOption)) yield return ContinuousController.instance.StartCoroutine(SharedSelectCardEffect(root).Activate());
|
|
|
- if (root == SelectCardEffect.Root.Trash && CardEffectCommons.HasMatchConditionOwnersCardInTrash(card, CanSelectOption)) yield return ContinuousController.instance.StartCoroutine(SharedSelectCardEffect(root).Activate());
|
|
|
if (selectedDevice != null)
|
|
|
{
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.PlayPermanentCards(
|
|
|
+ cardSources: new List<CardSource> { selectedDevice },
|
|
|
+ activateClass: activateClass,
|
|
|
+ payCost: false,
|
|
|
+ isTapped: false,
|
|
|
+ root: SelectCardEffect.Root.Trash,
|
|
|
+ activateETB: true));
|
|
|
+
|
|
|
ChangeBaseDPClass changeDPClass = new ChangeBaseDPClass();
|
|
|
changeDPClass.SetUpICardEffect("+3000 DP", (hashtable) => true, card);
|
|
|
changeDPClass.SetUpChangeBaseDPClass(changeDPFunc: ChangeDP, permanentCondition: permanentCondition, isUpDownFunc: () => false, isMinusDPFunc: () => false);
|
|
|
@@ -118,15 +149,13 @@ namespace DCGO.CardEffects.P
|
|
|
|
|
|
#region When Digivolving/Attacking OPT Shared
|
|
|
|
|
|
- string SharedEffectDiscription()
|
|
|
- => "When Digivolving or attacking] By trashing 1 [Device] Option on the field, you can select 1 of your opponent's Digimon with a level of 9 or less to delete.";
|
|
|
bool CanSelectPermanentOptionCondition(Permanent permanent)
|
|
|
=> permanent.TopCard.IsOption && permanent.TopCard.HasDeviceTraits;
|
|
|
|
|
|
bool CanSelectPermanentDigimonCondition(Permanent permanent)
|
|
|
=> CardEffectCommons.IsPermanentExistsOnBattleAreaDigimon(permanent)
|
|
|
- && permanent.TopCard.HasLevel
|
|
|
- && permanent.TopCard.Level <= 9;
|
|
|
+ && permanent.TopCard.HasPlayCost
|
|
|
+ && permanent.TopCard.GetCostItself <= 9;
|
|
|
|
|
|
IEnumerator SharedActivateCoroutine(Hashtable _hashtable, ActivateClass activateClass)
|
|
|
{
|
|
|
@@ -194,6 +223,9 @@ namespace DCGO.CardEffects.P
|
|
|
activateClass.SetHashString("P_179_Trash&Delete");
|
|
|
cardEffects.Add(activateClass);
|
|
|
|
|
|
+ string SharedEffectDiscription()
|
|
|
+ => "[When Digivolving] By trashing 1 [Device] Option on the field, you can select 1 of your opponent's Digimon with a level of 9 or less to delete.";
|
|
|
+
|
|
|
bool CanUseCondition(Hashtable hashtable)
|
|
|
=> CardEffectCommons.IsExistOnBattleAreaDigimon(card);
|
|
|
|
|
|
@@ -214,6 +246,9 @@ namespace DCGO.CardEffects.P
|
|
|
activateClass.SetHashString("P_179_Trash&Delete");
|
|
|
cardEffects.Add(activateClass);
|
|
|
|
|
|
+ string SharedEffectDiscription()
|
|
|
+ => "[When Attacking] By trashing 1 [Device] Option on the field, you can select 1 of your opponent's Digimon with a level of 9 or less to delete.";
|
|
|
+
|
|
|
bool CanUseCondition(Hashtable hashtable)
|
|
|
=> CardEffectCommons.IsExistOnBattleAreaDigimon(card);
|
|
|
|