using System.Collections; using System.Collections.Generic; //Monodramon namespace DCGO.CardEffects.BT23 { public class BT23_049 : CEntity_Effect { public override List CardEffects(EffectTiming timing, CardSource card) { List cardEffects = new List(); #region Alternate Digivolution if (timing == EffectTiming.None) { bool PermanentCondition(Permanent targetPermanent) { return targetPermanent.TopCard.IsLevel2 && targetPermanent.TopCard.HasCSTraits; } cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect( permanentCondition: PermanentCondition, digivolutionCost: 0, ignoreDigivolutionRequirement: false, card: card, condition: null)); } #endregion #region Start of Your Main Phase if (timing == EffectTiming.OnStartMainPhase) { ActivateClass activateClass = new ActivateClass(); activateClass.SetUpICardEffect("Trash 1 card from hand to Draw 1 and memory +1", CanUseCondition, card); activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, -1, true, EffectDiscription()); cardEffects.Add(activateClass); string EffectDiscription() { return "[Start of Your Main Phase] By trashing 1 card with the [Dragonkin], [Cyborg], [Device] or [CS] trait from your hand, and gain 1 memory."; } bool CanSelectCardCondition(CardSource cardSource) { return cardSource.EqualsTraits("Dragonkin") || cardSource.EqualsTraits("Cyborg") || cardSource.HasDeviceTraits || cardSource.HasCSTraits; } bool CanUseCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) { if (CardEffectCommons.IsOwnerTurn(card)) { return true; } } return false; } bool CanActivateCondition(Hashtable hashtable) { if (CardEffectCommons.IsExistOnBattleArea(card)) { if (card.Owner.HandCards.Count >= 1) { return true; } } return false; } IEnumerator ActivateCoroutine(Hashtable _hashtable) { if (card.Owner.HandCards.Some(CanSelectCardCondition)) { bool discarded = false; int discardCount = 1; SelectHandEffect selectHandEffect = GManager.instance.GetComponent(); selectHandEffect.SetUp( selectPlayer: card.Owner, canTargetCondition: CanSelectCardCondition, canTargetCondition_ByPreSelecetedList: null, canEndSelectCondition: null, maxCount: discardCount, canNoSelect: true, canEndNotMax: false, isShowOpponent: true, selectCardCoroutine: null, afterSelectCardCoroutine: AfterSelectCardCoroutine, mode: SelectHandEffect.Mode.Discard, cardEffect: activateClass); yield return StartCoroutine(selectHandEffect.Activate()); IEnumerator AfterSelectCardCoroutine(List cardSources) { if (cardSources.Count >= 1) { discarded = true; yield return null; } } if (discarded) { yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass)); yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 1, activateClass).Draw()); } } } } #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 return cardEffects; } } }