Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
V
Vgdpro Scripts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaoye
Vgdpro Scripts
Commits
b53a2ad8
Commit
b53a2ad8
authored
Feb 24, 2025
by
whenmo
Committed by
GitHub
Feb 24, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix LeaveFieldCost 增加额外退场数量判定(10402047)
parent
58e1c9cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
10 deletions
+32
-10
vgfuncLib.lua
vgfuncLib.lua
+32
-10
No files found.
vgfuncLib.lua
View file @
b53a2ad8
...
@@ -740,12 +740,12 @@ function VgF.DamageCost(val)
...
@@ -740,12 +740,12 @@ function VgF.DamageCost(val)
end
end
---用于效果的Cost。它返回一个执行“【费用】[将xxx退场]”的函数。
---用于效果的Cost。它返回一个执行“【费用】[将xxx退场]”的函数。
---@param card_code_func Card|integer|function|nil 退场的卡的条件
---@param card_code_func Card|integer|function|nil 退场的卡的条件
---@param
val_
max number|nil 退场的卡的最大数量
---@param max number|nil 退场的卡的最大数量
---@param
val_
min number|nil 退场的卡的最小数量
---@param min number|nil 退场的卡的最小数量
---@param except Card|nil
---@param except Card|nil
---@param ... any
---@param ... any
---@return function 效果的Cost函数
---@return function 效果的Cost函数
function
VgF
.
LeaveFieldCost
(
card_code_func
,
val_max
,
val_
min
,
except
,
...
)
function
VgF
.
LeaveFieldCost
(
card_code_func
,
max
,
min
,
except
,
...
)
if
not
card_code_func
then
if
not
card_code_func
then
return
VgF
.
LeaveFieldCostGroup
()
return
VgF
.
LeaveFieldCostGroup
()
elseif
VgF
.
GetValueType
(
card_code_func
)
==
"Card"
then
elseif
VgF
.
GetValueType
(
card_code_func
)
==
"Card"
then
...
@@ -754,8 +754,8 @@ function VgF.LeaveFieldCost(card_code_func, val_max, val_min, except, ...)
...
@@ -754,8 +754,8 @@ function VgF.LeaveFieldCost(card_code_func, val_max, val_min, except, ...)
return
VgF
.
LeaveFieldCostGroup
(
card_code_func
)
return
VgF
.
LeaveFieldCostGroup
(
card_code_func
)
end
end
local
ex_params
=
{
...
}
local
ex_params
=
{
...
}
val_min
,
val_max
=
val_min
or
1
,
val_
max
or
1
min
,
max
=
min
or
1
,
max
or
1
if
val_min
>
val_max
then
val_min
=
val_
max
end
if
min
>
max
then
min
=
max
end
local
leave_filter
=
VgF
.
True
local
leave_filter
=
VgF
.
True
if
type
(
card_code_func
)
==
"function"
then
if
type
(
card_code_func
)
==
"function"
then
leave_filter
=
card_code_func
leave_filter
=
card_code_func
...
@@ -764,16 +764,38 @@ function VgF.LeaveFieldCost(card_code_func, val_max, val_min, except, ...)
...
@@ -764,16 +764,38 @@ function VgF.LeaveFieldCost(card_code_func, val_max, val_min, except, ...)
end
end
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
leave_filter
=
function
(
c
)
return
leave_filter
(
c
,
table.unpack
(
ex_params
))
and
c
:
IsAbleToGraveAsCost
()
end
leave_filter
=
function
(
c
)
return
leave_filter
(
c
,
table.unpack
(
ex_params
))
and
c
:
IsAbleToGraveAsCost
()
end
if
chk
==
0
then
return
VgF
.
IsExistingMatchingCard
(
leave_filter
,
tp
,
LOCATION_MZONE
,
0
,
val_min
,
except
)
end
local
g
=
VgF
.
GetMatchingGroup
(
leave_filter
,
tp
,
LOCATION_MZONE
,
0
,
except
)
local
g
=
VgF
.
SelectMatchingCard
(
HINTMSG_LEAVEFIELD
,
e
,
tp
,
leave_filter
,
tp
,
LOCATION_MZONE
,
0
,
val_min
,
val_max
,
except
)
if
chk
==
0
then
return
g
:
CheckSubGroup
(
VgF
.
LeaveFieldCostFilter
,
1
,
max
,
min
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_LEAVEFIELD
)
g
=
g
:
SelectSubGroup
(
tp
,
VgF
.
LeaveFieldCostFilter
,
false
,
1
,
max
,
min
,
e
,
tp
)
VgF
.
Sendto
(
LOCATION_DROP
,
g
,
REASON_COST
)
VgF
.
Sendto
(
LOCATION_DROP
,
g
,
REASON_COST
)
end
end
end
end
function
VgF
.
LeaveFieldCostFilter
(
g
,
min
,
e
,
tp
)
local
fg
=
g
:
Filter
(
Card
.
IsHasEffect
,
nil
,
EFFECT_EXTRA_LEAVEFIELD_COUNT
)
if
#
fg
==
0
then
return
#
g
>=
min
end
local
val_total
=
0
for
c
in
VgF
.
Next
(
fg
)
do
for
_
,
te
in
pairs
({
c
:
IsHasEffect
(
EFFECT_EXTRA_LEAVEFIELD_COUNT
)})
do
local
val
=
te
:
GetValue
()
-- number or function
if
not
(
val
or
type
(
val
)
==
"number"
or
type
(
val
)
==
"function"
)
then
Debug
.
Message
(
"EFFECT_EXTRA_LEAVEFIELD_COUNT Value should be number or function"
)
end
if
type
(
val
)
==
"function"
then
val
=
val
(
g
,
e
,
tp
)
end
val_total
=
val_total
+
val
end
end
min
=
min
>
val_total
and
(
min
-
val_total
)
or
1
return
#
g
>=
min
end
---将 自己/g 退场
function
VgF
.
LeaveFieldCostGroup
(
g
)
function
VgF
.
LeaveFieldCostGroup
(
g
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
g
=
g
or
Group
.
FromCards
(
e
:
GetHandler
())
g
=
g
or
Group
.
FromCards
(
e
:
GetHandler
())
g
=
g
:
Filter
(
function
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
(
c
~=
e
:
GetHandler
()
or
c
:
IsRelateToEffect
(
e
))
end
,
nil
)
local
f
g
=
g
:
Filter
(
function
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
(
c
~=
e
:
GetHandler
()
or
c
:
IsRelateToEffect
(
e
))
end
,
nil
)
if
chk
==
0
then
return
g
:
GetCount
()
>
0
end
if
chk
==
0
then
return
#
g
==
#
fg
end
VgF
.
Sendto
(
LOCATION_DROP
,
g
,
REASON_COST
)
VgF
.
Sendto
(
LOCATION_DROP
,
g
,
REASON_COST
)
end
end
end
end
...
@@ -1532,4 +1554,4 @@ function VgF.EffectDamage(val, p)
...
@@ -1532,4 +1554,4 @@ function VgF.EffectDamage(val, p)
end
end
VgF
.
EffectDamageE
=
e1
VgF
.
EffectDamageE
=
e1
end
end
end
end
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment