Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-scripts-888
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
3
Merge Requests
3
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
MyCard
ygopro-scripts-888
Commits
31238bdb
Commit
31238bdb
authored
May 21, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update Engraver to support function-typed announce_filter
parent
09162251
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
15 deletions
+40
-15
c50078320.lua
c50078320.lua
+40
-15
No files found.
c50078320.lua
View file @
31238bdb
...
...
@@ -22,30 +22,55 @@ function c50078320.initial_effect(c)
e2
:
SetOperation
(
c50078320
.
regop
)
c
:
RegisterEffect
(
e2
)
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
)
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
function
c50078320
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToGraveAsCost
()
end
Duel
.
SendtoGrave
(
e
:
GetHandler
(),
REASON_COST
)
end
function
c50078320
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
code
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_TARGET_PARAM
)
local
ac
=
0
local
afilter
=
c50078320
.
GetAnnounceFilter
(
ep
,
ev
,
re
)
if
afilter
==
false
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CODE
)
if
re
:
GetHandler
().
announce_filter
==
nil
then
--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
local
ac
=
Duel
.
AnnounceCard
(
tp
,
table.unpack
(
afilter
))
Duel
.
ChangeTargetParam
(
ev
,
ac
)
end
function
c50078320
.
desfilter
(
c
)
...
...
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