--Jaden the Aeonbreaker's Alchemist function c32904930.initial_effect(c) --link summon c:EnableReviveLimit() aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_PSYCHO),2,2) --splimit local e1=Effect.CreateEffect(c) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(c32904930.regcon) e1:SetOperation(c32904930.regop) c:RegisterEffect(e1) --set local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(32904930,0)) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCondition(c32904930.setcon) e2:SetTarget(c32904930.settg) e2:SetOperation(c32904930.setop) c:RegisterEffect(e2) --special summon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(32904930,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCountLimit(1) e3:SetCost(c32904930.spcost) e3:SetTarget(c32904930.sptg) e3:SetOperation(c32904930.spop) c:RegisterEffect(e3) --Destroy replace local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) e4:SetCode(EFFECT_DESTROY_REPLACE) e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e4:SetRange(LOCATION_MZONE) e4:SetTarget(c32904930.desreptg) e4:SetOperation(c32904930.desrepop) c:RegisterEffect(e4) end function c32904930.regcon(e,tp,eg,ep,ev,re,r,rp) return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK end function c32904930.regop(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetTargetRange(1,0) e1:SetReset(RESET_PHASE+PHASE_END) e1:SetTarget(c32904930.splimit) Duel.RegisterEffect(e1,tp) end function c32904930.splimit(e,c,sump,sumtype,sumpos,targetp,se) return c:IsCode(32904930) and bit.band(sumtype,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK end function c32904930.setcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) end function c32904930.setfilter(c) return c:IsSetCard(0xaa12) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable() end function c32904930.settg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c32904930.setfilter,tp,LOCATION_DECK,0,1,nil) end end function c32904930.setop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) local g=Duel.SelectMatchingCard(tp,c32904930.setfilter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SSet(tp,g:GetFirst()) Duel.ConfirmCards(1-tp,g) end end function c32904930.cfilter(c) return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_PSYCHO) and c:IsAbleToRemoveAsCost() end function c32904930.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c32904930.cfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,c32904930.cfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) end function c32904930.spfilter(c,e,tp) return c:IsFaceup() and c:IsSetCard(0xaa12) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c32904930.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c32904930.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c32904930.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,c32904930.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function c32904930.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end function c32904930.repfilter(c,e) return c:IsFaceup() and c:IsRace(RACE_PSYCHO) and c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED+STATUS_BATTLE_DESTROYED) end function c32904930.desreptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return not c:IsReason(REASON_REPLACE) and c:IsOnField() and c:IsFaceup() and Duel.IsExistingMatchingCard(c32904930.repfilter,tp,LOCATION_MZONE,0,1,c,e) end if Duel.SelectEffectYesNo(tp,c,96) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE) local g=Duel.SelectMatchingCard(tp,c32904930.repfilter,tp,LOCATION_MZONE,0,1,1,c,e) e:SetLabelObject(g:GetFirst()) g:GetFirst():SetStatus(STATUS_DESTROY_CONFIRMED,true) return true else return false end end function c32904930.desrepop(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() tc:SetStatus(STATUS_DESTROY_CONFIRMED,false) Duel.Destroy(tc,REASON_EFFECT+REASON_REPLACE) end