Advertisement
arcagamer

abre

Apr 1st, 2023
1,080
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 KB | None | 0 0
  1. local s,id,o=GetID()
  2. function s.initial_effect(c)
  3.     local e1=Effect.CreateEffect(c)
  4.     e1:SetCategory(CATEGORY_DRAW+CATEGORY_DESTROY)
  5.     e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
  6.     e1:SetCode(EVENT_SUMMON_SUCCESS)
  7.     e1:SetProperty(EFFECT_FLAG_DELAY)
  8.     e1:SetTarget(s.target)
  9.     e1:SetOperation(s.operation)
  10.     c:RegisterEffect(e1)
  11. end
  12. function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
  13.     if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
  14.     Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
  15. end
  16. function s.operation(e,tp,eg,ep,ev,re,r,rp)
  17.     if Duel.Draw(tp,2,REASON_EFFECT)==2 then
  18.         local g=Duel.GetOperatedGroup()
  19.         if g:IsExists(Card.IsType,1,nil,TYPE_SPELL) and Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) then
  20.             Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
  21.             local sg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
  22.             Duel.Destroy(sg,REASON_EFFECT)
  23.         end
  24.     end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement