Commit 917e606d authored by Tachibana's avatar Tachibana

ybb

parent 48a6d343
......@@ -30,20 +30,28 @@ function cm.filter3(c)
return c:IsSetCard(0xccb) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_ONFIELD,0,e:GetHandler())
local g1=Duel.GetMatchingGroup(cm.filter3,tp,LOCATION_DECK,0,nil)
if chk==0 then return g:GetCount()>0 and g:FilterCount(cm.filter,nil)==g:GetCount()
and g1:GetCount()>0 and g:FilterCount(cm.filter,nil)<=g1:GetCount() end
Duel.Release(g,REASON_COST)
e:SetLabel(g:GetCount())
e:SetLabel(1)
return true
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter3,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,e:GetLabel(),tp,LOCATION_DECK)
local rg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_ONFIELD,0,e:GetHandler())
local cg=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,0,e:GetHandler())
local thg=Duel.GetMatchingGroup(cm.filter3,tp,LOCATION_DECK,0,nil)
if chk==0 then
if e:GetLabel()==1 then
return rg:GetCount()>0 and rg:GetCount()==cg:GetCount() and rg:GetCount()<=thg:GetCount()
else
return false
end
end
Duel.Release(rg,REASON_COST)
Duel.SetTargetParam(rg:GetCount())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,rg:GetCount(),tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local num=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter3,tp,LOCATION_DECK,0,e:GetLabel(),e:GetLabel(),nil)
local g=Duel.SelectMatchingCard(tp,cm.filter3,tp,LOCATION_DECK,0,num,num,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
......
......@@ -47,7 +47,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e4)
end
function cm.fuscheck(c)
return c:IsSummonType(SUMMON_TYPE_ADVANCE)
return c:IsSummonType(SUMMON_TYPE_ADVANCE) and c:IsSetCard(0xccb)
end
function cm.splimit(e,c)
return not (c:IsSetCard(0xccb,0xccd) or c:IsRace(RACE_FAIRY))
......
......@@ -52,13 +52,13 @@ function cm.splimit(e,c)
return not (c:IsSetCard(0xccb,0xccd) or c:IsRace(RACE_FAIRY))
end
function cm.xyztarget(c,tp)
return c:IsCanOverlay() and Duel.GetMZoneCount(tp,c)
return c:IsCanOverlay() and Duel.GetMZoneCount(tp,c)>0
end
function cm.ptarget(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.IsExistingTarget(cm.xyztarget,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectTarget(cm.xyztarget,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c,tp)
local g=Duel.SelectTarget(tp,cm.xyztarget,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,LOCATION_PZONE)
end
function cm.poperation(e,tp,eg,ep,ev,re,r,rp)
......
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