|
|
@@ -0,0 +1,163 @@
|
|
|
+using System.Collections;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Diagnostics;
|
|
|
+
|
|
|
+namespace DCGO.CardEffects.BT18
|
|
|
+{
|
|
|
+ public class FunBeemon_BT18_044 : CEntity_Effect
|
|
|
+ {
|
|
|
+ public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
|
|
|
+ {
|
|
|
+ List<ICardEffect> cardEffects = new List<ICardEffect>();
|
|
|
+
|
|
|
+ #region Alternate Digivolution
|
|
|
+
|
|
|
+ if (timing == EffectTiming.None)
|
|
|
+ {
|
|
|
+ bool PermanentCondition(Permanent targetPermanent)
|
|
|
+ {
|
|
|
+ return targetPermanent.TopCard.IsLevel2 &&
|
|
|
+ targetPermanent.TopCard.EqualsTraits("Royal Base");
|
|
|
+ }
|
|
|
+
|
|
|
+ cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
|
|
|
+ permanentCondition: PermanentCondition, digivolutionCost: 0, ignoreDigivolutionRequirement: false,
|
|
|
+ card: card, condition: null));
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region On Play
|
|
|
+ if (timing == EffectTiming.OnEnterFieldAnyone)
|
|
|
+ {
|
|
|
+ ActivateClass activateClass = new ActivateClass();
|
|
|
+ activateClass.SetUpICardEffect("Place 1 [Royal Base] trait Digimon face up as bottom security, add top security to hand", CanUseCondition, card);
|
|
|
+ activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription());
|
|
|
+ cardEffects.Add(activateClass);
|
|
|
+
|
|
|
+ string EffectDiscription()
|
|
|
+ {
|
|
|
+ return "[On Play] By placing 1 Digimon card with the [Royal Base] trait in your hand face up as your bottom security card, add your top security card to the hand.";
|
|
|
+ }
|
|
|
+
|
|
|
+ bool IsRoyalBaseDigimon(CardSource card)
|
|
|
+ {
|
|
|
+ return card.EqualsTraits("Royal Base");
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanUseCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ return CardEffectCommons.CanTriggerOnPlay(hashtable, card);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool CanActivateCondition(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
|
|
|
+ return CardEffectCommons.HasMatchConditionOwnersHand(card, IsRoyalBaseDigimon);
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ IEnumerator ActivateCoroutine(Hashtable hashtable)
|
|
|
+ {
|
|
|
+ bool cardAdded = false;
|
|
|
+
|
|
|
+ SelectHandEffect selectHandEffect = GManager.instance.GetComponent<SelectHandEffect>();
|
|
|
+
|
|
|
+ selectHandEffect.SetUp(
|
|
|
+ selectPlayer: card.Owner,
|
|
|
+ canTargetCondition: IsRoyalBaseDigimon,
|
|
|
+ canTargetCondition_ByPreSelecetedList: null,
|
|
|
+ canEndSelectCondition: null,
|
|
|
+ maxCount: 1,
|
|
|
+ canNoSelect: true,
|
|
|
+ canEndNotMax: false,
|
|
|
+ isShowOpponent: true,
|
|
|
+ selectCardCoroutine: CardSelected,
|
|
|
+ afterSelectCardCoroutine: null,
|
|
|
+ mode: SelectHandEffect.Mode.PutSecurityBottom,
|
|
|
+ cardEffect: activateClass);
|
|
|
+
|
|
|
+ selectHandEffect.SetIsFaceup();
|
|
|
+
|
|
|
+ yield return StartCoroutine(selectHandEffect.Activate());
|
|
|
+
|
|
|
+ IEnumerator CardSelected(CardSource cardSource)
|
|
|
+ {
|
|
|
+ cardAdded = true;
|
|
|
+
|
|
|
+ yield return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (cardAdded)
|
|
|
+ {
|
|
|
+ CardSource topCard = card.Owner.SecurityCards[0];
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(CardObjectController.AddHandCards(new List<CardSource>() { topCard }, false, activateClass));
|
|
|
+
|
|
|
+ yield return ContinuousController.instance.StartCoroutine(new IReduceSecurity(
|
|
|
+ player: card.Owner,
|
|
|
+ refSkillInfos: ref ContinuousController.instance.nullSkillInfos).ReduceSecurity());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region All Turns - ESS
|
|
|
+ if (timing == EffectTiming.None)
|
|
|
+ {
|
|
|
+ bool Condition()
|
|
|
+ {
|
|
|
+ if (CardEffectCommons.IsExistOnBattleArea(card))
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 1000, isInheritedEffect: true, card: card, condition: Condition));
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region All Turns - Security
|
|
|
+ if (timing == EffectTiming.None)
|
|
|
+ {
|
|
|
+ string EffectDiscription()
|
|
|
+ {
|
|
|
+ return "(Security) [All Turns] All of your [Royal Base] trait Digimon get +1000 DP.";
|
|
|
+ }
|
|
|
+
|
|
|
+ bool Condition()
|
|
|
+ {
|
|
|
+ UnityEngine.Debug.Log($"FUNBEEMON CONDITION: {CardEffectCommons.IsExistInSecurity(card, false)}");
|
|
|
+ return CardEffectCommons.IsExistInSecurity(card, false);
|
|
|
+ }
|
|
|
+
|
|
|
+ bool PermanentCondition(Permanent permanent)
|
|
|
+ {
|
|
|
+ if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
|
|
|
+ {
|
|
|
+ if (permanent.TopCard.EqualsTraits("Royal Base"))
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ cardEffects.Add(CardEffectFactory.ChangeDPStaticEffect(
|
|
|
+ permanentCondition: PermanentCondition,
|
|
|
+ changeValue: 1000,
|
|
|
+ isInheritedEffect: false,
|
|
|
+ card: card,
|
|
|
+ condition: Condition,
|
|
|
+ effectName: EffectDiscription));
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ return cardEffects;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|