NuclearLaser_BT1_092.cs 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 NuclearLaser_BT1_092 : 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.OptionSkill)
  14. {
  15. ActivateClass activateClass = new ActivateClass();
  16. activateClass.SetUpICardEffect(card.BaseENGCardNameFromEntity, CanUseCondition, card);
  17. activateClass.SetUpActivateClass(null, ActivateCoroutine, -1, false, EffectDiscription());
  18. cardEffects.Add(activateClass);
  19. string EffectDiscription()
  20. {
  21. return "[Main] Trigger <Draw 2> (Draw 2 cards from your deck). Then 1 of your Digimon gets +2000 DP for the turn.";
  22. }
  23. bool CanSelectPermanentCondition(Permanent permanent)
  24. {
  25. return CardEffectCommons.IsPermanentExistsOnOwnerBattleAreaDigimon(permanent, card);
  26. }
  27. bool CanUseCondition(Hashtable hashtable)
  28. {
  29. return CardEffectCommons.CanTriggerOptionMainEffect(hashtable, card);
  30. }
  31. IEnumerator ActivateCoroutine(Hashtable _hashtable)
  32. {
  33. yield return ContinuousController.instance.StartCoroutine(new DrawClass(card.Owner, 2, activateClass).Draw());
  34. if (CardEffectCommons.HasMatchConditionPermanent(CanSelectPermanentCondition))
  35. {
  36. int maxCount = Math.Min(1, CardEffectCommons.MatchConditionPermanentCount(CanSelectPermanentCondition));
  37. SelectPermanentEffect selectPermanentEffect = GManager.instance.GetComponent<SelectPermanentEffect>();
  38. selectPermanentEffect.SetUp(
  39. selectPlayer: card.Owner,
  40. canTargetCondition: CanSelectPermanentCondition,
  41. canTargetCondition_ByPreSelecetedList: null,
  42. canEndSelectCondition: null,
  43. maxCount: maxCount,
  44. canNoSelect: false,
  45. canEndNotMax: false,
  46. selectPermanentCoroutine: SelectPermanentCoroutine,
  47. afterSelectPermanentCoroutine: null,
  48. mode: SelectPermanentEffect.Mode.Custom,
  49. cardEffect: activateClass);
  50. selectPermanentEffect.SetUpCustomMessage("Select 1 Digimon that will get DP +2000.", "The opponent is selecting 1 Digimon that will get DP +2000.");
  51. yield return ContinuousController.instance.StartCoroutine(selectPermanentEffect.Activate());
  52. IEnumerator SelectPermanentCoroutine(Permanent permanent)
  53. {
  54. yield return ContinuousController.instance.StartCoroutine(CardEffectCommons.ChangeDigimonDP(targetPermanent: permanent, changeValue: 2000, effectDuration: EffectDuration.UntilEachTurnEnd, activateClass: activateClass));
  55. }
  56. }
  57. }
  58. }
  59. return cardEffects;
  60. }
  61. }