Commit 175e4655 authored by xiaoye's avatar xiaoye

fix

parent 2cb6cb6e
......@@ -19,9 +19,8 @@ function cm.con(e,tp,eg,ep,ev,re,r,rp)
return (c:IsSummonType(SUMMON_TYPE_RIDE) or c:IsSummonType(SUMMON_TYPE_SELFRIDE))
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
if vgf.GetAvailableLocation(tp)&0x4<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CALL)
local g=vgf.GetMatchingGroup(vgf.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst():GetOverlayGroup():Select(tp,1,1,nil)
local g=vgf.GetMatchingGroup(vgf.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst():GetOverlayGroup():FilterSelect(tp,vgf.IsCanBeCalled,1,1,nil,e,tp,nil,nil,0x4)
vgf.Sendto(LOCATION_MZONE,g,0,tp,0x4)
vgf.OverlayFill(1)(e,tp,eg,ep,ev,re,r,rp)
end
......@@ -16,7 +16,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(tp,1)
local tc=vgf.ReturnCard(g)
Duel.DisableShuffleCheck()
if tc:IsType(TYPE_MONSTER) then
if vgf.IsCanBeCalled(tc,e,tp) then
vgf.Sendto(LOCATION_MZONE,g,0,tp)
else
vgf.Sendto(LOCATION_DROP,g,REASON_EFFECT)
......
......@@ -13,7 +13,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(tp,1)
local tc=vgf.ReturnCard(g)
Duel.DisableShuffleCheck()
if tc:IsType(TYPE_MONSTER) then
if vgf.IsCanBeCalled(tc,e,tp) then
vgf.Sendto(LOCATION_MZONE,g,0,tp)
else
vgf.Sendto(LOCATION_HAND,g,nil,REASON_EFFECT)
......
......@@ -20,7 +20,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(tp,1)
local tc=vgf.ReturnCard(g)
Duel.DisableShuffleCheck()
if tc:IsType(TYPE_MONSTER) and vgf.IsLevel(tc,0,1,2) then
if vgf.IsCanBeCalled(tc,e,tp) and vgf.IsLevel(tc,0,1,2) then
vgf.Sendto(LOCATION_MZONE,g,0,tp)
else
vgf.Sendto(LOCATION_OVERLAY,g,c)
......
......@@ -11,7 +11,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(tp,1)
local tc=vgf.ReturnCard(g)
Duel.DisableShuffleCheck()
if tc:IsType(TYPE_MONSTER) then
if vgf.IsCanBeCalled(tc,e,tp) then
vgf.Sendto(LOCATION_MZONE,g,0,tp)
else
vgf.Sendto(LOCATION_HAND,g,nil,REASON_EFFECT)
......
......@@ -46,7 +46,7 @@ function cm.op1(e,tp,eg,ep,ev,re,r,rp)
if ct>e:GetLabel() then ct=e:GetLabel() end
local g=vgf.SelectMatchingCard(HINTMSG_CALL,e,tp,cm.filter1,tp,0,LOCATION_ORDER,ct,ct,nil,e,tp)
for tc in vgf.Next(g) do
if tc:IsType(TYPE_MONSTER) then
if vgf.IsCanBeCalled(tc,e,tp) then
vgf.Sendto(LOCATION_MZONE,tc,0,tp)
else
vgf.Sendto(LOCATION_DROP,tc,REASON_EFFECT)
......@@ -54,5 +54,5 @@ function cm.op1(e,tp,eg,ep,ev,re,r,rp)
end
end
function cm.filter1(c,e,tp)
return c:GetFlagEffect(FLAG_IMPRISON)>0
return c:GetFlagEffect(FLAG_IMPRISON)>0 and (vgf.IsCanBeCalled(c,e,tp) or not c:IsType(TYPE_MONSTER))
end
\ No newline at end of file
......@@ -13,7 +13,7 @@ function cm.con(e,tp,eg,ep,ev,re,r,rp)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=vgf.SelectMatchingCard(HINTMSG_CALL,e,tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil)
local g=vgf.SelectMatchingCard(HINTMSG_CALL,e,tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if vgf.Sendto(LOCATION_MZONE,g,SUMMON_VALUE_REVOLT,tp,0x20)>0 then
local mg=Duel.GetOperatedGroup()
vgd.TriggerCountUp(c,-2,RESET_PHASE+PHASE_END,mg)
......@@ -23,8 +23,8 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetAttacker()==c
end
function cm.filter(c)
return c:IsSetCard(0x76) and c:IsType(TYPE_MONSTER)
function cm.filter(c,e,tp)
return c:IsSetCard(0x76) and vgf.IsCanBeCalled(c,e,tp)
end
function cm.checkfilter(c)
return (c:IsSummonType(SUMMON_TYPE_SELFRIDE) or c:IsSummonType(SUMMON_TYPE_RIDE)) and c:IsLevelAbove(4)
......
......@@ -14,7 +14,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local off=1
local ops={}
local a=g:IsExists(cm.filter,1,nil)
local b=g:IsExists(cm.filter1,1,nil,tp)
local b=g:IsExists(cm.filter1,1,nil,e,tp)
if a then
ops[off]=1190
off=off+1
......@@ -33,7 +33,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
g:RemoveCard(vgf.ReturnCard(sg))
elseif (sel==1 and a and b) or (sel==0 and not a and b) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CALL)
local sg=g:FilterSelect(tp,cm.filter1,1,1,nil,tp)
local sg=g:FilterSelect(tp,cm.filter1,1,1,nil,e,tp)
vgf.Sendto(LOCATION_MZONE,sg,0,tp)
g:RemoveCard(vgf.ReturnCard(sg))
end
......@@ -48,6 +48,6 @@ end
function cm.filter(c)
return c:IsSetCard(0x77)
end
function cm.filter1(c,tp)
return c:IsLevelBelow(3) and c:IsType(TYPE_MONSTER) and vgf.GetAvailableLocation(tp)>0
function cm.filter1(c,e,tp)
return c:IsLevelBelow(3) and vgf.IsCanBeCalled(c,e,tp)
end
\ No newline at end of file
......@@ -34,8 +34,8 @@ end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_Call)
local g=vgf.GetVMonster(tp):GetOverlayGroup():FilterSelect(tp,cm.filter,1,1,nil,e,tp)
vgf.Sendto(LOCATION_MZONE,g,0,tp,0x20,POS_FACEDOWN_DEFENCE)
vgf.Sendto(LOCATION_MZONE,g,SUMMON_TYPE_RIDE,tp,0x20,POS_FACEDOWN_DEFENCE)
end
function cm.filter(c,e,tp)
return c:IsSetCard(0x202) and c:IsType(TYPE_MONSTER)
return c:IsSetCard(0x202) and vgf.IsCanBeCalled(c,e,tp,SUMMON_TYPE_RIDE,POS_FACEDOWN_DEFENCE,0x20)
end
\ No newline at end of file
......@@ -8,6 +8,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if vgf.GetAvailableLocation(tp)<=0 then return end
vgf.Sendto(LOCATION_MZONE,c,0,tp)
if vgf.IsCanBeCalled(c,e,tp) then
vgf.Sendto(LOCATION_MZONE,c,0,tp)
end
end
\ No newline at end of file
......@@ -18,7 +18,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(tp,3)
Duel.ConfirmCards(tp,g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:FilterSelect(tp,cm.filter,0,1,nil)
local sg=g:FilterSelect(tp,cm.filter,0,1,nil,e,tp)
if sg:GetCount()>0 then
vgf.Sendto(LOCATION_HAND,sg,nil,REASON_EFFECT)
else
......@@ -26,6 +26,6 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function cm.filter(c)
return c:IsLevelAbove(3) and c:IsType(TYPE_MONSTER)
function cm.filter(c,e,tp)
return c:IsLevelAbove(3) and vgf.IsCanBeCalled(c,e,tp)
end
\ No newline at end of file
......@@ -33,7 +33,7 @@ function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local ct=bit.ReturnCount(zone)
zone=bit.bor(zone,0xffffff00)
if ct>2 then ct=2 end
local g=vgf.SelectMatchingCard(HINTMSG_CALL,e,tp,Card.IsType,tp,LOCATION_HAND,0,0,ct,nil,TYPE_MONSTER)
local g=vgf.SelectMatchingCard(HINTMSG_CALL,e,tp,vgf.IsCanBeCalled,tp,LOCATION_HAND,0,0,ct,nil,e,tp)
if g:GetCount()==1 then
vgf.Sendto(LOCATION_MZONE,g,0,tp)
elseif g:GetCount()==2 then
......
......@@ -15,11 +15,11 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if vgf.GetAvailableLocation(tp)<=0 then return end
local g=vgf.SelectMatchingCard(HINTMSG_Call,e,tp,cm.filter,tp,LOCATION_DROP,0,1,1,nil)
local g=vgf.SelectMatchingCard(HINTMSG_Call,e,tp,cm.filter,tp,LOCATION_DROP,0,1,1,nil,e,tp)
vgf.Sendto(LOCATION_MZONE,g,0,tp,nil,POS_FACEUP_DEFENSE)
end
function cm.filter(c)
return c:IsLevel(c,0,1) and c:IsType(TYPE_MONSTER)
function cm.filter(c,e,tp)
return c:IsLevel(c,0,1) and vgf.IsCanBeCalled(c,e,tp)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -11,7 +11,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.DisableShuffleCheck()
local off=1
local ops={}
local a=tc:IsType(TYPE_MONSTERS) and vgf.GetAvailableLocation(tp)>0
local a=vgf.IsCanBeCalled(tc,e,tp)
if a then
ops[off]=1152
off=off+1
......
......@@ -29,7 +29,7 @@ function cm.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(g)
local ct1=vgf.GetAvailableLocation(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CALL)
local sg=g:FilterSelect(tp,Card.IsType,0,ct1,nil,TYPE_MONSTER)
local sg=g:FilterSelect(tp,vgf.IsCanBeCalled,0,ct1,nil,e,tp)
if sg:GetCount()>0 then
vgf.Sendto(LOCATION_MZONE,sg,0,tp)
g:Sub(sg)
......
......@@ -16,7 +16,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp,chk)
if ct>0 then
Duel.DisableShuffleCheck()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CALL)
local sg=g:Select(tp,1,ct,nil)
local sg=g:FilterSelect(tp,vgf.IsCanBeCalled,0,ct,nil,e,tp)
vgf.Sendto(LOCATION_MZONE,sg,0,tp)
sg=Duel.GetOperatedGroup()
vgf.AtkUp(c,sg,5000)
......
......@@ -10,16 +10,17 @@ function cm.con(e,tp,eg,ep,ev,re,r,rp)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(tp,5)
local c=e:GetHandler()
Duel.ConfirmCards(tp,g)
Duel.DisableShuffleCheck()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CALL)
local sg=g:FilterSelect(tp,cm.filter,0,2,nil)
local sg=g:FilterSelect(tp,cm.filter,0,2,nil,e,tp)
if #sg>0 then
vgf.Sendto(LOCATION_MZONE,c,0,tp,31,POS_FACEUP_ATTACK,0)
end
Duel.ShuffleDeck(tp)
end
function cm.filter(c)
return not c:IsRace(TRIGGER_NONE)
function cm.filter(c,e,tp)
return not c:IsRace(TRIGGER_NONE) and vgf.IsCanBeCalled(c,e,tp)
end
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