--Divine-Revelation local s,id=GetID() function s.initial_effect(c) --Add local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e1:SetCost(s.cost) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) --Send 1 local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOGRAVE) e2:SetType(EFFECT_TYPE_ACTIVATE) e2:SetCode(EVENT_FREE_CHAIN) e2:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e2:SetCost(s.cost2) e2:SetTarget(s.stg) e2:SetOperation(s.sop) c:RegisterEffect(e2) --Banish 1+1 local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_REMOVE) e3:SetType(EFFECT_TYPE_ACTIVATE) e3:SetCode(EVENT_FREE_CHAIN) e3:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e3:SetCost(s.cost3) e3:SetTarget(s.rmtg) e3:SetOperation(s.rmop) c:RegisterEffect(e3) --Shuffle 2 local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,3)) e4:SetCategory(CATEGORY_TODECK) e4:SetType(EFFECT_TYPE_ACTIVATE) e4:SetCode(EVENT_FREE_CHAIN) e4:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) e4:SetCost(s.cost4) e4:SetTarget(s.tdtg) e4:SetOperation(s.tdop) c:RegisterEffect(e4) end function s.xyzfilter(c) return c:IsType(TYPE_XYZ) and c:IsSetCard(0x12D9) and c:IsFaceup() end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) local dg=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_MZONE,0,nil) if chk==0 then return Duel.CheckRemoveOverlayCard(tp,0,0,1,REASON_COST,dg) end Duel.RemoveOverlayCard(tp,0,0,1,1,REASON_COST,dg) end function s.cost2(e,tp,eg,ep,ev,re,r,rp,chk) local dg=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_MZONE,0,nil) if chk==0 then return Duel.CheckRemoveOverlayCard(tp,0,0,2,REASON_COST,dg) end Duel.RemoveOverlayCard(tp,0,0,2,2,REASON_COST,dg) end function s.cost3(e,tp,eg,ep,ev,re,r,rp,chk) local dg=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_MZONE,0,nil) if chk==0 then return Duel.CheckRemoveOverlayCard(tp,0,0,3,REASON_COST,dg) end Duel.RemoveOverlayCard(tp,0,0,3,3,REASON_COST,dg) end function s.cost4(e,tp,eg,ep,ev,re,r,rp,chk) local dg=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_MZONE,0,nil) if chk==0 then return Duel.CheckRemoveOverlayCard(tp,0,0,4,REASON_COST,dg) end Duel.RemoveOverlayCard(tp,0,0,4,4,REASON_COST,dg) end function s.thfilter(c) return c:IsSetCard(0x12D9) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end function s.stg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler()) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0) end function s.sop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler()) if #g>0 then Duel.HintSelection(g) Duel.SendtoGrave(g,REASON_EFFECT) end end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return not Duel.IsPlayerAffectedByEffect(e:GetHandlerPlayer(),69832741) and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,LOCATION_ONFIELD+LOCATION_GRAVE) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local g1=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) local g2=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_GRAVE,nil) if #g1>0 and #g2>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local sg1=g1:RandomSelect(tp,1) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local sg2=g2:Select(tp,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) sg1:Merge(sg2) Duel.HintSelection(sg1) Duel.Remove(sg1,POS_FACEUP,REASON_EFFECT) end end function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_GRAVE+LOCATION_ONFIELD,LOCATION_GRAVE+LOCATION_ONFIELD,2,nil) end Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE+LOCATION_ONFIELD) end function s.tdop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsAbleToDeck),tp,LOCATION_GRAVE+LOCATION_ONFIELD,LOCATION_GRAVE+LOCATION_ONFIELD,2,2,nil) if #g>0 then Duel.SendtoDeck(g,nil,2,REASON_EFFECT) end end