| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- using System.Collections;
- using System.Collections.Generic;
- namespace DCGO.CardEffects.BT15
- {
- public class BT15_003 : CEntity_Effect
- {
- public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
- {
- List<ICardEffect> cardEffects = new List<ICardEffect>();
- if (timing == EffectTiming.OnAllyAttack)
- {
- ActivateClass activateClass = new ActivateClass();
- activateClass.SetUpICardEffect("Trash the top or bottom of your security to gain Memory +1", CanUseCondition, card);
- activateClass.SetUpActivateClass(CanActivateCondition, ActivateCoroutine, 1, true, EffectDiscription());
- activateClass.SetIsInheritedEffect(true);
- activateClass.SetHashString("TrashSecuirtyToGainMemory+1_BT15_003");
- cardEffects.Add(activateClass);
- string EffectDiscription()
- {
- return "[When Attacking][Once Per Turn] By trashing the top or bottom card of your security stack, gain 1 memory.";
- }
- bool CanUseCondition(Hashtable hashtable)
- {
- return CardEffectCommons.CanTriggerOnAttack(hashtable, card);
- }
- bool CanActivateCondition(Hashtable hashtable)
- {
- if (CardEffectCommons.IsExistOnBattleArea(card))
- {
- if (card.Owner.SecurityCards.Count >= 1)
- {
- return true;
- }
- }
- return false;
- }
- IEnumerator ActivateCoroutine(Hashtable _hashtable)
- {
- if (card.Owner.SecurityCards.Count >= 1)
- {
- List<SelectionElement<bool>> selectionElements = new List<SelectionElement<bool>>()
- {
- new SelectionElement<bool>(message: $"Security Top", value : true, spriteIndex: 0),
- new SelectionElement<bool>(message: $"Security Bottom", value : false, spriteIndex: 1),
- };
- string selectPlayerMessage = "Which will you trash the top or bottom card of the security?";
- string notSelectPlayerMessage = "The opponent is selecting whether to trash the top or bottom card of security.";
- GManager.instance.userSelectionManager.SetBoolSelection(selectionElements: selectionElements, selectPlayer: card.Owner, selectPlayerMessage: selectPlayerMessage, notSelectPlayerMessage: notSelectPlayerMessage);
- yield return ContinuousController.instance.StartCoroutine(GManager.instance.userSelectionManager.WaitForEndSelect());
- bool fromTop = GManager.instance.userSelectionManager.SelectedBoolValue;
- yield return ContinuousController.instance.StartCoroutine(new IDestroySecurity(
- card.Owner,
- 1,
- activateClass,
- fromTop).DestroySecurity());
- yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(1, activateClass));
- }
- }
- }
- return cardEffects;
- }
- }
- }
|