|
|
@@ -25,8 +25,6 @@ public partial class CardEffectCommons
|
|
|
defenderCondition: (permanent) => true,
|
|
|
cardEffect: activateClass);
|
|
|
|
|
|
- selectAttackEffect.SetBeforeOnAttackCoroutine(beforeOnAttackCoroutine);
|
|
|
-
|
|
|
yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
|
|
|
}
|
|
|
}
|
|
|
@@ -48,7 +46,7 @@ public partial class CardEffectCommons
|
|
|
&& !targetPermanent.TopCard.CanNotBeAffected(activateClass);
|
|
|
}
|
|
|
|
|
|
- ActivateClass engage = CardEffectCommons.EngageEffect(
|
|
|
+ ActivateClass engage = CardEffectFactory.EngageEffect(
|
|
|
targetPermanent: targetPermanent,
|
|
|
isInheritedEffect: false,
|
|
|
condition: CanUseCondition,
|
|
|
@@ -68,56 +66,4 @@ public partial class CardEffectCommons
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
|
-
|
|
|
- #region Trigger effect of [Engage]
|
|
|
- public static ActivateClass EngageEffect(
|
|
|
- Permanent targetPermanent,
|
|
|
- bool isInheritedEffect,
|
|
|
- Func<bool> condition,
|
|
|
- ICardEffect rootCardEffect,
|
|
|
- CardSource card,
|
|
|
- Func<IEnumerator> beforeOnAttackCoroutine = null)
|
|
|
- {
|
|
|
- if (targetPermanent == null) return null;
|
|
|
- if (targetPermanent.TopCard == null) return null;
|
|
|
- if (card == null) return null;
|
|
|
-
|
|
|
- ActivateClass activateClass = new ActivateClass();
|
|
|
- activateClass.SetUpICardEffect("Engage", CanUseCondition, card);
|
|
|
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDescription());
|
|
|
- activateClass.SetIsInheritedEffect(isInheritedEffect);
|
|
|
-
|
|
|
- string EffectDescription()
|
|
|
- {
|
|
|
- return $"{DataBase.EngageEffectDescription()}";
|
|
|
- }
|
|
|
-
|
|
|
- if (rootCardEffect != null)
|
|
|
- {
|
|
|
- activateClass.SetIsInheritedEffect(false);
|
|
|
- activateClass.SetEffectSourcePermanent(targetPermanent);
|
|
|
- activateClass.SetRootCardEffect(rootCardEffect);
|
|
|
- }
|
|
|
-
|
|
|
- bool CanUseCondition(Hashtable hashtable)
|
|
|
- {
|
|
|
- return CardEffectCommons.IsOwnerTurn(card);
|
|
|
- }
|
|
|
-
|
|
|
- bool CanActivateCondition(Hashtable hashtable)
|
|
|
- {
|
|
|
- return CardEffectCommons.CanActivateEngage(targetPermanent.TopCard, activateClass)
|
|
|
- && (condition == null
|
|
|
- || condition());
|
|
|
- }
|
|
|
-
|
|
|
- IEnumerator ActivateCoroutine(Hashtable _hashtable)
|
|
|
- {
|
|
|
- return CardEffectCommons.EngageProcess(targetPermanent.TopCard, activateClass, beforeOnAttackCoroutine);
|
|
|
- }
|
|
|
-
|
|
|
- return activateClass;
|
|
|
- }
|
|
|
- #endregion
|
|
|
-
|
|
|
}
|