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
4481e2a4
Commit
4481e2a4
authored
Feb 27, 2025
by
whenmo
Committed by
GitHub
Feb 27, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix about getmatchinggroup
parent
979c64be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
131 additions
and
225 deletions
+131
-225
vgfuncLib.lua
vgfuncLib.lua
+131
-225
No files found.
vgfuncLib.lua
View file @
4481e2a4
...
@@ -75,27 +75,32 @@ function VgF.GetValueType(v)
...
@@ -75,27 +75,32 @@ function VgF.GetValueType(v)
else
return
t
end
else
return
t
end
end
end
---如果g是Group的话,返回其第一张卡;如果g是Card的话,返回其本身;否则返回nil。
---返回卡片,接受 Card,Group,Effect
---@param g any 要操作的变量
---@param val 要操作的参数
---@return Card
---@return Card 返回卡片
function
VgF
.
ReturnCard
(
g
)
function
VgF
.
ReturnCard
(
val
)
local
tc
=
nil
local
typ
=
VgF
.
GetValueType
(
val
)
if
VgF
.
GetValueType
(
g
)
==
"Group"
then
if
typ
==
"Group"
then
tc
=
g
:
GetFirst
()
return
val
:
GetFirst
()
elseif
VgF
.
GetValueType
(
g
)
==
"Card"
then
elseif
typ
==
"Effect"
then
tc
=
g
return
val
:
GetHandler
()
end
elseif
typ
==
"Card"
then
return
tc
return
val
end
end
return
nil
function
VgF
.
ReturnGroup
(
tc
)
end
local
g
=
Group
.
CreateGroup
()
if
VgF
.
GetValueType
(
tc
)
==
"Group"
then
---返回卡片组,接受 Card,Group
return
tc
---@param val 要操作的参数
elseif
VgF
.
GetValueType
(
g
)
==
"Card"
then
---@return Card 返回卡片组
g
:
AddCard
(
tc
)
function
VgF
.
ReturnGroup
(
val
)
end
local
typ
=
VgF
.
GetValueType
(
val
)
return
g
if
typ
==
"Group"
then
return
val
elseif
typ
==
"Card"
then
return
Group
.
FromCards
(
val
)
end
return
Group
.
CreateGroup
()
end
end
---根据控制者,区域和编号获取zone;不合法的数据会返回0
---根据控制者,区域和编号获取zone;不合法的数据会返回0
...
@@ -116,7 +121,7 @@ end
...
@@ -116,7 +121,7 @@ end
function
VgF
.
GetAvailableLocation
(
tp
,
zone
)
function
VgF
.
GetAvailableLocation
(
tp
,
zone
)
local
z
local
z
if
zone
then
z
=
zone
else
z
=
0x1f
end
if
zone
then
z
=
zone
else
z
=
0x1f
end
local
rg
=
Duel
.
GetMatchingGroup
(
Card
.
IsPosition
,
tp
,
LOCATION_CIRCLE
,
0
,
nil
,
POS_FACEDOWN_ATTACK
)
local
rg
=
Duel
.(
Card
.
IsPosition
,
tp
,
LOCATION_CIRCLE
,
0
,
nil
,
POS_FACEDOWN_ATTACK
)
for
tc
in
VgF
.
Next
(
rg
)
do
for
tc
in
VgF
.
Next
(
rg
)
do
local
szone
=
VgF
.
SequenceToGlobal
(
tp
,
tc
:
GetLocation
(),
tc
:
GetSequence
())
local
szone
=
VgF
.
SequenceToGlobal
(
tp
,
tc
:
GetLocation
(),
tc
:
GetSequence
())
z
=
bit
.
bxor
(
z
,
szone
)
z
=
bit
.
bxor
(
z
,
szone
)
...
@@ -124,19 +129,45 @@ function VgF.GetAvailableLocation(tp, zone)
...
@@ -124,19 +129,45 @@ function VgF.GetAvailableLocation(tp, zone)
return
z
return
z
end
end
---根据 loc 回传转换后的 loc 以及 con, 用于区分V/R/M
function
VgF
.
FixVRLoc
(
loc
)
local
loc_con
=
VgF
.
True
local
has_v
=
loc
&
LOCATION_VZONE
>
0
local
has_r
=
loc
&
LOCATION_RZONE
>
0
if
has_v
and
has_r
then
loc
=
(
loc
-
LOCATION_VZONE
-
LOCATION_RZONE
)
|
LOCATION_MZONE
elseif
has_v
then
loc
=
(
loc
-
LOCATION_VZONE
)
|
LOCATION_MZONE
loc_con
=
Card
.
IsVanguard
elseif
has_r
then
loc
=
(
loc
-
LOCATION_RZONE
)
|
LOCATION_MZONE
loc_con
=
Card
.
IsRearguard
end
return
loc
,
loc_con
end
---检查并转换 loc 以及 con 用于【起】等模板函数
---检查并转换 loc 以及 con 用于【起】等模板函数
function
VgF
.
GetLocCondition
(
loc
,
con
)
function
VgF
.
GetLocCondition
(
loc
,
con
)
local
con_exf
=
VgF
.
True
local
loc
,
loc_con
=
VgF
.
FixVRLoc
(
loc
)
if
loc
==
LOCATION_R_CIRCLE
then
loc
,
con_exf
=
LOCATION_CIRCLE
,
VgF
.
Condition
.
IsR
elseif
loc
==
LOCATION_V_CIRCLE
then
loc
,
con_exf
=
LOCATION_CIRCLE
,
VgF
.
Condition
.
IsV
end
loc
=
loc
or
LOCATION_CIRCLE
local
condition
=
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
condition
=
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
(
not
con
or
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
))
and
con_exf
(
e
)
return
(
not
con
or
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
))
and
loc_con
(
e
:
GetHandler
()
)
end
end
return
loc
,
condition
return
loc
or
LOCATION_MZONE
,
condition
end
---返回玩家 p 场上的先导者。
---@param p number 要获取先导者的玩家。不合法则返回nil。
---@return Card|nil p场上的先导者
function
VgF
.
GetVanguard
(
p
)
-- pre GetVMonster
if
p
~=
0
and
p
~=
1
then
return
end
return
Duel
.
GetMatchingGroup
(
Card
.
IsVanguard
,
p
,
LOCATION_MZONE
,
0
,
nil
):
GetFirst
()
end
---返回玩家 p 场上的先导者的灵魂卡片组
function
VgF
.
GetSoulGroup
(
p
)
local
tc
=
VgF
.
GetVanguard
(
p
)
return
tc
and
tc
:
GetOverlayGroup
()
or
Group
.
CreateGroup
()
end
end
--函数检查器--------------------------------------------------------------------------------
--函数检查器--------------------------------------------------------------------------------
...
@@ -291,7 +322,7 @@ end
...
@@ -291,7 +322,7 @@ end
function
VgF
.
Condition
.
FirstCard
(
e
)
function
VgF
.
Condition
.
FirstCard
(
e
)
local
tp
=
e
:
GetHandlerPlayer
()
local
tp
=
e
:
GetHandlerPlayer
()
local
g
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
LOCATION_ALL
,
0
,
nil
)
local
g
=
Duel
.(
nil
,
tp
,
LOCATION_ALL
,
0
,
nil
)
return
e
:
GetHandler
()
==
g
:
GetFirst
()
return
e
:
GetHandler
()
==
g
:
GetFirst
()
end
end
function
VgF
.
Condition
.
FirstTurn
()
function
VgF
.
Condition
.
FirstTurn
()
...
@@ -393,7 +424,7 @@ function VgF.Cost.EnergyBlast(val)
...
@@ -393,7 +424,7 @@ function VgF.Cost.EnergyBlast(val)
end
end
return
VgF
.
IsExistingMatchingCard
(
Card
.
IsCode
,
tp
,
LOCATION_CREST
,
0
,
val
,
nil
,
CARD_ENERGY
)
return
VgF
.
IsExistingMatchingCard
(
Card
.
IsCode
,
tp
,
LOCATION_CREST
,
0
,
val
,
nil
,
CARD_ENERGY
)
end
end
local
sg
=
Duel
.
GetMatchingGroup
(
Card
.
IsCode
,
tp
,
LOCATION_CREST
,
0
,
nil
,
CARD_ENERGY
)
local
sg
=
Duel
.(
Card
.
IsCode
,
tp
,
LOCATION_CREST
,
0
,
nil
,
CARD_ENERGY
)
local
g
=
sg
:
GetCardsFromGroup
(
val
)
local
g
=
sg
:
GetCardsFromGroup
(
val
)
return
VgF
.
Sendto
(
0
,
g
,
tp
,
POS_FACEUP
,
REASON_COST
)
return
VgF
.
Sendto
(
0
,
g
,
tp
,
POS_FACEUP
,
REASON_COST
)
end
end
...
@@ -410,10 +441,10 @@ function VgF.Cost.SoulBlast(val)
...
@@ -410,10 +441,10 @@ function VgF.Cost.SoulBlast(val)
local
m
=
c
:
GetOriginalCode
()
local
m
=
c
:
GetOriginalCode
()
VgF
.
AddAlchemagic
(
m
,
"LOCATION_SOUL"
,
"LOCATION_DROP"
,
val
,
val
)
VgF
.
AddAlchemagic
(
m
,
"LOCATION_SOUL"
,
"LOCATION_DROP"
,
val
,
val
)
end
end
return
Duel
.
GetMatchingGroup
(
VgF
.
Filter
.
IsV
,
tp
,
LOCATION_CIRCLE
,
0
,
nil
,
nil
):
GetFirst
():
GetOverlayCount
()
>=
val
return
Duel
.(
VgF
.
Filter
.
IsV
,
tp
,
LOCATION_CIRCLE
,
0
,
nil
,
nil
):
GetFirst
():
GetOverlayCount
()
>=
val
end
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVEXYZ
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVEXYZ
)
local
g
=
Duel
.
GetMatchingGroup
(
VgF
.
Filter
.
IsV
,
tp
,
LOCATION_CIRCLE
,
0
,
nil
):
GetFirst
():
GetOverlayGroup
():
Select
(
tp
,
nil
,
val
,
val
,
nil
)
local
g
=
Duel
.(
VgF
.
Filter
.
IsV
,
tp
,
LOCATION_CIRCLE
,
0
,
nil
):
GetFirst
():
GetOverlayGroup
():
Select
(
tp
,
nil
,
val
,
val
,
nil
)
return
VgF
.
Sendto
(
LOCATION_DROP
,
g
,
REASON_COST
)
return
VgF
.
Sendto
(
LOCATION_DROP
,
g
,
REASON_COST
)
end
end
end
end
...
@@ -464,7 +495,7 @@ function VgF.Cost.Retire(card_code_func, max, min, except, ...)
...
@@ -464,7 +495,7 @@ function VgF.Cost.Retire(card_code_func, max, 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
local
g
=
VgF
.
GetMatchingGroup
(
leave_filter
,
tp
,
LOCATION_CIRCLE
,
0
,
except
)
local
g
=
VgF
.(
leave_filter
,
tp
,
LOCATION_CIRCLE
,
0
,
except
)
if
chk
==
0
then
return
g
:
CheckSubGroup
(
VgF
.
Cost
.
RetireFilter
,
1
,
max
,
min
,
e
,
tp
)
end
if
chk
==
0
then
return
g
:
CheckSubGroup
(
VgF
.
Cost
.
RetireFilter
,
1
,
max
,
min
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_LEAVEFIELD
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_LEAVEFIELD
)
g
=
g
:
SelectSubGroup
(
tp
,
VgF
.
Cost
.
RetireFilter
,
false
,
1
,
max
,
min
,
e
,
tp
)
g
=
g
:
SelectSubGroup
(
tp
,
VgF
.
Cost
.
RetireFilter
,
false
,
1
,
max
,
min
,
e
,
tp
)
...
@@ -550,7 +581,7 @@ function VgF.Operation.SoulCharge(val)
...
@@ -550,7 +581,7 @@ function VgF.Operation.SoulCharge(val)
end
end
return
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
>=
val
return
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
>=
val
end
end
local
rc
=
Duel
.
GetMatchingGroup
(
VgF
.
Filter
.
IsV
,
tp
,
LOCATION_CIRCLE
,
0
,
nil
):
GetFirst
()
local
rc
=
Duel
.(
VgF
.
Filter
.
IsV
,
tp
,
LOCATION_CIRCLE
,
0
,
nil
):
GetFirst
()
local
g
=
Duel
.
GetDecktopGroup
(
tp
,
val
)
local
g
=
Duel
.
GetDecktopGroup
(
tp
,
val
)
Duel
.
DisableShuffleCheck
()
Duel
.
DisableShuffleCheck
()
Duel
.
RaiseEvent
(
g
,
EVENT_CUSTOM
+
EVENT_OVERLAY_FILL
,
e
,
0
,
tp
,
tp
,
val
)
Duel
.
RaiseEvent
(
g
,
EVENT_CUSTOM
+
EVENT_OVERLAY_FILL
,
e
,
0
,
tp
,
tp
,
val
)
...
@@ -692,32 +723,23 @@ end
...
@@ -692,32 +723,23 @@ end
--Card库自定义函数-----------------------------------------------------------------------
--Card库自定义函数-----------------------------------------------------------------------
---返回
c
所在列的所有单位。
---返回
卡片 c
所在列的所有单位。
---@param c Card 指示某一列的卡
---@param c Card 指示某一列的卡
---@return Group 这一列的所有单位
---@return Group 这一列的所有单位
(除了 c
function
Card
.
GetColumnGroup
(
c
)
function
Card
.
GetColumnGroup
(
c
)
local
tp
=
c
:
GetControler
()
local
tp
,
seq
=
c
:
GetControler
(),
c
:
GetSequence
()
local
g
=
Group
.
CreateGroup
()
if
seq
==
2
or
seq
==
5
then
if
c
:
IsSequence
(
0
,
1
)
then
return
VgF
.
GetMatchingGroup
(
Card
.
IsSequence
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
c
,
2
,
5
)
-- 左列
end
local
sg1
=
VgF
.
GetMatchingGroup
(
Card
.
IsSequence
,
tp
,
LOCATION_CIRCLE
,
0
,
nil
,
0
,
1
)
local
g1
,
g2
=
Group
.
CreateGroup
(),
Group
.
CreateGroup
()
local
sg2
=
VgF
.
GetMatchingGroup
(
Card
.
IsSequence
,
tp
,
0
,
LOCATION_CIRCLE
,
nil
,
3
,
4
)
if
seq
==
0
or
seq
==
1
then
if
sg1
:
GetCount
()
>
0
then
g
:
Merge
(
sg1
)
end
g1
=
VgF
.
GetMatchingGroup
(
Card
.
IsSequence
,
tp
,
LOCATION_MZONE
,
0
,
nil
,
0
,
1
)
if
sg2
:
GetCount
()
>
0
then
g
:
Merge
(
sg2
)
end
g2
=
VgF
.
GetMatchingGroup
(
Card
.
IsSequence
,
tp
,
0
,
LOCATION_MZONE
,
nil
,
3
,
4
)
elseif
c
:
IsSequence
(
2
,
5
)
then
elseif
seq
==
3
or
seq
==
4
then
-- 中列
g1
=
VgF
.
GetMatchingGroup
(
Card
.
IsSequence
,
tp
,
LOCATION_MZONE
,
0
,
nil
,
3
,
4
)
local
sg
=
VgF
.
GetMatchingGroup
(
Card
.
IsSequence
,
tp
,
LOCATION_CIRCLE
,
LOCATION_CIRCLE
,
nil
,
2
,
5
)
g2
=
VgF
.
GetMatchingGroup
(
Card
.
IsSequence
,
tp
,
0
,
LOCATION_MZONE
,
nil
,
0
,
1
)
if
sg
:
GetCount
()
>
0
then
g
:
Merge
(
sg
)
end
end
elseif
c
:
IsSequence
(
3
,
4
)
then
return
(
g1
+
g2
):
Filter
(
nil
,
c
)
-- 右列
local
sg1
=
VgF
.
GetMatchingGroup
(
Card
.
IsSequence
,
tp
,
LOCATION_CIRCLE
,
0
,
nil
,
3
,
4
)
local
sg2
=
VgF
.
GetMatchingGroup
(
Card
.
IsSequence
,
tp
,
0
,
LOCATION_CIRCLE
,
nil
,
0
,
1
)
if
sg1
:
GetCount
()
>
0
then
g
:
Merge
(
sg1
)
end
if
sg2
:
GetCount
()
>
0
then
g
:
Merge
(
sg2
)
end
end
-- 排除自身
g
:
RemoveCard
(
c
)
return
g
end
end
---判断c是否可以以规则的手段到G区域。
---判断c是否可以以规则的手段到G区域。
...
@@ -981,179 +1003,63 @@ end
...
@@ -981,179 +1003,63 @@ end
--封装操作---------------------------------------------------------------------------------
--封装操作---------------------------------------------------------------------------------
function
VgF
.
IsExistingMatchingCard
(
f
,
tp
,
loc_self
,
loc_op
,
int
,
except_g
,
...
)
---过滤函数,返回玩家 p 来看的指定位置满足过滤条件 f 并且不等于 ex 的卡
return
VgF
.
GetMatchingGroupCount
(
f
,
tp
,
loc_self
,
loc_op
,
except_g
,
...
)
>=
int
---loc_self 代表玩家 p 来看的自己的位置,loc_oppo 代表玩家 p 来看的对方的位置
end
---第6个参数开始为额外参数
function
VgF
.
SelectMatchingCard
(
hintmsg
,
e
,
select_tp
,
f
,
tp
,
loc_self
,
loc_op
,
int_min
,
int_max
,
except_g
,
...
)
function
VgF
.
GetMatchingGroup
(
f
,
p
,
loc_self
,
loc_oppo
,
ex
,
...
)
local
a
=
false
local
loc_self
,
loc_self_con
=
VgF
.
GetlocCondition
(
loc_self
)
if
((
select_tp
==
tp
and
bit
.
band
(
loc_self
,
LOCATION_DECK
)
>
0
)
or
(
select_tp
~=
tp
and
bit
.
band
(
loc_op
,
LOCATION_DECK
)
>
0
))
and
Duel
.
SelectYesNo
(
select_tp
,
VgF
.
Stringid
(
VgID
,
13
))
then
local
loc_oppo
,
loc_oppo_con
=
VgF
.
GetlocCondition
(
loc_oppo
)
local
g
=
Duel
.
GetFieldGroup
(
select_tp
,
LOCATION_DECK
,
0
)
local
g
=
Duel
.
GetMatchingGroup
(
loc_self_con
,
p
,
loc_self
,
0
,
nil
)
Duel
.
DisableShuffleCheck
()
g
=
g
+
Duel
.
GetMatchingGroup
(
loc_oppo_con
,
p
,
0
,
loc_oppo
,
nil
)
Duel
.
ConfirmCards
(
select_tp
,
g
)
g
=
g
-
Duel
.
GetMatchingGroup
(
Card
.
IsFacedown
,
p
,
LOCATION_MZONE
,
LOCATION_MZONE
,
nil
)
a
=
true
if
loc_self
&
LOCATION_OVERLAY
>
0
then
end
g
=
g
+
VgF
.
GetSoulGroup
(
p
)
local
g
=
Group
.
CreateGroup
()
local
loc_self_f
=
VgF
.
True
local
loc_op_f
=
VgF
.
True
if
bit
.
band
(
loc_self
,
LOCATION_V_CIRCLE
)
>
0
and
bit
.
band
(
loc_self
,
LOCATION_R_CIRCLE
)
>
0
then
loc_self
=
loc_self
-
LOCATION_V_CIRCLE
-
LOCATION_R_CIRCLE
if
bit
.
band
(
loc_self
,
LOCATION_CIRCLE
)
==
0
then
loc_self
=
loc_self
+
LOCATION_CIRCLE
end
elseif
bit
.
band
(
loc_self
,
LOCATION_V_CIRCLE
)
>
0
then
loc_self
=
loc_self
-
LOCATION_V_CIRCLE
loc_self_f
=
VgF
.
Filter
.
IsV
if
bit
.
band
(
loc_self
,
LOCATION_CIRCLE
)
==
0
then
loc_self
=
loc_self
+
LOCATION_CIRCLE
end
elseif
bit
.
band
(
loc_self
,
LOCATION_R_CIRCLE
)
>
0
then
loc_self
=
loc_self
-
LOCATION_R_CIRCLE
loc_self_f
=
VgF
.
Filter
.
IsR
if
bit
.
band
(
loc_self
,
LOCATION_CIRCLE
)
==
0
then
loc_self
=
loc_self
+
LOCATION_CIRCLE
end
end
if
bit
.
band
(
loc_op
,
LOCATION_V_CIRCLE
)
>
0
and
bit
.
band
(
loc_op
,
LOCATION_R_CIRCLE
)
>
0
then
loc_op
=
loc_op
-
LOCATION_V_CIRCLE
-
LOCATION_R_CIRCLE
if
bit
.
band
(
loc_op
,
LOCATION_CIRCLE
)
==
0
then
loc_op
=
loc_op
+
LOCATION_CIRCLE
end
elseif
bit
.
band
(
loc_op
,
LOCATION_V_CIRCLE
)
>
0
then
loc_op
=
loc_op
-
LOCATION_V_CIRCLE
loc_op_f
=
VgF
.
Filter
.
IsV
if
bit
.
band
(
loc_op
,
LOCATION_CIRCLE
)
==
0
then
loc_op
=
loc_op
+
LOCATION_CIRCLE
end
elseif
bit
.
band
(
loc_op
,
LOCATION_R_CIRCLE
)
>
0
then
loc_op
=
loc_op
-
LOCATION_R_CIRCLE
loc_op_f
=
VgF
.
Filter
.
IsR
if
bit
.
band
(
loc_op
,
LOCATION_CIRCLE
)
==
0
then
loc_op
=
loc_op
+
LOCATION_CIRCLE
end
end
if
bit
.
band
(
loc_self
,
LOCATION_CIRCLE
)
>
0
then
local
g1
=
Duel
.
GetMatchingGroup
(
function
(
c
)
return
c
:
IsCanBeEffectTarget
(
e
)
and
c
:
IsFaceup
()
and
loc_self_f
(
c
)
end
,
tp
,
LOCATION_CIRCLE
,
0
,
nil
)
loc_self
=
loc_self
-
LOCATION_CIRCLE
if
g1
:
GetCount
()
>
0
then
g
:
Merge
(
g1
)
end
end
if
bit
.
band
(
loc_op
,
LOCATION_CIRCLE
)
>
0
then
local
g1
=
Duel
.
GetMatchingGroup
(
function
(
c
)
return
c
:
IsCanBeEffectTarget
(
e
)
and
c
:
IsFaceup
()
and
loc_op_f
(
c
)
end
,
tp
,
0
,
LOCATION_CIRCLE
,
nil
)
loc_op
=
loc_op
-
LOCATION_CIRCLE
if
g1
:
GetCount
()
>
0
then
g
:
Merge
(
g1
)
end
end
if
bit
.
band
(
loc_self
,
LOCATION_SOUL
)
>
0
then
local
g1
=
VgF
.
GetVMonster
(
tp
):
GetOverlayGroup
()
loc_self
=
loc_self
-
LOCATION_SOUL
if
g1
:
GetCount
()
>
0
then
g
:
Merge
(
g1
)
end
end
if
bit
.
band
(
loc_op
,
LOCATION_SOUL
)
>
0
then
local
g1
=
VgF
.
GetVMonster
(
1
-
tp
):
GetOverlayGroup
()
loc_op
=
loc_op
-
LOCATION_SOUL
if
g1
:
GetCount
()
>
0
then
g
:
Merge
(
g1
)
end
end
if
loc_self
>
0
or
loc_op
>
0
then
local
g1
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
loc_self
,
loc_op
,
nil
)
if
g1
:
GetCount
()
>
0
then
g
:
Merge
(
g1
)
end
end
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
select_tp
,
hintmsg
)
if
VgF
.
GetValueType
(
f
)
==
"function"
then
g
=
g
:
FilterSelect
(
select_tp
,
f
,
int_min
,
int_max
,
except_g
,
...
)
else
g
=
g
:
Select
(
select_tp
,
int_min
,
int_max
,
except_g
)
end
end
end
local
cg
=
g
:
Filter
(
function
(
tc
)
if
loc_oppo
&
LOCATION_OVERLAY
>
0
then
return
not
tc
:
IsLocation
(
LOCATION_DECK
+
LOCATION_HAND
+
LOCATION_RIDE
)
g
=
g
+
VgF
.
GetSoulGroup
(
1
-
p
)
end
,
nil
)
if
cg
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
cg
)
Duel
.
SetTargetCard
(
cg
)
end
end
if
a
then
Duel
.
ShuffleDeck
(
select_tp
)
end
return
g
:
Filter
(
f
,
ex
,
...
)
return
g
end
end
function
VgF
.
GetMatchingGroupCount
(
f
,
tp
,
loc_self
,
loc_op
,
except_g
,
...
)
return
VgF
.
GetMatchingGroup
(
f
,
tp
,
loc_self
,
loc_op
,
except_g
,
...
):
GetCount
()
---过滤函数,返回玩家 p 来看的指定位置满足过滤条件 f 并且不等于 ex 的卡的数量
---loc_self 代表玩家 p 来看的自己的位置,loc_oppo 代表玩家 p 来看的对方的位置
---第6个参数开始为额外参数
function
VgF
.
GetMatchingGroupCount
(
f
,
p
,
loc_self
,
loc_oppo
,
ex
,
...
)
return
#
VgF
.
GetMatchingGroup
(
f
,
p
,
loc_self
,
loc_oppo
,
ex
,
...
)
end
end
function
VgF
.
GetMatchingGroup
(
f
,
tp
,
loc_self
,
loc_op
,
except_g
,
...
)
local
loc_self_f
=
VgF
.
True
---过滤函数,检查玩家 p 来看的指定位置是否存在至少 count 张满足过滤条件 f 并且不等于 ex 的卡
local
loc_op_f
=
VgF
.
True
---loc_self 代表玩家 p 来看的自己的位置,loc_oppo 代表玩家 p 来看的对方的位置
if
bit
.
band
(
loc_self
,
LOCATION_V_CIRCLE
)
>
0
and
bit
.
band
(
loc_self
,
LOCATION_R_CIRCLE
)
>
0
then
---第7个参数开始为额外参数
loc_self
=
loc_self
-
LOCATION_V_CIRCLE
-
LOCATION_R_CIRCLE
function
VgF
.
IsExistingMatchingCard
(
f
,
p
,
loc_self
,
loc_oppo
,
count
,
ex
,
...
)
if
bit
.
band
(
loc_self
,
LOCATION_CIRCLE
)
==
0
then
return
#
VgF
.
GetMatchingGroup
(
f
,
p
,
loc_self
,
loc_oppo
,
ex
,
...
)
>=
count
loc_self
=
loc_self
+
LOCATION_CIRCLE
end
end
elseif
bit
.
band
(
loc_self
,
LOCATION_V_CIRCLE
)
>
0
then
---过滤函数,让玩家 sp 选择玩家 p 来看的指定位置满足过滤条件 f 并且不等于 ex 的 min-max 张卡
loc_self
=
loc_self
-
LOCATION_V_CIRCLE
---loc_self 代表以 p 来看的自己的位置,loc_oppo 代表以 p 来看的对方的位置
loc_self_f
=
VgF
.
Filter
.
IsV
---第9个参数开始为额外参数
if
bit
.
band
(
loc_self
,
LOCATION_CIRCLE
)
==
0
then
function
VgF
.
SelectMatchingCard
(
msg
,
e
,
sp
,
f
,
p
,
loc_self
,
loc_oppo
,
min
,
max
,
ex
,
...
)
loc_self
=
loc_self
+
LOCATION_CIRCLE
local
check_deck
=
false
end
if
((
sp
==
p
and
loc_self
&
LOCATION_DECK
>
0
)
or
(
sp
~=
p
and
loc_oppo
&
LOCATION_DECK
>
0
))
and
Duel
.
SelectYesNo
(
sp
,
VgF
.
Stringid
(
VgID
,
13
))
then
elseif
bit
.
band
(
loc_self
,
LOCATION_R_CIRCLE
)
>
0
then
Duel
.
DisableShuffleCheck
()
loc_self
=
loc_self
-
LOCATION_R_CIRCLE
Duel
.
ConfirmCards
(
sp
,
Duel
.
GetFieldGroup
(
sp
,
LOCATION_DECK
,
0
))
loc_self_f
=
VgF
.
Filter
.
IsR
check_deck
=
true
if
bit
.
band
(
loc_self
,
LOCATION_CIRCLE
)
==
0
then
loc_self
=
loc_self
+
LOCATION_CIRCLE
end
end
end
if
bit
.
band
(
loc_op
,
LOCATION_V_CIRCLE
)
>
0
and
bit
.
band
(
loc_op
,
LOCATION_R_CIRCLE
)
>
0
then
local
filter
=
function
(
c
,
e
)
loc_op
=
loc_op
-
LOCATION_V_CIRCLE
-
LOCATION_R_CIRCLE
return
c
:
IsCanBeEffectTarget
(
e
)
or
not
c
:
IsLocation
(
LOCATION_MZONE
)
if
bit
.
band
(
loc_op
,
LOCATION_CIRCLE
)
==
0
then
loc_op
=
loc_op
+
LOCATION_CIRCLE
end
elseif
bit
.
band
(
loc_op
,
LOCATION_V_CIRCLE
)
>
0
then
loc_op
=
loc_op
-
LOCATION_V_CIRCLE
loc_op_f
=
VgF
.
Filter
.
IsV
if
bit
.
band
(
loc_op
,
LOCATION_CIRCLE
)
==
0
then
loc_op
=
loc_op
+
LOCATION_CIRCLE
end
elseif
bit
.
band
(
loc_op
,
LOCATION_R_CIRCLE
)
>
0
then
loc_op
=
loc_op
-
LOCATION_R_CIRCLE
loc_op_f
=
VgF
.
Filter
.
IsR
if
bit
.
band
(
loc_op
,
LOCATION_CIRCLE
)
==
0
then
loc_op
=
loc_op
+
LOCATION_CIRCLE
end
end
end
local
g
=
Group
.
CreateGroup
()
local
g
=
VgF
.
GetMatchingGroup
(
filter
,
p
,
loc_self
,
loc_oppo
,
ex
,
e
)
if
bit
.
band
(
loc_self
,
LOCATION_CIRCLE
)
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
sp
,
msg
)
local
g1
=
Duel
.
GetMatchingGroup
(
function
(
c
)
g
=
g
:
FilterSelect
(
sp
,
f
or
vgf
.
True
,
min
,
max
,
ex
,
...
)
return
c
:
IsFaceup
()
and
loc_self_f
(
c
)
local
sg
=
g
:
Filter
(
VgF
.
Not
(
Card
.
IsLocation
),
nil
,
LOCATION_DECK
+
LOCATION_HAND
+
LOCATION_EXTRA
)
end
,
tp
,
LOCATION_CIRCLE
,
0
,
nil
)
if
#
sg
>
0
then
loc_self
=
loc_self
-
LOCATION_CIRCLE
Duel
.
HintSelection
(
sg
)
if
g1
:
GetCount
()
>
0
then
g
:
Merge
(
g1
)
end
Duel
.
SetTargetCard
(
sg
)
end
if
bit
.
band
(
loc_op
,
LOCATION_CIRCLE
)
>
0
then
local
g1
=
Duel
.
GetMatchingGroup
(
function
(
c
)
return
c
:
IsFaceup
()
and
loc_op_f
(
c
)
end
,
tp
,
0
,
LOCATION_CIRCLE
,
nil
)
loc_op
=
loc_op
-
LOCATION_CIRCLE
if
g1
:
GetCount
()
>
0
then
g
:
Merge
(
g1
)
end
end
if
bit
.
band
(
loc_self
,
LOCATION_SOUL
)
>
0
then
local
g1
=
VgF
.
GetVMonster
(
tp
):
GetOverlayGroup
()
loc_self
=
loc_self
-
LOCATION_SOUL
if
g1
:
GetCount
()
>
0
then
g
:
Merge
(
g1
)
end
end
if
bit
.
band
(
loc_op
,
LOCATION_SOUL
)
>
0
then
local
g1
=
VgF
.
GetVMonster
(
1
-
tp
):
GetOverlayGroup
()
loc_op
=
loc_op
-
LOCATION_SOUL
if
g1
:
GetCount
()
>
0
then
g
:
Merge
(
g1
)
end
end
if
loc_self
>
0
or
loc_op
>
0
then
local
g1
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
loc_self
,
loc_op
,
nil
)
if
g1
:
GetCount
()
>
0
then
g
:
Merge
(
g1
)
end
end
if
g
:
GetCount
()
>
0
then
f
=
f
or
VgF
.
True
g
=
g
:
Filter
(
f
,
except_g
,
...
)
end
end
if
check_deck
then
Duel
.
ShuffleDeck
(
sp
)
end
return
g
return
g
end
end
---用于效果的Operation。执行“把卡sg,送去loc,第三个参数开始为额外参数,内容与原函数相同。”。
---用于效果的Operation。执行“把卡sg,送去loc,第三个参数开始为额外参数,内容与原函数相同。”。
---@param loc number 要送去的区域。不填则返回0。
---@param loc number 要送去的区域。不填则返回0。
---@param sg Card|Group 要操作的卡|卡片组。
---@param sg Card|Group 要操作的卡|卡片组。
...
...
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