--created by Walrus, coded by Lyris, art from Shadowverse's "Triscythe Reaper" local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() c:SetUniqueOnField(1,0,id) local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,1)) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(function() return c:IsSummonType(SUMMON_TYPE_RITUAL) end) e1:SetTarget(s.copytg) e1:SetOperation(s.copyop) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetHintTiming(0,TIMING_STANDBY_PHASE) e2:SetCondition(function(e,tp) return Duel.GetTurnPlayer()~=tp and Duel.GetCurrentPhase()==PHASE_STANDBY end) e2:SetCost(s.cost) e2:SetOperation(s.atkop) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetCode(EVENT_LEAVE_FIELD) e3:SetCountLimit(1,id) e3:SetCategory(CATEGORY_DESTROY+CATEGORY_SEARCH+CATEGORY_TOHAND) e3:SetCondition(function() return c:IsSummonType(SUMMON_TYPE_RITUAL) and c:IsPreviousPosition(POS_FACEUP) end) e3:SetTarget(s.tg) e3:SetOperation(s.op) c:RegisterEffect(e3) end function s.cpfilter(c) return c:GetType()&0xa0==0xa0 and c:IsSetCard(0x106) and not c:IsCode(id) end function s.copytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.cpfilter(chkc) end if chk==0 then return true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.SelectTarget(tp,s.cpfilter,tp,LOCATION_GRAVE,0,1,1,nil) end function s.copyop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) and c:IsFaceup() then c:CopyEffect(tc:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD,1) end end function s.cfilter(c) return c:IsSetCard(0x106) and c:IsType(TYPE_MONSTER) and c:IsDiscardable() end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,s.cfilter,1,1,REASON_COST+REASON_DISCARD) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(s.drcon1) e1:SetOperation(s.drop1) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCondition(s.regcon) e2:SetOperation(s.regop) e2:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e2,tp) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e3:SetCode(EVENT_CHAIN_SOLVED) e3:SetCondition(s.drcon2) e3:SetOperation(s.drop2) e3:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e3,tp) end function s.filter(c,sp) return c:GetSummonPlayer()==sp end function s.drcon1(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.filter,1,nil,1-tp) and (not re:IsHasType(EFFECT_TYPE_ACTIONS) or re:IsHasType(EFFECT_TYPE_CONTINUOUS)) end function s.drop1(e,tp,eg,ep,ev,re,r,rp) local c=e:GetOwner() local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE) e1:SetValue(500) c:RegisterEffect(e1) end function s.regcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.filter,1,nil,1-tp) and re:IsHasType(EFFECT_TYPE_ACTIONS) and not re:IsHasType(EFFECT_TYPE_CONTINUOUS) end function s.regop(e,tp,eg,ep,ev,re,r,rp) Duel.RegisterFlagEffect(tp,id,RESET_CHAIN,0,1) end function s.drcon2(e,tp,eg,ep,ev,re,r,rp) return Duel.GetFlagEffect(tp,id)>0 end function s.drop2(e,tp,eg,ep,ev,re,r,rp) local n=Duel.GetFlagEffect(tp,id) Duel.ResetFlagEffect(tp,id) for i=1,n do s.drop1(e,tp,eg,ep,ev,re,r,rp) end end function s.tg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,LOCATION_MZONE) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.sfilter(c) return c:IsSetCard(0x106) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsCode(id) end function s.thfilter(c) return c:IsSetCard(0x106) and c:GetType()&0x82==0x82 and c:IsAbleToHand() end function s.op(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,LOCATION_MZONE) if Duel.Destroy(g,REASON_EFFECT)~=#g then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local sg=Duel.SelectMatchingCard(tp,s.sfilter,tp,LOCATION_DECK,0,1,1,nil) if Duel.SendtoHand(sg,nil,REASON_EFFECT)==0 then return end Duel.ConfirmCards(1-tp,sg) if not sg:GetFirst():IsType(TYPE_RITUAL) then Duel.ShuffleHand(tp) return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_GRAVE,0,1,1,nil) if #tg>0 then Duel.BreakEffect() Duel.SendtoHand(tg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tg) end end