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
c198a77a
Commit
c198a77a
authored
Jul 16, 2025
by
Vury Leo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move allow_extras to runtime
parent
71f7c749
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
19 deletions
+41
-19
procedure.lua
procedure.lua
+41
-19
No files found.
procedure.lua
View file @
c198a77a
...
...
@@ -3474,9 +3474,8 @@ function Fusion.AddFusionProcedure(c, opts)
c
:
RegisterEffect
(
e
)
end
---@param allow_extras boolean whether to allow extra materials for checking propose
function
Fusion
.
BasicCondition
(
tc
,
slots
,
matfilter
,
fgoalcheck
,
allow_extras
,
selected
)
return
function
(
e
,
g
,
gc
,
chkf
)
function
Fusion
.
BasicCondition
(
tc
,
slots
,
matfilter
,
fgoalcheck
,
selected
)
return
function
(
e
,
g
,
gc
,
chkf
,
allow_extras
)
if
not
g
then
return
false
end
-- Collect cards and apply global matfilter
...
...
@@ -4251,9 +4250,9 @@ function Fusion.CanCompleteFromMappings(e,sel,eg,slots,matfilter,fgoalcheck,tc,g
end
end
-- delegate to
Fusion
Condition (allow_extras=true)
local
search_cond
=
Fusion
.
BasicCondition
(
tc
,
rem_slots
,
matfilter
,
fgoalcheck
,
true
,
sel
)
if
search_cond
(
e
,
rem_pool
,
gc
,
chkf
)
then
-- delegate to
Basic
Condition (allow_extras=true)
local
cond
=
Fusion
.
BasicCondition
(
tc
,
rem_slots
,
matfilter
,
fgoalcheck
,
sel
)
if
cond
(
e
,
rem_pool
,
gc
,
chkf
,
true
--[[allow_extras]]
)
then
Fusion
.
LockedCodes
=
old_locked
return
true
end
...
...
@@ -4389,8 +4388,8 @@ function Fusion.BuildPatterns(opts)
end
-- Helper: combine multiple patterns into one condition function
function
Fusion
.
MultiCondition
(
tc
,
patterns
,
allow_extras
)
return
function
(
e
,
g
,
gc
,
chkf
,
selected
)
function
Fusion
.
MultiCondition
(
tc
,
patterns
)
return
function
(
e
,
g
,
gc
,
chkf
,
selected
,
allow_extras
)
if
not
g
then
return
false
end
local
locked
=
Fusion
.
LockedCodes
for
_
,
pat
in
ipairs
(
patterns
)
do
...
...
@@ -4405,8 +4404,8 @@ function Fusion.MultiCondition(tc,patterns,allow_extras)
end
end
if
ok
then
local
cond
=
Fusion
.
BasicCondition
(
tc
,
pat
.
slots
,
pat
.
matfilter
,
pat
.
fgoalcheck
,
allow_extras
,
selected
)
if
cond
(
e
,
g
,
gc
,
chkf
)
then
local
cond
=
Fusion
.
BasicCondition
(
tc
,
pat
.
slots
,
pat
.
matfilter
,
pat
.
fgoalcheck
,
selected
)
if
cond
(
e
,
g
,
gc
,
chkf
,
allow_extras
)
then
return
true
end
end
...
...
@@ -4463,7 +4462,7 @@ function Fusion.MultiOperation(tc,patterns)
max_req
=
math.min
(
max_req
,
eg
:
GetCount
())
-- strict condition uses only active patterns
local
strict_cond
=
Fusion
.
MultiCondition
(
tc
,
active_patterns
,
false
)
local
cond
=
Fusion
.
MultiCondition
(
tc
,
active_patterns
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FMATERIAL
)
local
sg
=
selected
and
selected
:
Clone
()
or
Group
.
CreateGroup
()
...
...
@@ -4475,7 +4474,7 @@ function Fusion.MultiOperation(tc,patterns)
end
while
true
do
local
finishable
=
sg
:
GetCount
()
>=
min_req
and
strict_cond
(
e
,
sg
,
gc
,
chkf
)
local
finishable
=
sg
:
GetCount
()
>=
min_req
and
cond
(
e
,
sg
,
gc
,
chkf
,
false
--[[allow_extras]]
)
local
addable
=
Group
.
CreateGroup
()
-- check fcheck on the *current* sg
...
...
@@ -4552,14 +4551,17 @@ function Fusion.PatternIncludesCode(pat,code)
return
false
end
--- A “seeded” condition that first tries CanCompleteFromMappings on each pattern,
--- then, if none complete, falls back to the strict DFS.
--- A “seeded” condition that first tries CanCompleteFromMappings on each pattern
--- @param tc Card
--- @param patterns table[]
function
Fusion
.
FusionCondition
(
tc
,
patterns
)
return
function
(
e
,
g
,
gc
,
chkf
)
return
function
(
e
,
g
,
gc
,
chkf
,
opts
)
if
not
g
then
return
false
end
opts
=
opts
or
{}
local
allow_extras
=
true
if
opts
.
allow_extras
==
false
then
allow_extras
=
false
end
-- build your seed group
local
selected
=
Group
.
CreateGroup
()
if
gc
then
selected
:
AddCard
(
gc
)
end
...
...
@@ -4568,12 +4570,32 @@ function Fusion.FusionCondition(tc,patterns)
local
must_materials
=
Duel
.
GetMustMaterial
(
e
:
GetHandler
():
GetOwner
(),
EFFECT_MUST_BE_FMATERIAL
)
selected
:
Merge
(
must_materials
)
-- attempt “search mode” on each pattern
if
allow_extras
then
-- attempt "search mode" on each pattern
local
locked
=
Fusion
.
LockedCodes
for
_
,
pat
in
ipairs
(
patterns
)
do
-- skip patterns that don't include all locked codes
local
ok
=
true
if
locked
then
for
_
,
code
in
ipairs
(
locked
)
do
if
not
Fusion
.
PatternIncludesCode
(
pat
,
code
)
then
ok
=
false
break
end
end
end
if
ok
then
if
Fusion
.
CanCompleteFromMappings
(
e
,
selected
,
g
,
pat
.
slots
,
pat
.
matfilter
,
pat
.
fgoalcheck
or
aux
.
TRUE
,
tc
,
gc
,
chkf
)
then
return
true
end
end
end
else
-- attempt "strict mode"
if
Fusion
.
MultiCondition
(
tc
,
patterns
)(
e
,
g
,
gc
,
chkf
,
allow_extras
)
then
return
true
end
end
return
false
end
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