--[[ Voidictator Servant - Rune Priestess Servitore dei Vuotodespoti - Sacerdotessa delle Rune Card Author: Walrus Scripted by: XGlitchy30 ]] local s,id=GetID() function s.initial_effect(c) --This card cannot be used as a material for the Summon of a monster from the Extra Deck while it is on the field. aux.CannotBeEDMaterial(c,nil,LOCATION_ONFIELD,true) --[[During your Main Phase: You can send 2 "Voidictator Rune" Spells/Traps from your hand or field to the GY; Special Summon this card from your hand.]] local e1=Effect.CreateEffect(c) e1:Desc(0) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:HOPT() e1:SetFunctions(nil,s.cost,s.target,s.operation) c:RegisterEffect(e1) --[[If this card is Normal or Special Summoned: You can Set 1 "Voidictator Rune" Spell/Trap directly from your Deck. It can be activated this turn.]] local e2=Effect.CreateEffect(c) e2:Desc(1) e2:SetType(EFFECT_TYPE_SINGLE|EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:HOPT() e2:SetFunctions(nil,nil,s.settg,s.setop) c:RegisterEffect(e2) e2:SpecialSummonEventClone(c) --[[If this card is banished because of a "Voidictator" card you own: You can either banish 1 Spell/Trap your opponent controls, or add 1 "Voidictator" Spell/Trap from your Deck or GY to your hand.]] local e3=Effect.CreateEffect(c) e3:Desc(2) e3:SetCategory(CATEGORY_REMOVE|CATEGORIES_SEARCH|CATEGORY_GRAVE_ACTION) e3:SetType(EFFECT_TYPE_SINGLE|EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_REMOVE) e3:HOPT() e3:SetFunctions(s.thcon,nil,s.thtg,s.thop) c:RegisterEffect(e3) aux.RegisterTriggeringArchetypeCheck(c,ARCHE_VOIDICTATOR) end --E1 function s.cfilter(c) return c:IsFaceupEx() and c:IsST() and c:IsSetCard(ARCHE_VOIDICTATOR_RUNE) and c:IsAbleToGraveAsCost() end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local g=Duel.Group(s.cfilter,tp,LOCATION_HAND|LOCATION_ONFIELD,0,c) if chk==0 then return g:CheckSubGroup(aux.mzctcheck,2,2,tp) end Duel.HintMessage(tp,HINTMSG_TOGRAVE) local tg=g:SelectSubGroup(tp,aux.mzctcheck,false,2,2,tp) if #tg>0 then Duel.SendtoGrave(tg,REASON_COST) end end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return (e:IsCostChecked() or Duel.GetMZoneCount(tp)>0) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetCardOperationInfo(c,CATEGORY_SPECIAL_SUMMON) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToChain() then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end --E2 function s.setfilter(c) return c:IsSetCard(ARCHE_VOIDICTATOR_RUNE) and c:IsST() and c:IsSSetable() end function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil) end end function s.setop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SSetAndFastActivation(tp,g,e) end end --E3 function s.thcon(e,tp,eg,ep,ev,re,r,rp) if not re then return false end local rc=re:GetHandler() return rc and aux.CheckArchetypeReasonEffect(s,re,ARCHE_VOIDICTATOR) and rc:IsOwner(tp) end function s.rmfilter(c) return c:IsSpellTrapOnField() and c:IsAbleToRemove() end function s.thfilter(c) return c:IsST() and c:IsSetCard(ARCHE_VOIDICTATOR) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) local b1=Duel.IsExistingMatchingCard(s.rmfilter,tp,0,LOCATION_ONFIELD,1,nil) local b2=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK|LOCATION_GRAVE,0,1,nil) if chk==0 then return b1 or b2 end Duel.SetPossibleOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_ONFIELD) Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK|LOCATION_GRAVE) end function s.thop(e,tp,eg,ep,ev,re,r,rp) local b1=Duel.IsExistingMatchingCard(s.rmfilter,tp,0,LOCATION_ONFIELD,1,nil) local b2=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK|LOCATION_GRAVE,0,1,nil) if not b1 and not b2 then return end local opt=aux.Option(tp,nil,nil,{b1,STRING_BANISH},{b2,STRING_ADD_TO_HAND}) if opt==0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.rmfilter,tp,0,LOCATION_ONFIELD,1,1,nil) if #g>0 then Duel.HintSelection(g) Duel.Remove(g,POS_FACEUP,REASON_EFFECT) end elseif opt==1 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,aux.Necro(s.thfilter),tp,LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil) if #g>0 then Duel.Search(g,tp) end end end