--Magister dell'Organizzazione Angeli, Hyper --Script by XGlitchy30 function c16599457.initial_effect(c) --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(c16599457.efilter) c:RegisterEffect(e0) --spsummon local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCost(c16599457.spcost) e1:SetTarget(c16599457.sptg) e1:SetOperation(c16599457.spop) c:RegisterEffect(e1) --destroy monster local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_FREE_CHAIN) e2:SetHintTiming(TIMING_DAMAGE_STEP) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCondition(c16599457.condition) e2:SetCost(c16599457.cost) e2:SetTarget(c16599457.target) e2:SetOperation(c16599457.operation) c:RegisterEffect(e2) --destroy spell/trap local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e3:SetCode(EVENT_REMOVE) e3:SetCountLimit(1,16599457) e3:SetCondition(c16599457.drycon) e3:SetCost(c16599457.drycost) e3:SetTarget(c16599457.drytg) e3:SetOperation(c16599457.dryop) c:RegisterEffect(e3) end --filters function c16599457.cfilter(c,tp) return c:IsFaceup() and c:IsSetCard(0x1559) and c:IsType(TYPE_MONSTER) and (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 or c:IsLocation(LOCATION_MZONE)) end function c16599457.costfilter(c,lv) return c:IsSetCard(0x1559) and c:IsType(TYPE_MONSTER) and c:GetLevel()0 and re:GetHandler():IsLevelBelow(8)) or (re:GetHandler():GetRank()>0 and re:GetHandler():GetRank()<=8)) and rp==1-e:GetHandlerPlayer() and re:IsActiveType(TYPE_MONSTER) end --spsummon function c16599457.spcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return not c:IsPublic() and Duel.IsExistingMatchingCard(c16599457.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,c16599457.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil,tp) if g:GetCount()>0 then Duel.Remove(g,POS_FACEUP,REASON_COST) end end function c16599457.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) end function c16599457.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end --destroy monster function c16599457.condition(e,tp,eg,ep,ev,re,r,rp) local phase=Duel.GetCurrentPhase() if phase~=PHASE_DAMAGE or Duel.IsDamageCalculated() then return false end local att=Duel.GetAttacker() local def=Duel.GetAttackTarget() return Duel.GetTurnPlayer()==1-tp and ((att:GetControler()==tp and att:IsRace(RACE_FAIRY)) or (def:GetControler()==tp and def:IsRace(RACE_FAIRY))) end function c16599457.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c16599457.costfilter,tp,LOCATION_DECK,0,1,e:GetHandler(),e:GetHandler():GetLevel()) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,c16599457.costfilter,tp,LOCATION_DECK,0,1,1,e:GetHandler(),e:GetHandler():GetLevel()) if g:GetCount()>0 then Duel.Remove(g,POS_FACEUP,REASON_COST) end end function c16599457.tgfilter(c) return c:IsType(TYPE_MONSTER) and c:IsFaceup() end function c16599457.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and c16599457.tgfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(c16599457.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,c16599457.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function c16599457.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end --activation limit local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetCode(EFFECT_CANNOT_ACTIVATE) e1:SetTargetRange(1,0) e1:SetValue(c16599457.aclimit) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) end --destroy spell/trap function c16599457.drycon(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 e:GetHandler():IsPreviousLocation(LOCATION_DECK) end function c16599457.drycost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c16599457.costfilter2,tp,LOCATION_HAND+LOCATION_DECK,0,1,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,c16599457.costfilter2,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,e:GetHandler()) if g:GetCount()>0 then Duel.Remove(g,POS_FACEUP,REASON_COST) end end function c16599457.drytg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil) end Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,PLAYER_ALL,LOCATION_SZONE) end function c16599457.dryop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil) local tc=g:GetFirst() if tc then Duel.HintSelection(g) Duel.Destroy(tc,REASON_EFFECT) end end