소스 검색

Update BT25_075.cs

Give choice to player to select any available linked digimon
Solly 4 주 전
부모
커밋
7bf706d793
1개의 변경된 파일30개의 추가작업 그리고 28개의 파일을 삭제
  1. 30 28
      Assets/Scripts/CardEffect/BT25/Black/BT25_075.cs

+ 30 - 28
Assets/Scripts/CardEffect/BT25/Black/BT25_075.cs

@@ -244,50 +244,52 @@ namespace DCGO.CardEffects.BT25
             if (timing == EffectTiming.WhenLinked)
             {
                 ActivateClass activateClass = new ActivateClass();
-                activateClass.SetUpICardEffect("Linked digimon may Attack", CanUseCondition, card);
+                activateClass.SetUpICardEffect("Linked Digimon may Attack", CanUseCondition, card);
                 activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDescription());
                 activateClass.SetIsSkippable(true);
                 activateClass.SetEffectTargets(TargetablePermanents);
-                cardEffects.Add(activateClass);
 
-                string EffectDescription()
-                {
-                    return "[Your Turn] When your Digimon get linked, one of them may attack.";
-                }
+                cardEffects.Add(activateClass);
 
-                bool PermanentCondition(Permanent permanent) => CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
+                string EffectDescription() => "[Your Turn] When your Digimon get linked, one of them may attack.";
 
-                bool CanUseCondition(Hashtable hashtable)
-                {
-                    return CardEffectCommons.IsExistOnBattleAreaTrigger(card, activateClass)
-                        && CardEffectCommons.IsOwnerTurn(card)
-                        && CardEffectCommons.CanTriggerWhenLinked(hashtable, PermanentCondition, null);
-                }
+                bool CanSelectPermanentCondition(Permanent permanent) => CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
 
-                Permanent GetAttacker(Hashtable hashtable) => CardEffectCommons.GetPermanentFromHashtable(hashtable);
+                bool CanUseCondition(Hashtable hashtable) => CardEffectCommons.IsExistOnBattleAreaTrigger(card, activateClass) && 
+                        CardEffectCommons.IsOwnerTurn(card) && 
+                        CardEffectCommons.CanTriggerWhenLinked(hashtable, CanSelectPermanentCondition, null);
 
-                List<Permanent> TargetablePermanents(Hashtable hashtable) => new List<Permanent>() { GetAttacker(hashtable) };
+                List<Permanent> TargetablePermanents(Hashtable hashtable) => CardEffectCommons.GetPermanentsFromHashtable(hashtable).Where(permanent => permanent.CanAttack(activateClass)).ToList();
 
-                bool CanActivateCondition(Hashtable hashtable)
-                {
-                    activateClass.SetEffectName($"{GetAttacker(hashtable).TopCard.BaseENGCardNameFromEntity} may attack");
-                    return CardEffectCommons.IsExistOnBattleAreaActivate(card, activateClass);
-                }
+                bool CanActivateCondition(Hashtable hashtable) => CardEffectCommons.IsExistOnBattleAreaActivate(card, activateClass);
 
                 IEnumerator ActivateCoroutine(Hashtable hashtable)
                 {
-                    Permanent attacker = GetAttacker(hashtable);
-                    if (attacker != null && attacker.TopCard != null && attacker.CanAttack(activateClass))
+                    
+                    if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
                     {
-                        SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent<SelectAttackEffect>();
 
-                        selectAttackEffect.SetUp(
-                            attacker: attacker,
-                            canAttackPlayerCondition: () => true,
-                            defenderCondition: (permanent) => true,
+                        int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
+
+                        SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
+
+                        selectPermanentEffect.SetUp(
+                            selectPlayer: card.Owner,
+                            canTargetCondition: CanSelectPermanentCondition,
+                            canTargetCondition_ByPreSelecetedList: null,
+                            canEndSelectCondition: null,
+                            maxCount: maxCount,
+                            canNoSelect: true,
+                            canEndNotMax: false,
+                            selectPermanentCoroutine: null,
+                            afterSelectPermanentCoroutine: null,
+                            mode: SelectPermanentEffect.Mode.Attack,
                             cardEffect: activateClass);
+                    
+                        
+                        selectPermanentEffect.SetUpCustomMessage("Select 1 linked Digimon to attack.");
 
-                        yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
+                        yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
                     }
                 }
             }