Commit 03b97a10 authored by xiaoye's avatar xiaoye

fix

parent 1672a8ad
...@@ -831,7 +831,7 @@ function VgF.IsExistingMatchingCard(f,tp,loc_self,loc_op,int,except_g,...) ...@@ -831,7 +831,7 @@ function VgF.IsExistingMatchingCard(f,tp,loc_self,loc_op,int,except_g,...)
local g1=Duel.GetMatchingGroup(nil,tp,loc_self,loc_op,nil) local g1=Duel.GetMatchingGroup(nil,tp,loc_self,loc_op,nil)
if g1:GetCount()>0 then g:Merge(g1) end if g1:GetCount()>0 then g:Merge(g1) end
end end
if g:GetCount()>0 then if g:GetCount()>0 and VgF.GetValueType(f)=="function" then
g=g:Filter(f,except_g,...) g=g:Filter(f,except_g,...)
end end
return g:GetCount()>=int return g:GetCount()>=int
...@@ -878,6 +878,9 @@ function VgF.SelectMatchingCard(hintmsg,e,select_tp,f,tp,loc_self,loc_op,int_min ...@@ -878,6 +878,9 @@ function VgF.SelectMatchingCard(hintmsg,e,select_tp,f,tp,loc_self,loc_op,int_min
if a then Duel.ShuffleDeck(select_tp) end if a then Duel.ShuffleDeck(select_tp) end
return g return g
end end
function VgF.GetMatchingGroupCount(f,tp,loc_self,loc_op,except_g,...)
return VgF.GetMatchingGroup(f,tp,loc_self,loc_op,except_g,...):GetCount()
end
function VgF.GetMatchingGroup(f,tp,loc_self,loc_op,except_g,...) function VgF.GetMatchingGroup(f,tp,loc_self,loc_op,except_g,...)
local g=Group.CreateGroup() local g=Group.CreateGroup()
if loc_self|LOCATION_MZONE>0 then if loc_self|LOCATION_MZONE>0 then
...@@ -894,7 +897,7 @@ function VgF.GetMatchingGroup(f,tp,loc_self,loc_op,except_g,...) ...@@ -894,7 +897,7 @@ function VgF.GetMatchingGroup(f,tp,loc_self,loc_op,except_g,...)
local g1=Duel.GetMatchingGroup(nil,tp,loc_self,loc_op,nil) local g1=Duel.GetMatchingGroup(nil,tp,loc_self,loc_op,nil)
if g1:GetCount()>0 then g:Merge(g1) end if g1:GetCount()>0 then g:Merge(g1) end
end end
if g:GetCount()>0 then if g:GetCount()>0 and VgF.GetValueType(f)=="function" then
g=g:Filter(f,except_g,...) g=g:Filter(f,except_g,...)
end end
return g return g
......
...@@ -4,12 +4,28 @@ function cm.initial_effect(c) ...@@ -4,12 +4,28 @@ function cm.initial_effect(c)
vgd.CardToG(c,nil,cm.op) vgd.CardToG(c,nil,cm.op)
end end
function cm.op(e,tp,eg,ep,ev,re,r,rp) function cm.op(e,tp,eg,ep,ev,re,r,rp)
local tg=vgf.SelectMatchingCard(HINTMSG_SELF,e,tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil) local c=e:GetHandler()
if tg:GetCount()>0 then tg:GetFirst():RegisterFlagEffect(DefenseEntirelyFlag,RESET_EVENT+RESETS_STANDARD,0,1) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_MONSTER)
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0) local g=vgf.SelectMatchingCard(HINTMSG_MONSTER,e,tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
if g:GetCount()>=2 then if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) local tc=g:GetFirst()
g=g:Select(tp,1,1,nil) if vgf.RMonsterFilter(tc) then
vgf.Sendto(LOCATION_DROP,g,REASON_EFFECT+REASON_DISCARD) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(1)
tc:RegisterEffect(e1)
vgf.EffectReset(c,e1,EVENT_BATTLED)
elseif vgf.VMonsterFilter(tc) then
tc:RegisterFlagEffect(DefenseEntirelyFlag,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
local sg=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
if sg:GetCount()>=2 then
sg=sg:Select(tp,1,1,nil)
vgf.Sendto(LOCATION_DROP,sg,REASON_DISCARD+REASON_EFFECT)
end end
end end
\ No newline at end of file
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