Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-scripts
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
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
Commits
409d71b4
Commit
409d71b4
authored
Mar 18, 2016
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update ritual proc
parent
7154552c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
18 deletions
+81
-18
utility.lua
utility.lua
+81
-18
No files found.
utility.lua
View file @
409d71b4
...
@@ -1235,16 +1235,27 @@ function Auxiliary.AddRitualProcGreater(c,filter)
...
@@ -1235,16 +1235,27 @@ function Auxiliary.AddRitualProcGreater(c,filter)
e1
:
SetOperation
(
Auxiliary
.
RPGOperation
(
filter
))
e1
:
SetOperation
(
Auxiliary
.
RPGOperation
(
filter
))
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
end
end
function
Auxiliary
.
RPGFilter
(
c
,
filter
,
e
,
tp
,
m
)
function
Auxiliary
.
RPGFilter
(
c
,
filter
,
e
,
tp
,
m
,
ft
)
if
(
filter
and
not
filter
(
c
))
or
not
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_RITUAL
,
tp
,
false
,
true
)
then
return
false
end
if
(
filter
and
not
filter
(
c
))
or
not
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_RITUAL
,
tp
,
false
,
true
)
then
return
false
end
local
mg
=
m
:
Filter
(
Card
.
IsCanBeRitualMaterial
,
c
,
c
)
local
mg
=
m
:
Filter
(
Card
.
IsCanBeRitualMaterial
,
c
,
c
)
return
mg
:
CheckWithSumGreater
(
Card
.
GetRitualLevel
,
c
:
GetOriginalLevel
(),
c
)
if
ft
>
0
then
return
mg
:
CheckWithSumGreater
(
Card
.
GetRitualLevel
,
c
:
GetOriginalLevel
(),
c
)
else
return
mg
:
IsExists
(
Auxiliary
.
RPGFilterF
,
1
,
nil
,
tp
,
mg
,
c
)
end
end
function
Auxiliary
.
RPGFilterF
(
c
,
tp
,
mg
,
rc
)
if
c
:
IsControler
(
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
then
Duel
.
SetSelectedCard
(
c
)
return
mg
:
CheckWithSumGreater
(
Card
.
GetRitualLevel
,
rc
:
GetOriginalLevel
(),
rc
)
else
return
false
end
end
end
function
Auxiliary
.
RPGTarget
(
filter
)
function
Auxiliary
.
RPGTarget
(
filter
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
chk
==
0
then
local
mg
=
Duel
.
GetRitualMaterial
(
tp
)
local
mg
=
Duel
.
GetRitualMaterial
(
tp
)
return
Duel
.
IsExistingMatchingCard
(
Auxiliary
.
RPGFilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
filter
,
e
,
tp
,
mg
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
return
ft
>-
1
and
Duel
.
IsExistingMatchingCard
(
Auxiliary
.
RPGFilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
filter
,
e
,
tp
,
mg
,
ft
)
end
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
)
end
end
...
@@ -1252,13 +1263,23 @@ end
...
@@ -1252,13 +1263,23 @@ end
function
Auxiliary
.
RPGOperation
(
filter
)
function
Auxiliary
.
RPGOperation
(
filter
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
mg
=
Duel
.
GetRitualMaterial
(
tp
)
local
mg
=
Duel
.
GetRitualMaterial
(
tp
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
Auxiliary
.
RPGFilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
filter
,
e
,
tp
,
mg
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
Auxiliary
.
RPGFilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
filter
,
e
,
tp
,
mg
,
ft
)
local
tc
=
tg
:
GetFirst
()
local
tc
=
tg
:
GetFirst
()
if
tc
then
if
tc
then
mg
=
mg
:
Filter
(
Card
.
IsCanBeRitualMaterial
,
tc
,
tc
)
mg
=
mg
:
Filter
(
Card
.
IsCanBeRitualMaterial
,
tc
,
tc
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
local
mat
=
nil
local
mat
=
mg
:
SelectWithSumGreater
(
tp
,
Card
.
GetRitualLevel
,
tc
:
GetOriginalLevel
(),
tc
)
if
ft
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
mat
=
mg
:
SelectWithSumGreater
(
tp
,
Card
.
GetRitualLevel
,
tc
:
GetOriginalLevel
(),
tc
)
else
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
mat
=
mg
:
FilterSelect
(
tp
,
Auxiliary
.
RPGFilterF
,
1
,
1
,
nil
,
tp
,
mg
,
tc
)
Duel
.
SetSelectedCard
(
mat
)
local
mat2
=
mg
:
SelectWithSumGreater
(
tp
,
Card
.
GetRitualLevel
,
tc
:
GetOriginalLevel
(),
tc
)
mat
:
Merge
(
mat2
)
end
tc
:
SetMaterial
(
mat
)
tc
:
SetMaterial
(
mat
)
Duel
.
ReleaseRitualMaterial
(
mat
)
Duel
.
ReleaseRitualMaterial
(
mat
)
Duel
.
BreakEffect
()
Duel
.
BreakEffect
()
...
@@ -1285,16 +1306,27 @@ function Auxiliary.AddRitualProcEqual(c,filter)
...
@@ -1285,16 +1306,27 @@ function Auxiliary.AddRitualProcEqual(c,filter)
e1
:
SetOperation
(
Auxiliary
.
RPEOperation
(
filter
))
e1
:
SetOperation
(
Auxiliary
.
RPEOperation
(
filter
))
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
end
end
function
Auxiliary
.
RPEFilter
(
c
,
filter
,
e
,
tp
,
m
)
function
Auxiliary
.
RPEFilter
(
c
,
filter
,
e
,
tp
,
m
,
ft
)
if
(
filter
and
not
filter
(
c
))
or
not
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_RITUAL
,
tp
,
false
,
true
)
then
return
false
end
if
(
filter
and
not
filter
(
c
))
or
not
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_RITUAL
,
tp
,
false
,
true
)
then
return
false
end
local
mg
=
m
:
Filter
(
Card
.
IsCanBeRitualMaterial
,
c
,
c
)
local
mg
=
m
:
Filter
(
Card
.
IsCanBeRitualMaterial
,
c
,
c
)
return
mg
:
CheckWithSumEqual
(
Card
.
GetRitualLevel
,
c
:
GetOriginalLevel
(),
1
,
99
,
c
)
if
ft
>
0
then
return
mg
:
CheckWithSumEqual
(
Card
.
GetRitualLevel
,
c
:
GetOriginalLevel
(),
1
,
99
,
c
)
else
return
mg
:
IsExists
(
Auxiliary
.
RPEFilterF
,
1
,
nil
,
tp
,
mg
,
c
)
end
end
function
Auxiliary
.
RPEFilterF
(
c
,
tp
,
mg
,
rc
)
if
c
:
IsControler
(
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
then
Duel
.
SetSelectedCard
(
c
)
return
mg
:
CheckWithSumEqual
(
Card
.
GetRitualLevel
,
rc
:
GetOriginalLevel
(),
0
,
99
,
rc
)
else
return
false
end
end
end
function
Auxiliary
.
RPETarget
(
filter
)
function
Auxiliary
.
RPETarget
(
filter
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
chk
==
0
then
local
mg
=
Duel
.
GetRitualMaterial
(
tp
)
local
mg
=
Duel
.
GetRitualMaterial
(
tp
)
return
Duel
.
IsExistingMatchingCard
(
Auxiliary
.
RPEFilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
filter
,
e
,
tp
,
mg
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
return
ft
>-
1
and
Duel
.
IsExistingMatchingCard
(
Auxiliary
.
RPEFilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
filter
,
e
,
tp
,
mg
,
ft
)
end
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
)
end
end
...
@@ -1302,13 +1334,23 @@ end
...
@@ -1302,13 +1334,23 @@ end
function
Auxiliary
.
RPEOperation
(
filter
)
function
Auxiliary
.
RPEOperation
(
filter
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
mg
=
Duel
.
GetRitualMaterial
(
tp
)
local
mg
=
Duel
.
GetRitualMaterial
(
tp
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
Auxiliary
.
RPEFilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
filter
,
e
,
tp
,
mg
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
Auxiliary
.
RPEFilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
filter
,
e
,
tp
,
mg
,
ft
)
local
tc
=
tg
:
GetFirst
()
local
tc
=
tg
:
GetFirst
()
if
tc
then
if
tc
then
mg
=
mg
:
Filter
(
Card
.
IsCanBeRitualMaterial
,
tc
,
tc
)
mg
=
mg
:
Filter
(
Card
.
IsCanBeRitualMaterial
,
tc
,
tc
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
local
mat
=
nil
local
mat
=
mg
:
SelectWithSumEqual
(
tp
,
Card
.
GetRitualLevel
,
tc
:
GetOriginalLevel
(),
1
,
99
,
tc
)
if
ft
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
mat
=
mg
:
SelectWithSumEqual
(
tp
,
Card
.
GetRitualLevel
,
tc
:
GetOriginalLevel
(),
1
,
99
,
tc
)
else
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
mat
=
mg
:
FilterSelect
(
tp
,
Auxiliary
.
RPEFilterF
,
1
,
1
,
nil
,
tp
,
mg
,
tc
)
Duel
.
SetSelectedCard
(
mat
)
local
mat2
=
mg
:
SelectWithSumEqual
(
tp
,
Card
.
GetRitualLevel
,
tc
:
GetOriginalLevel
(),
0
,
99
,
tc
)
mat
:
Merge
(
mat2
)
end
tc
:
SetMaterial
(
mat
)
tc
:
SetMaterial
(
mat
)
Duel
.
ReleaseRitualMaterial
(
mat
)
Duel
.
ReleaseRitualMaterial
(
mat
)
Duel
.
BreakEffect
()
Duel
.
BreakEffect
()
...
@@ -1335,16 +1377,27 @@ function Auxiliary.AddRitualProcEqual2(c,filter)
...
@@ -1335,16 +1377,27 @@ function Auxiliary.AddRitualProcEqual2(c,filter)
e1
:
SetOperation
(
Auxiliary
.
RPEOperation2
(
filter
))
e1
:
SetOperation
(
Auxiliary
.
RPEOperation2
(
filter
))
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
end
end
function
Auxiliary
.
RPEFilter2
(
c
,
filter
,
e
,
tp
,
m
)
function
Auxiliary
.
RPEFilter2
(
c
,
filter
,
e
,
tp
,
m
,
ft
)
if
(
filter
and
not
filter
(
c
))
or
not
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_RITUAL
,
tp
,
false
,
true
)
then
return
false
end
if
(
filter
and
not
filter
(
c
))
or
not
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_RITUAL
,
tp
,
false
,
true
)
then
return
false
end
local
mg
=
m
:
Filter
(
Card
.
IsCanBeRitualMaterial
,
c
,
c
)
local
mg
=
m
:
Filter
(
Card
.
IsCanBeRitualMaterial
,
c
,
c
)
return
mg
:
CheckWithSumEqual
(
Card
.
GetRitualLevel
,
c
:
GetLevel
(),
1
,
99
,
c
)
if
ft
>
0
then
return
mg
:
CheckWithSumEqual
(
Card
.
GetRitualLevel
,
c
:
GetLevel
(),
1
,
99
,
c
)
else
return
mg
:
IsExists
(
Auxiliary
.
RPEFilter2F
,
1
,
nil
,
tp
,
mg
,
c
)
end
end
function
Auxiliary
.
RPEFilter2F
(
c
,
tp
,
mg
,
rc
)
if
c
:
IsControler
(
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
then
Duel
.
SetSelectedCard
(
c
)
return
mg
:
CheckWithSumEqual
(
Card
.
GetRitualLevel
,
rc
:
GetLevel
(),
0
,
99
,
rc
)
else
return
false
end
end
end
function
Auxiliary
.
RPETarget2
(
filter
)
function
Auxiliary
.
RPETarget2
(
filter
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
chk
==
0
then
local
mg
=
Duel
.
GetRitualMaterial
(
tp
)
local
mg
=
Duel
.
GetRitualMaterial
(
tp
)
return
Duel
.
IsExistingMatchingCard
(
Auxiliary
.
RPEFilter2
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
filter
,
e
,
tp
,
mg
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
return
ft
>-
1
and
Duel
.
IsExistingMatchingCard
(
Auxiliary
.
RPEFilter2
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
filter
,
e
,
tp
,
mg
,
ft
)
end
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
)
end
end
...
@@ -1352,13 +1405,23 @@ end
...
@@ -1352,13 +1405,23 @@ end
function
Auxiliary
.
RPEOperation2
(
filter
)
function
Auxiliary
.
RPEOperation2
(
filter
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
mg
=
Duel
.
GetRitualMaterial
(
tp
)
local
mg
=
Duel
.
GetRitualMaterial
(
tp
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
Auxiliary
.
RPEFilter2
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
filter
,
e
,
tp
,
mg
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
Auxiliary
.
RPEFilter2
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
filter
,
e
,
tp
,
mg
,
ft
)
local
tc
=
tg
:
GetFirst
()
local
tc
=
tg
:
GetFirst
()
if
tc
then
if
tc
then
mg
=
mg
:
Filter
(
Card
.
IsCanBeRitualMaterial
,
tc
,
tc
)
mg
=
mg
:
Filter
(
Card
.
IsCanBeRitualMaterial
,
tc
,
tc
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
local
mat
=
nil
local
mat
=
mg
:
SelectWithSumEqual
(
tp
,
Card
.
GetRitualLevel
,
tc
:
GetLevel
(),
1
,
99
,
tc
)
if
ft
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
mat
=
mg
:
SelectWithSumEqual
(
tp
,
Card
.
GetRitualLevel
,
tc
:
GetLevel
(),
1
,
99
,
tc
)
else
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
mat
=
mg
:
FilterSelect
(
tp
,
Auxiliary
.
RPEFilter2F
,
1
,
1
,
nil
,
tp
,
mg
,
tc
)
Duel
.
SetSelectedCard
(
mat
)
local
mat2
=
mg
:
SelectWithSumEqual
(
tp
,
Card
.
GetRitualLevel
,
tc
:
GetLevel
(),
0
,
99
,
tc
)
mat
:
Merge
(
mat2
)
end
tc
:
SetMaterial
(
mat
)
tc
:
SetMaterial
(
mat
)
Duel
.
ReleaseRitualMaterial
(
mat
)
Duel
.
ReleaseRitualMaterial
(
mat
)
Duel
.
BreakEffect
()
Duel
.
BreakEffect
()
...
...
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