Commit a9aba25a authored by Tachibana's avatar Tachibana

nmbd

parent 8b3e506a
......@@ -25,12 +25,11 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end
if e:GetLabel()~=0 then
e:SetLabel(0)
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND,0,1,nil)
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
else
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND,0,1,nil)
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
end
end
if e:GetLabel()~=0 then
......@@ -49,7 +48,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==114 then
ft=2
end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK,0,nil)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()>0 then
local gg=g:RandomSelect(1-tp,ft)
Duel.SendtoHand(gg,nil,REASON_EFFECT)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment