--Star Bearer's Mage, Jaine local m=888702 local cm=_G["c"..m] function cm.initial_effect(c) local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_DISABLE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_BE_MATERIAL) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCountLimit(1,m) e2:SetCondition(cm.tgcon) e2:SetTarget(cm.target) e2:SetOperation(cm.activate) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(26674724,0)) e3:SetCategory(CATEGORY_TOGRAVE) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetCode(EVENT_FREE_CHAIN) e3:SetRange(LOCATION_HAND) e3:SetCountLimit(1,m) e3:SetCost(cm.thcost) e3:SetTarget(cm.thtg) e3:SetOperation(cm.thop) c:RegisterEffect(e3) end function cm.filter(c) return c:IsSetCard(0xff1) and c:IsFaceup() end function cm.tgcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local rc=c:GetReasonCard() return c:IsLocation(LOCATION_GRAVE) and rc:IsSetCard(0xff1) and r&REASON_FUSION~=0 end function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and cm.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,0,1,1,nil) end function cm.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetValue(1) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) tc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e2:SetValue(aux.indoval) tc:RegisterEffect(e2) end end function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsDiscardable() end Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD) end function cm.thfilter(c) return c:IsSetCard(0xff1) and not c:IsCode(c) and c:IsAbleToHand() end function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,2,nil) end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,2,tp,LOCATION_DECK) end function cm.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,2,2,nil) if g:GetCount()>0 then Duel.SendtoGrave(g,nil,REASON_EFFECT) end end