Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
no81cards
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
Nemo Ma
no81cards
Commits
5d1c4f8e
Commit
5d1c4f8e
authored
Sep 11, 2024
by
Nemo Ma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update glitchylib_regeff.lua
parent
9aa154b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
98 additions
and
78 deletions
+98
-78
expansions/script/glitchylib_regeff.lua
expansions/script/glitchylib_regeff.lua
+98
-78
No files found.
expansions/script/glitchylib_regeff.lua
View file @
5d1c4f8e
...
@@ -71,7 +71,7 @@ function Auxiliary.CheckAlreadyRegisteredEffects()
...
@@ -71,7 +71,7 @@ function Auxiliary.CheckAlreadyRegisteredEffects()
e1
:
SetCode
(
EVENT_PREDRAW
)
e1
:
SetCode
(
EVENT_PREDRAW
)
e1
:
OPT
()
e1
:
OPT
()
e1
:
SetOperation
(
function
(
e
)
e1
:
SetOperation
(
function
(
e
)
local
g
=
Duel
.
Group
(
function
(
c
)
return
not
c
:
IsOriginalType
(
TYPE_NORMAL
)
end
,
0
,
LOCATION_ALL
,
LOCATION_ALL
,
nil
)
local
g
=
Duel
.
Group
(
function
(
c
)
return
not
c
:
IsOriginalType
(
TYPE_NORMAL
)
end
,
0
,
LOCATION_ALL
,
0
,
nil
)
for
tc
in
aux
.
Next
(
g
)
do
for
tc
in
aux
.
Next
(
g
)
do
if
not
global_card_effect_table
[
tc
]
then
if
not
global_card_effect_table
[
tc
]
then
local
code
=
tc
:
GetOriginalCode
()
local
code
=
tc
:
GetOriginalCode
()
...
@@ -115,7 +115,12 @@ if not global_card_effect_table_global_check then
...
@@ -115,7 +115,12 @@ if not global_card_effect_table_global_check then
if
not
global_card_effect_table
[
self
]
then
global_card_effect_table
[
self
]
=
{}
end
if
not
global_card_effect_table
[
self
]
then
global_card_effect_table
[
self
]
=
{}
end
table.insert
(
global_card_effect_table
[
self
],
e
)
table.insert
(
global_card_effect_table
[
self
],
e
)
local
code
=
e
:
GetCode
()
local
typ
,
code
=
e
:
GetType
(),
e
:
GetCode
()
local
IsSingleOrField
=
typ
==
EFFECT_TYPE_SINGLE
or
typ
==
EFFECT_TYPE_FIELD
local
IsInherentSummonProc
=
code
==
EFFECT_SPSUMMON_PROC
or
code
==
EFFECT_SPSUMMON_PROC_G
local
IsHasExceptionType
=
typ
==
EFFECT_TYPE_XMATERIAL
or
typ
==
EFFECT_TYPE_XMATERIAL
+
EFFECT_TYPE_FIELD
or
typ
&
EFFECT_TYPE_GRANT
~=
0
local
selfp
,
oppo
=
e
:
GLGetTargetRange
()
local
selfp
,
oppo
=
e
:
GLGetTargetRange
()
local
condition
,
cost
,
tg
,
op
,
val
=
e
:
GetCondition
(),
e
:
GetCost
(),
e
:
GetTarget
(),
e
:
GetOperation
(),
e
:
GetValue
()
local
condition
,
cost
,
tg
,
op
,
val
=
e
:
GetCondition
(),
e
:
GetCost
(),
e
:
GetTarget
(),
e
:
GetOperation
(),
e
:
GetValue
()
...
@@ -183,71 +188,75 @@ if not global_card_effect_table_global_check then
...
@@ -183,71 +188,75 @@ if not global_card_effect_table_global_check then
end
end
--Define self_reference_effect
--Define self_reference_effect
if
condition
and
((
e
:
GetCode
()
==
EFFECT_SPSUMMON_PROC
or
e
:
GetCode
()
==
EFFECT_SPSUMMON_PROC_G
)
or
not
(
e
:
GetType
()
==
EFFECT_TYPE_FIELD
or
e
:
GetType
()
==
EFFECT_TYPE_SINGLE
or
e
:
GetType
()
==
EFFECT_TYPE_XMATERIAL
or
e
:
GetType
()
==
EFFECT_TYPE_XMATERIAL
+
EFFECT_TYPE_FIELD
or
e
:
GetType
()
&
EFFECT_TYPE_GRANT
~=
0
))
then
if
condition
and
not
IsHasExceptionType
then
local
newcon
=
function
(
...
)
local
newcon
=
function
(
...
)
self_reference_effect
=
e
local
x
=
{
...
}
local
previous_sre
=
self_reference_effect
self_reference_effect
=
x
[
1
]
local
x
=
{
...
}
local
x
=
{
...
}
if
type
(
x
[
2
])
==
"number"
and
(
x
[
2
]
==
0
or
x
[
2
]
==
1
)
then
if
type
(
x
[
2
])
==
"number"
and
(
x
[
2
]
==
0
or
x
[
2
]
==
1
)
then
self_reference_tp
=
x
[
2
]
self_reference_tp
=
x
[
2
]
end
end
return
condition
(
...
)
local
res
=
condition
(
table.unpack
(
x
))
self_reference_effect
=
previous_sre
return
res
end
end
e
:
SetCondition
(
newcon
)
e
:
SetCondition
(
newcon
)
end
end
if
cost
and
not
(
e
:
GetType
()
==
EFFECT_TYPE_FIELD
or
e
:
GetType
()
==
EFFECT_TYPE_SINGLE
or
e
:
GetType
()
==
EFFECT_TYPE_XMATERIAL
or
e
:
GetType
()
==
EFFECT_TYPE_XMATERIAL
+
EFFECT_TYPE_FIELD
or
e
:
GetType
()
&
EFFECT_TYPE_GRANT
~=
0
)
then
if
cost
and
not
IsHasExceptionType
then
local
newcost
=
function
(
...
)
local
newcost
=
function
(
...
)
self_reference_effect
=
e
local
x
=
{
...
}
local
x
=
{
...
}
local
previous_sre
=
self_reference_effect
self_reference_effect
=
x
[
1
]
if
#
x
>
1
and
type
(
x
[
2
])
==
"number"
and
(
x
[
2
]
==
0
or
x
[
2
]
==
1
)
then
if
#
x
>
1
and
type
(
x
[
2
])
==
"number"
and
(
x
[
2
]
==
0
or
x
[
2
]
==
1
)
then
self_reference_tp
=
x
[
2
]
self_reference_tp
=
x
[
2
]
end
end
return
cost
(
...
)
local
res
=
cost
(
table.unpack
(
x
))
self_reference_effect
=
previous_sre
return
res
end
end
e
:
SetCost
(
newcost
)
e
:
SetCost
(
newcost
)
end
end
if
tg
then
if
tg
and
not
IsHasExceptionType
then
if
e
:
GetCode
()
==
EFFECT_SPSUMMON_PROC
or
e
:
GetCode
()
==
EFFECT_SPSUMMON_PROC_G
then
local
newtg
=
function
(
...
)
local
newtg
=
function
(
...
)
local
x
=
{
...
}
self_reference_effect
=
e
local
previous_sre
=
self_reference_effect
local
x
=
{
...
}
self_reference_effect
=
x
[
1
]
if
#
x
>
1
and
type
(
x
[
2
])
==
"number"
and
(
x
[
2
]
==
0
or
x
[
2
]
==
1
)
then
if
#
x
>
1
and
type
(
x
[
2
])
==
"number"
and
(
x
[
2
]
==
0
or
x
[
2
]
==
1
)
then
self_reference_tp
=
x
[
2
]
self_reference_tp
=
x
[
2
]
end
return
tg
(
...
)
end
e
:
SetTarget
(
newtg
)
elseif
not
(
e
:
GetType
()
==
EFFECT_TYPE_FIELD
or
e
:
GetType
()
==
EFFECT_TYPE_SINGLE
or
e
:
GetType
()
==
EFFECT_TYPE_XMATERIAL
or
e
:
GetType
()
==
EFFECT_TYPE_XMATERIAL
+
EFFECT_TYPE_FIELD
or
e
:
GetType
()
&
EFFECT_TYPE_GRANT
~=
0
)
then
local
newtg
=
function
(
...
)
self_reference_effect
=
e
local
x
=
{
...
}
if
#
x
>
1
and
type
(
x
[
2
])
==
"number"
and
(
x
[
2
]
==
0
or
x
[
2
]
==
1
)
then
self_reference_tp
=
x
[
2
]
end
return
tg
(
...
)
end
end
e
:
SetTarget
(
newtg
)
local
res
=
tg
(
table.unpack
(
x
))
end
self_reference_effect
=
previous_sre
return
res
end
e
:
SetTarget
(
newtg
)
end
end
if
op
and
((
e
:
GetCode
()
==
EFFECT_SPSUMMON_PROC
or
e
:
GetCode
()
==
EFFECT_SPSUMMON_PROC_G
)
or
not
(
e
:
GetType
()
==
EFFECT_TYPE_FIELD
or
e
:
GetType
()
==
EFFECT_TYPE_SINGLE
or
e
:
GetType
()
==
EFFECT_TYPE_XMATERIAL
or
e
:
GetType
()
==
EFFECT_TYPE_XMATERIAL
+
EFFECT_TYPE_FIELD
or
e
:
GetType
()
&
EFFECT_TYPE_GRANT
~=
0
))
then
if
op
and
not
IsHasExceptionType
then
local
newop
=
function
(
...
)
local
newop
=
function
(
...
)
self_reference_effect
=
e
local
x
=
{
...
}
local
x
=
{
...
}
local
previous_sre
=
self_reference_effect
self_reference_effect
=
x
[
1
]
if
#
x
>
1
and
type
(
x
[
2
])
==
"number"
and
(
x
[
2
]
==
0
or
x
[
2
]
==
1
)
then
if
#
x
>
1
and
type
(
x
[
2
])
==
"number"
and
(
x
[
2
]
==
0
or
x
[
2
]
==
1
)
then
self_reference_tp
=
x
[
2
]
self_reference_tp
=
x
[
2
]
end
end
return
op
(
...
)
local
res
=
op
(
table.unpack
(
x
))
self_reference_effect
=
previous_sre
return
res
end
end
e
:
SetOperation
(
newop
)
e
:
SetOperation
(
newop
)
end
end
if
val
then
if
val
and
type
(
val
)
==
"function"
and
not
IsHasExceptionType
then
if
type
(
val
)
==
"function"
and
((
e
:
GetCode
()
==
EFFECT_SPSUMMON_PROC
or
e
:
GetCode
()
==
EFFECT_SPSUMMON_PROC_G
)
or
not
(
e
:
GetType
()
==
EFFECT_TYPE_FIELD
or
e
:
GetType
()
==
EFFECT_TYPE_SINGLE
or
e
:
GetType
()
==
EFFECT_TYPE_XMATERIAL
or
e
:
GetType
()
==
EFFECT_TYPE_XMATERIAL
+
EFFECT_TYPE_FIELD
or
e
:
GetType
()
&
EFFECT_TYPE_GRANT
~=
0
))
then
local
newval
=
function
(
...
)
local
newval
=
function
(
...
)
local
x
=
{
...
}
self_reference_effect
=
e
local
previous_sre
=
self_reference_effect
return
val
(
...
)
if
aux
.
GetValueType
(
x
[
1
])
==
"Effect"
then
self_reference_effect
=
x
[
1
]
end
end
e
:
SetValue
(
newval
)
local
res
=
val
(
...
)
self_reference_effect
=
previous_sre
end
return
res
end
e
:
SetValue
(
newval
)
end
end
if
aux
.
PreventSecondRegistration
then
return
end
if
aux
.
PreventSecondRegistration
then
return
end
return
self
.
register_global_card_effect_table
(
self
,
e
,
forced
)
return
self
.
register_global_card_effect_table
(
self
,
e
,
forced
)
...
@@ -264,7 +273,12 @@ if not global_duel_effect_table_global_check then
...
@@ -264,7 +273,12 @@ if not global_duel_effect_table_global_check then
if
not
global_duel_effect_table
[
tp
]
then
global_duel_effect_table
[
tp
]
=
{}
end
if
not
global_duel_effect_table
[
tp
]
then
global_duel_effect_table
[
tp
]
=
{}
end
table.insert
(
global_duel_effect_table
[
tp
],
e
)
table.insert
(
global_duel_effect_table
[
tp
],
e
)
local
code
=
e
:
GetCode
()
local
typ
,
code
=
e
:
GetType
(),
e
:
GetCode
()
local
IsSingleOrField
=
typ
==
EFFECT_TYPE_SINGLE
or
typ
==
EFFECT_TYPE_FIELD
local
IsInherentSummonProc
=
code
==
EFFECT_SPSUMMON_PROC
or
code
==
EFFECT_SPSUMMON_PROC_G
local
IsHasExceptionType
=
typ
==
EFFECT_TYPE_XMATERIAL
or
typ
==
EFFECT_TYPE_XMATERIAL
+
EFFECT_TYPE_FIELD
or
typ
&
EFFECT_TYPE_GRANT
~=
0
local
condition
,
cost
,
tg
,
op
,
val
=
e
:
GetCondition
(),
e
:
GetCost
(),
e
:
GetTarget
(),
e
:
GetOperation
(),
e
:
GetValue
()
local
condition
,
cost
,
tg
,
op
,
val
=
e
:
GetCondition
(),
e
:
GetCost
(),
e
:
GetTarget
(),
e
:
GetOperation
(),
e
:
GetValue
()
--Damage Replacement Effects
--Damage Replacement Effects
...
@@ -297,71 +311,77 @@ if not global_duel_effect_table_global_check then
...
@@ -297,71 +311,77 @@ if not global_duel_effect_table_global_check then
end
end
--Define self_reference_effect
--Define self_reference_effect
if
condition
and
((
e
:
GetCode
()
==
EFFECT_SPSUMMON_PROC
or
e
:
GetCode
()
==
EFFECT_SPSUMMON_PROC_G
)
or
not
(
e
:
GetType
()
==
EFFECT_TYPE_FIELD
or
e
:
GetType
()
==
EFFECT_TYPE_SINGLE
or
e
:
GetType
()
&
EFFECT_TYPE_GRANT
~=
0
))
then
if
condition
and
not
IsHasExceptionType
then
local
newcon
=
function
(
...
)
local
newcon
=
function
(
...
)
self_reference_effect
=
e
local
x
=
{
...
}
local
x
=
{
...
}
local
previous_sre
=
self_reference_effect
self_reference_effect
=
x
[
1
]
if
#
x
>
1
and
type
(
x
[
2
])
==
"number"
and
(
x
[
2
]
==
0
or
x
[
2
]
==
1
)
then
if
#
x
>
1
and
type
(
x
[
2
])
==
"number"
and
(
x
[
2
]
==
0
or
x
[
2
]
==
1
)
then
self_reference_tp
=
x
[
2
]
self_reference_tp
=
x
[
2
]
end
end
return
condition
(
...
)
local
res
=
condition
(
table.unpack
(
x
))
self_reference_effect
=
previous_sre
return
res
end
end
e
:
SetCondition
(
newcon
)
e
:
SetCondition
(
newcon
)
end
end
if
cost
and
((
e
:
GetCode
()
==
EFFECT_SPSUMMON_PROC
or
e
:
GetCode
()
==
EFFECT_SPSUMMON_PROC_G
)
or
not
(
e
:
GetType
()
==
EFFECT_TYPE_FIELD
or
e
:
GetType
()
==
EFFECT_TYPE_SINGLE
or
e
:
GetType
()
&
EFFECT_TYPE_GRANT
~=
0
))
then
if
cost
and
not
IsHasExceptionType
then
local
newcost
=
function
(
...
)
local
newcost
=
function
(
...
)
self_reference_effect
=
e
local
x
=
{
...
}
local
x
=
{
...
}
local
previous_sre
=
self_reference_effect
self_reference_effect
=
x
[
1
]
if
#
x
>
1
and
type
(
x
[
2
])
==
"number"
and
(
x
[
2
]
==
0
or
x
[
2
]
==
1
)
then
if
#
x
>
1
and
type
(
x
[
2
])
==
"number"
and
(
x
[
2
]
==
0
or
x
[
2
]
==
1
)
then
self_reference_tp
=
x
[
2
]
self_reference_tp
=
x
[
2
]
end
end
return
cost
(
...
)
local
res
=
cost
(
table.unpack
(
x
))
self_reference_effect
=
previous_sre
return
res
end
end
e
:
SetCost
(
newcost
)
e
:
SetCost
(
newcost
)
end
end
if
tg
then
if
tg
and
not
IsHasExceptionType
then
if
e
:
GetCode
()
==
EFFECT_SPSUMMON_PROC
or
e
:
GetCode
()
==
EFFECT_SPSUMMON_PROC_G
then
local
newtg
=
function
(
...
)
local
newtg
=
function
(
...
)
local
x
=
{
...
}
self_reference_effect
=
e
local
previous_sre
=
self_reference_effect
local
x
=
{
...
}
self_reference_effect
=
x
[
1
]
if
#
x
>
1
and
type
(
x
[
2
])
==
"number"
and
(
x
[
2
]
==
0
or
x
[
2
]
==
1
)
then
local
x
=
{
...
}
self_reference_tp
=
x
[
2
]
if
#
x
>
1
and
type
(
x
[
2
])
==
"number"
and
(
x
[
2
]
==
0
or
x
[
2
]
==
1
)
then
end
self_reference_tp
=
x
[
2
]
return
tg
(
...
)
end
e
:
SetTarget
(
newtg
)
elseif
not
(
e
:
GetType
()
==
EFFECT_TYPE_FIELD
or
e
:
GetType
()
==
EFFECT_TYPE_SINGLE
or
e
:
GetType
()
&
EFFECT_TYPE_GRANT
~=
0
)
then
local
newtg
=
function
(
...
)
self_reference_effect
=
e
local
x
=
{
...
}
if
#
x
>
1
and
type
(
x
[
2
])
==
"number"
and
(
x
[
2
]
==
0
or
x
[
2
]
==
1
)
then
self_reference_tp
=
x
[
2
]
end
return
tg
(
...
)
end
end
e
:
SetTarget
(
newtg
)
local
res
=
tg
(
table.unpack
(
x
))
end
self_reference_effect
=
previous_sre
return
res
end
e
:
SetTarget
(
newtg
)
end
end
if
op
and
((
e
:
GetCode
()
==
EFFECT_SPSUMMON_PROC
or
e
:
GetCode
()
==
EFFECT_SPSUMMON_PROC_G
)
or
not
(
e
:
GetType
()
==
EFFECT_TYPE_FIELD
or
e
:
GetType
()
==
EFFECT_TYPE_SINGLE
or
e
:
GetType
()
&
EFFECT_TYPE_GRANT
~=
0
))
then
if
op
and
not
IsHasExceptionType
then
local
newop
=
function
(
...
)
local
newop
=
function
(
...
)
self_reference_effect
=
e
local
x
=
{
...
}
local
x
=
{
...
}
local
previous_sre
=
self_reference_effect
self_reference_effect
=
x
[
1
]
if
#
x
>
1
and
type
(
x
[
2
])
==
"number"
and
(
x
[
2
]
==
0
or
x
[
2
]
==
1
)
then
if
#
x
>
1
and
type
(
x
[
2
])
==
"number"
and
(
x
[
2
]
==
0
or
x
[
2
]
==
1
)
then
self_reference_tp
=
x
[
2
]
self_reference_tp
=
x
[
2
]
end
end
return
op
(
...
)
local
res
=
op
(
table.unpack
(
x
))
self_reference_effect
=
previous_sre
return
res
end
end
e
:
SetOperation
(
newop
)
e
:
SetOperation
(
newop
)
end
end
if
val
then
if
val
and
type
(
val
)
==
"function"
and
not
IsHasExceptionType
then
if
type
(
val
)
==
"function"
and
((
e
:
GetCode
()
==
EFFECT_SPSUMMON_PROC
or
e
:
GetCode
()
==
EFFECT_SPSUMMON_PROC_G
)
or
not
(
e
:
GetType
()
==
EFFECT_TYPE_FIELD
or
e
:
GetType
()
==
EFFECT_TYPE_SINGLE
or
e
:
GetType
()
&
EFFECT_TYPE_GRANT
~=
0
))
then
local
newval
=
function
(
...
)
local
newval
=
function
(
...
)
local
x
=
{
...
}
self_reference_effect
=
e
local
previous_sre
=
self_reference_effect
return
val
(
...
)
if
aux
.
GetValueType
(
x
[
1
])
==
"Effect"
then
self_reference_effect
=
x
[
1
]
end
end
e
:
SetValue
(
newval
)
local
res
=
val
(
...
)
self_reference_effect
=
previous_sre
return
res
end
e
:
SetValue
(
newval
)
end
end
end
if
aux
.
PreventSecondRegistration
then
return
end
if
aux
.
PreventSecondRegistration
then
return
end
return
Duel
.
register_global_duel_effect_table
(
e
,
tp
)
return
Duel
.
register_global_duel_effect_table
(
e
,
tp
)
...
...
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