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
REIKAI
ygopro-222DIY-cards
Commits
f2ae6fd7
Commit
f2ae6fd7
authored
Jan 27, 2022
by
Tachibana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eme
parent
6aa5c75f
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
1041 additions
and
3723 deletions
+1041
-3723
expansions/222DIY.cdb
expansions/222DIY.cdb
+0
-0
expansions/script/c60002000.lua
expansions/script/c60002000.lua
+37
-0
expansions/script/c60002009.lua
expansions/script/c60002009.lua
+272
-202
expansions/script/c60002010.lua
expansions/script/c60002010.lua
+35
-263
expansions/script/c60002011.lua
expansions/script/c60002011.lua
+22
-229
expansions/script/c60002012.lua
expansions/script/c60002012.lua
+25
-229
expansions/script/c60002013.lua
expansions/script/c60002013.lua
+26
-234
expansions/script/c60002014.lua
expansions/script/c60002014.lua
+22
-235
expansions/script/c60002015.lua
expansions/script/c60002015.lua
+58
-291
expansions/script/c60002016.lua
expansions/script/c60002016.lua
+52
-274
expansions/script/c60002017.lua
expansions/script/c60002017.lua
+62
-264
expansions/script/c60002018.lua
expansions/script/c60002018.lua
+49
-253
expansions/script/c60002019.lua
expansions/script/c60002019.lua
+31
-234
expansions/script/c60002020.lua
expansions/script/c60002020.lua
+38
-245
expansions/script/c60002021.lua
expansions/script/c60002021.lua
+79
-144
expansions/script/c60002022.lua
expansions/script/c60002022.lua
+65
-210
expansions/script/c60002023.lua
expansions/script/c60002023.lua
+85
-189
expansions/script/c60002024.lua
expansions/script/c60002024.lua
+83
-227
No files found.
expansions/222DIY.cdb
View file @
f2ae6fd7
No preview for this file type
expansions/script/c60002000.lua
0 → 100644
View file @
f2ae6fd7
--时光酒桌 white
local
m
=
60002000
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetCode
(
10002024
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetTargetRange
(
1
,
0
)
c
:
RegisterEffect
(
e2
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetCode
(
20002024
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetTargetRange
(
1
,
0
)
c
:
RegisterEffect
(
e2
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetCode
(
60002011
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetTargetRange
(
1
,
0
)
c
:
RegisterEffect
(
e2
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetCode
(
60002024
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetTargetRange
(
1
,
0
)
c
:
RegisterEffect
(
e2
)
end
expansions/script/c60002009.lua
View file @
f2ae6fd7
--时光酒桌 嘉月
function
c60002009
.
initial_effect
(
c
)
--set
local
m
=
60002009
local
cm
=
_G
[
"c"
..
m
]
timeTable
=
timeTable
or
{}
--set self
function
timeTable
.
set
(
c
,
code
,
extra
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002009
,
0
))
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
60002009
)
e1
:
SetCondition
(
c60002009
.
stcon1
)
e1
:
SetCost
(
c60002009
.
s
tcost
)
e1
:
SetTarget
(
c60002009
.
s
ttg
)
e1
:
SetOperation
(
c60002009
.
stop
)
e1
:
SetCountLimit
(
1
,
code
)
e1
:
SetCondition
(
timeTable
.
setIgCon
)
e1
:
SetCost
(
timeTable
.
se
tcost
)
e1
:
SetTarget
(
timeTable
.
se
ttg
)
e1
:
SetOperation
(
timeTable
.
setop
(
extra
)
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCondition
(
c60002009
.
stcon2
)
e2
:
SetCondition
(
timeTable
.
setQuCon
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
60002009
)
e2
:
SetCondition
(
c60002009
.
spcon
)
e2
:
SetTarget
(
c60002009
.
sptg
)
e2
:
SetOperation
(
c60002009
.
spop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002009
.
global_check
then
c60002009
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002009
.
checkcon
)
ge1
:
SetOperation
(
c60002009
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002009
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
return
e1
,
e2
end
function
c60002009
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002009
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002009
.
stcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
timeTable
.
setIgCon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002009
.
stcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
timeTable
.
setQuCon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002009
.
s
tcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
timeTable
.
se
tcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002009
.
s
ttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
timeTable
.
se
ttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
c60002009
.
stfil
(
c
)
return
c
:
IsCode
(
60002024
)
and
not
c
:
IsForbidden
()
end
function
c60002009
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
c
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002009
.
gtcost
)
e1
:
SetTarget
(
c60002009
.
gttg
)
e1
:
SetOperation
(
c60002009
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
function
timeTable
.
getCounter
(
c
)
--get counter type
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
if
Duel
.
IsExistingMatchingCard
(
c60002009
.
stfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002009
,
0
))
then
Duel
.
BreakEffect
()
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
c60002009
.
stfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_FZONE
,
POS_FACEUP
,
true
)
end
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002009
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
c
:
RegisterEffect
(
e1
)
--get effect by counter
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e2
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCost
(
timeTable
.
counterEffectCost
)
e2
:
SetTarget
(
timeTable
.
counterEffectTarget
)
e2
:
SetOperation
(
timeTable
.
counterEffectOperation
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
--cant use counter effect to turn end
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e3
)
end
function
c60002009
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
function
timeTable
.
setop
(
extra
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
timeTable
.
getCounter
(
c
)
if
extra
then
extra
(
e
,
tp
,
1
)
end
end
end
end
function
c60002009
.
rmfil
(
c
)
return
c
:
Is
SetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
function
timeTable
.
toGraveFilter
(
c
)
return
c
:
Is
AbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002009
.
gckfil1
(
c
,
tp
)
function
timeTable
.
groupCheckMzone
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60002009
.
gckfil2
(
c
,
tp
)
function
timeTable
.
groupCheckSzone
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
function
c60002009
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002009
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002009
.
gckfil2
,
nil
,
tp
)
<=
1
function
timeTable
.
selectToGrave
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
and
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
timeTable
.
groupCheckMzone
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
timeTable
.
groupCheckSzone
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002009
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002009
.
gckfil2
,
nil
,
tp
)
<=
1
return
g
:
FilterCount
(
timeTable
.
groupCheckMzone
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
timeTable
.
groupCheckSzone
,
nil
,
tp
)
<=
0
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
timeTable
.
groupCheckMzone
,
nil
,
tp
)
<=
0
and
g
:
FilterCount
(
timeTable
.
groupCheckSzone
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
return
g
:
FilterCount
(
timeTable
.
groupCheckMzone
,
nil
,
tp
)
<=
0
and
g
:
FilterCount
(
timeTable
.
groupCheckSzone
,
nil
,
tp
)
<=
0
end
end
function
c60002009
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
0
end
function
timeTable
.
counterEffectCost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
3
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
then
x
=
2
else
x
=
3
x
=
2
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002009
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002009
.
gck
,
x
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002009
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
local
g
=
Duel
.
GetMatchingGroup
(
timeTable
.
toGraveFilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
timeTable
.
selectToGrave
,
x
,
99
,
tp
)
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
local
sg
=
g
:
SelectSubGroup
(
tp
,
timeTable
.
selectToGrave
,
false
,
x
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_COST
)
end
function
timeTable
.
removeFilter
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
end
function
timeTable
.
chainlm
(
e
,
rp
,
tp
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
end
function
timeTable
.
counterEffectTarget
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
timeTable
.
removeFilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002009
.
chainlm
)
Duel
.
SetChainLimit
(
timeTable
.
chainlm
)
end
end
function
c60002009
.
chainlm
(
e
,
rp
,
tp
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
function
timeTable
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
function
c60002009
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
then
x
=
2
else
x
=
3
end
function
timeTable
.
immue
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
+
EFFECT_FLAG_CLIENT_HINT
+
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
timeTable
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
end
function
timeTable
.
counterEffectOperation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002009
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
not
g
:
CheckSubGroup
(
c60002009
.
gck
,
x
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002009
.
gck
,
false
,
x
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002009
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002009
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
--spsum
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
>
0
then
--immue
timeTable
.
immue
(
c
)
--remove
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
timeTable
.
removeFilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c60002009
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
--spsummon
function
timeTable
.
spsummon
(
c
,
code
,
extra3
,
extra5
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_REMOVE
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCountLimit
(
1
,
code
)
e1
:
SetCondition
(
timeTable
.
spsummonCon
)
e1
:
SetTarget
(
timeTable
.
spsummonTarget
)
e1
:
SetOperation
(
timeTable
.
spsummonOperation
(
extra3
,
extra5
))
c
:
RegisterEffect
(
e1
)
return
e1
end
function
c60002009
.
spc
on
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
timeTable
.
spsummonC
on
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002009
.
tgfil
(
c
)
function
timeTable
.
spsummonTargetFilter
(
c
)
return
c
:
IsLevel
(
9
)
and
c
:
IsAbleToGrave
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c60002009
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002009
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
timeTable
.
spsummonTarget
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
timeTable
.
spsummonTargetFilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_REMOVED
)
end
function
c60002009
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002009
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
BreakEffect
()
--
if
Duel
.
GetFlagEffect
(
tp
,
60002009
)
>=
0
then
function
timeTable
.
spsummonOperation
(
extra3
,
extra5
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
timeTable
.
spsummonTargetFilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
if
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
==
0
then
return
end
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
>
0
then
Duel
.
BreakEffect
()
if
Duel
.
GetFlagEffect
(
tp
,
m
)
>=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
timeTable
.
exsplimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetTargetRange
(
1
,
0
)
e2
:
SetValue
(
timeTable
.
effectlimit
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
end
if
Duel
.
GetFlagEffect
(
tp
,
m
)
>=
3
and
extra3
then
extra3
(
c
)
end
if
Duel
.
GetFlagEffect
(
tp
,
m
)
>=
5
and
extra5
then
extra5
(
c
)
end
end
end
end
end
function
timeTable
.
exsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
function
timeTable
.
effectlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
timeTable
.
globle
(
c
)
if
not
timeTable
.
global_check
then
timeTable
.
global_check
=
true
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetCondition
(
timeTable
.
checkcon
)
e1
:
SetOperation
(
timeTable
.
checkop
)
Duel
.
RegisterEffect
(
e1
,
0
)
return
e1
end
end
function
timeTable
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
timeTable
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
--spell2
function
timeTable
.
spell
(
c
,
extra3
,
extra5
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002009
,
2
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002009
.
xsplimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002009
.
xactlimit
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e4
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002021
,
2
))
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCondition
(
timeTable
.
actionCon
)
e1
:
SetCost
(
timeTable
.
setcost
)
e1
:
SetOperation
(
timeTable
.
SpellOperation
(
extra3
,
extra5
))
c
:
RegisterEffect
(
e1
)
end
function
timeTable
.
actionConFilter
(
c
)
return
c
:
IsFacedown
()
or
not
c
:
IsSetCard
(
0x629
)
end
function
timeTable
.
actionCon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsExistingMatchingCard
(
timeTable
.
actionConFilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
timeTable
.
SpellOperation
(
extra3
,
extra5
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetFlagEffect
(
tp
,
m
)
>=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
timeTable
.
exsplimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetTargetRange
(
1
,
0
)
e2
:
SetValue
(
timeTable
.
effectlimit
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
if
Duel
.
GetFlagEffect
(
tp
,
m
)
>=
3
and
extra3
then
extra3
(
e
,
tp
)
end
if
Duel
.
GetFlagEffect
(
tp
,
m
)
>=
5
and
extra5
then
extra5
(
e
,
tp
)
end
end
end
if
not
cm
then
return
end
---------------------------------------
function
cm
.
initial_effect
(
c
)
local
e1
=
timeTable
.
set
(
c
,
m
,
cm
.
extraMove
)
local
e2
=
timeTable
.
spsummon
(
c
,
m
,
cm
.
extra3
,
cm
.
extra5
)
timeTable
.
globle
(
c
)
end
--e1
function
cm
.
setf
(
c
)
return
c
:
IsCode
(
60002024
)
and
not
c
:
IsForbidden
()
end
function
cm
.
extraMove
(
e
,
tp
)
local
c
=
e
:
GetHandler
()
if
not
Duel
.
IsExistingMatchingCard
(
cm
.
setf
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
then
return
end
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
Duel
.
BreakEffect
()
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
setf
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_FZONE
,
POS_FACEUP
,
true
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002009
)
>=
3
then
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
--e2
function
cm
.
extra3
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002009
,
3
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_UNRELEASABLE_SUM
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
...
...
@@ -228,44 +313,29 @@ function c60002009.spop(e,tp,eg,ep,ev,re,r,rp)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_UNRELEASABLE_NONSUM
)
c
:
RegisterEffect
(
e2
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002009
)
>=
5
then
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002009
,
4
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_SOLVING
)
e2
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCondition
(
c60002009
.
negcon
)
e2
:
SetOperation
(
c60002009
.
negop
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
end
end
end
end
function
c60002009
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
function
c60002009
.
xactlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
function
cm
.
extra5
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_CHAIN_SOLVING
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCondition
(
cm
.
negcon
)
e1
:
SetOperation
(
cm
.
negop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
end
function
c
60002009
.
negcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
negcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
rp
==
1
-
tp
and
re
:
IsActiveType
(
TYPE_SPELL
)
end
function
c60002009
.
negop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002009
,
0
))
then
Duel
.
Hint
(
HINT_CARD
,
0
,
60002009
)
local
rc
=
re
:
GetHandler
()
if
Duel
.
NegateEffect
(
ev
)
and
rc
:
IsRelateToEffect
(
re
)
then
Duel
.
Destroy
(
rc
,
REASON_EFFECT
)
function
cm
.
negop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
4
))
then
Duel
.
Hint
(
HINT_CARD
,
0
,
m
)
local
rc
=
re
:
GetHandler
()
if
Duel
.
NegateEffect
(
ev
)
and
rc
:
IsRelateToEffect
(
re
)
then
Duel
.
Destroy
(
rc
,
REASON_EFFECT
)
end
e
:
Reset
()
end
e
:
Reset
()
end
end
end
\ No newline at end of file
expansions/script/c60002010.lua
View file @
f2ae6fd7
--时光酒桌 花月
function
c60002010
.
initial_effect
(
c
)
--set
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002010
,
0
))
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
60002010
)
e1
:
SetCondition
(
c60002010
.
stcon1
)
e1
:
SetCost
(
c60002010
.
stcost
)
e1
:
SetTarget
(
c60002010
.
sttg
)
e1
:
SetOperation
(
c60002010
.
stop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCondition
(
c60002010
.
stcon2
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
60002010
)
e2
:
SetCondition
(
c60002010
.
spcon
)
e2
:
SetTarget
(
c60002010
.
sptg
)
e2
:
SetOperation
(
c60002010
.
spop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002010
.
global_check
then
c60002010
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002010
.
checkcon
)
ge1
:
SetOperation
(
c60002010
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002010
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
c60002010
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002010
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002010
.
stcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002010
.
stcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002010
.
stcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002010
.
sttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
c60002010
.
stfil
(
c
)
local
m
=
60002010
local
cm
=
_G
[
"c"
..
m
]
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
function
cm
.
initial_effect
(
c
)
local
e1
=
timeTable
.
set
(
c
,
m
,
cm
.
extraMove
)
local
e2
=
timeTable
.
spsummon
(
c
,
m
,
cm
.
extra3
,
cm
.
extra5
)
timeTable
.
globle
(
c
)
end
--e1
function
cm
.
stfil
(
c
)
return
not
c
:
IsCode
(
60002010
)
and
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsForbidden
()
end
function
c
60002010
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
r
p
)
function
c
m
.
extraMove
(
e
,
t
p
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
c
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002010
.
gtcost
)
e1
:
SetTarget
(
c60002010
.
gttg
)
e1
:
SetOperation
(
c60002010
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
local
ssg
=
Group
.
FromCards
(
c
)
if
Duel
.
IsExistingMatchingCard
(
c60002010
.
stfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002010
,
0
))
then
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
c60002010
.
stfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
if
Duel
.
IsExistingMatchingCard
(
cm
.
stfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
stfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
local
e1
=
Effect
.
CreateEffect
(
tc
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
tc
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
tc
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002010
.
gtcost
)
e1
:
SetTarget
(
c60002010
.
gttg
)
e1
:
SetOperation
(
c60002010
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
tc
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e1
)
ssg
:
AddCard
(
tc
)
end
Duel
.
RaiseEvent
(
ssg
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002010
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002010
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
end
function
c60002010
.
rmfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
end
function
c60002010
.
gckfil1
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60002010
.
gckfil2
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
function
c60002010
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002010
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002010
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002010
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002010
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
end
end
function
c60002010
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
then
x
=
2
else
x
=
3
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002010
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002010
.
gck
,
x
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002010
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002010
.
chainlm
)
timeTable
.
getCounter
(
tc
)
ssg
:
AddCard
(
tc
)
end
Duel
.
RaiseEvent
(
ssg
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
function
c60002010
.
chainlm
(
e
,
rp
,
tp
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
end
function
c60002010
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
then
x
=
2
else
x
=
3
end
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002010
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
not
g
:
CheckSubGroup
(
c60002010
.
gck
,
x
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002010
.
gck
,
false
,
x
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002010
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002010
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c60002010
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
function
c60002010
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002010
.
tgfil
(
c
)
return
c
:
IsLevel
(
9
)
and
c
:
IsAbleToGrave
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c60002010
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002010
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_REMOVED
)
end
function
c60002010
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002010
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
BreakEffect
()
--
if
Duel
.
GetFlagEffect
(
tp
,
60002010
)
>=
0
then
--e2
function
cm
.
extra3
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002010
,
2
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002010
.
xsplimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002010
.
xactlimit
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e4
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002010
)
>=
3
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002010
,
3
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
...
...
@@ -251,34 +37,20 @@ function c60002010.spop(e,tp,eg,ep,ev,re,r,rp)
e1
:
SetValue
(
1000
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002010
)
>=
5
then
local
e2
=
Effect
.
CreateEffect
(
c
)
--disable search
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
60002010
,
4
))
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetCode
(
EFFECT_CANNOT_TO_HAND
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e3
:
SetTargetRange
(
0
,
1
)
e3
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsLocation
,
LOCATION_DECK
))
e3
:
SetCondition
(
c60002010
.
disscon
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e3
)
end
end
end
end
function
c60002010
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
function
c60002010
.
xactlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
function
cm
.
extra5
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_TO_HAND
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
0
,
1
)
e1
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsLocation
,
LOCATION_DECK
))
e1
:
SetCondition
(
cm
.
disscon
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
end
function
c
60002010
.
disscon
(
e
)
function
c
m
.
disscon
(
e
)
return
Duel
.
GetCurrentPhase
()
~=
PHASE_MAIN2
end
end
\ No newline at end of file
expansions/script/c60002011.lua
View file @
f2ae6fd7
--时光酒桌 辰月
function
c60002011
.
initial_effect
(
c
)
--set
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002011
,
0
))
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
60002011
)
e1
:
SetCondition
(
c60002011
.
stcon1
)
e1
:
SetCost
(
c60002011
.
stcost
)
e1
:
SetTarget
(
c60002011
.
sttg
)
e1
:
SetOperation
(
c60002011
.
stop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCondition
(
c60002011
.
stcon2
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
60002011
)
e2
:
SetCondition
(
c60002011
.
spcon
)
e2
:
SetTarget
(
c60002011
.
sptg
)
e2
:
SetOperation
(
c60002011
.
spop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002011
.
global_check
then
c60002011
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002011
.
checkcon
)
ge1
:
SetOperation
(
c60002011
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002011
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
c60002011
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002011
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002011
.
stcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002011
.
stcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002011
.
stcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002011
.
sttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
c60002011
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
c
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002011
.
gtcost
)
e1
:
SetTarget
(
c60002011
.
gttg
)
e1
:
SetOperation
(
c60002011
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002011
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Recover
(
tp
,
1000
,
REASON_EFFECT
)
end
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002011
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002011
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
end
function
c60002011
.
rmfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
end
function
c60002011
.
gckfil1
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60002011
.
gckfil2
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
function
c60002011
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002011
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002011
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002011
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002011
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
end
end
function
c60002011
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
then
x
=
2
else
x
=
3
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002011
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002011
.
gck
,
x
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002011
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002011
.
chainlm
)
end
end
function
c60002011
.
chainlm
(
e
,
rp
,
tp
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
end
function
c60002011
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
then
x
=
2
else
x
=
3
end
local
m
=
60002011
local
cm
=
_G
[
"c"
..
m
]
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
function
cm
.
initial_effect
(
c
)
local
e1
=
timeTable
.
set
(
c
,
m
,
cm
.
extraMove
)
local
e2
=
timeTable
.
spsummon
(
c
,
m
,
cm
.
extra3
,
cm
.
extra5
)
timeTable
.
globle
(
c
)
end
--e1
function
cm
.
extraMove
(
e
,
tp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002011
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
not
g
:
CheckSubGroup
(
c60002011
.
gck
,
x
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002011
.
gck
,
false
,
x
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002011
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002011
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Recover
(
tp
,
1000
,
REASON_EFFECT
)
end
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
function
c60002011
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
function
c60002011
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002011
.
tgfil
(
c
)
return
c
:
IsLevel
(
9
)
and
c
:
IsAbleToGrave
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c60002011
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002011
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_REMOVED
)
end
function
c60002011
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002011
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
BreakEffect
()
--
if
Duel
.
GetFlagEffect
(
tp
,
60002011
)
>=
0
then
--e2
function
cm
.
extra3
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002011
,
2
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002011
.
xsplimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002011
.
xactlimit
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e4
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002011
)
>=
3
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002011
,
3
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
...
...
@@ -221,30 +29,15 @@ function c60002011.spop(e,tp,eg,ep,ev,re,r,rp)
e1
:
SetValue
(
1000
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002011
)
>=
5
then
--
end
function
cm
.
extra5
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002011
,
4
))
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetCode
(
60002011
)
e2
:
SetCode
(
m
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetTargetRange
(
1
,
0
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
end
end
end
end
function
c60002011
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
function
c60002011
.
xactlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
end
\ No newline at end of file
expansions/script/c60002012.lua
View file @
f2ae6fd7
--时光酒桌 乾月
function
c60002012
.
initial_effect
(
c
)
--set
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002012
,
0
))
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
60002012
)
e1
:
SetCondition
(
c60002012
.
stcon1
)
e1
:
SetCost
(
c60002012
.
stcost
)
e1
:
SetTarget
(
c60002012
.
sttg
)
e1
:
SetOperation
(
c60002012
.
stop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCondition
(
c60002012
.
stcon2
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
60002012
)
e2
:
SetCondition
(
c60002012
.
spcon
)
e2
:
SetTarget
(
c60002012
.
sptg
)
e2
:
SetOperation
(
c60002012
.
spop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002012
.
global_check
then
c60002012
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002012
.
checkcon
)
ge1
:
SetOperation
(
c60002012
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002012
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
c60002012
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002012
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002012
.
stcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002012
.
stcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002012
.
stcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002012
.
sttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
c60002012
.
rmfil
(
c
)
local
m
=
60002012
local
cm
=
_G
[
"c"
..
m
]
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
function
cm
.
initial_effect
(
c
)
local
e1
=
timeTable
.
set
(
c
,
m
,
cm
.
extraMove
)
local
e2
=
timeTable
.
spsummon
(
c
,
m
,
cm
.
extra3
,
cm
.
extra5
)
timeTable
.
globle
(
c
)
end
--e1
function
cm
.
rmfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
end
function
c
60002012
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
r
p
)
function
c
m
.
extraMove
(
e
,
t
p
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
c
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002012
.
gtcost
)
e1
:
SetTarget
(
c60002012
.
gttg
)
e1
:
SetOperation
(
c60002012
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
if
Duel
.
IsExistingMatchingCard
(
c60002012
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002012
,
0
))
then
Duel
.
BreakEffect
()
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
c60002012
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
if
Duel
.
IsExistingMatchingCard
(
cm
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
Duel
.
BreakEffect
()
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
end
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002012
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002012
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
end
function
c60002012
.
gckfil1
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60002012
.
gckfil2
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
function
c60002012
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002012
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002012
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002012
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002012
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
end
end
function
c60002012
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
then
x
=
2
else
x
=
3
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002012
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002012
.
gck
,
x
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002012
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002012
.
chainlm
)
end
end
function
c60002012
.
chainlm
(
e
,
rp
,
tp
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
end
function
c60002012
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
then
x
=
2
else
x
=
3
end
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002012
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
not
g
:
CheckSubGroup
(
c60002012
.
gck
,
x
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002012
.
gck
,
false
,
x
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002012
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002012
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c60002012
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
function
c60002012
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002012
.
tgfil
(
c
)
return
c
:
IsLevel
(
9
)
and
c
:
IsAbleToGrave
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c60002012
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002012
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_REMOVED
)
end
function
c60002012
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002012
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
BreakEffect
()
--
if
Duel
.
GetFlagEffect
(
tp
,
60002012
)
>=
0
then
--e2
function
cm
.
extra3
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002012
,
2
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002012
.
xsplimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002012
.
xactlimit
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e4
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002012
)
>=
3
then
--indes
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002012
,
3
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_INDESTRUCTABLE_COUNT
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
...
...
@@ -223,33 +33,19 @@ function c60002012.spop(e,tp,eg,ep,ev,re,r,rp)
e1
:
SetValue
(
1
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002012
)
>=
5
then
end
function
cm
.
extra5
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002012
,
4
))
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCode
(
EFFECT_CHANGE_DAMAGE
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetTargetRange
(
1
,
0
)
e2
:
SetValue
(
c
60002012
.
val
)
e2
:
SetValue
(
c
m
.
val
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
end
end
end
end
function
c60002012
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
c
:
RegisterEffect
(
e2
)
end
function
c60002012
.
xactlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002012
.
val
(
e
,
re
,
dam
,
r
,
rp
,
rc
)
function
cm
.
val
(
e
,
re
,
dam
,
r
,
rp
,
rc
)
return
math.floor
(
dam
/
12
)
end
end
\ No newline at end of file
expansions/script/c60002013.lua
View file @
f2ae6fd7
--时光酒桌 幕月
function
c60002013
.
initial_effect
(
c
)
--set
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002013
,
0
))
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
60002013
)
e1
:
SetCondition
(
c60002013
.
stcon1
)
e1
:
SetCost
(
c60002013
.
stcost
)
e1
:
SetTarget
(
c60002013
.
sttg
)
e1
:
SetOperation
(
c60002013
.
stop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCondition
(
c60002013
.
stcon2
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
60002013
)
e2
:
SetCondition
(
c60002013
.
spcon
)
e2
:
SetTarget
(
c60002013
.
sptg
)
e2
:
SetOperation
(
c60002013
.
spop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002013
.
global_check
then
c60002013
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002013
.
checkcon
)
ge1
:
SetOperation
(
c60002013
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002013
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
c60002013
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002013
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002013
.
stcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002013
.
stcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002013
.
stcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002013
.
sttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
c60002013
.
cpfil
(
c
)
local
m
=
60002013
local
cm
=
_G
[
"c"
..
m
]
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
function
cm
.
initial_effect
(
c
)
local
e1
=
timeTable
.
set
(
c
,
m
,
cm
.
extraMove
)
local
e2
=
timeTable
.
spsummon
(
c
,
m
,
cm
.
extra3
,
cm
.
extra5
)
timeTable
.
globle
(
c
)
end
--e1
function
cm
.
stfil
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCanChangePosition
()
end
function
c
60002013
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
r
p
)
function
c
m
.
extraMove
(
e
,
t
p
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
c
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002013
.
gtcost
)
e1
:
SetTarget
(
c60002013
.
gttg
)
e1
:
SetOperation
(
c60002013
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
if
Duel
.
IsExistingMatchingCard
(
c60002013
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002013
,
0
))
then
Duel
.
BreakEffect
()
local
pc
=
Duel
.
SelectMatchingCard
(
tp
,
c60002013
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
ChangePosition
(
pc
,
POS_FACEDOWN_DEFENSE
)
if
Duel
.
IsExistingMatchingCard
(
cm
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
Duel
.
BreakEffect
()
local
pc
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
ChangePosition
(
pc
,
POS_FACEDOWN_DEFENSE
)
end
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002013
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002013
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
end
function
c60002013
.
rmfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
end
function
c60002013
.
gckfil1
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60002013
.
gckfil2
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
function
c60002013
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002013
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002013
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002013
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002013
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
end
end
function
c60002013
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002013
)
then
x
=
2
else
x
=
3
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002013
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002013
.
gck
,
x
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002013
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002013
.
chainlm
)
end
end
function
c60002013
.
chainlm
(
e
,
rp
,
tp
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
end
function
c60002013
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002013
)
then
x
=
2
else
x
=
3
end
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002013
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
not
g
:
CheckSubGroup
(
c60002013
.
gck
,
x
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002013
.
gck
,
false
,
x
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002013
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002013
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c60002013
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
function
c60002013
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002013
.
tgfil
(
c
)
return
c
:
IsLevel
(
9
)
and
c
:
IsAbleToGrave
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c60002013
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002013
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_REMOVED
)
end
function
c60002013
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002013
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
BreakEffect
()
--
if
Duel
.
GetFlagEffect
(
tp
,
60002013
)
>=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002013
,
2
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002013
.
xsplimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002013
.
xactlimit
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e4
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002013
)
>=
3
then
--e2
function
cm
.
extra3
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002013
,
3
))
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_DIRECT_ATTACK
)
e2
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
...
...
@@ -223,50 +31,34 @@ function c60002013.spop(e,tp,eg,ep,ev,re,r,rp)
e2
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x629
))
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
--damage reduce
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetCode
(
EFFECT_CHANGE_BATTLE_DAMAGE
)
e3
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e3
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x629
))
e3
:
SetCondition
(
c
60002013
.
rdcon
)
e3
:
SetCondition
(
c
m
.
rdcon
)
e3
:
SetValue
(
aux
.
ChangeBattleDamage
(
1
,
HALF_DAMAGE
))
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e3
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002013
)
>=
5
then
--
end
function
cm
.
extra5
(
c
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
60002013
,
4
))
e4
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e4
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
LOCATION_SZONE
,
0
)
e4
:
SetValue
(
c
60002013
.
efilter
)
e4
:
SetValue
(
c
m
.
efilter
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e4
)
end
end
end
end
function
c60002013
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
function
c60002013
.
xactlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002013
.
rdcon
(
e
)
function
cm
.
rdcon
(
e
)
local
c
=
e
:
GetHandler
()
local
tp
=
e
:
GetHandlerPlayer
()
return
Duel
.
GetAttackTarget
()
==
nil
and
c
:
GetEffectCount
(
EFFECT_DIRECT_ATTACK
)
<
2
and
Duel
.
GetFieldGroupCount
(
tp
,
0
,
LOCATION_MZONE
)
>
0
end
function
c
60002013
.
efilter
(
e
,
re
)
function
c
m
.
efilter
(
e
,
re
)
return
re
:
GetOwnerPlayer
()
~=
e
:
GetHandlerPlayer
()
end
end
\ No newline at end of file
expansions/script/c60002014.lua
View file @
f2ae6fd7
--时光酒桌 荷月
function
c60002014
.
initial_effect
(
c
)
--set
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002014
,
0
))
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
60002014
)
e1
:
SetCondition
(
c60002014
.
stcon1
)
e1
:
SetCost
(
c60002014
.
stcost
)
e1
:
SetTarget
(
c60002014
.
sttg
)
e1
:
SetOperation
(
c60002014
.
stop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCondition
(
c60002014
.
stcon2
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
60002014
)
e2
:
SetCondition
(
c60002014
.
spcon
)
e2
:
SetTarget
(
c60002014
.
sptg
)
e2
:
SetOperation
(
c60002014
.
spop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002014
.
global_check
then
c60002014
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002014
.
checkcon
)
ge1
:
SetOperation
(
c60002014
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002014
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
c60002014
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002014
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002014
.
stcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002014
.
stcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002014
.
stcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002014
.
sttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
c60002014
.
cpfil
(
c
)
local
m
=
60002014
local
cm
=
_G
[
"c"
..
m
]
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
function
cm
.
initial_effect
(
c
)
local
e1
=
timeTable
.
set
(
c
,
m
,
cm
.
extraMove
)
local
e2
=
timeTable
.
spsummon
(
c
,
m
,
cm
.
extra3
,
cm
.
extra5
)
timeTable
.
globle
(
c
)
end
--e1
function
cm
.
cpfil
(
c
)
return
c
:
IsAttackPos
()
and
c
:
IsCanChangePosition
()
end
function
c
60002014
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
r
p
)
function
c
m
.
extraMove
(
e
,
t
p
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
c
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002014
.
gtcost
)
e1
:
SetTarget
(
c60002014
.
gttg
)
e1
:
SetOperation
(
c60002014
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
if
Duel
.
IsExistingMatchingCard
(
c60002014
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002014
,
0
))
then
Duel
.
BreakEffect
()
local
pc
=
Duel
.
SelectMatchingCard
(
tp
,
c60002014
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
ChangePosition
(
pc
,
POS_FACEUP_DEFENSE
)
if
Duel
.
IsExistingMatchingCard
(
cm
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
Duel
.
BreakEffect
()
local
pc
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
ChangePosition
(
pc
,
POS_FACEUP_DEFENSE
)
end
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002014
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002014
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
end
function
c60002014
.
rmfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
end
function
c60002014
.
gckfil1
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60002014
.
gckfil2
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
function
c60002014
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002014
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002014
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002014
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002014
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
end
end
function
c60002014
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002014
)
then
x
=
2
else
x
=
3
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002014
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002014
.
gck
,
x
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002014
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002014
.
chainlm
)
end
end
function
c60002014
.
chainlm
(
e
,
rp
,
tp
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
end
function
c60002014
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002014
)
then
x
=
2
else
x
=
3
end
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002014
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
not
g
:
CheckSubGroup
(
c60002014
.
gck
,
x
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002014
.
gck
,
false
,
x
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002014
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002014
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c60002014
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
function
c60002014
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002014
.
tgfil
(
c
)
return
c
:
IsLevel
(
9
)
and
c
:
IsAbleToGrave
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c60002014
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002014
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_REMOVED
)
end
function
c60002014
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002014
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
BreakEffect
()
--
if
Duel
.
GetFlagEffect
(
tp
,
60002014
)
>=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002014
,
2
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002014
.
xsplimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002014
.
xactlimit
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e4
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002014
)
>=
3
then
--e2
function
cm
.
extra3
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002014
,
3
))
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_PIERCE
)
e2
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
...
...
@@ -223,12 +31,10 @@ function c60002014.spop(e,tp,eg,ep,ev,re,r,rp)
e2
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x629
))
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002014
)
>=
5
then
--
end
function
cm
.
extra5
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002014
,
4
))
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_DRAW_COUNT
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
...
...
@@ -237,23 +43,4 @@ function c60002014.spop(e,tp,eg,ep,ev,re,r,rp)
e2
:
SetValue
(
2
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
end
end
end
end
function
c60002014
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
function
c60002014
.
xactlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002014
.
rdcon
(
e
)
local
c
=
e
:
GetHandler
()
local
tp
=
e
:
GetHandlerPlayer
()
return
Duel
.
GetAttackTarget
()
==
nil
and
c
:
GetEffectCount
(
EFFECT_DIRECT_ATTACK
)
<
2
and
Duel
.
GetFieldGroupCount
(
tp
,
0
,
LOCATION_MZONE
)
>
0
end
end
\ No newline at end of file
expansions/script/c60002015.lua
View file @
f2ae6fd7
--时光酒桌 相月
function
c60002015
.
initial_effect
(
c
)
--set
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002015
,
0
))
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
60002015
)
e1
:
SetCondition
(
c60002015
.
stcon1
)
e1
:
SetCost
(
c60002015
.
stcost
)
e1
:
SetTarget
(
c60002015
.
sttg
)
e1
:
SetOperation
(
c60002015
.
stop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCondition
(
c60002015
.
stcon2
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
60002015
)
e2
:
SetCondition
(
c60002015
.
spcon
)
e2
:
SetTarget
(
c60002015
.
sptg
)
e2
:
SetOperation
(
c60002015
.
spop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002015
.
global_check
then
c60002015
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002015
.
checkcon
)
ge1
:
SetOperation
(
c60002015
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002015
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
c60002015
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002015
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002015
.
stcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002015
.
stcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002015
.
stcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002015
.
sttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
c60002015
.
thfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
not
c
:
IsCode
(
60002015
)
and
c
:
IsAbleToHand
()
end
function
c60002015
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
m
=
60002015
local
cm
=
_G
[
"c"
..
m
]
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
function
cm
.
initial_effect
(
c
)
local
e1
=
timeTable
.
set
(
c
,
m
,
cm
.
extraMove
)
local
e2
=
timeTable
.
spsummon
(
c
,
m
,
cm
.
extra3
,
cm
.
extra5
)
timeTable
.
globle
(
c
)
end
--e1
function
cm
.
thfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
not
c
:
IsCode
(
m
)
and
c
:
IsAbleToHand
()
end
function
cm
.
extraMove
(
e
,
tp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
c
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002015
.
gtcost
)
e1
:
SetTarget
(
c60002015
.
gttg
)
e1
:
SetOperation
(
c60002015
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
if
Duel
.
IsExistingMatchingCard
(
c60002015
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002015
,
0
))
then
Duel
.
BreakEffect
()
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
c60002015
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
SendtoHand
(
tc
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
if
Duel
.
IsExistingMatchingCard
(
cm
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
Duel
.
BreakEffect
()
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
SendtoHand
(
tc
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
end
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002015
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002015
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
end
function
c60002015
.
gckfil1
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60002015
.
gckfil2
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
function
c60002015
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002015
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002015
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002015
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002015
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
end
end
function
c60002015
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
then
x
=
2
else
x
=
3
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002015
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002015
.
gck
,
x
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002015
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002015
.
chainlm
)
end
end
function
c60002015
.
chainlm
(
e
,
rp
,
tp
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
end
function
c60002015
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
then
x
=
2
else
x
=
3
end
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002015
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
not
g
:
CheckSubGroup
(
c60002015
.
gck
,
x
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002015
.
gck
,
false
,
x
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002015
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002015
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c60002015
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
function
c60002015
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002015
.
tgfil
(
c
)
return
c
:
IsLevel
(
9
)
and
c
:
IsAbleToGrave
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c60002015
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002015
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_REMOVED
)
end
function
c60002015
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002015
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
BreakEffect
()
--
if
Duel
.
GetFlagEffect
(
tp
,
60002015
)
>=
0
then
--e2
function
cm
.
extra3
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002015
,
2
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002015
.
xsplimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002015
.
xactlimit
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e4
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002015
)
>=
3
then
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002015
,
3
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCost
(
c
60002015
.
gxstcost
)
e1
:
SetTarget
(
c
60002015
.
gxsttg
)
e1
:
SetOperation
(
c
60002015
.
gxstop
)
e1
:
SetCost
(
c
m
.
gxstcost
)
e1
:
SetTarget
(
c
m
.
gxsttg
)
e1
:
SetOperation
(
c
m
.
gxstop
)
c
:
RegisterEffect
(
e1
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002015
)
>=
5
then
end
function
cm
.
extra5
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002015
,
4
))
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetCode
(
60002015
)
e2
:
SetCode
(
m
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetTargetRange
(
1
,
0
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
end
end
end
end
function
c60002015
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
c
:
RegisterEffect
(
e2
)
end
function
c60002015
.
xactlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002015
.
gxstctfil
(
c
)
function
cm
.
gxstctfil
(
c
)
return
c
:
IsDiscardable
()
and
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
end
function
c
60002015
.
gxstcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c
60002015
.
gxstctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
60002015
.
gxstctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
function
c
m
.
gxstcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c
m
.
gxstctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
m
.
gxstctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
+
REASON_DISCARD
)
end
function
c
60002015
.
gxstfil
(
c
)
if
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002015
)
then
return
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
and
c
:
IsSSetable
()
function
c
m
.
gxstfil
(
c
)
if
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
m
)
then
return
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
and
c
:
IsSSetable
()
else
return
(
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
and
c
:
IsSSetable
())
or
(
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
))
return
(
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
and
c
:
IsSSetable
())
or
(
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
))
end
end
function
c
60002015
.
gxstfil1
(
c
)
function
c
m
.
gxstfil1
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c
60002015
.
gxstgck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002015
)
then
return
g
:
FilterCount
(
c60002015
.
gxstfil1
,
nil
)
<=
1
function
c
m
.
gxstgck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
m
)
then
return
g
:
FilterCount
(
cm
.
gxstfil1
,
nil
)
<=
1
else
return
g
:
FilterCount
(
c60002015
.
gxstfil1
,
nil
)
<=
0
return
g
:
FilterCount
(
cm
.
gxstfil1
,
nil
)
<=
0
end
end
function
c
60002015
.
gxsttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetMatchingGroup
(
c
60002015
.
gxstfil
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c
60002015
.
gxstgck
,
1
,
3
,
tp
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
function
c
m
.
gxsttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetMatchingGroup
(
c
m
.
gxstfil
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c
m
.
gxstgck
,
1
,
99
,
tp
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
c
60002015
.
gxstop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gxstop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
ft
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
if
ft
<=
0
or
not
g
:
CheckSubGroup
(
c
60002015
.
gxstgck
,
1
,
3
,
tp
)
then
return
end
if
ft
<=
0
or
not
g
:
CheckSubGroup
(
c
m
.
gxstgck
,
1
,
99
,
tp
)
then
return
end
if
ft
>
3
then
ft
=
3
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c
60002015
.
gxstgck
,
false
,
1
,
ft
,
tp
)
local
sg
=
g
:
SelectSubGroup
(
tp
,
c
m
.
gxstgck
,
false
,
1
,
ft
,
tp
)
local
tc
=
sg
:
GetFirst
()
while
tc
do
if
tc
:
IsType
(
TYPE_TRAP
)
then
Duel
.
SSet
(
tp
,
tc
)
else
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
local
e1
=
Effect
.
CreateEffect
(
tc
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
tc
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
tc
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002015
.
gtcost
)
e1
:
SetTarget
(
c60002015
.
gttg
)
e1
:
SetOperation
(
c60002015
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
tc
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e1
)
end
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
)
tc
:
RegisterEffect
(
e1
)
tc
=
sg
:
GetNext
()
end
end
if
tc
:
IsType
(
TYPE_TRAP
)
then
Duel
.
SSet
(
tp
,
tc
)
else
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
timeTable
.
getCounter
(
tc
)
end
tc
=
sg
:
GetNext
()
end
end
\ No newline at end of file
expansions/script/c60002016.lua
View file @
f2ae6fd7
--时光酒桌 桂月
function
c60002016
.
initial_effect
(
c
)
--set
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002016
,
0
))
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
60002016
)
e1
:
SetCondition
(
c60002016
.
stcon1
)
e1
:
SetCost
(
c60002016
.
stcost
)
e1
:
SetTarget
(
c60002016
.
sttg
)
e1
:
SetOperation
(
c60002016
.
stop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCondition
(
c60002016
.
stcon2
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
60002016
)
e2
:
SetCondition
(
c60002016
.
spcon
)
e2
:
SetTarget
(
c60002016
.
sptg
)
e2
:
SetOperation
(
c60002016
.
spop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002016
.
global_check
then
c60002016
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002016
.
checkcon
)
ge1
:
SetOperation
(
c60002016
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002016
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
c60002016
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002016
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002016
.
stcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002016
.
stcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002016
.
stcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002016
.
sttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
c60002016
.
tgtfil
(
c
)
local
m
=
60002016
local
cm
=
_G
[
"c"
..
m
]
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
function
cm
.
initial_effect
(
c
)
local
e1
=
timeTable
.
set
(
c
,
m
,
cm
.
extraMove
)
local
e2
=
timeTable
.
spsummon
(
c
,
m
,
cm
.
extra3
,
cm
.
extra5
)
timeTable
.
globle
(
c
)
end
--e1
function
cm
.
tgtfil
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsSetCard
(
0x629
)
end
function
c
60002016
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
r
p
)
function
c
m
.
extraMove
(
e
,
t
p
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
c
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002016
.
gtcost
)
e1
:
SetTarget
(
c60002016
.
gttg
)
e1
:
SetOperation
(
c60002016
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
if
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
>=
3
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002016
,
0
))
then
Duel
.
BreakEffect
()
local
fg
=
Duel
.
GetDecktopGroup
(
tp
,
3
)
Duel
.
ConfirmCards
(
1
-
tp
,
fg
)
local
tg
=
fg
:
Filter
(
c60002016
.
tgtfil
,
nil
)
Duel
.
SendtoHand
(
tg
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tg
)
if
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
>=
3
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
ConfirmDecktop
(
tp
,
3
)
local
fg
=
Duel
.
GetDecktopGroup
(
tp
,
3
)
local
tg
=
fg
:
Filter
(
cm
.
tgtfil
,
nil
)
Duel
.
SendtoHand
(
tg
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tg
)
end
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002016
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002016
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
end
function
c60002016
.
rmfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
end
function
c60002016
.
gckfil1
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60002016
.
gckfil2
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
function
c60002016
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002016
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002016
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002016
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002016
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
end
end
function
c60002016
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002016
)
then
x
=
2
else
x
=
3
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002016
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002016
.
gck
,
x
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002016
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002016
.
chainlm
)
end
end
function
c60002016
.
chainlm
(
e
,
rp
,
tp
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
end
function
c60002016
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002016
)
then
x
=
2
else
x
=
3
end
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002016
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
not
g
:
CheckSubGroup
(
c60002016
.
gck
,
x
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002016
.
gck
,
false
,
x
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002016
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002016
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c60002016
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
function
c60002016
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002016
.
tgfil
(
c
)
return
c
:
IsLevel
(
9
)
and
c
:
IsAbleToGrave
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c60002016
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002016
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_REMOVED
)
end
function
c60002016
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002016
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
BreakEffect
()
--
if
Duel
.
GetFlagEffect
(
tp
,
60002016
)
>=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002016
,
2
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002016
.
xsplimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002016
.
xactlimit
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e4
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002016
)
>=
3
then
--e2
function
cm
.
extra3
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002016
,
3
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e1
:
SetCategory
(
CATEGORY_CONTROL
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetTarget
(
c
60002016
.
cnttg
)
e1
:
SetOperation
(
c
60002016
.
cntop
)
e1
:
SetTarget
(
c
m
.
cnttg
)
e1
:
SetOperation
(
c
m
.
cntop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002016
)
>=
5
then
--
end
function
cm
.
extra5
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002016
,
4
))
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetCountLimit
(
1
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCost
(
c60002016
.
gcost
)
e2
:
SetTarget
(
c60002016
.
gtg
)
e2
:
SetOperation
(
c60002016
.
gop
)
e2
:
SetCost
(
cm
.
gcost
)
e2
:
SetOperation
(
cm
.
gop
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
end
end
end
end
function
c60002016
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
function
c60002016
.
xactlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c
60002016
.
cnttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c
m
.
cnttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsControlerCanBeChanged
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_CONTROL
,
nil
,
1
,
1
-
tp
,
LOCATION_MZONE
)
end
function
c
60002016
.
cntop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
cntop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsControlerCanBeChanged
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
if
g
:
GetCount
()
<=
0
then
return
end
local
tc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
GetControl
(
tc
,
tp
,
PHASE_END
,
2
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002016
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
,
true
)
timeTable
.
immue
(
tc
)
end
function
c
60002016
.
ggctfil
(
c
)
function
c
m
.
ggctfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsDiscardable
()
end
function
c
60002016
.
gcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c
60002016
.
ggctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
60002016
.
ggctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
function
c
m
.
gcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c
m
.
ggctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
m
.
ggctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
+
REASON_DISCARD
)
end
function
c60002016
.
gtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
function
c60002016
.
gop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
cm
.
gop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetCondition
(
c
60002016
.
gxgcon
)
e1
:
SetOperation
(
c
60002016
.
gxgop
)
e1
:
SetCondition
(
c
m
.
gxgcon
)
e1
:
SetOperation
(
c
m
.
gxgop
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e1
:
SetCondition
(
c
60002016
.
gxspcon
)
e1
:
SetOperation
(
c
60002016
.
gxspop
)
e1
:
SetCondition
(
c
m
.
gxspcon
)
e1
:
SetOperation
(
c
m
.
gxspop
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
c
60002016
.
gxgcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gxgcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
rp
~=
tp
and
re
:
GetHandler
():
IsType
(
TYPE_MONSTER
)
end
function
c
60002016
.
gxgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gxgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COS
T
+
REASON_DISCARD
,
nil
)
Duel
.
RegisterFlagEffect
(
tp
,
60002016
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_EFFEC
T
+
REASON_DISCARD
,
nil
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
end
function
c
60002016
.
gxspcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetFlagEffect
(
tp
,
60002016
)
>=
5
function
c
m
.
gxspcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetFlagEffect
(
tp
,
m
)
>=
5
end
function
c
60002016
.
gxspfil
(
c
,
e
,
tp
)
function
c
m
.
gxspfil
(
c
,
e
,
tp
)
return
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c
60002016
.
gxspop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gxspop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
IsExistingMatchingCard
(
c
60002016
.
gxspfil
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
nil
,
e
,
tp
)
and
Duel
.
GetLocationCount
(
LOCATION_MZONE
,
0
)
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002016
,
5
))
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
60002016
.
gxspfil
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
1
,
nil
,
e
,
tp
)
if
Duel
.
IsExistingMatchingCard
(
c
m
.
gxspfil
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
nil
,
e
,
tp
)
and
Duel
.
GetLocationCount
(
LOCATION_MZONE
,
0
)
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
5
))
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
m
.
gxspfil
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
end
\ No newline at end of file
expansions/script/c60002017.lua
View file @
f2ae6fd7
--时光酒桌 菊月
function
c60002017
.
initial_effect
(
c
)
--set
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002017
,
0
))
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
60002017
)
e1
:
SetCondition
(
c60002017
.
stcon1
)
e1
:
SetCost
(
c60002017
.
stcost
)
e1
:
SetTarget
(
c60002017
.
sttg
)
e1
:
SetOperation
(
c60002017
.
stop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCondition
(
c60002017
.
stcon2
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
60002017
)
e2
:
SetCondition
(
c60002017
.
spcon
)
e2
:
SetTarget
(
c60002017
.
sptg
)
e2
:
SetOperation
(
c60002017
.
spop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002017
.
global_check
then
c60002017
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002017
.
checkcon
)
ge1
:
SetOperation
(
c60002017
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002017
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
c60002017
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002017
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002017
.
stcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002017
.
stcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002017
.
stcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002017
.
sttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
c60002017
.
thfil
(
c
)
local
m
=
60002017
local
cm
=
_G
[
"c"
..
m
]
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
function
cm
.
initial_effect
(
c
)
local
e1
=
timeTable
.
set
(
c
,
m
,
cm
.
extraMove
)
local
e2
=
timeTable
.
spsummon
(
c
,
m
,
cm
.
extra3
,
cm
.
extra5
)
timeTable
.
globle
(
c
)
end
--e1
function
cm
.
thfil
(
c
)
return
c
:
IsType
(
TYPE_SPELL
)
and
c
:
IsSetCard
(
0x629
)
end
function
c
60002017
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
r
p
)
function
c
m
.
extraMove
(
e
,
t
p
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
c
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002017
.
gtcost
)
e1
:
SetTarget
(
c60002017
.
gttg
)
e1
:
SetOperation
(
c60002017
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
if
Duel
.
IsExistingMatchingCard
(
c60002017
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002017
,
0
))
then
Duel
.
BreakEffect
()
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
c60002017
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
SendtoHand
(
tc
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
if
Duel
.
IsExistingMatchingCard
(
cm
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
Duel
.
BreakEffect
()
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
SendtoHand
(
tc
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
end
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002017
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002017
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
end
function
c60002017
.
rmfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
end
function
c60002017
.
gckfil1
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60002017
.
gckfil2
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
function
c60002017
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002017
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002017
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002017
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002017
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
end
end
function
c60002017
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002017
)
then
x
=
2
else
x
=
3
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002017
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002017
.
gck
,
x
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002017
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002017
.
chainlm
)
end
end
function
c60002017
.
chainlm
(
e
,
rp
,
tp
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
end
function
c60002017
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002017
)
then
x
=
2
else
x
=
3
end
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002017
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
not
g
:
CheckSubGroup
(
c60002017
.
gck
,
x
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002017
.
gck
,
false
,
x
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002017
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002017
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c60002017
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
function
c60002017
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002017
.
tgfil
(
c
)
return
c
:
IsLevel
(
9
)
and
c
:
IsAbleToGrave
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c60002017
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002017
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_REMOVED
)
end
function
c60002017
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002017
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
BreakEffect
()
--
if
Duel
.
GetFlagEffect
(
tp
,
60002017
)
>=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002017
,
2
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002017
.
xsplimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002017
.
xactlimit
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e4
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002017
)
>=
3
then
--e2
function
cm
.
extra3
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002017
,
3
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetTarget
(
c
60002017
.
addtg
)
e1
:
SetOperation
(
c
60002017
.
addop
)
e1
:
SetTarget
(
c
m
.
addtg
)
e1
:
SetOperation
(
c
m
.
addop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002017
)
>=
5
then
--
end
function
cm
.
extra5
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002017
,
4
))
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetCountLimit
(
1
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCost
(
c
60002017
.
gcost
)
e2
:
SetTarget
(
c
60002017
.
gtg
)
e2
:
SetOperation
(
c
60002017
.
gop
)
e2
:
SetCost
(
c
m
.
gcost
)
e2
:
SetTarget
(
c
m
.
gtg
)
e2
:
SetOperation
(
c
m
.
gop
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
end
end
end
end
function
c60002017
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
function
c60002017
.
xactlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c
60002017
.
addtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c
m
.
addtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
nil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
end
function
c
60002017
.
addop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
addop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
if
g
:
GetCount
()
<=
0
then
return
end
local
tc
=
g
:
GetFirst
()
while
tc
do
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SET_ATTACK_FINAL
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
tc
:
GetAttack
()
/
2
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_SET_DEFENSE_FINAL
)
e2
:
SetValue
(
tc
:
GetDefense
()
/
2
)
tc
=
g
:
GetNext
()
end
end
function
c
60002017
.
ggctfil
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SET_ATTACK_FINAL
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
tc
:
GetAttack
()
/
2
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_SET_DEFENSE_FINAL
)
e2
:
SetValue
(
tc
:
GetDefense
()
/
2
)
tc
=
g
:
GetNext
()
end
end
function
c
m
.
ggctfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsDiscardable
()
end
function
c
60002017
.
gcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c
60002017
.
ggctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
60002017
.
ggctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
function
c
m
.
gcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c
m
.
ggctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
m
.
ggctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
+
REASON_DISCARD
)
end
function
c
60002017
.
gtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c
m
.
gtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
function
c
60002017
.
gop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetCondition
(
c
60002017
.
gxgcon
)
e1
:
SetOperation
(
c
60002017
.
gxgop
)
e1
:
SetCondition
(
c
m
.
gxgcon
)
e1
:
SetOperation
(
c
m
.
gxgop
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e1
:
SetCondition
(
c
60002017
.
gxspcon
)
e1
:
SetOperation
(
c
60002017
.
gxspop
)
e1
:
SetCondition
(
c
m
.
gxspcon
)
e1
:
SetOperation
(
c
m
.
gxspop
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
c
60002017
.
gxgcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gxgcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
rp
~=
tp
and
re
:
GetHandler
():
IsType
(
TYPE_SPELL
)
end
function
c
60002017
.
gxgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gxgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
,
nil
)
Duel
.
RegisterFlagEffect
(
tp
,
60002017
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
end
function
c
60002017
.
gxspcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetFlagEffect
(
tp
,
60002017
)
>=
5
function
c
m
.
gxspcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetFlagEffect
(
tp
,
m
)
>=
5
end
function
c
60002017
.
gxspfil
(
c
)
function
c
m
.
gxspfil
(
c
)
return
c
:
IsSSetable
()
and
c
:
IsType
(
TYPE_SPELL
)
end
function
c
60002017
.
gxspop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gxspop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
IsExistingMatchingCard
(
c
60002017
.
gxspfil
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
LOCATION_SZONE
,
0
)
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002017
,
5
))
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
60002017
.
gxspfil
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
1
,
nil
)
if
Duel
.
IsExistingMatchingCard
(
c
m
.
gxspfil
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
LOCATION_SZONE
,
0
)
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
5
))
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
m
.
gxspfil
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
1
,
nil
)
Duel
.
SSet
(
tp
,
g
)
end
end
...
...
expansions/script/c60002018.lua
View file @
f2ae6fd7
--时光酒桌 坤月
function
c60002018
.
initial_effect
(
c
)
--set
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002018
,
0
))
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
60002018
)
e1
:
SetCondition
(
c60002018
.
stcon1
)
e1
:
SetCost
(
c60002018
.
stcost
)
e1
:
SetTarget
(
c60002018
.
sttg
)
e1
:
SetOperation
(
c60002018
.
stop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCondition
(
c60002018
.
stcon2
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
60002018
)
e2
:
SetCondition
(
c60002018
.
spcon
)
e2
:
SetTarget
(
c60002018
.
sptg
)
e2
:
SetOperation
(
c60002018
.
spop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002018
.
global_check
then
c60002018
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002018
.
checkcon
)
ge1
:
SetOperation
(
c60002018
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002018
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
end
function
c60002018
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002018
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002018
.
stcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002018
.
stcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002018
.
stcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002018
.
sttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
c60002018
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
m
=
60002018
local
cm
=
_G
[
"c"
..
m
]
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
function
cm
.
initial_effect
(
c
)
local
e1
=
timeTable
.
set
(
c
,
m
,
cm
.
extraMove
)
local
e2
=
timeTable
.
spsummon
(
c
,
m
,
cm
.
extra3
,
cm
.
extra5
)
timeTable
.
globle
(
c
)
end
--e1
function
cm
.
thfil
(
c
)
return
c
:
IsType
(
TYPE_SPELL
)
and
c
:
IsSetCard
(
0x629
)
end
function
cm
.
extraMove
(
e
,
tp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
c
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002018
.
gtcost
)
e1
:
SetTarget
(
c60002018
.
gttg
)
e1
:
SetOperation
(
c60002018
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
if
Duel
.
IsExistingMatchingCard
(
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002018
,
0
))
then
Duel
.
BreakEffect
()
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
NegateRelatedChain
(
tc
,
RESET_TURN_SET
)
if
Duel
.
IsExistingMatchingCard
(
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
Duel
.
BreakEffect
()
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsFaceup
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
NegateRelatedChain
(
tc
,
RESET_TURN_SET
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
...
...
@@ -103,172 +30,44 @@ function c60002018.stop(e,tp,eg,ep,ev,re,r,rp)
tc
:
RegisterEffect
(
e2
)
end
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002018
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002018
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
end
function
c60002018
.
rmfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
end
function
c60002018
.
gckfil1
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60002018
.
gckfil2
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
function
c60002018
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002018
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002018
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002018
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002018
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
end
end
function
c60002018
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002018
)
then
x
=
2
else
x
=
3
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002018
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002018
.
gck
,
x
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002018
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002018
.
chainlm
)
end
end
function
c60002018
.
chainlm
(
e
,
rp
,
tp
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
end
function
c60002018
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002018
)
then
x
=
2
else
x
=
3
end
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002018
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
not
g
:
CheckSubGroup
(
c60002018
.
gck
,
x
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002018
.
gck
,
false
,
x
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002018
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002018
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c60002018
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
function
c60002018
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002018
.
tgfil
(
c
)
return
c
:
IsLevel
(
9
)
and
c
:
IsAbleToGrave
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c60002018
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002018
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_REMOVED
)
end
function
c60002018
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002018
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
BreakEffect
()
--
if
Duel
.
GetFlagEffect
(
tp
,
60002018
)
>=
0
then
--e2
function
cm
.
extra3
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002018
,
2
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002018
.
xsplimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002018
.
xactlimit
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e4
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002018
)
>=
3
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002018
,
3
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetTarget
(
c
60002018
.
addtg
)
e1
:
SetOperation
(
c
60002018
.
addop
)
e1
:
SetTarget
(
c
m
.
addtg
)
e1
:
SetOperation
(
c
m
.
addop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002018
)
>=
5
then
--
end
function
cm
.
extra5
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002018
,
4
))
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetCountLimit
(
1
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCost
(
c60002018
.
gcost
)
e2
:
SetTarget
(
c60002018
.
gtg
)
e2
:
SetOperation
(
c60002018
.
gop
)
e2
:
SetCost
(
cm
.
gcost
)
e2
:
SetOperation
(
cm
.
gop
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
end
end
end
end
function
c60002018
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
function
c60002018
.
xactlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002018
.
tgfilter
(
c
)
function
cm
.
tgfilter
(
c
)
return
not
c
:
IsPublic
()
or
c
:
IsType
(
TYPE_MONSTER
)
end
function
c
60002018
.
addtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c
m
.
addtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
mc
=
Duel
.
GetFieldGroupCount
(
tp
,
0
,
LOCATION_MZONE
)
local
g
=
Duel
.
GetFieldGroup
(
tp
,
0
,
LOCATION_HAND
)
if
chk
==
0
then
return
mc
>
0
or
g
and
g
:
IsExists
(
c
60002018
.
tgfilter
,
1
,
nil
)
end
if
chk
==
0
then
return
mc
>
0
or
g
and
g
:
IsExists
(
c
m
.
tgfilter
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
1
-
tp
,
LOCATION_MZONE
+
LOCATION_HAND
)
end
function
c
60002018
.
addop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
addop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsType
,
1
-
tp
,
LOCATION_MZONE
+
LOCATION_HAND
,
0
,
nil
,
TYPE_MONSTER
)
if
g
:
GetCount
()
>
0
then
...
...
@@ -278,57 +77,54 @@ function c60002018.addop(e,tp,eg,ep,ev,re,r,rp)
Duel
.
SendtoGrave
(
sg
,
REASON_RULE
)
end
end
function
c
60002018
.
ggctfil
(
c
)
function
c
m
.
ggctfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsDiscardable
()
end
function
c
60002018
.
gcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c
60002018
.
ggctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
60002018
.
ggctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
function
c
m
.
gcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c
m
.
ggctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
m
.
ggctfil
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
+
REASON_DISCARD
)
end
function
c60002018
.
gtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
function
c60002018
.
gop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
cm
.
gop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetCondition
(
c
60002018
.
gxgcon
)
e1
:
SetOperation
(
c
60002018
.
gxgop
)
e1
:
SetCondition
(
c
m
.
gxgcon
)
e1
:
SetOperation
(
c
m
.
gxgop
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e1
:
SetCondition
(
c
60002018
.
gxspcon
)
e1
:
SetOperation
(
c
60002018
.
gxspop
)
e1
:
SetCondition
(
c
m
.
gxspcon
)
e1
:
SetOperation
(
c
m
.
gxspop
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
c
60002018
.
gxgcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gxgcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
rp
~=
tp
and
re
:
GetHandler
():
IsType
(
TYPE_TRAP
)
end
function
c
60002018
.
gxgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gxgop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
,
nil
)
Duel
.
RegisterFlagEffect
(
tp
,
60002018
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
end
function
c
60002018
.
gxspcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetFlagEffect
(
tp
,
60002018
)
>=
5
function
c
m
.
gxspcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetFlagEffect
(
tp
,
m
)
>=
5
end
function
c
60002018
.
gxspfil
(
c
)
function
c
m
.
gxspfil
(
c
)
return
c
:
IsSSetable
()
and
c
:
IsType
(
TYPE_TRAP
)
end
function
c
60002018
.
gxspop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gxspop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
IsExistingMatchingCard
(
c
60002018
.
gxspfil
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
LOCATION_SZONE
,
0
)
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002018
,
5
))
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
60002018
.
gxspfil
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
1
,
nil
)
if
Duel
.
IsExistingMatchingCard
(
c
m
.
gxspfil
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
LOCATION_SZONE
,
0
)
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
5
))
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c
m
.
gxspfil
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
1
,
nil
)
Duel
.
SSet
(
tp
,
g
)
end
end
expansions/script/c60002019.lua
View file @
f2ae6fd7
--时光酒桌 复月
function
c60002019
.
initial_effect
(
c
)
--set
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002019
,
0
))
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
60002019
)
e1
:
SetCondition
(
c60002019
.
stcon1
)
e1
:
SetCost
(
c60002019
.
stcost
)
e1
:
SetTarget
(
c60002019
.
sttg
)
e1
:
SetOperation
(
c60002019
.
stop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCondition
(
c60002019
.
stcon2
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
60002019
)
e2
:
SetCondition
(
c60002019
.
spcon
)
e2
:
SetTarget
(
c60002019
.
sptg
)
e2
:
SetOperation
(
c60002019
.
spop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002019
.
global_check
then
c60002019
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002019
.
checkcon
)
ge1
:
SetOperation
(
c60002019
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002019
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
c60002019
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002019
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002019
.
stcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002019
.
stcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002019
.
stcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
local
m
=
60002019
local
cm
=
_G
[
"c"
..
m
]
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
function
cm
.
initial_effect
(
c
)
local
e1
=
timeTable
.
set
(
c
,
m
,
cm
.
extraMove
)
local
e2
=
timeTable
.
spsummon
(
c
,
m
,
cm
.
extra3
,
cm
.
extra5
)
timeTable
.
globle
(
c
)
end
--e1
function
cm
.
gtxthfil
(
c
)
return
c
:
IsAbleToHand
()
and
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
end
function
c60002019
.
sttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
function
cm
.
gtxthop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
IsExistingMatchingCard
(
cm
.
gtxthfil
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
gtxthfil
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
g
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
function
c
60002019
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
r
p
)
function
c
m
.
extraMove
(
e
,
t
p
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
c
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002019
.
gtcost
)
e1
:
SetTarget
(
c60002019
.
gttg
)
e1
:
SetOperation
(
c60002019
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
--
Duel
.
BreakEffect
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e1
:
SetCountLimit
(
1
)
e1
:
SetOperation
(
c
60002019
.
gtxthop
)
e1
:
SetOperation
(
c
m
.
gtxthop
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002019
.
gtxthfil
(
c
)
return
c
:
IsAbleToHand
()
and
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
end
function
c60002019
.
gtxthop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
IsExistingMatchingCard
(
c60002019
.
gtxthfil
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002019
,
0
))
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002019
.
gtxthfil
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
g
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
function
c60002019
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002019
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
end
function
c60002019
.
rmfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
end
function
c60002019
.
gckfil1
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60002019
.
gckfil2
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
function
c60002019
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002019
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002019
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002019
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002019
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
end
end
function
c60002019
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002019
)
then
x
=
2
else
x
=
3
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002019
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002019
.
gck
,
x
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002019
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002019
.
chainlm
)
end
end
function
c60002019
.
chainlm
(
e
,
rp
,
tp
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
end
function
c60002019
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002019
)
then
x
=
2
else
x
=
3
end
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002019
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
not
g
:
CheckSubGroup
(
c60002019
.
gck
,
x
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002019
.
gck
,
false
,
x
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002019
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002019
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c60002019
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
function
c60002019
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002019
.
tgfil
(
c
)
return
c
:
IsLevel
(
9
)
and
c
:
IsAbleToGrave
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c60002019
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002019
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_REMOVED
)
end
function
c60002019
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002019
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
BreakEffect
()
--
if
Duel
.
GetFlagEffect
(
tp
,
60002019
)
>=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002019
,
2
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002019
.
xsplimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002019
.
xactlimit
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e4
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002019
)
>=
3
then
--e2
function
cm
.
extra3
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002019
,
3
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_TRAP_ACT_IN_HAND
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
...
...
@@ -236,35 +44,24 @@ function c60002019.spop(e,tp,eg,ep,ev,re,r,rp)
e1
:
SetCountLimit
(
1
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002019
)
>=
5
then
--
end
function
cm
.
extra5
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002019
,
4
))
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e2
:
SetCountLimit
(
1
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetTarget
(
c
60002019
.
gtg
)
e2
:
SetOperation
(
c
60002019
.
gop
)
e2
:
SetTarget
(
c
m
.
gtg
)
e2
:
SetOperation
(
c
m
.
gop
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e2
)
end
end
end
end
function
c60002019
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
function
c60002019
.
xactlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c
60002019
.
gtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c
m
.
gtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsAttackPos
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
end
function
c
60002019
.
gop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
gop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
--
local
e1
=
Effect
.
CreateEffect
(
c
)
...
...
expansions/script/c60002020.lua
View file @
f2ae6fd7
--时光酒桌 冰月
function
c60002020
.
initial_effect
(
c
)
--set
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002020
,
0
))
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
60002020
)
e1
:
SetCondition
(
c60002020
.
stcon1
)
e1
:
SetCost
(
c60002020
.
stcost
)
e1
:
SetTarget
(
c60002020
.
sttg
)
e1
:
SetOperation
(
c60002020
.
stop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMING_END_PHASE
)
e2
:
SetCondition
(
c60002020
.
stcon2
)
c
:
RegisterEffect
(
e2
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
60002020
)
e2
:
SetCondition
(
c60002020
.
spcon
)
e2
:
SetTarget
(
c60002020
.
sptg
)
e2
:
SetOperation
(
c60002020
.
spop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002020
.
global_check
then
c60002020
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002020
.
checkcon
)
ge1
:
SetOperation
(
c60002020
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002020
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
c60002020
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002020
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002020
.
stcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002020
.
stcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002024
)
end
function
c60002020
.
stcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002020
.
sttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
c60002020
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
m
=
60002020
local
cm
=
_G
[
"c"
..
m
]
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
function
cm
.
initial_effect
(
c
)
local
e1
=
timeTable
.
set
(
c
,
m
,
cm
.
extraMove
)
local
e2
=
timeTable
.
spsummon
(
c
,
m
,
cm
.
extra3
,
cm
.
extra5
)
timeTable
.
globle
(
c
)
end
--e1
function
cm
.
extraMove
(
e
,
tp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
MoveToField
(
c
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
then
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
if
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
Duel
.
BreakEffect
()
local
dg
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
+
REASON_DISCARD
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
c
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002020
.
gtcost
)
e1
:
SetTarget
(
c60002020
.
gttg
)
e1
:
SetOperation
(
c60002020
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
c
:
RegisterEffect
(
e1
)
if
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002020
,
0
))
then
Duel
.
BreakEffect
()
local
dg
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
+
REASON_DISCARD
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetTargetRange
(
0
,
1
)
e1
:
SetValue
(
aux
.
TRUE
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetTargetRange
(
0
,
1
)
e1
:
SetValue
(
aux
.
TRUE
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
Duel
.
RaiseEvent
(
c
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002020
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002020
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
end
function
c60002020
.
rmfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
end
function
c60002020
.
gckfil1
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60002020
.
gckfil2
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
function
c60002020
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002020
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002020
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002020
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002020
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
end
end
function
c60002020
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002020
)
then
x
=
2
else
x
=
3
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002020
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002020
.
gck
,
x
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002020
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002020
.
chainlm
)
end
end
function
c60002020
.
chainlm
(
e
,
rp
,
tp
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
end
function
c60002020
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
0
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002020
)
then
x
=
2
else
x
=
3
end
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002020
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
not
g
:
CheckSubGroup
(
c60002020
.
gck
,
x
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002020
.
gck
,
false
,
x
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002020
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002020
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c60002020
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
function
c60002020
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002020
.
tgfil
(
c
)
return
c
:
IsLevel
(
9
)
and
c
:
IsAbleToGrave
()
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
end
function
c60002020
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002020
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_REMOVED
)
end
function
c60002020
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002020
.
tgfil
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
local
dg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
dg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
BreakEffect
()
--
if
Duel
.
GetFlagEffect
(
tp
,
60002020
)
>=
0
then
--e2
function
cm
.
extra3
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002020
,
2
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002020
.
xsplimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002020
.
xactlimit
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e4
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002020
)
>=
3
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002020
,
3
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCost
(
c
60002020
.
xkwcost
)
e1
:
SetTarget
(
c
60002020
.
xkwtg
)
e1
:
SetOperation
(
c
60002020
.
xkwop
)
e1
:
SetCost
(
c
m
.
xkwcost
)
e1
:
SetTarget
(
c
m
.
xkwtg
)
e1
:
SetOperation
(
c
m
.
xkwop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
end
--
if
Duel
.
GetFlagEffect
(
tp
,
60002020
)
>=
5
then
--
end
function
cm
.
extra5
(
c
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
60002020
,
4
))
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_CHAINING
)
e3
:
SetProperty
(
EFFECT_FLAG_CLIENT_HINT
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetOperation
(
c
60002020
.
chainop
)
e3
:
SetOperation
(
c
m
.
chainop
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e3
)
end
end
end
end
function
c60002020
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
function
c60002020
.
xactlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002020
.
xkwcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
cm
.
xkwcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
+
REASON_DISCARD
)
end
function
c
60002020
.
xkwtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c
m
.
xkwtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
function
c
60002020
.
xkwop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
xkwop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
...
...
@@ -272,15 +69,11 @@ function c60002020.xkwop(e,tp,eg,ep,ev,re,r,rp)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
c
60002020
.
chainop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
chainop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
re
:
GetHandler
()
==
e
:
GetHandler
()
then
Duel
.
SetChainLimit
(
c
60002020
.
chainlm
)
Duel
.
SetChainLimit
(
c
m
.
chainlm
)
end
end
function
c
60002020
.
chainlm
(
e
,
rp
,
tp
)
function
c
m
.
chainlm
(
e
,
rp
,
tp
)
return
tp
==
rp
end
end
\ No newline at end of file
expansions/script/c60002021.lua
View file @
f2ae6fd7
--时光酒桌 意识
function
c60002021
.
initial_effect
(
c
)
--Activate
local
m
=
60002021
local
cm
=
_G
[
"c"
..
m
]
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
function
cm
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002021
,
1
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e1
:
SetCategory
(
CATEGORY_REMOVE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
60002021
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
c60002021
.
accon
)
e1
:
SetTarget
(
c60002021
.
actg
)
e1
:
SetOperation
(
c60002021
.
acop
)
c
:
RegisterEffect
(
e1
)
--xx
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002021
,
2
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_HAND
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCost
(
c60002021
.
xxcost
)
e2
:
SetTarget
(
c60002021
.
xxtg
)
e2
:
SetOperation
(
c60002021
.
xxop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002021
.
global_check
then
c60002021
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002021
.
checkcon
)
ge1
:
SetOperation
(
c60002021
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002021
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
c60002021
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002021
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002021
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
not
c
:
IsSetCard
(
0x629
)
end
function
c60002021
.
accon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsExistingMatchingCard
(
c60002021
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
e1
:
SetCountLimit
(
1
,
m
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
timeTable
.
actionCon
)
e1
:
SetTarget
(
cm
.
actg
)
e1
:
SetOperation
(
cm
.
acop
)
c
:
RegisterEffect
(
e1
)
timeTable
.
spell
(
c
,
cm
.
extra3
,
cm
.
extra5
)
timeTable
.
globle
(
c
)
end
--e1
function
cm
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60002021
.
actg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_HAND
,
0
)
==
Duel
.
GetMatchingGroupCount
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_HAND
,
0
,
nil
)
and
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_HAND
,
0
)
>
0
end
function
cm
.
actg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_HAND
,
0
)
local
x
=
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_HAND
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
g
,
x
,
tp
,
LOCATION_HAND
)
if
chk
==
0
then
return
g
:
GetCount
()
==
Duel
.
GetMatchingGroupCount
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_HAND
,
0
,
nil
)
and
g
:
GetCount
()
>
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
g
,
g
:
GetCount
()
,
tp
,
LOCATION_HAND
)
if
Duel
.
GetMatchingGroup
(
Card
.
IsFacedown
,
tp
,
LOCATION_ONFIELD
,
0
,
nil
):
GetCount
()
>=
3
then
Duel
.
SetChainLimit
(
c60002021
.
chlimit
)
Duel
.
SetChainLimit
(
cm
.
chlimit
)
end
end
function
c60002021
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60002021
.
ckfil
(
c
)
function
cm
.
ckfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
or
(
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
))
end
function
c60002021
.
ssfil
(
c
)
function
cm
.
aclimit
(
e
,
re
,
tp
)
return
re
:
GetHandler
():
IsCode
(
e
:
GetLabel
())
end
function
cm
.
ssfil
(
c
)
return
c
:
IsSSetable
()
and
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
end
function
c
60002021
.
acop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
acop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_HAND
,
0
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
local
x
=
g
:
FilterCount
(
c
60002021
.
ckfil
,
nil
)
if
x
>=
0
then
Duel
.
Draw
(
tp
,
x
,
REASON_EFFECT
)
local
tc
=
g
:
GetFirst
()
while
tc
do
local
code
=
tc
:
GetCode
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetValue
(
c60002021
.
aclimit
)
e1
:
SetLabel
(
code
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
tc
=
g
:
GetNext
()
end
local
x
=
g
:
FilterCount
(
c
m
.
ckfil
,
nil
)
if
x
>=
0
then
Duel
.
Draw
(
tp
,
x
,
REASON_EFFECT
)
local
tc
=
g
:
GetFirst
()
while
tc
do
local
code
=
tc
:
GetCode
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetValue
(
cm
.
aclimit
)
e1
:
SetLabel
(
code
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
tc
=
g
:
GetNext
()
end
end
if
x
>=
2
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
if
x
>=
4
and
g
:
IsExists
(
c
60002021
.
ssfil
,
1
,
nil
)
then
local
sc
=
g
:
FilterSelect
(
tp
,
c60002021
.
ssfil
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
SSet
(
tp
,
sc
)
if
x
>=
4
and
g
:
IsExists
(
c
m
.
ssfil
,
1
,
nil
)
then
local
sc
=
g
:
FilterSelect
(
tp
,
cm
.
ssfil
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
SSet
(
tp
,
sc
)
end
end
function
c60002021
.
aclimit
(
e
,
re
,
tp
)
return
re
:
GetHandler
():
IsCode
(
e
:
GetLabel
())
end
function
c60002021
.
xxcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002021
.
xxtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
function
c60002021
.
setfilter
(
c
)
return
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
and
c
:
IsSSetable
()
end
function
c60002021
.
thfil1
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c60002021
.
thfil2
(
c
)
return
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
end
function
c60002021
.
xxop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
x
=
Duel
.
GetFlagEffect
(
tp
,
60002021
)
if
x
>=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002021
.
xsplimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002021
.
xactlimit
)
e4
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e4
,
tp
)
end
local
g
=
Duel
.
GetMatchingGroup
(
c60002021
.
setfilter
,
tp
,
LOCATION_HAND
,
0
,
nil
)
--e2
function
cm
.
extra3
(
e
,
tp
)
local
g
=
Duel
.
GetMatchingGroup
(
cm
.
setfilter
,
tp
,
LOCATION_HAND
,
0
,
nil
)
local
ct
=
math.min
(
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
),
g
:
GetCount
())
if
x
>=
3
and
ct
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
sg
=
g
:
Select
(
tp
,
1
,
ct
,
nil
)
Duel
.
SSet
(
tp
,
sg
)
--
local
tc
=
sg
:
GetFirst
()
while
tc
do
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_TRAP_ACT_IN_SET_TURN
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
tc
=
sg
:
GetNext
()
end
if
ct
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
sg
=
g
:
Select
(
tp
,
1
,
ct
,
nil
)
Duel
.
SSet
(
tp
,
sg
)
local
tc
=
sg
:
GetFirst
()
while
tc
do
local
e1
=
Effect
.
CreateEffect
(
tc
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_TRAP_ACT_IN_SET_TURN
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
tc
=
sg
:
GetNext
()
end
end
if
x
>=
5
and
Duel
.
IsExistingMatchingCard
(
c60002021
.
thfil1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c60002021
.
thfil2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
then
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
c60002021
.
thfil1
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
local
g2
=
Duel
.
SelectMatchingCard
(
tp
,
c60002021
.
thfil2
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
g1
:
Merge
(
g2
)
Duel
.
SendtoHand
(
g1
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g1
)
end
function
cm
.
extra5
(
e
,
tp
)
if
Duel
.
IsExistingMatchingCard
(
cm
.
thfil1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
thfil2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
then
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfil1
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
local
g2
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfil2
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
g1
:
Merge
(
g2
)
Duel
.
SendtoHand
(
g1
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g1
)
end
end
function
c
60002021
.
xsplimit
(
e
,
c
)
return
c
:
Is
Location
(
LOCATION_EXTRA
)
function
c
m
.
setfilter
(
c
)
return
c
:
Is
Type
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
and
c
:
IsSSetable
(
)
end
function
c
60002021
.
xactlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
function
c
m
.
thfil1
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
(
)
end
function
cm
.
thfil2
(
c
)
return
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
)
and
c
:
IsAbleToHand
()
end
\ No newline at end of file
expansions/script/c60002022.lua
View file @
f2ae6fd7
--时光酒桌 年华
function
c60002022
.
initial_effect
(
c
)
--Activate
local
m
=
60002022
local
cm
=
_G
[
"c"
..
m
]
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
function
cm
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002022
,
0
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
60002022
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
c60002022
.
acc
on
)
e1
:
SetTarget
(
c
60002022
.
actg
)
e1
:
SetOperation
(
c
60002022
.
acop
)
e1
:
SetCountLimit
(
1
,
m
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
timeTable
.
actionC
on
)
e1
:
SetTarget
(
c
m
.
actg
)
e1
:
SetOperation
(
c
m
.
acop
)
c
:
RegisterEffect
(
e1
)
--xx
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002022
,
1
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_HAND
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCost
(
c60002022
.
xxcost
)
e2
:
SetTarget
(
c60002022
.
xxtg
)
e2
:
SetOperation
(
c60002022
.
xxop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002022
.
global_check
then
c60002022
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002022
.
checkcon
)
ge1
:
SetOperation
(
c60002022
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002022
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
end
function
c60002022
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002022
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002022
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
not
c
:
IsSetCard
(
0x629
)
timeTable
.
spell
(
c
,
cm
.
extra3
,
cm
.
extra5
)
timeTable
.
globle
(
c
)
end
function
c60002022
.
accon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsExistingMatchingCard
(
c60002022
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
c60002022
.
actg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
--e1
function
cm
.
actg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
>=
10
end
if
Duel
.
GetMatchingGroup
(
Card
.
IsFacedown
,
tp
,
LOCATION_ONFIELD
,
0
,
nil
):
GetCount
()
>=
3
then
Duel
.
SetChainLimit
(
c60002022
.
chlimit
)
Duel
.
SetChainLimit
(
cm
.
chlimit
)
end
end
function
c
60002022
.
chlimit
(
e
,
ep
,
tp
)
function
c
m
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c
60002022
.
ckfil
(
c
)
function
c
m
.
ckfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
or
(
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
))
end
function
c
60002022
.
thfil1
(
c
)
function
c
m
.
thfil1
(
c
)
return
c
:
IsAbleToHand
()
and
(
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
))
end
function
c60002022
.
acop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
cm
.
aclimit
(
e
,
re
,
tp
)
return
re
:
GetHandler
():
IsCode
(
e
:
GetLabel
())
end
function
cm
.
acop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_DECK
,
0
)
<
10
then
return
end
Duel
.
ConfirmDecktop
(
tp
,
10
)
local
g
=
Duel
.
GetDecktopGroup
(
tp
,
10
)
local
x
=
g
:
FilterCount
(
c60002022
.
ckfil
,
nil
)
g1
=
g
:
Filter
(
c60002022
.
thfil1
,
nil
)
g2
=
g1
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
g2
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g2
)
--
local
g
=
g
:
Filter
(
cm
.
ckfil
,
nil
)
local
cg
=
Group
.
CreateGroup
()
if
g
:
GetCount
()
>=
0
and
g
:
FilterCount
(
cm
.
thfil1
,
nil
)
>
0
then
local
g2
=
g
:
FilterSelect
(
tp
,
cm
.
thfil1
,
1
,
1
,
nil
)
local
tc
=
g2
:
GetFirst
()
local
code
=
tc
:
GetCode
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetValue
(
c60002022
.
aclimit
)
e1
:
SetLabel
(
code
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
if
x
>=
2
and
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
if
x
>=
4
then
local
g1
=
g1
:
Sub
(
g2
)
local
g3
=
g1
:
FilterSelect
(
Card
.
IsAbleToHand
,
nil
)
Duel
.
SendtoHand
(
g3
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g3
)
end
end
function
c60002022
.
aclimit
(
e
,
re
,
tp
)
return
re
:
GetHandler
():
IsCode
(
e
:
GetLabel
())
end
function
c60002022
.
xxcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002022
.
xxtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
function
c60002022
.
setfilter
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c60002022
.
xxop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
x
=
Duel
.
GetFlagEffect
(
tp
,
60002022
)
if
x
>=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002022
.
xsplimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002022
.
xactlimit
)
e4
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e4
,
tp
)
end
if
x
>=
3
and
Duel
.
IsExistingMatchingCard
(
c60002022
.
setfilter
,
tp
,
LOCATION_GRAVE
,
0
,
2
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>=
2
then
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
c60002022
.
setfilter
,
tp
,
LOCATION_GRAVE
,
0
,
2
,
2
,
nil
)
local
tc
=
sg
:
GetFirst
()
while
tc
do
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
local
e1
=
Effect
.
CreateEffect
(
tc
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
tc
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
tc
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002022
.
gtcost
)
e1
:
SetTarget
(
c60002022
.
gttg
)
e1
:
SetOperation
(
c60002022
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
tc
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e1
)
tc
=
sg
:
GetNext
()
if
Duel
.
SendtoHand
(
tc
,
tp
,
REASON_EFFECT
)
>
0
then
cg
:
AddCard
(
tc
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetValue
(
cm
.
aclimit
)
e1
:
SetLabel
(
tc
:
GetCode
())
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
Duel
.
RaiseEvent
(
sg
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
if
g
:
GetCount
()
>=
2
and
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
then
local
dc
=
Duel
.
GetDecktopGroup
(
tp
,
1
):
GetFirst
()
cg
:
AddCard
(
dc
)
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
if
x
>=
5
and
Duel
.
IsPlayerCanDraw
(
tp
,
3
)
then
Duel
.
Draw
(
tp
,
3
,
REASON_EFFECT
)
if
g
:
GetCount
()
>=
4
and
g
:
FilterCount
(
Card
.
IsAbleToHand
,
cg
)
>
0
then
local
g3
=
g
:
FilterSelect
(
tp
,
Card
.
IsAbleToHand
,
1
,
1
,
cg
)
Duel
.
SendtoHand
(
g3
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g3
)
end
end
function
c60002022
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002022
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
end
function
c60002022
.
rmfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsAbleToRemove
()
end
function
c60002022
.
gckfil1
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60002022
.
gckfil2
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
function
c60002022
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
20002024
)
then
return
g
:
FilterCount
(
c60002022
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002022
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
10002024
)
then
return
not
g
:
IsExists
(
c60002022
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002022
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
--e2
function
cm
.
setf
(
c
)
return
c
:
IsSSetable
()
and
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
cm
.
extra3
(
e
,
tp
)
if
Duel
.
IsExistingMatchingCard
(
cm
.
setf
,
tp
,
LOCATION_GRAVE
,
0
,
2
,
nil
)
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
setf
,
tp
,
LOCATION_GRAVE
,
0
,
2
,
2
,
nil
)
local
tc
=
sg
:
GetFirst
()
while
tc
do
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
timeTable
.
getCounter
(
tc
)
tc
=
sg
:
GetNext
()
end
end
end
function
c60002022
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetMatchingGroup
(
c60002022
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002022
.
gck
,
3
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002022
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002022
.
chainlm
)
end
end
function
c60002022
.
chainlm
(
e
,
rp
,
tp
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
end
function
c60002022
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002022
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
not
g
:
CheckSubGroup
(
c60002022
.
gck
,
3
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002022
.
gck
,
false
,
3
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002022
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002022
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
function
cm
.
extra5
(
e
,
tp
)
if
Duel
.
IsPlayerCanDraw
(
tp
,
3
)
then
Duel
.
Draw
(
tp
,
3
,
REASON_EFFECT
)
end
end
function
c60002022
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
function
c60002022
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
function
c60002022
.
xactlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
end
\ No newline at end of file
expansions/script/c60002023.lua
View file @
f2ae6fd7
--时光酒桌 刹那
function
c60002023
.
initial_effect
(
c
)
--Activate
local
m
=
60002023
local
cm
=
_G
[
"c"
..
m
]
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
function
cm
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002023
,
1
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
60002023
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
c60002023
.
accon
)
e1
:
SetCost
(
c60002023
.
accost
)
e1
:
SetTarget
(
c60002023
.
actg
)
e1
:
SetOperation
(
c60002023
.
acop
)
c
:
RegisterEffect
(
e1
)
--xx
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
60002023
,
2
))
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_HAND
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCost
(
c60002023
.
xxcost
)
e2
:
SetTarget
(
c60002023
.
xxtg
)
e2
:
SetOperation
(
c60002023
.
xxop
)
c
:
RegisterEffect
(
e2
)
if
not
c60002023
.
global_check
then
c60002023
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002023
.
checkcon
)
ge1
:
SetOperation
(
c60002023
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002023
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
c60002023
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002023
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c60002023
.
accon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsExistingMatchingCard
(
c60002023
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
c60002023
.
accost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemoveAsCost
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemoveAsCost
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
99
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
e
:
SetLabel
(
g
:
GetCount
())
end
function
c60002023
.
actg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
x
=
e
:
GetLabel
()
e1
:
SetCountLimit
(
1
,
m
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
timeTable
.
actionCon
)
e1
:
SetCost
(
cm
.
accost
)
e1
:
SetTarget
(
cm
.
actg
)
e1
:
SetOperation
(
cm
.
acop
)
c
:
RegisterEffect
(
e1
)
timeTable
.
spell
(
c
,
cm
.
extra3
,
cm
.
extra5
)
timeTable
.
globle
(
c
)
end
--e1
function
cm
.
accost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
rc
=
Duel
.
GetMatchingGroupCount
(
Card
.
IsAbleToRemoveAsCost
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
nil
)
local
rh
=
Duel
.
GetMatchingGroupCount
(
Card
.
IsAbleToHand
,
tp
,
0
,
LOCATION_ONFIELD
,
nil
)
local
count
=
math.min
(
rc
,
rh
)
if
chk
==
0
then
return
count
>
0
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemoveAsCost
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
count
,
nil
)
local
count
=
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
e
:
SetLabel
(
count
)
end
function
cm
.
actg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
if
Duel
.
GetMatchingGroup
(
Card
.
IsFacedown
,
tp
,
LOCATION_ONFIELD
,
0
,
nil
):
GetCount
()
>=
3
then
Duel
.
SetChainLimit
(
c60002023
.
chlimit
)
Duel
.
SetChainLimit
(
cm
.
chlimit
)
end
end
function
c
60002023
.
chlimit
(
e
,
ep
,
tp
)
function
c
m
.
chlimit
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
c60002023
.
acop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
cm
.
aclimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_SPELL
+
TYPE_TRAP
)
end
function
cm
.
acop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
x
=
e
:
GetLabel
()
if
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToHand
,
tp
,
0
,
LOCATION_ONFIELD
,
x
,
nil
)
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToHand
,
tp
,
0
,
LOCATION_ONFIELD
,
x
,
x
,
nil
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EFFECT_CANNOT_SUMMON
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
Duel
.
RegisterEffect
(
e2
,
tp
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetValue
(
c60002023
.
aclimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
if
x
>=
2
and
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
if
x
>=
4
then
Duel
.
SkipPhase
(
tp
,
PHASE_DRAW
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_STANDBY
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_MAIN1
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_BATTLE
,
RESET_PHASE
+
PHASE_END
,
1
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_MAIN2
,
RESET_PHASE
+
PHASE_END
,
1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_BP
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToHand
,
tp
,
0
,
LOCATION_ONFIELD
,
x
,
x
,
nil
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EFFECT_CANNOT_SUMMON
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
Duel
.
RegisterEffect
(
e2
,
tp
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetValue
(
cm
.
aclimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
if
x
>=
2
and
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
if
x
>=
4
then
Duel
.
SkipPhase
(
tp
,
PHASE_DRAW
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_STANDBY
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_MAIN1
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_BATTLE
,
RESET_PHASE
+
PHASE_END
,
1
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_MAIN2
,
RESET_PHASE
+
PHASE_END
,
1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_BP
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
end
function
c60002023
.
aclimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_SPELL
+
TYPE_TRAP
)
end
function
c60002023
.
xxcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
c60002023
.
xxtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
function
c60002023
.
thfil
(
c
)
--e2
function
cm
.
thfil
(
c
)
return
c
:
IsAbleToHand
()
and
(
c
:
IsType
(
TYPE_TRAP
)
and
c
:
IsType
(
TYPE_COUNTER
))
end
function
c60002023
.
xxop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
x
=
Duel
.
GetFlagEffect
(
tp
,
60002023
)
if
x
>=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
c60002023
.
xsplimit
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e4
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetTargetRange
(
1
,
0
)
e4
:
SetValue
(
c60002023
.
xactlimit
)
e4
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e4
,
tp
)
function
cm
.
extra3
(
e
,
tp
)
if
Duel
.
IsExistingMatchingCard
(
cm
.
thfil
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
then
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfil
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
sg
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
sg
)
end
if
x
>=
3
and
Duel
.
IsExistingMatchingCard
(
c60002023
.
thfil
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
then
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
c60002023
.
thfil
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
sg
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
sg
)
end
if
x
>=
5
then
end
function
cm
.
extra5
(
e
,
tp
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_DISABLE
)
e1
:
SetTargetRange
(
LOCATION_ONFIELD
,
0
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x629
))
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_CANNOT_DISEFFECT
)
e2
:
SetValue
(
c
60002023
.
dxefil
)
e2
:
SetValue
(
c
m
.
dxefil
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
end
function
c60002023
.
efilter
(
e
,
ct
)
local
te
=
Duel
.
GetChainInfo
(
ct
,
CHAININFO_TRIGGERING_EFFECT
)
return
te
:
GetHandler
():
IsControler
(
e
:
GetOwnerPlayer
())
and
te
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
c60002023
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002023
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002023
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
0
,
3
,
e
:
GetHandler
())
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002023
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
0
,
3
,
3
,
e
:
GetHandler
())
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
end
function
c60002023
.
rmfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsAbleToRemove
()
end
function
c60002023
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c60002023
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002023
.
chainlm
)
end
end
function
c60002023
.
chainlm
(
e
,
rp
,
tp
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
end
function
c60002023
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002023
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002023
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
c60002023
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
end
function
c60002023
.
xsplimit
(
e
,
c
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
end
function
c60002023
.
xactlimit
(
e
,
re
,
tp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
re
:
GetHandler
():
IsSetCard
(
0x629
)
end
function
cm
.
dxefil
(
e
,
ct
)
local
p
=
e
:
GetHandler
():
GetControler
()
local
te
,
tp
=
Duel
.
GetChainInfo
(
ct
,
CHAININFO_TRIGGERING_EFFECT
,
CHAININFO_TRIGGERING_PLAYER
)
return
p
==
tp
and
te
:
GetHandler
():
IsSetCard
(
0x629
)
end
\ No newline at end of file
expansions/script/c60002024.lua
View file @
f2ae6fd7
--时光酒桌 门扉
function
c60002024
.
initial_effect
(
c
)
--Activate
local
m
=
60002024
local
cm
=
_G
[
"c"
..
m
]
if
not
pcall
(
function
()
require
(
"expansions/script/c60002009"
)
end
)
then
require
(
"script/c60002009"
)
end
function
cm
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
60002024
,
0
))
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_TODECK
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
60002024
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
c60002024
.
accon
)
e1
:
SetTarget
(
c60002024
.
actg
)
e1
:
SetOperation
(
c60002024
.
acop
)
c
:
RegisterEffect
(
e1
)
--change effect type
e1
:
SetCountLimit
(
1
,
m
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
timeTable
.
actionCon
)
e1
:
SetTarget
(
cm
.
actg
)
e1
:
SetOperation
(
cm
.
acop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetCode
(
10002024
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetTargetRange
(
1
,
0
)
e2
:
SetCondition
(
c60002024
.
cetcon1
)
c
:
RegisterEffect
(
e2
)
--change effect type
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetCode
(
10002024
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetTargetRange
(
1
,
0
)
e2
:
SetCondition
(
c60002024
.
cetcon2
)
c
:
RegisterEffect
(
e2
)
--change effect type
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetCode
(
60002024
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetTargetRange
(
1
,
0
)
e2
:
SetCondition
(
c60002024
.
cetcon3
)
c
:
RegisterEffect
(
e2
)
--change
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetCategory
(
CATEGORY_POSITION
)
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetCode
(
EVENT_CHAINING
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetRange
(
LOCATION_FZONE
)
e3
:
SetCountLimit
(
1
)
e3
:
SetCondition
(
c60002024
.
cetcon4
)
e3
:
SetTarget
(
c60002024
.
cptg
)
e3
:
SetOperation
(
c60002024
.
cpop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e1
:
Clone
()
e3
:
SetCode
(
20002024
)
e3
:
SetCondition
(
cm
.
condition3
)
c
:
RegisterEffect
(
e3
)
if
not
c60002024
.
global_check
then
c60002024
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetCondition
(
c60002024
.
checkcon
)
ge1
:
SetOperation
(
c60002024
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
c60002024
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsType
(
TYPE_TRAP
)
and
rc
:
IsType
(
TYPE_COUNTER
)
end
function
c60002024
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
=
re
:
GetHandlerPlayer
()
Duel
.
RegisterFlagEffect
(
p
,
60002024
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
local
c
=
e
:
GetHandler
()
local
flag
=
c
:
GetFlagEffectLabel
(
60002024
)
if
flag
==
nil
then
c
:
RegisterFlagEffect
(
60002024
,
RESET_PHASE
+
PHASE_END
,
EFFECT_FLAG_CLIENT_HINT
,
1
,
1
,
0
)
else
c
:
SetFlagEffectLabel
(
60002024
,
flag
+
1
)
end
c
:
ResetFlagEffect
(
30002024
)
c
:
RegisterFlagEffect
(
30002024
,
RESET_PHASE
+
PHASE_END
,
EFFECT_FLAG_CLIENT_HINT
,
1
,
1
,
aux
.
Stringid
(
60002024
,
flag
))
end
function
c60002024
.
cetcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
Duel
.
GetFlagEffect
(
tp
,
60002024
)
return
x
>=
0
end
function
c60002024
.
cetcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
Duel
.
GetFlagEffect
(
tp
,
60002024
)
return
x
>=
2
end
function
c60002024
.
cetcon3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
Duel
.
GetFlagEffect
(
tp
,
60002024
)
return
x
>=
12
end
function
c60002024
.
cetcon4
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
Duel
.
GetFlagEffect
(
tp
,
60002024
)
return
x
>=
4
end
function
c60002024
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
not
c
:
IsSetCard
(
0x629
)
end
function
c60002024
.
accon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
Duel
.
IsExistingMatchingCard
(
c60002024
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
c60002024
.
setfilter
(
c
)
local
e4
=
e1
:
Clone
()
e4
:
SetCode
(
m
)
e4
:
SetCondition
(
cm
.
condition4
)
c
:
RegisterEffect
(
e4
)
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetCategory
(
CATEGORY_POSITION
)
e5
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e5
:
SetCode
(
EVENT_CHAINING
)
e5
:
SetRange
(
LOCATION_FZONE
)
e5
:
SetCountLimit
(
1
)
e5
:
SetCondition
(
cm
.
condition5
)
e5
:
SetTarget
(
cm
.
cptg
)
e5
:
SetOperation
(
cm
.
cpop
)
c
:
RegisterEffect
(
e5
)
timeTable
.
globle
(
c
)
end
--e1
function
cm
.
setfilter
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c
60002024
.
actg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
nil
,
tp
,
LOCATION_SZONE
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c
60002024
.
setfilter
,
tp
,
LOCATION_DECK
,
0
,
3
,
nil
)
end
function
c
m
.
actg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
nil
,
tp
,
LOCATION_SZONE
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
c
m
.
setfilter
,
tp
,
LOCATION_DECK
,
0
,
3
,
nil
)
end
local
sg
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
LOCATION_SZONE
,
0
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
sg
,
sg
:
GetCount
(),
tp
,
LOCATION_SZONE
)
end
function
c
60002024
.
acop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
acop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
dg
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
LOCATION_SZONE
,
0
,
nil
)
if
dg
:
GetCount
()
>=
0
and
Duel
.
IsExistingMatchingCard
(
c60002024
.
setfilter
,
tp
,
LOCATION_DECK
,
0
,
3
,
nil
)
then
Duel
.
SendtoDeck
(
dg
,
nil
,
2
,
REASON_EFFECT
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
c60002024
.
setfilter
,
tp
,
LOCATION_DECK
,
0
,
3
,
3
,
nil
)
local
tc
=
sg
:
GetFirst
()
while
tc
do
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
local
e1
=
Effect
.
CreateEffect
(
tc
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
)
e1
:
SetValue
(
TYPE_TRAP
+
TYPE_COUNTER
)
tc
:
RegisterEffect
(
e1
)
--get
local
e1
=
Effect
.
CreateEffect
(
tc
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
+
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCost
(
c60002024
.
gtcost
)
e1
:
SetTarget
(
c60002024
.
gttg
)
e1
:
SetOperation
(
c60002024
.
gtop
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
local
e1
=
Effect
.
CreateEffect
(
tc
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e1
)
tc
=
sg
:
GetNext
()
end
Duel
.
SkipPhase
(
tp
,
PHASE_DRAW
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_STANDBY
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_MAIN1
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_BATTLE
,
RESET_PHASE
+
PHASE_END
,
1
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_MAIN2
,
RESET_PHASE
+
PHASE_END
,
1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_BP
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
Duel
.
RaiseEvent
(
sg
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002024
.
gctfil
(
c
)
return
c
:
IsAbleToGraveAsCost
()
and
c
:
IsFacedown
()
end
function
c60002024
.
gtcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ChangePosition
(
e
:
GetHandler
(),
POS_FACEUP
)
end
function
c60002024
.
rmfil
(
c
)
return
c
:
IsSetCard
(
0x629
)
and
c
:
IsAbleToRemove
()
end
function
c60002024
.
gckfil1
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
c60002024
.
gckfil2
(
c
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsLocation
(
LOCATION_SZONE
)
end
function
c60002024
.
gck
(
g
,
tp
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
return
g
:
FilterCount
(
c60002024
.
gckfil1
,
nil
,
tp
)
<=
1
and
g
:
FilterCount
(
c60002024
.
gckfil2
,
nil
,
tp
)
<=
1
elseif
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
return
not
g
:
IsExists
(
c60002024
.
gckfil1
,
1
,
nil
,
tp
)
and
g
:
FilterCount
(
c60002024
.
gckfil2
,
nil
,
tp
)
<=
1
else
return
not
g
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
tp
)
end
end
function
c60002024
.
gttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetMatchingGroup
(
c60002024
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
chk
==
0
then
return
g
:
CheckSubGroup
(
c60002024
.
gck
,
3
,
3
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
c60002024
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
tp
,
LOCATION_SZONE
)
if
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
Duel
.
SetChainLimit
(
c60002024
.
chainlm
)
if
dg
:
GetCount
()
>=
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
setfilter
,
tp
,
LOCATION_DECK
,
0
,
3
,
nil
)
then
Duel
.
SendtoDeck
(
dg
,
nil
,
2
,
REASON_EFFECT
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
setfilter
,
tp
,
LOCATION_DECK
,
0
,
3
,
3
,
nil
)
local
tc
=
sg
:
GetFirst
()
while
tc
do
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
timeTable
.
getCounter
(
tc
)
tc
=
sg
:
GetNext
()
end
Duel
.
SkipPhase
(
tp
,
PHASE_DRAW
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_STANDBY
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_MAIN1
,
RESET_PHASE
+
PHASE_END
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_BATTLE
,
RESET_PHASE
+
PHASE_END
,
1
,
1
)
Duel
.
SkipPhase
(
tp
,
PHASE_MAIN2
,
RESET_PHASE
+
PHASE_END
,
1
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_BP
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
Duel
.
RaiseEvent
(
sg
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
end
function
c60002024
.
chainlm
(
e
,
rp
,
tp
)
return
e
:
GetHandler
():
IsType
(
TYPE_COUNTER
)
--e2,3,4
function
cm
.
condition3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
Duel
.
GetFlagEffect
(
tp
,
60002009
)
return
x
>=
2
end
function
c60002024
.
gtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c60002024
.
gctfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
e
:
GetHandler
())
if
not
g
:
CheckSubGroup
(
c60002024
.
gck
,
3
,
3
,
tp
)
then
return
end
local
sg
=
g
:
SelectSubGroup
(
tp
,
c60002024
.
gck
,
false
,
3
,
3
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c60002024
.
immval
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
,
true
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c60002024
.
rmfil
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
function
cm
.
condition4
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
Duel
.
GetFlagEffect
(
tp
,
60002009
)
return
x
>=
12
end
function
c60002024
.
immval
(
e
,
te
)
return
((
te
:
IsActiveType
(
TYPE_MONSTER
)
and
te
:
GetOwner
():
IsSummonLocation
(
LOCATION_EXTRA
))
or
te
:
IsActiveType
(
TYPE_TRAP
))
and
te
:
GetHandlerPlayer
()
~=
tp
function
cm
.
condition5
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
x
=
Duel
.
GetFlagEffect
(
tp
,
60002009
)
return
x
>=
4
end
function
c
60002024
.
tgfil1
(
c
)
function
c
m
.
tgfil1
(
c
)
return
c
:
IsFacedown
()
and
c
:
IsAbleToGrave
()
end
function
c60002024
.
tgfil
(
c
,
tp
)
local
g
=
Duel
.
GetMatchingGroup
(
c60002024
.
tgfil1
,
tp
,
LOCATION_ONFIELD
,
0
,
nil
)
local
g1
=
Duel
.
GetMatchingGroup
(
c60002024
.
tgfil1
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
local
g2
=
Duel
.
GetMatchingGroup
(
c60002024
.
tgfil1
,
tp
,
0
,
LOCATION_SZONE
,
nil
)
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
10002024
)
then
g
:
Merge
(
g1
)
end
if
Duel
.
IsPlayerAffectedByEffect
(
tp
,
20002024
)
then
g
:
Merge
(
g2
)
end
return
g
:
IsContains
(
c
)
and
Duel
.
IsExistingMatchingCard
(
c60002024
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
function
c60002024
.
cpfil
(
c
)
function
cm
.
cpfil
(
c
)
return
c
:
IsCanChangePosition
()
and
c
:
IsFaceup
()
end
function
c60002024
.
cptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
(
Duel
.
IsExistingMatchingCard
(
c60002024
.
tgfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
,
tp
)
or
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
))
and
Duel
.
IsExistingMatchingCard
(
c60002024
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
function
cm
.
cptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
and
(
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
or
Duel
.
IsExistingMatchingCard
(
cm
.
tgfil1
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
))
end
end
function
c
60002024
.
cpop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c
m
.
cpop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
c
60002024
.
tgfil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
nil
,
tp
)
if
g
:
GetCount
()
>
0
or
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
then
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
60002024
,
0
))
then
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
end
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
c60002024
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
ChangePosition
(
tc
,
POS_FACEDOWN_DEFENSE
)
local
g
=
Duel
.
GetMatchingGroup
(
c
m
.
tgfil1
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
nil
)
if
g
:
GetCount
()
>
0
or
Duel
.
IsPlayerAffectedByEffect
(
tp
,
60002011
)
then
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
sg
,
REASON_EFFECT
)
end
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
cpfil
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
ChangePosition
(
tc
,
POS_FACEDOWN_DEFENSE
)
end
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