--赤月礼赞·SHUDDER RUNNING local m=33701434 local cm=_G["c"..m] function cm.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(m,0)) e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_CHAINING) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e1:SetRange(LOCATION_SZONE) e1:SetCost(cm.cost) e1:SetTarget(cm.distg) e1:SetOperation(cm.disop) c:RegisterEffect(e1) --disable spsummon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(m,1)) e2:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetRange(LOCATION_SZONE) e2:SetCode(EVENT_SUMMON) e2:SetCondition(cm.dscon) e2:SetCost(cm.cost) e2:SetTarget(cm.dstg) e2:SetOperation(cm.dsop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_SPSUMMON) c:RegisterEffect(e3) end function cm.costfilter(c) return c:IsSetCard(0x9449) and c:IsType(TYPE_MONSTER) and not c:IsPublic() end function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_HAND,0,1,1,nil) e:SetTargetCard(g:GetFirst()) e:SetLabelObject(g:GetFirst()) e:SetLabel(g:GetFirst():GetDefense()) Duel.ConfirmCards(1-tp,g) Duel.ShuffleHand(tp) end function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local ct=e:GetLabel() Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,ct) if ct>0 and Duel.IsPlayerAffectedByEffect(tp,EFFECT_NO_EFFECT_DAMAGE) then Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0) end end function cm.disop(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() if not (tc and tc:IsRelateToEffect(e)) then return end local ct=tc:GetDefense() if Duel.Damage(tp,ct,REASON_EFFECT)>0 then Duel.NegateSummon(eg) if Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then Duel.SendtoHand(eg,tp,REASON_EFFECT) else Duel.Destroy(eg,REASON_EFFECT) end end end function cm.dstg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local ct=e:GetLabel() Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,ct) if ct>0 and Duel.IsPlayerAffectedByEffect(tp,EFFECT_NO_EFFECT_DAMAGE) then Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) end end end function cm.filter(c) return c:IsSetCard(0x9449) and c:IsFaceup() end function cm.dsop(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() if not (tc and tc:IsRelateToEffect(e)) then return end local ct=tc:GetDefense() if Duel.Damage(tp,ct,REASON_EFFECT)>0 then if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then if Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then Duel.SendtoHand(eg,tp,REASON_EFFECT) else Duel.Destroy(eg,REASON_EFFECT) end end end end