--Lupo Bushido --Script by XGlitchy30 local cid,id=GetID() function cid.initial_effect(c) --cannot be target local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetValue(cid.tgval) c:RegisterEffect(e1) --NS/Monster Search local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e2:SetTarget(cid.thtg1) e2:SetOperation(cid.thop1) c:RegisterEffect(e2) --SS local e3=Effect.CreateEffect(c) e3:Desc(1) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_GRAVE) e3:SetCountLimit(1,id+100+EFFECT_COUNT_CODE_OATH) e3:SetCost(cid.spcost) e3:SetTarget(cid.sptg) e3:SetOperation(cid.spop) c:RegisterEffect(e3) end function cid.tgval(e,re,rp) local rc=re:GetHandler() return rc:IsLocation(LOCATION_MZONE) and re:IsActiveType(TYPE_MONSTER) and rc:IsControler(1-e:GetHandlerPlayer()) and rc:IsSummonType(SUMMON_TYPE_SPECIAL) end function cid.filter1(c) return c:IsSetCard(0x4b0) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() end function cid.filter2(c) return c:IsSetCard(0x4b0) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand() end function cid.thtg1(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cid.filter1,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function cid.thop1(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,cid.filter1,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.Search(g,tp) end end function cid.spcost(e,tp,eg,ep,ev,re,r,rp,chk) e:SetLabel(1) if chk==0 then return aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,chk) end aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,chk) end function cid.spfilter(c,e,tp) return c:IsType(TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK) and c:IsSetCard(0x4b0) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK) end function cid.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local exc = e:GetLabel()==1 and e:GetHandler() or nil e:SetLabel(0) return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cid.spfilter,tp,LOCATION_GRAVE,0,1,exc,e,tp) end e:SetLabel(0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) end function cid.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cid.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummonATKDEF(e,g,0,tp,tp,false,false,POS_FACEUP_ATTACK,nil,0,0) end end