--created & coded by Lyris --機光襲雷竜-イグニスター local s,id,o=GetID() function s.initial_effect(c) c:EnableReviveLimit() aux.AddFusionProcFunRep(c,aux.AND(aux.FilterBoolFunction(Card.IsFusionSetCard,0x7c4),aux.FilterBoolFunction(Card.IsAttackAbove,1600)),2,false) local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE) e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e4:SetCode(EFFECT_SPSUMMON_CONDITION) e4:SetValue(aux.fuslimit) c:RegisterEffect(e4) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD) e1:SetCode(EVENT_DESTROYED) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e1:SetCategory(CATEGORY_DESTROY) e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,tp) end) e1:SetTarget(s.tg) e1:SetOperation(s.op) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetCode(EFFECT_IMMUNE_EFFECT) e2:SetRange(LOCATION_MZONE) e2:SetCondition(s.tgcon) e2:SetValue(s.etarget) c:RegisterEffect(e2) local e5=e2:Clone() e5:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET) e5:SetValue(aux.imval1) c:RegisterEffect(e5) local e0=Effect.CreateEffect(c) e0:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON) e0:SetType(EFFECT_TYPE_QUICK_O) e0:SetRange(LOCATION_MZONE) e0:SetCode(EVENT_FREE_CHAIN) e0:SetCountLimit(1) e0:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_BATTLE_START) e0:SetTarget(s.destg) e0:SetOperation(s.desop) c:RegisterEffect(e0) end function s.desfilter(c,e,tp) return c:IsLevelBelow(5) and c:IsSetCard(0x7c4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetMZoneCount(tp,c)>0 and Duel.GetTurnPlayer()~=tp and aux.bpcon() and Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)~=0 then if Duel.GetAttacker() then Duel.NegateAttack() else local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetReset(RESET_PHASE+PHASE_END) e1:SetCountLimit(1) e1:SetOperation(function() Duel.Hint(HINT_CARD,0,id) Duel.NegateAttack() end) Duel.RegisterEffect(e1,tp) end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.SpecialSummon(Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.desfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp),0,tp,tp,false,false,POS_FACEUP) end end function s.disop(e,tp,eg,ep,ev,re,r,rp) if Duel.SelectEffectYesNo(tp,e:GetOwner()) then Duel.Hint(HINT_CARD,0,id) Duel.NegateAttack() end end function s.tgfilter(c) return c:IsFaceup() and c:IsSetCard(0x7c4) and c:IsLevelBelow(5) end function s.tgcon(e) return Duel.IsExistingMatchingCard(s.tgfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) end function s.etarget(e,re) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) return g and g:IsContains(e:GetHandler()) end function s.cfilter(c,tp) return c:IsPreviousLocation(LOCATION_MZONE) and (c:IsPreviousPosition(POS_FACEUP) or c:GetPreviousControler()==tp) and c:IsPreviousSetCard(0x7c4) end function s.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,0,1,nil) and Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g1=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,0,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g2=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil) g1:Merge(g2) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,2,0,0) end function s.op(e,tp,eg,ep,ev,re,r,rp) Duel.Destroy(Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e),REASON_EFFECT) end