--Infernalizzatrice del Cielo Brakadiano Citrinoartiglieria --Scripted by: XGlitchy30 local s,id = GetID() function s.initial_effect(c) aux.EnablePendulumAttribute(c,false) aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_DRAGON),aux.NonTuner(aux.FilterBoolFunction(Card.IsSetCard,0xb48)),1,1) c:EnableReviveLimit() --immune local p1=Effect.CreateEffect(c) p1:SetType(EFFECT_TYPE_FIELD) p1:SetCode(EFFECT_IMMUNE_EFFECT) p1:SetRange(LOCATION_PZONE) p1:SetTargetRange(LOCATION_ONFIELD,0) p1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xb48)) p1:SetValue(s.efilter) c:RegisterEffect(p1) --Special summon from the pendulum zone local p2=Effect.CreateEffect(c) p2:SetDescription(aux.Stringid(id,0)) p2:SetCategory(CATEGORY_SPECIAL_SUMMON) p2:SetType(EFFECT_TYPE_IGNITION) p2:SetRange(LOCATION_PZONE) p2:SetCountLimit(1,id) p2:SetCost(s.spcost) p2:SetTarget(s.sptg) p2:SetOperation(s.spop) c:RegisterEffect(p2) --attack twice local e7=Effect.CreateEffect(c) e7:SetDescription(aux.Stringid(id,3)) e7:SetCategory(CATEGORY_DAMAGE) e7:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e7:SetCode(EVENT_BATTLE_DESTROYING) e7:SetCountLimit(1,id+300) e7:SetCondition(aux.bdcon) e7:SetTarget(s.damtg) e7:SetOperation(s.damop) c:RegisterEffect(e7) --destroy local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,1)) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DISABLE) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id+100) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e1:SetTarget(s.destg) e1:SetOperation(s.desop) c:RegisterEffect(e1) --place local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_DESTROYED) e3:SetCountLimit(1,id+200) e3:SetCondition(s.dscon) e3:SetCost(s.dscost) e3:SetTarget(s.dstg) e3:SetOperation(s.dsop) c:RegisterEffect(e3) end function s.efilter(e,te) return te:GetOwnerPlayer()~=e:GetHandlerPlayer() and te:IsActiveType(TYPE_TRAP) end function s.cf(c,tp) return c:IsFaceup() and c:IsMonster() and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsRace(RACE_DRAGON) and Duel.GetMZoneCount(tp,c)>0 and c:IsAbleToRemoveAsCost() end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 and Duel.IsExistingMatchingCard(s.cf,tp,LOCATION_MZONE,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.cf,tp,LOCATION_MZONE,0,1,1,nil,tp) if #g>0 then Duel.Remove(g,POS_FACEUP,REASON_COST) end end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local dam=e:GetHandler():GetBattleTarget():GetBaseAttack() if dam<0 then dam=0 end Duel.SetTargetPlayer(1-tp) Duel.SetTargetParam(dam) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam) end function s.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 function s.f1(c) return c:IsFaceup() and c:IsSetCard(0xb48) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return Duel.IsExistingTarget(s.f1,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) and Duel.IsExistingTarget(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g1=Duel.SelectTarget(tp,s.f1,tp,LOCATION_ONFIELD,0,1,1,e:GetHandler()) if #g1>0 then e:SetLabelObject(g1:GetFirst()) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g2=Duel.SelectTarget(tp,aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,1,nil) g1:Merge(g2) Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetLabelObject(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE,g2,#g2,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetTargetCards(e) local tc1,tc2=tg:GetFirst(),tg:GetNext() if e:GetLabelObject()~=tc1 then tc1,tc2=tc2,tc1 end if not tc1 or e:GetLabelObject()~=tc1 or not s.f1(tc1) then return end if Duel.Destroy(tc1,REASON_EFFECT)>0 then if not tc2 or not aux.NegateAnyFilter(tc2) then return end Duel.Negate(tc2,e) end end function s.dscon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsReason(REASON_EFFECT) and e:GetHandler():IsPreviousLocation(LOCATION_MZONE) and e:GetHandler():GetPreviousControler()==tp end function s.thf(c) return c:IsFaceup() and c:IsSetCard(0xb48) and c:IsAbleToHandAsCost() end function s.dscost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.thf,tp,LOCATION_PZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectMatchingCard(tp,s.thf,tp,LOCATION_PZONE,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,tp,REASON_COST) end end function s.dstg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end if e:GetHandler():IsLocation(LOCATION_GRAVE) then Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) end end function s.dsop(e,tp,eg,ep,ev,re,r,rp) if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return end local c=e:GetHandler() if c:IsRelateToEffect(e) then if c:IsLocation(LOCATION_GRAVE) and c:IsHasEffect(EFFECT_NECRO_VALLEY) and not c:IsHasEffect(EFFECT_NECRO_VALLEY_IM) then return end Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true) end end