Commit cb411859 authored by Nemo Ma's avatar Nemo Ma

fix+del

parent 61cb7c84
......@@ -49,14 +49,36 @@ function cm.initial_effect(c)
c:RegisterEffect(e4)
end
function cm.remfilter(c,tp)
return c:IsAbleToRemove(tp,POS_FACEDOWN,REASON_COST) and c:IsType(TYPE_MONSTER)
return c:IsAbleToRemove(tp,POS_FACEDOWN,REASON_COST)
end
function cm.typefilter(c)
if c:GetType()&(TYPE_SPELL+TYPE_TRAP)~=0 then
return c:GetType()&(TYPE_SPELL+TYPE_TRAP)
elseif c:GetType()&(TYPE_NORMAL+TYPE_RITUAL+TYPE_FUSION+TYPE_XYZ+TYPE_SYNCHRO+TYPE_LINK)~=0 then
return c:GetType()&(TYPE_NORMAL+TYPE_RITUAL+TYPE_FUSION+TYPE_XYZ+TYPE_SYNCHRO+TYPE_LINK)
else
return TYPE_EFFECT
end
end
function cm.typefilter1(c,tc)
return cm.typefilter(c)==cm.typefilter(tc)
end
function cm.gfilter(g)
return g:GetClassCount(cm.typefilter)==#g
end
function cm.mtop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.remfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_EXTRA,0,nil)
if g:GetClassCount(Card.GetCode)>=7 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=g:SelectSubGroup(tp,aux.dncheck,false,7,7)
Duel.Remove(rg,POS_FACEDOWN,REASON_COST)
local sg=Group.CreateGroup()
if g:GetClassCount(cm.typefilter)>=9 then
for i=1,7 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc then
sg:AddCard(tc)
g:Remove(cm.typefilter1,nil,tc)
end
end
Duel.Remove(sg,POS_FACEDOWN,REASON_COST)
else
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
......@@ -102,11 +124,19 @@ end
function cm.skipcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.remfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_EXTRA,0,nil)
if chk==0 then return c:IsAbleToRemove(tp,POS_FACEDOWN,REASON_COST) and g:GetClassCount(Card.GetCode)>=9 end
if chk==0 then return c:IsAbleToRemove(tp,POS_FACEDOWN,REASON_COST) and g:GetClassCount(cm.typefilter)>=9 end
local sg=Group.CreateGroup()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=g:SelectSubGroup(tp,aux.dncheck,false,9,9)
rg:AddCard(c)
Duel.Remove(rg,POS_FACEDOWN,REASON_COST)
for i=1,9 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc then
sg:AddCard(tc)
g:Remove(cm.typefilter1,nil,tc)
end
end
sg:AddCard(c)
Duel.Remove(sg,POS_FACEDOWN,REASON_COST)
end
function cm.skiptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(1-tp,EFFECT_SKIP_TURN) end
......
......@@ -24,7 +24,7 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local t_flag_2=true
local tossp=1-tp
local num=0
while (flag==false or flag_1==false) do
while (flag==false and flag_1==false) do
tossp=1-tossp
num=num+1
Duel.Hint(HINT_SELECTMSG,tossp,HINTMSG_COIN)
......
......@@ -64,13 +64,11 @@ function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local sg=tg:Filter(Card.IsAbleToHand,nil)
if sg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=sg:Select(tp,1,1,nil)
local tg=sg:RandomSelect(tp,1)
local tc=tg:GetFirst()
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD-RESET_TOHAND,0,0)
Duel.SendtoHand(tc,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
--tc:ResetEffect(EVENT_CUSTOM+m,RESET_EVENT)
--Debug.Message(tc:GetFlagEffect(m))
end
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -46,7 +46,7 @@ function c9910141.xmfilter(c,tp)
end
function c9910141.xmtarget(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then returnDuel.IsExistingMatchingCard(c9910141.xmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c,tp) end
if chk==0 then return Duel.IsExistingMatchingCard(c9910141.xmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c,tp) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c9910141.xmoperation(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