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
fd8f58fc
Commit
fd8f58fc
authored
Sep 22, 2021
by
Tachibana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
emergency
parent
dbd7bcc5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
94 deletions
+81
-94
expansions/script/c20000051.lua
expansions/script/c20000051.lua
+81
-94
No files found.
expansions/script/c20000051.lua
View file @
fd8f58fc
--安宁茶具
function
c20000051
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_RECOVER
+
CATEGORY_SUMMON
+
CATEGORY_TOGRAVE
+
CATEGORY_DRAW
+
CATEGORY_HANDES
+
CATEGORY_TODECK
+
CATEGORY_REMOVE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
20000051
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetTarget
(
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
local
g
=
c20000051
[
0
]
if
chk
==
0
then
return
if
g
==
1
or
g
==
2
or
g
==
9
or
g
==
10
then
return
true
elseif
g
==
3
then
Duel
.
IsExistingMatchingCard
(
function
(
c
)
return
c
:
IsSummonable
(
true
,
nil
)
end
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
elseif
g
==
4
then
return
Duel
.
IsExistingMatchingCard
(
nil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
elseif
g
==
5
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
elseif
g
==
6
then
return
Duel
.
GetFieldGroupCount
(
tp
,
0
,
LOCATION_HAND
)
>
0
elseif
g
==
7
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToDeck
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
elseif
g
==
8
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
0
,
LOCATION_GRAVE
,
1
,
nil
)
end
if
g
==
1
then
e
:
SetCategory
(
CATEGORY_RECOVER
)
e
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
1000
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_RECOVER
,
nil
,
0
,
tp
,
1000
)
elseif
g
==
3
then
e
:
SetCategory
(
CATEGORY_SUMMON
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SUMMON
,
nil
,
1
,
0
,
0
)
elseif
g
==
4
then
e
:
SetCategory
(
CATEGORY_TOGRAVE
)
elseif
g
==
5
then
e
:
SetCategory
(
CATEGORY_DRAW
)
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
elseif
g
==
6
then
e
:
SetCategory
(
CATEGORY_HANDES
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_HANDES
,
nil
,
0
,
1
-
tp
,
1
)
elseif
g
==
7
then
local
g7
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
e
:
SetCategory
(
CATEGORY_TODECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
g7
,
g7
:
GetCount
(),
tp
,
LOCATION_GRAVE
)
elseif
g
==
8
then
local
g8
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
0
,
LOCATION_GRAVE
,
nil
)
e
:
SetCategory
(
CATEGORY_REMOVE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
g8
,
g8
:
GetCount
(),
1
-
tp
,
LOCATION_GRAVE
)
e1
:
SetOperation
(
c20000051
.
op1
)
c
:
RegisterEffect
(
e1
)
if
not
c20000051
.
global_check
then
c20000051
.
global_check
=
true
c20000051
[
0
]
=
0
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c20000051
.
checkcon
)
ge1
:
SetOperation
(
c20000051
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
)
e1
:
SetOperation
(
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
end
function
c20000051
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
GetOriginalCode
()
==
20000051
end
function
c20000051
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
c20000051
[
0
]
=
c20000051
[
0
]
+
1
end
--
function
c20000051
.
opg3
(
c
)
return
c
:
IsSummonable
(
true
,
nil
)
end
function
c20000051
.
op1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
c20000051
[
0
]
if
g
==
1
then
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
Duel
.
Recover
(
p
,
d
,
REASON_EFFECT
)
Duel
.
Recover
(
tp
,
1000
,
REASON_EFFECT
)
Duel
.
BreakEffect
()
c
:
CancelToGrave
()
Duel
.
SendtoDeck
(
c
,
nil
,
2
,
REASON_EFFECT
)
elseif
g
==
2
then
Duel
.
SetLP
(
1
-
tp
,
Duel
.
GetLP
(
1
-
tp
)
-
2500
)
Duel
.
BreakEffect
()
c
:
CancelToGrave
()
Duel
.
SendtoDeck
(
c
,
nil
,
2
,
REASON_EFFECT
)
elseif
g
==
3
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
function
(
c
)
return
c
:
IsSummonable
(
true
,
nil
)
end
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c20000051
.
g3
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
local
tc
=
g
:
GetFirst
()
if
tc
then
Duel
.
Summon
(
tp
,
tc
,
true
,
nil
,
1
)
end
Duel
.
BreakEffect
()
c
:
CancelToGrave
()
Duel
.
SendtoDeck
(
c
,
nil
,
2
,
REASON_EFFECT
)
elseif
g
==
4
then
local
g
=
Duel
.
GetMatchingGroup
(
nil
,
1
-
tp
,
LOCATION_MZONE
,
0
,
nil
)
Duel
.
Hint
(
HINT_SELECTMSG
,
1
-
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
g
:
Select
(
1
-
tp
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
sg
)
Duel
.
SendtoGrave
(
sg
,
REASON_RULE
)
Duel
.
BreakEffect
()
c
:
CancelToGrave
()
Duel
.
SendtoDeck
(
c
,
nil
,
2
,
REASON_EFFECT
)
elseif
g
==
5
then
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
Duel
.
Draw
(
p
,
d
,
REASON_EFFECT
)
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
Duel
.
BreakEffect
()
c
:
CancelToGrave
()
Duel
.
SendtoDeck
(
c
,
nil
,
2
,
REASON_EFFECT
)
elseif
g
==
6
then
Duel
.
DiscardHand
(
1
-
tp
,
nil
,
1
,
1
,
REASON_EFFECT
+
REASON_DISCARD
)
Duel
.
BreakEffect
()
c
:
CancelToGrave
()
Duel
.
SendtoDeck
(
c
,
nil
,
2
,
REASON_EFFECT
)
elseif
g
==
7
then
local
g7
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
Duel
.
SendtoDeck
(
g7
,
tp
,
2
,
REASON_EFFECT
)
local
g
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
Duel
.
SendtoDeck
(
g
,
tp
,
2
,
REASON_EFFECT
)
Duel
.
BreakEffect
()
c
:
CancelToGrave
()
Duel
.
SendtoDeck
(
c
,
nil
,
2
,
REASON_EFFECT
)
elseif
g
==
8
then
local
g8
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
0
,
LOCATION_GRAVE
,
nil
)
Duel
.
Remove
(
g8
,
POS_FACEUP
,
REASON_EFFECT
)
local
g
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
0
,
LOCATION_GRAVE
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
Duel
.
BreakEffect
()
c
:
CancelToGrave
()
Duel
.
SendtoDeck
(
c
,
nil
,
2
,
REASON_EFFECT
)
elseif
g
==
9
then
Duel
.
SetLP
(
tp
,
8000
)
Duel
.
BreakEffect
()
c
:
CancelToGrave
()
Duel
.
SendtoDeck
(
c
,
nil
,
2
,
REASON_EFFECT
)
else
Duel
.
SetLP
(
1
-
tp
,
0
)
end
Duel
.
BreakEffect
()
c
:
CancelToGrave
()
Duel
.
SendtoDeck
(
c
,
nil
,
2
,
REASON_EFFECT
)
end
)
c
:
RegisterEffect
(
e1
)
if
not
c20000051
.
global_check
then
c20000051
.
global_check
=
true
c20000051
[
0
]
=
0
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
GetOriginalCode
()
==
20000051
end
)
ge1
:
SetOperation
(
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
c20000051
[
0
]
=
c20000051
[
0
]
+
1
end
)
Duel
.
RegisterEffect
(
ge1
,
0
)
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