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
6622dadb
Commit
6622dadb
authored
Aug 29, 2024
by
xiaoye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
148fc60a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
18 deletions
+19
-18
VgD.Lua
VgD.Lua
+7
-7
VgFuncLib.lua
VgFuncLib.lua
+12
-11
No files found.
VgD.Lua
View file @
6622dadb
...
@@ -431,7 +431,7 @@ end
...
@@ -431,7 +431,7 @@ end
function
VgD
.
TriggerCard
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
VgD
.
TriggerCard
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tg
=
Duel
.
GetDecktopGroup
(
tp
,
1
)
local
tg
=
Duel
.
GetDecktopGroup
(
tp
,
1
)
Duel
.
DisableShuffleCheck
()
Duel
.
DisableShuffleCheck
()
VgF
.
Sendto
(
LOCATION_TRIGGER
,
tg
:
GetFirst
()
,
tp
,
tp
,
POS_FACEUP
,
true
)
VgF
.
Sendto
(
LOCATION_TRIGGER
,
tg
:
GetFirst
())
end
end
function
VgD
.
MonsterPosDefenseOperation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
VgD
.
MonsterPosDefenseOperation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
...
@@ -707,10 +707,10 @@ function VgD.CardTriggerOperation(chkop,f)
...
@@ -707,10 +707,10 @@ function VgD.CardTriggerOperation(chkop,f)
end
)
end
)
end
end
if
VgD
.
OperationWhenCardTrigger
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
,
0
)
then
if
VgD
.
OperationWhenCardTrigger
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
,
0
)
then
table.insert
(
ops
,
VgF
.
Stringid
(
VgID
+
5
,
5
))
table.insert
(
ops
,
VgF
.
Stringid
(
VgID
+
5
,
6
))
table.insert
(
sel
,
function
()
table.insert
(
sel
,
function
()
VgD
.
OperationWhenCardTrigger
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
,
1
)
return
VgD
.
OperationWhenCardTrigger
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
,
1
)
end
)
end
)
end
end
while
#
ops
>
0
do
while
#
ops
>
0
do
local
i
=
Duel
.
SelectOption
(
tp
,
table.unpack
(
ops
))
+
1
local
i
=
Duel
.
SelectOption
(
tp
,
table.unpack
(
ops
))
+
1
...
@@ -738,8 +738,7 @@ function VgD.CardTriggerOperation(chkop,f)
...
@@ -738,8 +738,7 @@ function VgD.CardTriggerOperation(chkop,f)
end
end
function
VgD
.
OperationWhenCardTrigger
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
,
chk
)
function
VgD
.
OperationWhenCardTrigger
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
,
chk
)
local
effect_when_trigger
local
effect_when_trigger
=
c
.
effect_when_trigger
tabel
.
copy
(
effect_when_trigger
,
c
.
effect_when_trigger
)
local
cost
,
con
,
tg
=
true
,
true
,
true
local
cost
,
con
,
tg
=
true
,
true
,
true
if
#
effect_when_trigger
==
0
then
return
end
if
#
effect_when_trigger
==
0
then
return
end
if
(
VgF
.
GetValueType
(
effect_when_trigger
[
5
])
==
"boolean"
and
not
effect_when_trigger
[
5
])
or
(
VgF
.
GetValueType
(
effect_when_trigger
[
5
])
~=
"boolean"
and
Duel
.
GetTurnPlayer
()
~=
c
:
GetControler
())
then
return
false
end
if
(
VgF
.
GetValueType
(
effect_when_trigger
[
5
])
==
"boolean"
and
not
effect_when_trigger
[
5
])
or
(
VgF
.
GetValueType
(
effect_when_trigger
[
5
])
~=
"boolean"
and
Duel
.
GetTurnPlayer
()
~=
c
:
GetControler
())
then
return
false
end
...
@@ -747,7 +746,7 @@ function VgD.OperationWhenCardTrigger(e,tp,eg,ep,ev,re,r,rp,c,chk)
...
@@ -747,7 +746,7 @@ function VgD.OperationWhenCardTrigger(e,tp,eg,ep,ev,re,r,rp,c,chk)
if
VgF
.
GetValueType
(
effect_when_trigger
[
3
])
==
"function"
then
con
=
effect_when_trigger
[
3
](
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
end
if
VgF
.
GetValueType
(
effect_when_trigger
[
3
])
==
"function"
then
con
=
effect_when_trigger
[
3
](
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
end
if
VgF
.
GetValueType
(
effect_when_trigger
[
4
])
==
"function"
then
tg
=
effect_when_trigger
[
4
](
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
0
)
end
if
VgF
.
GetValueType
(
effect_when_trigger
[
4
])
==
"function"
then
tg
=
effect_when_trigger
[
4
](
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
0
)
end
if
VgF
.
GetValueType
(
effect_when_trigger
[
1
])
==
"function"
and
cost
and
con
and
tg
then
if
VgF
.
GetValueType
(
effect_when_trigger
[
1
])
==
"function"
and
cost
and
con
and
tg
then
if
chk
==
0
then
return
true
e
lse
return
false
e
nd
if
chk
==
0
then
return
true
end
local
activate_chk
=
true
local
activate_chk
=
true
if
VgF
.
GetValueType
(
effect_when_trigger
[
2
])
==
"function"
then
activate_chk
=
Duel
.
SelectYesNo
(
tp
,
VgF
.
Stringid
(
VgID
,
15
))
end
if
VgF
.
GetValueType
(
effect_when_trigger
[
2
])
==
"function"
then
activate_chk
=
Duel
.
SelectYesNo
(
tp
,
VgF
.
Stringid
(
VgID
,
15
))
end
if
activate_chk
then
if
activate_chk
then
...
@@ -759,6 +758,7 @@ function VgD.OperationWhenCardTrigger(e,tp,eg,ep,ev,re,r,rp,c,chk)
...
@@ -759,6 +758,7 @@ function VgD.OperationWhenCardTrigger(e,tp,eg,ep,ev,re,r,rp,c,chk)
effect_when_trigger
[
1
](
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
effect_when_trigger
[
1
](
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
end
end
end
end
return
false
end
end
--vg规则
--vg规则
...
...
VgFuncLib.lua
View file @
6622dadb
VgF
=
{}
VgF
=
{}
vgf
=
VgF
vgf
=
VgF
bit
=
{}
---@class Card
---@class Card
---@class Group
---@class Group
...
@@ -121,7 +122,6 @@ function VgF.GetCardsFromGroup(g,val)
...
@@ -121,7 +122,6 @@ function VgF.GetCardsFromGroup(g,val)
return
sg
return
sg
end
end
end
end
bit
=
{}
function
bit
.
ReturnCount
(
n
)
function
bit
.
ReturnCount
(
n
)
if
n
==
0
then
if
n
==
0
then
return
0
return
0
...
@@ -129,6 +129,14 @@ function bit.ReturnCount(n)
...
@@ -129,6 +129,14 @@ function bit.ReturnCount(n)
return
1
+
bit
.
ReturnCount
(
n
&
(
n
-
1
))
return
1
+
bit
.
ReturnCount
(
n
&
(
n
-
1
))
end
end
function
table
.
copy
(
copy
,
original
)
copy
=
{}
if
VgF
.
GetValueType
(
original
)
~=
"table"
then
return
end
for
i
=
1
,
#
original
do
table.insert
(
copy
,
original
[
i
])
end
end
---返回对a和b进行按位与运算的结果。
---返回对a和b进行按位与运算的结果。
---@param a integer 操作数1
---@param a integer 操作数1
---@param b integer 操作数2
---@param b integer 操作数2
...
@@ -1127,14 +1135,15 @@ function VgF.Sendto(loc,sg,...)
...
@@ -1127,14 +1135,15 @@ function VgF.Sendto(loc,sg,...)
elseif
loc
==
LOCATION_TRIGGER
then
elseif
loc
==
LOCATION_TRIGGER
then
local
ct
=
0
local
ct
=
0
for
tc
in
VgF
.
Next
(
g
)
do
for
tc
in
VgF
.
Next
(
g
)
do
if
Duel
.
MoveToField
(
tc
,
table.unpack
(
ext_params
))
then
ct
=
ct
+
1
end
local
tp
=
tc
:
GetControler
()
if
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
loc
,
POS_FACEUP
,
true
)
then
ct
=
ct
+
1
end
end
end
return
ct
return
ct
elseif
loc
==
LOCATION_MZONE
then
elseif
loc
==
LOCATION_MZONE
then
return
VgF
.
Call
(
g
,
table.unpack
(
ext_params
))
return
VgF
.
Call
(
g
,
table.unpack
(
ext_params
))
elseif
bit
.
band
(
loc
,
0xf800
)
>
0
or
loc
==
0
then
elseif
bit
.
band
(
loc
,
0xf800
)
>
0
or
loc
==
0
then
AddOverlayGroup
(
g
,
loc
)
AddOverlayGroup
(
g
,
loc
)
Duel
.
Sendto
(
g
,
table.unpack
(
ext_params
)
)
Duel
.
Sendto
(
g
,
loc
,
...
)
local
return_group
=
Duel
.
GetOperatedGroup
()
local
return_group
=
Duel
.
GetOperatedGroup
()
return
return_group
:
GetCount
()
return
return_group
:
GetCount
()
end
end
...
@@ -1217,14 +1226,6 @@ function VgF.ShiftLocationFromString(str)
...
@@ -1217,14 +1226,6 @@ function VgF.ShiftLocationFromString(str)
return
loc
return
loc
end
end
function
table
.
copy
(
copy
,
original
)
copy
=
{}
if
VgF
.
GetValueType
(
original
)
~=
"table"
then
return
end
for
i
=
1
,
#
original
do
table.insert
(
copy
,
original
[
i
])
end
end
function
VgF
.
PlayerEffect
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
VgF
.
PlayerEffect
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
true
return
true
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