--Alchemage Extra local cid,id=GetID() function cid.initial_effect(c) --link summon aux.AddLinkProcedure(c,cid.matfilter,1,1) c:EnableReviveLimit() --Search local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCountLimit(1,id) e1:SetTarget(cid.cttg) e1:SetOperation(cid.ctop) c:RegisterEffect(e1) --Transfer Counters local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_COUNTER) 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) e3:SetCost(aux.bfgcost) e3:SetTarget(cid.rmtg) e3:SetOperation(cid.rmop) c:RegisterEffect(e3) end --Filters function cid.thfilter1(c,tp) local cardtype=c:GetType()&0x7 return c:IsFaceup() and Duel.IsExistingMatchingCard(cid.thfilter2,tp,LOCATION_DECK,0,1,nil,cardtype) end function cid.thfilter2(c,cardtype) return c:IsSetCard(0x8108) and c:IsAbleToHand() and not c:IsType(cardtype) end function cid.thfilter3(c) return c:IsFaceup() and c:GetCounter(0x1818)>0 end function cid.matfilter(c) return (c:IsCode(21770262) or c:IsCode(21770263) or c:IsCode(21770264)) end function cid.cttg(e,tp,eg,ep,ev,re,r,rp,chk) if chkc then return chkc:IsLocation(LOCATION_ONFIELD) end if chk==0 then return Duel.IsExistingTarget(cid.thfilter1,tp,LOCATION_ONFIELD,0,1,nil,tp) end local g=Duel.SelectTarget(tp,cid.thfilter1,tp,LOCATION_ONFIELD,0,1,1,nil,tp) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function cid.ctop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local tc=Duel.GetFirstTarget() local cardtype=tc:GetType()&0x7 if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.Destroy(tc,REASON_EFFECT)~=0 then local g=Duel.SelectMatchingCard(tp,cid.thfilter2,tp,LOCATION_DECK,0,1,1,nil,cardtype) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end end --Transfer Counters function cid.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return Duel.IsExistingTarget(cid.thfilter3,tp,LOCATION_ONFIELD,0,1,nil) and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_ONFIELD,0,2,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g1=Duel.SelectTarget(tp,cid.thfilter3,tp,LOCATION_ONFIELD,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_COUNTER,g1,1,0,0) e:SetLabelObject(g1:GetFirst()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g2=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,0,1,1,g1) Duel.SetOperationInfo(0,CATEGORY_COUNTER,g2,1,0,0) end function cid.rmop(e,tp,eg,ep,ev,re,r,rp) local tc1=e:GetLabelObject() local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local tc2=g:GetFirst() if tc1==tc2 then tc2=g:GetNext() end if tc1:IsFaceup() and tc1:IsRelateToEffect(e) then local ct1=tc1:GetCounter(0x1818) if tc2:IsFaceup() and tc2:IsRelateToEffect(e) then tc1:RemoveCounter(tp,0x1818,ct1,REASON_EFECT) tc2:AddCounter(0x1818,ct1) end end end