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
b763072e
Commit
b763072e
authored
Mar 04, 2025
by
xiaoye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
a656ddb8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
22 deletions
+22
-22
vgdefinition.lua
vgdefinition.lua
+2
-1
vgfuncLib.lua
vgfuncLib.lua
+20
-21
No files found.
vgdefinition.lua
View file @
b763072e
...
@@ -23,7 +23,8 @@ LOCATION_SPARE = 0x2000 --备用格子(用于怪物箱等)
...
@@ -23,7 +23,8 @@ LOCATION_SPARE = 0x2000 --备用格子(用于怪物箱等)
LOCATION_G_CIRCLE
=
0x4000
--防卫者圆阵
LOCATION_G_CIRCLE
=
0x4000
--防卫者圆阵
LOCATION_CREST
=
0x8000
--纹章区
LOCATION_CREST
=
0x8000
--纹章区
LOCATION_ALL
=
0xffff
LOCATION_ALL
=
0xffff
LOCATION_R_CIRCLE
=
0x10000
-- 后防者圆阵导者圆阵
LOCATION_R_CIRCLE
=
0x10000
-- 后防者圆阵
LOCATION_V_CIRCLE
=
0x20000
-- 先导者圆阵
LOCATION_LIST
=
{[
"0"
]
=
0
,
[
"LOCATION_DECK"
]
=
LOCATION_DECK
,
[
"LOCATION_HAND"
]
=
LOCATION_HAND
,
[
"LOCATION_CIRCLE"
]
=
LOCATION_CIRCLE
,
[
"LOCATION_DROP"
]
=
LOCATION_DROP
,
[
"LOCATION_BIND"
]
=
LOCATION_BIND
,
[
"LOCATION_RIDE"
]
=
LOCATION_RIDE
,
[
"LOCATION_SOUL"
]
=
LOCATION_SOUL
,
[
"LOCATION_REMOVED"
]
=
LOCATION_REMOVED
,
[
"LOCATION_DAMAGE"
]
=
LOCATION_DAMAGE
,
[
"LOCATION_ORDER"
]
=
LOCATION_ORDER
,
[
"LOCATION_SPARE"
]
=
LOCATION_SPARE
,
[
"LOCATION_G_CIRCLE"
]
=
LOCATION_G_CIRCLE
,
[
"LOCATION_CREST"
]
=
LOCATION_CREST
}
LOCATION_LIST
=
{[
"0"
]
=
0
,
[
"LOCATION_DECK"
]
=
LOCATION_DECK
,
[
"LOCATION_HAND"
]
=
LOCATION_HAND
,
[
"LOCATION_CIRCLE"
]
=
LOCATION_CIRCLE
,
[
"LOCATION_DROP"
]
=
LOCATION_DROP
,
[
"LOCATION_BIND"
]
=
LOCATION_BIND
,
[
"LOCATION_RIDE"
]
=
LOCATION_RIDE
,
[
"LOCATION_SOUL"
]
=
LOCATION_SOUL
,
[
"LOCATION_REMOVED"
]
=
LOCATION_REMOVED
,
[
"LOCATION_DAMAGE"
]
=
LOCATION_DAMAGE
,
[
"LOCATION_ORDER"
]
=
LOCATION_ORDER
,
[
"LOCATION_SPARE"
]
=
LOCATION_SPARE
,
[
"LOCATION_G_CIRCLE"
]
=
LOCATION_G_CIRCLE
,
[
"LOCATION_CREST"
]
=
LOCATION_CREST
}
...
...
vgfuncLib.lua
View file @
b763072e
...
@@ -130,15 +130,15 @@ end
...
@@ -130,15 +130,15 @@ end
---根据 loc 回传转换后的 loc 以及 con, 用于区分V/R/M
---根据 loc 回传转换后的 loc 以及 con, 用于区分V/R/M
function
VgF
.
FixVRLoc
(
loc
)
function
VgF
.
FixVRLoc
(
loc
)
local
loc_con
=
VgF
.
True
local
loc_con
=
VgF
.
True
local
has_v
=
loc
&
LOCATION_V
ZON
E
>
0
local
has_v
=
loc
&
LOCATION_V
_CIRCL
E
>
0
local
has_r
=
loc
&
LOCATION_R
ZON
E
>
0
local
has_r
=
loc
&
LOCATION_R
_CIRCL
E
>
0
if
has_v
and
has_r
then
if
has_v
and
has_r
then
loc
=
(
loc
-
LOCATION_V
ZONE
-
LOCATION_RZONE
)
|
LOCATION_MZONE
loc
=
(
loc
-
LOCATION_V
_CIRCLE
-
LOCATION_R_CIRCLE
)
|
LOCATION_CIRCLE
elseif
has_v
then
elseif
has_v
then
loc
=
(
loc
-
LOCATION_V
ZONE
)
|
LOCATION_MZONE
loc
=
(
loc
-
LOCATION_V
_CIRCLE
)
|
LOCATION_CIRCLE
loc_con
=
Card
.
IsVanguard
loc_con
=
Card
.
IsVanguard
elseif
has_r
then
elseif
has_r
then
loc
=
(
loc
-
LOCATION_R
ZONE
)
|
LOCATION_MZONE
loc
=
(
loc
-
LOCATION_R
_CIRCLE
)
|
LOCATION_CIRCLE
loc_con
=
Card
.
IsRearguard
loc_con
=
Card
.
IsRearguard
end
end
return
loc
,
loc_con
return
loc
,
loc_con
...
@@ -150,7 +150,7 @@ function VgF.GetLocCondition(loc, con)
...
@@ -150,7 +150,7 @@ function VgF.GetLocCondition(loc, con)
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
loc_con
(
e
:
GetHandler
())
return
(
not
con
or
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
))
and
loc_con
(
e
:
GetHandler
())
end
end
return
loc
or
LOCATION_
MZON
E
,
condition
return
loc
or
LOCATION_
CIRCL
E
,
condition
end
end
---检查并转换typ 以及 code 用于【自】能力函数
---检查并转换typ 以及 code 用于【自】能力函数
...
@@ -170,7 +170,7 @@ end
...
@@ -170,7 +170,7 @@ end
function
VgF
.
GetVanguard
(
p
)
function
VgF
.
GetVanguard
(
p
)
-- pre GetVMonster
-- pre GetVMonster
if
p
~=
0
and
p
~=
1
then
return
end
if
p
~=
0
and
p
~=
1
then
return
end
return
Duel
.
GetMatchingGroup
(
Card
.
IsVanguard
,
p
,
LOCATION_
MZON
E
,
0
,
nil
):
GetFirst
()
return
Duel
.
GetMatchingGroup
(
Card
.
IsVanguard
,
p
,
LOCATION_
CIRCL
E
,
0
,
nil
):
GetFirst
()
end
end
---返回玩家 p 场上的先导者的灵魂卡片组
---返回玩家 p 场上的先导者的灵魂卡片组
...
@@ -371,7 +371,7 @@ function VgF.Cost.Bind(val, f, pos)
...
@@ -371,7 +371,7 @@ function VgF.Cost.Bind(val, f, pos)
f
=
function
(
c
)
return
c
:
IsCode
(
f
)
end
f
=
function
(
c
)
return
c
:
IsCode
(
f
)
end
end
end
pos
=
pos
or
POS_FACEUP
pos
=
pos
or
POS_FACEUP
local
bind_loc
=
LOCATION_HAND
+
LOCATION_
MZON
E
+
LOCATION_SOUL
+
LOCATION_DROP
local
bind_loc
=
LOCATION_HAND
+
LOCATION_
CIRCL
E
+
LOCATION_SOUL
+
LOCATION_DROP
if
not
val
then
if
not
val
then
-- 将这个单位封锁
-- 将这个单位封锁
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
...
@@ -758,15 +758,15 @@ end
...
@@ -758,15 +758,15 @@ end
function
Card
.
GetColumnGroup
(
c
)
function
Card
.
GetColumnGroup
(
c
)
local
tp
,
seq
=
c
:
GetControler
(),
c
:
GetSequence
()
local
tp
,
seq
=
c
:
GetControler
(),
c
:
GetSequence
()
if
seq
==
2
or
seq
==
5
then
if
seq
==
2
or
seq
==
5
then
return
VgF
.
GetMatchingGroup
(
Card
.
IsSequence
,
tp
,
LOCATION_
MZONE
,
LOCATION_MZON
E
,
c
,
2
,
5
)
return
VgF
.
GetMatchingGroup
(
Card
.
IsSequence
,
tp
,
LOCATION_
CIRCLE
,
LOCATION_CIRCL
E
,
c
,
2
,
5
)
end
end
local
g1
,
g2
=
Group
.
CreateGroup
(),
Group
.
CreateGroup
()
local
g1
,
g2
=
Group
.
CreateGroup
(),
Group
.
CreateGroup
()
if
seq
==
0
or
seq
==
1
then
if
seq
==
0
or
seq
==
1
then
g1
=
VgF
.
GetMatchingGroup
(
Card
.
IsSequence
,
tp
,
LOCATION_
MZON
E
,
0
,
nil
,
0
,
1
)
g1
=
VgF
.
GetMatchingGroup
(
Card
.
IsSequence
,
tp
,
LOCATION_
CIRCL
E
,
0
,
nil
,
0
,
1
)
g2
=
VgF
.
GetMatchingGroup
(
Card
.
IsSequence
,
tp
,
0
,
LOCATION_
MZON
E
,
nil
,
3
,
4
)
g2
=
VgF
.
GetMatchingGroup
(
Card
.
IsSequence
,
tp
,
0
,
LOCATION_
CIRCL
E
,
nil
,
3
,
4
)
elseif
seq
==
3
or
seq
==
4
then
elseif
seq
==
3
or
seq
==
4
then
g1
=
VgF
.
GetMatchingGroup
(
Card
.
IsSequence
,
tp
,
LOCATION_
MZON
E
,
0
,
nil
,
3
,
4
)
g1
=
VgF
.
GetMatchingGroup
(
Card
.
IsSequence
,
tp
,
LOCATION_
CIRCL
E
,
0
,
nil
,
3
,
4
)
g2
=
VgF
.
GetMatchingGroup
(
Card
.
IsSequence
,
tp
,
0
,
LOCATION_
MZON
E
,
nil
,
0
,
1
)
g2
=
VgF
.
GetMatchingGroup
(
Card
.
IsSequence
,
tp
,
0
,
LOCATION_
CIRCL
E
,
nil
,
0
,
1
)
end
end
return
Group
.
__add
(
g1
,
g2
):
Filter
(
nil
,
c
)
return
Group
.
__add
(
g1
,
g2
):
Filter
(
nil
,
c
)
end
end
...
@@ -834,13 +834,13 @@ end
...
@@ -834,13 +834,13 @@ end
---@param c Card 要判断的卡
---@param c Card 要判断的卡
---@return boolean 指示c是否是前列的单位
---@return boolean 指示c是否是前列的单位
function
Card
.
IsFrontrow
(
c
)
function
Card
.
IsFrontrow
(
c
)
return
c
:
IsSequence
(
0
,
5
,
4
)
and
c
:
IsLocation
(
LOCATION_
MZON
E
)
return
c
:
IsSequence
(
0
,
5
,
4
)
and
c
:
IsLocation
(
LOCATION_
CIRCL
E
)
end
end
---返回卡片 c 是否在后列。
---返回卡片 c 是否在后列。
---@param c Card 要判断的卡
---@param c Card 要判断的卡
---@return boolean 指示c是否是后列的单位
---@return boolean 指示c是否是后列的单位
function
Card
.
IsBackrow
(
c
)
function
Card
.
IsBackrow
(
c
)
return
c
:
IsSequence
(
1
,
2
,
3
)
and
c
:
IsLocation
(
LOCATION_
MZON
E
)
return
c
:
IsSequence
(
1
,
2
,
3
)
and
c
:
IsLocation
(
LOCATION_
CIRCL
E
)
end
end
---返回卡片 c 技能是否是 skill
---返回卡片 c 技能是否是 skill
---@param c Card 要判断的卡
---@param c Card 要判断的卡
...
@@ -854,7 +854,7 @@ end
...
@@ -854,7 +854,7 @@ end
---@return boolean 卡片 c 是否可以以规则的手段到G区域。
---@return boolean 卡片 c 是否可以以规则的手段到G区域。
function
Card
.
IsAbleToGZone
(
c
)
function
Card
.
IsAbleToGZone
(
c
)
if
c
:
IsLocation
(
LOCATION_HAND
)
and
c
:
IsType
(
TYPE_MONSTER
)
then
return
true
end
if
c
:
IsLocation
(
LOCATION_HAND
)
and
c
:
IsType
(
TYPE_MONSTER
)
then
return
true
end
return
c
:
IsLocation
(
LOCATION_
MZON
E
)
and
c
:
IsSkill
(
SKILL_BLOCK
)
and
c
:
IsSequence
(
0
,
4
)
and
c
:
IsFaceup
()
return
c
:
IsLocation
(
LOCATION_
CIRCL
E
)
and
c
:
IsSkill
(
SKILL_BLOCK
)
and
c
:
IsSequence
(
0
,
4
)
and
c
:
IsFaceup
()
end
end
---返回卡片 c 是否可以被玩家 tp 用效果 e[以 calltyp 方式和 callpos 表示形式] Call 到玩家 tp [的区域 zone]
---返回卡片 c 是否可以被玩家 tp 用效果 e[以 calltyp 方式和 callpos 表示形式] Call 到玩家 tp [的区域 zone]
---@param c Card 要判断的卡
---@param c Card 要判断的卡
...
@@ -871,7 +871,7 @@ function Card.IsCanBeCalled(c, e, tp, calltyp, callpos, zone)
...
@@ -871,7 +871,7 @@ function Card.IsCanBeCalled(c, e, tp, calltyp, callpos, zone)
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_MONSTER
+
TYPE_EFFECT
,
atk
,
def
,
lv
,
race
,
att
,
callpos
,
tp
,
calltyp
)
end
end
if
zone
==
"NoMonster"
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_
MZON
E
)
==
0
then
return
false
end
if
zone
==
"NoMonster"
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_
CIRCL
E
)
==
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
loccount
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
calltyp
,
tp
,
false
,
false
,
callpos
,
tp
,
zone
)
...
@@ -1047,7 +1047,7 @@ function VgF.GetMatchingGroup(f, p, loc_self, loc_oppo, ex, ...)
...
@@ -1047,7 +1047,7 @@ function VgF.GetMatchingGroup(f, p, loc_self, loc_oppo, ex, ...)
local
loc_oppo
,
loc_oppo_con
=
VgF
.
GetlocCondition
(
loc_oppo
)
local
loc_oppo
,
loc_oppo_con
=
VgF
.
GetlocCondition
(
loc_oppo
)
local
g
=
Duel
.
GetMatchingGroup
(
loc_self_con
,
p
,
loc_self
,
0
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
loc_self_con
,
p
,
loc_self
,
0
,
nil
)
g
=
g
+
Duel
.
GetMatchingGroup
(
loc_oppo_con
,
p
,
0
,
loc_oppo
,
nil
)
g
=
g
+
Duel
.
GetMatchingGroup
(
loc_oppo_con
,
p
,
0
,
loc_oppo
,
nil
)
g
=
g
-
Duel
.
GetMatchingGroup
(
Card
.
IsFacedown
,
p
,
LOCATION_
MZONE
,
LOCATION_MZON
E
,
nil
)
g
=
g
-
Duel
.
GetMatchingGroup
(
Card
.
IsFacedown
,
p
,
LOCATION_
CIRCLE
,
LOCATION_CIRCL
E
,
nil
)
if
loc_self
&
LOCATION_OVERLAY
>
0
then
if
loc_self
&
LOCATION_OVERLAY
>
0
then
g
=
g
+
VgF
.
GetSoulGroup
(
p
)
g
=
g
+
VgF
.
GetSoulGroup
(
p
)
end
end
...
@@ -1082,12 +1082,12 @@ function VgF.SelectMatchingCard(msg, e, sp, f, p, loc_self, loc_oppo, min, max,
...
@@ -1082,12 +1082,12 @@ function VgF.SelectMatchingCard(msg, e, sp, f, p, loc_self, loc_oppo, min, max,
check_deck
=
true
check_deck
=
true
end
end
local
filter
=
function
(
c
,
e
)
local
filter
=
function
(
c
,
e
)
return
c
:
IsCanBeEffectTarget
(
e
)
or
not
c
:
IsLocation
(
LOCATION_
MZON
E
)
return
c
:
IsCanBeEffectTarget
(
e
)
or
not
c
:
IsLocation
(
LOCATION_
CIRCL
E
)
end
end
local
g
=
VgF
.
GetMatchingGroup
(
filter
,
p
,
loc_self
,
loc_oppo
,
ex
,
e
)
local
g
=
VgF
.
GetMatchingGroup
(
filter
,
p
,
loc_self
,
loc_oppo
,
ex
,
e
)
Duel
.
Hint
(
HINT_SELECTMSG
,
sp
,
msg
)
Duel
.
Hint
(
HINT_SELECTMSG
,
sp
,
msg
)
g
=
g
:
FilterSelect
(
sp
,
f
or
vgf
.
True
,
min
,
max
,
ex
,
...
)
g
=
g
:
FilterSelect
(
sp
,
f
or
vgf
.
True
,
min
,
max
,
ex
,
...
)
local
sg
=
g
:
Filter
(
VgF
.
Not
(
Card
.
IsLocation
),
nil
,
LOCATION_DECK
+
LOCATION_HAND
+
LOCATION_
EXTRA
)
local
sg
=
g
:
Filter
(
VgF
.
Not
(
Card
.
IsLocation
),
nil
,
LOCATION_DECK
+
LOCATION_HAND
+
LOCATION_
RIDE
)
if
#
sg
>
0
then
if
#
sg
>
0
then
Duel
.
HintSelection
(
sg
)
Duel
.
HintSelection
(
sg
)
Duel
.
SetTargetCard
(
sg
)
Duel
.
SetTargetCard
(
sg
)
...
@@ -1125,7 +1125,6 @@ function VgF.Sendto(loc, g, ...)
...
@@ -1125,7 +1125,6 @@ function VgF.Sendto(loc, g, ...)
}
}
if
loc_table
[
loc
]
then
if
loc_table
[
loc
]
then
return
loc_table
[
loc
](
g
,
...
)
return
loc_table
[
loc
](
g
,
...
)
-- loc = LOCATION_DAMAGE, LOCATION_ORDER, LOCATION_SPARE, LOCATION_GZONE, LOCATION_EMBLEM
elseif
bit
.
band
(
loc
,
0xf800
)
>
0
or
loc
==
0
then
elseif
bit
.
band
(
loc
,
0xf800
)
>
0
or
loc
==
0
then
local
sg
=
VgF
.
GetUnderGroup
(
g
)
local
sg
=
VgF
.
GetUnderGroup
(
g
)
return
Duel
.
Sendto
(
sg
,
ex_params
[
1
],
loc
,
ex_params
[
2
],
ex_params
[
3
],
ex_params
[
4
])
+
Duel
.
Sendto
(
g
,
ex_params
[
1
],
loc
,
ex_params
[
2
],
ex_params
[
3
],
ex_params
[
4
])
return
Duel
.
Sendto
(
sg
,
ex_params
[
1
],
loc
,
ex_params
[
2
],
ex_params
[
3
],
ex_params
[
4
])
+
Duel
.
Sendto
(
g
,
ex_params
[
1
],
loc
,
ex_params
[
2
],
ex_params
[
3
],
ex_params
[
4
])
...
...
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