Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Odd Eyes Raging Light Dragon
- function c17690501.initial_effect(c)
- --xyz summon
- aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_DRAGON),7,2)
- c:EnableReviveLimit()
- --pendulum summon
- aux.EnablePendulumAttribute(c,false)
- --pendulum set
- local e1=Effect.CreateEffect(c)
- e1:SetDescription(aux.Stringid(17690501,0))
- e1:SetType(EFFECT_TYPE_IGNITION)
- e1:SetRange(LOCATION_PZONE)
- e1:SetCountLimit(1)
- e1:SetTarget(c17690501.pctg)
- e1:SetOperation(c17690501.pcop)
- c:RegisterEffect(e1)
- --summon success
- local e2=Effect.CreateEffect(c)
- e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
- e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
- e2:SetCode(EVENT_SPSUMMON_SUCCESS)
- e2:SetCondition(c17690501.regcon)
- e2:SetOperation(c17690501.regop)
- c:RegisterEffect(e2)
- local e3=Effect.CreateEffect(c)
- e3:SetType(EFFECT_TYPE_SINGLE)
- e3:SetCode(EFFECT_MATERIAL_CHECK)
- e3:SetValue(c17690501.valcheck)
- e3:SetLabelObject(e2)
- c:RegisterEffect(e3)
- --extra attack
- local e4=Effect.CreateEffect(c)
- e4:SetType(EFFECT_TYPE_SINGLE)
- e4:SetCode(EFFECT_EXTRA_ATTACK)
- e4:SetValue(1)
- e4:SetCondition(c17690501.effcon)
- c:RegisterEffect(e4)
- --destroy
- local e5=Effect.CreateEffect(c)
- e5:SetDescription(aux.Stringid(17690501,1))
- e5:SetCategory(CATEGORY_RECOVER)
- e5:SetProperty(EFFECT_FLAG2_XMDETACH)
- e5:SetType(EFFECT_TYPE_IGNITION)
- e5:SetRange(LOCATION_MZONE)
- e5:SetCountLimit(1)
- e5:SetCondition(c17690501.effcon)
- e5:SetCost(c17690501.descost)
- e5:SetTarget(c17690501.destg)
- e5:SetOperation(c17690501.desop)
- c:RegisterEffect(e5)
- --pendulum
- local e6=Effect.CreateEffect(c)
- e6:SetDescription(aux.Stringid(17690501,2))
- e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
- e6:SetCode(EVENT_DESTROYED)
- e6:SetProperty(EFFECT_FLAG_DELAY)
- e6:SetCondition(c17690501.pencon)
- e6:SetTarget(c17690501.pentg)
- e6:SetOperation(c17690501.penop)
- c:RegisterEffect(e6)
- end
- c17690501.pendulum_level=7
- function c17690501.pcfilter(c)
- return c:IsType(TYPE_PENDULUM) and not c:IsForbidden()
- end
- function c17690501.pctg(e,tp,eg,ep,ev,re,r,rp,chk)
- local seq=e:GetHandler():GetSequence()
- if chk==0 then return Duel.CheckLocation(tp,LOCATION_SZONE,13-seq)
- and Duel.IsExistingMatchingCard(c17690501.pcfilter,tp,LOCATION_DECK,0,1,nil) end
- end
- function c17690501.pcop(e,tp,eg,ep,ev,re,r,rp)
- if not e:GetHandler():IsRelateToEffect(e) then return end
- local seq=e:GetHandler():GetSequence()
- if not Duel.CheckLocation(tp,LOCATION_SZONE,13-seq) then return end
- Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
- local g=Duel.SelectMatchingCard(tp,c17690501.pcfilter,tp,LOCATION_DECK,0,1,1,nil)
- if g:GetCount()>0 then
- Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
- end
- end
- function c17690501.regcon(e,tp,eg,ep,ev,re,r,rp)
- return e:GetHandler():GetSummonType()==SUMMON_TYPE_XYZ and e:GetLabel()==1
- end
- function c17690501.regop(e,tp,eg,ep,ev,re,r,rp)
- local c=e:GetHandler()
- c:RegisterFlagEffect(17690501,RESET_EVENT+0x1fe0000,0,1)
- c:RegisterFlagEffect(0,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(17690501,3))
- end
- function c17690501.effcon(e)
- return e:GetHandler():GetFlagEffect(17690501)>0
- end
- function c17690501.descost(e,tp,eg,ep,ev,re,r,rp,chk)
- if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
- e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
- end
- function c17690501.destg(e,tp,eg,ep,ev,re,r,rp,chk)
- if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>0 end
- local sg=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
- Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
- end
- function c17690501.desop(e,tp,eg,ep,ev,re,r,rp)
- local c=e:GetHandler()
- local sg=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
- local ct=Duel.Destroy(sg,REASON_EFFECT)
- if ct>0 and c:IsFaceup() and c:IsRelateToEffect(e) then
- local e1=Effect.CreateEffect(c)
- e1:SetType(EFFECT_TYPE_SINGLE)
- e1:SetCode(EFFECT_UPDATE_ATTACK)
- e1:SetValue(ct*100)
- e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
- c:RegisterEffect(e1)
- end
- end
- function c17690501.valcheck(e,c)
- local g=c:GetMaterial()
- if g:IsExists(Card.IsType,1,nil,TYPE_XYZ) then
- e:GetLabelObject():SetLabel(1)
- else
- e:GetLabelObject():SetLabel(0)
- end
- end
- function c17690501.pencon(e,tp,eg,ep,ev,re,r,rp)
- local c=e:GetHandler()
- return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup()
- end
- function c17690501.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
- if chk==0 then return Duel.CheckLocation(tp,LOCATION_SZONE,6) or Duel.CheckLocation(tp,LOCATION_SZONE,7) end
- end
- function c17690501.penop(e,tp,eg,ep,ev,re,r,rp)
- if not Duel.CheckLocation(tp,LOCATION_SZONE,6) and not Duel.CheckLocation(tp,LOCATION_SZONE,7) then return false end
- local c=e:GetHandler()
- if c:IsRelateToEffect(e) then
- Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement