Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Relampagos - Nia Meyer, Estrategista das Relampagos
- local s,id,o=GetID()
- function s.initial_effect(c)
- --negate effect
- local e0=Effect.CreateEffect(c)
- e0:SetDescription(aux.Stringid(id,0))
- e0:SetCategory(CATEGORY_NEGATE)
- e0:SetType(EFFECT_TYPE_QUICK_O)
- e0:SetCode(EVENT_CHAINING)
- e0:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
- e0:SetRange(LOCATION_MZONE)
- e0:SetCountLimit(1)
- --e0:SetCost(s.negcost)
- e0:SetCondition(s.negicon)
- e0:SetTarget(s.target)
- e0:SetOperation(s.negiop)
- c:RegisterEffect(e0)
- --negate attack and move
- local e1=Effect.CreateEffect(c)
- e1:SetDescription(aux.Stringid(id,1))
- e1:SetType(EFFECT_TYPE_QUICK_O)
- e1:SetCode(EVENT_ATTACK_ANNOUNCE)
- e1:SetRange(LOCATION_MZONE)
- e1:SetCountLimit(1)
- e1:SetCondition(s.atkcon)
- e1:SetTarget(s.atktg)
- e1:SetOperation(s.atkop)
- c:RegisterEffect(e1)
- --(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.
- local e2=Effect.CreateEffect(c)
- e2:SetDescription(aux.Stringid(id,2))
- e2:SetCategory(CATEGORY_NEGATE)
- e2:SetType(EFFECT_TYPE_QUICK_O)
- e2:SetCode(EVENT_FREE_CHAIN)
- e2:SetRange(LOCATION_GRAVE)
- e2:SetCost(aux.bfgcost)
- e2:SetTarget(s.negtg)
- e2:SetOperation(s.negop)
- c:RegisterEffect(e2)
- -- Effect to limit the number of copies on the field to 1
- local e5=Effect.CreateEffect(c)
- e5:SetType(EFFECT_TYPE_SINGLE)
- e5:SetCode(EFFECT_CANNOT_SUMMON)
- e5:SetCondition(s.sumcon)
- c:RegisterEffect(e5)
- local e6=e5:Clone()
- e6:SetCode(EFFECT_CANNOT_FLIP_SUMMON)
- c:RegisterEffect(e6)
- local e7=e5:Clone()
- e7:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
- c:RegisterEffect(e7)
- end
- function s.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
- local tc=re:GetHandler()
- if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
- Duel.MoveSequence(tc,1)
- end
- function s.negicon(e,tp,eg,ep,ev,re,r,rp)
- local c=e:GetHandler()
- local tc=re:GetHandler()
- if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
- local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
- return g and g:IsContains(c) and c:IsFaceup() and c:IsSetCard(0xb14) and c:IsLevelBelow(6) and Duel.IsChainNegatable(ev)
- end
- function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
- if chk==0 then return true end
- Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
- end
- function s.negiop(e,tp,eg,ep,ev,re,r,rp)
- local c=e:GetHandler()
- if Duel.NegateActivation(ev) and c:IsRelateToEffect(e) and c:IsControler(tp) then
- local p=c:GetControler()
- local seq=c:GetSequence()
- local flag=0
- if Duel.CheckLocation(p,LOCATION_MZONE,seq-1) then flag=flag+2^(seq-1) end
- if Duel.CheckLocation(p,LOCATION_MZONE,seq+1) then flag=flag+2^(seq+1) end
- if flag==0 then return end
- Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
- local nseq=math.log(Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,~flag),2)
- Duel.MoveSequence(c,nseq)
- end
- end
- function s.phgal(c)
- return c:IsMonster() and c:IsSetCard(0xb14) and c:IsLevelBelow(6)
- end
- function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
- if chkc then return chkc:IsOnField() end
- if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
- Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_NEGATE)
- local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
- Duel.SetOperationInfo(0,CATEGORY_NEGATE,g,1,0,0)
- end
- function s.negop(e,tp,eg,ep,ev,re,r,rp)
- local tc=Duel.GetFirstTarget()
- if tc:IsRelateToEffect(e) then
- local e1=Effect.CreateEffect(e:GetHandler())
- e1:SetType(EFFECT_TYPE_SINGLE)
- e1:SetCode(EFFECT_DISABLE)
- e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
- tc:RegisterEffect(e1)
- local e2=e1:Clone()
- e2:SetCode(EFFECT_DISABLE_EFFECT)
- tc:RegisterEffect(e2)
- end
- end
- function s.sumcon(e)
- return Duel.IsExistingMatchingCard(Card.IsCode,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil,id)
- end
- function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
- local at=Duel.GetAttackTarget()
- return at and at:IsControler(tp) and at:IsSetCard(0xb14) and at:IsLevelBelow(6) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
- end
- function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
- local at=Duel.GetAttackTarget()
- if chkc then return chkc==at end
- if chk==0 then return Duel.IsExistingMatchingCard(Auxiliary.FaceupFilter(Card.IsSetCard,0xb14),tp,LOCATION_MZONE,0,1,nil) end
- Duel.SetTargetCard(at)
- end
- function s.atkop(e,tp,eg,ep,ev,re,r,rp)
- local tc=Duel.GetFirstTarget()
- local c=e:GetHandler()
- if tc and tc:IsRelateToEffect(e) and tc:IsControler(tp) then
- Duel.NegateAttack()
- local p=c:GetControler()
- local seq=c:GetSequence()
- local flag=0
- if Duel.CheckLocation(p,LOCATION_MZONE,seq-1) then flag=flag+2^(seq-1) end
- if Duel.CheckLocation(p,LOCATION_MZONE,seq+1) then flag=flag+2^(seq+1) end
- --flag=flag&~tc:GetColumnZone(LOCATION_MZONE,tp,LOCATION_REASON_CONTROL)
- if flag==0 then return end
- Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
- local nseq=math.log(Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,~flag),2)
- Duel.MoveSequence(c,nseq)
- end
- end
Advertisement
Comments
-
- muito complexo kkkkk estou a aprender progamar ainda
Add Comment
Please, Sign In to add comment
Advertisement