Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-222DIY-cards
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alstroemeria-silentlove
ygopro-222DIY-cards
Commits
f5173df4
Commit
f5173df4
authored
Feb 10, 2025
by
Huangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add orther data lua
parent
3de1c6f4
Pipeline
#33063
passed with stage
in 10 minutes and 58 seconds
Changes
41
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
5216 additions
and
109 deletions
+5216
-109
expansions/script/c16104242.lua
expansions/script/c16104242.lua
+84
-0
expansions/script/c16150001.lua
expansions/script/c16150001.lua
+80
-0
expansions/script/c16150002.lua
expansions/script/c16150002.lua
+76
-0
expansions/script/c16150003.lua
expansions/script/c16150003.lua
+76
-0
expansions/script/c16150004.lua
expansions/script/c16150004.lua
+60
-0
expansions/script/c16150005.lua
expansions/script/c16150005.lua
+112
-0
expansions/script/c16150006.lua
expansions/script/c16150006.lua
+56
-0
expansions/script/c16150007.lua
expansions/script/c16150007.lua
+92
-0
expansions/script/c16150008.lua
expansions/script/c16150008.lua
+166
-0
expansions/script/c16150009.lua
expansions/script/c16150009.lua
+255
-0
expansions/script/c16150010.lua
expansions/script/c16150010.lua
+100
-0
expansions/script/c16150011.lua
expansions/script/c16150011.lua
+100
-0
expansions/script/c16150012.lua
expansions/script/c16150012.lua
+109
-0
expansions/script/c16150013.lua
expansions/script/c16150013.lua
+142
-0
expansions/script/c16150014.lua
expansions/script/c16150014.lua
+228
-0
expansions/script/c16150015.lua
expansions/script/c16150015.lua
+104
-0
expansions/script/c16150017.lua
expansions/script/c16150017.lua
+136
-0
expansions/script/c16150018.lua
expansions/script/c16150018.lua
+291
-0
expansions/script/c16150019.lua
expansions/script/c16150019.lua
+58
-0
expansions/script/c16150020.lua
expansions/script/c16150020.lua
+167
-0
expansions/script/c16150021.lua
expansions/script/c16150021.lua
+98
-0
expansions/script/c16150022.lua
expansions/script/c16150022.lua
+118
-0
expansions/script/c16150023.lua
expansions/script/c16150023.lua
+91
-0
expansions/script/c16150025.lua
expansions/script/c16150025.lua
+167
-0
expansions/script/c16150026.lua
expansions/script/c16150026.lua
+78
-0
expansions/script/c16150027.lua
expansions/script/c16150027.lua
+81
-0
expansions/script/c16150028.lua
expansions/script/c16150028.lua
+68
-0
expansions/script/c16150030.lua
expansions/script/c16150030.lua
+98
-0
expansions/script/c16150031.lua
expansions/script/c16150031.lua
+69
-0
expansions/script/c16150032.lua
expansions/script/c16150032.lua
+135
-0
expansions/script/c16150033.lua
expansions/script/c16150033.lua
+203
-0
expansions/script/c16150035.lua
expansions/script/c16150035.lua
+38
-0
expansions/script/c18700046.lua
expansions/script/c18700046.lua
+202
-0
expansions/script/c18700051.lua
expansions/script/c18700051.lua
+177
-0
expansions/script/c18700055.lua
expansions/script/c18700055.lua
+184
-0
expansions/script/c18700060.lua
expansions/script/c18700060.lua
+71
-0
expansions/script/c18700576.lua
expansions/script/c18700576.lua
+193
-0
expansions/script/c18700672.lua
expansions/script/c18700672.lua
+105
-0
expansions/script/c33720372.lua
expansions/script/c33720372.lua
+427
-0
expansions/script/c5012625.lua
expansions/script/c5012625.lua
+17
-2
expansions/script/c5012636.lua
expansions/script/c5012636.lua
+104
-107
No files found.
expansions/script/c16104242.lua
0 → 100644
View file @
f5173df4
xpcall
(
function
()
require
(
"expansions/script/c16104200"
)
end
,
function
()
require
(
"script/c16104200"
)
end
)
local
m
,
cm
=
rk
.
set
(
16104242
)
function
cm
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
m
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetTarget
(
cm
.
target
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCode
(
16104232
)
end
function
cm
.
cfilter2
(
c
)
return
c
:
IsFaceup
()
and
c
:
GetOriginalCode
()
==
16104248
end
function
cm
.
filter
(
c
)
return
c
:
IsSetCard
(
0x3ccd
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
end
function
cm
.
filter2
(
c
)
return
c
:
IsCode
(
16104226
)
and
c
:
IsSSetable
()
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
b1
=
Duel
.
IsExistingMatchingCard
(
cm
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
local
b2
=
Duel
.
IsExistingMatchingCard
(
cm
.
cfilter2
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
filter2
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
nil
)
if
chk
==
0
then
return
b1
or
b2
end
local
off
=
1
local
ops
=
{}
local
opval
=
{}
if
b1
then
ops
[
off
]
=
aux
.
Stringid
(
m
,
0
)
opval
[
off
-
1
]
=
1
off
=
off
+
1
end
if
b2
then
ops
[
off
]
=
aux
.
Stringid
(
m
,
1
)
opval
[
off
-
1
]
=
2
off
=
off
+
1
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EFFECT
)
local
op
=
Duel
.
SelectOption
(
tp
,
table.unpack
(
ops
))
if
opval
[
op
]
==
1
then
e
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e
:
SetOperation
(
cm
.
mactivate
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
elseif
opval
[
op
]
==
2
then
e
:
SetOperation
(
cm
.
setop
)
end
end
function
cm
.
mactivate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
Duel
.
RegisterFlagEffect
(
tp
,
16104242
,
RESET_PHASE
+
PHASE_END
,
0
,
2
)
end
end
function
cm
.
setop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
cm
.
filter2
),
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
local
tc
=
g
:
GetFirst
()
if
tc
and
Duel
.
SSet
(
tp
,
tc
)
~=
0
then
if
tc
:
IsType
(
TYPE_QUICKPLAY
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EFFECT_QP_ACT_IN_SET_TURN
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
end
if
tc
:
IsType
(
TYPE_TRAP
)
then
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
)
end
end
end
\ No newline at end of file
expansions/script/c16150001.lua
0 → 100644
View file @
f5173df4
--大王百足虫
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150001
,
"DAIOUHYAKUZOKUCYUU"
)
function
cm
.
initial_effect
(
c
)
c
:
SetUniqueOnField
(
1
,
0
,
m
)
--tohand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
+
CATEGORY_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_FLIP
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCost
(
cm
.
cost
)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
operation
)
c
:
RegisterEffect
(
e1
)
--flip
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_FLIP
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetOperation
(
cm
.
flipop
)
c
:
RegisterEffect
(
e2
)
--disable
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_CHAIN_SOLVING
)
e3
:
SetCondition
(
cm
.
discon
)
e3
:
SetOperation
(
cm
.
disop
)
Duel
.
RegisterEffect
(
e3
,
0
)
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
end
function
cm
.
filter
(
c
)
return
c
:
IsRace
(
RACE_INSECT
)
and
c
:
IsAbleToHand
()
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
local
tc
=
g
:
GetFirst
()
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
if
tc
:
IsLevelAbove
(
8
)
and
(
tc
:
IsSummonable
(
true
,
nil
)
or
tc
:
IsMSetable
(
true
,
nil
))
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
3
))
then
local
b1
=
tc
:
IsSummonable
(
true
,
nil
)
local
b2
=
tc
:
IsMSetable
(
true
,
nil
)
local
op
=
1
if
b1
and
b2
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
1
),
aux
.
Stringid
(
m
,
2
))
elseif
b2
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
2
))
+
1
else
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
1
))
end
if
op
==
0
then
Duel
.
Summon
(
tp
,
tc
,
true
,
nil
)
else
Duel
.
MSet
(
tp
,
tc
,
true
,
nil
)
end
end
end
end
function
cm
.
flipop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
e
:
GetHandler
():
RegisterFlagEffect
(
m
,
RESET_EVENT
+
RESETS_STANDARD
,
0
,
1
)
end
function
cm
.
disfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
GetFlagEffect
(
m
)
>
0
and
not
c
:
IsStatus
(
STATUS_BATTLE_DESTROYED
)
and
not
c
:
IsDisabled
()
end
function
cm
.
discon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
,
loc
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_TRIGGERING_CONTROLER
,
CHAININFO_TRIGGERING_LOCATION
)
return
loc
==
LOCATION_GRAVE
and
Duel
.
IsExistingMatchingCard
(
cm
.
disfilter
,
p
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
function
cm
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
NegateEffect
(
ev
)
end
\ No newline at end of file
expansions/script/c16150002.lua
0 → 100644
View file @
f5173df4
--大王兽使
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150002
,
"DAIOUJYUUTSUKAI"
)
function
cm
.
initial_effect
(
c
)
c
:
SetUniqueOnField
(
1
,
0
,
m
)
--tohand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_FLIP
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCost
(
cm
.
cost
)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
operation
)
c
:
RegisterEffect
(
e1
)
--flip
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_FLIP
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetOperation
(
cm
.
flipop
)
c
:
RegisterEffect
(
e2
)
--disable spsummon
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCondition
(
cm
.
disspcon
)
e3
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e3
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e3
:
SetTargetRange
(
0
,
1
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
end
function
cm
.
filter
(
c
,
tp
)
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
(
c
:
IsControler
(
tp
)
or
c
:
IsAbleToChangeControler
())
and
c
:
IsFaceup
()
and
c
:
CheckUniqueOnField
(
tp
)
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
e
:
GetHandler
(),
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
nil
,
1
,
tp
,
LOCATION_MZONE
)
end
function
cm
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
local
eqg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
c
)
if
eqg
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
eqg
)
local
sc
=
eqg
:
GetFirst
()
if
Duel
.
Equip
(
tp
,
sc
,
c
)
~=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetLabelObject
(
c
)
e1
:
SetValue
(
cm
.
eqlimit
)
sc
:
RegisterEffect
(
e1
)
if
not
sc
:
IsType
(
TYPE_TRAPMONSTER
)
and
sc
:
IsRace
(
RACE_BEAST
)
then
local
cid
=
c
:
CopyEffect
(
sc
:
GetCode
(),
RESET_EVENT
+
RESETS_STANDARD
)
end
end
end
end
end
function
cm
.
eqlimit
(
e
,
c
)
return
c
==
e
:
GetLabelObject
()
end
function
cm
.
flipop
(
e
)
e
:
GetHandler
():
RegisterFlagEffect
(
m
,
RESET_EVENT
+
RESETS_STANDARD
,
0
,
1
)
end
function
cm
.
disspcon
(
e
)
return
e
:
GetHandler
():
GetFlagEffect
(
m
)
>
0
end
\ No newline at end of file
expansions/script/c16150003.lua
0 → 100644
View file @
f5173df4
--大王具足虫
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150003
,
"DAIOUGU"
)
function
cm
.
initial_effect
(
c
)
c
:
SetUniqueOnField
(
1
,
0
,
m
)
--tohand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_SPSUMMON
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_FLIP
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCost
(
cm
.
cost
)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
operation
)
c
:
RegisterEffect
(
e1
)
--flip
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_FLIP
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetOperation
(
cm
.
flipop
)
c
:
RegisterEffect
(
e2
)
--disable
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_CHAIN_SOLVING
)
e3
:
SetCondition
(
cm
.
discon
)
e3
:
SetOperation
(
cm
.
disop
)
Duel
.
RegisterEffect
(
e3
,
0
)
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
CheckReleaseGroup
(
tp
,
cm
.
spfilter
,
1
,
nil
,
e
,
tp
)
end
e
:
SetLabel
(
100
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
local
sg
=
Duel
.
SelectReleaseGroup
(
tp
,
cm
.
spfilter
,
1
,
1
,
nil
)
Duel
.
Release
(
sg
,
REASON_COST
)
e
:
SetLabelObject
(
sg
)
end
function
cm
.
spfilter
(
c
,
e
,
tp
)
return
(
c
:
IsRace
(
RACE_INSECT
)
or
c
:
IsType
(
TYPE_FLIP
))
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
c
,
e
,
tp
)
end
function
cm
.
spfilter1
(
c
,
mc
,
e
,
tp
)
return
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
and
not
c
:
IsCode
(
mc
:
GetCode
())
and
(
c
:
IsRace
(
RACE_INSECT
)
or
c
:
IsType
(
TYPE_FLIP
))
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
num
=
e
:
GetLabel
()
if
num
~=
100
then
return
false
end
if
num
==
10
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
:
GetLabelObject
():
GetFirst
(),
e
,
tp
)
end
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
:
GetLabelObject
():
GetFirst
(),
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
cm
.
flipop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
e
:
GetHandler
():
RegisterFlagEffect
(
m
,
RESET_EVENT
+
RESETS_STANDARD
,
0
,
1
)
end
function
cm
.
disfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
GetFlagEffect
(
m
)
>
0
and
not
c
:
IsStatus
(
STATUS_BATTLE_DESTROYED
)
and
not
c
:
IsDisabled
()
end
function
cm
.
discon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
,
loc
=
Duel
.
GetChainInfo
(
ev
,
CHAININFO_TRIGGERING_CONTROLER
,
CHAININFO_TRIGGERING_LOCATION
)
return
loc
==
LOCATION_HAND
and
re
:
IsActiveType
(
TYPE_MONSTER
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
disfilter
,
p
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
function
cm
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
NegateEffect
(
ev
)
end
\ No newline at end of file
expansions/script/c16150004.lua
0 → 100644
View file @
f5173df4
--落入蛛网的蝴蝶
local
m
=
16150004
local
cm
=
_G
[
"c"
..
m
]
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
function
cm
.
initial_effect
(
c
)
local
e1
=
rsef
.
ACT
(
c
,
nil
,
nil
,{
1
,
m
,
1
},
nil
,
nil
,
nil
,
nil
,
nil
,
cm
.
thop
)
--disable spsummon
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e5
:
SetCategory
(
CATEGORY_DISABLE_SUMMON
+
CATEGORY_SPECIAL_SUMMON
)
e5
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e5
:
SetRange
(
LOCATION_MZONE
)
e5
:
SetCode
(
EVENT_SUMMON
)
e5
:
SetCondition
(
cm
.
dscon
)
e5
:
SetCountLimit
(
1
,
m
)
e5
:
SetTarget
(
cm
.
dstg
)
e5
:
SetOperation
(
cm
.
dsop
)
c
:
RegisterEffect
(
e5
)
local
e6
=
e5
:
Clone
()
e6
:
SetCode
(
EVENT_FLIP_SUMMON
)
c
:
RegisterEffect
(
e6
)
local
e7
=
e5
:
Clone
()
e7
:
SetCode
(
EVENT_SPSUMMON
)
c
:
RegisterEffect
(
e7
)
end
function
cm
.
thfilter
(
c
,
e
)
return
c
:
IsFaceup
()
and
not
c
:
IsImmuneToEffect
(
e
)
and
c
:
IsCanChangePosition
()
end
function
cm
.
thop
(
e
,
tp
)
rsop
.
SelectSolve
(
HINTMSG_POSITION
,
tp
,
cm
.
thfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
,{
cm
.
solvefun
,
tp
})
end
function
cm
.
solvefun
(
g
,
tp
)
local
tc
=
g
:
GetFirst
()
local
b1
=
c
:
IsFaceup
()
and
not
c
:
IsImmuneToEffect
(
e
)
and
c
:
IsCanChangePosition
()
if
b1
then
Duel
.
ChangePosition
(
tc
,
dd
)
end
end
function
cm
.
dscon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetCurrentChain
()
==
0
and
eg
:
IsExists
(
Card
.
IsRace
,
1
,
nil
,
RACE_INSECT
)
end
function
cm
.
dstg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DISABLE_SUMMON
,
eg
,
eg
:
GetCount
(),
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
spfilter
(
c
,
e
,
tp
,
og
)
return
not
og
:
IsExists
(
Card
.
IsCode
,
1
,
nil
,
c
:
GetCode
())
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEDOWN_DEFENSE
)
and
(
c
:
IsRace
(
RACE_INSECT
)
or
c
:
IsType
(
TYPE_FLIP
))
end
function
cm
.
dsop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ng
=
eg
:
Filter
(
Card
.
IsRace
,
nil
,
RACE_INSECT
)
if
Duel
.
NegateSummon
(
ng
)
and
Duel
.
SendtoHand
(
ng
,
tp
,
REASON_EFFECT
)
then
local
og
=
Duel
.
GetOperatedGroup
()
if
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
og
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
2
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
,
og
)
Duel
.
SpecialSummon
(
sg
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEDOWN_DEFENSE
)
end
end
end
\ No newline at end of file
expansions/script/c16150005.lua
0 → 100644
View file @
f5173df4
--大王龙使
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150005
,
"DAIOURYUUTSUKAI"
)
function
cm
.
initial_effect
(
c
)
c
:
SetUniqueOnField
(
1
,
0
,
m
)
--tohand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCost
(
cm
.
cost
)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
operation
)
c
:
RegisterEffect
(
e1
)
--indes
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
e2
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetTargetRange
(
LOCATION_ONFIELD
,
0
)
e2
:
SetCondition
(
cm
.
incon
)
e2
:
SetTarget
(
cm
.
intg
)
e2
:
SetValue
(
1
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
filter
(
c
)
return
c
:
IsAbleToHand
()
and
(
rk
.
check
(
c
,
"DAIOU"
)
or
c
:
IsSetCard
(
0xccd
)
or
rk
.
check
(
c
,
"OUMEI"
))
end
function
cm
.
eqfilter
(
c
,
tp
)
return
not
c
:
IsForbidden
()
and
rk
.
check
(
c
,
"DAIOURYUU"
)
and
c
:
CheckUniqueOnField
(
tp
)
end
function
cm
.
costfilter
(
c
,
sg
)
if
not
c
:
IsAbleToDeckAsCost
()
then
return
false
end
if
sg
and
sg
:
IsContains
(
c
)
then
return
false
end
if
not
sg
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
c
)
else
local
rg
=
sg
:
Clone
()
rg
:
AddCard
(
c
)
return
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
rg
)
end
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
costfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
nil
)
end
local
g
=
Group
.
CreateGroup
()
for
i
=
1
,
3
do
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
costfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
,
g
)
g
:
Merge
(
sg
)
if
i
<
3
and
Duel
.
IsExistingMatchingCard
(
cm
.
costfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
nil
,
g
)
and
not
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
2
))
then
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_COST
)
return
end
end
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_EFFECT
)
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
eqfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
tp
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_GRAVE
)
end
function
cm
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
thg
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
cm
.
filter
),
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
1
,
nil
)
if
thg
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
thg
)
if
Duel
.
SendtoHand
(
thg
,
nil
,
REASON_EFFECT
)
~=
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
then
local
eqg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
eqfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
,
tp
)
if
eqg
:
GetCount
()
>
0
then
local
sc
=
eqg
:
GetFirst
()
if
Duel
.
Equip
(
tp
,
sc
,
c
)
~=
0
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetLabelObject
(
c
)
e1
:
SetValue
(
cm
.
eqlimit
)
sc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_EQUIP
)
e2
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetValue
(
1000
)
sc
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
sc
:
RegisterEffect
(
e3
)
if
not
sc
:
IsType
(
TYPE_TRAPMONSTER
)
then
local
cid
=
c
:
CopyEffect
(
sc
:
GetCode
(),
RESET_EVENT
+
RESETS_STANDARD
)
end
end
end
end
end
end
end
function
cm
.
eqlimit
(
e
,
c
)
return
c
==
e
:
GetLabelObject
()
end
function
cm
.
intg
(
e
,
c
)
return
true
end
function
cm
.
incon
(
e
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_ADVANCE
)
end
\ No newline at end of file
expansions/script/c16150006.lua
0 → 100644
View file @
f5173df4
--天命托宣
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150006
,
"TENMEITAKUSENN"
)
function
c16150006
.
initial_effect
(
c
)
--cost
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e2
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e2
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetCountLimit
(
1
,
m
+
EFFECT_COUNT_CODE_OATH
)
e2
:
SetCost
(
cm
.
cost
)
e2
:
SetTarget
(
cm
.
target2
)
e2
:
SetOperation
(
cm
.
activate2
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
thfilter
(
c
)
return
rk
.
check
(
c
,
"OUMEI"
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
end
function
cm
.
thfilter2
(
c
)
return
c
:
IsSetCard
(
0xccd
)
and
c
:
IsAbleToHand
()
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
e
:
SetLabel
(
2
)
return
true
end
function
cm
.
target2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
a
=
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
local
b
=
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
())
if
chk
==
0
then
return
a
end
if
a
and
b
and
e
:
GetLabel
()
==
2
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
1
))
then
e
:
SetLabel
(
1
)
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
,
e
:
GetHandler
())
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
2
,
tp
,
LOCATION_DECK
)
else
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
end
function
cm
.
activate2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
flag
=
e
:
GetLabel
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
thg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
thg
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
thg
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
thg
)
end
if
flag
==
1
and
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
2
))
then
local
g
=
Duel
.
GetMatchingGroup
(
cm
.
thfilter2
,
tp
,
LOCATION_DECK
,
0
,
nil
)
local
thg2
=
g
:
RandomSelect
(
tp
,
1
)
Duel
.
SendtoHand
(
thg2
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
thg2
)
end
end
expansions/script/c16150007.lua
0 → 100644
View file @
f5173df4
--大王虫 大百足
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150007
,
"DAIOUCYUUDAIHYAKUZOKU"
)
function
cm
.
initial_effect
(
c
)
c
:
SetUniqueOnField
(
1
,
0
,
m
)
--tohand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_FLIP
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCost
(
cm
.
cost
)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
operation
)
c
:
RegisterEffect
(
e1
)
--flip
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_FLIP
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetOperation
(
cm
.
flipop
)
c
:
RegisterEffect
(
e2
)
--cannot activate
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e3
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetTargetRange
(
0
,
1
)
e3
:
SetValue
(
cm
.
aclimit
)
c
:
RegisterEffect
(
e3
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e4
:
SetCode
(
EVENT_SSET
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetCondition
(
cm
.
actlimcon
)
e4
:
SetOperation
(
cm
.
aclimset
)
c
:
RegisterEffect
(
e4
)
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
end
function
cm
.
spfilter1
(
c
)
return
c
:
IsAbleToHand
()
and
c
:
IsRace
(
RACE_INSECT
)
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
changefilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCanTurnSet
()
end
function
cm
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
if
Duel
.
SendtoHand
(
g
,
tp
,
REASON_EFFECT
)
~=
0
then
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
local
tc
=
g
:
GetFirst
()
if
tc
:
IsLevelAbove
(
8
)
and
tc
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
1
))
then
if
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
~=
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
changefilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
e
:
GetHandler
())
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
2
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
aux
.
Stringid
(
m
,
3
))
local
sc
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
changefilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
e
:
GetHandler
()):
GetFirst
()
if
not
sc
:
IsImmuneToEffect
(
e
)
then
Duel
.
ChangePosition
(
sc
,
POS_FACEDOWN_DEFENSE
)
end
end
end
end
end
end
function
cm
.
flipop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
e
:
GetHandler
():
RegisterFlagEffect
(
m
,
RESET_EVENT
+
RESETS_STANDARD
,
0
,
1
)
end
function
cm
.
aclimit
(
e
,
re
,
tp
)
if
not
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
or
not
re
:
IsActiveType
(
TYPE_SPELL
+
TYPE_TRAP
)
then
return
false
end
local
c
=
re
:
GetHandler
()
return
not
c
:
IsLocation
(
LOCATION_SZONE
)
or
c
:
GetFlagEffect
(
m
+
1
)
>
0
end
function
cm
.
actlimcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetFlagEffect
(
m
)
>
0
end
function
cm
.
aclimset
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
eg
:
GetFirst
()
while
tc
do
tc
:
RegisterFlagEffect
(
m
+
1
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
+
RESET_OPPO_TURN
,
0
,
1
)
tc
=
eg
:
GetNext
()
end
end
expansions/script/c16150008.lua
0 → 100644
View file @
f5173df4
--王命的集结
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150008
,
"OUMEI"
)
function
cm
.
initial_effect
(
c
,
flag
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e1
)
--change effect type
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetCode
(
m
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetTargetRange
(
1
,
0
)
c
:
RegisterEffect
(
e2
)
--
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_FZONE
)
e3
:
SetCountLimit
(
1
)
e3
:
SetCost
(
cm
.
cost
)
e3
:
SetTarget
(
cm
.
target
)
e3
:
SetOperation
(
cm
.
op
)
c
:
RegisterEffect
(
e3
)
--
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e4
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_SZONE
)
e4
:
SetCondition
(
cm
.
con1
)
e4
:
SetTarget
(
cm
.
sptg
)
e4
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e4
)
local
e5
=
e4
:
Clone
()
e5
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e5
:
SetCode
(
EVENT_FREE_CHAIN
)
e5
:
SetCondition
(
cm
.
con2
)
c
:
RegisterEffect
(
e5
)
if
flag
and
flag
==
true
then
return
e1
,
e2
,
e3
,
e4
,
e5
end
end
function
cm
.
afilter
(
c
)
return
rk
.
check
(
c
,
"DAIOU"
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsPublic
()
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
afilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CONFIRM
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
afilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
Duel
.
ConfirmCards
(
1
-
tp
,
sg
)
sg
:
KeepAlive
()
e
:
SetLabelObject
(
sg
)
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
end
function
cm
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
local
tc
=
e
:
GetLabelObject
():
GetFirst
()
if
tc
:
IsLocation
(
LOCATION_HAND
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_PUBLIC
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
)
tc
:
RegisterEffect
(
e1
)
tc
:
RegisterFlagEffect
(
m
,
RESET_EVENT
+
RESETS_STANDARD
,
EFFECT_FLAG_CLIENT_HINT
,
0
,
0
,
aux
.
Stringid
(
m
,
4
))
--serch
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
5
))
e2
:
SetCategory
(
CATEGORY_TOGRAVE
+
CATEGORY_EQUIP
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TOFIELD
)
e2
:
SetTarget
(
cm
.
thtg2
)
e2
:
SetOperation
(
cm
.
thop2
)
tc
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
tc
:
RegisterEffect
(
e3
)
end
end
end
function
cm
.
thfilter
(
c
)
return
rk
.
check
(
c
,
"DAIOU"
)
and
c
:
CheckUniqueOnField
(
tp
)
and
not
c
:
IsForbidden
()
end
function
cm
.
thtg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
,
0
)
>
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
tgfilter
(
c
)
return
rk
.
check
(
c
,
"OUMEI"
)
and
c
:
IsAbleToGrave
()
end
function
cm
.
thop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
or
not
c
:
IsRelateToEffect
(
e
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
local
tc
=
g
:
GetFirst
()
if
not
Duel
.
Equip
(
tp
,
tc
,
c
)
then
return
end
--equip limit
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetLabelObject
(
c
)
e1
:
SetValue
(
cm
.
eqlimit
)
tc
:
RegisterEffect
(
e1
)
if
tc
:
GetOriginalType
()
&
TYPE_EQUIP
~=
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
3
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoGrave
(
tg
,
REASON_EFFECT
)
end
end
end
function
cm
.
eqlimit
(
e
,
c
)
return
c
==
e
:
GetLabelObject
()
end
function
cm
.
con1
(
e
,
tp
)
local
c
=
e
:
GetHandler
()
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
16150008
)
and
c
:
GetEquipTarget
()
~=
nil
end
function
cm
.
con2
(
e
,
tp
)
local
c
=
e
:
GetHandler
()
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
16150008
)
and
c
:
GetEquipTarget
()
~=
nil
and
not
c
:
IsStatus
(
STATUS_CHAINING
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
not
c
:
IsLocation
(
LOCATION_FZONE
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
)
end
function
cm
.
thfilter2
(
c
)
return
(
rk
.
check
(
c
,
"DAIOU"
)
or
rk
.
check
(
c
,
"OUMEI"
)
or
c
:
IsSetCard
(
0xccd
))
and
c
:
IsAbleToHand
()
and
not
c
:
IsCode
(
m
)
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
if
c
then
local
fc
=
Duel
.
GetFieldCard
(
tp
,
LOCATION_FZONE
,
0
)
if
fc
then
Duel
.
SendtoGrave
(
fc
,
REASON_RULE
)
Duel
.
BreakEffect
()
end
Duel
.
MoveSequence
(
c
,
5
)
local
e1
,
e2
,
e3
,
e4
,
e5
=
cm
.
initial_effect
(
c
,
true
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e5
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
if
Duel
.
IsExistingMatchingCard
(
aux
.
NecroValleyFilter
(
cm
.
thfilter2
),
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
2
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
cm
.
thfilter2
),
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
Duel
.
SendtoHand
(
tg
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tg
)
end
end
end
expansions/script/c16150009.lua
0 → 100644
View file @
f5173df4
--大王具 大王兽机
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150009
,
"DAIOUGUDAIOUJYUUKI"
)
function
cm
.
initial_effect
(
c
)
--xyz summon
aux
.
AddXyzProcedure
(
c
,
nil
,
8
,
3
)
c
:
EnableReviveLimit
()
--pendulum summon
aux
.
EnablePendulumAttribute
(
c
,
false
)
--equip-P
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e0
:
SetCategory
(
CATEGORY_EQUIP
+
CATEGORY_SPECIAL_SUMMON
)
e0
:
SetType
(
EFFECT_TYPE_IGNITION
)
e0
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e0
:
SetRange
(
LOCATION_PZONE
)
e0
:
SetCountLimit
(
1
,
m
)
e0
:
SetTarget
(
cm
.
eqtg2
)
e0
:
SetOperation
(
cm
.
eqop2
)
c
:
RegisterEffect
(
e0
)
--1 in 3
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e1
:
SetCategory
(
CATEGORY_DESTROY
+
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetTarget
(
cm
.
drtg1
)
e1
:
SetCondition
(
cm
.
condition
)
e1
:
SetOperation
(
cm
.
drop
)
c
:
RegisterEffect
(
e1
)
--1 in 3 Q
local
e3
=
e1
:
Clone
()
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetCondition
(
cm
.
condition1
)
c
:
RegisterEffect
(
e3
)
----
if
not
cm
.
global_check
then
cm
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_EQUIP
)
ge1
:
SetOperation
(
cm
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
c16150009
.
pendulum_level
=
8
function
cm
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
eg
:
GetFirst
()
if
tc
and
tc
:
GetOriginalCode
()
==
m
then
local
c
=
tc
:
GetEquipTarget
()
local
cid
=
c
:
CopyEffect
(
m
,
RESET_EVENT
+
RESETS_STANDARD
,
0
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
8
))
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_ADJUST
)
e3
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e3
:
SetRange
(
0x7f
)
e3
:
SetLabel
(
cid
)
e3
:
SetLabelObject
(
c
)
e3
:
SetOperation
(
cm
.
rstop
)
tc
:
RegisterEffect
(
e3
)
tc
=
eg
:
GetNext
()
end
end
function
cm
.
rstop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetLabelObject
()
local
tc
=
e
:
GetHandler
()
local
cid
=
e
:
GetLabel
()
if
tc
:
GetEquipTarget
()
~=
c
then
if
cid
~=
0
then
c
:
ResetEffect
(
cid
,
RESET_COPY
)
c
:
ResetEffect
(
RESET_DISABLE
,
RESET_EVENT
)
end
e
:
Reset
()
end
end
function
cm
.
eqfilter
(
c
)
return
c
:
IsFaceup
()
end
function
cm
.
eqtg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
cm
.
eqfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
local
tc
=
Duel
.
SelectTarget
(
tp
,
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
):
GetFirst
()
local
op
=
0
local
a
=
tc
:
IsFaceup
()
local
b
=
tc
:
IsCanOverlay
()
Duel
.
Hint
(
HINT_OPSELECTED
,
tp
,
aux
.
Stringid
(
m
,
0
))
if
a
and
b
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
1
),
aux
.
Stringid
(
m
,
2
))
elseif
a
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
1
))
elseif
b
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
2
))
+
1
end
e
:
SetLabel
(
op
)
end
function
cm
.
eqop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
local
op
=
e
:
GetLabel
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
false
end
if
tc
:
GetControler
()
~=
tp
or
not
tc
:
IsRelateToEffect
(
e
)
then
return
end
if
op
==
0
and
tc
:
IsFaceup
()
then
if
not
Duel
.
Equip
(
tp
,
c
,
tc
)
then
return
end
--equip limit
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetLabelObject
(
tc
)
e1
:
SetValue
(
cm
.
eqlimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
c
:
RegisterEffect
(
e1
)
end
if
op
==
1
and
tc
:
IsCanOverlay
()
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
,
0
)
>
0
then
if
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
~=
0
then
Duel
.
Overlay
(
c
,
tc
)
end
end
end
function
cm
.
eqlimit
(
e
,
c
)
return
c
==
e
:
GetLabelObject
()
end
function
cm
.
condition
(
e
,
tp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
16150008
)
end
function
cm
.
condition1
(
e
,
tp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
16150008
)
end
function
cm
.
drtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
LOCATION_ONFIELD
+
LOCATION_GRAVE
,
LOCATION_ONFIELD
+
LOCATION_GRAVE
,
nil
)
if
chk
==
0
then
return
g
:
CheckSubGroup
(
cm
.
filter
,
3
,
3
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
nil
,
3
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
nil
,
3
,
0
,
0
)
end
function
cm
.
desfilter
(
c
,
tc
,
ec
)
return
c
:
GetEquipTarget
()
~=
tc
and
c
~=
ec
end
function
cm
.
filter
(
g
,
tp
,
c
)
return
not
(
g
:
IsExists
(
cm
.
filter1
,
1
,
nil
,
c
)
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
,
0
)
<
3
or
g
:
IsContains
(
c
))
or
not
(
g
:
IsExists
(
cm
.
filter2
,
1
,
nil
)
or
g
:
IsContains
(
c
)
or
not
c
:
IsType
(
TYPE_XYZ
))
or
not
g
:
IsExists
(
cm
.
filter3
,
1
,
nil
)
end
function
cm
.
filter1
(
c
,
ec
)
return
(
c
:
IsLocation
(
LOCATION_GRAVE
)
and
c
:
IsForbidden
())
or
(
not
c
:
IsAbleToChangeControler
())
or
c
:
GetEquipTarget
()
==
ec
end
function
cm
.
filter2
(
c
)
return
not
c
:
IsCanOverlay
()
end
function
cm
.
filter3
(
c
)
return
c
:
IsLocation
(
LOCATION_GRAVE
)
end
function
cm
.
costfilter
(
c
,
ec
,
tp
)
local
g
=
Duel
.
GetMatchingGroup
(
aux
.
NecroValleyFilter
(
nil
),
tp
,
LOCATION_ONFIELD
+
LOCATION_GRAVE
,
LOCATION_ONFIELD
+
LOCATION_GRAVE
,
c
)
return
(
c
:
IsControler
(
tp
)
or
c
:
IsFaceup
())
and
c
:
IsReleasable
()
and
c
:
IsType
(
TYPE_EQUIP
)
and
g
:
CheckSubGroup
(
cm
.
filter
,
3
,
3
,
tp
,
ec
)
end
function
cm
.
drtg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
costfilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
,
c
,
tp
)
and
c
:
GetFlagEffect
(
m
)
==
0
end
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
costfilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
,
c
,
tp
)
Duel
.
Release
(
sg
,
REASON_COST
)
c
:
RegisterFlagEffect
(
m
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
,
nil
,
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
nil
,
3
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
nil
,
3
,
0
,
0
)
end
function
cm
.
drop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ec
=
e
:
GetHandler
()
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
local
sg
=
Duel
.
GetMatchingGroup
(
aux
.
NecroValleyFilter
(
nil
),
tp
,
LOCATION_ONFIELD
+
LOCATION_GRAVE
,
LOCATION_ONFIELD
+
LOCATION_GRAVE
,
nil
)
local
g
=
sg
:
SelectSubGroup
(
tp
,
cm
.
filter
,
false
,
3
,
3
,
tp
,
ec
)
if
sg
:
GetCount
()
>
0
then
local
op
=
3
local
a
=
not
(
g
:
IsExists
(
cm
.
filter1
,
1
,
nil
,
ec
)
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
,
0
)
<
3
or
g
:
IsContains
(
ec
))
local
b
=
not
(
g
:
IsExists
(
cm
.
filter2
,
1
,
nil
)
or
g
:
IsContains
(
ec
)
or
not
ec
:
IsType
(
TYPE_XYZ
))
local
c
=
not
g
:
IsExists
(
cm
.
filter3
,
1
,
nil
)
if
a
and
b
and
c
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
5
),
aux
.
Stringid
(
m
,
6
),
aux
.
Stringid
(
m
,
7
))
elseif
a
and
b
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
5
),
aux
.
Stringid
(
m
,
6
))
elseif
b
and
c
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
6
),
aux
.
Stringid
(
m
,
7
))
+
1
elseif
a
and
c
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
5
),
aux
.
Stringid
(
m
,
7
))
if
op
==
1
then
op
=
op
+
1
end
elseif
a
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
5
))
elseif
b
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
6
))
+
1
elseif
c
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
7
))
+
2
end
if
op
==
0
then
for
tc
in
aux
.
Next
(
g
)
do
if
tc
:
IsType
(
TYPE_SPELL
)
and
not
tc
:
IsType
(
TYPE_EQUIP
)
then
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
local
record_type
=
tc
:
GetOriginalType
()
tc
:
SetCardData
(
CARDDATA_TYPE
,
record_type
|
TYPE_EQUIP
)
tc
:
RegisterFlagEffect
(
m
,
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TOFIELD
,
0
,
1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_MOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e2
:
SetLabel
(
record_type
)
e2
:
SetOperation
(
function
(
de
)
local
dc
=
de
:
GetHandler
()
dc
:
SetCardData
(
CARDDATA_TYPE
,
de
:
GetLabel
())
de
:
Reset
()
end
)
tc
:
RegisterEffect
(
e2
)
end
if
Duel
.
Equip
(
tp
,
tc
,
ec
,
true
,
true
)
then
--equip limit
local
e1
=
Effect
.
CreateEffect
(
ec
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetLabelObject
(
ec
)
e1
:
SetValue
(
cm
.
eqlimit
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
end
end
Duel
.
EquipComplete
()
elseif
op
==
1
then
Duel
.
Overlay
(
ec
,
g
)
elseif
op
==
2
then
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
end
end
end
function
cm
.
rtop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
c
:
SetCardData
(
CARDDATA_TYPE
,
e
:
GetLabel
())
e
:
Reset
()
end
expansions/script/c16150010.lua
0 → 100644
View file @
f5173df4
--大王机使 331Y34M2
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150010
,
"DAIOUGUTSUKAI"
)
function
cm
.
initial_effect
(
c
)
c
:
SetUniqueOnField
(
1
,
0
,
m
)
--Removed Card Cannot Effect
local
e1_1
=
Effect
.
CreateEffect
(
c
)
e1_1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1_1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1_1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1_1
:
SetRange
(
LOCATION_MZONE
)
e1_1
:
SetTargetRange
(
1
,
1
)
e1_1
:
SetValue
(
cm
.
aclimit
)
c
:
RegisterEffect
(
e1_1
)
--
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCategory
(
CATEGORY_TODECK
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCost
(
cm
.
cost
)
e2
:
SetTarget
(
cm
.
target
)
e2
:
SetOperation
(
cm
.
op
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
aclimit
(
e
,
re
,
tp
)
local
rc
=
re
:
GetHandler
()
return
(
rc
:
IsStatus
(
STATUS_BATTLE_DESTROYED
)
or
rc
:
IsComplexReason
(
REASON_DESTROY
,
true
,
REASON_EFFECT
,
REASON_BATTLE
))
and
rc
:
GetControler
()
~=
e
:
GetHandler
():
GetControler
()
end
function
cm
.
sumlimit
(
e
,
c
,
sump
,
sumtype
,
sumpos
,
targetp
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
cm
.
filter
(
c
)
return
rk
.
check
(
c
,
"DAIOUGU"
)
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
GetFlagEffect
(
m
+
200
)
==
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CONFIRM
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
c
:
RegisterFlagEffect
(
m
+
200
,
RESET_CHAIN
,
0
,
1
)
end
function
cm
.
eqfilter
(
c
,
tp
)
return
rk
.
check
(
c
,
"DAIOUGU"
)
and
c
:
CheckUniqueOnField
(
tp
)
and
not
c
:
IsForbidden
()
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
local
a
=
Duel
.
IsExistingMatchingCard
(
cm
.
eqfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
tp
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
,
0
)
>
0
and
c
:
GetFlagEffect
(
m
)
==
0
local
b
=
Duel
.
IsExistingMatchingCard
(
nil
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
and
c
:
GetFlagEffect
(
m
+
100
)
==
0
if
chk
==
0
then
return
a
or
b
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
nil
,
1
,
0
,
0
)
end
function
cm
.
op
(
e
,
tp
)
local
c
=
e
:
GetHandler
()
local
a
=
Duel
.
IsExistingMatchingCard
(
cm
.
eqfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
tp
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
,
0
)
>
0
and
c
:
GetFlagEffect
(
m
)
==
0
local
b
=
Duel
.
IsExistingMatchingCard
(
nil
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
and
c
:
GetFlagEffect
(
m
+
100
)
==
0
local
op
=
2
if
a
and
b
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
2
),
aux
.
Stringid
(
m
,
3
))
elseif
a
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
2
))
elseif
b
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
3
))
+
1
else
return
end
if
op
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
aux
.
Stringid
(
m
,
4
))
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
eqfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
,
tp
)
if
g
:
GetCount
()
>
0
then
local
tc
=
g
:
GetFirst
()
if
not
Duel
.
Equip
(
tp
,
tc
,
c
)
then
return
end
--equip limit
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetLabelObject
(
c
)
e1
:
SetValue
(
cm
.
eqlimit
)
tc
:
RegisterEffect
(
e1
)
c
:
RegisterFlagEffect
(
m
,
RESET_PHASE
+
PHASE_END
+
RESET_EVENT
+
RESETS_STANDARD
,
0
,
0
)
end
elseif
op
==
1
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
nil
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
2
,
nil
)
if
tg
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
tg
)
Duel
.
Destroy
(
tg
,
REASON_EFFECT
)
c
:
RegisterFlagEffect
(
m
+
100
,
RESET_PHASE
+
PHASE_END
+
RESET_EVENT
+
RESETS_STANDARD
,
0
,
0
)
end
else
return
end
end
function
cm
.
eqlimit
(
e
,
c
)
return
c
==
e
:
GetLabelObject
()
end
\ No newline at end of file
expansions/script/c16150011.lua
0 → 100644
View file @
f5173df4
--大王剑使
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150011
,
"DAIOUGUTSUKAI"
)
function
cm
.
initial_effect
(
c
)
c
:
SetUniqueOnField
(
1
,
0
,
m
)
--spsummon limit
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
0
,
1
)
e1
:
SetCondition
(
cm
.
con
)
e1
:
SetTarget
(
cm
.
sumlimit
)
c
:
RegisterEffect
(
e1
)
--
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCategory
(
CATEGORY_TODECK
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCost
(
cm
.
cost
)
e2
:
SetTarget
(
cm
.
target
)
e2
:
SetOperation
(
cm
.
op
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
con
(
e
,
tp
)
return
e
:
GetHandler
():
GetEquipCount
()
>
0
end
function
cm
.
sumlimit
(
e
,
c
,
sump
,
sumtype
,
sumpos
,
targetp
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
cm
.
filter
(
c
)
return
rk
.
check
(
c
,
"DAIOUGU"
)
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
GetFlagEffect
(
m
+
200
)
==
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CONFIRM
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
c
:
RegisterFlagEffect
(
m
+
200
,
RESET_CHAIN
,
0
,
1
)
end
function
cm
.
eqfilter
(
c
)
return
(
c
:
IsLocation
(
LOCATION_GRAVE
)
or
c
:
IsFaceup
())
and
rk
.
check
(
c
,
"DAIOUGU"
)
and
c
:
CheckUniqueOnField
(
tp
)
and
not
c
:
IsForbidden
()
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
local
a
=
Duel
.
IsExistingMatchingCard
(
cm
.
eqfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
nil
,
tp
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
,
0
)
>
0
and
c
:
GetFlagEffect
(
m
)
==
0
local
b
=
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToDeck
,
tp
,
0
,
LOCATION_ONFIELD
,
2
,
nil
)
and
c
:
GetFlagEffect
(
m
+
100
)
==
0
if
chk
==
0
then
return
a
or
b
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
nil
,
2
,
0
,
0
)
end
function
cm
.
op
(
e
,
tp
)
local
c
=
e
:
GetHandler
()
local
a
=
Duel
.
IsExistingMatchingCard
(
aux
.
NecroValleyFilter
(
cm
.
eqfilter
),
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
nil
,
tp
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
,
0
)
>
0
and
c
:
GetFlagEffect
(
m
)
==
0
local
b
=
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToDeck
,
tp
,
0
,
LOCATION_ONFIELD
,
2
,
nil
)
and
c
:
GetFlagEffect
(
m
+
100
)
==
0
local
op
=
2
if
a
and
b
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
2
),
aux
.
Stringid
(
m
,
3
))
elseif
a
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
2
))
elseif
b
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
3
))
+
1
else
return
end
if
op
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
aux
.
Stringid
(
m
,
4
))
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
cm
.
eqfilter
),
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
,
tp
)
if
g
:
GetCount
()
>
0
then
local
tc
=
g
:
GetFirst
()
if
not
Duel
.
Equip
(
tp
,
tc
,
c
)
then
return
end
--equip limit
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetLabelObject
(
c
)
e1
:
SetValue
(
cm
.
eqlimit
)
tc
:
RegisterEffect
(
e1
)
c
:
RegisterFlagEffect
(
m
,
RESET_PHASE
+
PHASE_END
+
RESET_EVENT
+
RESETS_STANDARD
,
0
,
0
)
end
elseif
op
==
1
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToDeck
,
tp
,
0
,
LOCATION_ONFIELD
,
2
,
2
,
nil
)
if
tg
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
tg
)
Duel
.
SendtoDeck
(
tg
,
nil
,
2
,
REASON_EFFECT
)
c
:
RegisterFlagEffect
(
m
+
100
,
RESET_PHASE
+
PHASE_END
+
RESET_EVENT
+
RESETS_STANDARD
,
0
,
0
)
end
else
return
end
end
function
cm
.
eqlimit
(
e
,
c
)
return
c
==
e
:
GetLabelObject
()
end
\ No newline at end of file
expansions/script/c16150012.lua
0 → 100644
View file @
f5173df4
--大王具使
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150012
,
"DAIOUGUTSUKAI"
)
function
cm
.
initial_effect
(
c
)
c
:
SetUniqueOnField
(
1
,
0
,
m
)
--cannot remove
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_REMOVE
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCondition
(
cm
.
con
)
e1
:
SetTargetRange
(
0
,
1
)
c
:
RegisterEffect
(
e1
)
--
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCategory
(
CATEGORY_TODECK
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCost
(
cm
.
cost
)
e2
:
SetTarget
(
cm
.
target
)
e2
:
SetOperation
(
cm
.
op
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
con
(
e
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_ADVANCE
)
end
function
cm
.
sumlimit
(
e
,
c
,
sump
,
sumtype
,
sumpos
,
targetp
)
return
c
:
IsLocation
(
LOCATION_EXTRA
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
cm
.
filter
(
c
)
return
rk
.
check
(
c
,
"DAIOUGU"
)
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
GetFlagEffect
(
m
+
200
)
==
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CONFIRM
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
c
:
RegisterFlagEffect
(
m
+
200
,
RESET_CHAIN
,
0
,
1
)
end
function
cm
.
eqfilter
(
c
,
tp
)
return
rk
.
check
(
c
,
"DAIOUGU"
)
and
c
:
CheckUniqueOnField
(
tp
)
and
not
c
:
IsForbidden
()
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
local
a
=
Duel
.
IsExistingMatchingCard
(
cm
.
eqfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
tp
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
,
0
)
>
0
and
c
:
GetFlagEffect
(
m
)
==
0
local
b
=
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_ONFIELD
+
LOCATION_GRAVE
,
LOCATION_ONFIELD
+
LOCATION_GRAVE
,
1
,
nil
)
and
c
:
GetFlagEffect
(
m
+
100
)
==
0
if
chk
==
0
then
return
a
or
b
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
0
,
LOCATION_ONFIELD
+
LOCATION_GRAVE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
nil
,
1
,
0
,
0
)
end
function
cm
.
op
(
e
,
tp
)
local
c
=
e
:
GetHandler
()
local
a
=
Duel
.
IsExistingMatchingCard
(
cm
.
eqfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
tp
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
,
0
)
>
0
and
c
:
GetFlagEffect
(
m
)
==
0
local
b
=
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_ONFIELD
+
LOCATION_GRAVE
,
LOCATION_ONFIELD
+
LOCATION_GRAVE
,
1
,
nil
)
and
c
:
GetFlagEffect
(
m
+
100
)
==
0
local
op
=
2
if
a
and
b
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
2
),
aux
.
Stringid
(
m
,
3
))
elseif
a
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
2
))
elseif
b
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
3
))
+
1
else
return
end
if
op
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
aux
.
Stringid
(
m
,
4
))
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
eqfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
tp
)
if
g
:
GetCount
()
>
0
then
local
tc
=
g
:
GetFirst
()
if
not
Duel
.
Equip
(
tp
,
tc
,
c
)
then
return
end
--equip limit
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetLabelObject
(
c
)
e1
:
SetValue
(
cm
.
eqlimit
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_EQUIP
)
e2
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetValue
(
1500
)
tc
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
tc
:
RegisterEffect
(
e3
)
c
:
RegisterFlagEffect
(
m
,
RESET_PHASE
+
PHASE_END
+
RESET_EVENT
+
RESETS_STANDARD
,
0
,
0
)
end
elseif
op
==
1
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
LOCATION_ONFIELD
+
LOCATION_GRAVE
,
LOCATION_ONFIELD
+
LOCATION_GRAVE
,
1
,
1
,
nil
)
if
tg
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
tg
)
Duel
.
Remove
(
tg
,
POS_FACEUP
,
REASON_EFFECT
)
c
:
RegisterFlagEffect
(
m
+
100
,
RESET_PHASE
+
PHASE_END
+
RESET_EVENT
+
RESETS_STANDARD
,
0
,
0
)
end
else
return
end
end
function
cm
.
eqlimit
(
e
,
c
)
return
c
==
e
:
GetLabelObject
()
end
\ No newline at end of file
expansions/script/c16150013.lua
0 → 100644
View file @
f5173df4
--大王具 大王龙机
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150013
,
"DAIOUGUDAIOURYUUKI"
)
function
cm
.
initial_effect
(
c
)
--link summon
c
:
EnableReviveLimit
()
aux
.
AddLinkProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsLinkType
,
TYPE_EFFECT
),
3
)
--to hand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCondition
(
cm
.
thcondition
)
e1
:
SetTarget
(
cm
.
thtg
)
e1
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e1
)
--hand summon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e2
:
SetCategory
(
CATEGORY_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCost
(
cm
.
effcost
)
e2
:
SetTarget
(
cm
.
sumtg
)
e2
:
SetOperation
(
cm
.
sumop
)
--c:RegisterEffect(e2)
--give effect
local
e6
=
Effect
.
CreateEffect
(
c
)
e6
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e6
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e6
:
SetType
(
EFFECT_TYPE_IGNITION
)
e6
:
SetRange
(
LOCATION_MZONE
)
e6
:
SetCountLimit
(
1
)
e6
:
SetCondition
(
cm
.
condition
)
e6
:
SetTarget
(
cm
.
retg
)
e6
:
SetOperation
(
cm
.
reop
)
local
e7
=
Effect
.
CreateEffect
(
c
)
e7
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_GRANT
)
e7
:
SetRange
(
LOCATION_SZONE
)
e7
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e7
:
SetTarget
(
cm
.
eftg
)
e7
:
SetLabelObject
(
e6
)
c
:
RegisterEffect
(
e7
)
local
e6_1
=
Effect
.
CreateEffect
(
c
)
e6_1
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e6_1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e6_1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e6_1
:
SetCode
(
EVENT_FREE_CHAIN
)
e6_1
:
SetRange
(
LOCATION_MZONE
)
e6_1
:
SetCondition
(
cm
.
condition1
)
e6_1
:
SetCountLimit
(
1
)
e6_1
:
SetTarget
(
cm
.
retg
)
e6_1
:
SetOperation
(
cm
.
reop
)
local
e7_1
=
Effect
.
CreateEffect
(
c
)
e7_1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_GRANT
)
e7_1
:
SetRange
(
LOCATION_SZONE
)
e7_1
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e7_1
:
SetTarget
(
cm
.
eftg
)
e7_1
:
SetLabelObject
(
e6_1
)
c
:
RegisterEffect
(
e7_1
)
end
function
cm
.
chainlm
(
e
,
ep
,
tp
)
return
tp
==
ep
end
function
cm
.
thcondition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_LINK
)
end
function
cm
.
thfilter
(
c
)
return
rk
.
check
(
c
,
"DAIOU"
)
and
c
:
IsAbleToHand
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetChainLimit
(
cm
.
chainlm
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
function
cm
.
costfilter
(
c
,
tp
)
return
c
:
IsReleasable
()
and
c
:
IsType
(
TYPE_EQUIP
)
and
(
c
:
IsFaceup
()
or
c
:
IsControler
(
tp
))
end
function
cm
.
effcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
costfilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
costfilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
,
tp
)
Duel
.
Release
(
g
,
REASON_COST
)
end
function
cm
.
sumfilter
(
c
)
return
c
:
IsRace
(
RACE_WARRIOR
)
and
c
:
IsSummonable
(
true
,
nil
)
end
function
cm
.
sumtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
sumfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SUMMON
,
nil
,
1
,
0
,
0
)
Duel
.
SetChainLimit
(
cm
.
chainlm
)
end
function
cm
.
sumop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
sumfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
local
tc
=
g
:
GetFirst
()
if
tc
then
Duel
.
Summon
(
tp
,
tc
,
true
,
nil
)
end
end
function
cm
.
condition
(
e
,
tp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
16150008
)
end
function
cm
.
condition1
(
e
,
tp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
16150008
)
end
function
cm
.
retg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
and
e
:
GetHandler
():
GetFlagEffect
(
m
)
==
0
end
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
nil
)
e
:
GetHandler
():
RegisterFlagEffect
(
m
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
,
EFFECT_FLAG_CLIENT_HINT
+
EFFECT_FLAG_OATH
,
0
,
0
,
aux
.
Stringid
(
m
,
5
))
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
g
,
1
,
0
,
0
)
end
function
cm
.
reop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
g
)
if
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
~=
0
then
local
tc
=
Duel
.
GetOperatedGroup
():
GetFirst
()
if
tc
and
tc
:
IsType
(
TYPE_MONSTER
)
and
tc
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
3
))
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
end
end
function
cm
.
eftg
(
e
,
c
)
return
e
:
GetHandler
():
GetEquipTarget
()
==
c
end
\ No newline at end of file
expansions/script/c16150014.lua
0 → 100644
View file @
f5173df4
--真言之天命 真剑之王命
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150014
,
"TENMEIOUMEI"
)
function
cm
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
m
+
EFFECT_COUNT_CODE_OATH
)
c
:
RegisterEffect
(
e1
)
--
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCode
(
EVENT_EQUIP
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCost
(
cm
.
cost
)
e2
:
SetTarget
(
cm
.
target
)
e2
:
SetOperation
(
cm
.
op
)
c
:
RegisterEffect
(
e2
)
--
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetOperation
(
cm
.
aop
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
cost
(
e
)
e
:
SetLabel
(
1
)
return
true
end
function
cm
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
c
:
GetOriginalType
()
&
TYPE_MONSTER
~=
0
end
function
cm
.
thfilter
(
c
,
tp
)
return
c
:
IsReleasable
()
and
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
c
)
end
function
cm
.
thfilter1
(
c
,
rc
)
local
tpe
=
rc
:
GetType
()
&
0x7
return
(
rk
.
check
(
c
,
"OUMEI"
)
or
rk
.
check
(
c
,
"DAIOU"
))
and
c
:
IsAbleToHand
()
and
c
:
IsType
(
tpe
)
end
function
cm
.
tpfilter
(
c
)
local
tpe
=
c
:
GetOriginalType
()
&
0x7
return
tpe
end
function
cm
.
addfilter
(
g
)
return
g
:
GetClassCount
(
cm
.
tpfilter
,
TYPE_SPELL
)
==#
g
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
local
a
=
eg
:
IsExists
(
cm
.
spfilter
,
1
,
nil
,
e
,
tp
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
,
0
)
>
0
local
b
=
eg
:
IsExists
(
cm
.
thfilter
,
1
,
nil
,
tp
)
local
c
=
eg
:
IsExists
(
Card
.
IsAbleToHandAsCost
,
1
,
nil
)
if
chk
==
0
then
if
e
:
GetLabel
()
==
1
then
return
a
or
b
or
c
else
return
false
end
end
local
op
=
2
if
a
and
b
and
c
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
5
),
aux
.
Stringid
(
m
,
6
),
aux
.
Stringid
(
m
,
7
))
elseif
a
and
b
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
5
),
aux
.
Stringid
(
m
,
6
))
elseif
b
and
c
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
6
),
aux
.
Stringid
(
m
,
7
))
+
1
elseif
a
and
c
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
5
),
aux
.
Stringid
(
m
,
7
))
if
op
==
1
then
op
=
op
+
1
end
elseif
a
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
5
))
elseif
b
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
6
))
+
1
elseif
c
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
7
))
+
2
end
if
op
==
0
then
e
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
eg
,
1
,
tp
,
0
)
e
:
SetLabel
(
4
)
elseif
op
==
1
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
local
g
=
eg
:
Filter
(
cm
.
thfilter
,
nil
,
tp
)
local
sg
=
g
:
SelectSubGroup
(
tp
,
cm
.
addfilter
,
false
,
1
,
#
g
)
Duel
.
Release
(
sg
,
REASON_COST
)
local
og
=
Duel
.
GetOperatedGroup
()
og
:
KeepAlive
()
e
:
SetLabelObject
(
og
)
e
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
#
sg
,
tp
,
LOCATION_DECK
)
e
:
SetLabel
(
5
)
elseif
op
==
2
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
rg
=
eg
:
FilterSelect
(
tp
,
Card
.
IsAbleToHandAsCost
,
1
,
#
eg
,
nil
)
local
og
=
Group
.
CreateGroup
()
for
tc
in
aux
.
Next
(
rg
)
do
local
eqc
=
tc
:
GetEquipTarget
()
if
eqc
then
og
:
AddCard
(
eqc
)
end
end
og
:
KeepAlive
()
e
:
SetLabelObject
(
og
)
Duel
.
SendtoHand
(
rg
,
tp
,
REASON_COST
)
local
og
=
Duel
.
GetOperatedGroup
()
if
og
:
IsExists
(
Card
.
IsType
,
1
,
nil
,
TYPE_MONSTER
)
then
e
:
SetLabel
(
7
)
else
e
:
SetLabel
(
6
)
end
e
:
SetCategory
(
CATEGORY_SUMMON
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SUMMON
,
nil
,
1
,
tp
,
0
)
end
end
function
cm
.
tpefilter
(
c
,
tpe
)
return
c
:
GetOriginalType
()
&
tpe
~=
0
end
function
cm
.
adfilter1
(
c
,
tpe
,
og
)
return
c
:
IsAbleToHand
()
and
(
rk
.
check
(
c
,
"OUMEI"
)
or
rk
.
check
(
c
,
"DAIOU"
))
and
not
c
:
IsType
(
tpe
)
and
og
:
IsExists
(
cm
.
tpefilter
,
1
,
nil
,
c
:
GetType
()
&
0x7
)
end
function
cm
.
imfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsLocation
(
LOCATION_MZONE
)
end
function
cm
.
val
(
e
,
re
)
return
re
:
GetHandlerPlayer
()
~=
e
:
GetOwnerPlayer
()
end
function
cm
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
false
end
if
e
:
GetLabel
()
==
4
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
,
0
)
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
eg
:
FilterSelect
(
tp
,
cm
.
spfilter
,
1
,
1
,
nil
,
e
,
tp
)
if
sg
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
sg
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
elseif
e
:
GetLabel
()
==
5
then
local
og
=
e
:
GetLabelObject
()
local
tpe
=
0x0
local
ag
=
Group
.
CreateGroup
()
for
i
=
0
,
#
og
do
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
adfilter1
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
tpe
,
og
)
if
sg
:
GetCount
()
>
0
then
local
tc
=
sg
:
GetFirst
()
tpe
=
tpe
|
(
tc
:
GetType
()
&
0x7
)
ag
:
Merge
(
sg
)
end
end
if
ag
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
ag
,
tp
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
ag
)
end
elseif
e
:
GetLabel
()
==
6
then
local
og
=
e
:
GetLabelObject
()
local
ig
=
og
:
Filter
(
cm
.
imfilter
,
nil
)
if
ig
:
GetCount
()
>
0
then
for
tc
in
aux
.
Next
(
ig
)
do
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetValue
(
cm
.
val
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
,
2
)
e1
:
SetOwnerPlayer
(
tp
)
tc
:
RegisterEffect
(
e1
)
end
end
elseif
e
:
GetLabel
()
==
7
then
local
og
=
e
:
GetLabelObject
()
local
ig
=
og
:
Filter
(
cm
.
imfilter
,
nil
)
if
ig
:
GetCount
()
>
0
then
for
tc
in
aux
.
Next
(
ig
)
do
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e1
:
SetValue
(
cm
.
val
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
,
2
)
e1
:
SetOwnerPlayer
(
tp
)
tc
:
RegisterEffect
(
e1
)
end
end
Duel
.
BreakEffect
()
if
Duel
.
IsExistingMatchingCard
(
Card
.
IsSummonable
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
true
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
2
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SUMMON
)
local
sc
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsSummonable
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
true
,
nil
):
GetFirst
()
if
sc
then
Duel
.
Summon
(
tp
,
sc
,
true
,
nil
)
end
end
end
end
function
cm
.
aop
(
e
,
tp
)
local
c
=
e
:
GetHandler
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetCode
(
EFFECT_ADD_EXTRA_TRIBUTE
)
e1
:
SetTargetRange
(
LOCATION_ONFIELD
,
LOCATION_ONFIELD
)
e1
:
SetTarget
(
cm
.
rtg
)
e1
:
SetValue
(
POS_FACEUP_ATTACK
+
POS_FACEDOWN_DEFENSE
)
e1
:
SetOwnerPlayer
(
tp
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_GRANT
)
e2
:
SetTargetRange
(
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
)
e2
:
SetTarget
(
cm
.
advtg
)
e2
:
SetLabelObject
(
e1
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
,
2
)
Duel
.
RegisterEffect
(
e2
,
tp
)
local
e3
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e3
:
SetReset
(
RESET_PHASE
+
PHASE_END
+
RESET_OPPO_TURN
,
2
)
e3
:
SetTargetRange
(
1
,
0
)
Duel
.
RegisterEffect
(
e3
,
tp
)
end
function
cm
.
rtg
(
e
,
rc
)
return
(
rc
:
IsLocation
(
LOCATION_SZONE
)
or
(
rc
:
IsFaceup
()
and
rc
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
))
and
rc
~=
e
:
GetHandler
()
end
function
cm
.
advtg
(
e
,
c
)
return
c
:
IsLevelAbove
(
5
)
end
\ No newline at end of file
expansions/script/c16150015.lua
0 → 100644
View file @
f5173df4
--天命之骑士 大王命骑士
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150015
,
"TENMEINOKISIDAIOUMEIKISI"
)
function
cm
.
initial_effect
(
c
)
--special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
m
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCondition
(
cm
.
spcon
)
e1
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e1
)
--Equip
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e2
:
SetCategory
(
CATEGORY_EQUIP
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e2
:
SetTarget
(
cm
.
distg1
)
e2
:
SetOperation
(
cm
.
disop1
)
c
:
RegisterEffect
(
e2
)
--
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_RELEASE
)
e3
:
SetOperation
(
cm
.
op
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
spcfilter
(
c
)
return
rk
.
check
(
c
,
"DAIOU"
)
and
not
c
:
IsPublic
()
end
function
cm
.
spcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
cm
.
spcfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
c
)
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CONFIRM
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spcfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
c
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
Duel
.
ShuffleHand
(
tp
)
end
function
cm
.
thfilter
(
c
)
return
rk
.
check
(
c
,
"OUMEI"
)
and
c
:
CheckUniqueOnField
(
tp
)
and
not
c
:
IsForbidden
()
end
function
cm
.
distg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
,
0
)
>
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
disop1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsFacedown
()
or
not
c
:
IsRelateToEffect
(
e
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
local
tc
=
g
:
GetFirst
()
if
tc
:
IsType
(
TYPE_SPELL
)
and
not
tc
:
IsType
(
TYPE_EQUIP
)
then
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
local
record_type
=
tc
:
GetOriginalType
()
tc
:
SetCardData
(
CARDDATA_TYPE
,
record_type
|
TYPE_EQUIP
)
tc
:
RegisterFlagEffect
(
m
,
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TOFIELD
,
0
,
1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_MOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e2
:
SetLabel
(
record_type
)
e2
:
SetOperation
(
cm
.
rstop
)
tc
:
RegisterEffect
(
e2
)
end
if
not
Duel
.
Equip
(
tp
,
tc
,
c
)
then
return
end
--equip limit
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetLabelObject
(
c
)
e1
:
SetValue
(
cm
.
eqlimit
)
tc
:
RegisterEffect
(
e1
)
end
end
function
cm
.
rstcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetFlagEffect
(
m
)
==
0
end
function
cm
.
rstop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
c
:
SetCardData
(
CARDDATA_TYPE
,
e
:
GetLabel
())
e
:
Reset
()
end
function
cm
.
eqlimit
(
e
,
c
)
return
c
==
e
:
GetLabelObject
()
end
function
cm
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsReason
(
REASON_SUMMON
)
and
c
:
IsReason
(
REASON_MATERIAL
)
then
local
tc
=
c
:
GetReasonCard
()
tc
:
CopyEffect
(
m
,
RESET_EVENT
+
0x7e0000
,
0
)
end
end
\ No newline at end of file
expansions/script/c16150017.lua
0 → 100644
View file @
f5173df4
--真王命之大王具
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150017
,
"SEIOUMEINODAIOUGU"
)
function
cm
.
initial_effect
(
c
)
--fusion procedure
c
:
EnableReviveLimit
()
aux
.
AddFusionProcMix
(
c
,
true
,
true
,
cm
.
FusFilter1
,
cm
.
FusFilter2
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetOperation
(
cm
.
op
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e2
:
SetTargetRange
(
LOCATION_ONFIELD
,
0
)
e2
:
SetTarget
(
cm
.
tg
)
e2
:
SetValue
(
cm
.
efilter
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
FusFilter1
(
c
)
return
rk
.
check
(
c
,
"DAIOU"
)
or
rk
.
check
(
c
,
"OUMEI"
)
or
c
:
IsType
(
TYPE_EQUIP
)
end
function
cm
.
FusFilter2
(
c
)
return
rk
.
check
(
c
,
"DAIOU"
)
or
rk
.
check
(
c
,
"OUMEI"
)
or
c
:
IsType
(
TYPE_EQUIP
)
end
function
cm
.
op
(
e
,
tp
)
local
c
=
e
:
GetHandler
()
local
tp
=
c
:
GetSummonPlayer
()
if
not
c
:
IsSummonType
(
SUMMON_TYPE_FUSION
)
then
return
false
end
if
Duel
.
GetFlagEffect
(
tp
,
m
)
==
0
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e1
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetCondition
(
cm
.
con
)
e1
:
SetOperation
(
cm
.
op1
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EFFECT_SEND_REPLACE
)
e2
:
SetTarget
(
cm
.
reptg
)
e2
:
SetValue
(
cm
.
repval
)
Duel
.
RegisterEffect
(
e2
,
tp
)
local
e3
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_CLIENT_HINT
)
e3
:
SetTargetRange
(
1
,
0
)
Duel
.
RegisterEffect
(
e3
,
tp
)
end
Duel
.
RegisterFlagEffect
(
tp
,
m
,
0
,
0
,
0
)
end
function
cm
.
sfilter
(
c
)
return
c
:
IsSummonable
(
true
,
nil
)
and
(
rk
.
check
(
c
,
"DAIOU"
)
or
rk
.
check
(
c
,
"OUMEI"
)
or
c
:
IsSetCard
(
0xccd
))
end
function
cm
.
con
(
e
,
tp
)
local
num
=
Duel
.
GetFlagEffect
(
tp
,
m
)
local
num2
=
Duel
.
GetFlagEffect
(
tp
,
m
+
2
)
if
num
==
nil
or
num
==
0
then
return
false
end
return
(
Duel
.
GetCurrentPhase
()
==
PHASE_MAIN1
or
Duel
.
GetCurrentPhase
()
==
PHASE_MAIN2
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
sfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
and
Duel
.
GetFlagEffect
(
tp
,
m
+
2
)
<
Duel
.
GetFlagEffect
(
tp
,
m
)
end
function
cm
.
op1
(
e
,
tp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
sfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Summon
(
tp
,
g
:
GetFirst
(),
true
,
nil
)
Duel
.
RegisterFlagEffect
(
tp
,
m
+
2
,
RESET_PHASE
+
PHASE_END
,
0
,
0
)
end
end
function
cm
.
val
(
e
,
re
)
local
num
=
Duel
.
GetFlagEffect
(
tp
,
m
)
if
num
==
nil
then
return
0
end
return
num
end
function
cm
.
repfilter
(
c
,
tp
)
return
c
:
IsControler
(
tp
)
and
(
c
:
IsReason
(
REASON_LOST_TARGET
)
or
(
c
:
IsReason
(
REASON_RELEASE
)
and
c
:
IsReason
(
REASON_SUMMON
))
or
c
:
GetDestination
()
==
LOCATION_DECK
)
and
c
:
IsLocation
(
LOCATION_ONFIELD
)
and
c
:
IsType
(
TYPE_EQUIP
)
end
function
cm
.
reptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
eg
:
IsExists
(
cm
.
repfilter
,
1
,
nil
,
tp
)
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
0
,
1
,
eg
)
end
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
1
))
then
local
g
=
eg
:
Filter
(
cm
.
repfilter
,
nil
,
tp
)
local
ct
=
g
:
GetCount
()
if
ct
>
1
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
g
=
g
:
Select
(
tp
,
1
,
ct
,
nil
)
end
local
tc
=
g
:
GetFirst
()
while
tc
do
Duel
.
Hint
(
HINT_CARD
,
0
,
tc
:
GetOriginalCode
())
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
aux
.
Stringid
(
m
,
2
))
local
ac
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
tc
:
GetEquipTarget
()):
GetFirst
()
if
not
Duel
.
Equip
(
tp
,
tc
,
ac
,
true
,
true
)
then
return
end
--equip limit
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetLabelObject
(
ac
)
e1
:
SetValue
(
cm
.
eqlimit
)
tc
:
RegisterEffect
(
e1
,
true
)
tc
=
g
:
GetNext
()
end
Duel
.
EquipComplete
()
return
true
else
return
false
end
end
function
cm
.
eqlimit
(
e
,
c
)
return
c
==
e
:
GetLabelObject
()
end
function
cm
.
repval
(
e
,
c
)
return
true
end
function
cm
.
efilter
(
e
,
re
)
return
e
:
GetHandlerPlayer
()
~=
re
:
GetOwnerPlayer
()
end
function
cm
.
tg
(
e
,
c
)
local
rc
=
e
:
GetHandler
()
local
qc
=
rc
:
GetEquipTarget
()
if
qc
then
local
eg
=
qc
:
GetEquipGroup
()
if
eg
:
GetCount
()
<
3
then
return
false
end
return
eg
:
IsContains
(
c
)
or
c
==
qc
end
return
false
end
\ No newline at end of file
expansions/script/c16150018.lua
0 → 100644
View file @
f5173df4
This diff is collapsed.
Click to expand it.
expansions/script/c16150019.lua
0 → 100644
View file @
f5173df4
--大王咒使
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150019
,
"DAIOUJYUTSUKAI"
)
function
cm
.
initial_effect
(
c
)
c
:
SetUniqueOnField
(
1
,
0
,
m
)
--change effect
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCost
(
cm
.
cost
)
e1
:
SetCondition
(
cm
.
discon
)
e1
:
SetTarget
(
cm
.
distg
)
e1
:
SetOperation
(
cm
.
disop
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
costfilter2
(
c
,
tp
)
return
c
:
IsType
(
TYPE_SPELL
)
and
(
c
:
IsFaceup
()
or
c
:
IsControler
(
tp
))
and
c
:
IsReleasable
()
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
local
g
=
Duel
.
GetMatchingGroup
(
cm
.
costfilter2
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
nil
,
tp
)
if
c
:
GetEquipGroup
()
and
c
:
GetEquipGroup
():
IsExists
(
Card
.
IsCode
,
1
,
nil
,
16150020
)
then
g
=
Duel
.
GetMatchingGroup
(
cm
.
costfilter2
,
tp
,
LOCATION_ONFIELD
+
LOCATION_HAND
,
LOCATION_ONFIELD
,
nil
,
tp
)
end
if
chk
==
0
then
return
g
:
GetCount
()
>
0
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
Release
(
sg
,
REASON_COST
)
sg
:
KeepAlive
()
e
:
SetLabelObject
(
sg
)
end
function
cm
.
discon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
e
:
GetHandler
():
IsStatus
(
STATUS_BATTLE_DESTROYED
)
end
function
cm
.
distg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
nil
,
rp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
nil
,
1
,
0
,
LOCATION_ONFIELD
)
end
function
cm
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Group
.
CreateGroup
()
Duel
.
ChangeTargetCard
(
ev
,
g
)
Duel
.
ChangeChainOperation
(
ev
,
cm
.
repop
)
if
re
:
GetHandler
()
then
re
:
GetHandler
():
CancelToGrave
()
Duel
.
SendtoDeck
(
re
:
GetHandler
(),
nil
,
2
,
REASON_EFFECT
)
end
end
function
cm
.
repop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectMatchingCard
(
1
-
tp
,
nil
,
1
-
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
g
)
Duel
.
Destroy
(
g
,
REASON_EFFECT
)
end
end
\ No newline at end of file
expansions/script/c16150020.lua
0 → 100644
View file @
f5173df4
--大王具 智慧的抱拥
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150020
,
"DAIOUGU"
)
local
code
,
ccode
=
rk
.
set
(
16150024
,
"OUMEI"
)
function
cm
.
initial_effect
(
c
)
c
:
SetUniqueOnField
(
1
,
1
,
m
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_CONTINUOUS_TARGET
)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
operation2
)
c
:
RegisterEffect
(
e1
)
--Special Summon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCountLimit
(
1
,
m
)
e2
:
SetCost
(
cm
.
cost
)
e2
:
SetCondition
(
cm
.
con
)
e2
:
SetTarget
(
cm
.
tktg
)
e2
:
SetOperation
(
cm
.
tkop
)
c
:
RegisterEffect
(
e2
)
local
e2_1
=
e2
:
Clone
()
e2_1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2_1
:
SetCode
(
EVENT_FREE_CHAIN
)
e2_1
:
SetCondition
(
cm
.
con1
)
c
:
RegisterEffect
(
e2_1
)
--Equip limit
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e3
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e3
:
SetValue
(
cm
.
eqlimit
)
c
:
RegisterEffect
(
e3
)
--
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e4
:
SetRange
(
LOCATION_SZONE
)
e4
:
SetCode
(
EVENT_CHAINING
)
e4
:
SetCondition
(
cm
.
condition
)
e4
:
SetOperation
(
cm
.
operation
)
c
:
RegisterEffect
(
e4
)
--inactivatable
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetType
(
EFFECT_TYPE_FIELD
)
e5
:
SetCode
(
EFFECT_CANNOT_INACTIVATE
)
e5
:
SetRange
(
LOCATION_SZONE
)
e5
:
SetValue
(
cm
.
effectfilter
)
c
:
RegisterEffect
(
e5
)
local
e6
=
Effect
.
CreateEffect
(
c
)
e6
:
SetType
(
EFFECT_TYPE_FIELD
)
e6
:
SetCode
(
EFFECT_CANNOT_DISEFFECT
)
e6
:
SetRange
(
LOCATION_SZONE
)
e6
:
SetValue
(
cm
.
effectfilter
)
c
:
RegisterEffect
(
e6
)
end
function
cm
.
eqlimit
(
e
,
c
)
return
rk
.
check
(
c
,
"DAIOU"
)
end
function
cm
.
filter
(
c
)
return
c
:
IsFaceup
()
and
rk
.
check
(
c
,
"DAIOU"
)
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
GetLocation
()
==
LOCATION_MZONE
and
cm
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
SelectTarget
(
tp
,
cm
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
cm
.
operation2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
e
:
GetHandler
():
IsRelateToEffect
(
e
)
and
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
then
Duel
.
Equip
(
tp
,
e
:
GetHandler
(),
tc
)
end
end
function
cm
.
con
(
e
,
tp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
16150008
)
end
function
cm
.
con1
(
e
,
tp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
16150008
)
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
CheckLPCost
(
tp
,
1000
)
end
Duel
.
PayLPCost
(
tp
,
1000
)
end
function
cm
.
tktg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
m
+
4
,
0
,
TYPES_TOKEN_MONSTER
,
1000
,
1000
,
4
,
RACE_SPELLCASTER
,
ATTRIBUTE_LIGHT
,
POS_FACEUP
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
end
function
cm
.
tkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetTargetRange
(
1
,
0
)
e1
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsLocation
,
LOCATION_EXTRA
))
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
m
+
4
,
0
,
TYPES_TOKEN_MONSTER
,
1000
,
1000
,
4
,
RACE_SPELLCASTER
,
ATTRIBUTE_LIGHT
,
POS_FACEUP
)
then
return
end
local
token
=
Duel
.
CreateToken
(
tp
,
m
+
4
)
Duel
.
SpecialSummon
(
token
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
function
cm
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetFlagEffect
(
m
)
==
0
end
function
cm
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
op
=
re
:
GetOperation
()
if
Duel
.
IsChainNegatable
(
ev
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
2
))
and
Duel
.
NegateActivation
(
ev
)
then
if
not
op
then
return
end
if
not
c
:
GetEquipTarget
()
then
return
end
Duel
.
Hint
(
HINT_CARD
,
tp
,
re
:
GetHandler
():
GetOriginalCode
())
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
4
))
then
local
e1
=
c
:
RegisterFlagEffect
(
m
,
RESET_EVENT
+
RESETS_STANDARD
,
EFFECT_FLAG_CLIENT_HINT
,
0
,
0
,
aux
.
Stringid
(
m
,
3
))
local
ec
=
c
:
GetEquipTarget
()
local
ce
=
re
:
Clone
()
ce
:
SetType
(
EFFECT_TYPE_QUICK_O
)
ce
:
SetRange
(
LOCATION_MZONE
)
ce
:
SetCountLimit
(
1
)
if
not
ce
:
GetCode
()
then
ce
:
SetCode
(
EVENT_FREE_CHAIN
)
end
ce
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
ec
:
RegisterEffect
(
ce
)
getmetatable
(
c
).
daioufilter
=
{
ce
,
e1
}
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_ADJUST
)
e3
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e3
:
SetRange
(
0x7f
)
e3
:
SetLabelObject
(
ec
)
e3
:
SetOperation
(
cm
.
rstop
)
c
:
RegisterEffect
(
e3
)
end
end
end
function
cm
.
rstop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetLabelObject
()
local
tc
=
e
:
GetHandler
()
local
cid
=
e
:
GetLabel
()
local
tab
=
getmetatable
(
tc
).
daioufilter
if
tc
:
GetEquipTarget
()
~=
c
then
if
#
tab
~=
0
then
for
i
,
v
in
ipairs
(
tab
)
do
if
aux
.
GetValueType
(
v
)
==
"Effect"
then
v
:
Reset
()
end
end
end
e
:
Reset
()
end
end
function
cm
.
effectfilter
(
e
,
ct
)
local
te
,
tp
,
loc
=
Duel
.
GetChainInfo
(
ct
,
CHAININFO_TRIGGERING_EFFECT
,
CHAININFO_TRIGGERING_PLAYER
,
CHAININFO_TRIGGERING_LOCATION
)
return
te
:
GetHandler
()
==
e
:
GetHandler
():
GetEquipTarget
()
end
\ No newline at end of file
expansions/script/c16150021.lua
0 → 100644
View file @
f5173df4
--大王具 恶食的笼手
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150021
,
"DAIOUGURYUTE"
)
function
cm
.
initial_effect
(
c
)
c
:
SetUniqueOnField
(
1
,
1
,
cm
.
uqfilter
,
LOCATION_ONFIELD
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_CONTINUOUS_TARGET
)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
operation2
)
c
:
RegisterEffect
(
e1
)
--
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCondition
(
cm
.
condition
)
e2
:
SetOperation
(
cm
.
operation
)
c
:
RegisterEffect
(
e2
)
--Equip limit
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e3
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e3
:
SetValue
(
cm
.
eqlimit
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
unfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCode
(
m
)
end
function
cm
.
uqfilter
(
c
)
return
Duel
.
IsExistingMatchingCard
(
cm
.
unfilter
,
0
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
2
,
c
)
and
c
:
IsCode
(
m
)
end
function
cm
.
eqlimit
(
e
,
c
)
return
rk
.
check
(
c
,
"DAIOU"
)
end
function
cm
.
filter
(
c
)
return
c
:
IsFaceup
()
and
rk
.
check
(
c
,
"DAIOU"
)
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
GetLocation
()
==
LOCATION_MZONE
and
cm
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
SelectTarget
(
tp
,
cm
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
cm
.
operation2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
e
:
GetHandler
():
IsRelateToEffect
(
e
)
and
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
then
Duel
.
Equip
(
tp
,
e
:
GetHandler
(),
tc
)
end
end
function
cm
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
rp
==
tp
and
re
:
IsActiveType
(
TYPE_SPELL
)
and
re
:
GetHandlerPlayer
()
==
tp
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
and
e
:
GetHandler
():
GetFlagEffect
(
m
)
==
0
end
function
cm
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
op
=
re
:
GetOperation
()
local
pro1
,
pro2
=
re
:
GetProperty
()
if
not
op
then
return
end
Duel
.
Hint
(
HINT_CARD
,
tp
,
re
:
GetHandler
():
GetOriginalCode
())
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
1
))
then
c
:
RegisterFlagEffect
(
m
,
RESET_EVENT
+
RESETS_STANDARD
,
EFFECT_FLAG_CLIENT_HINT
,
0
,
0
,
aux
.
Stringid
(
m
,
2
))
e
:
GetHandler
():
SetHint
(
CHINT_CARD
,
re
:
GetHandler
():
GetOriginalCode
())
local
ce
=
re
:
Clone
()
local
ce2
=
re
:
Clone
()
if
not
re
:
GetHandler
():
IsType
(
TYPE_QUICKPLAY
)
and
pro2
&
EFFECT_FLAG2_COF
==
0
then
ce
:
SetType
(
EFFECT_TYPE_IGNITION
)
ce
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
ce
:
SetCountLimit
(
1
)
c
:
RegisterEffect
(
ce
)
end
if
pro2
&
EFFECT_FLAG2_COF
~=
0
or
re
:
GetHandler
():
IsType
(
TYPE_QUICKPLAY
)
then
ce2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
ce2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
ce2
:
SetCountLimit
(
1
)
c
:
RegisterEffect
(
ce2
)
end
if
not
((
rk
.
check
(
re
:
GetHandler
(),
"DAIOU"
)
or
rk
.
check
(
re
:
GetHandler
(),
"OUMEI"
)
or
re
:
GetHandler
():
IsSetCard
(
0xccd
)))
then
local
tc
=
re
:
GetHandler
()
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetTargetRange
(
1
,
1
)
e1
:
SetValue
(
cm
.
aclimit
)
e1
:
SetLabel
(
tc
:
GetCode
())
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
end
function
cm
.
aclimit
(
e
,
re
,
tp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
GetOriginalCode
()
==
e
:
GetLabel
()
end
\ No newline at end of file
expansions/script/c16150022.lua
0 → 100644
View file @
f5173df4
--大王具 恶魔的笼手
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150022
,
"DAIOUGURYUTE"
)
function
cm
.
initial_effect
(
c
)
c
:
SetUniqueOnField
(
1
,
1
,
cm
.
uqfilter
,
LOCATION_ONFIELD
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_CONTINUOUS_TARGET
)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
operation2
)
c
:
RegisterEffect
(
e1
)
--
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCondition
(
cm
.
condition
)
e2
:
SetOperation
(
cm
.
operation
)
c
:
RegisterEffect
(
e2
)
--Equip limit
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e3
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e3
:
SetValue
(
cm
.
eqlimit
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
unfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCode
(
m
)
end
function
cm
.
uqfilter
(
c
)
return
Duel
.
IsExistingMatchingCard
(
cm
.
unfilter
,
0
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
2
,
c
)
and
c
:
IsCode
(
m
)
end
function
cm
.
eqlimit
(
e
,
c
)
return
rk
.
check
(
c
,
"DAIOU"
)
end
function
cm
.
filter
(
c
)
return
c
:
IsFaceup
()
and
rk
.
check
(
c
,
"DAIOU"
)
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
GetLocation
()
==
LOCATION_MZONE
and
cm
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
SelectTarget
(
tp
,
cm
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
cm
.
operation2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
e
:
GetHandler
():
IsRelateToEffect
(
e
)
and
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
then
Duel
.
Equip
(
tp
,
e
:
GetHandler
(),
tc
)
end
end
function
cm
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
rp
==
tp
and
re
:
IsActiveType
(
TYPE_MONSTER
)
and
re
:
GetHandlerPlayer
()
==
tp
and
e
:
GetHandler
():
GetFlagEffect
(
m
)
==
0
end
function
cm
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
op
=
re
:
GetOperation
()
if
not
op
then
return
end
Duel
.
Hint
(
HINT_CARD
,
tp
,
re
:
GetHandler
():
GetOriginalCode
())
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
1
))
then
c
:
RegisterFlagEffect
(
m
,
RESET_EVENT
+
RESETS_STANDARD
,
EFFECT_FLAG_CLIENT_HINT
,
0
,
0
,
aux
.
Stringid
(
m
,
2
))
e
:
GetHandler
():
SetHint
(
CHINT_CARD
,
re
:
GetHandler
():
GetOriginalCode
())
local
ce
=
Effect
.
CreateEffect
(
c
)
local
desc
=
re
:
GetDescription
()
local
con
=
re
:
GetCondition
()
local
cost
=
re
:
GetCost
()
local
target
=
re
:
GetTarget
()
local
operation
=
re
:
GetOperation
()
local
code
=
re
:
GetCode
()
local
pro1
,
pro2
=
re
:
GetProperty
()
ce
:
SetDescription
(
desc
)
ce
:
SetType
(
re
:
GetType
())
if
con
then
ce
:
SetCondition
(
con
)
end
if
cost
then
ce
:
SetCost
(
cost
)
end
if
target
then
ce
:
SetTarget
(
target
)
end
if
operation
then
ce
:
SetOperation
(
operation
)
end
ce
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
ce
:
SetRange
(
LOCATION_SZONE
)
if
code
then
ce
:
SetCode
(
code
)
else
ce
:
SetCode
(
EVENT_FREE_CHAIN
)
end
if
pro1
and
pro2
then
ce
:
SetProperty
(
pro1
,
pro2
)
end
ce
:
SetCountLimit
(
1
)
c
:
RegisterEffect
(
ce
,
true
)
if
not
((
rk
.
check
(
re
:
GetHandler
(),
"DAIOU"
)
or
rk
.
check
(
re
:
GetHandler
(),
"OUMEI"
)
or
re
:
GetHandler
():
IsSetCard
(
0xccd
)))
then
local
tc
=
re
:
GetHandler
()
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetTargetRange
(
1
,
1
)
e1
:
SetValue
(
cm
.
aclimit
)
e1
:
SetLabel
(
tc
:
GetCode
())
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
end
function
cm
.
aclimit
(
e
,
re
,
tp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
GetOriginalCode
()
==
e
:
GetLabel
()
end
\ No newline at end of file
expansions/script/c16150023.lua
0 → 100644
View file @
f5173df4
--大王具 恶形的笼手
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150023
,
"DAIOUGURYUTE"
)
function
cm
.
initial_effect
(
c
)
c
:
SetUniqueOnField
(
1
,
1
,
cm
.
uqfilter
,
LOCATION_ONFIELD
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_CONTINUOUS_TARGET
)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
operation2
)
c
:
RegisterEffect
(
e1
)
--
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCondition
(
cm
.
condition
)
e2
:
SetOperation
(
cm
.
operation
)
c
:
RegisterEffect
(
e2
)
--Equip limit
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e3
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e3
:
SetValue
(
cm
.
eqlimit
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
unfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCode
(
m
)
end
function
cm
.
uqfilter
(
c
)
return
Duel
.
IsExistingMatchingCard
(
cm
.
unfilter
,
0
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
2
,
c
)
and
c
:
IsCode
(
m
)
end
function
cm
.
eqlimit
(
e
,
c
)
return
rk
.
check
(
c
,
"DAIOU"
)
end
function
cm
.
filter
(
c
)
return
c
:
IsFaceup
()
and
rk
.
check
(
c
,
"DAIOU"
)
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
GetLocation
()
==
LOCATION_MZONE
and
cm
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
SelectTarget
(
tp
,
cm
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
cm
.
operation2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
e
:
GetHandler
():
IsRelateToEffect
(
e
)
and
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
then
Duel
.
Equip
(
tp
,
e
:
GetHandler
(),
tc
)
end
end
function
cm
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
rp
==
tp
and
re
:
IsActiveType
(
TYPE_TRAP
)
and
re
:
GetHandlerPlayer
()
==
tp
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
and
e
:
GetHandler
():
GetFlagEffect
(
m
)
==
0
end
function
cm
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
op
=
re
:
GetOperation
()
local
pro1
,
pro2
=
re
:
GetProperty
()
if
not
op
then
return
end
Duel
.
Hint
(
HINT_CARD
,
tp
,
re
:
GetHandler
():
GetOriginalCode
())
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
1
))
then
c
:
RegisterFlagEffect
(
m
,
RESET_EVENT
+
RESETS_STANDARD
,
EFFECT_FLAG_CLIENT_HINT
,
0
,
0
,
aux
.
Stringid
(
m
,
2
))
e
:
GetHandler
():
SetHint
(
CHINT_CARD
,
re
:
GetHandler
():
GetOriginalCode
())
local
ce
=
re
:
Clone
()
local
ce2
=
re
:
Clone
()
ce2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
ce2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
ce2
:
SetCountLimit
(
1
)
c
:
RegisterEffect
(
ce2
)
if
not
((
rk
.
check
(
re
:
GetHandler
(),
"DAIOU"
)
or
rk
.
check
(
re
:
GetHandler
(),
"OUMEI"
)
or
re
:
GetHandler
():
IsSetCard
(
0xccd
)))
then
local
tc
=
re
:
GetHandler
()
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e1
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e1
:
SetTargetRange
(
1
,
1
)
e1
:
SetValue
(
cm
.
aclimit
)
e1
:
SetLabel
(
tc
:
GetCode
())
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
end
function
cm
.
aclimit
(
e
,
re
,
tp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
GetOriginalCode
()
==
e
:
GetLabel
()
end
\ No newline at end of file
expansions/script/c16150025.lua
0 → 100644
View file @
f5173df4
--水晶的大王兽
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150025
,
"DAIOUJYUU"
)
if
rkj
then
return
end
rkj
=
cm
function
rkj
.
HandSp
(
c
,
code
)
local
e
=
Effect
.
CreateEffect
(
c
)
e
:
SetDescription
(
aux
.
Stringid
(
code
,
0
))
e
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e
:
SetType
(
EFFECT_TYPE_IGNITION
)
e
:
SetRange
(
LOCATION_HAND
)
e
:
SetCountLimit
(
1
,
code
)
e
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e
:
SetCost
(
cm
.
HandSpCost
)
e
:
SetCondition
(
rkj
.
HandSpCondition1
)
e
:
SetTarget
(
cm
.
HandSpTarget
)
e
:
SetOperation
(
cm
.
HandSpOperation
)
c
:
RegisterEffect
(
e
)
local
re
=
e
:
Clone
()
re
:
SetType
(
EFFECT_TYPE_QUICK_O
)
re
:
SetCode
(
EVENT_FREE_CHAIN
)
re
:
SetCondition
(
rkj
.
HandSpCondition2
)
c
:
RegisterEffect
(
re
)
return
e
,
re
end
function
cm
.
HandSpCost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
Duel
.
ConfirmCards
(
1
-
tp
,
e
:
GetHandler
())
end
function
rkj
.
HandSpCondition1
(
e
,
tp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
16150008
)
end
function
rkj
.
HandSpCondition2
(
e
,
tp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
16150008
)
end
function
cm
.
HandSpTarget
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
chkc
:
IsControler
(
tp
)
and
chkc
:
IsLocation
(
LOCATION_MZONE
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
nil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
local
g
=
Duel
.
SelectTarget
(
tp
,
nil
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
cm
.
HandSpOperation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
not
c
:
IsRelateToEffect
(
e
)
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<
1
or
not
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
then
return
false
end
if
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
~=
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
tc
:
IsRelateToEffect
(
e
)
then
if
tc
:
IsPosition
(
POS_FACEUP
)
then
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
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_SPELL
+
TYPE_CONTINUOUS
)
tc
:
RegisterEffect
(
e1
)
else
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
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_SPELL
+
TYPE_CONTINUOUS
)
tc
:
RegisterEffect
(
e1
)
end
end
end
function
rkj
.
STzoneEffect
(
c
,
code
,
cate
,
target
,
op
)
local
e
=
Effect
.
CreateEffect
(
c
)
e
:
SetDescription
(
aux
.
Stringid
(
code
,
1
))
e
:
SetCategory
(
cate
)
e
:
SetType
(
EFFECT_TYPE_IGNITION
)
e
:
SetRange
(
LOCATION_SZONE
)
e
:
SetCountLimit
(
1
)
e
:
SetProperty
(
EFFECT_FLAG_NO_TURN_RESET
)
e
:
SetCost
(
cm
.
STzoneCost
)
e
:
SetCondition
(
cm
.
STzoneCondition1
)
e
:
SetTarget
(
target
)
e
:
SetOperation
(
op
)
c
:
RegisterEffect
(
e
)
local
re
=
e
:
Clone
()
re
:
SetType
(
EFFECT_TYPE_QUICK_O
)
re
:
SetCode
(
EVENT_FREE_CHAIN
)
re
:
SetCondition
(
cm
.
STzoneCondition2
)
c
:
RegisterEffect
(
re
)
return
e
,
re
end
function
cm
.
STzoneCondition1
(
e
,
tp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
16150008
)
end
function
cm
.
STzoneCondition2
(
e
,
tp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
16150008
)
end
function
cm
.
STzoneCost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
e
:
SetLabel
(
1
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDiscardDeckAsCost
(
tp
,
3
)
and
e
:
GetHandler
():
GetFlagEffect
(
m
)
==
0
end
Duel
.
DiscardDeck
(
tp
,
3
,
REASON_COST
)
e
:
GetHandler
():
RegisterFlagEffect
(
m
,
RESET_EVENT
+
RESETS_STANDARD
,
0
,
0
,
0
)
local
og
=
Duel
.
GetOperatedGroup
()
og
:
KeepAlive
()
e
:
SetLabelObject
(
og
)
end
function
cm
.
initial_effect
(
c
)
local
e0
,
e1
=
rkj
.
HandSp
(
c
,
m
)
local
e4
,
e5
=
rkj
.
STzoneEffect
(
c
,
m
,
CATEGORY_POSITION
+
CATEGORY_CONTROL
,
cm
.
tg
,
cm
.
op
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCondition
(
rkj
.
HandSpCondition1
)
e2
:
SetCost
(
cm
.
cost
)
e2
:
SetTarget
(
cm
.
target
)
e2
:
SetOperation
(
cm
.
operation
)
c
:
RegisterEffect
(
e2
)
local
e2_1
=
e2
:
Clone
()
e2_1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2_1
:
SetCode
(
EVENT_FREE_CHAIN
)
e2_1
:
SetCondition
(
rkj
.
HandSpCondition2
)
c
:
RegisterEffect
(
e2_1
)
end
function
cm
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsCanChangePosition
()
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsControlerCanBeChanged
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_POSITION
,
e
:
GetHandler
(),
1
,
tp
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_CONTROL
,
nil
,
0
,
tp
,
0
)
end
function
cm
.
op
(
e
,
tp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
if
Duel
.
ChangePosition
(
c
,
POS_FACEDOWN_ATTACK
)
~=
0
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsControlerCanBeChanged
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsControlerCanBeChanged
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
)
local
tc
=
g
:
GetFirst
()
if
tc
:
IsPosition
(
POS_FACEUP
)
then
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
else
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEDOWN
,
true
)
end
end
end
function
cm
.
rlfilter
(
c
,
e
,
tp
)
return
c
:
IsReleasable
()
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter
,
tp
,
LOCATION_SZONE
,
LOCATION_SZONE
,
1
,
c
,
e
,
tp
)
end
function
cm
.
spfilter
(
c
,
e
,
tp
)
return
c
:
GetOriginalType
()
&
TYPE_MONSTER
~=
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
(
c
:
IsFaceup
()
or
c
:
IsControler
(
tp
))
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
rlfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
,
e
,
tp
)
and
e
:
GetHandler
():
GetFlagEffect
(
m
)
==
0
end
e
:
GetHandler
():
RegisterFlagEffect
(
m
,
RESET_PHASE
+
PHASE_END
+
RESET_EVENT
+
RESETS_STANDARD
,
0
,
1
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
rlfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
Release
(
g
,
REASON_COST
)
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter
,
tp
,
LOCATION_SZONE
,
LOCATION_SZONE
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_SZONE
)
end
function
cm
.
operation
(
e
,
tp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<
1
then
return
false
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter
,
tp
,
LOCATION_SZONE
,
LOCATION_SZONE
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
g
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
\ No newline at end of file
expansions/script/c16150026.lua
0 → 100644
View file @
f5173df4
--斩击的大王兽
xpcall
(
function
()
require
(
"expansions/script/c16150025"
)
end
,
function
()
require
(
"script/c16150025"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150026
,
"DAIOUJYUU"
)
function
cm
.
initial_effect
(
c
)
local
e0
,
e1
=
rkj
.
HandSp
(
c
,
m
)
local
e4
,
e5
=
rkj
.
STzoneEffect
(
c
,
m
,
CATEGORY_ATKCHANGE
+
CATEGORY_DEFCHANGE
,
cm
.
tg
,
cm
.
op
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e2
:
SetCategory
(
CATEGORY_ATKCHANGE
+
CATEGORY_DEFCHANGE
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCondition
(
rkj
.
HandSpCondition1
)
e2
:
SetCost
(
cm
.
cost
)
e2
:
SetTarget
(
cm
.
target
)
e2
:
SetOperation
(
cm
.
operation
)
c
:
RegisterEffect
(
e2
)
local
e2_1
=
e2
:
Clone
()
e2_1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2_1
:
SetCode
(
EVENT_FREE_CHAIN
)
e2_1
:
SetCondition
(
rkj
.
HandSpCondition2
)
c
:
RegisterEffect
(
e2_1
)
end
function
cm
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_ATKCHANGE
,
nil
,
0
,
tp
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DEFCHANGE
,
nil
,
0
,
tp
,
0
)
end
function
cm
.
op
(
e
,
tp
)
local
og
=
e
:
GetLabelObject
()
local
sg
=
og
:
Filter
(
Card
.
IsType
,
nil
,
TYPE_MONSTER
)
local
rg
=
Duel
.
GetMatchingGroup
(
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
atk
=
sg
:
GetSum
(
Card
.
GetAttack
)
local
def
=
sg
:
GetSum
(
Card
.
GetDefense
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
for
tc
in
aux
.
Next
(
rg
)
do
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetValue
(
atk
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
e2
:
SetValue
(
def
)
tc
:
RegisterEffect
(
e2
)
end
end
function
cm
.
rlfilter
(
c
)
return
c
:
IsReleasable
()
end
function
cm
.
spfilter
(
c
)
return
(
c
:
IsAttackAbove
(
0
)
or
c
:
IsDefenseAbove
(
0
))
and
(
c
:
IsFaceup
()
or
c
:
IsLocation
(
LOCATION_GRAVE
))
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
rlfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
e
:
GetHandler
())
and
e
:
GetHandler
():
GetFlagEffect
(
m
)
==
0
end
e
:
GetHandler
():
RegisterFlagEffect
(
m
,
RESET_PHASE
+
PHASE_END
+
RESET_EVENT
+
RESETS_STANDARD
,
0
,
1
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
rlfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
e
:
GetHandler
())
Duel
.
Release
(
g
,
REASON_COST
)
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter
,
tp
,
LOCATION_MZONE
+
LOCATION_REMOVED
+
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_ATKCHANGE
,
nil
,
0
,
tp
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DEFCHANGE
,
nil
,
0
,
tp
,
0
)
end
function
cm
.
operation
(
e
,
tp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
false
end
local
g
=
Duel
.
GetMatchingGroup
(
aux
.
NecroValleyFilter
(
cm
.
spfilter
),
tp
,
LOCATION_MZONE
+
LOCATION_REMOVED
+
LOCATION_GRAVE
,
0
,
c
)
local
atk
=
g
:
GetSum
(
Card
.
GetAttack
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetValue
(
atk
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_DISABLE
)
c
:
RegisterEffect
(
e1
)
end
expansions/script/c16150027.lua
0 → 100644
View file @
f5173df4
--汲魂的大王兽
xpcall
(
function
()
require
(
"expansions/script/c16150025"
)
end
,
function
()
require
(
"script/c16150025"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150027
,
"DAIOUJYUU"
)
function
cm
.
initial_effect
(
c
)
local
e0
,
e1
=
rkj
.
HandSp
(
c
,
m
)
local
e4
,
e5
=
rkj
.
STzoneEffect
(
c
,
m
,
CATEGORY_RECOVER
,
cm
.
tg
,
cm
.
op
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e2
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_RECOVER
+
CATEGORY_ATKCHANGE
+
CATEGORY_DEFCHANGE
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCondition
(
rkj
.
HandSpCondition1
)
e2
:
SetCost
(
cm
.
cost
)
e2
:
SetTarget
(
cm
.
target
)
e2
:
SetOperation
(
cm
.
operation
)
c
:
RegisterEffect
(
e2
)
local
e2_1
=
e2
:
Clone
()
e2_1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2_1
:
SetCode
(
EVENT_FREE_CHAIN
)
e2_1
:
SetCondition
(
rkj
.
HandSpCondition2
)
c
:
RegisterEffect
(
e2_1
)
end
function
cm
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_RECOVER
,
nil
,
0
,
tp
,
0
)
end
function
cm
.
op
(
e
,
tp
)
local
og
=
e
:
GetLabelObject
()
local
sg
=
og
:
Filter
(
Card
.
IsType
,
nil
,
TYPE_MONSTER
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
if
sg
and
sg
:
GetCount
()
>
0
then
Duel
.
Recover
(
tp
,
sg
:
GetCount
()
*
1000
,
REASON_EFFECT
)
end
end
function
cm
.
rlfilter
(
c
)
return
c
:
IsReleasable
()
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter
,
tp
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
1
,
c
)
end
function
cm
.
spfilter
(
c
)
return
c
:
IsAbleToRemove
()
and
(
c
:
IsAttackAbove
(
0
)
or
c
:
IsDefenseAbove
(
0
))
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
rlfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
GetFlagEffect
(
m
)
==
0
end
e
:
GetHandler
():
RegisterFlagEffect
(
m
,
RESET_PHASE
+
PHASE_END
+
RESET_EVENT
+
RESETS_STANDARD
,
0
,
1
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
rlfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
Duel
.
Release
(
g
,
REASON_COST
)
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
1
-
tp
)
and
chkc
:
IsControlerCanBeChanged
()
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter
,
tp
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
1
,
c
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_MZONE
+
LOCATION_GRAVE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_ATKCHANGE
,
nil
,
0
,
tp
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DEFCHANGE
,
nil
,
0
,
tp
,
0
)
end
function
cm
.
operation
(
e
,
tp
)
local
c
=
e
:
GetHandler
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
cm
.
spfilter
),
tp
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
g
)
local
tc
=
g
:
GetFirst
()
if
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
~=
0
then
Duel
.
BreakEffect
()
local
atk
=
tc
:
GetAttack
()
local
def
=
tc
:
GetDefense
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetValue
(
atk
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_DISABLE
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
e2
:
SetValue
(
def
)
c
:
RegisterEffect
(
e2
)
Duel
.
Recover
(
tp
,
atk
+
def
,
REASON_EFFECT
)
end
end
end
expansions/script/c16150028.lua
0 → 100644
View file @
f5173df4
--幻想的大王兽
xpcall
(
function
()
require
(
"expansions/script/c16150025"
)
end
,
function
()
require
(
"script/c16150025"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150028
,
"DAIOUJYUU"
)
function
cm
.
initial_effect
(
c
)
local
e0
,
e1
=
rkj
.
HandSp
(
c
,
m
)
local
e4
,
e5
=
rkj
.
STzoneEffect
(
c
,
m
,
CATEGORY_CONTROL
,
cm
.
tg
,
cm
.
op
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e2
:
SetCategory
(
CATEGORY_CONTROL
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetCondition
(
rkj
.
HandSpCondition1
)
e2
:
SetCost
(
cm
.
cost
)
e2
:
SetTarget
(
cm
.
target
)
e2
:
SetOperation
(
cm
.
operation
)
c
:
RegisterEffect
(
e2
)
local
e2_1
=
e2
:
Clone
()
e2_1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2_1
:
SetCode
(
EVENT_FREE_CHAIN
)
e2_1
:
SetCondition
(
rkj
.
HandSpCondition2
)
c
:
RegisterEffect
(
e2_1
)
end
function
cm
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsControlerCanBeChanged
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_CONTROL
,
nil
,
0
,
tp
,
0
)
end
function
cm
.
op
(
e
,
tp
)
local
og
=
e
:
GetLabelObject
()
local
sg
=
og
:
Filter
(
Card
.
IsType
,
nil
,
TYPE_MONSTER
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
if
sg
and
sg
:
GetCount
()
>
0
then
local
ct
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
if
ct
>
sg
:
GetCount
()
then
ct
=
sg
:
GetCount
()
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CONTROL
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsControlerCanBeChanged
,
tp
,
0
,
LOCATION_MZONE
,
1
,
ct
,
nil
)
Duel
.
HintSelection
(
g
)
Duel
.
GetControl
(
g
,
tp
,
RESET_PHASE
+
PHASE_END
)
end
end
function
cm
.
rlfilter
(
c
,
e
,
tp
)
return
c
:
IsReleasable
()
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter
,
tp
,
LOCATION_SZONE
,
LOCATION_SZONE
,
1
,
c
,
e
,
tp
)
end
function
cm
.
spfilter
(
c
,
e
,
tp
)
return
c
:
GetOriginalType
()
&
TYPE_MONSTER
~=
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
(
c
:
IsFaceup
()
or
c
:
IsControler
(
tp
))
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsReleasable
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
e
:
GetHandler
():
GetFlagEffect
(
m
)
==
0
end
e
:
GetHandler
():
RegisterFlagEffect
(
m
,
RESET_PHASE
+
PHASE_END
+
RESET_EVENT
+
RESETS_STANDARD
,
0
,
1
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsReleasable
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
Duel
.
Release
(
g
,
REASON_COST
)
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsControlerCanBeChanged
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CONTROL
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsControlerCanBeChanged
,
tp
,
0
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_CONTROL
,
g
,
1
,
tp
,
0
)
end
function
cm
.
operation
(
e
,
tp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
GetControl
(
tc
,
tp
)
end
end
expansions/script/c16150030.lua
0 → 100644
View file @
f5173df4
--王命的传达者
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150030
,
"OUMEI"
)
function
cm
.
initial_effect
(
c
)
--destroy
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCost
(
cm
.
actcost
)
e1
:
SetTarget
(
cm
.
acttg
)
e1
:
SetOperation
(
cm
.
actop
)
c
:
RegisterEffect
(
e1
)
--Equip
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e2
:
SetCategory
(
CATEGORY_EQUIP
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_TO_GRAVE
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
1
,
m
)
e2
:
SetTarget
(
cm
.
target
)
e2
:
SetOperation
(
cm
.
operation
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
actcost
(
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
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
end
function
cm
.
actcheck
(
c
,
tp
)
return
c
:
IsCode
(
m
+
1
)
and
c
:
GetActivateEffect
():
IsActivatable
(
tp
)
end
function
cm
.
acttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
g
=
Duel
.
GetMatchingGroup
(
cm
.
actcheck
,
tp
,
LOCATION_DECK
,
0
,
nil
,
tp
)
if
chk
==
0
then
return
g
:
GetCount
()
>
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
end
end
function
cm
.
actop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
actcheck
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
tp
)
if
g
:
GetCount
()
>
0
then
local
tc
=
g
:
GetFirst
()
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
local
te
=
tc
:
GetActivateEffect
()
local
tep
=
tc
:
GetControler
()
local
cost
=
te
:
GetCost
()
if
cost
then
cost
(
te
,
tep
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
1
)
end
end
end
function
cm
.
eqcheck
(
c
,
tp
)
return
not
c
:
IsForbidden
()
and
c
:
CheckUniqueOnField
(
tp
)
and
rk
.
check
(
c
,
"OUMEI"
)
and
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
eqcheck
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
tp
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
operation
(
e
,
tp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
==
0
then
return
false
end
if
not
Duel
.
IsExistingMatchingCard
(
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
then
return
false
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
eqcheck
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
tp
)
if
sg
:
GetCount
()
>
0
then
local
rc
=
sg
:
GetFirst
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
aux
.
Stringid
(
m
,
3
))
local
rg
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
if
rg
:
GetCount
()
>
0
then
local
tc
=
rg
:
GetFirst
()
Duel
.
HintSelection
(
rg
)
if
rc
:
IsType
(
TYPE_SPELL
)
and
not
rc
:
IsType
(
TYPE_EQUIP
)
then
Duel
.
MoveToField
(
rc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
local
record_type
=
rc
:
GetOriginalType
()
rc
:
SetCardData
(
CARDDATA_TYPE
,
record_type
|
TYPE_EQUIP
)
rc
:
RegisterFlagEffect
(
m
,
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TOFIELD
,
0
,
1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_MOVE
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e2
:
SetLabel
(
record_type
)
e2
:
SetOperation
(
cm
.
rstop
)
rc
:
RegisterEffect
(
e2
)
end
if
not
Duel
.
Equip
(
tp
,
rc
,
tc
)
then
return
end
--equip limit
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetLabelObject
(
tc
)
e1
:
SetValue
(
cm
.
eqlimit
)
rc
:
RegisterEffect
(
e1
)
end
end
end
function
cm
.
eqlimit
(
e
,
c
)
return
c
==
e
:
GetLabelObject
()
end
\ No newline at end of file
expansions/script/c16150031.lua
0 → 100644
View file @
f5173df4
--王命的引导
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150031
,
"OUMEI"
)
function
cm
.
initial_effect
(
c
)
c
:
SetUniqueOnField
(
1
,
0
,
m
)
--Activate
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e0
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e0
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_EQUIP
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
operation
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e2
)
end
function
cm
.
eqcheck
(
c
,
tp
,
ec
)
return
not
c
:
IsForbidden
()
and
c
:
CheckUniqueOnField
(
tp
)
and
rk
.
check
(
c
,
"DAIOU"
)
and
c
:
IsLevel
(
ec
:
GetLevel
()
*
2
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
cm
.
tgfilter
(
c
,
tp
,
eg
)
return
eg
:
IsContains
(
c
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
eqcheck
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
tp
,
c
)
and
c
:
IsLevelAbove
(
1
)
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
c
=
e
:
GetHandler
()
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
cm
.
tgfilter
(
chkc
,
tp
,
eg
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
tgfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
tp
,
eg
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
c
:
GetFlagEffect
(
m
)
==
0
end
if
eg
:
GetCount
()
==
1
then
Duel
.
SetTargetCard
(
eg
)
else
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
Duel
.
SelectTarget
(
tp
,
cm
.
tgfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
tp
,
eg
)
end
e
:
GetHandler
():
RegisterFlagEffect
(
m
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
,
EFFECT_FLAG_OATH
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
operation
(
e
,
tp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
==
0
then
return
false
end
if
not
tc
:
IsRelateToEffect
(
e
)
or
not
tc
:
IsFaceup
()
then
return
false
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
eqcheck
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
tp
,
tc
)
if
sg
:
GetCount
()
>
0
then
local
rc
=
sg
:
GetFirst
()
if
not
Duel
.
Equip
(
tp
,
rc
,
tc
)
then
return
end
--equip limit
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetLabelObject
(
tc
)
e1
:
SetValue
(
cm
.
eqlimit
)
rc
:
RegisterEffect
(
e1
)
end
end
function
cm
.
eqlimit
(
e
,
c
)
return
c
==
e
:
GetLabelObject
()
end
\ No newline at end of file
expansions/script/c16150032.lua
0 → 100644
View file @
f5173df4
--大王兽 奇美拉
xpcall
(
function
()
require
(
"expansions/script/c16150025"
)
end
,
function
()
require
(
"script/c16150025"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150032
,
"DAIOUJYUU"
)
function
cm
.
initial_effect
(
c
)
--fusion material
c
:
EnableReviveLimit
()
aux
.
AddFusionProcFunRep
(
c
,
function
(
c
)
return
rk
.
check
(
c
,
"DAIOUJYUU"
)
end
,
3
,
true
)
--special summon rule
local
e_1
=
Effect
.
CreateEffect
(
c
)
e_1
:
SetDescription
(
aux
.
Stringid
(
m
,
5
))
e_1
:
SetType
(
EFFECT_TYPE_FIELD
)
e_1
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e_1
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e_1
:
SetRange
(
LOCATION_EXTRA
)
e_1
:
SetCountLimit
(
1
,
m
)
e_1
:
SetCondition
(
cm
.
spcon
)
e_1
:
SetOperation
(
cm
.
spop2
)
c
:
RegisterEffect
(
e_1
)
--SpecialSummon
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e0
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e0
:
SetType
(
EFFECT_TYPE_IGNITION
)
e0
:
SetRange
(
LOCATION_SZONE
+
LOCATION_GRAVE
)
e0
:
SetCountLimit
(
1
,
m
*
10
)
e0
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e0
:
SetCondition
(
rkj
.
HandSpCondition1
)
e0
:
SetTarget
(
cm
.
ExtraSpTarget
)
e0
:
SetOperation
(
cm
.
ExtraSpOperation
)
c
:
RegisterEffect
(
e0
)
local
e1
=
e0
:
Clone
()
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCondition
(
rkj
.
HandSpCondition2
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetCondition
(
cm
.
checkcon
)
e2
:
SetTarget
(
cm
.
target
)
e2
:
SetOperation
(
cm
.
operation
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetCountLimit
(
1
,
m
+
100
)
c
:
RegisterEffect
(
e3
)
end
function
cm
.
spfilter
(
c
,
fc
,
tp
)
return
c
:
check
(
"DAIOU"
)
and
c
:
IsFaceup
()
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
c
,
fc
)
>
0
and
c
:
IsCanBeFusionMaterial
(
fc
,
SUMMON_TYPE_SPECIAL
)
end
function
cm
.
spcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
,
c
,
tp
)
end
function
cm
.
spop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
c
,
tp
)
c
:
SetMaterial
(
g
)
local
tc
=
g
:
GetFirst
()
if
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
then
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_SPELL
+
TYPE_CONTINUOUS
)
tc
:
RegisterEffect
(
e1
)
end
c
:
CompleteProcedure
()
end
function
cm
.
ExtraSpCost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
ConfirmCards
(
1
-
tp
,
e
:
GetHandler
())
end
function
cm
.
targetcheck
(
c
)
return
rk
.
check
(
c
,
"DAIOU"
)
and
(
c
:
IsFaceup
()
or
c
:
IsLocation
(
LOCATION_GRAVE
))
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
cm
.
ExtraSpTarget
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
chkc
:
IsControler
(
tp
)
and
chkc
:
IsLocation
(
LOCATION_MZONE
+
LOCATION_GRAVE
)
and
chkc
~=
e
:
GetHandler
()
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
targetcheck
,
tp
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
0
,
1
,
e
:
GetHandler
())
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
local
g
=
Duel
.
SelectTarget
(
tp
,
cm
.
targetcheck
,
tp
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
0
,
1
,
1
,
e
:
GetHandler
())
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
cm
.
ExtraSpOperation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
not
c
:
IsRelateToEffect
(
e
)
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
==
0
or
not
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
then
return
false
end
if
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
~=
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
tc
:
IsRelateToEffect
(
e
)
then
if
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
then
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_SPELL
+
TYPE_CONTINUOUS
)
tc
:
RegisterEffect
(
e1
)
end
end
end
function
cm
.
checkcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
re
:
GetHandler
():
IsLocation
(
LOCATION_SZONE
)
and
re
:
GetHandler
():
IsRelateToEffect
(
re
)
and
re
:
GetHandler
():
GetOriginalType
()
&
TYPE_MONSTER
~=
0
and
re
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
c
:
GetFlagEffect
(
m
)
==
0
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
end
e
:
GetHandler
():
RegisterFlagEffect
(
m
,
RESET_PHASE
+
PHASE_END
+
RESET_EVENT
+
RESETS_STANDARD
,
0
,
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
re
:
GetHandler
(),
1
,
tp
,
0
)
end
function
cm
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsLocation
(
LOCATION_SZONE
)
and
not
c
:
IsRelateToEffect
(
e
)
then
return
end
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
re
:
GetHandler
():
IsLocation
(
LOCATION_SZONE
)
and
re
:
GetHandler
():
IsRelateToEffect
(
re
)
then
re
:
GetHandler
():
RegisterFlagEffect
(
m
,
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TURN_SET
+
RESET_CHAIN
,
0
,
0
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EVENT_CHAIN_SOLVED
)
e1
:
SetLabelObject
(
re
)
e1
:
SetCondition
(
cm
.
checkspcon
)
e1
:
SetOperation
(
cm
.
spop
)
e1
:
SetReset
(
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
function
cm
.
checkspcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
==
e
:
GetLabelObject
()
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
re
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
re
:
GetHandler
():
GetFlagEffect
(
m
)
>
0
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
SpecialSummon
(
re
:
GetHandler
(),
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
\ No newline at end of file
expansions/script/c16150033.lua
0 → 100644
View file @
f5173df4
--天命结合
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150033
,
"OUMEI"
)
function
cm
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_FUSION_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetTarget
(
cm
.
sptg
)
e1
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e1
)
local
e1_1
=
e1
:
Clone
()
e1_1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1_1
:
SetRange
(
LOCATION_SZONE
)
e1_1
:
SetCountLimit
(
1
,
m
)
e1_1
:
SetCondition
(
cm
.
con
)
c
:
RegisterEffect
(
e1_1
)
local
e1_2
=
e1
:
Clone
()
e1_2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1_2
:
SetRange
(
LOCATION_SZONE
)
e1_2
:
SetCode
(
EVENT_FREE_CHAIN
)
e1_2
:
SetCountLimit
(
1
,
m
)
e1_2
:
SetCondition
(
cm
.
con1
)
c
:
RegisterEffect
(
e1_2
)
--salvage
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_EQUIP
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
m
+
1
)
e2
:
SetCondition
(
cm
.
con2
)
e2
:
SetCost
(
cm
.
thcost
)
e2
:
SetTarget
(
cm
.
thtg
)
e2
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e2
)
local
e2_1
=
e2
:
Clone
()
e2_1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2_1
:
SetRange
(
LOCATION_GRAVE
)
e2_1
:
SetCode
(
EVENT_FREE_CHAIN
)
e2_1
:
SetCountLimit
(
1
,
m
+
1
)
e2_1
:
SetCondition
(
cm
.
con3
)
c
:
RegisterEffect
(
e2_1
)
end
function
cm
.
con
(
e
,
tp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
16150008
)
and
e
:
GetHandler
():
GetEquipTarget
()
~=
nil
end
function
cm
.
con1
(
e
,
tp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
16150008
)
and
e
:
GetHandler
():
GetEquipTarget
()
~=
nil
end
function
cm
.
filter1
(
c
,
e
)
return
not
c
:
IsImmuneToEffect
(
e
)
end
function
cm
.
mfilter1
(
c
)
return
c
:
IsCanBeFusionMaterial
()
and
c
:
IsAbleToGrave
()
and
rk
.
check
(
c
,
"DAIOU"
)
end
function
cm
.
mfilter_im
(
c
,
e
)
return
not
c
:
IsImmuneToEffect
(
e
)
end
function
cm
.
spfilter1
(
c
,
e
,
tp
,
m
,
f
,
chkf
)
return
c
:
IsType
(
TYPE_FUSION
)
and
(
rk
.
check
(
c
,
"DAIOU"
)
or
rk
.
check
(
c
,
"OUMEI"
)
or
c
:
IsSetCard
(
0xccd
))
and
(
not
f
or
f
(
c
))
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_FUSION
,
tp
,
false
,
false
)
and
c
:
CheckFusionMaterial
(
m
,
nil
,
chkf
)
end
function
cm
.
fcheck
(
tp
,
sg
,
fc
)
return
sg
:
FilterCount
(
Card
.
IsLocation
,
nil
,
LOCATION_EXTRA
)
<=
1
end
function
cm
.
gcheck
(
sg
)
return
sg
:
FilterCount
(
Card
.
IsLocation
,
nil
,
LOCATION_EXTRA
)
<=
1
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
local
chkf
=
tp
local
mg
=
Duel
.
GetFusionMaterial
(
tp
):
Filter
(
Card
.
IsReleasable
,
nil
)
if
c
:
GetEquipTarget
()
~=
nil
then
local
mg1
=
Duel
.
GetMatchingGroup
(
cm
.
mfilter1
,
tp
,
LOCATION_EXTRA
,
0
,
nil
)
mg
:
Merge
(
mg1
)
end
Auxiliary
.
FCheckAdditional
=
cm
.
fcheck
Auxiliary
.
GCheckAdditional
=
cm
.
gcheck
local
res
=
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter1
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
mg
,
nil
,
chkf
)
Auxiliary
.
FCheckAdditional
=
nil
Auxiliary
.
GCheckAdditional
=
nil
if
res
then
return
true
end
if
not
res
then
local
ce
=
Duel
.
GetChainMaterial
(
tp
)
if
ce
~=
nil
then
local
fgroup
=
ce
:
GetTarget
()
local
mg4
=
fgroup
(
ce
,
e
,
tp
)
local
mf
=
ce
:
GetValue
()
res
=
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter1
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
mg4
,
mf
,
chkf
)
end
end
return
res
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_RELEASE
,
nil
,
1
,
0
,
LOCATION_MZONE
+
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
0
,
LOCATION_EXTRA
)
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
chkf
=
tp
local
mg
=
Duel
.
GetFusionMaterial
(
tp
):
Filter
(
Card
.
IsReleasable
,
nil
):
Filter
(
cm
.
filter1
,
nil
,
e
)
if
c
:
GetEquipTarget
()
~=
nil
then
local
mg1
=
Duel
.
GetMatchingGroup
(
cm
.
mfilter1
,
tp
,
LOCATION_EXTRA
,
0
,
nil
)
mg
:
Merge
(
mg1
)
end
Auxiliary
.
FCheckAdditional
=
cm
.
fcheck
Auxiliary
.
GCheckAdditional
=
cm
.
gcheck
local
mg3
=
Group
.
FromCards
()
local
sg3
=
nil
local
sg1
=
Duel
.
GetMatchingGroup
(
cm
.
spfilter1
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
e
,
tp
,
mg
,
nil
,
chkf
)
local
mg2
=
nil
local
sg2
=
nil
local
ce
=
Duel
.
GetChainMaterial
(
tp
)
if
ce
~=
nil
then
local
fgroup
=
ce
:
GetTarget
()
mg2
=
fgroup
(
ce
,
e
,
tp
)
local
mf
=
ce
:
GetValue
()
sg2
=
Duel
.
GetMatchingGroup
(
cm
.
spfilter1
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
e
,
tp
,
mg2
,
mf
,
chkf
)
end
sg3
=
Duel
.
GetMatchingGroup
(
cm
.
spfilter1
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
e
,
tp
,
mg3
,
nil
,
chkf
)
sg1
:
Merge
(
sg3
)
Auxiliary
.
FCheckAdditional
=
nil
Auxiliary
.
GCheckAdditional
=
nil
if
sg1
:
GetCount
()
>
0
or
(
sg2
~=
nil
and
sg2
:
GetCount
()
>
0
)
then
local
sg
=
sg1
:
Clone
()
if
sg2
then
sg
:
Merge
(
sg2
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
tg
=
sg
:
Select
(
tp
,
1
,
1
,
nil
)
local
tc
=
tg
:
GetFirst
()
if
sg1
:
IsContains
(
tc
)
and
(
sg2
==
nil
or
not
sg2
:
IsContains
(
tc
)
or
not
Duel
.
SelectYesNo
(
tp
,
ce
:
GetDescription
()))
then
Auxiliary
.
FCheckAdditional
=
cm
.
fcheck
Auxiliary
.
GCheckAdditional
=
cm
.
gcheck
local
mat1
=
Duel
.
SelectFusionMaterial
(
tp
,
tc
,
mg
,
nil
,
chkf
)
Auxiliary
.
FCheckAdditional
=
nil
Auxiliary
.
GCheckAdditional
=
nil
tc
:
SetMaterial
(
mat1
)
local
subg
=
mat1
:
Filter
(
Card
.
IsLocation
,
nil
,
LOCATION_EXTRA
)
mat1
:
Sub
(
subg
)
Duel
.
SendtoGrave
(
subg
,
REASON_EFFECT
+
REASON_MATERIAL
+
REASON_FUSION
)
Duel
.
Release
(
mat1
,
REASON_EFFECT
+
REASON_MATERIAL
+
REASON_FUSION
)
Duel
.
BreakEffect
()
Duel
.
SpecialSummon
(
tc
,
SUMMON_TYPE_FUSION
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
else
local
mat2
=
Duel
.
SelectFusionMaterial
(
tp
,
tc
,
mg2
,
nil
,
chkf
)
local
fop
=
ce
:
GetOperation
()
fop
(
ce
,
e
,
tp
,
tc
,
mat2
)
end
tc
:
CompleteProcedure
()
end
aux
.
FCheckAdditional
=
nil
end
function
cm
.
con2
(
e
,
tp
)
return
not
Duel
.
IsPlayerAffectedByEffect
(
tp
,
16150008
)
end
function
cm
.
con3
(
e
,
tp
)
return
Duel
.
IsPlayerAffectedByEffect
(
tp
,
16150008
)
end
function
cm
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
c
:
IsAbleToRemoveAsCost
()
end
Duel
.
Remove
(
c
,
POS_FACEUP
,
REASON_COST
)
end
function
cm
.
eqfilter
(
c
)
return
rk
.
check
(
c
,
"DAIOUGU"
)
and
c
:
CheckUniqueOnField
(
tp
)
and
not
c
:
IsForbidden
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
eqfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
tp
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
,
0
)
>
0
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_EQUIP
,
nil
,
1
,
0
,
0
)
end
function
cm
.
checkeq
(
c
,
e
)
return
c
:
IsFaceup
()
and
not
c
:
IsImmuneToEffect
(
e
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
==
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
aux
.
Stringid
(
m
,
2
))
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
checkeq
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
,
e
)
if
sg
:
GetCount
()
==
0
then
return
end
local
rc
=
sg
:
GetFirst
()
Duel
.
HintSelection
(
sg
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
aux
.
Stringid
(
m
,
3
))
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
eqfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
tp
)
if
g
:
GetCount
()
>
0
then
local
tc
=
g
:
GetFirst
()
if
not
Duel
.
Equip
(
tp
,
tc
,
rc
)
then
return
end
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetLabelObject
(
rc
)
e1
:
SetValue
(
cm
.
eqlimit
)
tc
:
RegisterEffect
(
e1
)
end
end
function
cm
.
eqlimit
(
e
,
c
)
return
c
==
e
:
GetLabelObject
()
end
\ No newline at end of file
expansions/script/c16150035.lua
0 → 100644
View file @
f5173df4
--天命结合
xpcall
(
function
()
require
(
"expansions/script/c16199990"
)
end
,
function
()
require
(
"script/c16199990"
)
end
)
local
m
,
cm
=
rk
.
set
(
16150035
,
"OUMEI"
)
function
cm
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetTarget
(
cm
.
sptg
)
e1
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
spfilter1
(
c
,
tp
)
return
rk
.
check
(
c
,
"DAIOUJYUU"
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsForbidden
()
and
c
:
CheckUniqueOnField
(
tp
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
tp
)
end
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
tp
)
if
g
:
GetCount
()
>
0
then
local
tc
=
g
:
GetFirst
()
if
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_SZONE
,
POS_FACEUP
,
true
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CHANGE_TYPE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
end
end
end
\ No newline at end of file
expansions/script/c18700046.lua
0 → 100644
View file @
f5173df4
--血罪灵骸·天魔髓
local
m
=
18700046
local
cm
=
_G
[
"c"
..
m
]
xpcall
(
function
()
require
(
"expansions/script/1"
)
end
,
function
()
require
(
"script/1"
)
end
)
function
cm
.
initial_effect
(
c
)
c
:
EnableCounterPermit
(
0x1820
)
aux
.
EnablePendulumAttribute
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_PZONE
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetCost
(
cm
.
spcost
)
e1
:
SetTarget
(
cm
.
pctg
)
e1
:
SetOperation
(
cm
.
pcop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_COUNTER
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetRange
(
LOCATION_PZONE
)
e2
:
SetOperation
(
cm
.
regop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e3
:
SetCategory
(
CATEGORY_REMOVE
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_PZONE
)
e3
:
SetCountLimit
(
1
,
m
+
1
)
e3
:
SetCost
(
cm
.
tkcost
)
e3
:
SetTarget
(
cm
.
tktg
)
e3
:
SetOperation
(
cm
.
tkop
)
c
:
RegisterEffect
(
e3
)
local
e4
=
e3
:
Clone
()
e4
:
SetCode
(
EVENT_CHAINING
)
e4
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e4
:
SetCondition
(
cm
.
rmcon
)
c
:
RegisterEffect
(
e4
)
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e5
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e5
:
SetType
(
EFFECT_TYPE_IGNITION
)
e5
:
SetRange
(
LOCATION_HAND
)
e5
:
SetCountLimit
(
1
,
m
+
2
)
e5
:
SetCondition
(
cm
.
spcon2
)
e5
:
SetTarget
(
cm
.
sptg
)
e5
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e5
)
local
e7
=
Effect
.
CreateEffect
(
c
)
e7
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e7
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e7
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e7
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e7
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e7
:
SetCountLimit
(
1
,
m
+
3
)
e7
:
SetTarget
(
cm
.
thtg
)
e7
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e7
)
local
e8
=
e7
:
Clone
()
e8
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e8
)
local
e9
=
Effect
.
CreateEffect
(
c
)
e9
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e9
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e9
:
SetCode
(
EVENT_REMOVE
)
e9
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e9
:
SetCountLimit
(
1
,
m
+
4
)
e9
:
SetTarget
(
cm
.
sptg2
)
e9
:
SetOperation
(
cm
.
spop2
)
c
:
RegisterEffect
(
e9
)
local
e10
=
Effect
.
CreateEffect
(
c
)
e10
:
SetType
(
EFFECT_TYPE_EQUIP
)
e10
:
SetCode
(
EFFECT_SET_CONTROL
)
e10
:
SetValue
(
cm
.
ctval
)
c
:
RegisterEffect
(
e10
)
local
e11
=
Effect
.
CreateEffect
(
c
)
e11
:
SetType
(
EFFECT_TYPE_EQUIP
)
e11
:
SetCode
(
EFFECT_INDESTRUCTABLE_BATTLE
)
e11
:
SetValue
(
1
)
c
:
RegisterEffect
(
e11
)
end
function
cm
.
costfilter
(
c
)
return
c
:
IsAbleToRemoveAsCost
()
end
function
cm
.
spcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
costfilter
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
costfilter
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
end
function
cm
.
pcfilter
(
c
,
tp
)
return
not
c
:
IsCode
(
m
)
and
c
:
IsSetCard
(
0x821
)
and
c
:
IsType
(
TYPE_PENDULUM
)
and
not
c
:
IsForbidden
()
and
c
:
CheckUniqueOnField
(
tp
,
LOCATION_SZONE
)
end
function
cm
.
pctg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
(
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
or
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
))
and
Duel
.
IsExistingMatchingCard
(
cm
.
pcfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
tp
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
cm
.
pcop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
and
not
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
)
then
return
end
local
c
=
e
:
GetHandler
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
pcfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
tp
)
if
#
g
==
0
or
not
Duel
.
MoveToField
(
g
:
GetFirst
(),
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
then
return
end
if
not
c
:
IsRelateToEffect
(
e
)
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
BreakEffect
()
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
function
cm
.
regop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
e
:
GetHandler
():
AddCounter
(
0x1820
,
1
)
end
function
cm
.
tkcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsCanRemoveCounter
(
tp
,
1
,
0
,
0x1820
,
2
,
REASON_COST
)
end
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x1820
,
2
,
REASON_COST
)
end
function
cm
.
rmcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
rp
==
1
-
tp
and
(
re
:
IsActiveType
(
TYPE_MONSTER
)
or
re
:
IsActiveType
(
TYPE_TRAP
)
or
re
:
IsActiveType
(
TYPE_SPELL
))
end
function
cm
.
filter
(
c
)
return
c
:
IsType
(
TYPE_TRAP
+
TYPE_SPELL
)
and
c
:
IsSetCard
(
0x821
)
and
c
:
IsAbleToRemove
()
end
function
cm
.
tktg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
filter4
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
tkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
function
cm
.
cfilter2
(
c
)
return
c
:
IsSetCard
(
0x821
)
and
c
:
IsFaceup
()
end
function
cm
.
spcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
cm
.
cfilter2
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP_DEFENSE
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
cm
.
thfilter2
(
c
)
return
c
:
IsSetCard
(
0x821
)
and
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c
:
IsAbleToHand
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter2
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
function
cm
.
eqfilter2
(
c
,
tp
)
if
c
:
IsFacedown
()
then
return
false
end
if
c
:
IsType
(
TYPE_TRAPMONSTER
)
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
,
tp
,
LOCATION_REASON_CONTROL
)
>
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
,
tp
,
0
)
>=
2
end
return
true
end
function
cm
.
sptg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
cm
.
eqfilter2
(
chkc
,
tp
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
IsExistingTarget
(
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
SelectTarget
(
tp
,
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
,
tp
)
end
function
cm
.
eqlimit2
(
e
,
c
)
return
c
==
e
:
GetLabelObject
()
end
function
cm
.
spop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
then
return
end
local
tc
=
Duel
.
GetFirstTarget
()
if
c
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
and
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
Equip
(
tp
,
c
,
tc
)
--Add Equip limit
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetValue
(
cm
.
eqlimit2
)
e1
:
SetLabelObject
(
tc
)
c
:
RegisterEffect
(
e1
)
end
end
function
cm
.
ctval
(
e
,
c
)
return
e
:
GetHandlerPlayer
()
end
\ No newline at end of file
expansions/script/c18700051.lua
0 → 100644
View file @
f5173df4
--血罪灵骸·謬罪骷
local
m
=
18700051
local
cm
=
_G
[
"c"
..
m
]
xpcall
(
function
()
require
(
"expansions/script/1"
)
end
,
function
()
require
(
"script/1"
)
end
)
function
cm
.
initial_effect
(
c
)
c
:
EnableCounterPermit
(
0x820
)
aux
.
EnablePendulumAttribute
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_COUNTER
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCode
(
EVENT_REMOVE
)
e1
:
SetRange
(
LOCATION_PZONE
)
e1
:
SetOperation
(
cm
.
regop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_PZONE
)
e2
:
SetCountLimit
(
2
,
18700051
)
e2
:
SetCost
(
cm
.
tkcost
)
e2
:
SetTarget
(
cm
.
tktg
)
e2
:
SetOperation
(
cm
.
tkop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EVENT_CHAINING
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetCondition
(
cm
.
rmcon
)
c
:
RegisterEffect
(
e3
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e4
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_HAND
)
e4
:
SetCountLimit
(
1
,
18700052
)
e4
:
SetCost
(
cm
.
cost
)
e4
:
SetTarget
(
cm
.
thtg
)
e4
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e4
)
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e5
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e5
:
SetCode
(
EVENT_REMOVE
)
e5
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e5
:
SetCountLimit
(
1
,
18700053
)
e5
:
SetTarget
(
cm
.
sptg2
)
e5
:
SetOperation
(
cm
.
spop2
)
c
:
RegisterEffect
(
e5
)
local
e6
=
Effect
.
CreateEffect
(
c
)
e6
:
SetType
(
EFFECT_TYPE_EQUIP
)
e6
:
SetCode
(
EFFECT_SET_CONTROL
)
e6
:
SetValue
(
cm
.
ctval
)
c
:
RegisterEffect
(
e6
)
local
e7
=
Effect
.
CreateEffect
(
c
)
e7
:
SetType
(
EFFECT_TYPE_EQUIP
)
e7
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
e7
:
SetValue
(
500
)
c
:
RegisterEffect
(
e7
)
local
e8
=
Effect
.
CreateEffect
(
c
)
e8
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e8
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e8
:
SetType
(
EFFECT_TYPE_IGNITION
)
e8
:
SetRange
(
LOCATION_SZONE
)
e8
:
SetCountLimit
(
1
,
18700054
)
e8
:
SetCondition
(
cm
.
spcon3
)
e8
:
SetTarget
(
cm
.
sptg3
)
e8
:
SetOperation
(
cm
.
spop3
)
c
:
RegisterEffect
(
e8
)
end
function
cm
.
regop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
e
:
GetHandler
():
AddCounter
(
0x1820
,
1
)
end
function
cm
.
tkcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsCanRemoveCounter
(
tp
,
1
,
0
,
0x1820
,
2
,
REASON_COST
)
end
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x1820
,
2
,
REASON_COST
)
end
function
cm
.
rmcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
rp
==
1
-
tp
and
(
re
:
IsActiveType
(
TYPE_MONSTER
)
or
re
:
IsActiveType
(
TYPE_TRAP
)
or
re
:
IsActiveType
(
TYPE_SPELL
))
end
function
cm
.
filter
(
c
)
return
(
c
:
IsType
(
TYPE_TRAP
)
or
c
:
IsType
(
TYPE_QUICKPLAY
)
or
c
:
IsType
(
TYPE_SPELL
))
and
c
:
IsSetCard
(
0x821
)
and
c
:
CheckActivateEffect
(
false
,
true
,
false
)
~=
nil
end
function
cm
.
tktg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
local
te
=
e
:
GetLabelObject
()
local
tg
=
te
:
GetTarget
()
return
tg
and
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
0
,
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
cm
.
filter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
nil
)
end
e
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
local
g
=
Duel
.
SelectTarget
(
tp
,
cm
.
filter
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
1
,
nil
)
local
te
,
ceg
,
cep
,
cev
,
cre
,
cr
,
crp
=
g
:
GetFirst
():
CheckActivateEffect
(
false
,
true
,
true
)
Duel
.
ClearTargetCard
()
g
:
GetFirst
():
CreateEffectRelation
(
e
)
local
tg
=
te
:
GetTarget
()
e
:
SetProperty
(
te
:
GetProperty
())
if
tg
then
tg
(
e
,
tp
,
ceg
,
cep
,
cev
,
cre
,
cr
,
crp
,
1
)
end
te
:
SetLabelObject
(
e
:
GetLabelObject
())
e
:
SetLabelObject
(
te
)
Duel
.
ClearOperationInfo
(
0
)
end
function
cm
.
tkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
te
=
e
:
GetLabelObject
()
local
tc
=
te
:
GetHandler
()
if
not
te
then
return
end
e
:
SetLabelObject
(
te
:
GetLabelObject
())
local
op
=
te
:
GetOperation
()
if
op
then
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
end
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToRemoveAsCost
()
end
Duel
.
Remove
(
e
:
GetHandler
(),
POS_FACEUP
,
REASON_COST
)
end
function
cm
.
thfilter2
(
c
)
return
c
:
IsSetCard
(
0x821
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
and
(
c
:
IsLocation
(
LOCATION_DECK
)
or
(
c
:
IsLocation
(
LOCATION_EXTRA
)
and
c
:
IsFaceup
()))
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter2
,
tp
,
LOCATION_DECK
+
LOCATION_EXTRA
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
+
LOCATION_EXTRA
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter2
,
tp
,
LOCATION_DECK
+
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
function
cm
.
eqfilter2
(
c
,
tp
)
if
c
:
IsFacedown
()
then
return
false
end
if
c
:
IsType
(
TYPE_TRAPMONSTER
)
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
,
tp
,
LOCATION_REASON_CONTROL
)
>
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
,
tp
,
0
)
>=
2
end
return
true
end
function
cm
.
sptg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
cm
.
eqfilter2
(
chkc
,
tp
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
IsExistingTarget
(
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
SelectTarget
(
tp
,
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
,
tp
)
end
function
cm
.
eqlimit2
(
e
,
c
)
return
c
==
e
:
GetLabelObject
()
end
function
cm
.
spop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
then
return
end
local
tc
=
Duel
.
GetFirstTarget
()
if
c
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
and
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
Equip
(
tp
,
c
,
tc
)
--Add Equip limit
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetValue
(
cm
.
eqlimit2
)
e1
:
SetLabelObject
(
tc
)
c
:
RegisterEffect
(
e1
)
end
end
function
cm
.
ctval
(
e
,
c
)
return
e
:
GetHandlerPlayer
()
end
function
cm
.
spcon3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
GetEquipTarget
()
end
function
cm
.
sptg3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
cm
.
spop3
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
then
return
end
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
\ No newline at end of file
expansions/script/c18700055.lua
0 → 100644
View file @
f5173df4
--血罪灵骸·业罪骨
local
m
=
18700055
local
cm
=
_G
[
"c"
..
m
]
xpcall
(
function
()
require
(
"expansions/script/1"
)
end
,
function
()
require
(
"script/1"
)
end
)
function
cm
.
initial_effect
(
c
)
c
:
EnableCounterPermit
(
0x1820
)
aux
.
EnablePendulumAttribute
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_COUNTER
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_PZONE
)
e1
:
SetCountLimit
(
1
,
18700055
)
e1
:
SetCost
(
cm
.
spcost
)
e1
:
SetOperation
(
cm
.
pcop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_COUNTER
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_REMOVE
)
e2
:
SetRange
(
LOCATION_PZONE
)
e2
:
SetOperation
(
cm
.
regop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e3
:
SetCategory
(
CATEGORY_TODECK
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e3
:
SetRange
(
LOCATION_PZONE
)
e3
:
SetCountLimit
(
1
,
18700056
)
e3
:
SetCost
(
cm
.
tkcost
)
e3
:
SetTarget
(
cm
.
tktg
)
e3
:
SetOperation
(
cm
.
tkop
)
c
:
RegisterEffect
(
e3
)
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e5
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e5
:
SetType
(
EFFECT_TYPE_IGNITION
)
e5
:
SetRange
(
LOCATION_HAND
)
e5
:
SetCountLimit
(
1
,
18700057
)
e5
:
SetCondition
(
cm
.
spcon2
)
e5
:
SetTarget
(
cm
.
sptg
)
e5
:
SetOperation
(
cm
.
spop
)
c
:
RegisterEffect
(
e5
)
local
e7
=
Effect
.
CreateEffect
(
c
)
e7
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e7
:
SetCategory
(
CATEGORY_REMOVE
)
e7
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e7
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e7
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e7
:
SetCountLimit
(
1
,
18700058
)
e7
:
SetTarget
(
cm
.
thtg
)
e7
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e7
)
local
e8
=
e7
:
Clone
()
e8
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e8
)
local
e9
=
Effect
.
CreateEffect
(
c
)
e9
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e9
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e9
:
SetCode
(
EVENT_REMOVE
)
e9
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e9
:
SetCountLimit
(
1
,
18700059
)
e9
:
SetTarget
(
cm
.
sptg2
)
e9
:
SetOperation
(
cm
.
spop2
)
c
:
RegisterEffect
(
e9
)
local
e10
=
Effect
.
CreateEffect
(
c
)
e10
:
SetType
(
EFFECT_TYPE_EQUIP
)
e10
:
SetCode
(
EFFECT_SET_CONTROL
)
e10
:
SetValue
(
cm
.
ctval
)
c
:
RegisterEffect
(
e10
)
local
e11
=
Effect
.
CreateEffect
(
c
)
e11
:
SetType
(
EFFECT_TYPE_EQUIP
)
e11
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
e11
:
SetValue
(
1
)
c
:
RegisterEffect
(
e11
)
end
function
cm
.
costfilter
(
c
)
return
c
:
IsAbleToRemoveAsCost
()
end
function
cm
.
spcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
costfilter
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
costfilter
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_COST
)
end
function
cm
.
cfilter
(
c
)
return
c
:
IsCanAddCounter
(
0x1820
,
1
,
nil
,
nil
)
and
c
:
IsFaceup
()
end
function
cm
.
pcop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_COUNTER
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
cfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
tg
:
GetCount
()
>
0
then
tc
=
tg
:
GetFirst
()
tc
:
AddCounter
(
0x1820
,
1
)
end
end
function
cm
.
regop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
e
:
GetHandler
():
AddCounter
(
0x1820
,
1
)
end
function
cm
.
tkcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsCanRemoveCounter
(
tp
,
1
,
0
,
0x1820
,
2
,
REASON_COST
)
end
Duel
.
RemoveCounter
(
tp
,
1
,
0
,
0x1820
,
2
,
REASON_COST
)
end
function
cm
.
cfilter2
(
c
)
return
c
:
IsSetCard
(
0x821
)
and
c
:
IsFaceup
()
end
function
cm
.
tktg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
cfilter2
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
nil
,
1
,
0
,
LOCATION_GRAVE
+
LOCATION_REMOVED
)
end
function
cm
.
tkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
cm
.
cfilter2
,
tp
,
LOCATION_GRAVE
+
LOCATION_REMOVED
,
0
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
sg
)
Duel
.
SendtoDeck
(
sg
,
nil
,
nil
,
REASON_EFFECT
)
end
end
function
cm
.
cfilter3
(
c
)
return
c
:
IsSetCard
(
0x821
)
and
c
:
IsFaceup
()
end
function
cm
.
spcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
cm
.
cfilter3
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
cm
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
e
:
GetHandler
():
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP_DEFENSE
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
cm
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
cm
.
cfilter4
(
c
)
return
c
:
IsAbleToRemove
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
cfilter4
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
cfilter4
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
function
cm
.
eqfilter2
(
c
,
tp
)
if
c
:
IsFacedown
()
then
return
false
end
if
c
:
IsType
(
TYPE_TRAPMONSTER
)
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
,
tp
,
LOCATION_REASON_CONTROL
)
>
0
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
,
tp
,
0
)
>=
2
end
return
true
end
function
cm
.
sptg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
cm
.
eqfilter2
(
chkc
,
tp
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
and
Duel
.
IsExistingTarget
(
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_EQUIP
)
Duel
.
SelectTarget
(
tp
,
cm
.
eqfilter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
,
tp
)
end
function
cm
.
eqlimit2
(
e
,
c
)
return
c
==
e
:
GetLabelObject
()
end
function
cm
.
spop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
<=
0
then
return
end
local
tc
=
Duel
.
GetFirstTarget
()
if
c
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
and
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
Equip
(
tp
,
c
,
tc
)
--Add Equip limit
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_EQUIP_LIMIT
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e1
:
SetValue
(
cm
.
eqlimit2
)
e1
:
SetLabelObject
(
tc
)
c
:
RegisterEffect
(
e1
)
end
end
function
cm
.
ctval
(
e
,
c
)
return
e
:
GetHandlerPlayer
()
end
\ No newline at end of file
expansions/script/c18700060.lua
0 → 100644
View file @
f5173df4
--血罪骸临
local
m
=
18700060
local
cm
=
_G
[
"c"
..
m
]
xpcall
(
function
()
require
(
"expansions/script/1"
)
end
,
function
()
require
(
"script/1"
)
end
)
function
cm
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_LIMIT_ZONE
)
e1
:
SetCountLimit
(
1
,
18700060
)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
activate
)
e1
:
SetValue
(
cm
.
zones
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e4
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetCode
(
EVENT_REMOVE
)
e4
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e4
:
SetCountLimit
(
1
,
18700061
)
e4
:
SetTarget
(
cm
.
thtg
)
e4
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e4
)
end
function
cm
.
zones
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
zone
=
0xff
local
p0
=
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
local
p1
=
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
)
local
b
=
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
and
not
e
:
GetHandler
():
IsLocation
(
LOCATION_SZONE
)
if
not
b
or
p0
and
p1
then
return
zone
end
if
p0
then
zone
=
zone
-
0x1
end
if
p1
then
zone
=
zone
-
0x10
end
return
zone
end
function
cm
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
IsAbleToRemoveAsCost
()
and
c
:
IsSetCard
(
0x821
)
end
function
cm
.
check
(
g
,
tp
)
return
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_DECK
+
LOCATION_EXTRA
+
LOCATION_REMOVED
,
0
,
1
,
g
)
end
function
cm
.
filter
(
c
)
return
c
:
IsFaceupEx
()
and
c
:
IsType
(
TYPE_PENDULUM
)
and
not
c
:
IsForbidden
()
and
c
:
IsSetCard
(
0x821
)
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
(
e
:
IsCostChecked
()
or
Duel
.
IsExistingMatchingCard
(
cm
.
filter
,
tp
,
LOCATION_DECK
+
LOCATION_EXTRA
+
LOCATION_REMOVED
+
LOCATION_GRAVE
,
0
,
1
,
nil
))
and
(
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
or
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
))
end
end
function
cm
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
(
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
0
)
or
Duel
.
CheckLocation
(
tp
,
LOCATION_PZONE
,
1
))
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOFIELD
)
local
tc
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
filter
,
tp
,
LOCATION_DECK
+
LOCATION_EXTRA
+
LOCATION_REMOVED
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
):
GetFirst
()
if
tc
then
Duel
.
MoveToField
(
tc
,
tp
,
tp
,
LOCATION_PZONE
,
POS_FACEUP
,
true
)
end
end
function
cm
.
thfilter2
(
c
)
return
c
:
IsSetCard
(
0x821
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
and
(
c
:
IsLocation
(
LOCATION_DECK
)
or
(
c
:
IsLocation
(
LOCATION_EXTRA
)
and
c
:
IsFaceup
()))
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter2
,
tp
,
LOCATION_DECK
+
LOCATION_EXTRA
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
+
LOCATION_EXTRA
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter2
,
tp
,
LOCATION_DECK
+
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
\ No newline at end of file
expansions/script/c18700576.lua
0 → 100644
View file @
f5173df4
--祈星魔女协心祓灵
local
cm
,
m
,
o
=
GetID
()
function
cm
.
initial_effect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
operation
)
c
:
RegisterEffect
(
e1
)
local
e21
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e21
:
SetCategory
(
CATEGORY_DESTROY
)
e21
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e21
:
SetCode
(
EVENT_CHAINING
)
e21
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e21
:
SetRange
(
LOCATION_GRAVE
)
e21
:
SetCountLimit
(
1
,
m
+
1
)
e21
:
SetCost
(
aux
.
bfgcost
)
e21
:
SetCondition
(
cm
.
con
)
e21
:
SetTarget
(
cm
.
destg
)
e21
:
SetOperation
(
cm
.
desop
)
c
:
RegisterEffect
(
e21
)
end
function
cm
.
dfilter
(
c
)
return
(
c
:
IsType
(
TYPE_PENDULUM
)
or
c
:
IsType
(
TYPE_SPELL
))
and
c
:
IsReleasable
()
end
function
cm
.
matfilter
(
c
)
return
bit
.
band
(
c
:
GetOriginalType
(),
TYPE_PENDULUM
)
~=
0
end
function
cm
.
mfilter
(
c
,
e
)
return
((
c
:
IsType
(
TYPE_PENDULUM
)
or
c
:
IsType
(
TYPE_SPELL
))
and
c
:
IsReleasableByEffect
(
e
))
or
c
:
IsType
(
TYPE_SPELL
)
end
function
cm
.
filter
(
c
,
e
,
tp
)
return
c
:
IsType
(
TYPE_RITUAL
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
cm
.
ttfilter
(
c
)
return
bit
.
band
(
c
:
GetOriginalType
(),
TYPE_PENDULUM
)
~=
0
end
function
cm
.
GetCappedLeftScale
(
c
)
local
level
=
c
:
GetLeftScale
()
if
c
:
IsType
(
TYPE_SPELL
)
then
level
=
3
end
if
level
>
MAX_PARAMETER
then
return
MAX_PARAMETER
else
return
level
end
end
function
cm
.
GetCappedLevel
(
c
)
local
level
=
c
:
GetLevel
()
if
level
>
MAX_PARAMETER
then
return
MAX_PARAMETER
else
return
level
end
end
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
mg
=
Duel
.
GetRitualMaterialEx
(
tp
):
Filter
(
cm
.
matfilter
,
nil
,
e
:
GetHandler
())
local
mg2
=
Duel
.
GetMatchingGroup
(
cm
.
mfilter
,
tp
,
LOCATION_SZONE
+
LOCATION_FZONE
+
LOCATION_HAND
,
0
,
e
:
GetHandler
())
return
Duel
.
IsExistingMatchingCard
(
cm
.
RitualUltimateFilter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
nil
,
cm
.
filter
,
e
,
tp
,
mg
,
mg2
,
Card
.
GetLevel
,
"Greater"
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
+
LOCATION_EXTRA
)
end
function
cm
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
::
cancel
::
local
mg1
=
Duel
.
GetRitualMaterialEx
(
tp
):
Filter
(
cm
.
matfilter
,
nil
,
e
:
GetHandler
())
local
mg2
=
Duel
.
GetMatchingGroup
(
cm
.
mfilter
,
tp
,
LOCATION_SZONE
+
LOCATION_FZONE
+
LOCATION_HAND
,
0
,
e
:
GetHandler
())
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
cm
.
RitualUltimateFilter
),
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
cm
.
filter
,
e
,
tp
,
mg1
,
mg2
,
Card
.
GetLevel
,
"Greater"
)
local
tc
=
tg
:
GetFirst
()
if
tc
then
local
mg
=
mg1
:
Filter
(
Card
.
IsCanBeRitualMaterial
,
tc
,
tc
)
mg
:
Merge
(
mg2
)
if
sg
then
mg
:
Merge
(
sg
)
end
if
tc
.
mat_filter
then
mg
=
mg
:
Filter
(
tc
.
mat_filter
,
tc
,
tp
)
else
mg
:
RemoveCard
(
tc
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RELEASE
)
aux
.
GCheckAdditional
=
cm
.
RitualCheckAdditional
(
tc
,
tc
:
GetLevel
(),
"Greater"
)
local
mat
=
mg
:
SelectSubGroup
(
tp
,
cm
.
RitualCheck
,
true
,
1
,
#
mg
,
tp
,
tc
,
tc
:
GetLevel
(),
"Greater"
)
aux
.
GCheckAdditional
=
nil
if
not
mat
then
goto
cancel
end
tc
:
SetMaterial
(
mat
)
Duel
.
ReleaseRitualMaterial
(
mat
)
Duel
.
Release
(
mat
,
REASON_RITUAL
)
Duel
.
BreakEffect
()
Duel
.
SpecialSummon
(
tc
,
SUMMON_TYPE_RITUAL
,
tp
,
tp
,
false
,
true
,
POS_FACEUP
)
tc
:
CompleteProcedure
()
end
local
ct
=
mat
:
Filter
(
cm
.
ttfilter
,
nil
):
GetCount
()
if
ct
>=
1
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_TRAP_ACT_IN_SET_TURN
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetTargetRange
(
LOCATION_SZONE
,
0
)
e1
:
SetCountLimit
(
ct
)
e1
:
SetTarget
(
function
(
e
,
c
)
return
c
:
GetType
()
==
TYPE_QUICKPLAY
end
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
function
cm
.
RitualCheckGreater
(
g
,
c
,
level
)
if
level
==
0
then
return
false
end
Duel
.
SetSelectedCard
(
g
)
return
g
:
CheckWithSumGreater
(
cm
.
GetCappedLeftScale
,
level
)
end
function
cm
.
RitualCheckEqual
(
g
,
c
,
level
)
if
level
==
0
then
return
false
end
return
g
:
CheckWithSumEqual
(
cm
.
GetCappedLeftScale
,
level
,
#
g
,
#
g
)
end
function
cm
.
RitualCheck
(
g
,
tp
,
c
,
level
,
greater_or_equal
)
return
cm
[
"RitualCheck"
..
greater_or_equal
](
g
,
c
,
level
)
and
Duel
.
GetMZoneCount
(
tp
,
g
,
tp
)
>
0
and
(
not
c
.
mat_group_check
or
c
.
mat_group_check
(
g
,
tp
))
and
(
not
aux
.
RCheckAdditional
or
aux
.
RCheckAdditional
(
tp
,
g
,
c
))
end
function
cm
.
RitualCheckAdditional
(
c
,
level
,
greater_or_equal
)
if
greater_or_equal
==
"Equal"
then
return
function
(
g
)
local
link3
=
g
:
GetSum
(
cm
.
GetCappedLeftScale
)
return
(
not
aux
.
RGCheckAdditional
or
aux
.
RGCheckAdditional
(
g
))
and
link3
<=
level
end
else
return
function
(
g
,
ec
)
if
level
==
0
then
return
#
g
<=
1
end
if
ec
then
local
link3
=
g
:
GetSum
(
cm
.
GetCappedLeftScale
)
return
(
not
aux
.
RGCheckAdditional
or
aux
.
RGCheckAdditional
(
g
,
ec
))
and
link3
-
ec
:
GetLevel
()
>
0
else
return
not
aux
.
RGCheckAdditional
or
aux
.
RGCheckAdditional
(
g
)
end
end
end
end
function
cm
.
RitualUltimateFilter
(
c
,
filter
,
e
,
tp
,
m1
,
m2
,
level_function
,
greater_or_equal
,
chk
)
if
bit
.
band
(
c
:
GetType
(),
0x81
)
~=
0x81
or
(
filter
and
not
filter
(
c
,
e
,
tp
,
chk
))
or
not
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_RITUAL
,
tp
,
false
,
true
)
then
return
false
end
local
mg
=
m1
:
Filter
(
Card
.
IsCanBeRitualMaterial
,
c
,
c
)
if
m2
then
mg
:
Merge
(
m2
)
end
if
c
.
mat_filter
then
mg
=
mg
:
Filter
(
c
.
mat_filter
,
c
,
tp
)
else
mg
:
RemoveCard
(
c
)
end
local
level
=
level_function
(
c
)
aux
.
GCheckAdditional
=
cm
.
RitualCheckAdditional
(
c
,
level
,
greater_or_equal
)
local
res
=
mg
:
CheckSubGroup
(
cm
.
RitualCheck
,
1
,
#
mg
,
tp
,
c
,
level
,
greater_or_equal
)
aux
.
GCheckAdditional
=
nil
return
res
end
function
cm
.
slevel
(
e
,
c
,
rc
)
local
lv
=
aux
.
GetCappedLevel
(
e
:
GetHandler
())
return
(
6
<<
16
)
+
lv
end
function
cm
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
re
:
GetHandler
():
IsType
(
TYPE_RITUAL
)
end
function
cm
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsOnField
()
and
chkc
:
IsControler
(
1
-
tp
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
nil
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
g
=
Duel
.
SelectTarget
(
tp
,
nil
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
1
,
0
,
0
)
end
function
cm
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
end
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_TRAP_ACT_IN_SET_TURN
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetTargetRange
(
LOCATION_SZONE
,
0
)
e1
:
SetCountLimit
(
1
)
e1
:
SetTarget
(
function
(
e
,
c
)
return
c
:
GetType
()
==
TYPE_QUICKPLAY
end
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
\ No newline at end of file
expansions/script/c18700672.lua
0 → 100644
View file @
f5173df4
--赤色坍缩
local
cm
,
m
,
o
=
GetID
()
function
cm
.
initial_effect
(
c
)
-- 永续陷阱特性
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e0
:
SetCode
(
EVENT_FREE_CHAIN
)
e0
:
SetCost
(
cm
.
cost
)
c
:
RegisterEffect
(
e0
)
-- 持续处理效果
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_ADJUST
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetOperation
(
cm
.
adjust_op
)
c
:
RegisterEffect
(
e1
)
end
function
cm
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
CheckLPCost
(
tp
,
1000
)
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToGraveAsCost
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
PayLPCost
(
tp
,
1000
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToGraveAsCost
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
e
:
GetHandler
())
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
end
function
cm
.
check_position
(
p
)
local
g
=
Duel
.
GetFieldGroup
(
p
,
LOCATION_MZONE
,
0
)
for
_
,
seq
in
ipairs
({
0
,
1
,
2
,
3
,
4
})
do
local
tc
=
Duel
.
GetFieldCard
(
p
,
LOCATION_MZONE
,
seq
)
if
tc
then
if
(
seq
>
0
and
Duel
.
GetFieldCard
(
p
,
LOCATION_MZONE
,
seq
-
1
))
or
(
seq
<
4
and
Duel
.
GetFieldCard
(
p
,
LOCATION_MZONE
,
seq
+
1
))
then
return
false
end
if
seq
==
1
and
Duel
.
GetFieldCard
(
p
,
LOCATION_MZONE
,
5
)
or
seq
==
3
and
Duel
.
GetFieldCard
(
p
,
LOCATION_MZONE
,
6
)
then
return
false
end
end
end
return
true
end
function
cm
.
check_unique
(
p
)
local
g
=
Duel
.
GetFieldGroup
(
p
,
LOCATION_MZONE
,
0
)
local
lv_tbl
=
{}
local
rk_tbl
=
{}
local
lnk_tbl
=
{}
for
tc
in
aux
.
Next
(
g
)
do
local
lv
=
tc
:
GetLevel
()
local
rk
=
tc
:
GetRank
()
local
lnk
=
tc
:
GetLink
()
if
lv
>
0
then
if
lv_tbl
[
lv
]
then
return
false
end
lv_tbl
[
lv
]
=
true
end
if
rk
>
0
then
if
rk_tbl
[
rk
]
then
return
false
end
rk_tbl
[
rk
]
=
true
end
if
lnk
>
0
then
if
lnk_tbl
[
lnk
]
then
return
false
end
lnk_tbl
[
lnk
]
=
true
end
end
return
true
end
function
cm
.
adjust_op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
for
p
=
0
,
1
do
::
restart
::
local
need_adjust
=
false
if
not
cm
.
check_position
(
p
)
then
need_adjust
=
true
end
if
not
cm
.
check_unique
(
p
)
then
need_adjust
=
true
end
if
need_adjust
then
Duel
.
Hint
(
HINT_SELECTMSG
,
p
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
p
,
Card
.
IsAbleToGrave
,
p
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
if
#
g
>
0
then
Duel
.
HintSelection
(
g
)
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
goto
restart
else
break
end
end
end
end
expansions/script/c33720372.lua
0 → 100644
View file @
f5173df4
This diff is collapsed.
Click to expand it.
expansions/script/c5012625.lua
View file @
f5173df4
...
@@ -59,17 +59,24 @@ function s.initial_effect(c)
...
@@ -59,17 +59,24 @@ function s.initial_effect(c)
local
e9
=
e8
:
Clone
()
local
e9
=
e8
:
Clone
()
e9
:
SetCode
(
EFFECT_UNRELEASABLE_NONSUM
)
e9
:
SetCode
(
EFFECT_UNRELEASABLE_NONSUM
)
c
:
RegisterEffect
(
e9
)
c
:
RegisterEffect
(
e9
)
--做超量素材时送去墓地
local
e11
=
Effect
.
CreateEffect
(
c
)
e11
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
)
e11
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_FIELD
)
e11
:
SetCode
(
EVENT_ADJUST
)
e11
:
SetOperation
(
s
.
rmop
)
Duel
.
RegisterEffect
(
e11
,
0
)
--control
--control
local
e10
=
Effect
.
CreateEffect
(
c
)
local
e10
=
Effect
.
CreateEffect
(
c
)
e10
:
SetType
(
EFFECT_TYPE_SINGLE
)
e10
:
SetType
(
EFFECT_TYPE_SINGLE
)
e10
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
+
EFFECT_FLAG_CANNOT_DISABLE
)
e10
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
+
EFFECT_FLAG_CANNOT_DISABLE
)
e10
:
SetRange
(
LOCATION_MZONE
)
e10
:
SetRange
(
LOCATION_MZONE
)
--
e10:SetCode(EFFECT_CANNOT_CHANGE_CONTROL)
e10
:
SetCode
(
EFFECT_CANNOT_CHANGE_CONTROL
)
c
:
RegisterEffect
(
e10
)
c
:
RegisterEffect
(
e10
)
--maintain
--maintain
local
e17
=
Effect
.
CreateEffect
(
c
)
local
e17
=
Effect
.
CreateEffect
(
c
)
e17
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e17
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e17
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
--
e17:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e17
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e17
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e17
:
SetRange
(
LOCATION_MZONE
)
e17
:
SetRange
(
LOCATION_MZONE
)
e17
:
SetCountLimit
(
1
)
e17
:
SetCountLimit
(
1
)
...
@@ -77,6 +84,14 @@ function s.initial_effect(c)
...
@@ -77,6 +84,14 @@ function s.initial_effect(c)
e17
:
SetOperation
(
s
.
mtop
)
e17
:
SetOperation
(
s
.
mtop
)
c
:
RegisterEffect
(
e17
)
c
:
RegisterEffect
(
e17
)
end
end
function
s
.
rmop
(
e
)
local
g
=
Duel
.
GetOverlayGroup
(
0
,
LOCATION_MZONE
,
LOCATION_MZONE
)
local
tgg
=
g
:
Filter
(
Card
.
IsCode
,
nil
,
id
)
if
tgg
and
#
tgg
>
0
then
Duel
.
SendtoGrave
(
tgg
,
REASON_EFFECT
)
end
end
function
s
.
ndsfilter
(
c
)
function
s
.
ndsfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCode
(
5012604
)
return
c
:
IsFaceup
()
and
c
:
IsCode
(
5012604
)
end
end
...
...
expansions/script/c5012636.lua
View file @
f5173df4
--安娜·施普伦格尔
--安娜·施普伦格尔
local
cm
,
m
,
o
=
GetID
()
local
s
,
id
,
o
=
GetID
()
local
s
,
id
,
o
=
GetID
()
s
.
MoJin
=
true
s
.
MoJin
=
true
function
cm
.
initial_effect
(
c
)
function
s
.
initial_effect
(
c
)
aux
.
AddSynchroProcedure
(
c
,
nil
,
aux
.
NonTuner
(
cm
.
sfilter
),
1
)
c
:
EnableReviveLimit
()
c
:
EnableReviveLimit
()
--immune
aux
.
AddMaterialCodeList
(
c
,
5012604
)
local
e3
=
Effect
.
CreateEffect
(
c
)
--synchro summon
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
aux
.
AddSynchroProcedure
(
c
,
nil
,
aux
.
FilterBoolFunction
(
Card
.
IsCode
,
5012604
),
1
,
1
)
e3
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
--Activate
e3
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e3
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetValue
(
cm
.
efilter
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e3
)
e1
:
SetCategory
(
CATEGORY_DISABLE
+
CATEGORY_ATKCHANGE
)
e1
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_END_PHASE
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
4
))
e1
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetCountLimit
(
3
)
e3
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCost
(
s
.
cost
)
e3
:
SetCountLimit
(
3
)
e1
:
SetTarget
(
s
.
tg
)
e3
:
SetCost
(
cm
.
thcost
)
e1
:
SetOperation
(
s
.
op
)
e3
:
SetTarget
(
cm
.
thtg
)
c
:
RegisterEffect
(
e1
)
e3
:
SetOperation
(
cm
.
thop
)
local
e5
=
Effect
.
CreateEffect
(
c
)
c
:
RegisterEffect
(
e3
)
e5
:
SetType
(
EFFECT_TYPE_SINGLE
)
end
e5
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
function
cm
.
sfilter
(
c
)
e5
:
SetRange
(
LOCATION_MZONE
)
return
c
.
MoJin
==
true
e5
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
end
e5
:
SetValue
(
s
.
immval
)
function
cm
.
efilter
(
e
,
re
)
c
:
RegisterEffect
(
e5
)
return
re
:
IsActivated
()
end
function
cm
.
fil
(
c
)
return
not
c
:
IsAttack
(
0
)
and
c
:
IsFaceup
()
end
function
cm
.
fil2
(
c
)
return
c
:
IsCode
(
5012604
)
and
c
:
IsFaceup
()
end
end
function
cm
.
th
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
e
:
GetHandler
()
)
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
Duel
.
DiscardHand
(
tp
,
Card
.
IsDiscardable
,
1
,
1
,
REASON_COST
+
REASON_DISCARD
)
if
Duel
.
IsExistingMatchingCard
(
cm
.
fil2
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
Duel
.
IsPlayerCanDraw
(
tp
,
2
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
3
))
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
end
function
cm
.
th
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
b1
=
false
local
b1
=
Duel
.
IsExistingTarget
(
aux
.
nzatk
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
local
b2
=
false
local
b2
=
Duel
.
IsExistingTarget
(
aux
.
NegateAnyFilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
local
b3
=
false
local
b3
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
,
PLAYER_NONE
,
0
)
if
Duel
.
IsExistingMatchingCard
(
cm
.
fil
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
then
b1
=
true
end
+
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
,
PLAYER_NONE
,
0
)
if
Duel
.
IsExistingMatchingCard
(
aux
.
NegateAnyFilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
then
b2
=
true
end
+
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
,
PLAYER_NONE
,
0
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
+
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
+
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_SZONE
)
+
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
)
>
0
then
b3
=
true
end
+
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_SZONE
,
PLAYER_NONE
,
0
)
>
0
if
chk
==
0
then
return
b1
or
b2
or
b3
end
if
chk
==
0
then
return
b1
or
b2
or
b3
end
local
op
=
aux
.
SelectFromOptions
(
tp
,
{
b1
,
aux
.
Stringid
(
m
,
0
)},
{
b2
,
aux
.
Stringid
(
m
,
1
)},
{
b3
,
aux
.
Stringid
(
m
,
2
)})
if
op
==
1
then
Duel
.
SetOperationInfo
(
0
,
CATEGORY_ATKCHANGE
,
nil
,
1
,
PLAYER_ALL
,
LOCATION_MZONE
)
elseif
op
==
2
then
Duel
.
SetOperationInfo
(
0
,
CATEGORY_NEGATE
,
nil
,
1
,
PLAYER_ALL
,
LOCATION_ONFIELD
)
end
e
:
SetLabel
(
op
)
end
end
function
cm
.
th
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
op
=
e
:
GetLabel
()
local
b1
=
Duel
.
IsExistingTarget
(
aux
.
nzatk
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
if
op
==
1
then
local
b2
=
Duel
.
IsExistingTarget
(
aux
.
NegateAnyFilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
cm
.
fil
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
nil
)
local
b3
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
,
PLAYER_NONE
,
0
)
for
ac
in
aux
.
Next
(
g
)
do
+
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
,
PLAYER_NONE
,
0
)
local
e1
=
Effect
.
CreateEffect
(
c
)
+
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
,
PLAYER_NONE
,
0
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
+
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_SZONE
,
PLAYER_NONE
,
0
)
>
0
e1
:
SetCode
(
EFFECT_SET_ATTACK_FINAL
)
local
op
=
aux
.
SelectFromOptions
(
tp
,
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
{
b1
,
aux
.
Stringid
(
id
,
0
),
0
},
e1
:
SetValue
(
0
)
{
b2
,
aux
.
Stringid
(
id
,
1
),
1
},
ac
:
RegisterEffect
(
e1
)
{
b3
,
aux
.
Stringid
(
id
,
2
),
2
})
end
if
op
==
0
then
elseif
op
==
2
then
local
sg
=
Duel
.
GetMatchingGroup
(
aux
.
nzatk
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
aux
.
NegateAnyFilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
nil
)
if
sg
:
GetCount
()
>
0
then
for
ac
in
aux
.
Next
(
g
)
do
local
sc
=
sg
:
GetFirst
()
Duel
.
NegateRelatedChain
(
ac
,
RESET_TURN_SET
)
while
sc
do
local
e1
=
Effect
.
CreateEffect
(
c
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetCode
(
EFFECT_SET_ATTACK_FINAL
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_CHAIN
)
ac
:
RegisterEffect
(
e1
)
e1
:
SetValue
(
0
)
local
e2
=
Effect
.
CreateEffect
(
c
)
sc
:
RegisterEffect
(
e1
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
sc
=
sg
:
GetNext
()
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
end
e2
:
SetValue
(
RESET_TURN_SET
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
ac
:
RegisterEffect
(
e2
)
end
end
elseif
op
==
3
then
elseif
op
==
1
then
local
zone
=
0
local
sg
=
Duel
.
GetMatchingGroup
(
aux
.
NegateAnyFilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
nil
)
local
num
=
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
+
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
+
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_SZONE
)
+
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
)
+
2
-
Duel
.
GetMatchingGroupCount
(
cm
.
filx
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
nil
)
if
sg
:
GetCount
()
>
0
then
Debug
.
Message
(
num
)
local
sc
=
sg
:
GetFirst
()
while
num
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
5
))
do
while
sc
do
Duel
.
BreakEffect
()
Duel
.
NegateRelatedChain
(
sc
,
RESET_TURN_SET
)
local
zone2
=
Duel
.
SelectDisableField
(
tp
,
1
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
zone
)
local
e1
=
Effect
.
CreateEffect
(
c
)
if
tp
==
1
then
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
zone2
=
((
zone2
&
0xffff
)
<<
16
)
|
((
zone2
>>
16
)
&
0xffff
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_CHAIN
)
sc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetValue
(
RESET_TURN_SET
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_CHAIN
)
sc
:
RegisterEffect
(
e2
)
if
sc
:
IsType
(
TYPE_TRAPMONSTER
)
then
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e3
:
SetCode
(
EFFECT_DISABLE_TRAPMONSTER
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_CHAIN
)
sc
:
RegisterEffect
(
e3
)
end
sc
=
sg
:
GetNext
()
end
end
zone
=
bit
.
bor
(
zone
,
zone2
)
num
=
num
-
1
end
end
elseif
op
==
2
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
if
not
c
:
IsRelateToEffect
(
e
)
then
goto
setting
end
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCode
(
EFFECT_DISABLE_FIELD
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetValue
(
zone
)
e3
:
SetCode
(
EFFECT_DISABLE_FIELD
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e3
:
SetValue
(
0xffffffff
)
Duel
.
RegisterEffect
(
e1
,
tp
)
e3
:
SetReset
(
RESET_PHASE
+
PHASE_END
+
RESET_CHAIN
)
Duel
.
RegisterEffect
(
e3
,
tp
)
end
::
setting
::
if
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
3
))
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
end
end
function
s
.
filter
(
c
)
function
cm
.
filx
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCode
(
5012604
)
return
c
:
GetSequence
()
>
4
end
function
s
.
immval
(
e
,
te
)
return
te
:
IsActivated
()
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment