Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Hail To The King - Lelouch Le Britannia
- --2 Level 8 Spellcaster monsters
- --Once per turn: You can detach 1 material from this card; activate one of these effects(quick effect).
- --Target 1 face-up monster your opponent controls; take control of it until the end phase, but it cannot attack or activate its effects.
- --Target 1 face-up card your opponent controls; negate its effects until the end phase, then draw 1 card.
- --Target up to 3 cards in your opponent’s graveyard; banish them, and if you do,inflict 300 damage and draw 1 card for each card banished by this effect.
- local s,id=GetID()
- function s.initial_effect(c)
- --xyz summon
- Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_SPELLCASTER),8,2)
- c:EnableReviveLimit()
- --activate one of three effects once per turn
- local e1=Effect.CreateEffect(c)
- e1:SetDescription(aux.Stringid(id,0))
- e1:SetCategory(CATEGORY_CONTROL)
- e1:SetType(EFFECT_TYPE_QUICK_O)
- e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
- e1:SetCode(EVENT_FREE_CHAIN)
- e1:SetRange(LOCATION_MZONE)
- e1:SetCountLimit(1,id)
- e1:SetCost(s.cost)
- e1:SetTarget(s.target)
- e1:SetOperation(s.operation)
- c:RegisterEffect(e1,false,REGISTER_FLAG_DETACH_XMAT)
- local e2=e1:Clone()
- e2:SetDescription(aux.Stringid(id,1))
- e2:SetCategory(CATEGORY_NEGATE)
- e2:SetTarget(s.target2)
- e2:SetOperation(s.operation2)
- c:RegisterEffect(e2,false,REGISTER_FLAG_DETACH_XMAT)
- local e3=e2:Clone()
- e3:SetDescription(aux.Stringid(id,2))
- e3:SetCategory(CATEGORY_NEGATE)
- e3:SetTarget(s.target3)
- e3:SetOperation(s.operation3)
- c:RegisterEffect(e3,false,REGISTER_FLAG_DETACH_XMAT)
- --special summon
- local e4=Effect.CreateEffect(c)
- e4:SetDescription(aux.Stringid(id,3))
- e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
- e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
- e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
- e4:SetCode(EVENT_TO_GRAVE)
- e4:SetCountLimit(1,id+100)
- e4:SetCondition(s.spcon)
- e4:SetTarget(s.sptg)
- e4:SetOperation(s.spop)
- c:RegisterEffect(e4)
- end
- s.listed_names={id}
- function s.cost(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 s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
- if chkc then return chkc:GetLocation()==LOCATION_MZONE and chkc:GetControler()~=tp and chkc:IsControlerCanBeChanged() end
- if chk==0 then return Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) end
- Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
- local g=Duel.SelectTarget(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil)
- Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
- end
- function s.operation(e,tp,eg,ep,ev,re,r,rp,chkc)
- local c=e:GetHandler()
- local tc=Duel.GetFirstTarget()
- if tc:IsRelateToEffect(e) and Duel.GetControl(tc,tp,PHASE_END,1)~=0 then
- local e1=Effect.CreateEffect(c)
- local reset=RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_PHASE+PHASE_END
- e1:SetType(EFFECT_TYPE_SINGLE)
- e1:SetCode(EFFECT_CANNOT_ACTIVATE)
- e1:SetReset(reset)
- e1:SetValue(1)
- tc:RegisterEffect(e1)
- local e3=Effect.CreateEffect(c)
- e3:SetType(EFFECT_TYPE_SINGLE)
- e3:SetCode(EFFECT_CANNOT_ATTACK)
- e3:SetReset(reset)
- tc:RegisterEffect(e3)
- end
- end
- function s.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
- if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() and chkc:IsControler(1-tp) end
- if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
- Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
- local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
- Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
- end
- function s.operation2(e,tp,eg,ep,ev,re,r,rp,chkc)
- local c=e:GetHandler()
- local tc=Duel.GetFirstTarget()
- if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then
- Duel.NegateRelatedChain(tc,RESET_TURN_SET)
- local e2=Effect.CreateEffect(c)
- e2:SetType(EFFECT_TYPE_SINGLE)
- e2:SetCode(EFFECT_DISABLE)
- e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
- tc:RegisterEffect(e2)
- local e3=Effect.CreateEffect(c)
- e3:SetType(EFFECT_TYPE_SINGLE)
- e3:SetCode(EFFECT_DISABLE_EFFECT)
- e3:SetValue(RESET_TURN_SET)
- e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
- tc:RegisterEffect(e3)
- Duel.Draw(tp,1,REASON_EFFECT)
- end
- end
- function s.rmfilter(c)
- return c:IsAbleToRemove() and aux.SpElimFilter(c)
- end
- function s.target3(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
- if chkc then return chkc:IsLocation(LOCATION_GRAVE) and s.rmfilter(chkc) end
- if chk==0 then return Duel.IsExistingTarget(s.rmfilter,tp,0,LOCATION_GRAVE,1,nil) end
- Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
- local g=Duel.SelectTarget(tp,s.rmfilter,tp,0,LOCATION_GRAVE,1,3,nil)
- Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0)
- end
- function s.operation3(e,tp,eg,ep,ev,re,r,rp,chkc)
- local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
- local sg=g:Filter(Card.IsRelateToEffect,nil,e)
- local tamanho = #sg
- Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
- Duel.Damage(1-tp,300*tamanho,REASON_EFFECT)
- Duel.Draw(tp,1*tamanho,REASON_EFFECT)
- end
- function s.spfilter(c,e,tp)
- return c:IsType(TYPE_XYZ) and c:IsRace(RACE_SPELLCASTER) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
- end
- function s.spcon(e,tp,eg,ep,ev,re,r,rp)
- local c=e:GetHandler()
- return c:IsPreviousControler(tp) and rp==1-tp and c:IsReason(REASON_DESTROY)
- end
- function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
- if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end
- if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
- and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
- Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
- local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
- Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
- end
- function s.spop(e,tp,eg,ep,ev,re,r,rp)
- if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
- local c=e:GetHandler()
- local tc=Duel.GetFirstTarget()
- if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
- if c:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
- Duel.Overlay(tc,c)
- end
- end
- Duel.SpecialSummonComplete()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement