Commit 6faba86a authored by jwyxym's avatar jwyxym Committed by GitHub

Add files via upload

parent fd0ae174
...@@ -513,39 +513,47 @@ end ...@@ -513,39 +513,47 @@ end
function VgF.SearchCard(loc,f) function VgF.SearchCard(loc,f)
if not loc then return end if not loc then return end
return function (e,tp,eg,ep,ev,re,r,rp) return function (e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) VgF.SearchCardOP(loc,f,e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,function (c)
if VgF.GetValueType(f)=="function" and not f(c) then return false end
return c:IsAbleToHand()
end,tp,loc,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
local sg=Duel.GetOperatedGroup() local sg=Duel.GetOperatedGroup()
return sg:GetCount() return sg:GetCount()
end end
end end
---用于效果的Operation。执行“从loc中选取1张满足f的卡,Call到R上。”。 function VgF.SearchCardOP(loc,f,e,tp,eg,ep,ev,re,r,rp)
if not loc then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,function (c)
if VgF.GetValueType(f)=="function" and not f(c) then return false end
return c:IsAbleToHand()
end,tp,loc,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
---用于效果的Operation。执行“从loc中选取1张满足f的卡,Call到R上。”。
---@param loc integer 要选取的区域。不填则返回nil,而不是效果的Operation函数。 ---@param loc integer 要选取的区域。不填则返回nil,而不是效果的Operation函数。
---@param f function 卡片过滤的条件 ---@param f function 卡片过滤的条件
---@return function|nil 效果的Operation函数 ---@return function|nil 效果的Operation函数
function VgF.SearchCardSpecialSummon(loc,f) function VgF.SearchCardSpecialSummon(loc,f)
if not loc then return end if not loc then return end
return function (e,tp,eg,ep,ev,re,r,rp) return function (e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) VgF.SearchCardSpecialSummonOP(loc,f,e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,function (c)
if VgF.GetValueType(f)=="function" and not f(c) then return false end
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK)
end,tp,loc,0,1,1,nil)
if g:GetCount()>0 then
if loc&LOCATION_DECK+LOCATION_HAND+LOCATION_EXTRA==0 then Duel.HintSelection(g) end
VgF.Call(g,0,tp)
end
local sg=Duel.GetOperatedGroup() local sg=Duel.GetOperatedGroup()
return sg:GetCount() return sg:GetCount()
end end
end end
function VgF.SearchCardSpecialSummonOP(loc,f,e,tp,eg,ep,ev,re,r,rp)
if not loc then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,function (c)
if VgF.GetValueType(f)=="function" and not f(c) then return false end
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK)
end,tp,loc,0,1,1,nil)
if g:GetCount()>0 then
if loc&LOCATION_DECK+LOCATION_HAND+LOCATION_EXTRA==0 then Duel.HintSelection(g) end
VgF.Call(g,0,tp)
end
end
function Group.CheckSubGroup(g,f,min,max,...) function Group.CheckSubGroup(g,f,min,max,...)
min = min or 1 min = min or 1
max = max or #g max = max or #g
...@@ -621,4 +629,4 @@ function VgF.CheckPrison(p) ...@@ -621,4 +629,4 @@ function VgF.CheckPrison(p)
local og=Duel.GetFieldGroup(p,LOCATION_ORDER,0) local og=Duel.GetFieldGroup(p,LOCATION_ORDER,0)
local oc=og:Filter(VgF.PrisonFilter,nil,og:GetCount()):GetFirst() local oc=og:Filter(VgF.PrisonFilter,nil,og:GetCount()):GetFirst()
return oc:IsSetCard(0x3040) return oc:IsSetCard(0x3040)
end end
\ No newline at end of file
...@@ -10,7 +10,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -10,7 +10,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
Duel.HintSelection(g) Duel.HintSelection(g)
VgF.AtkUp(c,g,5000,nil) VgF.AtkUp(c,g,5000,nil)
vgf.SearchCard(LOCATION_DROP,cm.filter) vgf.SearchCardOP(LOCATION_DROP,cm.filter,e,tp,eg,ep,ev,re,r,rp)
end end
function cm.filter(c) function cm.filter(c)
return c:IsCode(10101006) return c:IsCode(10101006)
......
...@@ -9,7 +9,7 @@ function cm.initial_effect(c) ...@@ -9,7 +9,7 @@ function cm.initial_effect(c)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
vgf.SearchCard(LOCATION_DECK,cm.fliter) vgf.SearchCardOP(LOCATION_DECK,cm.fliter,e,tp,eg,ep,ev,re,r,rp)
vgf.AtkUp(c,c,10000,nil) vgf.AtkUp(c,c,10000,nil)
end end
function cm.fliter(c) function cm.fliter(c)
...@@ -22,10 +22,9 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -22,10 +22,9 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp) function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
vgf.SearchCardSpecialSummon(LOCATION_DROP,cm.fliter2) vgf.SearchCardSpecialSummonOP(LOCATION_DROP,cm.fliter2,e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetOperatedGroup() local g=Duel.GetOperatedGroup()
vgf.AtkUp(c,g,10000) vgf.AtkUp(c,g,10000)
end end
function cm.fliter2(c) function cm.fliter2(c)
return vgf.IsLevel(c,1,2,3) return vgf.IsLevel(c,1,2,3)
......
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