--created by Dragonecro, coded by Lyris local cid,id=GetID() function cid.initial_effect(c) local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_ACTIVATE) e0:SetCode(EVENT_FREE_CHAIN) e0:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e0:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e0:SetOperation(cid.activate) c:RegisterEffect(e0) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetRange(LOCATION_FZONE) e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xff2)) e1:SetValue(300) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_FZONE) e3:SetCountLimit(1) e3:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON) e3:SetDescription(2) e3:SetTarget(cid.target) e3:SetOperation(cid.operation) c:RegisterEffect(e3) local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_FZONE) e4:SetCountLimit(1) e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e4:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW) e4:SetDescription(1108) e4:SetTarget(cid.drtg) e4:SetOperation(cid.drop) c:RegisterEffect(e4) local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) e5:SetCode(EFFECT_DESTROY_REPLACE) e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e5:SetRange(LOCATION_FZONE) e5:SetCountLimit(1) e5:SetTarget(cid.desreptg) e5:SetOperation(cid.desrepop) c:RegisterEffect(e5) end function cid.filter(c) return c:IsSetCard(0xff2) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() end function cid.activate(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local g=Duel.GetMatchingGroup(cid.filter,tp,LOCATION_DECK,0,nil) if g:GetCount()>0 and Duel.SelectYesNo(tp,1190) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local sg=g:Select(tp,1,1,nil) Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,sg) end end function cid.filter1(c,e,tp) return c:IsFaceup() and c:IsSetCard(0xff2) and Duel.GetMZoneCount(tp,c)>0 and Duel.IsExistingMatchingCard(cid.filter2,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetCode()) end function cid.filter2(c,e,tp,code) return c:IsSetCard(0xff2) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(code) end function cid.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cid.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_MZONE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function cid.operation(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,cid.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp) if #g>0 and Duel.Destroy(g,REASON_EFFECT)~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=Duel.SelectMatchingCard(tp,cid.filter2,tp,LOCATION_DECK,0,1,1,nil,e,tp,g:GetFirst():GetCode()) if #sg>0 then Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) end end end function cid.dfilter(c) return c:IsSetCard(0xff2) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck() and not c:IsPublic() end function cid.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp) and Duel.IsExistingMatchingCard(cid.dfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end Duel.SetTargetPlayer(tp) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND) end function cid.drop(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(p,cid.dfilter,p,LOCATION_HAND,0,1,63,nil) if g:GetCount()>0 then Duel.ConfirmCards(1-p,g) local ct=Duel.SendtoDeck(g,nil,2,REASON_EFFECT) Duel.ShuffleDeck(p) Duel.BreakEffect() Duel.Draw(p,ct+1,REASON_EFFECT) end end function cid.repfilter(c) return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xff2) and c:IsAbleToRemove() end function cid.desreptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsReason(REASON_EFFECT) and Duel.IsExistingMatchingCard(cid.repfilter,tp,LOCATION_GRAVE,0,1,nil) end return Duel.SelectEffectYesNo(tp,e:GetHandler(),96) end function cid.desrepop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.SelectMatchingCard(tp,cid.repfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_EFFECT) end