Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-222DIY-cards
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
alstroemeria-silentlove
ygopro-222DIY-cards
Commits
3cc45805
Commit
3cc45805
authored
Mar 28, 2022
by
Tachibana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
得得得得得
parent
1ca7d864
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
492 additions
and
8 deletions
+492
-8
expansions/script/c12026040.lua
expansions/script/c12026040.lua
+241
-8
expansions/script/c12029081.lua
expansions/script/c12029081.lua
+44
-0
expansions/script/c12029085.lua
expansions/script/c12029085.lua
+207
-0
No files found.
expansions/script/c12026040.lua
View file @
3cc45805
...
...
@@ -3,7 +3,7 @@ local m=12026040
local
cm
=
_G
[
"c"
..
m
]
Duel
.
LoadScript
(
"c12000000.lua"
)
function
cm
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
--
c:EnableReviveLimit()
aux
.
EnablePendulumAttribute
(
c
)
c
:
EnableCounterPermit
(
0x1
,
LOCATION_PZONE
+
LOCATION_MZONE
)
--change scale
...
...
@@ -35,11 +35,11 @@ function cm.initial_effect(c)
e3
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e3
)
--spsummon condition
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e2
:
SetCode
(
EFFECT_SPSUMMON_CONDITION
)
c
:
RegisterEffect
(
e2
)
--
local e2=Effect.CreateEffect(c)
--
e2:SetType(EFFECT_TYPE_SINGLE)
--
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
--
e2:SetCode(EFFECT_SPSUMMON_CONDITION)
--
c:RegisterEffect(e2)
--special summon
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
...
...
@@ -49,6 +49,237 @@ function cm.initial_effect(c)
e3
:
SetCondition
(
cm
.
hspcon
)
e3
:
SetOperation
(
cm
.
hspop
)
c
:
RegisterEffect
(
e3
)
--P Summon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCondition
(
cm
.
pcon
)
e2
:
SetTarget
(
cm
.
ptg
)
e2
:
SetOperation
(
cm
.
ptop
)
c
:
RegisterEffect
(
e2
)
--only me
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e3
:
SetCode
(
m
)
e3
:
SetRange
(
LOCATION_MZONE
)
c
:
RegisterEffect
(
e3
)
--P
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetCode
(
EVENT_CUSTOM
+
m
)
e4
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e4
:
SetOperation
(
cm
.
pop
)
c
:
RegisterEffect
(
e4
)
--special summon
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e5
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e5
:
SetType
(
EFFECT_TYPE_IGNITION
)
e5
:
SetRange
(
LOCATION_MZONE
)
e5
:
SetCountLimit
(
1
)
e5
:
SetCost
(
cm
.
spcost
)
e5
:
SetTarget
(
cm
.
sptg
)
e5
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e5
)
end
function
cm
.
spcfilter
(
c
,
ft
,
tp
)
return
ft
>
0
or
(
c
:
IsControler
(
tp
)
and
c
:
GetSequence
()
<
5
)
end
function
cm
.
spcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
if
chk
==
0
then
return
ft
>-
1
and
Duel
.
CheckReleaseGroup
(
tp
,
cm
.
spcfilter
,
1
,
nil
,
ft
,
tp
)
end
local
sg
=
Duel
.
SelectReleaseGroup
(
tp
,
cm
.
spcfilter
,
1
,
1
,
nil
,
ft
,
tp
)
Duel
.
Release
(
sg
,
REASON_COST
)
end
function
cm
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsAttribute
(
ATTRIBUTE_LIGHT
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
cm
.
sumfilter
(
c
)
return
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
IsFaceup
()
end
function
cm
.
PConditionFilter
(
c
,
e
,
tp
,
lscale
,
rscale
,
eset
)
local
lv
=
0
if
c
.
pendulum_level
then
lv
=
c
.
pendulum_level
else
lv
=
c
:
GetLevel
()
end
local
bool
=
Auxiliary
.
PendulumSummonableBool
(
c
)
return
(
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_PENDULUM
)
)
and
lv
>
lscale
and
lv
<
rscale
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_PENDULUM
,
tp
,
bool
,
bool
)
and
not
c
:
IsForbidden
()
and
(
(
PENDULUM_CHECKLIST
and
PENDULUM_CHECKLIST
&
(
0x1
<<
tp
)
==
0
)
or
Auxiliary
.
PConditionExtraFilter
(
c
,
e
,
tp
,
lscale
,
rscale
,
eset
))
end
function
cm
.
pcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
PENDULUM_CHECKLIST
then
PENDULUM_CHECKLIST
=
0
local
ge1
=
Effect
.
GlobalEffect
()
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_PHASE_START
+
PHASE_DRAW
)
ge1
:
SetOperation
(
Auxiliary
.
PendulumReset
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
local
eset
=
{
Duel
.
IsPlayerAffectedByEffect
(
tp
,
EFFECT_EXTRA_PENDULUM_SUMMON
)}
local
pg
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
LOCATION_PZONE
,
0
,
nil
)
if
pg
:
GetCount
()
~=
2
then
return
false
end
local
cc
=
pg
:
GetFirst
()
local
lscale
=
cc
:
GetLeftScale
()
local
dc
=
pg
:
GetNext
()
local
rscale
=
dc
:
GetRightScale
()
if
lscale
>
rscale
then
lscale
=
dc
:
GetRightScale
()
rscale
=
cc
:
GetLeftScale
()
end
if
(
lscale
==
rscale
or
lscale
==
rscale
-
1
or
lscale
==
rscale
+
1
)
then
return
false
end
local
loc
=
0
local
sc
=
Duel
.
GetMatchingGroup
(
cm
.
sumfilter
,
tp
,
LOCATION_EXTRA
,
0
,
nil
):
GetFirst
()
if
sc
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
nil
,
sc
)
>
0
then
loc
=
loc
+
LOCATION_EXTRA
end
if
loc
==
0
then
return
false
end
local
g
=
nil
if
og
then
g
=
og
:
Filter
(
Card
.
IsLocation
,
nil
,
loc
)
else
g
=
Duel
.
GetFieldGroup
(
tp
,
loc
,
0
)
end
return
g
:
IsExists
(
cm
.
PConditionFilter
,
1
,
nil
,
e
,
tp
,
lscale
,
rscale
,
eset
)
end
function
cm
.
ptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
local
eset
=
{
Duel
.
IsPlayerAffectedByEffect
(
tp
,
EFFECT_EXTRA_PENDULUM_SUMMON
)}
local
pg
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
LOCATION_PZONE
,
0
,
nil
)
if
pg
:
GetCount
()
~=
2
then
return
false
end
local
cc
=
pg
:
GetFirst
()
local
lscale
=
cc
:
GetLeftScale
()
local
dc
=
pg
:
GetNext
()
local
rscale
=
dc
:
GetRightScale
()
if
lscale
>
rscale
then
lscale
=
dc
:
GetRightScale
()
rscale
=
cc
:
GetLeftScale
()
end
local
loc
=
0
local
sc
=
Duel
.
GetMatchingGroup
(
cm
.
sumfilter
,
tp
,
LOCATION_EXTRA
,
0
,
nil
):
GetFirst
()
if
sc
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
nil
,
sc
)
>
0
then
loc
=
loc
+
LOCATION_EXTRA
end
local
g
=
nil
if
og
then
g
=
og
:
Filter
(
Card
.
IsLocation
,
nil
,
loc
)
else
g
=
Duel
.
GetFieldGroup
(
tp
,
loc
,
0
)
end
local
yg
=
g
:
Filter
(
cm
.
PConditionFilter
,
nil
,
e
,
tp
,
lscale
,
rscale
,
eset
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
yg
,
yg
:
GetCount
(),
tp
,
0
)
end
function
cm
.
ptop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
RaiseEvent
(
e
:
GetHandler
(),
EVENT_CUSTOM
+
m
,
re
,
r
,
rp
,
ep
,
ev
)
end
function
cm
.
pop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
sg
,
og
)
if
not
PENDULUM_CHECKLIST
then
PENDULUM_CHECKLIST
=
0
local
ge1
=
Effect
.
GlobalEffect
()
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_PHASE_START
+
PHASE_DRAW
)
ge1
:
SetOperation
(
Auxiliary
.
PendulumReset
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
local
pg
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
LOCATION_PZONE
,
0
,
nil
)
if
pg
:
GetCount
()
~=
2
then
return
end
local
cc
=
pg
:
GetFirst
()
local
lscale
=
cc
:
GetLeftScale
()
local
dc
=
pg
:
GetNext
()
local
rscale
=
dc
:
GetRightScale
()
if
lscale
>
rscale
then
lscale
=
dc
:
GetRightScale
()
rscale
=
cc
:
GetLeftScale
()
end
if
(
lscale
==
rscale
or
lscale
==
rscale
-
1
or
lscale
==
rscale
+
1
)
then
return
end
local
eset
=
{
Duel
.
IsPlayerAffectedByEffect
(
tp
,
EFFECT_EXTRA_PENDULUM_SUMMON
)}
local
tg
=
nil
local
loc
=
0
local
sc
=
Duel
.
GetMatchingGroup
(
cm
.
sumfilter
,
tp
,
LOCATION_EXTRA
,
0
,
nil
):
GetFirst
()
local
ft1
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
local
ft2
=
0
if
sc
then
ft2
=
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
nil
,
sc
)
end
local
ft
=
Duel
.
GetUsableMZoneCount
(
tp
)
local
ect
=
99
if
c29724053
and
Duel
.
IsPlayerAffectedByEffect
(
tp
,
29724053
)
then
ect
=
c29724053
[
tp
]
end
if
ect
and
ect
<
ft2
then
ft2
=
ect
end
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
59822133
)
then
if
ft1
>
0
then
ft1
=
1
end
if
ft2
>
0
then
ft2
=
1
end
ft
=
1
end
if
ft2
>
0
then
loc
=
loc
|
LOCATION_EXTRA
end
if
og
then
tg
=
og
:
Filter
(
Card
.
IsLocation
,
nil
,
loc
):
Filter
(
cm
.
PConditionFilter
,
nil
,
e
,
tp
,
lscale
,
rscale
,
eset
)
else
tg
=
Duel
.
GetMatchingGroup
(
cm
.
PConditionFilter
,
tp
,
loc
,
0
,
nil
,
e
,
tp
,
lscale
,
rscale
,
eset
)
end
local
ce
=
nil
local
b1
=
PENDULUM_CHECKLIST
&
(
0x1
<<
tp
)
==
0
local
b2
=#
eset
>
0
if
b1
and
b2
then
local
options
=
{
1163
}
for
_
,
te
in
ipairs
(
eset
)
do
table.insert
(
options
,
te
:
GetDescription
())
end
local
op
=
Duel
.
SelectOption
(
tp
,
table.unpack
(
options
))
if
op
>
0
then
ce
=
eset
[
op
]
end
elseif
b2
and
not
b1
then
local
options
=
{}
for
_
,
te
in
ipairs
(
eset
)
do
table.insert
(
options
,
te
:
GetDescription
())
end
local
op
=
Duel
.
SelectOption
(
tp
,
table.unpack
(
options
))
ce
=
eset
[
op
+
1
]
end
if
ce
then
tg
=
tg
:
Filter
(
aux
.
PConditionExtraFilterSpecific
,
nil
,
e
,
tp
,
lscale
,
rscale
,
ce
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Auxiliary
.
GCheckAdditional
=
Auxiliary
.
PendOperationCheck
(
ft1
,
ft2
,
ft
)
local
g
=
tg
:
SelectSubGroup
(
tp
,
aux
.
TRUE
,
true
,
1
,
math.min
(
#
tg
,
ft
))
Auxiliary
.
GCheckAdditional
=
nil
if
not
g
then
return
end
if
ce
then
Duel
.
Hint
(
HINT_CARD
,
0
,
ce
:
GetOwner
():
GetOriginalCode
())
ce
:
Reset
()
end
local
lpz
=
Duel
.
GetFieldCard
(
tp
,
LOCATION_PZONE
,
0
)
local
rpz
=
Duel
.
GetFieldCard
(
tp
,
LOCATION_PZONE
,
1
)
Duel
.
HintSelection
(
Group
.
FromCards
(
lpz
))
Duel
.
HintSelection
(
Group
.
FromCards
(
rpz
))
local
spg
=
Group
.
CreateGroup
()
for
tc
in
aux
.
Next
(
g
)
do
local
bool
=
aux
.
PendulumSummonableBool
(
tc
)
if
Duel
.
SpecialSummonStep
(
tc
,
SUMMON_TYPE_PENDULUM
,
tp
,
tp
,
bool
,
bool
,
POS_FACEUP
)
then
spg
:
AddCard
(
tc
)
end
end
Duel
.
SpecialSummonComplete
()
for
tc
in
aux
.
Next
(
g
)
do
tc
:
CompleteProcedure
()
end
if
spg
:
GetCount
()
~=
0
then
Duel
.
RaiseEvent
(
e
:
GetHandler
(),
EVENT_CUSTOM
+
m
+
100
,
re
,
r
,
rp
,
ep
,
ev
)
end
end
cm
.
lighting_with_Raphael
=
1
function
cm
.
describe_with_Raphael
(
c
)
...
...
@@ -76,8 +307,8 @@ function cm.scop(e,tp,eg,ep,ev,re,r,rp)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_UPDATE_
L
SCALE
)
e2
:
SetValue
(
tc
:
Get
RightScale
()
)
e2
:
SetCode
(
EFFECT_UPDATE_
R
SCALE
)
e2
:
SetValue
(
tc
:
Get
Level
()
*
2
)
c
:
RegisterEffect
(
e2
)
end
end
...
...
@@ -115,6 +346,8 @@ function cm.hspcon(e,c)
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
g
,
c
)
>
0
end
function
cm
.
hspop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetReleaseGroup
(
tp
)
Duel
.
Release
(
g
,
REASON_COST
)
c
:
RegisterFlagEffect
(
m
,
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TOFIELD
,
EFFECT_FLAG_CLIENT_HINT
,
1
,
0
,
aux
.
Stringid
(
m
,
3
))
end
\ No newline at end of file
expansions/script/c12029081.lua
View file @
3cc45805
...
...
@@ -23,6 +23,20 @@ function cm.initial_effect(c)
e2
:
SetCondition
(
cm
.
condition
)
e2
:
SetOperation
(
cm
.
op
)
c
:
RegisterEffect
(
e2
)
--
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e5
:
SetCategory
(
CATEGORY_TOHAND
)
e5
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e5
:
SetCode
(
EVENT_FREE_CHAIN
)
e5
:
SetRange
(
LOCATION_MZONE
)
e5
:
SetCountLimit
(
1
)
e5
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e5
:
SetCondition
(
cm
.
spcon2
)
e5
:
SetCost
(
cm
.
spcost2
)
e5
:
SetTarget
(
cm
.
sptg2
)
e5
:
SetOperation
(
cm
.
spop2
)
c
:
RegisterEffect
(
e5
)
end
function
cm
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
IsActiveType
(
TYPE_SPELL
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
...
...
@@ -75,4 +89,34 @@ function cm.ctdo(e,tp)
local
tc
=
e
:
GetLabelObject
()
tc
:
AddCounter
(
0x1
,
1
)
e
:
Reset
()
end
function
costfilter
(
c
)
return
c
:
IsCanRemoveCounter
(
tp
,
0x1
,
1
,
REASON_COST
)
end
function
cm
.
spcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
costfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
9
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
costfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
9
,
9
,
nil
)
local
tc
=
g
:
GetFirst
()
while
tc
do
tc
:
RemoveCounter
(
tp
,
0x1
,
1
,
REASON_EFFECT
)
tc
=
g
:
GetNext
()
end
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToHandAsCost
,
tp
,
0
,
LOCATION_GRAVE
+
LOCATION_ONFIELD
+
LOCATION_HAND
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToHandAsCost
,
tp
,
LOCATION_ONFIELD
+
LOCATION_HAND
,
0
,
1
,
nil
)
end
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
mg1
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToHandAsCost
,
tp
,
0
,
LOCATION_GRAVE
+
LOCATION_ONFIELD
+
LOCATION_HAND
,
nil
)
local
mg2
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToHandAsCost
,
tp
,
LOCATION_ONFIELD
+
LOCATION_HAND
,
0
,
nil
)
local
tt
=
math.min
(
#
mg1
,
#
mg2
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
mg1
:
Select
(
tp
,
1
,
tt
,
nil
)
local
ct
=
g
:
GetCount
()
Duel
.
SendtoHand
(
g
,
tp
,
REASON_EFFECT
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g1
=
mg2
:
Select
(
tp
,
ct
,
ctt
,
nil
)
Duel
.
SendtoHand
(
g1
,
1
-
tp
,
REASON_EFFECT
)
end
\ No newline at end of file
expansions/script/c12029085.lua
0 → 100644
View file @
3cc45805
--灵摆手续
local
m
=
12029085
local
cm
=
_G
[
"c"
..
m
]
Duel
.
LoadScript
(
"c12000000.lua"
)
function
cm
.
initial_effect
(
c
)
--pendulum summon
aux
.
EnablePendulumAttribute
(
c
,
true
)
--P Summon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_PZONE
)
e2
:
SetCountLimit
(
1
,
m
)
e2
:
SetCondition
(
cm
.
pcon
)
e2
:
SetTarget
(
cm
.
ptg
)
e2
:
SetOperation
(
cm
.
ptop
)
c
:
RegisterEffect
(
e2
)
--only me
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e3
:
SetCode
(
m
)
e3
:
SetRange
(
LOCATION_MZONE
)
c
:
RegisterEffect
(
e3
)
--P
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e4
:
SetRange
(
LOCATION_PZONE
)
e4
:
SetCode
(
EVENT_CUSTOM
+
m
)
e4
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e4
:
SetOperation
(
cm
.
pop
)
c
:
RegisterEffect
(
e4
)
end
function
cm
.
sumfilter
(
c
)
return
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
IsFaceup
()
end
function
cm
.
PConditionFilter
(
c
,
e
,
tp
,
lscale
,
rscale
,
eset
)
local
lv
=
0
if
c
.
pendulum_level
then
lv
=
c
.
pendulum_level
else
lv
=
c
:
GetLevel
()
end
local
bool
=
Auxiliary
.
PendulumSummonableBool
(
c
)
return
(
c
:
IsLocation
(
LOCATION_HAND
)
or
(
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_PENDULUM
)))
and
lv
>
lscale
and
lv
<
rscale
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_PENDULUM
,
tp
,
bool
,
bool
)
and
not
c
:
IsForbidden
()
and
(
PENDULUM_CHECKLIST
&
(
0x1
<<
tp
)
==
0
or
Auxiliary
.
PConditionExtraFilter
(
c
,
e
,
tp
,
lscale
,
rscale
,
eset
))
end
function
cm
.
pcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
PENDULUM_CHECKLIST
then
PENDULUM_CHECKLIST
=
0
local
ge1
=
Effect
.
GlobalEffect
()
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_PHASE_START
+
PHASE_DRAW
)
ge1
:
SetOperation
(
Auxiliary
.
PendulumReset
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
local
eset
=
{
Duel
.
IsPlayerAffectedByEffect
(
tp
,
EFFECT_EXTRA_PENDULUM_SUMMON
)}
local
pg
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
LOCATION_PZONE
,
0
,
nil
)
if
pg
:
GetCount
()
~=
2
then
return
false
end
local
cc
=
pg
:
GetFirst
()
local
lscale
=
cc
:
GetLeftScale
()
local
dc
=
pg
:
GetNext
()
local
rscale
=
dc
:
GetRightScale
()
if
lscale
>
rscale
then
lscale
=
dc
:
GetRightScale
()
rscale
=
cc
:
GetLeftScale
()
end
if
(
lscale
==
rscale
or
lscale
==
rscale
-
1
or
lscale
==
rscale
+
1
)
then
return
false
end
local
loc
=
0
local
sc
=
Duel
.
GetMatchingGroup
(
cm
.
sumfilter
,
tp
,
LOCATION_EXTRA
,
0
,
nil
):
GetFirst
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
loc
=
loc
+
LOCATION_HAND
end
if
sc
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
nil
,
sc
)
>
0
then
loc
=
loc
+
LOCATION_EXTRA
end
if
loc
==
0
then
return
false
end
local
g
=
nil
if
og
then
g
=
og
:
Filter
(
Card
.
IsLocation
,
nil
,
loc
)
else
g
=
Duel
.
GetFieldGroup
(
tp
,
loc
,
0
)
end
return
g
:
IsExists
(
cm
.
PConditionFilter
,
1
,
nil
,
e
,
tp
,
lscale
,
rscale
,
eset
)
end
function
cm
.
ptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
local
eset
=
{
Duel
.
IsPlayerAffectedByEffect
(
tp
,
EFFECT_EXTRA_PENDULUM_SUMMON
)}
local
pg
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
LOCATION_PZONE
,
0
,
nil
)
if
pg
:
GetCount
()
~=
2
then
return
false
end
local
cc
=
pg
:
GetFirst
()
local
lscale
=
cc
:
GetLeftScale
()
local
dc
=
pg
:
GetNext
()
local
rscale
=
dc
:
GetRightScale
()
if
lscale
>
rscale
then
lscale
=
dc
:
GetRightScale
()
rscale
=
cc
:
GetLeftScale
()
end
local
loc
=
0
local
sc
=
Duel
.
GetMatchingGroup
(
cm
.
sumfilter
,
tp
,
LOCATION_EXTRA
,
0
,
nil
):
GetFirst
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
loc
=
loc
+
LOCATION_HAND
end
if
sc
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
nil
,
sc
)
>
0
then
loc
=
loc
+
LOCATION_EXTRA
end
local
g
=
nil
if
og
then
g
=
og
:
Filter
(
Card
.
IsLocation
,
nil
,
loc
)
else
g
=
Duel
.
GetFieldGroup
(
tp
,
loc
,
0
)
end
local
yg
=
g
:
Filter
(
cm
.
PConditionFilter
,
nil
,
e
,
tp
,
lscale
,
rscale
,
eset
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
yg
,
yg
:
GetCount
(),
tp
,
0
)
end
function
cm
.
ptop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
RaiseEvent
(
e
:
GetHandler
(),
EVENT_CUSTOM
+
m
,
re
,
r
,
rp
,
ep
,
ev
)
end
function
cm
.
pop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
sg
,
og
)
if
not
PENDULUM_CHECKLIST
then
PENDULUM_CHECKLIST
=
0
local
ge1
=
Effect
.
GlobalEffect
()
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_PHASE_START
+
PHASE_DRAW
)
ge1
:
SetOperation
(
Auxiliary
.
PendulumReset
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
local
pg
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
LOCATION_PZONE
,
0
,
nil
)
if
pg
:
GetCount
()
~=
2
then
return
end
local
cc
=
pg
:
GetFirst
()
local
lscale
=
cc
:
GetLeftScale
()
local
dc
=
pg
:
GetNext
()
local
rscale
=
dc
:
GetRightScale
()
if
lscale
>
rscale
then
lscale
=
dc
:
GetRightScale
()
rscale
=
cc
:
GetLeftScale
()
end
if
(
lscale
==
rscale
or
lscale
==
rscale
-
1
or
lscale
==
rscale
+
1
)
then
return
end
local
eset
=
{
Duel
.
IsPlayerAffectedByEffect
(
tp
,
EFFECT_EXTRA_PENDULUM_SUMMON
)}
local
tg
=
nil
local
loc
=
0
local
sc
=
Duel
.
GetMatchingGroup
(
cm
.
sumfilter
,
tp
,
LOCATION_EXTRA
,
0
,
nil
):
GetFirst
()
local
ft1
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
local
ft2
=
0
if
sc
then
ft2
=
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
nil
,
sc
)
end
local
ft
=
Duel
.
GetUsableMZoneCount
(
tp
)
local
ect
=
99
if
c29724053
and
Duel
.
IsPlayerAffectedByEffect
(
tp
,
29724053
)
then
ect
=
c29724053
[
tp
]
end
if
ect
and
ect
<
ft2
then
ft2
=
ect
end
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
59822133
)
then
if
ft1
>
0
then
ft1
=
1
end
if
ft2
>
0
then
ft2
=
1
end
ft
=
1
end
if
ft1
>
0
then
loc
=
loc
|
LOCATION_HAND
end
if
ft2
>
0
then
loc
=
loc
|
LOCATION_EXTRA
end
if
og
then
tg
=
og
:
Filter
(
Card
.
IsLocation
,
nil
,
loc
):
Filter
(
cm
.
PConditionFilter
,
nil
,
e
,
tp
,
lscale
,
rscale
,
eset
)
else
tg
=
Duel
.
GetMatchingGroup
(
cm
.
PConditionFilter
,
tp
,
loc
,
0
,
nil
,
e
,
tp
,
lscale
,
rscale
,
eset
)
end
local
ce
=
nil
local
b1
=
PENDULUM_CHECKLIST
&
(
0x1
<<
tp
)
==
0
local
b2
=#
eset
>
0
if
b1
and
b2
then
local
options
=
{
1163
}
for
_
,
te
in
ipairs
(
eset
)
do
table.insert
(
options
,
te
:
GetDescription
())
end
local
op
=
Duel
.
SelectOption
(
tp
,
table.unpack
(
options
))
if
op
>
0
then
ce
=
eset
[
op
]
end
elseif
b2
and
not
b1
then
local
options
=
{}
for
_
,
te
in
ipairs
(
eset
)
do
table.insert
(
options
,
te
:
GetDescription
())
end
local
op
=
Duel
.
SelectOption
(
tp
,
table.unpack
(
options
))
ce
=
eset
[
op
+
1
]
end
if
ce
then
tg
=
tg
:
Filter
(
aux
.
PConditionExtraFilterSpecific
,
nil
,
e
,
tp
,
lscale
,
rscale
,
ce
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
Auxiliary
.
GCheckAdditional
=
Auxiliary
.
PendOperationCheck
(
ft1
,
ft2
,
ft
)
local
g
=
tg
:
SelectSubGroup
(
tp
,
aux
.
TRUE
,
true
,
1
,
math.min
(
#
tg
,
ft
))
Auxiliary
.
GCheckAdditional
=
nil
if
not
g
then
return
end
if
ce
then
Duel
.
Hint
(
HINT_CARD
,
0
,
ce
:
GetOwner
():
GetOriginalCode
())
ce
:
Reset
()
end
local
lpz
=
Duel
.
GetFieldCard
(
tp
,
LOCATION_PZONE
,
0
)
local
rpz
=
Duel
.
GetFieldCard
(
tp
,
LOCATION_PZONE
,
1
)
Duel
.
HintSelection
(
Group
.
FromCards
(
lpz
))
Duel
.
HintSelection
(
Group
.
FromCards
(
rpz
))
local
spg
=
Group
.
CreateGroup
()
for
tc
in
aux
.
Next
(
g
)
do
local
bool
=
aux
.
PendulumSummonableBool
(
tc
)
if
Duel
.
SpecialSummonStep
(
tc
,
SUMMON_TYPE_PENDULUM
,
tp
,
tp
,
bool
,
bool
,
POS_FACEUP
)
then
spg
:
AddCard
(
tc
)
end
end
Duel
.
SpecialSummonComplete
()
for
tc
in
aux
.
Next
(
g
)
do
tc
:
CompleteProcedure
()
end
if
spg
:
GetCount
()
~=
0
then
Duel
.
RaiseEvent
(
e
:
GetHandler
(),
EVENT_CUSTOM
+
m
+
100
,
re
,
r
,
rp
,
ep
,
ev
)
end
end
\ No newline at end of file
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