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
a0444f9d
Commit
a0444f9d
authored
Apr 23, 2023
by
mercury233
Committed by
GitHub
Apr 23, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Auxiliary.SelectFromOptions (#2076)
parent
52ca49bb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
57 deletions
+35
-57
c197042.lua
c197042.lua
+6
-19
c2511.lua
c2511.lua
+3
-12
c95113856.lua
c95113856.lua
+10
-26
utility.lua
utility.lua
+16
-0
No files found.
c197042.lua
View file @
a0444f9d
...
...
@@ -66,29 +66,16 @@ function c197042.activate(e,tp,eg,ep,ev,re,r,rp)
Duel
.
AdjustAll
()
local
b1
=
Duel
.
IsExistingMatchingCard
(
c197042
.
xyzfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
)
local
b2
=
Duel
.
GetFlagEffect
(
tp
,
197042
)
>
0
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
local
off
=
1
local
ops
=
{}
local
opval
=
{}
if
b1
then
ops
[
off
]
=
aux
.
Stringid
(
197042
,
0
)
opval
[
off
-
1
]
=
1
off
=
off
+
1
end
if
b2
then
ops
[
off
]
=
aux
.
Stringid
(
197042
,
1
)
opval
[
off
-
1
]
=
2
off
=
off
+
1
end
ops
[
off
]
=
aux
.
Stringid
(
197042
,
2
)
opval
[
off
-
1
]
=
3
off
=
off
+
1
local
op
=
Duel
.
SelectOption
(
tp
,
table.unpack
(
ops
))
if
opval
[
op
]
==
1
then
local
op
=
aux
.
SelectFromOptions
(
tp
,
{
b1
,
aux
.
Stringid
(
197042
,
0
)},
{
b2
,
aux
.
Stringid
(
197042
,
1
)},
{
true
,
aux
.
Stringid
(
197042
,
2
)})
if
op
==
1
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c197042
.
xyzfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
)
Duel
.
XyzSummon
(
tp
,
g
:
GetFirst
(),
nil
)
elseif
op
val
[
op
]
==
2
then
elseif
op
==
2
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
...
...
c2511.lua
View file @
a0444f9d
...
...
@@ -68,20 +68,11 @@ function c2511.tsop(e,tp,eg,ep,ev,re,r,rp)
if
not
aux
.
NecroValleyFilter
()(
c
)
then
return
end
local
b1
=
c
:
IsAbleToHand
()
local
b2
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
local
op
=
0
if
b1
and
not
b2
then
op
=
Duel
.
SelectOption
(
tp
,
1190
)
end
if
not
b1
and
b2
then
op
=
Duel
.
SelectOption
(
tp
,
1152
)
+
1
end
if
b1
and
b2
then
op
=
Duel
.
SelectOption
(
tp
,
1190
,
1152
)
end
if
op
==
0
then
local
op
=
aux
.
SelectFromOptions
(
tp
,{
b1
,
1190
},{
b2
,
1152
})
if
op
==
1
then
Duel
.
SendtoHand
(
c
,
nil
,
REASON_EFFECT
)
end
if
op
==
1
then
if
op
==
2
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
c95113856.lua
View file @
a0444f9d
...
...
@@ -21,32 +21,16 @@ function c95113856.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function
c95113856
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
0
,
LOCATION_ONFIELD
+
LOCATION_HAND
+
LOCATION_GRAVE
+
LOCATION_DECK
,
1
,
nil
)
end
local
off
=
1
local
ops
=
{}
local
opval
=
{}
if
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
then
ops
[
off
]
=
aux
.
Stringid
(
95113856
,
1
)
opval
[
off
-
1
]
=
1
off
=
off
+
1
end
if
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
0
,
LOCATION_HAND
,
1
,
nil
)
then
ops
[
off
]
=
aux
.
Stringid
(
95113856
,
2
)
opval
[
off
-
1
]
=
2
off
=
off
+
1
end
if
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
0
,
LOCATION_GRAVE
,
1
,
nil
)
then
ops
[
off
]
=
aux
.
Stringid
(
95113856
,
3
)
opval
[
off
-
1
]
=
3
off
=
off
+
1
end
if
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
0
,
LOCATION_DECK
,
1
,
nil
)
then
ops
[
off
]
=
aux
.
Stringid
(
95113856
,
4
)
opval
[
off
-
1
]
=
4
off
=
off
+
1
end
if
off
==
1
then
return
end
local
op
=
Duel
.
SelectOption
(
tp
,
table.unpack
(
ops
))
e
:
SetLabel
(
opval
[
op
])
local
b1
=
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
local
b2
=
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
0
,
LOCATION_HAND
,
1
,
nil
)
local
b3
=
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
0
,
LOCATION_GRAVE
,
1
,
nil
)
local
b4
=
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
0
,
LOCATION_DECK
,
1
,
nil
)
local
op
=
aux
.
SelectFromOptions
(
tp
,
{
b1
,
aux
.
Stringid
(
95113856
,
1
)},
{
b2
,
aux
.
Stringid
(
95113856
,
2
)},
{
b3
,
aux
.
Stringid
(
95113856
,
3
)},
{
b4
,
aux
.
Stringid
(
95113856
,
4
)})
e
:
SetLabel
(
op
)
end
function
c95113856
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
op
=
e
:
GetLabel
()
...
...
utility.lua
View file @
a0444f9d
...
...
@@ -125,6 +125,22 @@ end
function
Auxiliary
.
PuzzleOp
(
e
,
tp
)
Duel
.
SetLP
(
0
,
0
)
end
--Duel.SelectOption with option condition
--Return value starts from 1, different from Duel.SelectOption
function
Auxiliary
.
SelectFromOptions
(
tp
,
...
)
local
options
=
{
...
}
local
ops
=
{}
local
opvals
=
{}
for
i
=
1
,
#
options
do
if
options
[
i
][
1
]
then
table.insert
(
ops
,
options
[
i
][
2
])
table.insert
(
opvals
,
options
[
i
][
3
]
or
i
)
end
end
if
#
ops
==
0
then
return
nil
end
local
select
=
Duel
.
SelectOption
(
tp
,
table.unpack
(
ops
))
return
opvals
[
select
+
1
]
end
function
Auxiliary
.
IsDualState
(
effect
)
local
c
=
effect
:
GetHandler
()
return
not
c
:
IsDisabled
()
and
c
:
IsDualState
()
...
...
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