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
2
Merge Requests
2
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
638bcfc6
Commit
638bcfc6
authored
Jun 18, 2025
by
Vury Leo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add 究極融合 to new fusion + add callback stage STAGE_BEFORE_MOVE_MATERIAL
parent
581dae8d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
94 deletions
+57
-94
c71143015.lua
c71143015.lua
+49
-94
procedure.lua
procedure.lua
+8
-0
No files found.
c71143015.lua
View file @
638bcfc6
--究極融合
--究極融合
function
c71143015
.
initial_effect
(
c
)
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
aux
.
AddCodeList
(
c
,
89631139
,
23995346
)
aux
.
AddCodeList
(
c
,
89631139
,
23995346
)
--Activate
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
FusionSpell
.
CreateSummonEffect
(
c
,{
fusfilter
=
s
.
fusfilter
,
pre_select_mat_location
=
LOCATION_HAND
|
LOCATION_MZONE
|
LOCATION_GRAVE
,
mat_operation_code_map
=
{
{
[
LOCATION_DECK
]
=
FusionSpell
.
FUSION_OPERATION_GRAVE
},
{
[
0xff
]
=
FusionSpell
.
FUSION_OPERATION_SHUFFLE
}
},
stage_x_operation
=
s
.
stage_x_operation
})
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_FUSION_SUMMON
+
CATEGORY_GRAVE_ACTION
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_FUSION_SUMMON
+
CATEGORY_GRAVE_ACTION
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_MAIN_END
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_MAIN_END
)
e1
:
SetCountLimit
(
1
,
71143015
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCountLimit
(
1
,
id
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
c71143015
.
condition
)
e1
:
SetCondition
(
s
.
condition
)
e1
:
SetTarget
(
c71143015
.
target
)
e1
:
SetOperation
(
c71143015
.
activate
)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
end
end
function
c71143015
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
local
ph
=
Duel
.
GetCurrentPhase
()
return
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
return
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
end
end
function
c71143015
.
filter0
(
c
,
e
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsCanBeFusionMaterial
()
and
c
:
IsAbleToDeck
()
and
not
c
:
IsImmuneToEffect
(
e
)
function
s
.
fusfilter
(
c
)
return
aux
.
IsMaterialListCode
(
c
,
89631139
)
==
true
or
aux
.
IsMaterialListCode
(
c
,
23995346
)
==
true
end
end
function
c71143015
.
filter1
(
c
,
e
,
tp
,
m
,
f
,
chkf
)
if
not
(
c
:
IsType
(
TYPE_FUSION
)
and
(
aux
.
IsMaterialListCode
(
c
,
89631139
)
or
aux
.
IsMaterialListCode
(
c
,
23995346
))
and
(
not
f
or
f
(
c
))
--- @type FUSION_FGCHECK_FUNCTION
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_FUSION
,
tp
,
false
,
false
))
then
return
false
end
function
s
.
fcheck
(
tp
,
mg
,
fc
,
mg_all
)
aux
.
FCheckAdditional
=
c
.
ultimate_fusion_check
or
c71143015
.
fcheck
if
fc
.
ultimate_fusion_check
~=
nil
then
local
res
=
c
:
CheckFusionMaterial
(
m
,
nil
,
chkf
)
if
fc
.
ultimate_fusion_check
(
tp
,
mg_all
,
fc
)
==
false
then
aux
.
FCheckAdditional
=
nil
return
false
return
res
end
function
c71143015
.
fcheck
(
tp
,
sg
,
fc
)
return
sg
:
IsExists
(
Card
.
IsFusionCode
,
1
,
nil
,
89631139
)
and
aux
.
IsMaterialListCode
(
fc
,
89631139
)
or
sg
:
IsExists
(
Card
.
IsFusionCode
,
1
,
nil
,
23995346
)
and
aux
.
IsMaterialListCode
(
fc
,
23995346
)
end
function
c71143015
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
chkf
=
tp
local
mg
=
Duel
.
GetMatchingGroup
(
c71143015
.
filter0
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
+
LOCATION_GRAVE
,
0
,
nil
,
e
)
local
res
=
Duel
.
IsExistingMatchingCard
(
c71143015
.
filter1
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
mg
,
nil
,
chkf
)
if
not
res
then
local
ce
=
Duel
.
GetChainMaterial
(
tp
)
if
ce
~=
nil
then
local
fgroup
=
ce
:
GetTarget
()
local
mg3
=
fgroup
(
ce
,
e
,
tp
)
local
mf
=
ce
:
GetValue
()
res
=
Duel
.
IsExistingMatchingCard
(
c71143015
.
filter1
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
mg3
,
mf
,
chkf
)
end
end
end
return
res
elseif
not
(
mg_all
:
IsExists
(
function
(
c
)
return
c
:
IsFusionCode
(
89631139
)
end
,
1
,
nil
)
and
aux
.
IsMaterialListCode
(
fc
,
89631139
)
==
true
or
mg_all
:
IsExists
(
function
(
c
)
return
c
:
IsFusionCode
(
23995346
)
end
,
1
,
nil
)
and
aux
.
IsMaterialListCode
(
fc
,
23995346
)
==
true
)
then
return
false
end
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
return
true
end
end
function
c71143015
.
desfilter
(
c
)
function
s
.
desfilter
(
c
)
return
c
:
IsFusionCode
(
89631139
,
23995346
)
and
c
:
IsOnField
()
return
c
:
IsFusionCode
(
89631139
,
23995346
)
and
c
:
IsOnField
()
end
end
function
c71143015
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
chkf
=
tp
--- @type FUSION_SPELL_STAGE_X_CALLBACK_FUNCTION
local
mg
=
Duel
.
GetMatchingGroup
(
aux
.
NecroValleyFilter
(
c71143015
.
filter0
),
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
+
LOCATION_GRAVE
,
0
,
nil
,
e
)
function
s
.
stage_x_operation
(
e
,
tc
,
tp
,
stage
,
mg_fuison_spell
,
mg_all
)
local
sg1
=
Duel
.
GetMatchingGroup
(
c71143015
.
filter1
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
e
,
tp
,
mg
,
nil
,
chkf
)
if
stage
==
FusionSpell
.
STAGE_BEFORE_MOVE_MATERIAL
then
local
mg3
=
nil
--- calculate the count of 青眼の白龍 and 青眼の究極竜
local
sg2
=
nil
local
destory_count
=
mg_all
:
FilterCount
(
s
.
desfilter
,
nil
)
local
ct
=
0
if
destory_count
>
0
then
local
spchk
=
0
e
:
SetLabel
(
destory_count
)
local
ce
=
Duel
.
GetChainMaterial
(
tp
)
if
ce
~=
nil
then
local
fgroup
=
ce
:
GetTarget
()
mg3
=
fgroup
(
ce
,
e
,
tp
)
local
mf
=
ce
:
GetValue
()
sg2
=
Duel
.
GetMatchingGroup
(
c71143015
.
filter1
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
e
,
tp
,
mg3
,
mf
,
chkf
)
end
if
sg1
:
GetCount
()
>
0
or
(
sg2
~=
nil
and
sg2
:
GetCount
()
>
0
)
then
local
sg
=
sg1
:
Clone
()
if
sg2
then
sg
:
Merge
(
sg2
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
tg
=
sg
:
Select
(
tp
,
1
,
1
,
nil
)
local
tc
=
tg
:
GetFirst
()
aux
.
FCheckAdditional
=
tc
.
ultimate_fusion_check
or
c71143015
.
fcheck
if
sg1
:
IsContains
(
tc
)
and
(
sg2
==
nil
or
not
sg2
:
IsContains
(
tc
)
or
not
Duel
.
SelectYesNo
(
tp
,
ce
:
GetDescription
()))
then
local
mat1
=
Duel
.
SelectFusionMaterial
(
tp
,
tc
,
mg
,
nil
,
chkf
)
ct
=
mat1
:
FilterCount
(
c71143015
.
desfilter
,
nil
)
tc
:
SetMaterial
(
mat1
)
if
mat1
:
IsExists
(
Card
.
IsFacedown
,
1
,
nil
)
then
local
cg
=
mat1
:
Filter
(
Card
.
IsFacedown
,
nil
)
Duel
.
ConfirmCards
(
1
-
tp
,
cg
)
end
if
mat1
:
Filter
(
c71143015
.
cfilter
,
nil
):
GetCount
()
>
0
then
local
cg
=
mat1
:
Filter
(
c71143015
.
cfilter
,
nil
)
Duel
.
HintSelection
(
cg
)
end
Duel
.
SendtoDeck
(
mat1
,
nil
,
SEQ_DECKSHUFFLE
,
REASON_EFFECT
+
REASON_MATERIAL
+
REASON_FUSION
)
Duel
.
BreakEffect
()
Duel
.
SpecialSummon
(
tc
,
SUMMON_TYPE_FUSION
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
spchk
=
1
else
else
local
mat2
=
Duel
.
SelectFusionMaterial
(
tp
,
tc
,
mg3
,
nil
,
chkf
)
e
:
SetLabel
(
0
)
ct
=
mat2
:
FilterCount
(
c71143015
.
desfilter
,
nil
)
end
local
fop
=
ce
:
GetOperation
()
elseif
stage
==
FusionSpell
.
STAGE_AT_SUMMON_OPERATION_FINISH
then
fop
(
ce
,
e
,
tp
,
tc
,
mat2
)
local
destory_count
=
e
:
GetLabel
()
spchk
=
1
if
destory_count
>
0
and
Duel
.
IsExistingMatchingCard
(
function
(
c
)
return
c
:
IsFaceup
()
end
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
dg
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
destory_count
,
nil
)
Duel
.
HintSelection
(
dg
)
Duel
.
Destroy
(
dg
,
REASON_EFFECT
)
e
:
SetLabel
(
0
)
end
end
tc
:
CompleteProcedure
()
end
aux
.
FCheckAdditional
=
nil
if
ct
>
0
and
spchk
>
0
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
71143015
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
dg
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
ct
,
nil
)
Duel
.
HintSelection
(
dg
)
Duel
.
Destroy
(
dg
,
REASON_EFFECT
)
end
end
end
end
function
c71143015
.
cfilter
(
c
)
return
c
:
IsLocation
(
LOCATION_GRAVE
)
or
(
c
:
IsLocation
(
LOCATION_MZONE
)
and
c
:
IsFaceup
())
end
procedure.lua
View file @
638bcfc6
...
@@ -2731,6 +2731,8 @@ function FusionSpell.GetSummonOperation(
...
@@ -2731,6 +2731,8 @@ function FusionSpell.GetSummonOperation(
end
end
Duel
.
HintSelection
(
materials
-
confirm_materials
)
Duel
.
HintSelection
(
materials
-
confirm_materials
)
stage_x_operation
(
e
,
tc
,
tp
,
FusionSpell
.
STAGE_BEFORE_MOVE_MATERIAL
,
materials_from_spell_card
,
materials
)
local
operated_material_count
=
0
local
operated_material_count
=
0
-- perform operations on grouped materials
-- perform operations on grouped materials
for
operation
,
grouped_materials
in
pairs
(
material_grouped_by_op
)
do
for
operation
,
grouped_materials
in
pairs
(
material_grouped_by_op
)
do
...
@@ -2955,10 +2957,16 @@ end
...
@@ -2955,10 +2957,16 @@ end
---@alias FUSION_SPELL_STAGE_X_CALLBACK_FUNCTION fun(e:Effect,tc:Card,tp:integer,stage:FUSION_SPELL_CALLBACK_STAGE,mg_fuison_spell:Group,mg_all:Group)
---@alias FUSION_SPELL_STAGE_X_CALLBACK_FUNCTION fun(e:Effect,tc:Card,tp:integer,stage:FUSION_SPELL_CALLBACK_STAGE,mg_fuison_spell:Group,mg_all:Group)
-- different stage for call back
-- different stage for call back
---@alias FUSION_SPELL_CALLBACK_STAGE integer
---@alias FUSION_SPELL_CALLBACK_STAGE integer
-- Right before the Fusion Monster is officially summoned
FusionSpell
.
STAGE_BEFORE_SUMMON_COMPLETE
=
1
FusionSpell
.
STAGE_BEFORE_SUMMON_COMPLETE
=
1
-- Right before the entire Fusion procedure finishes
FusionSpell
.
STAGE_BEFORE_PROCEDURE_COMPLETE
=
2
FusionSpell
.
STAGE_BEFORE_PROCEDURE_COMPLETE
=
2
-- After the summon operation succeeds
FusionSpell
.
STAGE_AT_SUMMON_OPERATION_FINISH
=
3
FusionSpell
.
STAGE_AT_SUMMON_OPERATION_FINISH
=
3
-- After **all** operations have run, whether the summon succeeded or not
FusionSpell
.
STAGE_AT_ALL_OPERATION_FINISH
=
4
FusionSpell
.
STAGE_AT_ALL_OPERATION_FINISH
=
4
-- Right before the selected materials are moved
FusionSpell
.
STAGE_BEFORE_MOVE_MATERIAL
=
5
-- operation that would be applied on the material
-- operation that would be applied on the material
---@alias FUSION_OPERATION_CODE integer
---@alias FUSION_OPERATION_CODE integer
...
...
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