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
5b4f5576
Commit
5b4f5576
authored
Nov 17, 2022
by
mercury233
Committed by
GitHub
Nov 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Auxiliary.RegisterMergedDelayedEvent (#1994)
parent
8da51818
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
63 additions
and
58 deletions
+63
-58
c34090915.lua
c34090915.lua
+2
-1
c48626373.lua
c48626373.lua
+3
-9
c52038441.lua
c52038441.lua
+2
-1
c53485634.lua
c53485634.lua
+2
-1
c59071624.lua
c59071624.lua
+4
-4
c63767246.lua
c63767246.lua
+2
-1
c66399653.lua
c66399653.lua
+5
-5
c72656408.lua
c72656408.lua
+3
-35
c72971064.lua
c72971064.lua
+2
-1
utility.lua
utility.lua
+38
-0
No files found.
c34090915.lua
View file @
5b4f5576
...
...
@@ -11,13 +11,14 @@ function s.initial_effect(c)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_TODECK
+
CATEGORY_DRAW
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_
REMOVE
)
e1
:
SetCode
(
EVENT_
CUSTOM
+
id
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetTarget
(
s
.
tdtg
)
e1
:
SetOperation
(
s
.
tdop
)
c
:
RegisterEffect
(
e1
)
aux
.
RegisterMergedDelayedEvent
(
c
,
id
,
EVENT_REMOVE
)
--special summon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
...
...
c48626373.lua
View file @
5b4f5576
...
...
@@ -18,11 +18,12 @@ function s.initial_effect(c)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_F
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCode
(
EVENT_
REMOVE
)
e2
:
SetCode
(
EVENT_
CUSTOM
+
id
)
e2
:
SetCondition
(
s
.
mtcon
)
e2
:
SetTarget
(
s
.
mttg
)
e2
:
SetOperation
(
s
.
mtop
)
c
:
RegisterEffect
(
e2
)
aux
.
RegisterMergedDelayedEvent
(
c
,
id
,
EVENT_REMOVE
)
--remove
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
...
...
@@ -61,14 +62,7 @@ function s.mtcon(e,tp,eg,ep,ev,re,r,rp)
end
function
s
.
mttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
--workaround check of only 1 activation
local
g
=
e
:
GetLabelObject
()
local
res
=
c
:
GetFlagEffect
(
id
)
==
0
and
(
g
==
nil
or
g
:
Equal
(
eg
))
if
res
then
e
:
SetLabelObject
(
eg
)
end
return
res
end
e
:
SetLabelObject
(
nil
)
if
chk
==
0
then
return
c
:
GetFlagEffect
(
id
)
==
0
end
c
:
RegisterFlagEffect
(
id
,
RESET_CHAIN
,
0
,
1
)
end
function
s
.
mtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
...
...
c52038441.lua
View file @
5b4f5576
...
...
@@ -5,7 +5,7 @@ function c52038441.initial_effect(c)
e1
:
SetDescription
(
aux
.
Stringid
(
52038441
,
0
))
e1
:
SetCategory
(
CATEGORY_DISABLE
+
CATEGORY_DAMAGE
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_
SPSUMMON_SUCCESS
)
e1
:
SetCode
(
EVENT_
CUSTOM
+
52038441
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
52038441
)
...
...
@@ -14,6 +14,7 @@ function c52038441.initial_effect(c)
e1
:
SetTarget
(
c52038441
.
distg
)
e1
:
SetOperation
(
c52038441
.
disop
)
c
:
RegisterEffect
(
e1
)
aux
.
RegisterMergedDelayedEvent
(
c
,
52038441
,
EVENT_SPSUMMON_SUCCESS
)
end
function
c52038441
.
cfilter
(
c
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsSummonPlayer
(
1
-
tp
)
and
(
aux
.
NegateMonsterFilter
(
c
)
or
c
:
GetAttack
()
>
0
)
...
...
c53485634.lua
View file @
5b4f5576
...
...
@@ -5,12 +5,13 @@ function c53485634.initial_effect(c)
e1
:
SetDescription
(
aux
.
Stringid
(
53485634
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_GRAVE_SPSUMMON
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_
TO_GRAVE
)
e1
:
SetCode
(
EVENT_
CUSTOM
+
53485634
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e1
:
SetTarget
(
c53485634
.
sptg
)
e1
:
SetOperation
(
c53485634
.
spop
)
c
:
RegisterEffect
(
e1
)
aux
.
RegisterMergedDelayedEvent
(
c
,
53485634
,
EVENT_TO_GRAVE
)
--extra summon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
53485634
,
1
))
...
...
c59071624.lua
View file @
5b4f5576
...
...
@@ -28,7 +28,7 @@ function c59071624.initial_effect(c)
e3
:
SetDescription
(
aux
.
Stringid
(
59071624
,
1
))
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetCode
(
EVENT_
TO_GRAVE
)
e3
:
SetCode
(
EVENT_
CUSTOM
+
59071624
)
e3
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
1
,
59071625
)
...
...
@@ -37,9 +37,9 @@ function c59071624.initial_effect(c)
e3
:
SetTarget
(
c59071624
.
sptg2
)
e3
:
SetOperation
(
c59071624
.
spop2
)
c
:
RegisterEffect
(
e3
)
local
e4
=
e3
:
Clone
()
e4
:
SetCode
(
EVENT_REMOVE
)
c
:
RegisterEffect
(
e4
)
local
g
=
Group
.
CreateGroup
()
aux
.
RegisterMergedDelayedEvent
(
c
,
59071624
,
EVENT_TO_GRAVE
,
g
)
aux
.
RegisterMergedDelayedEvent
(
c
,
59071624
,
EVENT_REMOVE
,
g
)
end
function
c59071624
.
imcon
(
e
)
return
e
:
GetHandler
():
GetOverlayCount
()
>
0
...
...
c63767246.lua
View file @
5b4f5576
...
...
@@ -31,12 +31,13 @@ function c63767246.initial_effect(c)
e3
:
SetCategory
(
CATEGORY_ATKCHANGE
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e3
:
SetCode
(
EVENT_
DESTROYED
)
e3
:
SetCode
(
EVENT_
CUSTOM
+
63767246
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCondition
(
c63767246
.
atkcon
)
e3
:
SetTarget
(
c63767246
.
atktg
)
e3
:
SetOperation
(
c63767246
.
atkop
)
c
:
RegisterEffect
(
e3
)
aux
.
RegisterMergedDelayedEvent
(
c
,
63767246
,
EVENT_DESTROYED
)
end
aux
.
xyz_number
[
63767246
]
=
38
function
c63767246
.
discon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
...
...
c66399653.lua
View file @
5b4f5576
...
...
@@ -12,16 +12,16 @@ function c66399653.initial_effect(c)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
66399653
,
1
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_
SUMMON_SUCCESS
)
e2
:
SetCode
(
EVENT_
CUSTOM
+
66399653
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetCountLimit
(
1
,
EFFECT_COUNT_CODE_SINGLE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e2
:
SetTarget
(
c66399653
.
eqtg
)
e2
:
SetOperation
(
c66399653
.
eqop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e3
)
local
g
=
Group
.
CreateGroup
()
aux
.
RegisterMergedDelayedEvent
(
c
,
66399653
,
EVENT_SUMMON_SUCCESS
,
g
)
aux
.
RegisterMergedDelayedEvent
(
c
,
66399653
,
EVENT_SPSUMMON_SUCCESS
,
g
)
end
function
c66399653
.
thfilter
(
c
)
return
c
:
IsRace
(
RACE_MACHINE
)
and
c
:
IsAttribute
(
ATTRIBUTE_LIGHT
)
...
...
c72656408.lua
View file @
5b4f5576
...
...
@@ -18,16 +18,7 @@ function s.initial_effect(c)
e2
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_END_PHASE
)
e2
:
SetCondition
(
s
.
spcon2
)
c
:
RegisterEffect
(
e2
)
--group summoned monsters (avoid "Union Hangar" scenario)
local
g
=
Group
.
CreateGroup
()
g
:
KeepAlive
()
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e3
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetOperation
(
s
.
regop
)
--banish among grouped monsters
--banish summoned monster
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e4
:
SetCategory
(
CATEGORY_REMOVE
)
...
...
@@ -36,13 +27,10 @@ function s.initial_effect(c)
e4
:
SetCode
(
EVENT_CUSTOM
+
id
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetCountLimit
(
1
,
id
+
o
)
e4
:
SetLabelObject
(
g
)
e4
:
SetTarget
(
s
.
rmtg
)
e4
:
SetOperation
(
s
.
rmop
)
c
:
RegisterEffect
(
e4
)
--complete e3 registration
e3
:
SetLabelObject
(
e4
)
c
:
RegisterEffect
(
e3
)
aux
.
RegisterMergedDelayedEvent
(
c
,
id
,
EVENT_SPSUMMON_SUCCESS
)
end
function
s
.
spcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetFieldGroupCount
(
tp
,
0
,
LOCATION_MZONE
)
==
0
...
...
@@ -75,38 +63,18 @@ function s.rmfilter(c,tp,e)
and
c
:
IsType
(
TYPE_FUSION
+
TYPE_RITUAL
+
TYPE_SYNCHRO
+
TYPE_XYZ
+
TYPE_LINK
)
and
c
:
IsAbleToRemove
()
and
(
not
e
or
c
:
IsCanBeEffectTarget
(
e
))
end
function
s
.
rmgroupfilter
(
c
)
return
c
:
GetFlagEffect
(
id
)
==
0
end
function
s
.
regop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetFlagEffect
(
tp
,
id
)
>
0
then
return
end
local
c
=
e
:
GetHandler
()
local
tg
=
eg
:
Filter
(
s
.
rmfilter
,
nil
,
tp
,
nil
)
if
#
tg
>
0
then
for
tc
in
aux
.
Next
(
tg
)
do
tc
:
RegisterFlagEffect
(
id
,
RESET_CHAIN
,
0
,
1
)
end
local
g
=
e
:
GetLabelObject
():
GetLabelObject
()
if
Duel
.
GetCurrentChain
()
==
0
then
g
:
Clear
()
end
g
:
Merge
(
tg
)
g
:
Remove
(
s
.
rmgroupfilter
,
nil
)
e
:
GetLabelObject
():
SetLabelObject
(
g
)
Duel
.
RaiseSingleEvent
(
e
:
GetHandler
(),
EVENT_CUSTOM
+
id
,
e
,
0
,
tp
,
tp
,
0
)
end
end
function
s
.
costfilter
(
c
,
g
,
tp
)
return
c
:
IsAttribute
(
ATTRIBUTE_LIGHT
+
ATTRIBUTE_DARK
)
and
g
:
FilterCount
(
aux
.
TRUE
,
c
)
>
0
and
(
c
:
IsControler
(
tp
)
or
c
:
IsFaceup
())
end
function
s
.
rmtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
c
=
e
:
GetHandler
()
local
g
=
e
:
GetLabelObject
()
:
Filter
(
s
.
rmfilter
,
nil
,
tp
,
e
)
local
g
=
e
g
:
Filter
(
s
.
rmfilter
,
nil
,
tp
,
e
)
if
chkc
then
return
g
:
IsContains
(
chkc
)
end
if
chk
==
0
then
return
e
:
IsCostChecked
()
and
#
g
>
0
and
Duel
.
CheckReleaseGroup
(
tp
,
s
.
costfilter
,
1
,
c
,
g
,
tp
)
end
local
rg
=
Duel
.
SelectReleaseGroup
(
tp
,
s
.
costfilter
,
1
,
1
,
c
,
g
,
tp
)
Duel
.
Release
(
rg
,
REASON_COST
)
Duel
.
RegisterFlagEffect
(
tp
,
id
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
local
tg
=
g
:
Clone
()
if
#
g
>
1
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
...
...
c72971064.lua
View file @
5b4f5576
...
...
@@ -15,7 +15,7 @@ function c72971064.initial_effect(c)
e2
:
SetDescription
(
aux
.
Stringid
(
72971064
,
0
))
e2
:
SetCategory
(
CATEGORY_TOHAND
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_
SPSUMMON_SUCCESS
)
e2
:
SetCode
(
EVENT_
CUSTOM
+
72971064
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e2
:
SetCondition
(
c72971064
.
thcon
)
...
...
@@ -23,6 +23,7 @@ function c72971064.initial_effect(c)
e2
:
SetTarget
(
c72971064
.
thtg
)
e2
:
SetOperation
(
c72971064
.
thop
)
c
:
RegisterEffect
(
e2
)
aux
.
RegisterMergedDelayedEvent
(
c
,
72971064
,
EVENT_SPSUMMON_SUCCESS
)
--recover
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
72971064
,
1
))
...
...
utility.lua
View file @
5b4f5576
...
...
@@ -3022,3 +3022,41 @@ function Auxiliary.PlaceCardsOnDeckBottom(p,g,reason)
end
return
#
og
end
--The event is triggered multiple times in a chain
--but only 1 event with EVENT_CUSTOM+code will be triggered at EVENT_CHAIN_END, or immediately if not in chain
--NOTE: re,r,rp,ep,ev of that custom event ARE NOT releated to the real event that trigger this custom event
function
Auxiliary
.
RegisterMergedDelayedEvent
(
c
,
code
,
event
,
g
)
local
mt
=
getmetatable
(
c
)
if
mt
[
event
]
==
true
then
return
end
mt
[
event
]
=
true
if
not
g
then
g
=
Group
.
CreateGroup
()
end
g
:
KeepAlive
()
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
event
)
ge1
:
SetLabel
(
code
)
ge1
:
SetLabelObject
(
g
)
ge1
:
SetOperation
(
Auxiliary
.
MergedDelayEventCheck1
)
Duel
.
RegisterEffect
(
ge1
,
0
)
local
ge2
=
ge1
:
Clone
()
ge2
:
SetCode
(
EVENT_CHAIN_END
)
ge2
:
SetOperation
(
Auxiliary
.
MergedDelayEventCheck2
)
Duel
.
RegisterEffect
(
ge2
,
0
)
end
function
Auxiliary
.
MergedDelayEventCheck1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
e
:
GetLabelObject
()
g
:
Merge
(
eg
)
if
Duel
.
GetCurrentChain
()
==
0
and
not
Duel
.
CheckEvent
(
EVENT_CHAIN_END
)
then
local
_eg
=
g
:
Clone
()
Duel
.
RaiseEvent
(
_eg
,
EVENT_CUSTOM
+
e
:
GetLabel
(),
re
,
r
,
rp
,
ep
,
ev
)
g
:
Clear
()
end
end
function
Auxiliary
.
MergedDelayEventCheck2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
e
:
GetLabelObject
()
if
#
g
>
0
then
local
_eg
=
g
:
Clone
()
Duel
.
RaiseEvent
(
_eg
,
EVENT_CUSTOM
+
e
:
GetLabel
(),
re
,
r
,
rp
,
ep
,
ev
)
g
:
Clear
()
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