--[[ Voidictator Rune - Final Verdict Runa dei Vuotodespoti - Verdetto Finale Card Author: Walrus Scripted by: XGlitchy30 ]] local s,id=GetID() function s.initial_effect(c) --[[If you control a "Voidictator" card: Banish 1 face-up card your opponent controls. If you control "Voidictator Deity - Nemesis the Grand Judge", you can banish up to 3 cards your opponent controls instead. Your opponent cannot activate cards or effects in response to this effect's activation if you control "Voidictator Deity - Nemesis the Grand Judge".]] local e1=Effect.CreateEffect(c) e1:Desc(0) e1:SetCategory(CATEGORY_REMOVE) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:HOPT() e1:SetRelevantTimings() e1:SetFunctions(s.condition,nil,s.target,s.activate) c:RegisterEffect(e1) --[[If this card is banished because of a "Voidictator" card you own: You can Tribute 1 "Voidictator Servant" monster from your hand or field; Set this card.]] local e2=Effect.CreateEffect(c) e2:Desc(1) e2:SetType(EFFECT_TYPE_SINGLE|EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_REMOVE) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SHOPT() e2:SetCondition(s.setcon) e2:SetCost(s.setcost) e2:SetTarget(s.settg) e2:SetOperation(s.setop) c:RegisterEffect(e2) aux.RegisterTriggeringArchetypeCheck(c,ARCHE_VOIDICTATOR) end --E1 function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExists(false,aux.FaceupFilter(Card.IsSetCard,ARCHE_VOIDICTATOR),tp,LOCATION_ONFIELD,0,1,nil) end function s.rmfilter(c) return c:IsFaceup() and c:IsAbleToRemove() end function s.chfilter(c) return c:IsFaceup() and c:IsCode(CARD_VOIDICTATOR_DEITY_NEMESIS) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExists(false,s.rmfilter,tp,0,LOCATION_ONFIELD,1,nil) end Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_ONFIELD) if Duel.IsExists(false,s.chfilter,tp,LOCATION_ONFIELD,0,1,nil) then Duel.SetChainLimit(s.chlimit) end end function s.chlimit(e,ep,tp) return tp==ep end function s.activate(e,tp,eg,ep,ev,re,r,rp) local max=Duel.IsExists(false,s.chfilter,tp,LOCATION_ONFIELD,0,1,nil) and 3 or 1 local g=Duel.Select(HINTMSG_REMOVE,false,tp,s.rmfilter,tp,0,LOCATION_ONFIELD,1,max,nil) if #g>0 then Duel.HintSelection(g) Duel.Remove(g,POS_FACEUP,REASON_EFFECT) end end --E2 function s.setcon(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.cfilter(c) return (c:IsLocation(LOCATION_MZONE) or c:IsMonster()) and c:IsSetCard(ARCHE_VOIDICTATOR_SERVANT) end function s.setcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroupEx(tp,s.cfilter,1,REASON_COST,true,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) local g=Duel.SelectReleaseGroupEx(tp,s.cfilter,1,1,REASON_COST,true,nil) Duel.Release(g,REASON_COST) end function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsSSetable() end end function s.setop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToChain() and c:IsSSetable() then Duel.SSet(tp,c) end end