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
Nguyễn Anh Kiệt
ygopro-222DIY-cards
Commits
192d9ddf
Commit
192d9ddf
authored
Aug 07, 2021
by
Grajade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update c12047052.lua
parent
9e949301
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
58 deletions
+53
-58
expansions/script/c12047052.lua
expansions/script/c12047052.lua
+53
-58
No files found.
expansions/script/c12047052.lua
View file @
192d9ddf
...
...
@@ -2,69 +2,64 @@
local
m
=
12047052
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_TODECK
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMING_TOGRAVE
)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
activate
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCost
(
cm
.
cost
)
c
:
RegisterEffect
(
e2
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_TODECK
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMING_TOGRAVE
)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
activate
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCost
(
cm
.
cost
)
c
:
RegisterEffect
(
e2
)
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
:
IsAbleToDeck
()
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
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
cm
.
disfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
disfilter
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
local
tc
=
Duel
.
SelectTarget
(
tp
,
cm
.
disfilter
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
tc
,
1
,
0
,
0
)
end
function
cm
.
spfilter1
(
c
)
return
c
:
IsAbleToGrave
()
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
chkc
:
IsAbleToDeck
()
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsAbleToDeck
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
nil
)
and
(
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
or
(
not
e
:
GetHandler
():
IsLocation
(
LOCATION_SZONE
)))
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
tc
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsAbleToDeck
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
tc
,
1
,
0
,
0
)
end
function
cm
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
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
(
dp
,
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
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
end
end
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
local
shuffle
=
0
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
if
Duel
.
SendtoDeck
(
tc
,
nil
,
2
,
REASON_EFFECT
)
>
0
then
shuffle
=
1
end
end
local
dp
=
tc
:
GetOwner
()
if
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToGrave
,
dp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
dp
,
aux
.
Stringid
(
m
,
1
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
dp
,
HINTMSG_TOGRAVE
)
local
sg
=
Duel
.
SelectMatchingCard
(
dp
,
Card
.
IsAbleToGrave
,
dp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
>
0
then
shuffle
=
1
end
end
if
shuffle
==
1
then
Duel
.
ShuffleDeck
(
dp
)
end
if
not
c
:
IsStatus
(
STATUS_ACT_FROM_HAND
)
and
e
:
GetLabel
()
~=
2
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
function
cm
.
handcon
(
e
)
return
Duel
.
GetFieldGroupCount
(
e
:
GetHandlerPlayer
(),
LOCATION_ONFIELD
,
0
)
==
0
end
return
Duel
.
GetFieldGroupCount
(
e
:
GetHandlerPlayer
(),
LOCATION_ONFIELD
,
0
)
==
0
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