Advertisement
arcagamer

Nia Meyer

Mar 26th, 2023 (edited)
739
1
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.07 KB | None | 1 0
  1. --Relampagos - Nia Meyer, Estrategista das Relampagos
  2. local s,id,o=GetID()
  3. function s.initial_effect(c)
  4.     --negate effect
  5.     local e0=Effect.CreateEffect(c)
  6.     e0:SetDescription(aux.Stringid(id,0))
  7.     e0:SetCategory(CATEGORY_NEGATE)
  8.     e0:SetType(EFFECT_TYPE_QUICK_O)
  9.     e0:SetCode(EVENT_CHAINING)
  10.     e0:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
  11.     e0:SetRange(LOCATION_MZONE)
  12.     e0:SetCountLimit(1)
  13.     --e0:SetCost(s.negcost)
  14.     e0:SetCondition(s.negicon)
  15.     e0:SetTarget(s.target)
  16.     e0:SetOperation(s.negiop)
  17.     c:RegisterEffect(e0)
  18.     --negate attack and move
  19.     local e1=Effect.CreateEffect(c)
  20.     e1:SetDescription(aux.Stringid(id,1))
  21.     e1:SetType(EFFECT_TYPE_QUICK_O)
  22.     e1:SetCode(EVENT_ATTACK_ANNOUNCE)
  23.     e1:SetRange(LOCATION_MZONE)
  24.     e1:SetCountLimit(1)
  25.     e1:SetCondition(s.atkcon)
  26.     e1:SetTarget(s.atktg)
  27.     e1:SetOperation(s.atkop)
  28.     c:RegisterEffect(e1)
  29.     --(Quick Effect) You can banish this card from your Graveyard; select 1 card on the field; negate its effect until the End Phase of this turn.
  30.     local e2=Effect.CreateEffect(c)
  31.     e2:SetDescription(aux.Stringid(id,2))
  32.     e2:SetCategory(CATEGORY_NEGATE)
  33.     e2:SetType(EFFECT_TYPE_QUICK_O)
  34.     e2:SetCode(EVENT_FREE_CHAIN)
  35.     e2:SetRange(LOCATION_GRAVE)
  36.     e2:SetCost(aux.bfgcost)
  37.     e2:SetTarget(s.negtg)
  38.     e2:SetOperation(s.negop)
  39.     c:RegisterEffect(e2)
  40.     -- Effect to limit the number of copies on the field to 1
  41.     local e5=Effect.CreateEffect(c)
  42.     e5:SetType(EFFECT_TYPE_SINGLE)
  43.     e5:SetCode(EFFECT_CANNOT_SUMMON)
  44.     e5:SetCondition(s.sumcon)
  45.     c:RegisterEffect(e5)
  46.     local e6=e5:Clone()
  47.     e6:SetCode(EFFECT_CANNOT_FLIP_SUMMON)
  48.     c:RegisterEffect(e6)
  49.     local e7=e5:Clone()
  50.     e7:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  51.     c:RegisterEffect(e7)
  52. end
  53. function s.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
  54.     local tc=re:GetHandler()
  55.     if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
  56.     Duel.MoveSequence(tc,1)
  57. end
  58. function s.negicon(e,tp,eg,ep,ev,re,r,rp)  
  59.     local c=e:GetHandler()
  60.     local tc=re:GetHandler()
  61.     if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
  62.     local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
  63.     return g and g:IsContains(c) and c:IsFaceup() and c:IsSetCard(0xb14) and c:IsLevelBelow(6) and Duel.IsChainNegatable(ev)
  64. end
  65. function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
  66.     if chk==0 then return true end
  67.     Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
  68. end
  69. function s.negiop(e,tp,eg,ep,ev,re,r,rp)
  70.     local c=e:GetHandler()
  71.     if Duel.NegateActivation(ev) and c:IsRelateToEffect(e) and c:IsControler(tp) then
  72.         local p=c:GetControler()
  73.         local seq=c:GetSequence()
  74.         local flag=0
  75.         if Duel.CheckLocation(p,LOCATION_MZONE,seq-1) then flag=flag+2^(seq-1) end
  76.         if Duel.CheckLocation(p,LOCATION_MZONE,seq+1) then flag=flag+2^(seq+1) end
  77.         if flag==0 then return end
  78.         Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
  79.         local nseq=math.log(Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,~flag),2)
  80.         Duel.MoveSequence(c,nseq)
  81.     end
  82. end
  83.  
  84. function s.phgal(c)
  85.     return c:IsMonster() and c:IsSetCard(0xb14) and c:IsLevelBelow(6)
  86. end
  87.  
  88. function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
  89.     if chkc then return chkc:IsOnField() end
  90.     if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
  91.     Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_NEGATE)
  92.     local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
  93.     Duel.SetOperationInfo(0,CATEGORY_NEGATE,g,1,0,0)
  94. end
  95. function s.negop(e,tp,eg,ep,ev,re,r,rp)
  96.     local tc=Duel.GetFirstTarget()
  97.     if tc:IsRelateToEffect(e) then
  98.         local e1=Effect.CreateEffect(e:GetHandler())
  99.         e1:SetType(EFFECT_TYPE_SINGLE)
  100.         e1:SetCode(EFFECT_DISABLE)
  101.         e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
  102.         tc:RegisterEffect(e1)
  103.         local e2=e1:Clone()
  104.         e2:SetCode(EFFECT_DISABLE_EFFECT)
  105.         tc:RegisterEffect(e2)
  106.     end
  107. end
  108. function s.sumcon(e)
  109.     return Duel.IsExistingMatchingCard(Card.IsCode,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil,id)
  110. end
  111.  
  112.  
  113.  
  114. function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
  115.     local at=Duel.GetAttackTarget()
  116.     return at and at:IsControler(tp) and at:IsSetCard(0xb14) and at:IsLevelBelow(6) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
  117. end
  118. function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
  119.     local at=Duel.GetAttackTarget()
  120.     if chkc then return chkc==at end
  121.     if chk==0 then return Duel.IsExistingMatchingCard(Auxiliary.FaceupFilter(Card.IsSetCard,0xb14),tp,LOCATION_MZONE,0,1,nil) end
  122.     Duel.SetTargetCard(at)
  123. end
  124. function s.atkop(e,tp,eg,ep,ev,re,r,rp)
  125.     local tc=Duel.GetFirstTarget()
  126.     local c=e:GetHandler()
  127.     if tc and tc:IsRelateToEffect(e) and tc:IsControler(tp) then
  128.         Duel.NegateAttack()
  129.         local p=c:GetControler()
  130.         local seq=c:GetSequence()
  131.         local flag=0
  132.         if Duel.CheckLocation(p,LOCATION_MZONE,seq-1) then flag=flag+2^(seq-1) end
  133.         if Duel.CheckLocation(p,LOCATION_MZONE,seq+1) then flag=flag+2^(seq+1) end
  134.         --flag=flag&~tc:GetColumnZone(LOCATION_MZONE,tp,LOCATION_REASON_CONTROL)
  135.         if flag==0 then return end
  136.         Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
  137.         local nseq=math.log(Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,~flag),2)
  138.         Duel.MoveSequence(c,nseq)
  139.     end
  140. end
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement