--Silent Swordsman LV6 function c269000030.initial_effect(c) --lvlup 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(c269000030.spcon) e1:SetTarget(c269000030.sptg) e1:SetOperation(c269000030.spop) c:RegisterEffect(e1) --immune spell local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_IMMUNE_EFFECT) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetRange(LOCATION_MZONE) e2:SetValue(c269000030.efilter) c:RegisterEffect(e2) --negate local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(15180041,1)) e3:SetCategory(CATEGORY_NEGATE) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_CHAINING) e3:SetCountLimit(1) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e3:SetRange(LOCATION_MZONE) e3:SetCondition(c269000030.condition) e3:SetTarget(c269000030.target) e3:SetOperation(c269000030.operation) c:RegisterEffect(e3) end c269000030.lvup={269000031} c269000030.lvdn={269000029} function c269000030.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetBattledGroupCount()>0 end function c269000030.spfilter(c,e,tp) return c:IsCode(269000031) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) end function c269000030.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c269000030.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 c269000030.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(c269000030.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,c269000030.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 c269000030.efilter(e,te) return te:IsActiveType(TYPE_SPELL) and te:GetOwnerPlayer()~=e:GetHandlerPlayer() end function c269000030.condition(e,tp,eg,ep,ev,re,r,rp) return re:IsActiveType(TYPE_SPELL) and Duel.IsChainNegatable(ev) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) end function c269000030.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) end function c269000030.operation(e,tp,eg,ep,ev,re,r,rp) Duel.NegateActivation(ev) end