--Celestial Swordsman LV6 function c249001120.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(2) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_PHASE+PHASE_BATTLE) e1:SetRange(LOCATION_MZONE) e1:SetCondition(c249001120.spcon) e1:SetTarget(c249001120.sptg) e1:SetOperation(c249001120.spop) c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(65192027,2)) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(2) e2:SetCost(c249001120.cost) e2:SetTarget(c249001120.target) e2:SetOperation(c249001120.operation) c:RegisterEffect(e2) --special summon local e3=Effect.CreateEffect(c) e3:SetDescription(2) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCost(c249001120.spcost) e3:SetTarget(c249001120.sptg) e3:SetOperation(c249001120.spop) c:RegisterEffect(e3) end c249001120.lvup={249001121} c249001120.lvdn={249001119} function c249001120.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetBattledGroupCount()>0 end function c249001120.spfilter(c,e,tp) return c:IsCode(249001121) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) end function c249001120.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c249001120.spfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE) end function c249001120.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) or c:IsFacedown() or not Duel.IsExistingMatchingCard(c249001120.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c249001120.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp) local tc=g:GetFirst() if tc then Duel.SendtoGrave(c,REASON_EFFECT) Duel.SpecialSummon(tc,0,tp,tp,true,true,POS_FACEUP) tc:CompleteProcedure() end end function c249001120.costfilter(c) return c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() end function c249001120.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c249001120.costfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,c249001120.costfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) end function c249001120.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function c249001120.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end function c249001120.spcostfilter(c) return c:IsLevelAbove(1) and c:IsAbleToRemoveAsCost() and c:IsRace(RACE_WARRIOR) end function c249001120.spcost(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(c249001120.spcostfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil) if chk==0 then return g:CheckWithSumGreater(Card.GetLevel,8) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local sg=g:SelectWithSumGreater(tp,Card.GetLevel,8) Duel.Remove(sg,POS_FACEUP,REASON_EFFECT) end