Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Relampagos - Astrid Fischer,Velocista das Relampagos
- local s,id,o=GetID()
- function s.initial_effect(c)
- local e1=Effect.CreateEffect(c)
- e1:SetType(EFFECT_TYPE_QUICK_O)
- e1:SetCode(EVENT_FREE_CHAIN)
- e1:SetRange(LOCATION_MZONE)
- e1:SetTarget(s.target)
- e1:SetOperation(s.operation)
- c:RegisterEffect(e1)
- -- If this card is destroyed by a card effect: you can destroy 1 face-down card your opponent controls.
- local e2=Effect.CreateEffect(c)
- e2:SetCategory(CATEGORY_DESTROY)
- e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
- e2:SetCode(EVENT_DESTROYED)
- e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
- e2:SetCondition(s.descon)
- e2:SetTarget(s.destg)
- e2:SetOperation(s.desop)
- 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.sumcon(e)
- return Duel.IsExistingMatchingCard(Card.IsCode,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil,id)
- end
- function s.filter(c)
- return c:IsFaceup() and c:IsSetCard(0xb13) and not c:IsCode(id)
- end
- function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
- if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.filter(chkc) end
- if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_MZONE,1,nil) end
- Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
- local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_MZONE,1,1,nil)
- end
- function s.operation(e,tp,eg,ep,ev,re,r,rp)
- local tc=Duel.GetFirstTarget()
- if tc and tc:IsRelateToEffect(e) then
- Duel.SwapControl(e:GetHandler(),tc)
- Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
- local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
- if #g>0 then
- Duel.HintSelection(g)
- Duel.Destroy(g,REASON_EFFECT)
- if g:GetFirst():IsSetCard(0xb13) then
- local e1=Effect.CreateEffect(e:GetHandler())
- e1:SetType(EFFECT_TYPE_SINGLE)
- e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
- e1:SetValue(1)
- e1:SetReset(RESET_PHASE+PHASE_END,2)
- e:GetHandler():RegisterEffect(e1,true)
- local e2=e1:Clone()
- e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
- e:GetHandler():RegisterEffect(e2,true)
- end
- end
- end
- end
- function s.descon(e,tp,eg,ep,ev,re,r,rp)
- return (r&REASON_EFFECT)~=0
- end
- function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
- if chkc then return chkc:IsOnField() and chkc:IsFacedown() and chkc:IsControler(1-tp) end
- if chk==0 then return Duel.IsExistingTarget(Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,nil) end
- Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
- local g=Duel.SelectTarget(tp,Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,1,nil)
- Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
- end
- function s.desop(e,tp,eg,ep,ev,re,r,rp)
- local tc=Duel.GetFirstTarget()
- if tc and tc:IsRelateToEffect(e) then
- Duel.Destroy(tc,REASON_EFFECT)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement