Advertisement
arcagamer

Magia precisa

Mar 23rd, 2023
565
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.04 KB | None | 0 0
  1. Here is a sample code for an EDOPro card script that meets your requirements:
  2.  
  3. ```lua
  4. local s,id,o=GetID()
  5. function s.initial_effect(c)
  6.     local e1=Effect.CreateEffect(c)
  7.     e1:SetType(EFFECT_TYPE_ACTIVATE)
  8.     e1:SetCode(EVENT_FREE_CHAIN)
  9.     e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
  10.     e1:SetCondition(s.condition)
  11.     e1:SetTarget(s.target)
  12.     e1:SetOperation(s.activate)
  13.     c:RegisterEffect(e1)
  14. end
  15. function s.condition(e,tp,eg,ep,ev,re,r,rp)
  16.     return not Duel.IsExistingMatchingCard(aux.FilterFaceupFunction(Card.IsSetCard,0xTITAN),tp,0,LOCATION_MZONE,1,nil)
  17. end
  18. function s.filter(c,e,tp,eg,ep,ev,re,r,rp)
  19.     return c:IsSetCard(0xLIGHTNING) and c:IsAbleToHand()
  20. end
  21. function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
  22.     if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end
  23.     Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
  24. end
  25. function s.activate(e,tp,eg,ep,ev,re,r,rp)
  26.     Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
  27.     local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
  28.     if #g>0 then
  29.         Duel.SendtoHand(g,nil,REASON_EFFECT)
  30.         Duel.ConfirmCards(1-tp,g)
  31.         if g:GetFirst():IsCode(CARD_LIGHTNING_MARIA) then
  32.             local g2=Duel.SelectMatchingCard(tp,s.banishfilter,tp,0,LOCATION_ONFIELD,1,1,nil,e,tp,eg,ep,ev,re,r,rp):GetFirst()
  33.             if g2 then
  34.                 Duel.Banish(g2,pos=POS_FACEDOWN)
  35.             end
  36.         end
  37.     end
  38. end
  39.  
  40. function s.banishfilter(c,e,tp,eg,ep,ev,re,r,rp)
  41.   return c:IsFacedown() and c:IsAbleToRemove()
  42. end
  43.  
  44. ```
  45.  
  46. This script creates an effect for a spell card that can only be activated if your opponent controls no "titan" monsters. When activated it allows you to add 1 "lightning" card from your deck to your hand. If you added "lightning-Maria" with this effect it also allows you to banish one facedown card your opponent controls. The effect of this card can only be activated once per turn.
  47.  
  48. I hope this helps! Let me know if you have any questions or need further assistance.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement