--Celestial Swordsman LV4 function c249001119.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(c249001119.spcon) e1:SetTarget(c249001119.sptg) e1:SetOperation(c249001119.spop) c:RegisterEffect(e1) --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(c249001119.spcost) e3:SetTarget(c249001119.sptg) e3:SetOperation(c249001119.spop) c:RegisterEffect(e3) end c249001119.lvup={249001120} function c249001119.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetBattledGroupCount()>0 end function c249001119.spfilter(c,e,tp) return c:IsCode(249001120) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) end function c249001119.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c249001119.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 c249001119.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(c249001119.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,c249001119.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 c249001119.spcostfilter(c) return c:IsLevelAbove(1) and c:IsAbleToRemoveAsCost() and c:IsRace(RACE_WARRIOR) end function c249001119.spcost(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(c249001119.spcostfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil) if chk==0 then return g:CheckWithSumGreater(Card.GetLevel,6) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local sg=g:SelectWithSumGreater(tp,Card.GetLevel,6) Duel.Remove(sg,POS_FACEUP,REASON_EFFECT) end