--Booster Ennigmaterial --Script by XGlitchy30 local cid,id=GetID() function cid.initial_effect(c) --boost atk local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTarget(cid.atktg) e1:SetValue(cid.atkval) c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_HAND) e2:SetCountLimit(1,id) e2:SetCost(cid.spcost) e2:SetTarget(cid.sptg) e2:SetOperation(cid.spop) c:RegisterEffect(e2) --boost atk (quick) local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_ATKCHANGE) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCode(EVENT_FREE_CHAIN) e3:SetRange(LOCATION_GRAVE) e3:SetCountLimit(1,id+100) e3:SetCost(aux.bfgcost) e3:SetTarget(cid.qatktg) e3:SetOperation(cid.qatkop) c:RegisterEffect(e3) end --filters function cid.cfilter(c) return c:IsFaceup() and c:IsSetCard(0xead) and c:IsType(TYPE_XYZ) and c:IsType(TYPE_MONSTER) end function cid.atkfilter(c) return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0xead) and c:GetOverlayCount()>0 end --atk boost function cid.atktg(e,c) return c:IsType(TYPE_XYZ) and c:IsSetCard(0xead) and c:GetOverlayCount()>0 end function cid.atkval(e,c) return c:GetOverlayCount()*100 end --spsummon function cid.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local g=Group.CreateGroup() local mg=Duel.GetMatchingGroup(cid.cfilter,tp,LOCATION_MZONE,0,nil) local tc=mg:GetFirst() while tc do g:Merge(tc:GetOverlayGroup()) tc=mg:GetNext() end return #g>0 end local g=Group.CreateGroup() local mg=Duel.GetMatchingGroup(cid.cfilter,tp,LOCATION_MZONE,0,nil) local tc=mg:GetFirst() while tc do g:Merge(tc:GetOverlayGroup()) tc=mg:GetNext() end if #g==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ) local sg=g:Select(tp,1,1,nil) Duel.SendtoGrave(sg,REASON_COST) end function cid.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function cid.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end --boost atk (quick) function cid.qatktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and cid.atkfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(cid.atkfilter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,cid.atkfilter,tp,LOCATION_MZONE,0,1,1,nil) end function cid.qatkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc and tc:IsFaceup() and tc:GetOverlayCount()>0 then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetValue(tc:GetOverlayCount()*100) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) end end