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) ...@@ -7,7 +7,7 @@ function cm.con(e,tp,eg,ep,ev,re,r,rp)
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 g=vgf.SelectMatchingCard(HINTMSG_CALL,e,tp,cm.filter,tp,LOCATION_SOUL,0,0,1,nil,e,tp) 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 end
function cm.filter(c,e,tp) function cm.filter(c,e,tp)
return c:IsCanBeCalled(e,tp)end 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) ...@@ -11,7 +11,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(tp,g) Duel.ConfirmCards(tp,g)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
local tc=g:GetFirst() 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) Duel.MoveSequence(tc,1)
end end
end end
......
...@@ -15,7 +15,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp) ...@@ -15,7 +15,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CALL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CALL)
local sg=g:FilterSelect(tp,cm.filter,0,2,nil,e,tp) local sg=g:FilterSelect(tp,cm.filter,0,2,nil,e,tp)
if #sg>0 then if #sg>0 then
vgf.Sendto(LOCATION_CIRCLE,sg,0,tp,"NoMonster") vgf.Sendto(LOCATION_CIRCLE,sg,0,tp,"NoUnit")
end end
Duel.ShuffleDeck(tp) Duel.ShuffleDeck(tp)
end end
......
...@@ -8,7 +8,7 @@ end ...@@ -8,7 +8,7 @@ end
function cm.op(e,tp,eg,ep,ev,re,r,rp) function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsCanBeCalled(e,tp) then 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
end end
......
...@@ -542,19 +542,6 @@ function VgF.Cost.RetireGroup(g) ...@@ -542,19 +542,6 @@ function VgF.Cost.RetireGroup(g)
VgF.Sendto(LOCATION_DROP, g, REASON_COST) VgF.Sendto(LOCATION_DROP, g, REASON_COST)
end end
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均可使用的函数------------------------------------------------------ ----catalogue:Cost和Operation均可使用的函数------------------------------------------------------
...@@ -649,7 +636,7 @@ function VgF.Operation.CardsFromTo(reason ,loc_to, loc_from, f, int_max, int_min ...@@ -649,7 +636,7 @@ function VgF.Operation.CardsFromTo(reason ,loc_to, loc_from, f, int_max, int_min
end end
elseif loc_to == LOCATION_V_CIRCLE then elseif loc_to == LOCATION_V_CIRCLE then
local g = VgF.SelectMatchingCard(HINTMSG_CALL, e, tp, function (c) 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)) return VgF.GetValueType(f) ~= "function" or f(c, table.unpack(ext_params))
end, tp, loc_from, 0, int_min, int_max, nil) end, tp, loc_from, 0, int_min, int_max, nil)
if g:GetCount() > 0 then if g:GetCount() > 0 then
...@@ -660,7 +647,7 @@ function VgF.Operation.CardsFromTo(reason ,loc_to, loc_from, f, int_max, int_min ...@@ -660,7 +647,7 @@ function VgF.Operation.CardsFromTo(reason ,loc_to, loc_from, f, int_max, int_min
elseif loc_to == LOCATION_CIRCLE then elseif loc_to == LOCATION_CIRCLE then
if VgF.GetAvailableLocation(tp) < int_min then return 0 end if VgF.GetAvailableLocation(tp) < int_min then return 0 end
local g = VgF.SelectMatchingCard(HINTMSG_CALL, e, tp, function (c) 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)) return VgF.GetValueType(f) ~= "function" or f(c, table.unpack(ext_params))
end, tp, loc_from, 0, int_min, int_max, nil) end, tp, loc_from, 0, int_min, int_max, nil)
if g:GetCount() > 0 then if g:GetCount() > 0 then
...@@ -865,16 +852,16 @@ end ...@@ -865,16 +852,16 @@ end
---@return boolean 返回卡片 c 是否可以被玩家 tp 用效果 e[以 calltyp 方式和 callpos 表示形式] Call 到玩家 tp [的区域 zone] ---@return boolean 返回卡片 c 是否可以被玩家 tp 用效果 e[以 calltyp 方式和 callpos 表示形式] Call 到玩家 tp [的区域 zone]
function Card.IsCanBeCalled(c, e, tp, calltyp, callpos, zone) function Card.IsCanBeCalled(c, e, tp, calltyp, callpos, zone)
calltyp = calltyp or 0 calltyp = calltyp or 0
callpos = callpos or POS_FACEUP_ATTACK callpos = callpos or POS_FACEUP_ATTACK
if zone == "FromSoulToV" then if zone == "FromSoulToV" then
local _, code = c:GetOriginalCode() local _, code = c:GetOriginalCode()
local atk, def, lv, race, att = c:GetBaseAttack(), c:GetBaseDefense(), c:GetOriginalLevel(), c:GetOriginalRace(), c:GetOriginalAttribute() 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 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 type(zone) ~= "number" then zone = 0x1f end
if VgF.GetAvailableLocation(tp, zone) == 0 then return false 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 end
--catalogue:Group库自定义函数----------------------------------------------------------------------- --catalogue:Group库自定义函数-----------------------------------------------------------------------
...@@ -1142,11 +1129,11 @@ end ...@@ -1142,11 +1129,11 @@ end
function VgF.Call(g, calltyp, tp, zone, pos) 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(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(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) return Duel.SpecialSummon(g, calltyp, tp, tp, false, false, pos)
elseif VgF.GetValueType(zone) == "string" and zone == "FromSouloV" then elseif VgF.GetValueType(zone) == "string" and zone == "FromSouloV" then
local tc = VgF.ReturnCard(g) 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) VgF.Sendto(0, tc, tp, POS_FACEUP, REASON_EFFECT)
local _, code = tc:GetOriginalCode() local _, code = tc:GetOriginalCode()
local c = Duel.CreateToken(tp, code) 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