P_033.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System.Linq;
  5. using Photon;
  6. using System;
  7. using Photon.Pun;
  8. public class P_033 : CEntity_Effect
  9. {
  10. public override List<ICardEffect> CardEffects(EffectTiming timing, CardSource card)
  11. {
  12. List<ICardEffect> cardEffects = new List<ICardEffect>();
  13. if (timing == EffectTiming.None)
  14. {
  15. AddSkillClass addSkillClass = new AddSkillClass();
  16. addSkillClass.SetUpICardEffect("Your Digimon gain Pierce", CanUseCondition, card);
  17. addSkillClass.SetUpAddSkillClass(cardSourceCondition: CardSourceCondition, getEffects: GetEffects);
  18. cardEffects.Add(addSkillClass);
  19. bool CanUseCondition(Hashtable hashtable)
  20. {
  21. if (CardEffectCommons.IsExistOnBattleArea(card))
  22. {
  23. if (CardEffectCommons.IsOwnerTurn(card))
  24. {
  25. return true;
  26. }
  27. }
  28. return false;
  29. }
  30. bool PermanentCondition(Permanent permanent)
  31. {
  32. if (CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card))
  33. {
  34. if (permanent.DP >= 13000)
  35. {
  36. if (permanent.TopCard.CardColors.Contains(CardColor.Black))
  37. {
  38. return true;
  39. }
  40. }
  41. }
  42. return false;
  43. }
  44. bool CardSourceCondition(CardSource cardSource)
  45. {
  46. if (CardEffectCommons.IsExistOnBattleArea(cardSource))
  47. {
  48. if (cardSource.Owner == card.Owner)
  49. {
  50. if (cardSource == cardSource.PermanentOfThisCard().TopCard)
  51. {
  52. if (PermanentCondition(cardSource.PermanentOfThisCard()))
  53. {
  54. return true;
  55. }
  56. }
  57. }
  58. }
  59. return false;
  60. }
  61. List<ICardEffect> GetEffects(CardSource cardSource, List<ICardEffect> cardEffects, EffectTiming _timing)
  62. {
  63. if (_timing == EffectTiming.OnDetermineDoSecurityCheck)
  64. {
  65. bool Condition()
  66. {
  67. return CardSourceCondition(cardSource);
  68. }
  69. cardEffects.Add(CardEffectFactory.PierceSelfEffect(isInheritedEffect: false, card: cardSource, condition: Condition));
  70. }
  71. return cardEffects;
  72. }
  73. }
  74. if (timing == EffectTiming.None)
  75. {
  76. bool Condition()
  77. {
  78. if (CardEffectCommons.IsExistOnBattleArea(card))
  79. {
  80. if (CardEffectCommons.IsOwnerTurn(card))
  81. {
  82. if (card.PermanentOfThisCard().TopCard.CardColors.Contains(CardColor.Black))
  83. {
  84. if (card.PermanentOfThisCard().DP >= 13000)
  85. {
  86. return true;
  87. }
  88. }
  89. }
  90. }
  91. return false;
  92. }
  93. cardEffects.Add(CardEffectFactory.ChangeSelfSAttackStaticEffect(changeValue: 1, isInheritedEffect: true, card: card, condition: Condition));
  94. }
  95. return cardEffects;
  96. }
  97. }