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
Soulgamer
ygopro-222DIY-cards
Commits
07f99962
Commit
07f99962
authored
Jan 21, 2021
by
TanakaKotoha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dededededededededededede
parent
2b1633a9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
130 additions
and
162 deletions
+130
-162
expansions/script/c12047050.lua
expansions/script/c12047050.lua
+18
-23
expansions/script/c12047051.lua
expansions/script/c12047051.lua
+22
-27
expansions/script/c12047052.lua
expansions/script/c12047052.lua
+20
-25
expansions/script/c12047053.lua
expansions/script/c12047053.lua
+18
-23
expansions/script/c12047054.lua
expansions/script/c12047054.lua
+35
-42
expansions/script/c12047055.lua
expansions/script/c12047055.lua
+17
-22
No files found.
expansions/script/c12047050.lua
View file @
07f99962
...
...
@@ -12,29 +12,24 @@ function cm.initial_effect(c)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
activate
)
c
:
RegisterEffect
(
e1
)
--act in hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_TRAP_ACT_IN_HAND
)
local
e2
=
e1
:
Clone
()
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCo
ndition
(
cm
.
handcon
)
e2
:
SetCo
st
(
cm
.
cost
)
c
:
RegisterEffect
(
e2
)
--spsum limit
local
e11
=
Effect
.
CreateEffect
(
c
)
e11
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e11
:
SetCode
(
EVENT_CHAINING
)
e11
:
SetOperation
(
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
GetPreviousLocation
()
~=
LOCATION_GRAVE
then
return
end
local
c
=
e
:
GetHandler
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_LEAVE_FIELD_REDIRECT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_REDIRECT
)
e1
:
SetValue
(
LOCATION_DECK
)
c
:
RegisterEffect
(
e1
,
true
)
end
)
c
:
RegisterEffect
(
e11
)
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
e
:
GetHandlerPlayer
(),
LOCATION_ONFIELD
,
0
)
==
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
Duel
.
MoveToField
(
e
:
GetHandler
(),
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
c
:
CreateEffectRelation
(
e
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_LEAVE_FIELD_REDIRECT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_REDIRECT
)
e1
:
SetValue
(
LOCATION_DECKSHF
)
c
:
RegisterEffect
(
e1
,
true
)
e
:
SetLabel
(
2
)
end
function
cm
.
disfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsAbleToHand
()
...
...
@@ -57,7 +52,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
end
if
true
then
local
dp
=
tc
:
GetOwner
()
if
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter1
,
dp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
dp
)
and
Duel
.
SelectYesNo
(
t
p
,
aux
.
Stringid
(
12004006
,
2
))
then
if
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter1
,
dp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
dp
)
and
Duel
.
SelectYesNo
(
d
p
,
aux
.
Stringid
(
12004006
,
2
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
dp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
dp
,
cm
.
spfilter1
,
dp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
dp
)
if
g
:
GetCount
()
>
0
then
...
...
@@ -65,7 +60,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
end
if
not
c
:
IsStatus
(
STATUS_ACT_FROM_HAND
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
then
if
not
c
:
IsStatus
(
STATUS_ACT_FROM_HAND
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
and
e
:
GetLabel
()
~=
2
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
...
...
expansions/script/c12047051.lua
View file @
07f99962
...
...
@@ -12,38 +12,33 @@ function cm.initial_effect(c)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
activate
)
c
:
RegisterEffect
(
e1
)
--act in hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_TRAP_ACT_IN_HAND
)
local
e2
=
e1
:
Clone
()
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCo
ndition
(
cm
.
handcon
)
e2
:
SetCo
st
(
cm
.
cost
)
c
:
RegisterEffect
(
e2
)
--spsum limit
local
e11
=
Effect
.
CreateEffect
(
c
)
e11
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e11
:
SetCode
(
EVENT_CHAINING
)
e11
:
SetOperation
(
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
GetPreviousLocation
()
~=
LOCATION_GRAVE
then
return
end
local
c
=
e
:
GetHandler
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_LEAVE_FIELD_REDIRECT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_REDIRECT
)
e1
:
SetValue
(
LOCATION_DECK
)
c
:
RegisterEffect
(
e1
,
true
)
end
)
c
:
RegisterEffect
(
e11
)
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
e
:
GetHandlerPlayer
(),
LOCATION_ONFIELD
,
0
)
==
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
Duel
.
MoveToField
(
e
:
GetHandler
(),
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
c
:
CreateEffectRelation
(
e
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_LEAVE_FIELD_REDIRECT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_REDIRECT
)
e1
:
SetValue
(
LOCATION_DECKSHF
)
c
:
RegisterEffect
(
e1
,
true
)
e
:
SetLabel
(
2
)
end
function
cm
.
disfilter
(
c
)
return
c
:
Is
Faceup
()
and
c
:
Is
AbleToDeck
()
return
c
:
IsAbleToDeck
()
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_SZONE
)
and
cm
.
disfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
disfilter
,
tp
,
LOCATION_SZONE
,
LOCATION_SZONE
,
1
,
nil
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
disfilter
,
tp
,
LOCATION_SZONE
,
LOCATION_SZONE
,
1
,
e
:
GetHandler
()
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
local
tc
=
Duel
.
SelectTarget
(
tp
,
cm
.
disfilter
,
tp
,
LOCATION_SZONE
,
LOCATION_SZONE
,
1
,
1
,
nil
)
local
tc
=
Duel
.
SelectTarget
(
tp
,
cm
.
disfilter
,
tp
,
LOCATION_SZONE
,
LOCATION_SZONE
,
1
,
1
,
e
:
GetHandler
()
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
tc
,
1
,
0
,
0
)
end
function
cm
.
spfilter1
(
c
)
...
...
@@ -52,12 +47,12 @@ end
function
cm
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
Is
Faceup
()
and
tc
:
Is
RelateToEffect
(
e
)
then
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoDeck
(
tc
,
nil
,
2
,
REASON_EFFECT
)
end
if
true
then
local
dp
=
tc
:
GetOwner
()
if
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter1
,
dp
,
LOCATION_HAND
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
t
p
,
aux
.
Stringid
(
m
,
1
))
then
if
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter1
,
dp
,
LOCATION_HAND
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
d
p
,
aux
.
Stringid
(
m
,
1
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
dp
,
HINTMSG_SET
)
local
g
=
Duel
.
SelectMatchingCard
(
dp
,
cm
.
spfilter1
,
dp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
...
...
@@ -65,7 +60,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
end
if
not
c
:
IsStatus
(
STATUS_ACT_FROM_HAND
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
then
if
not
c
:
IsStatus
(
STATUS_ACT_FROM_HAND
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
and
e
:
SetLabel
()
~=
2
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
...
...
expansions/script/c12047052.lua
View file @
07f99962
...
...
@@ -12,32 +12,27 @@ function cm.initial_effect(c)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
activate
)
c
:
RegisterEffect
(
e1
)
--act in hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_TRAP_ACT_IN_HAND
)
local
e2
=
e1
:
Clone
()
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCo
ndition
(
cm
.
handcon
)
e2
:
SetCo
st
(
cm
.
cost
)
c
:
RegisterEffect
(
e2
)
--spsum limit
local
e11
=
Effect
.
CreateEffect
(
c
)
e11
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e11
:
SetCode
(
EVENT_CHAINING
)
e11
:
SetOperation
(
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
GetPreviousLocation
()
~=
LOCATION_GRAVE
then
return
end
local
c
=
e
:
GetHandler
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_LEAVE_FIELD_REDIRECT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_REDIRECT
)
e1
:
SetValue
(
LOCATION_DECK
)
c
:
RegisterEffect
(
e1
,
true
)
end
)
c
:
RegisterEffect
(
e11
)
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
e
:
GetHandlerPlayer
(),
LOCATION_ONFIELD
,
0
)
==
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
Duel
.
MoveToField
(
e
:
GetHandler
(),
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
c
:
CreateEffectRelation
(
e
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_LEAVE_FIELD_REDIRECT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_REDIRECT
)
e1
:
SetValue
(
LOCATION_DECKSHF
)
c
:
RegisterEffect
(
e1
,
true
)
e
:
SetLabel
(
2
)
end
function
cm
.
disfilter
(
c
)
return
c
:
Is
Faceup
()
and
not
c
:
Is
AbleToDeck
()
return
c
:
IsAbleToDeck
()
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
cm
.
disfilter
(
chkc
)
end
...
...
@@ -52,12 +47,12 @@ end
function
cm
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsFaceup
()
and
tc
:
IsRelateToEffect
(
e
)
then
if
tc
and
tc
:
IsFaceup
()
and
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoDeck
(
tc
,
nil
,
2
,
REASON_EFFECT
)
end
if
true
then
local
dp
=
tc
:
GetOwner
()
if
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter1
,
dp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
t
p
,
aux
.
Stringid
(
m
,
1
))
then
if
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter1
,
dp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
d
p
,
aux
.
Stringid
(
m
,
1
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
dp
,
HINTMSG_SET
)
local
g
=
Duel
.
SelectMatchingCard
(
dp
,
cm
.
spfilter1
,
dp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
...
...
@@ -65,7 +60,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
end
if
not
c
:
IsStatus
(
STATUS_ACT_FROM_HAND
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
then
if
not
c
:
IsStatus
(
STATUS_ACT_FROM_HAND
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
and
e
:
GetLabel
()
~=
2
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
...
...
expansions/script/c12047053.lua
View file @
07f99962
...
...
@@ -12,29 +12,24 @@ function cm.initial_effect(c)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
activate
)
c
:
RegisterEffect
(
e1
)
--act in hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_TRAP_ACT_IN_HAND
)
local
e2
=
e1
:
Clone
()
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCo
ndition
(
cm
.
handcon
)
e2
:
SetCo
st
(
cm
.
cost
)
c
:
RegisterEffect
(
e2
)
--spsum limit
local
e11
=
Effect
.
CreateEffect
(
c
)
e11
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e11
:
SetCode
(
EVENT_CHAINING
)
e11
:
SetOperation
(
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
GetPreviousLocation
()
~=
LOCATION_GRAVE
then
return
end
local
c
=
e
:
GetHandler
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_LEAVE_FIELD_REDIRECT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_REDIRECT
)
e1
:
SetValue
(
LOCATION_DECK
)
c
:
RegisterEffect
(
e1
,
true
)
end
)
c
:
RegisterEffect
(
e11
)
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
e
:
GetHandlerPlayer
(),
LOCATION_ONFIELD
,
0
)
==
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
Duel
.
MoveToField
(
e
:
GetHandler
(),
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
c
:
CreateEffectRelation
(
e
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_LEAVE_FIELD_REDIRECT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_REDIRECT
)
e1
:
SetValue
(
LOCATION_DECKSHF
)
c
:
RegisterEffect
(
e1
,
true
)
e
:
SetLabel
(
2
)
end
function
cm
.
disfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsAbleToGrave
()
...
...
@@ -52,7 +47,7 @@ end
function
cm
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
if
tc
and
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
)
end
if
true
then
...
...
@@ -65,7 +60,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
end
if
not
c
:
IsStatus
(
STATUS_ACT_FROM_HAND
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
then
if
not
c
:
IsStatus
(
STATUS_ACT_FROM_HAND
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
and
e
:
GetLabel
()
~=
2
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
...
...
expansions/script/c12047054.lua
View file @
07f99962
...
...
@@ -12,39 +12,38 @@ function cm.initial_effect(c)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
activate
)
c
:
RegisterEffect
(
e1
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e1
:
SetCategory
(
CATEGORY_DRAW
+
CATEGORY_HANDES
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMING_TOHAND
)
e1
:
SetTarget
(
cm
.
target1
)
e1
:
SetOperation
(
cm
.
activate1
)
c
:
RegisterEffect
(
e1
)
--act in hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_TRAP_ACT_IN_HAND
)
local
e2
=
e1
:
Clone
()
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCo
ndition
(
cm
.
handcon
)
e2
:
SetCo
st
(
cm
.
cost
)
c
:
RegisterEffect
(
e2
)
--spsum limit
local
e11
=
Effect
.
CreateEffect
(
c
)
e11
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e11
:
SetCode
(
EVENT_CHAINING
)
e11
:
SetOperation
(
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
GetPreviousLocation
()
~=
LOCATION_GRAVE
then
return
end
local
c
=
e
:
GetHandler
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_LEAVE_FIELD_REDIRECT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_REDIRECT
)
e1
:
SetValue
(
LOCATION_DECK
)
c
:
RegisterEffect
(
e1
,
true
)
end
)
c
:
RegisterEffect
(
e11
)
--Activate
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e3
:
SetCategory
(
CATEGORY_DRAW
+
CATEGORY_HANDES
)
e3
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetHintTiming
(
0
,
TIMING_TOHAND
)
e3
:
SetTarget
(
cm
.
target1
)
e3
:
SetOperation
(
cm
.
activate1
)
c
:
RegisterEffect
(
e3
)
local
e4
=
e1
:
Clone
()
e4
:
SetRange
(
LOCATION_GRAVE
)
e4
:
SetCost
(
cm
.
cost
)
c
:
RegisterEffect
(
e4
)
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
e
:
GetHandlerPlayer
(),
LOCATION_ONFIELD
,
0
)
==
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
Duel
.
MoveToField
(
e
:
GetHandler
(),
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
c
:
CreateEffectRelation
(
e
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_LEAVE_FIELD_REDIRECT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_REDIRECT
)
e1
:
SetValue
(
LOCATION_DECKSHF
)
c
:
RegisterEffect
(
e1
,
true
)
e
:
SetLabel
(
2
)
end
function
cm
.
disfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsAbleToGrave
()
...
...
@@ -62,15 +61,12 @@ function cm.spfilter1(c)
end
function
cm
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
local
h1
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_HAND
,
0
)
Duel
.
SendtoGrave
(
h1
,
REASON_EFFECT
+
REASON_DISCARD
)
Duel
.
Draw
(
tp
,
h1
:
GetCount
(),
REASON_EFFECT
)
end
if
true
then
local
dp
=
tp
if
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter1
,
dp
,
LOCATION_HAND
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
t
p
,
aux
.
Stringid
(
m
,
1
))
then
if
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter1
,
dp
,
LOCATION_HAND
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
d
p
,
aux
.
Stringid
(
m
,
1
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
dp
,
HINTMSG_SET
)
local
g
=
Duel
.
SelectMatchingCard
(
dp
,
cm
.
spfilter1
,
dp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
...
...
@@ -78,7 +74,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
end
if
not
c
:
IsStatus
(
STATUS_ACT_FROM_HAND
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
then
if
not
c
:
IsStatus
(
STATUS_ACT_FROM_HAND
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
and
e
:
GetLabel
()
~=
2
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
...
...
@@ -95,15 +91,12 @@ function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function
cm
.
activate1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
local
h1
=
Duel
.
GetFieldGroup
(
1
-
tp
,
LOCATION_HAND
,
0
)
local
h1
=
Duel
.
GetFieldGroup
(
1
-
tp
,
LOCATION_HAND
,
0
)
Duel
.
SendtoGrave
(
h1
,
REASON_EFFECT
+
REASON_DISCARD
)
Duel
.
Draw
(
1
-
tp
,
h1
:
GetCount
(),
REASON_EFFECT
)
end
if
true
then
local
dp
=
1
-
tp
if
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter1
,
dp
,
LOCATION_HAND
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
1
-
t
p
,
aux
.
Stringid
(
m
,
1
))
then
if
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter1
,
dp
,
LOCATION_HAND
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
d
p
,
aux
.
Stringid
(
m
,
1
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
dp
,
HINTMSG_SET
)
local
g
=
Duel
.
SelectMatchingCard
(
dp
,
cm
.
spfilter1
,
dp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
...
...
@@ -111,7 +104,7 @@ function cm.activate1(e,tp,eg,ep,ev,re,r,rp)
end
end
end
if
not
c
:
IsStatus
(
STATUS_ACT_FROM_HAND
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
then
if
not
c
:
IsStatus
(
STATUS_ACT_FROM_HAND
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
and
e
:
GetLabel
()
~=
2
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
\ No newline at end of file
expansions/script/c12047055.lua
View file @
07f99962
...
...
@@ -12,29 +12,24 @@ function cm.initial_effect(c)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
activate
)
c
:
RegisterEffect
(
e1
)
--act in hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_TRAP_ACT_IN_HAND
)
local
e2
=
e1
:
Clone
()
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCo
ndition
(
cm
.
handcon
)
e2
:
SetCo
st
(
cm
.
cost
)
c
:
RegisterEffect
(
e2
)
--spsum limit
local
e11
=
Effect
.
CreateEffect
(
c
)
e11
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e11
:
SetCode
(
EVENT_CHAINING
)
e11
:
SetOperation
(
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetHandler
():
GetPreviousLocation
()
~=
LOCATION_GRAVE
then
return
end
local
c
=
e
:
GetHandler
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_LEAVE_FIELD_REDIRECT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_REDIRECT
)
e1
:
SetValue
(
LOCATION_DECK
)
c
:
RegisterEffect
(
e1
,
true
)
end
)
c
:
RegisterEffect
(
e11
)
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
e
:
GetHandlerPlayer
(),
LOCATION_ONFIELD
,
0
)
==
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
Duel
.
MoveToField
(
e
:
GetHandler
(),
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
c
:
CreateEffectRelation
(
e
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_LEAVE_FIELD_REDIRECT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_REDIRECT
)
e1
:
SetValue
(
LOCATION_DECKSHF
)
c
:
RegisterEffect
(
e1
,
true
)
e
:
SetLabel
(
2
)
end
function
cm
.
disfilter
(
c
)
return
c
:
IsSSetable
()
and
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
...
...
@@ -64,7 +59,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
end
if
not
c
:
IsStatus
(
STATUS_ACT_FROM_HAND
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
then
if
not
c
:
IsStatus
(
STATUS_ACT_FROM_HAND
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
and
e
:
GetLabel
()
~=
2
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
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