|
|
@@ -6,6 +6,48 @@ using UnityEngine;
|
|
|
|
|
|
public partial class CardEffectCommons
|
|
|
{
|
|
|
+ #region Permanent gains effect to can't digivolve
|
|
|
+ public static IEnumerator GainCanNotSuspendEffect(Permanent targetPermanent, EffectDuration effectDuration, ICardEffect activateClass, bool isOnlyActivePhase, string effectName)
|
|
|
+ {
|
|
|
+ if (activateClass == null || activateClass.EffectSourceCard == null) yield break;
|
|
|
+ if (targetPermanent == null || targetPermanent.TopCard == null) yield break;
|
|
|
+
|
|
|
+ CardSource card = activateClass.EffectSourceCard;
|
|
|
+
|
|
|
+ bool PermanentCondition(Permanent permanent)
|
|
|
+ {
|
|
|
+ if (IsPermanentExistsOnBattleArea(permanent))
|
|
|
+ {
|
|
|
+ if (!permanent.TopCard.CanNotBeAffected(activateClass))
|
|
|
+ {
|
|
|
+ return permanent == targetPermanent;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanUseCondition()
|
|
|
+ {
|
|
|
+ return !isOnlyActivePhase || GManager.instance.turnStateMachine.gameContext.TurnPhase == GameContext.phase.Active;
|
|
|
+ }
|
|
|
+
|
|
|
+ CanNotSuspendClass canNotSuspendClass = CardEffectFactory.CantSuspendStaticEffect(
|
|
|
+ permanentCondition: PermanentCondition,
|
|
|
+ isInheritedEffect: false,
|
|
|
+ card: card,
|
|
|
+ condition: CanUseCondition,
|
|
|
+ effectName: effectName);
|
|
|
+
|
|
|
+ AddEffectToPermanent(targetPermanent: targetPermanent, effectDuration: effectDuration, card: card, cardEffect: activateClass, timing: EffectTiming.None);
|
|
|
+
|
|
|
+ if (!targetPermanent.TopCard.CanNotBeAffected(activateClass))
|
|
|
+ {
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent<Effects>().CreateDebuffEffect(targetPermanent));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
#region Player gains effect to have Digimon can't suspend
|
|
|
public static IEnumerator GainCanNotSuspendPlayerEffect(Func<Permanent, bool> permanentCondition, EffectDuration effectDuration, ICardEffect activateClass, bool isOnlyActivePhase, string effectName)
|
|
|
{
|