--Runeforged Number Rat local cid,id=GetID() function cid.initial_effect(c) c:EnableReviveLimit() aux.AddFusionProcCodeFun(c,80000800,aux.FilterBoolFunction(Card.IsFusionSetCard,0x48),1,true,true) Auxiliary.Add_Runeslots(c,1) local e0=Effect.CreateEffect(c) e0:SetCategory(CATEGORY_DRAW+CATEGORY_TODECK) e0:SetType(EFFECT_TYPE_IGNITION) e0:SetRange(LOCATION_MZONE) e0:SetCountLimit(1) e0:SetDescription(aux.Stringid(id,0)) e0:SetTarget(cid.drtg) e0:SetOperation(cid.drop) c:RegisterEffect(e0) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCode(EVENT_TO_HAND) e1:SetRange(LOCATION_MZONE) e1:SetCondition(cid.drcon1) e1:SetOperation(cid.drop1) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e2:SetCode(EVENT_TO_HAND) e2:SetRange(LOCATION_MZONE) e2:SetCondition(cid.regcon) e2:SetOperation(cid.regop) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e3:SetCode(EVENT_CHAIN_SOLVED) e3:SetRange(LOCATION_MZONE) e3:SetCondition(cid.drcon2) e3:SetOperation(cid.drop2) c:RegisterEffect(e3) end function cid.cfilter(c,tp) return c:IsPreviousLocation(LOCATION_DECK+LOCATION_GRAVE) end function cid.drcon1(e,tp,eg,ep,ev,re,r,rp) if re == nil then return end local red = 0x1ff5 local blue = 0x2ff5 local purple = 0x3ff5 local yellow = 0x4ff5 local orange = 0x5ff5 local green = 0x6ff5 local prismatic = 0x7ff5 return eg:IsExists(cid.cfilter,1,nil,tp) and e:GetHandler():GetOverlayGroup():IsExists(Card.IsSetCard,1,nil,yellow) and (not re:IsHasType(EFFECT_TYPE_ACTIONS) or re:IsHasType(EFFECT_TYPE_CONTINUOUS)) end function cid.drop1(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_CARD,0,id) Duel.GainRP(e:GetHandlerPlayer(),100) end function cid.regcon(e,tp,eg,ep,ev,re,r,rp) if re == nil then return end local red = 0x1ff5 local blue = 0x2ff5 local purple = 0x3ff5 local yellow = 0x4ff5 local orange = 0x5ff5 local green = 0x6ff5 local prismatic = 0x7ff5 return eg:IsExists(cid.cfilter,1,nil,tp) and e:GetHandler():GetOverlayGroup():IsExists(Card.IsSetCard,1,nil,yellow) and Duel.GetFlagEffect(tp,id)==0 and re:IsHasType(EFFECT_TYPE_ACTIONS) and not re:IsHasType(EFFECT_TYPE_CONTINUOUS) end function cid.regop(e,tp,eg,ep,ev,re,r,rp) Duel.RegisterFlagEffect(tp,id,RESET_CHAIN,0,1) end function cid.drcon2(e,tp,eg,ep,ev,re,r,rp) return Duel.GetFlagEffect(tp,id)>0 end function cid.drop2(e,tp,eg,ep,ev,re,r,rp) Duel.ResetFlagEffect(tp,id) Duel.Hint(HINT_CARD,0,id) Duel.GainRP(e:GetHandlerPlayer(),100) end function cid.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function cid.drop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local ct=Duel.Draw(p,d,REASON_EFFECT) if ct~=0 then Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_HAND,0,1,1,nil) Duel.SendtoDeck(g,nil,2,REASON_EFFECT) end end