BT18_046.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace DCGO.CardEffects.BT18
  4. {
  5. public class BT18_046 : CEntity_Effect
  6. {
  7. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  8. {
  9. List<ICardEffect> cardEffects = new List<ICardEffect>();
  10. #region Alternate Digivolution
  11. if (timing == EffectTiming.None)
  12. {
  13. bool PermanentCondition(Permanent targetPermanent)
  14. {
  15. return targetPermanent.TopCard.IsLevel3 &&
  16. targetPermanent.TopCard.EqualsTraits("Royal Base");
  17. }
  18. cardEffects.Add(CardEffectFactory.AddSelfDigivolutionRequirementStaticEffect(
  19. permanentCondition: PermanentCondition, digivolutionCost: 2, ignoreDigivolutionRequirement: false,
  20. card: card, condition: null));
  21. }
  22. #endregion
  23. #region Opponent's Turn Effect
  24. if (timing == EffectTiming.None)
  25. {
  26. bool AttackerCondition(Permanent permanent)
  27. {
  28. return CardEffectCommons.IsPermanentExistsOnOpponentBattleAreaDigimon(permanent, card) &&
  29. permanent.DP <= card.PermanentOfThisCard().DP;
  30. }
  31. bool DefenderCondition(Permanent permanent)
  32. {
  33. return permanent == null;
  34. }
  35. bool Condition()
  36. {
  37. if (CardEffectCommons.IsExistOnBattleAreaDigimon(card))
  38. {
  39. if (CardEffectCommons.IsOpponentTurn(card))
  40. {
  41. if(card.PermanentOfThisCard().TopCard == card)
  42. return true;
  43. }
  44. }
  45. return false;
  46. }
  47. string effectName = "Opponent's Digimon with as much or less DP as this Digimon can't attack players";
  48. cardEffects.Add(CardEffectFactory.CanNotAttackStaticEffect(
  49. attackerCondition: AttackerCondition,
  50. defenderCondition: DefenderCondition,
  51. isInheritedEffect: false,
  52. card: card,
  53. condition: Condition,
  54. effectName: effectName
  55. ));
  56. }
  57. #endregion
  58. #region All Turns - ESS
  59. if (timing == EffectTiming.None)
  60. {
  61. bool Condition()
  62. {
  63. if (CardEffectCommons.IsExistOnBattleArea(card))
  64. {
  65. return true;
  66. }
  67. return false;
  68. }
  69. cardEffects.Add(CardEffectFactory.ChangeSelfDPStaticEffect(changeValue: 1000, isInheritedEffect: true, card: card, condition: Condition));
  70. }
  71. #endregion
  72. #region All Turns - Security
  73. if (timing == EffectTiming.None)
  74. {
  75. string EffectDiscription()
  76. {
  77. return "(Security) [All Turns] All of your [Royal Base] trait Digimon get +1000 DP.";
  78. }
  79. bool Condition()
  80. {
  81. return CardEffectCommons.IsExistInSecurity(card, false);
  82. }
  83. bool PermanentCondition(Permanent permanent)
  84. {
  85. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleArea(permanent, card))
  86. {
  87. if (permanent.TopCard.EqualsTraits("Royal Base"))
  88. {
  89. return true;
  90. }
  91. }
  92. return false;
  93. }
  94. cardEffects.Add(CardEffectFactory.ChangeDPStaticEffect(
  95. permanentCondition: PermanentCondition,
  96. changeValue: 1000,
  97. isInheritedEffect: false,
  98. card: card,
  99. condition: Condition,
  100. effectName: EffectDiscription));
  101. }
  102. #endregion
  103. return cardEffects;
  104. }
  105. }
  106. }