|
|
@@ -7,88 +7,75 @@ using UnityEngine;
|
|
|
public partial class CardEffectFactory
|
|
|
{
|
|
|
#region Static effect of [Progress] on oneself
|
|
|
- public static ActivateClass ProgressSelfStaticEffect(bool isInheritedEffect, CardSource card, Func<bool> condition)
|
|
|
+ public static CanNotAffectedClass ProgressSelfStaticEffect(bool isInheritedEffect, CardSource card, Func<bool> condition)
|
|
|
{
|
|
|
- Permanent targetPermanent = card.PermanentOfThisCard();
|
|
|
-
|
|
|
- bool PermanentCondition(Permanent permanent) => permanent == card.PermanentOfThisCard();
|
|
|
-
|
|
|
bool CanUseCondition()
|
|
|
{
|
|
|
- if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
|
|
|
- {
|
|
|
- if (GManager.instance.attackProcess.IsAttacking)
|
|
|
- {
|
|
|
- if (GManager.instance.attackProcess.AttackingPermanent == card.PermanentOfThisCard())
|
|
|
- {
|
|
|
- if (condition == null || condition())
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
+ return CardEffectCommons.CanActivateProgress(card);
|
|
|
}
|
|
|
|
|
|
- return ProgressStaticEffect(permanentCondition: PermanentCondition, isInheritedEffect: isInheritedEffect, card: card, condition: CanUseCondition);
|
|
|
+ return ProgressStaticEffect(isInheritedEffect: isInheritedEffect, card: card, condition: CanUseCondition);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region Static effect of [Progress]
|
|
|
- public static ActivateClass ProgressStaticEffect(
|
|
|
- Func<Permanent, bool> permanentCondition,
|
|
|
+ public static CanNotAffectedClass ProgressStaticEffect(
|
|
|
bool isInheritedEffect,
|
|
|
CardSource card,
|
|
|
Func<bool> condition)
|
|
|
{
|
|
|
- ActivateClass activateClass = new ActivateClass();
|
|
|
- activateClass.SetUpICardEffect("Progress", CanUseCondition, card);
|
|
|
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, false, EffectDiscription());
|
|
|
- activateClass.SetIsInheritedEffect(isInheritedEffect);
|
|
|
- activateClass.SetIsBackgroundProcess(true);
|
|
|
+ CanNotAffectedClass canNotAffectedClass = new CanNotAffectedClass();
|
|
|
+ canNotAffectedClass.SetUpICardEffect("Progress", CanUseCondition, card);
|
|
|
+ canNotAffectedClass.SetUpCanNotAffectedClass(CardCondition: CardCondition, SkillCondition: SkillCondition);
|
|
|
+ canNotAffectedClass.SetIsInheritedEffect(isInheritedEffect);
|
|
|
+ canNotAffectedClass.SetIsBackgroundProcess(true);
|
|
|
|
|
|
- string EffectDiscription()
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
{
|
|
|
- return DataBase.ProgressEffectDiscription();
|
|
|
+ if (condition == null || condition())
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
- bool PermanentCondition(Permanent permanent)
|
|
|
+ bool CardCondition(CardSource cardSource)
|
|
|
{
|
|
|
- if (CardEffectCommons.IsPermanentExistsOnBattleArea(permanent))
|
|
|
+ if (CardEffectCommons.IsExistOnBattleArea(card))
|
|
|
{
|
|
|
- if (permanentCondition == null || permanentCondition(permanent))
|
|
|
+ if (cardSource == card)
|
|
|
{
|
|
|
- return true;
|
|
|
+ if (GManager.instance.attackProcess.IsAttacking)
|
|
|
+ {
|
|
|
+ if (GManager.instance.attackProcess.AttackingPermanent == cardSource.PermanentOfThisCard())
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- bool CanUseCondition(Hashtable hashtable)
|
|
|
+ bool SkillCondition(ICardEffect cardEffect)
|
|
|
{
|
|
|
- if (condition == null || condition())
|
|
|
+ if (cardEffect != null)
|
|
|
{
|
|
|
- if(PermanentCondition(card.PermanentOfThisCard()))
|
|
|
- return true;
|
|
|
+ if (cardEffect.EffectSourceCard != null)
|
|
|
+ {
|
|
|
+ if (CardEffectCommons.IsOpponentEffect(cardEffect, card))
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- bool CanActivateCondition(Hashtable hashtable)
|
|
|
- {
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- IEnumerator ActivateCoroutine(Hashtable _hashtable)
|
|
|
- {
|
|
|
- return CardEffectCommons.ProgressProcess(card, activateClass);
|
|
|
- }
|
|
|
-
|
|
|
- return activateClass;
|
|
|
+ return canNotAffectedClass;
|
|
|
}
|
|
|
#endregion
|
|
|
}
|