--created by Discord \ MegaSausage, coded by Lyris, art generated by Dall-E2 AI --剣主徴兵 local s,id,o=GetID() function s.initial_effect(c) aux.AddCodeList(c,id-2,id-24) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetTarget(s.nctg) e1:SetOperation(s.ncop) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,id+o*10) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND) e2:SetCondition(function() return Duel.GetTurnPlayer()==c:GetControler() end) e2:SetTarget(s.rttg) e2:SetOperation(s.rtop) c:RegisterEffect(e2) end function s.filter(c) return c:IsFaceup() and c:IsLevel(4) and c:IsRace(RACE_WARRIOR) and not c:IsCode(id-2) end function s.nctg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) end function s.ncop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CHANGE_CODE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetValue(id-2) tc:RegisterEffect(e1) end function s.cfilter(c) return c:IsFaceupEx() and c:IsCode(id-24) and c:IsAbleToDeck() end function s.rttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and s.cfilter(chkc) end local c=e:GetHandler() if chk==0 then return Duel.IsExistingTarget(s.cfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) and c:IsAbleToHand() end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.SetOperationInfo(0,CATEGORY_TODECK,Duel.SelectTarget(tp,s.cfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil),1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0) end function s.rtop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_DECK) and c:IsRelateToEffect(e) then Duel.SendtoHand(c,nil,REASON_EFFECT) end end