| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- using System;
- using System.Collections;
- public partial class CardEffectFactory
- {
- #region Static effect of [Reboot] on oneself
- public static RebootClass RebootSelfStaticEffect(bool isInheritedEffect, CardSource card, Func<bool> condition, bool isLinkedEffect = false)
- {
- bool PermanentCondition(Permanent permanent) => permanent == card.PermanentOfThisCard();
- bool CanUseCondition()
- {
- if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
- {
- if (condition == null || condition())
- {
- return true;
- }
- }
- return false;
- }
- return RebootStaticEffect(permanentCondition: PermanentCondition, isInheritedEffect: isInheritedEffect, card: card, condition: CanUseCondition, isLinkedEffect: isLinkedEffect);
- }
- #endregion
- #region Static effect of [Reboot]
- public static RebootClass RebootStaticEffect(Func<Permanent, bool> permanentCondition, bool isInheritedEffect, CardSource card, Func<bool> condition, bool isLinkedEffect = false)
- {
- string effectName = "Reboot";
- RebootClass rebootClass = new RebootClass();
- rebootClass.SetUpICardEffect(effectName, CanUseCondition, card);
- rebootClass.SetUpRebootClass(PermanentCondition: PermanentCondition);
- if (isInheritedEffect)
- {
- rebootClass.SetIsInheritedEffect(true);
- }
- if (isLinkedEffect)
- {
- rebootClass.SetIsLinkedEffect(true);
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return condition == null || condition();
- }
- bool PermanentCondition(Permanent permanent)
- {
- if (CardEffectCommons.IsPermanentExistsOnBattleArea(permanent))
- {
- if (permanentCondition == null || permanentCondition(permanent))
- {
- return true;
- }
- }
- return false;
- }
- return rebootClass;
- }
- #endregion
- }
|