Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-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
nanahira
ygopro-scripts
Commits
9e1c14b8
You need to sign in or sign up before continuing.
Commit
9e1c14b8
authored
Jun 14, 2025
by
wind2009
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/patch-engraver' into 888_master
parents
2efe8985
f6f3508c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
132 additions
and
57 deletions
+132
-57
c50078320.lua
c50078320.lua
+40
-15
c74733322.lua
c74733322.lua
+92
-42
No files found.
c50078320.lua
View file @
9e1c14b8
...
@@ -22,30 +22,55 @@ function c50078320.initial_effect(c)
...
@@ -22,30 +22,55 @@ function c50078320.initial_effect(c)
e2
:
SetOperation
(
c50078320
.
regop
)
e2
:
SetOperation
(
c50078320
.
regop
)
c
:
RegisterEffect
(
e2
)
c
:
RegisterEffect
(
e2
)
end
end
function
c50078320
.
GetAnnounceFilter
(
ep
,
ev
,
re
)
local
code
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_TARGET_PARAM
)
local
announce_filter
=
re
:
GetHandler
().
announce_filter
if
not
announce_filter
then
-- announce_filter not specified
return
{
code
,
OPCODE_ISCODE
,
OPCODE_NOT
}
end
local
function
AddNotCodeCondition
(
t
)
-- ... and not c:IsCode(code)
local
afilter
=
{
table.unpack
(
t
)}
table.insert
(
afilter
,
code
)
table.insert
(
afilter
,
OPCODE_ISCODE
)
table.insert
(
afilter
,
OPCODE_NOT
)
table.insert
(
afilter
,
OPCODE_AND
)
return
afilter
end
if
aux
.
GetValueType
(
announce_filter
)
==
"function"
then
-- function form
local
res
=
announce_filter
(
re
,
ep
,
ev
)
if
res
==
true
then
-- allow any except announced code
return
{
code
,
OPCODE_ISCODE
,
OPCODE_NOT
}
elseif
not
res
then
-- cannot be reannounced
return
false
else
-- returns a table, so we wrap it
return
AddNotCodeCondition
(
res
)
end
else
-- table form
return
AddNotCodeCondition
(
announce_filter
)
end
end
function
c50078320
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c50078320
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ex
=
Duel
.
GetOperationInfo
(
ev
,
CATEGORY_ANNOUNCE
)
local
ex
=
Duel
.
GetOperationInfo
(
ev
,
CATEGORY_ANNOUNCE
)
return
rp
==
1
-
tp
and
ex
return
rp
==
1
-
tp
and
ex
and
c50078320
.
GetAnnounceFilter
(
ep
,
ev
,
re
)
~=
false
end
end
function
c50078320
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c50078320
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToGraveAsCost
()
end
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToGraveAsCost
()
end
Duel
.
SendtoGrave
(
e
:
GetHandler
(),
REASON_COST
)
Duel
.
SendtoGrave
(
e
:
GetHandler
(),
REASON_COST
)
end
end
function
c50078320
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c50078320
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
code
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_TARGET_PARAM
)
local
afilter
=
c50078320
.
GetAnnounceFilter
(
ep
,
ev
,
re
)
local
ac
=
0
if
afilter
==
false
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CODE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CODE
)
if
re
:
GetHandler
().
announce_filter
==
nil
then
local
ac
=
Duel
.
AnnounceCard
(
tp
,
table.unpack
(
afilter
))
--not c:IsCode(code)
ac
=
Duel
.
AnnounceCard
(
tp
,
code
,
OPCODE_ISCODE
,
OPCODE_NOT
)
else
local
afilter
=
{
table.unpack
(
re
:
GetHandler
().
announce_filter
)}
--and not c:IsCode(code)
table.insert
(
afilter
,
code
)
table.insert
(
afilter
,
OPCODE_ISCODE
)
table.insert
(
afilter
,
OPCODE_NOT
)
table.insert
(
afilter
,
OPCODE_AND
)
ac
=
Duel
.
AnnounceCard
(
tp
,
table.unpack
(
afilter
))
end
Duel
.
ChangeTargetParam
(
ev
,
ac
)
Duel
.
ChangeTargetParam
(
ev
,
ac
)
end
end
function
c50078320
.
desfilter
(
c
)
function
c50078320
.
desfilter
(
c
)
...
...
c74733322.lua
View file @
9e1c14b8
...
@@ -21,12 +21,39 @@ function s.initial_effect(c)
...
@@ -21,12 +21,39 @@ function s.initial_effect(c)
e3
:
SetCategory
(
CATEGORY_SEARCH
+
CATEGORY_TOHAND
+
CATEGORY_ANNOUNCE
)
e3
:
SetCategory
(
CATEGORY_SEARCH
+
CATEGORY_TOHAND
+
CATEGORY_ANNOUNCE
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_FZONE
)
e3
:
SetRange
(
LOCATION_FZONE
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetCost
(
s
.
thcost
)
e3
:
SetCost
(
s
.
thcost
)
e3
:
SetTarget
(
s
.
thtg
)
e3
:
SetTarget
(
s
.
thtg
)
e3
:
SetOperation
(
s
.
thop
)
e3
:
SetOperation
(
s
.
thop
)
c
:
RegisterEffect
(
e3
)
c
:
RegisterEffect
(
e3
)
--global resetter
if
not
s
.
global_check
then
s
.
global_check
=
true
s
.
announced
=
{}
s
.
announced_set
=
{}
s
.
clearop
()
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_PHASE_START
+
PHASE_DRAW
)
ge1
:
SetOperation
(
s
.
clearop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
-- workaround for Engraver
local
ARTMEGIA_COUNT
=
4
function
s
.
AddToAnnounced
(
tp
,
code
)
table.insert
(
s
.
announced
[
tp
],
code
)
s
.
announced_set
[
tp
][
code
]
=
true
end
end
function
s
.
clearop
()
s
.
announced
[
0
]
=
{}
s
.
announced
[
1
]
=
{}
s
.
announced_set
[
0
]
=
{}
s
.
announced_set
[
1
]
=
{}
end
function
s
.
costfilter
(
c
)
function
s
.
costfilter
(
c
)
return
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c
:
IsDiscardable
()
return
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c
:
IsDiscardable
()
end
end
...
@@ -36,26 +63,57 @@ function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
...
@@ -36,26 +63,57 @@ function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function
s
.
anfilter
(
c
,
tp
)
function
s
.
anfilter
(
c
,
tp
)
return
c
:
IsSetCard
(
0x1cd
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
return
c
:
IsSetCard
(
0x1cd
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
and
not
Duel
.
IsExistingMatchingCard
(
Card
.
IsCode
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
c
:
GetCode
())
and
not
s
.
announced_set
[
tp
][
c
:
GetCode
()]
and
not
c
:
IsHasEffect
(
id
,
tp
)
end
end
function
s
.
thfilter
(
c
,
code
)
function
s
.
thfilter
(
c
,
code
)
return
c
:
IsSetCard
(
0x1cd
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
return
c
:
IsSetCard
(
0x1cd
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
and
c
:
IsCode
(
code
)
and
c
:
IsCode
(
code
)
end
end
function
s
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
anfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
tp
)
end
function
s
.
CreateCodeList
(
g
,
list
,
exg
,
exlist
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
anfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
,
tp
)
local
ag
=
Group
.
CreateGroup
()
local
codes
=
{}
local
codes
=
{}
local
existing
=
{}
-- exclude group
if
exg
then
for
c
in
aux
.
Next
(
exg
)
do
local
code
=
c
:
GetCode
()
existing
[
code
]
=
true
end
end
-- exclude list
if
exlist
then
for
_
,
code
in
ipairs
(
exlist
)
do
existing
[
code
]
=
true
end
end
-- add group
if
g
then
for
c
in
aux
.
Next
(
g
)
do
for
c
in
aux
.
Next
(
g
)
do
local
code
=
c
:
GetCode
()
local
code
=
c
:
GetCode
()
if
not
ag
:
IsExists
(
Card
.
IsCode
,
1
,
nil
,
code
)
then
if
not
existing
[
code
]
then
ag
:
AddCard
(
c
)
existing
[
code
]
=
true
table.insert
(
codes
,
code
)
table.insert
(
codes
,
code
)
end
end
end
end
end
-- add list
if
list
then
for
_
,
code
in
ipairs
(
list
)
do
if
not
existing
[
code
]
then
existing
[
code
]
=
true
table.insert
(
codes
,
code
)
end
end
end
table.sort
(
codes
)
table.sort
(
codes
)
return
codes
end
function
s
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
anfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
,
tp
)
local
exg
=
Duel
.
GetMatchingGroup
(
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
codes
=
s
.
CreateCodeList
(
g
,
nil
,
exg
,
nil
)
if
chk
==
0
then
return
#
codes
>
0
end
local
afilter
=
{
codes
[
1
],
OPCODE_ISCODE
}
local
afilter
=
{
codes
[
1
],
OPCODE_ISCODE
}
if
#
codes
>
1
then
if
#
codes
>
1
then
--or ... or c:IsCode(codes[i])
--or ... or c:IsCode(codes[i])
...
@@ -65,41 +123,13 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
...
@@ -65,41 +123,13 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
table.insert
(
afilter
,
OPCODE_OR
)
table.insert
(
afilter
,
OPCODE_OR
)
end
end
end
end
ag
:
Clear
()
local
ncodes
=
{}
local
exg
=
Duel
.
GetMatchingGroup
(
aux
.
AND
(
Card
.
IsFaceup
,
Card
.
IsSetCard
),
tp
,
LOCATION_MZONE
,
0
,
nil
,
0x1cd
)
for
c
in
aux
.
Next
(
exg
)
do
local
code
=
c
:
GetCode
()
if
not
ag
:
IsExists
(
Card
.
IsCode
,
1
,
nil
,
code
)
then
ag
:
AddCard
(
c
)
table.insert
(
ncodes
,
code
)
end
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CODE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CODE
)
local
ac
=
Duel
.
AnnounceCard
(
tp
,
table.unpack
(
afilter
))
local
ac
=
Duel
.
AnnounceCard
(
tp
,
table.unpack
(
afilter
))
local
af
=
{
s
.
AddToAnnounced
(
tp
,
ac
)
TYPE_FUSION
+
TYPE_SYNCHRO
+
TYPE_XYZ
+
TYPE_LINK
,
OPCODE_ISTYPE
,
OPCODE_NOT
,
0x1cd
,
OPCODE_ISSETCARD
,
OPCODE_AND
,
TYPE_MONSTER
,
OPCODE_ISTYPE
,
OPCODE_AND
}
for
i
=
1
,
#
ncodes
do
table.insert
(
af
,
ncodes
[
i
])
table.insert
(
af
,
OPCODE_ISCODE
)
table.insert
(
af
,
OPCODE_NOT
)
table.insert
(
af
,
OPCODE_AND
)
end
getmetatable
(
e
:
GetHandler
()).
announce_filter
=
af
Duel
.
SetTargetParam
(
ac
)
Duel
.
SetTargetParam
(
ac
)
getmetatable
(
e
:
GetHandler
()).
announce_filter
=
s
.
announce_filter_func
Duel
.
SetOperationInfo
(
0
,
CATEGORY_ANNOUNCE
,
nil
,
0
,
tp
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_ANNOUNCE
,
nil
,
0
,
tp
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
local
e0
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e0
:
SetType
(
EFFECT_TYPE_FIELD
)
e0
:
SetCode
(
id
)
e0
:
SetTargetRange
(
1
,
0
)
e0
:
SetTarget
(
s
.
thlimit
)
e0
:
SetLabel
(
ac
)
e0
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e0
,
tp
)
end
end
function
s
.
thlimit
(
e
,
c
,
tp
,
re
)
function
s
.
thlimit
(
e
,
c
,
tp
,
re
)
return
c
:
IsCode
(
e
:
GetLabel
())
return
c
:
IsCode
(
e
:
GetLabel
())
...
@@ -124,3 +154,23 @@ end
...
@@ -124,3 +154,23 @@ end
function
s
.
splimit
(
e
,
c
)
function
s
.
splimit
(
e
,
c
)
return
not
(
c
:
IsSetCard
(
0x1cd
)
or
c
:
IsCode
(
97556336
))
and
not
c
:
IsLocation
(
LOCATION_EXTRA
)
return
not
(
c
:
IsSetCard
(
0x1cd
)
or
c
:
IsCode
(
97556336
))
and
not
c
:
IsLocation
(
LOCATION_EXTRA
)
end
end
function
s
.
announce_filter_func
(
e
,
tp
,
ev
)
local
exg
=
Duel
.
GetMatchingGroup
(
aux
.
AND
(
Card
.
IsFaceup
,
Card
.
IsSetCard
),
tp
,
LOCATION_MZONE
,
0
,
nil
,
0x1cd
)
local
ncodes
=
s
.
CreateCodeList
(
exg
,
s
.
announced
[
tp
],
nil
,
nil
)
if
#
ncodes
>=
ARTMEGIA_COUNT
then
return
false
end
local
af
=
{
TYPE_FUSION
+
TYPE_SYNCHRO
+
TYPE_XYZ
+
TYPE_LINK
,
OPCODE_ISTYPE
,
OPCODE_NOT
,
0x1cd
,
OPCODE_ISSETCARD
,
OPCODE_AND
,
TYPE_MONSTER
,
OPCODE_ISTYPE
,
OPCODE_AND
}
for
i
=
1
,
#
ncodes
do
table.insert
(
af
,
ncodes
[
i
])
table.insert
(
af
,
OPCODE_ISCODE
)
table.insert
(
af
,
OPCODE_NOT
)
table.insert
(
af
,
OPCODE_AND
)
end
return
af
end
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