using System.Collections; using System.Collections.Generic; using System; using System.Linq; using UnityEngine; public partial class CardEffectCommons { #region Target 1 Digimon gains [Jamming] public static IEnumerator GainJamming(Permanent targetPermanent, EffectDuration effectDuration, ICardEffect activateClass) { if (targetPermanent == null) yield break; if (!IsPermanentExistsOnBattleArea(targetPermanent)) yield break; if (activateClass == null) yield break; if (activateClass.EffectSourceCard == null) yield break; CardSource card = activateClass.EffectSourceCard; bool PermanentCondition(Permanent permanent) => permanent == targetPermanent; bool CanUseCondition() { if (IsPermanentExistsOnBattleArea(targetPermanent)) { if (!targetPermanent.TopCard.CanNotBeAffected(activateClass)) { return true; } } return false; } CanNotBeDestroyedByBattleClass jamming = CardEffectFactory.JammingStaticEffect(permanentCondition: PermanentCondition, isInheritedEffect: false, card: card, condition: CanUseCondition); AddEffectToPermanent(targetPermanent: targetPermanent, effectDuration: effectDuration, card: card, cardEffect: jamming, timing: EffectTiming.None); if (!targetPermanent.TopCard.CanNotBeAffected(activateClass)) { yield return ContinuousController.instance.StartCoroutine(GManager.instance.GetComponent().CreateBuffEffect(targetPermanent)); } } #endregion }