--Warbear Ennigmaterial --Script by XGlitchy30 local cid,id=GetID() function cid.initial_effect(c) --attach and boost atk local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetCountLimit(1,id) e1:SetTarget(cid.atktg) e1:SetOperation(cid.atkop) c:RegisterEffect(e1) --attach and boost atk (xyz) local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetRange(LOCATION_HAND+LOCATION_MZONE) e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE) e2:SetCountLimit(1,id) e2:SetCondition(cid.xatkcon) e2:SetOperation(cid.xatkop) c:RegisterEffect(e2) end --filters function cid.filter(c) return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0x2ead) end --attach and boost atk function cid.atktg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 and Duel.IsExistingMatchingCard(cid.filter,tp,LOCATION_MZONE,0,1,nil) end end function cid.atkop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g=Duel.SelectMatchingCard(tp,cid.filter,tp,LOCATION_MZONE,0,1,1,nil) if #g>0 then Duel.HintSelection(g) local td=Duel.GetDecktopGroup(tp,1) Duel.DisableShuffleCheck() Duel.Overlay(g:GetFirst(),td) Duel.BreakEffect() if g:GetFirst():IsFaceup() and g:GetFirst():GetOverlayCount()>0 and e:GetHandler():IsFaceup() then local ct=g:GetFirst():GetOverlayCount() --boost atk local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(ct*300) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE) e:GetHandler():RegisterEffect(e1) end end end --attach and boost atk (xyz) function cid.xatkcon(e,tp,eg,ep,ev,re,r,rp) local a=Duel.GetAttacker() if not a:IsControler(tp) then a=Duel.GetAttackTarget() end return a and a:IsType(TYPE_XYZ) and a:IsSetCard(0x2ead) end function cid.xatkop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local tc=Duel.GetAttacker() if tc:IsControler(1-tp) then tc=Duel.GetAttackTarget() end if tc:IsRelateToBattle() and tc:IsFaceup() and e:GetHandler():IsLocation(LOCATION_HAND+LOCATION_MZONE) then Duel.Overlay(tc,Group.FromCards(e:GetHandler())) if tc:GetOverlayGroup():IsContains(e:GetHandler()) then local ct=tc:GetOverlayCount() local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(ct*100) e1:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e1) end end end