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
bdb09189
Commit
bdb09189
authored
Nov 11, 2024
by
xiaoye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update VgF.SearchCard()
parent
51255a0f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
VgFuncLib.lua
VgFuncLib.lua
+12
-0
No files found.
VgFuncLib.lua
View file @
bdb09189
...
...
@@ -782,6 +782,7 @@ function VgF.SearchCard(loc_to, loc_from, f, int_max, int_min, ...)
local
ext_params
=
{
...
}
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
loc_to
or
not
loc_from
then
return
0
end
if
loc_from
==
LOCATION_RZONE
then
loc_from
=
LOCATION_MZONE
end
if
VgF
.
GetValueType
(
int_max
)
~=
"number"
then
int_max
=
1
end
if
VgF
.
GetValueType
(
int_min
)
~=
"number"
then
int_min
=
int_max
end
if
loc_to
==
LOCATION_HAND
then
...
...
@@ -791,7 +792,18 @@ function VgF.SearchCard(loc_to, loc_from, f, int_max, int_min, ...)
if
g
:
GetCount
()
>
0
then
return
VgF
.
Sendto
(
loc_to
,
g
,
nil
,
REASON_EFFECT
)
end
elseif
loc_to
==
LOCATION_VZONE
then
local
g
=
VgF
.
SelectMatchingCard
(
HINTMSG_CALL
,
e
,
tp
,
function
(
c
)
if
not
VgF
.
IsCanBeCalled
(
c
,
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
if
loc_from
==
LOCATION_OVERLAY
then
return
VgF
.
Sendto
(
loc_to
,
g
,
0
,
tp
,
"FromOverlayToV"
)
else
return
VgF
.
Sendto
(
loc_to
,
g
,
0
,
tp
,
0x20
)
end
end
elseif
loc_to
==
LOCATION_MZONE
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
return
VgF
.
GetValueType
(
f
)
~=
"function"
or
f
(
c
,
table.unpack
(
ext_params
))
...
...
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