BT22_010.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. // Meramon
  4. namespace DCGO.CardEffects.BT22
  5. {
  6. public class BT22_010 : CEntity_Effect
  7. {
  8. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  9. {
  10. List<ICardEffect> cardEffects = new List<ICardEffect>();
  11. #region Alternative Digivolution Condition
  12. if (timing == EffectTiming.None)
  13. {
  14. bool PermanentCondition(Permanent targetPermanent)
  15. {
  16. return targetPermanent.TopCard.IsLevel3 && (targetPermanent.TopCard.HasFlameTraits || targetPermanent.TopCard.HasCSTraits);
  17. }
  18. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(permanentCondition: PermanentCondition, digivolutionCost: 2, ignoreDigivolutionRequirement: false, card: card, condition: null));
  19. }
  20. #endregion
  21. #region Main
  22. if (timing == EffectTiming.OnDeclaration)
  23. {
  24. ActivateClass activateClass = new ActivateClass();
  25. activateClass.SetUpICardEffect("Pay 2, Gain raid & piercing. then it may attack", CanUseCondition, card);
  26. activateClass.SetUpActivateClass(null, ActivateCoroutine, 1, false, EffectDiscription());
  27. activateClass.SetHashString("BT22_010_Main");
  28. cardEffects.Add(activateClass);
  29. string EffectDiscription()
  30. {
  31. return "[Main] [Once Per Turn] By paying 2 cost, this Digimon gains <Raid> (When this Digimon attacks, you may switch the target of attack to 1 of your opponent's unsuspended Digimon with the highest DP) and <Piercing> (When this Digimon attacks and deletes an opponent's Digimon and survives the battle, it performs any security checks it normally would) for the turn. Then, this Digimon may attack.";
  32. }
  33. bool CanUseCondition(Hashtable hashtable)
  34. {
  35. return CardEffectCommons.IsExistOnBattleAreaDigimon(card) && CardEffectCommons.IsOwnerTurn(card);
  36. }
  37. IEnumerator ActivateCoroutine(Hashtable hashtable)
  38. {
  39. yield return ContinuousController.instance.StartCoroutine(card.Owner.AddMemory(-2, activateClass));
  40. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainRaid(card.PermanentOfThisCard(), EffectDuration.UntilEachTurnEnd, activateClass));
  41. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.GainPierce(card.PermanentOfThisCard(), EffectDuration.UntilEachTurnEnd, activateClass));
  42. if (card.PermanentOfThisCard().CanAttack(activateClass))
  43. {
  44. SelectAttackEffect selectAttackEffect = GManager.instance.GetComponent<SelectAttackEffect>();
  45. selectAttackEffect.SetUp(
  46. attacker: card.PermanentOfThisCard(),
  47. canAttackPlayerCondition: () => true,
  48. defenderCondition: _ => true,
  49. cardEffect: activateClass);
  50. yield return ContinuousController.instance.StartCoroutine(selectAttackEffect.Activate());
  51. }
  52. }
  53. }
  54. #endregion
  55. #region ESS
  56. if (timing == EffectTiming.None)
  57. {
  58. bool Condition()
  59. {
  60. return CardEffectCommons.IsExistOnBattleArea(card) && CardEffectCommons.IsOwnerTurn(card);
  61. }
  62. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 2000, isInheritedEffect: true, card: card, condition: Condition));
  63. }
  64. #endregion
  65. return cardEffects;
  66. }
  67. }
  68. }