--created by Jake --Bushido God Burning Phoenix local s,id,o=GetID() function s.initial_effect(c) c:SetUniqueOnField(1,0,id) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_IMMUNE_EFFECT) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetValue(s.unval) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(3825890,0)) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_SUMMON_PROC) e2:SetCondition(s.ntcon) e2:SetOperation(s.ntop) e2:SetValue(1) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(2158562,0)) e3:SetCategory(CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetCode(EVENT_SUMMON_SUCCESS) e3:SetCondition(s.descon) e3:SetTarget(s.destg) e3:SetOperation(s.desop) c:RegisterEffect(e3) local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD) e4:SetCode(EFFECT_SET_POSITION) e4:SetRange(LOCATION_MZONE) e4:SetTargetRange(0,LOCATION_MZONE) e4:SetCondition(s.poscon) e4:SetTarget(s.posfilter) e4:SetValue(POS_FACEUP_DEFENSE) c:RegisterEffect(e4) local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e5:SetCode(EVENT_FLIP) e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e5:SetOperation(s.flipop) c:RegisterEffect(e5) local e6=Effect.CreateEffect(c) e6:SetDescription(aux.Stringid(10028593,0)) e6:SetCategory(CATEGORY_SPECIAL_SUMMON) e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e6:SetCode(EVENT_LEAVE_FIELD) e6:SetCondition(s.spcon) e6:SetTarget(s.sptg) e6:SetOperation(s.spop) c:RegisterEffect(e6) end function s.unval(e,te) return te:IsActiveType(TYPE_MONSTER) and te:GetOwnerPlayer()~=e:GetHandlerPlayer() and (te:GetOwner():IsSummonType(SUMMON_TYPE_SPECIAL) or te:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL)) end function s.ntfilter(c) return c:IsFaceup() and c:IsSetCard(0x4b0) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeckAsCost() end function s.ntcon(e,c,minc) if c==nil then return true end return minc<=0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.ntfilter,c:GetControler(),LOCATION_REMOVED,0,3,nil) end function s.ntop(e,tp,eg,ep,ev,re,r,rp,c) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,s.ntfilter,tp,LOCATION_REMOVED,0,3,3,nil) Duel.SendtoDeck(g,nil,2,REASON_COST) end function s.descon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetSummonType()==SUMMON_TYPE_NORMAL+1 end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local sg=Duel.GetMatchingGroup(Card.IsType,tp,0,LOCATION_MZONE,nil,TYPE_MONSTER) Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local sg=Duel.GetMatchingGroup(Card.IsType,tp,0,LOCATION_MZONE,nil,TYPE_MONSTER) if #sg>0 then Duel.Destroy(sg,REASON_EFFECT) end end function s.poscon(e) return e:GetHandler():IsSummonType(SUMMON_TYPE_NORMAL) and e:GetHandler():GetFlagEffect(id)==0 end function s.posfilter(e,c) return c:IsSummonType(SUMMON_TYPE_SPECIAL) and c:GetLevel()>e:GetHandler():GetLevel() end function s.flipop(e,tp,eg,ep,ev,re,r,rp) e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return not e:GetHandler():IsLocation(LOCATION_DECK) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0x13) end function s.spfilter(c,e,tp) return c:IsLevelBelow(7) and c:IsSetCard(0x4b0) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.spop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,0x13,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.ShuffleDeck(tp) end end