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
4
Merge Requests
4
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
784936d4
Commit
784936d4
authored
Jan 08, 2024
by
Chen Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Auxiliary.SameValueCheck
parent
98714204
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
43 deletions
+52
-43
c41659072.lua
c41659072.lua
+1
-7
utility.lua
utility.lua
+51
-36
No files found.
c41659072.lua
View file @
784936d4
...
@@ -36,13 +36,7 @@ function c41659072.initial_effect(c)
...
@@ -36,13 +36,7 @@ function c41659072.initial_effect(c)
c
:
RegisterEffect
(
e3
)
c
:
RegisterEffect
(
e3
)
end
end
function
c41659072
.
syncheck
(
g
)
function
c41659072
.
syncheck
(
g
)
local
sg
=
g
:
Clone
()
return
aux
.
SameValueCheck
(
g
,
Card
.
GetAttribute
)
local
attr
=
ATTRIBUTE_ALL
for
c
in
aux
.
Next
(
sg
)
do
attr
=
attr
&
c
:
GetAttribute
()
if
attr
==
0
then
break
end
end
return
attr
~=
0
end
end
function
c41659072
.
sumlimit
(
e
,
se
,
sp
,
st
)
function
c41659072
.
sumlimit
(
e
,
se
,
sp
,
st
)
return
bit
.
band
(
st
,
SUMMON_TYPE_SYNCHRO
)
~=
SUMMON_TYPE_SYNCHRO
or
not
se
return
bit
.
band
(
st
,
SUMMON_TYPE_SYNCHRO
)
~=
SUMMON_TYPE_SYNCHRO
or
not
se
...
...
utility.lua
View file @
784936d4
...
@@ -334,40 +334,40 @@ function Auxiliary.EnableUnionAttribute(c,filter)
...
@@ -334,40 +334,40 @@ function Auxiliary.EnableUnionAttribute(c,filter)
c
:
RegisterEffect
(
e4
)
c
:
RegisterEffect
(
e4
)
end
end
function
Auxiliary
.
UnionEquipFilter
(
filter
)
function
Auxiliary
.
UnionEquipFilter
(
filter
)
return
function
(
c
,
tp
)
return
function
(
c
,
tp
)
local
ct1
,
ct2
=
c
:
GetUnionCount
()
local
ct1
,
ct2
=
c
:
GetUnionCount
()
return
c
:
IsFaceup
()
and
ct2
==
0
and
c
:
IsControler
(
tp
)
and
filter
(
c
)
return
c
:
IsFaceup
()
and
ct2
==
0
and
c
:
IsControler
(
tp
)
and
filter
(
c
)
end
end
end
end
function
Auxiliary
.
UnionEquipLimit
(
filter
)
function
Auxiliary
.
UnionEquipLimit
(
filter
)
return
function
(
e
,
c
)
return
function
(
e
,
c
)
return
(
c
:
IsControler
(
e
:
GetHandlerPlayer
())
and
filter
(
c
))
or
e
:
GetHandler
():
GetEquipTarget
()
==
c
return
(
c
:
IsControler
(
e
:
GetHandlerPlayer
())
and
filter
(
c
))
or
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
end
end
end
function
Auxiliary
.
UnionEquipTarget
(
equip_filter
)
function
Auxiliary
.
UnionEquipTarget
(
equip_filter
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
equip_filter
(
chkc
,
tp
)
end
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
equip_filter
(
chkc
,
tp
)
end
if
chk
==
0
then
return
c
:
GetFlagEffect
(
FLAG_ID_UNION
)
==
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
if
chk
==
0
then
return
c
:
GetFlagEffect
(
FLAG_ID_UNION
)
==
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
IsExistingTarget
(
equip_filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
c
,
tp
)
end
and
Duel
.
IsExistingTarget
(
equip_filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
c
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
local
g
=
Duel
.
SelectTarget
(
tp
,
equip_filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
c
,
tp
)
local
g
=
Duel
.
SelectTarget
(
tp
,
equip_filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
c
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
g
,
1
,
0
,
0
)
c
:
RegisterFlagEffect
(
FLAG_ID_UNION
,
RESET_EVENT
+
0x7e0000
+
RESET_PHASE
+
PHASE_END
,
0
,
1
)
c
:
RegisterFlagEffect
(
FLAG_ID_UNION
,
RESET_EVENT
+
0x7e0000
+
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
end
end
end
function
Auxiliary
.
UnionEquipOperation
(
equip_filter
)
function
Auxiliary
.
UnionEquipOperation
(
equip_filter
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
local
tc
=
Duel
.
GetFirstTarget
()
if
not
c
:
IsRelateToEffect
(
e
)
or
c
:
IsFacedown
()
then
return
end
if
not
c
:
IsRelateToEffect
(
e
)
or
c
:
IsFacedown
()
then
return
end
if
not
tc
:
IsRelateToEffect
(
e
)
or
not
equip_filter
(
tc
,
tp
)
then
if
not
tc
:
IsRelateToEffect
(
e
)
or
not
equip_filter
(
tc
,
tp
)
then
Duel
.
SendtoGrave
(
c
,
REASON_RULE
)
Duel
.
SendtoGrave
(
c
,
REASON_RULE
)
return
return
end
end
if
not
Duel
.
Equip
(
tp
,
c
,
tc
,
false
)
then
return
end
if
not
Duel
.
Equip
(
tp
,
c
,
tc
,
false
)
then
return
end
Auxiliary
.
SetUnionState
(
c
)
Auxiliary
.
SetUnionState
(
c
)
end
end
end
end
function
Auxiliary
.
UnionUnequipTarget
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
Auxiliary
.
UnionUnequipTarget
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
...
@@ -913,14 +913,14 @@ function Auxiliary.DrytronSpSummonTarget(e,tp,eg,ep,ev,re,r,rp,chk)
...
@@ -913,14 +913,14 @@ function Auxiliary.DrytronSpSummonTarget(e,tp,eg,ep,ev,re,r,rp,chk)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
end
function
Auxiliary
.
DrytronSpSummonOperation
(
func
)
function
Auxiliary
.
DrytronSpSummonOperation
(
func
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
if
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
true
,
POS_FACEUP_DEFENSE
)
~=
0
then
if
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
true
,
POS_FACEUP_DEFENSE
)
~=
0
then
c
:
CompleteProcedure
()
c
:
CompleteProcedure
()
func
(
e
,
tp
)
func
(
e
,
tp
)
end
end
end
end
end
end
---The `nolimit` parameter for Special Summon effects of Drytron cards
---The `nolimit` parameter for Special Summon effects of Drytron cards
---@param c Card
---@param c Card
...
@@ -1481,3 +1481,18 @@ end
...
@@ -1481,3 +1481,18 @@ end
function
Auxiliary
.
NegateSummonCondition
()
function
Auxiliary
.
NegateSummonCondition
()
return
Duel
.
GetReadyChain
()
==
0
return
Duel
.
GetReadyChain
()
==
0
end
end
--
function
Auxiliary
.
SameValueFilter
(
f
,
value
)
return
function
(
c
)
return
f
(
c
)
&
value
==
0
end
end
---Check if all cards in g have the same Attribute/Race
---@param g Group
---@param f function
---@return boolean
function
Auxiliary
.
SameValueCheck
(
g
,
f
)
local
tc
=
g
:
GetFirst
()
local
filter
=
Auxiliary
.
SameValueFilter
(
f
,
f
(
tc
))
return
not
g
:
IsExists
(
filter
,
1
,
tc
)
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