--Alchemage Inception local cid,id=GetID() function cid.initial_effect(c) --Special from Deck local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id) e1:SetCondition(cid.spcon) e1:SetTarget(cid.sptg) e1:SetOperation(cid.spop) c:RegisterEffect(e1) --Transfer Counters local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_COUNTER) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_GRAVE) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCountLimit(1,id+100) e3:SetCost(aux.bfgcost) e3:SetTarget(cid.rmtg) e3:SetOperation(cid.rmop) c:RegisterEffect(e3) end --Filters function cid.spfilter(c,e,tp) return c:IsSetCard(0x8108) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function cid.spcfilter(c) return c:IsType(TYPE_EFFECT) and c:IsFaceup() end function cid.filter1(c) return c:IsFaceup() and c:GetCounter(0x1818)>0 end function cid.filter2(c) return c:IsFaceup() end --Special From Deck function cid.spcon(e,tp,eg,ep,ev,re,r,rp) return not Duel.IsExistingMatchingCard(cid.spcfilter,tp,LOCATION_MZONE,0,1,nil) 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 Duel.IsExistingMatchingCard(cid.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function cid.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,cid.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) 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.filter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.IsExistingTarget(cid.filter2,tp,LOCATION_ONFIELD,0,1,nil) and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,2,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g1=Duel.SelectTarget(tp,cid.filter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,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,cid.filter2,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