--Primus dell'Organizzazione Angeli, Phoenatura --Script by XGlitchy30 function c16599463.initial_effect(c) --synchro summon aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_FAIRY),aux.NonTuner(nil),1) c:EnableReviveLimit() --target protection local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_SINGLE) e0:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e0:SetRange(LOCATION_MZONE) e0:SetValue(c16599463.efilter) c:RegisterEffect(e0) --protection local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetCondition(c16599463.bpcon) e1:SetCost(c16599463.bpcost) e1:SetOperation(c16599463.bpop) c:RegisterEffect(e1) --inflict damage -- local e2=Effect.CreateEffect(c) -- e2:SetCategory(CATEGORY_DAMAGE) -- e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) -- e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_PLAYER_TARGET) -- e2:SetCode(EVENT_BATTLE_DAMAGE) -- e2:SetRange(LOCATION_MZONE) -- e2:SetCountLimit(1) -- e2:SetCondition(c16599463.damcon) -- e2:SetTarget(c16599463.damtg) -- e2:SetOperation(c16599463.damop) -- c:RegisterEffect(e2) --protection (synchro) local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_DISABLE) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET) e3:SetCode(EVENT_REMOVE) e3:SetCountLimit(1,16599463) e3:SetCondition(c16599463.spcon) e3:SetTarget(c16599463.sptg) e3:SetOperation(c16599463.spop) c:RegisterEffect(e3) end --filters function c16599463.mfilter(c,sync) return c:IsLocation(LOCATION_GRAVE) and bit.band(c:GetReason(),0x80008)==0x80008 and c:GetReasonCard()==sync and c:IsAbleToRemoveAsCost() end function c16599463.lvfilter(c) return c:IsFaceup() and (not c:IsType(TYPE_EFFECT) or not c:IsDisabled()) end --target protection function c16599463.efilter(e,re,rp) return ((re:GetHandler():GetLevel()>0 and re:GetHandler():IsLevelBelow(5)) or (re:GetHandler():GetRank()>0 and re:GetHandler():GetRank()<=5)) and rp==1-e:GetHandlerPlayer() and re:IsActiveType(TYPE_MONSTER) end --battle protection function c16599463.bpcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) end function c16599463.bpcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local mat=c:GetMaterial() local matc=mat:GetCount() if chk==0 then return matc>0 and mat:FilterCount(c16599463.mfilter,nil,c)==matc end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=mat:Select(tp,matc,matc,nil) if g:GetCount()==matc then Duel.Remove(g,POS_FACEUP,REASON_COST) end end function c16599463.bpop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SINGLE_RANGE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetRange(LOCATION_MZONE) e1:SetValue(1) e1:SetReset(RESET_EVENT+0x1fe0000) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) c:RegisterEffect(e2) c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(16599463,0)) end --inflict damage -- function c16599463.damcon(e,tp,eg,ep,ev,re,r,rp) -- local att=Duel.GetAttacker() -- local def=Duel.GetAttackTarget() -- return ep==tp -- and att and def and ((att:GetControler()==tp and att:IsRace(RACE_FAIRY) and att:IsRelateToBattle()) -- or (def:GetControler()==tp and def:IsRace(RACE_FAIRY) and def:IsRelateToBattle())) -- end -- function c16599463.damtg(e,tp,eg,ep,ev,re,r,rp,chk) -- local c=e:GetHandler() -- if chk==0 then return true end -- Duel.SetTargetPlayer(1-tp) -- Duel.SetTargetParam(1500) -- Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1500) -- end -- function c16599463.damop(e,tp,eg,ep,ev,re,r,rp) -- local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) -- Duel.Damage(p,d,REASON_EFFECT) -- end --battle protection (synchro) function c16599463.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsReason(REASON_COST) and re:IsHasType(0x7e0) and re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsRace(RACE_FAIRY) and re:GetHandler():IsType(TYPE_SYNCHRO) end function c16599463.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c16599463.lvfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(c16599463.lvfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,c16599463.lvfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) end function c16599463.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then if tc:IsType(TYPE_EFFECT) and not tc:IsDisabled() then Duel.NegateRelatedChain(tc,RESET_TURN_SET) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetValue(RESET_TURN_SET) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e2) end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetValue(1) e1:SetReset(RESET_EVENT+0x1fe0000) tc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) c:RegisterEffect(e2) tc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(16599463,0)) end end