--梁木刺 local m=33711405 local cm=_G["c"..m] function cm.initial_effect(c) --AnnounceLevel local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(m,0)) e1:SetCategory(CATEGORY_DISABLE+CATEGORY_ANNOUNCE) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER) e1:SetRange(LOCATION_HAND+LOCATION_MZONE) e1:SetCost(cm.cost) e1:SetTarget(cm.target) e1:SetOperation(cm.operation) c:RegisterEffect(e1) --SpecialSummon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(m,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetRange(LOCATION_GRAVE) e2:SetProperty(EFFECT_FLAG_BOTH_SIDE) e2:SetCode(EVENT_FREE_CHAIN) e2:SetLabelObject(e1) e2:SetCost(cm.effcost) e2:SetTarget(cm.sptg) e2:SetOperation(cm.spop) c:RegisterEffect(e2) end function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then if c:IsLocation(LOCATION_HAND) then return e:GetHandler():IsDiscardable() else return c:IsAbleToGraveAsCost() end end if c:IsLocation(LOCATION_HAND) then Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD) else Duel.SendtoGrave(c,REASON_COST) end end function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE) local ac=Duel.AnnounceCard(tp) Duel.SetTargetParam(ac) e:SetLabel(ac) Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0) end function cm.operation(e,tp,eg,ep,ev,re,r,rp) local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM) local c=e:GetHandler() --damage local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_CHAINING) e2:SetLabel(ac) e2:SetOperation(cm.regop) Duel.RegisterEffect(e2,tp) end function cm.regop(e,tp,eg,ep,ev,re,r,rp) if re:GetHandler():IsCode(e:GetLabel()) then Duel.Damage(rp,2000,REASON_EFFECT) end end function cm.rmfilter(c,code) return c:IsAbleToRemoveAsCost() and c:IsCode(code) end function cm.effcost(e,tp,eg,ep,ev,re,r,rp,chk) local code=e:GetLabelObject():GetLabel() if chk==0 then return Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_DECK,0,1,nil,code) and not e:GetHandler():IsControler(tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local rg=Duel.SelectMatchingCard(tp,cm.rmfilter,tp,LOCATION_DECK,0,1,1,nil,code) Duel.Remove(rg,POS_FACEUP,REASON_COST) end function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,0,tp,LOCATION_GRAVE) end function cm.spop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) end