Commit e3d59b7e authored by xiaoye's avatar xiaoye

fix

parent b763072e
......@@ -7,7 +7,7 @@ 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=vgf.SelectMatchingCard(HINTMSG_CALL,e,tp,cm.filter,tp,LOCATION_SOUL,0,0,1,nil,e,tp)
vgf.Sendto(LOCATION_CIRCLE,g,0,tp,"NoMonster")
vgf.Sendto(LOCATION_CIRCLE,g,0,tp,"NoUnit")
end
function cm.filter(c,e,tp)
return c:IsCanBeCalled(e,tp)end
\ No newline at end of file
......@@ -11,7 +11,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(tp,g)
Duel.ConfirmCards(1-tp,g)
local tc=g:GetFirst()
if tc:IsType(TYPE_UNIT) and tc:GetLevel()~=2 and tc:IsCanBeCalled(e,tp) and vgf.Sendto(LOCATION_CIRCLE,tc,0,tp,"NoMonster")==0 then
if tc:IsType(TYPE_UNIT) and tc:GetLevel()~=2 and tc:IsCanBeCalled(e,tp) and vgf.Sendto(LOCATION_CIRCLE,tc,0,tp,"NoUnit")==0 then
Duel.MoveSequence(tc,1)
end
end
......
......@@ -15,7 +15,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CALL)
local sg=g:FilterSelect(tp,cm.filter,0,2,nil,e,tp)
if #sg>0 then
vgf.Sendto(LOCATION_CIRCLE,sg,0,tp,"NoMonster")
vgf.Sendto(LOCATION_CIRCLE,sg,0,tp,"NoUnit")
end
Duel.ShuffleDeck(tp)
end
......
......@@ -8,7 +8,7 @@ end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsCanBeCalled(e,tp) then
vgf.Sendto(LOCATION_CIRCLE,c,0,tp,"NoMonster")
vgf.Sendto(LOCATION_CIRCLE,c,0,tp,"NoUnit")
end
end
......
......@@ -542,19 +542,6 @@ function VgF.Cost.RetireGroup(g)
VgF.Sendto(LOCATION_DROP, g, REASON_COST)
end
end
function VgF.IsCanBeCalled(c, e, tp, calltyp, pos, zone)
local z = 0
if VgF.GetValueType(zone) == "number" then z = VgF.GetAvailableLocation(tp, zone)
elseif VgF.GetValueType(zone) == "string" and zone == "NoMonster" then z = Duel.GetLocationCount(tp, LOCATION_CIRCLE) zone = 0xff
else z = VgF.GetAvailableLocation(tp) zone = 0xff end
if VgF.GetValueType(calltyp) ~= "number" then calltyp = 0 end
if VgF.GetValueType(pos) ~= "number" then pos = POS_FACEUP_ATTACK end
if VgF.GetValueType(zone) == "string" and zone == "FromSouloV" then
local _, code = c:GetOriginalCode()
return Duel.IsPlayerCanSpecialSummonMonster(tp, code, nil, TYPE_UNIT + TYPE_NORMAL, c:GetBaseAttack(), c:GetBaseDefense(), c:GetOriginalLevel(), c:GetOriginalRace(), c:GetOriginalAttribute())
end
return z > 0 and c:IsCanBeSpecialSummoned(e, calltyp, tp, false, false, pos, tp, zone)
end
----catalogue:Cost和Operation均可使用的函数------------------------------------------------------
......@@ -649,7 +636,7 @@ function VgF.Operation.CardsFromTo(reason ,loc_to, loc_from, f, int_max, int_min
end
elseif loc_to == LOCATION_V_CIRCLE then
local g = VgF.SelectMatchingCard(HINTMSG_CALL, e, tp, function (c)
if not VgF.IsCanBeCalled(c, e, tp) then return false end
if not c:IsCanBeCalled(e, tp) then return false end
return VgF.GetValueType(f) ~= "function" or f(c, table.unpack(ext_params))
end, tp, loc_from, 0, int_min, int_max, nil)
if g:GetCount() > 0 then
......@@ -660,7 +647,7 @@ function VgF.Operation.CardsFromTo(reason ,loc_to, loc_from, f, int_max, int_min
elseif loc_to == LOCATION_CIRCLE then
if VgF.GetAvailableLocation(tp) < int_min then return 0 end
local g = VgF.SelectMatchingCard(HINTMSG_CALL, e, tp, function (c)
if not VgF.IsCanBeCalled(c, e, tp) then return false end
if not c:IsCanBeCalled(e, tp) then return false end
return VgF.GetValueType(f) ~= "function" or f(c, table.unpack(ext_params))
end, tp, loc_from, 0, int_min, int_max, nil)
if g:GetCount() > 0 then
......@@ -869,12 +856,12 @@ function Card.IsCanBeCalled(c, e, tp, calltyp, callpos, zone)
if zone == "FromSoulToV" then
local _, code = c:GetOriginalCode()
local atk, def, lv, race, att = c:GetBaseAttack(), c:GetBaseDefense(), c:GetOriginalLevel(), c:GetOriginalRace(), c:GetOriginalAttribute()
return Duel.IsPlayerCanSpecialSummonMonster(tp, code, nil, TYPE_MONSTER + TYPE_EFFECT, atk, def, lv, race, att, callpos, tp, calltyp)
return Duel.IsPlayerCanSpecialSummonMonster(tp, code, nil, TYPE_UNIT + TYPE_NORMAL, atk, def, lv, race, att, callpos, tp, calltyp)
end
if zone == "NoMonster" and Duel.GetLocationCount(tp, LOCATION_CIRCLE) == 0 then return false end
if zone == "NoUnit" and Duel.GetLocationCount(tp, LOCATION_CIRCLE) == 0 then return false end
if type(zone) ~= "number" then zone = 0x1f end
if VgF.GetAvailableLocation(tp, zone) == 0 then return false end
return loccount > 0 and c:IsCanBeSpecialSummoned(e, calltyp, tp, false, false, callpos, tp, zone)
return c:IsCanBeSpecialSummoned(e, calltyp, tp, false, false, callpos, tp, zone)
end
--catalogue:Group库自定义函数-----------------------------------------------------------------------
......@@ -1142,11 +1129,11 @@ end
function VgF.Call(g, calltyp, tp, zone, pos)
if (VgF.GetValueType(g) ~= "Card" and VgF.GetValueType(g) ~= "Group") or (VgF.GetValueType(g) == "Group" and g:GetCount() == 0) then return 0 end
if VgF.GetValueType(pos) ~= "number" then pos = POS_FACEUP_ATTACK end
if VgF.GetValueType(zone) == "string" and zone == "NoMonster" then
if VgF.GetValueType(zone) == "string" and zone == "NoUnit" then
return Duel.SpecialSummon(g, calltyp, tp, tp, false, false, pos)
elseif VgF.GetValueType(zone) == "string" and zone == "FromSouloV" then
local tc = VgF.ReturnCard(g)
if not VgF.IsCanBeCalled(tc, nil, tp, calltyp, pos, "FromSouloV") then return 0 end
if not tc:IsCanBeCalled(nil, tp, calltyp, pos, "FromSouloV") then return 0 end
VgF.Sendto(0, tc, tp, POS_FACEUP, REASON_EFFECT)
local _, code = tc:GetOriginalCode()
local c = Duel.CreateToken(tp, code)
......
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