--断码者 希 local m=33337004 local cm=_G["c"..m] function cm.initial_effect(c) c:SetSPSummonOnce(m) --spsummon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(m,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_MAIN_END) e1:SetRange(LOCATION_GRAVE+LOCATION_HAND) e1:SetCountLimit(1,m) e1:SetCondition(function(e) return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.IsExistingMatchingCard(cm.cfilter,tp,0,LOCATION_MZONE,1,nil) end) e1:SetTarget(cm.target) e1:SetOperation(cm.operation) c:RegisterEffect(e1) --special summon 2 local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(m,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCost(cm.spcost) e2:SetTarget(cm.sptg) e2:SetOperation(cm.spop) c:RegisterEffect(e2) Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter) end function cm.counterfilter(c) return c:IsSetCard(0x155b) end function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 and e:GetHandler():IsReleasable() end Duel.Release(e:GetHandler(),REASON_COST) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetReset(RESET_PHASE+PHASE_END) e1:SetTargetRange(1,0) e1:SetLabelObject(e) e1:SetTarget(cm.splimit) Duel.RegisterEffect(e1,tp) end function cm.splimit(e,c,sump,sumtype,sumpos,targetp,se) return not c:IsSetCard(0x155b) end function cm.spfilter(c,e,tp,ec) return c:IsSetCard(0x155b) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_LINK,tp,false,false) and c:IsType(TYPE_LINK) and c:IsLinkBelow(2) and Duel.GetLocationCountFromEx(tp,tp,ec)>0 end function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,e:GetHandler()) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function cm.spop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,e:GetHandler()) if g:GetCount()>0 then Duel.SpecialSummon(g,SUMMON_TYPE_LINK,tp,tp,false,false,POS_FACEUP) end end function cm.cfilter(c) return c:IsFaceup() and c:IsType(TYPE_LINK) end function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) end function cm.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end