--Shadowflame Summoner --Design and code by Kindrindra local ref=_G['c'..28915255] function ref.initial_effect(c) --Special Summon local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,28915255) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e1:SetTarget(ref.sstg) e1:SetOperation(ref.ssop) c:RegisterEffect(e1) --Search local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e2:SetCode(EVENT_FREE_CHAIN) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,28915255) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e2:SetCondition(aux.exccon) e2:SetCost(ref.thcost) e2:SetTarget(ref.thtg) e2:SetOperation(ref.thop) c:RegisterEffect(e2) end function ref.actcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end if ref.sscost(e,tp,eg,ep,ev,re,r,rp,0) and ref.sstg(e,tp,eg,ep,ev,re,r,rp,0) and Duel.SelectYesNo(tp,aux.Stringid(0,28915255)) then e:SetOperation(ref.ssop) e:SetTarget(ref.sstg) ref.sscost(e,tp,eg,ep,ev,re,r,rp,chk) end end function ref.cfilter(c) return c:IsSetCard(0x729) and c:IsDiscardable() end function ref.sscost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(ref.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end Duel.DiscardHand(tp,ref.cfilter,1,1,REASON_COST+REASON_DISCARD) end function ref.ssfilter(c,tp) return c:IsSetCard(0x729) and c:IsType(TYPE_SPELL+TYPE_TRAP) and Duel.IsPlayerCanSpecialSummonMonster(tp,c:GetCode(),nil,0x4107,1000,1600,3,RACE_PYRO,ATTRIBUTE_DARK) end function ref.sstg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(ref.ssfilter,tp,LOCATION_DECK,0,1,nil,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function ref.ssop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tc=Duel.SelectMatchingCard(tp,ref.ssfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst() if tc then tc:SetStatus(STATUS_NO_LEVEL,false) local e1=Effect.CreateEffect(tc) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetValue(TYPE_NORMAL+TYPE_MONSTER+TYPE_TUNER) e1:SetReset(RESET_EVENT+0x47c0000) tc:RegisterEffect(e1,true) local e2=e1:Clone() e2:SetCode(EFFECT_CHANGE_RACE) e2:SetValue(RACE_PYRO) tc:RegisterEffect(e2,true) local e3=e1:Clone() e3:SetCode(EFFECT_CHANGE_ATTRIBUTE) e3:SetValue(ATTRIBUTE_DARK) tc:RegisterEffect(e3,true) local e4=e1:Clone() e4:SetCode(EFFECT_SET_BASE_ATTACK) e4:SetValue(1000) tc:RegisterEffect(e4,true) local e5=e1:Clone() e5:SetCode(EFFECT_SET_BASE_DEFENSE) e5:SetValue(1600) tc:RegisterEffect(e5,true) local e6=e1:Clone() e6:SetCode(EFFECT_CHANGE_LEVEL) e6:SetValue(3) tc:RegisterEffect(e6,true) Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP) end end function ref.thcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsAbleToRemoveAsCost() end Duel.Remove(c,POS_FACEUP,REASON_COST) end function ref.thfilter(c) return c:IsSetCard(0x729) and c:IsAbleToHand() and not c:IsCode(28915255) end function ref.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(ref.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function ref.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,ref.thfilter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end