--Duelahan Pumpkin Noggin local cid,id=GetID() function cid.initial_effect(c) --link summon aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkAttribute,ATTRIBUTE_DARK),1,1) c:EnableReviveLimit() --cannot link material local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL) e1:SetValue(1) c:RegisterEffect(e1) --atkup local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetRange(LOCATION_MZONE) e2:SetValue(cid.atkval) c:RegisterEffect(e2) --direct atk local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_DIRECT_ATTACK) c:RegisterEffect(e3) --tohand local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,0)) e4:SetCategory(CATEGORY_TOHAND) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_BATTLE_DAMAGE) e4:SetCondition(cid.thcon) e4:SetCost(cid.thcost) e4:SetTarget(cid.thtg) e4:SetOperation(cid.thop) c:RegisterEffect(e4) end function cid.atkfilter(c) return c:IsFaceup() and c:IsSetCard(0x684) and c:GetAttack()>=0 end function cid.atkval(e,c) local lg=c:GetLinkedGroup():Filter(cid.atkfilter,nil) return lg:GetSum(Card.GetAttack) end function cid.indesfilter(c) return c:IsFaceup() and c:IsSetCard(0x684) end function cid.thcon(e,tp,eg,ep,ev,re,r,rp) return ep~=tp and e:GetHandler():GetLinkedGroup():IsExists(cid.indesfilter,1,nil) end function cid.cfilter(c) return c:IsSetCard(0x684) and not c:IsStatus(STATUS_BATTLE_DESTROYED) end function cid.thcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroup(tp,cid.cfilter,1,nil) end local g=Duel.SelectReleaseGroup(tp,cid.cfilter,1,1,nil) Duel.Release(g,REASON_COST) end function cid.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_ONFIELD) end function cid.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) end end