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
6acc04ad
Commit
6acc04ad
authored
Jul 10, 2025
by
Huangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
14ce4515
Pipeline
#38806
failed with stages
in 90 minutes and 47 seconds
Changes
22
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
761 additions
and
598 deletions
+761
-598
expansions/script/c1300900.lua
expansions/script/c1300900.lua
+4
-4
expansions/script/c1300901.lua
expansions/script/c1300901.lua
+16
-31
expansions/script/c1300910.lua
expansions/script/c1300910.lua
+4
-4
expansions/script/c16110003.lua
expansions/script/c16110003.lua
+1
-1
expansions/script/c16401240.lua
expansions/script/c16401240.lua
+1
-0
expansions/script/c16401560.lua
expansions/script/c16401560.lua
+3
-0
expansions/script/c5012606.lua
expansions/script/c5012606.lua
+2
-2
expansions/script/c79100260.lua
expansions/script/c79100260.lua
+10
-10
expansions/script/c79103020.lua
expansions/script/c79103020.lua
+81
-78
expansions/script/c79103030.lua
expansions/script/c79103030.lua
+100
-56
expansions/script/c79103040.lua
expansions/script/c79103040.lua
+33
-23
expansions/script/c79103050.lua
expansions/script/c79103050.lua
+56
-45
expansions/script/c79103070.lua
expansions/script/c79103070.lua
+121
-72
expansions/script/c79103080.lua
expansions/script/c79103080.lua
+13
-22
expansions/script/c79103090.lua
expansions/script/c79103090.lua
+44
-16
expansions/script/c79103100.lua
expansions/script/c79103100.lua
+27
-10
expansions/script/c79103110.lua
expansions/script/c79103110.lua
+42
-67
expansions/script/c79103120.lua
expansions/script/c79103120.lua
+63
-48
expansions/script/c79103130.lua
expansions/script/c79103130.lua
+65
-59
expansions/script/c79103140.lua
expansions/script/c79103140.lua
+2
-2
expansions/script/c79103150.lua
expansions/script/c79103150.lua
+53
-41
expansions/script/c79103170.lua
expansions/script/c79103170.lua
+20
-7
No files found.
expansions/script/c1300900.lua
View file @
6acc04ad
...
...
@@ -25,10 +25,10 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
Duel
.
RegisterEffect
(
e0
,
true
)
end
function
s
.
adjustop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
1
=
Duel
.
GetFieldGroup
(
tp
,
0
,
LOCATION_HAND
)
local
ct
=
g
1
:
GetCount
()
-
6
local
g
=
Duel
.
GetFieldGroup
(
tp
,
0
,
LOCATION_HAND
)
local
ct
=
g
:
GetCount
()
-
6
if
ct
>
0
then
local
g2
=
g1
:
RandomSelect
(
1
-
tp
,
ct
)
Duel
.
SendtoDeck
(
g2
,
nil
,
SEQ_DECKBOTTOM
,
REASON_EFFECT
)
local
sg
=
g
:
RandomSelect
(
1
-
tp
,
ct
)
Duel
.
SendtoDeck
(
sg
,
nil
,
SEQ_DECKBOTTOM
,
REASON_EFFECT
)
end
end
\ No newline at end of file
expansions/script/c1300901.lua
View file @
6acc04ad
...
...
@@ -16,13 +16,13 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel
.
SendtoGrave
(
e
:
GetHandler
(),
REASON_COST
+
REASON_DISCARD
)
end
function
s
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_CARDTYPE
)
local
opt
=
Duel
.
SelectOption
(
tp
,
1056
,
1063
,
1073
,
1076
)
if
opt
==
0
then
ct
=
TYPE_FUSION
end
if
opt
==
1
then
ct
=
TYPE_SYNCHRO
end
if
opt
==
2
then
ct
=
TYPE_XYZ
end
if
opt
==
3
then
ct
=
TYPE_LINK
end
local
c
=
e
:
GetHandler
()
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e0
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
...
...
@@ -47,12 +47,12 @@ function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return
eg
:
IsExists
(
s
.
filter
,
1
,
nil
,
1
-
tp
,
e
:
GetLabel
())
end
function
s
.
regop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g1
=
Duel
.
GetMatchingGroup
(
Card
.
IsType
,
tp
,
0
,
LOCATION_EXTRA
,
nil
,
e
:
GetLabel
()
)
if
g1
:
GetCount
()
>
0
then
local
g2
=
g1
:
RandomSelect
(
1
-
tp
,
2
)
local
tc
=
g2
:
GetFirst
(
)
while
tc
do
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
(
)
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsType
,
tp
,
0
,
LOCATION_EXTRA
,
nil
,
e
:
GetLabel
())
if
g
:
GetCount
()
>
0
then
Duel
.
ShuffleExtra
(
1
-
tp
)
local
sg
=
g
:
RandomSelect
(
tp
,
2
)
for
tc
in
aux
.
Next
(
sg
)
do
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e0
:
SetType
(
EFFECT_TYPE_SINGLE
)
...
...
@@ -61,41 +61,26 @@ function s.regop(e,tp,eg,ep,ev,re,r,rp)
e0
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e0
)
tc
:
RegisterFlagEffect
(
id
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
,
0
,
2
)
tc
=
g2
:
GetNext
()
end
end
end
function
s
.
spfilter1
(
c
)
return
c
:
GetFlagEffect
(
id
)
>
0
end
function
s
.
spfilter2
(
c
,
e
,
tp
)
function
s
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
true
,
false
)
and
c
:
GetFlagEffect
(
id
)
>
0
end
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
nil
)
>
0
and
Duel
.
IsExistingMatchingCard
(
s
.
spfilter
1
,
tp
,
0
,
LOCATION_EXTRA
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
s
.
spfilter
,
tp
,
0
,
LOCATION_EXTRA
,
1
,
nil
,
e
,
tp
)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
1
))
then
Duel
.
Hint
(
HINT_CARD
,
0
,
id
)
local
g1
=
Duel
.
GetMatchingGroup
(
s
.
spfilter1
,
tp
,
0
,
LOCATION_EXTRA
,
nil
)
if
g1
:
GetCount
()
>
0
then
Duel
.
ConfirmCards
(
tp
,
g1
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g2
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
spfilter2
,
tp
,
0
,
LOCATION_EXTRA
,
1
,
1
,
nil
,
e
,
tp
)
if
g2
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g2
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
Duel
.
ShuffleExtra
(
1
-
tp
)
end
end
end
s
.
skipop
(
e
,
tp
)
end
function
s
.
skipop
(
e
,
tp
)
local
g1
=
Duel
.
GetMatchingGroup
(
s
.
spfilter1
,
tp
,
0
,
LOCATION_EXTRA
,
nil
)
if
g1
:
GetCount
()
>
0
then
for
tc
in
aux
.
Next
(
g1
)
do
tc
:
ResetFlagEffect
(
id
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
spfilter
,
tp
,
0
,
LOCATION_EXTRA
,
nil
,
e
,
tp
)
Duel
.
ConfirmCards
(
tp
,
g
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
g
:
FilterSelect
(
tp
,
s
.
spfilter
,
1
,
1
,
nil
,
e
,
tp
)
if
#
sg
>
0
then
Duel
.
SpecialSummon
(
sg
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
end
Duel
.
ShuffleExtra
(
1
-
tp
)
end
end
\ No newline at end of file
expansions/script/c1300910.lua
View file @
6acc04ad
...
...
@@ -50,13 +50,13 @@ function s.fcon(con)
return
e
:
GetHandler
():
GetFlagEffect
(
id
)
==
0
and
con
(
e
,
tp
,
...
)
end
end
function
s
.
syn
CheckA
dditional
(
c
,
level
)
function
s
.
syn
checka
dditional
(
c
,
level
)
return
function
(
g
)
local
sum
=
g
:
GetSum
(
Card
.
GetLevel
)
return
sum
<=
level
end
end
function
s
.
syn
C
heck
(
g
,
tp
,
c
,
level
)
function
s
.
syn
c
heck
(
g
,
tp
,
c
,
level
)
local
sum
=
g
:
GetSum
(
Card
.
GetLevel
)
return
sum
==
level
and
c
:
IsSynchroSummonable
(
nil
,
g
)
end
...
...
@@ -78,8 +78,8 @@ function s.scop(e,tp,eg,ep,ev,re,r,rp)
if
tc
then
local
level
=
tc
:
GetLevel
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SMATERIAL
)
aux
.
GCheckAdditional
=
s
.
syn
CheckA
dditional
(
tc
,
level
)
local
sg
=
mg
:
SelectSubGroup
(
tp
,
s
.
syn
C
heck
,
false
,
2
,
#
mg
,
tp
,
tc
,
level
)
aux
.
GCheckAdditional
=
s
.
syn
checka
dditional
(
tc
,
level
)
local
sg
=
mg
:
SelectSubGroup
(
tp
,
s
.
syn
c
heck
,
false
,
2
,
#
mg
,
tp
,
tc
,
level
)
aux
.
GCheckAdditional
=
nil
if
sg
then
sg
:
KeepAlive
()
...
...
expansions/script/c16110003.lua
View file @
6acc04ad
...
...
@@ -11,7 +11,7 @@ function cm.initial_effect(c)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetCountLimit
(
1
,
m
)
e3
:
SetCountLimit
(
2
,
m
)
e3
:
SetCondition
(
cm
.
descon
)
e3
:
SetTarget
(
cm
.
destg
)
e3
:
SetOperation
(
cm
.
desop
)
...
...
expansions/script/c16401240.lua
View file @
6acc04ad
...
...
@@ -18,6 +18,7 @@ function s.initial_effect(c)
e2
:
SetCategory
(
CATEGORY_DESTROY
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_ATTACK_ANNOUNCE
)
e2
:
SetCountLimit
(
1
,
id
+
1
)
e2
:
SetTarget
(
s
.
destg
)
e2
:
SetOperation
(
s
.
desop
)
c
:
RegisterEffect
(
e2
)
...
...
expansions/script/c16401560.lua
View file @
6acc04ad
...
...
@@ -40,6 +40,9 @@ function s.initial_effect(c)
e3
:
SetOperation
(
s
.
operation3
)
c
:
RegisterEffect
(
e3
)
end
function
s
.
mfilter
(
c
)
return
c
:
IsFusionSetCard
(
0x5ce1
)
and
c
:
IsFusionAttribute
(
ATTRIBUTE_LIGHT
)
end
function
s
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
IsActiveType
(
TYPE_SPELL
)
and
rp
==
1
-
tp
end
...
...
expansions/script/c5012606.lua
View file @
6acc04ad
...
...
@@ -30,7 +30,7 @@ function s.filter1(c,e,tp)
return
c
.
MoJin
and
c
:
IsAbleToRemoveAsCost
()
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
c
)
>
0
and
Duel
.
IsExistingMatchingCard
(
s
.
filter2
,
tp
,
LOCATION_GRAVE
+
LOCATION_ONFIELD
,
LOCATION_GRAVE
+
LOCATION_ONFIELD
,
5
,
c
)
and
c
:
IsFaceup
()
end
function
s
.
filter2
(
c
)
return
c
.
MoJin
and
c
:
IsAbleToRemoveAsCost
()
and
c
:
IsFaceup
()
and
c
:
IsFaceup
()
return
c
.
MoJin
and
c
:
IsAbleToRemoveAsCost
()
and
c
:
IsFaceup
()
end
function
s
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
...
...
@@ -40,7 +40,7 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
sg
=
g1
:
Clone
()
sg
:
AddCard
(
c
)
local
g2
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter2
,
tp
,
LOCATION_GRAVE
+
LOCATION_ONFIELD
,
LOCATION_GRAVE
+
LOCATION_ONFIELD
,
5
,
5
,
sg
,
e
,
tp
)
local
g2
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
filter2
,
tp
,
LOCATION_GRAVE
+
LOCATION_ONFIELD
,
LOCATION_GRAVE
+
LOCATION_ONFIELD
,
4
,
4
,
sg
,
e
,
tp
)
g1
:
Merge
(
g2
)
Duel
.
Remove
(
g1
,
POS_FACEUP
,
REASON_COST
)
end
...
...
expansions/script/c79100260.lua
View file @
6acc04ad
--律法塔魂的贤王 法墨特
local
m
=
79100260
local
cm
=
c79100260
function
s
.
initial_effect
(
c
)
function
cm
.
initial_effect
(
c
)
--fusion summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_FUSION_SUMMON
)
...
...
@@ -9,10 +9,10 @@ function s.initial_effect(c)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetHintTiming
(
0
,
TIMING_MAIN_END
)
e1
:
SetCountLimit
(
1
,
id
+
o
)
e1
:
SetCondition
(
s
.
condition
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
operation
)
e1
:
SetCountLimit
(
1
,
m
)
e1
:
SetCondition
(
cm
.
condition
)
e1
:
SetTarget
(
cm
.
target
)
e1
:
SetOperation
(
cm
.
operation
)
c
:
RegisterEffect
(
e1
)
--
local
e2
=
Effect
.
CreateEffect
(
c
)
...
...
@@ -26,18 +26,18 @@ function s.initial_effect(c)
e2
:
SetOperation
(
cm
.
spop2
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
cm
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
return
ph
==
PHASE_MAIN1
or
ph
==
PHASE_MAIN2
end
function
s
.
filter1
(
c
,
e
)
function
cm
.
filter1
(
c
,
e
)
return
c
:
IsOnField
()
and
not
c
:
IsImmuneToEffect
(
e
)
end
function
s
.
filter2
(
c
,
e
,
tp
,
m
,
f
,
gc
,
chkf
)
function
cm
.
filter2
(
c
,
e
,
tp
,
m
,
f
,
gc
,
chkf
)
return
c
:
IsType
(
TYPE_FUSION
)
and
(
c
:
IsSetCard
(
0x3a11
)
or
Duel
.
GetTurnPlayer
()
==
tp
)
and
(
not
f
or
f
(
c
))
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_FUSION
,
tp
,
false
,
false
)
and
c
:
CheckFusionMaterial
(
m
,
gc
,
chkf
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
cm
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
local
chkf
=
tp
...
...
@@ -56,7 +56,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
s
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
cm
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
chkf
=
tp
if
not
c
:
IsRelateToEffect
(
e
)
or
c
:
IsImmuneToEffect
(
e
)
then
return
end
...
...
expansions/script/c79103020.lua
View file @
6acc04ad
...
...
@@ -4,93 +4,96 @@ function s.initial_effect(c)
--fusion material
c
:
EnableReviveLimit
()
aux
.
AddFusionProcCode2FunRep
(
c
,
79103130
,
79103000
,
aux
.
FilterBoolFunction
(
Card
.
IsFusionSetCard
,
0x5a13
),
1
,
127
,
true
,
true
)
--spsummon success
--attack
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetCondition
(
s
.
sumcon
)
e1
:
SetOperation
(
s
.
sucop
)
c
:
RegisterEffect
(
e1
)
--disable
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
82734805
,
0
))
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetCondition
(
s
.
con
)
e2
:
SetTarget
(
s
.
tg
)
e2
:
SetOperation
(
s
.
op
)
e2
:
SetDescription
(
1131
)
e2
:
SetCategory
(
CATEGORY_DISABLE
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCondition
(
s
.
discon
)
e2
:
SetTarget
(
s
.
distg
)
e2
:
SetOperation
(
s
.
disop
)
c
:
RegisterEffect
(
e2
)
--
material check
--
indes
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
E
FFECT_MATERIAL_CHECK
)
e3
:
Set
Value
(
s
.
valcheck
)
e3
:
Set
LabelObject
(
e2
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
E
VENT_SPSUMMON_SUCCESS
)
e3
:
Set
Condition
(
s
.
e3con
)
e3
:
Set
Operation
(
s
.
e3op
)
c
:
RegisterEffect
(
e3
)
end
function
s
.
valcheck
(
e
,
c
)
local
ct
=
e
:
GetHandler
():
GetMaterial
():
GetClassCount
(
Card
.
GetCode
)
e
:
GetLabelObject
():
SetLabel
(
ct
)
end
function
s
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
sumcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_FUSION
)
end
function
s
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
ct
=
e
:
GetLabel
()
local
con3
,
con5
,
con8
,
con10
=
nil
,
nil
,
nil
,
nil
if
ct
>=
3
then
con3
=
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_EXTRA
,
0
,
3
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToGrave
,
tp
,
0
,
LOCATION_EXTRA
,
3
,
nil
)
end
if
ct
>=
5
then
con5
=
Duel
.
IsPlayerCanDiscardDeck
(
tp
,
3
)
and
Duel
.
IsPlayerCanDiscardDeck
(
1
-
tp
,
3
)
end
if
ct
>=
8
then
con8
=
Duel
.
IsExistingMatchingCard
(
nil
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
nil
,
tp
,
0
,
LOCATION_REMOVED
,
1
,
nil
)
end
if
ct
>=
10
then
con10
=
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_HAND
,
LOCATION_HAND
)
>
0
end
if
chk
==
0
then
return
con3
or
con5
or
con8
or
con10
end
local
cat
=
0
if
ct
>=
3
or
ct
>=
8
then
cat
=
cat
+
CATEGORY_TOGRAVE
end
if
ct
>=
5
then
cat
=
cat
+
CATEGORY_DECKDES
end
if
ct
>=
10
then
cat
=
cat
+
CATEGORY_HANDES
end
e
:
SetCategory
(
cat
)
function
s
.
sucop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SET_BASE_ATTACK
)
e1
:
SetValue
(
c
:
GetMaterialCount
()
*
400
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_DISABLE
)
c
:
RegisterEffect
(
e1
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_SET_BASE_DEFENSE
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ct
=
e
:
GetLabel
()
if
ct
>=
3
then
local
g1
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_EXTRA
,
0
,
nil
)
local
sg1
=
nil
if
g1
:
GetCount
()
>=
3
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
sg1
=
g1
:
Select
(
tp
,
3
,
3
,
nil
)
else
sg1
=
g1
end
local
g2
=
Duel
.
GetMatchingGroup
(
Card
.
IsAbleToGrave
,
tp
,
0
,
LOCATION_EXTRA
,
nil
)
local
sg2
=
nil
if
g2
:
GetCount
()
>=
3
then
Duel
.
Hint
(
HINT_SELECTMSG
,
1
-
tp
,
HINTMSG_TOGRAVE
)
sg2
=
g2
:
Select
(
1
-
tp
,
3
,
3
,
nil
)
else
sg2
=
g2
end
sg1
:
Merge
(
sg2
)
if
sg1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
sg1
,
REASON_EFFECT
)
end
end
if
ct
>=
5
then
Duel
.
BreakEffect
()
Duel
.
DiscardDeck
(
tp
,
3
,
REASON_EFFECT
)
Duel
.
DiscardDeck
(
1
-
tp
,
3
,
REASON_EFFECT
)
function
s
.
discon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
ep
~=
tp
and
re
:
IsActiveType
(
TYPE_MONSTER
+
TYPE_SPELL
+
TYPE_TRAP
)
and
Duel
.
IsChainDisablable
(
ev
)
end
function
s
.
distg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DISABLE
,
eg
,
1
,
0
,
0
)
end
function
s
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
d
=
Duel
.
TossDice
(
tp
,
1
)
if
d
==
6
then
Duel
.
NegateEffect
(
ev
)
end
if
ct
>=
8
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g1
=
Duel
.
SelectMatchingCard
(
tp
,
nil
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
3
,
nil
)
Duel
.
Hint
(
HINT_SELECTMSG
,
1
-
tp
,
HINTMSG_TOGRAVE
)
local
g2
=
Duel
.
SelectMatchingCard
(
1
-
tp
,
nil
,
1
-
tp
,
LOCATION_REMOVED
,
0
,
1
,
3
,
nil
)
g1
:
Merge
(
g2
)
if
g1
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
+
REASON_RETURN
)
end
function
s
.
e3con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
IsSummonType
(
SUMMON_TYPE_FUSION
)
and
c
:
GetMaterialCount
()
>=
4
end
function
s
.
e3op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_TOSS_DICE_NEGATE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetCondition
(
s
.
dicecon
)
e2
:
SetOperation
(
s
.
diceop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
dicecon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
GetFlagEffect
(
id
)
==
0
end
function
s
.
diceop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
cc
=
Duel
.
GetCurrentChain
()
local
cid
=
Duel
.
GetChainInfo
(
cc
,
CHAININFO_CHAIN_ID
)
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
1
))
then
Duel
.
Hint
(
HINT_CARD
,
0
,
id
)
e
:
GetHandler
():
RegisterFlagEffect
(
id
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
,
0
,
1
)
local
dc
=
{
Duel
.
GetDiceResult
()}
local
ac
=
1
local
ct
=
(
ev
&
0xff
)
+
(
ev
>>
16
&
0xff
)
if
ct
>
1
then
--choose the index of results
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
aux
.
Stringid
(
id
,
2
))
local
val
,
idx
=
Duel
.
AnnounceNumber
(
tp
,
table.unpack
(
aux
.
idx_table
,
1
,
ct
))
ac
=
idx
+
1
end
end
if
ct
>=
10
then
Duel
.
BreakEffect
()
local
g1
=
Duel
.
GetFieldGroup
(
tp
,
LOCATION_HAND
,
LOCATION_HAND
)
Duel
.
SendtoGrave
(
g1
,
REASON_EFFECT
)
dc
[
ac
]
=
7
Duel
.
SetDiceResult
(
table.unpack
(
dc
))
end
end
\ No newline at end of file
expansions/script/c79103030.lua
View file @
6acc04ad
--虚星舰组件 流水推进器
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
c
:
EnableReviveLimit
()
aux
.
AddXyzProcedure
(
c
,
nil
,
1
,
2
,
nil
,
nil
,
99
)
--
tograve
--
fus
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
1174075
,
0
))
e1
:
SetCategory
(
CATEGORY_TOGRAVE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCountLimit
(
1
,
1174075
)
e1
:
SetCondition
(
s
.
tgcon
)
e1
:
SetTarget
(
s
.
tgtg
)
e1
:
SetOperation
(
s
.
tgop
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetCode
(
id
)
e1
:
SetRange
(
LOCATION_MZONE
)
c
:
RegisterEffect
(
e1
)
--
extra material
--
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
E
FFECT_OVERLAY_RITUAL
_MATERIAL
)
e2
:
SetProperty
(
EFFECT_FLAG_
SINGLE_RANGE
)
e2
:
Set
Range
(
LOCATION_MZONE
)
e2
:
Set
Value
(
1
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
E
VENT_BE
_MATERIAL
)
e2
:
SetProperty
(
EFFECT_FLAG_
EVENT_PLAYER
)
e2
:
Set
Condition
(
s
.
indcon
)
e2
:
Set
Operation
(
s
.
indop
)
c
:
RegisterEffect
(
e2
)
--
negat
e
--
tograv
e
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
1174075
,
1
))
e3
:
SetCategory
(
CATEGORY_NEGATE
+
CATEGORY_DESTROY
)
e3
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetCode
(
EVENT_CHAINING
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
1
,
1174076
)
e3
:
SetCondition
(
s
.
discon
)
e3
:
SetCost
(
s
.
discost
)
e3
:
SetTarget
(
s
.
distg
)
e3
:
SetOperation
(
s
.
disop
)
e3
:
SetDescription
(
1191
)
e3
:
SetCategory
(
CATEGORY_TOGRAVE
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetCondition
(
s
.
tgcon
)
e3
:
SetTarget
(
s
.
tgtg
)
e3
:
SetOperation
(
s
.
tgop
)
c
:
RegisterEffect
(
e3
)
if
not
s
.
global_check
then
s
.
global_check
=
true
GM_hack_fusion_check
=
Card
.
CheckFusionMaterial
function
Card
.
CheckFusionMaterial
(
card
,
Group_fus
,
Card_g
,
int_chkf
,
not_mat
)
local
exc
=
Duel
.
GetMatchingGroup
(
s
.
getexc
,
int_chkf
,
LOCATION_MZONE
,
0
,
nil
)
local
exg
=
Group
.
CreateGroup
()
if
exc
:
GetCount
()
>
0
then
for
tc
in
aux
.
Next
(
exc
)
do
local
exg_temp
=
tc
:
GetOverlayGroup
()
if
exg_temp
:
GetCount
()
>
0
then
exg
:
Merge
(
exg_temp
)
end
end
end
if
card
:
IsSetCard
(
0xa13
)
and
exg
:
GetCount
()
>
0
then
Group_fus
:
Merge
(
exg
)
end
return
GM_hack_fusion_check
(
card
,
Group_fus
,
Card_g
,
int_chkf
,
not_mat
)
end
end
end
function
s
.
getexc
(
c
)
return
c
:
IsHasEffect
(
id
)
and
c
:
IsFaceup
()
end
function
s
.
indcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
r
==
REASON_FUSION
end
function
s
.
indop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
rc
=
c
:
GetReasonCard
()
local
e1
=
Effect
.
CreateEffect
(
rc
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e1
:
SetCategory
(
CATEGORY_DISABLE
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCondition
(
aux
.
dscon
)
e1
:
SetCountLimit
(
1
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
rc
:
RegisterEffect
(
e1
,
true
)
if
not
rc
:
IsType
(
TYPE_EFFECT
)
then
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_ADD_TYPE
)
e2
:
SetValue
(
TYPE_EFFECT
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
rc
:
RegisterEffect
(
e2
,
true
)
end
rc
:
RegisterFlagEffect
(
id
+
o
,
RESET_EVENT
+
RESETS_STANDARD
,
EFFECT_FLAG_CLIENT_HINT
,
1
,
0
,
aux
.
Stringid
(
id
,
1
))
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsFaceup
()
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsFaceup
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DISABLE
,
g
,
1
,
0
,
0
)
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
then
Duel
.
NegateRelatedChain
(
tc
,
RESET_TURN_SET
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_DISABLE
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e3
:
SetValue
(
RESET_TURN_SET
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e3
)
end
end
function
s
.
tgcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_XYZ
)
end
function
s
.
tgfilter
(
c
)
return
c
:
IsSetCard
(
0x
154
)
and
c
:
IsAbleToGrave
(
)
return
c
:
IsSetCard
(
0x
a13
)
and
c
:
IsAbleToGrave
()
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
s
.
tgtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
...
...
@@ -53,30 +123,4 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
end
function
s
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_RITUAL
)
and
c
:
IsRace
(
RACE_MACHINE
)
end
function
s
.
discon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
not
e
:
GetHandler
():
IsStatus
(
STATUS_BATTLE_DESTROYED
)
and
Duel
.
IsChainNegatable
(
ev
)
and
ep
==
1
-
tp
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
and
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
s
.
discost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
CheckRemoveOverlayCard
(
tp
,
1
,
REASON_COST
)
end
e
:
GetHandler
():
RemoveOverlayCard
(
tp
,
1
,
1
,
REASON_COST
)
end
function
s
.
distg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_NEGATE
,
eg
,
1
,
0
,
0
)
if
re
:
GetHandler
():
IsDestructable
()
and
re
:
GetHandler
():
IsRelateToEffect
(
re
)
then
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
eg
,
1
,
0
,
0
)
end
end
function
s
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
NegateActivation
(
ev
)
and
re
:
GetHandler
():
IsRelateToEffect
(
re
)
then
Duel
.
Destroy
(
eg
,
REASON_EFFECT
)
end
end
end
\ No newline at end of file
expansions/script/c79103040.lua
View file @
6acc04ad
...
...
@@ -5,44 +5,54 @@ function s.initial_effect(c)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetRange
(
LOCATION_HAND
+
LOCATION_GRAVE
)
e1
:
SetCountLimit
(
1
,
id
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetCondition
(
s
.
spcon
)
c
:
RegisterEffect
(
e1
)
--
position
--
destroy
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_POSITION
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e2
:
SetCategory
(
CATEGORY_DESTROY
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_FREE_CHAIN
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e2
:
SetTarget
(
s
.
postg
)
e2
:
SetOperation
(
s
.
posop
)
e2
:
SetTarget
(
s
.
destg
)
e2
:
SetOperation
(
s
.
desop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e3
)
end
function
s
.
cfilter
(
c
)
return
c
:
Is
AttackPos
()
and
c
:
IsRace
(
RACE_INSECT
)
return
c
:
Is
Faceup
()
and
c
:
IsSetCard
(
0xa13
)
end
function
s
.
spcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
local
tp
=
c
:
GetControler
()
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
function
s
.
po
stg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
Is
Location
(
LOCATION_MZONE
)
and
chkc
:
IsCanChangePosition
()
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsCanChangePosition
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_
POSCHANGE
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsCanChangePosition
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_
POSITION
,
g
,
1
,
0
,
0
)
function
s
.
de
stg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
Is
OnField
()
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
nil
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_
DESTROY
)
local
g
=
Duel
.
SelectTarget
(
tp
,
aux
.
TRUE
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_
DESTROY
,
g
,
1
,
0
,
0
)
end
function
s
.
posop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
fufilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0xa13
)
and
c
:
IsType
(
TYPE_FUSION
)
end
function
s
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
ChangePosition
(
tc
,
POS_FACEUP_DEFENSE
,
POS_FACEUP_ATTACK
,
POS_FACEUP_ATTACK
,
POS_FACEUP_ATTACK
)
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
>
0
then
if
Duel
.
IsExistingMatchingCard
(
s
.
fufilter
,
tp
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
0
,
1
,
nil
)
and
Duel
.
GetFieldGroupCount
(
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
)
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
1
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
TRUE
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
sg
)
Duel
.
Destroy
(
sg
,
REASON_EFFECT
)
end
end
end
end
\ No newline at end of file
expansions/script/c79103050.lua
View file @
6acc04ad
...
...
@@ -3,69 +3,80 @@ local s,id,o=GetID()
function
s
.
initial_effect
(
c
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
)
)
e1
:
Set
Type
(
EFFECT_TYPE_FIELD
)
e1
:
Set
Code
(
EFFECT_SPSUMMON_PROC
)
e1
:
Set
Property
(
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
id
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetDescription
(
1118
)
e1
:
Set
Category
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
Set
Type
(
EFFECT_TYPE_QUICK_O
)
e1
:
Set
Code
(
EVENT_FREE_CHAIN
)
e1
:
SetRange
(
LOCATION_HAND
+
LOCATION_GRAVE
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetCondition
(
s
.
spcon
)
e1
:
SetTarget
(
s
.
sptg
)
e1
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e1
)
--
to deck
--
Destroy
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
)
)
e2
:
SetCategory
(
CATEGORY_
TODECK
+
CATEGORY_REMOVE
)
e2
:
SetDescription
(
1101
)
e2
:
SetCategory
(
CATEGORY_
DESTROY
+
CATEGORY_REMOVE
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetTarget
(
s
.
td
tg
)
e2
:
SetOperation
(
s
.
td
op
)
e2
:
SetCountLimit
(
1
,
id
+
1
)
e2
:
SetTarget
(
s
.
des
tg
)
e2
:
SetOperation
(
s
.
des
op
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e3
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e4
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e4
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e4
:
SetOperation
(
s
.
checkop
)
c
:
RegisterEffect
(
e4
)
if
not
s
.
global_check
then
s
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_TO_GRAVE
)
ge1
:
SetCondition
(
s
.
regcon
)
ge1
:
SetOperation
(
s
.
regop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
end
function
s
.
rfilter
(
c
,
tp
)
return
c
:
IsSetCard
(
0x5a13
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
not
c
:
IsReason
(
REASON_RETURN
)
end
function
s
.
filter
(
c
)
return
(
c
:
IsLevel
(
2
)
and
c
:
IsType
(
TYPE_SYNCHRO
)
or
c
:
IsLink
(
1
)
and
c
:
IsType
(
TYPE_LINK
))
and
c
:
IsFaceup
()
function
s
.
regcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
s
.
rfilter
,
1
,
nil
)
end
function
s
.
regop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
for
tc
in
aux
.
Next
(
eg
)
do
if
s
.
rfilter
(
tc
)
then
Duel
.
RegisterFlagEffect
(
tc
:
GetControler
(),
id
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
end
end
function
s
.
spcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
return
Duel
.
GetLocationCount
(
c
:
GetControler
(),
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
s
.
filter
,
c
:
GetControler
(),
LOCATION_MZONE
,
0
,
1
,
nil
)
return
Duel
.
GetFlagEffect
(
tp
,
id
)
>
0
end
function
s
.
tdtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsControler
(
1
-
tp
)
and
chkc
:
IsLocation
(
LOCATION_GRAVE
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
Card
.
IsAbleToDeck
,
tp
,
0
,
LOCATION_GRAVE
,
1
,
nil
)
end
if
e
:
GetHandler
():
GetFlagEffect
(
id
)
>
0
then
e
:
SetLabel
(
1
)
else
e
:
SetLabel
(
0
)
function
s
.
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
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
aux
.
NecroValleyFilter
()(
c
)
then
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
s
.
destg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
aux
.
TRUE
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TARGET
)
local
g
=
Duel
.
SelectTarget
(
tp
,
Card
.
IsAbleToDeck
,
tp
,
0
,
LOCATION_GRAV
E
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_
TODECK
,
g
,
1
,
0
,
0
)
local
g
=
Duel
.
SelectTarget
(
tp
,
aux
.
TRUE
,
tp
,
LOCATION_MZONE
,
LOCATION_MZON
E
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_
DESTROY
,
g
,
1
,
0
,
0
)
end
function
s
.
td
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
des
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
not
(
tc
:
IsRelateToEffect
(
e
)
and
aux
.
NecroValleyFilter
()(
tc
))
then
return
end
local
b1
=
tc
:
IsAbleToDeck
()
local
b2
=
e
:
GetLabel
()
==
1
and
tc
:
IsAbleToRemove
()
if
b1
and
(
not
b2
or
not
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
2
)))
then
Duel
.
SendtoDeck
(
tc
,
nil
,
SEQ_DECKSHUFFLE
,
REASON_EFFECT
)
elseif
b2
then
if
not
tc
:
IsRelateToEffect
(
e
)
then
return
end
if
not
tc
:
IsAbleToRemove
()
or
not
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
2
))
then
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
elseif
tc
:
IsAbleToRemove
()
then
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
s
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
re
then
return
end
if
re
:
IsActiveType
(
TYPE_MONSTER
)
and
re
:
GetHandler
():
IsType
(
TYPE_SYNCHRO
)
then
e
:
GetHandler
():
RegisterFlagEffect
(
id
,
RESET_EVENT
+
RESETS_STANDARD
-
RESET_TOFIELD
-
RESET_TEMP_REMOVE
,
0
,
1
)
end
end
\ No newline at end of file
expansions/script/c79103070.lua
View file @
6acc04ad
...
...
@@ -4,93 +4,142 @@ function s.initial_effect(c)
--special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_FUSION_SUMMON
+
CATEGORY_TODECK
+
CATEGORY_DRAW
+
CATEGORY_DESTROY
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_END_PHASE
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetCost
(
s
.
sp
cost
)
e1
:
SetTarget
(
s
.
sp
tg
)
e1
:
SetOperation
(
s
.
sp
op
)
e1
:
SetCost
(
s
.
e1
cost
)
e1
:
SetTarget
(
s
.
e1
tg
)
e1
:
SetOperation
(
s
.
e1
op
)
c
:
RegisterEffect
(
e1
)
--buff
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e2
:
SetValue
(
s
.
atkval
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
c
:
RegisterEffect
(
e3
)
--set
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
2
))
e4
:
SetType
(
EFFECT_TYPE_IGNITION
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetCountLimit
(
1
,
id
+
o
)
e4
:
SetCost
(
aux
.
bfgcost
)
e4
:
SetTarget
(
s
.
settg
)
e4
:
SetOperation
(
s
.
setop
)
c
:
RegisterEffect
(
e4
)
end
function
s
.
sp
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
s
.
e1
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
not
e
:
GetHandler
():
IsPublic
()
end
end
function
s
.
spfilter
(
c
,
tp
,
chk
)
return
c
:
IsSetCard
(
0x1c1
)
and
c
:
IsAllTypes
(
TYPE_CONTINUOUS
|
TYPE_TRAP
)
and
c
:
IsFaceup
()
and
c
:
IsAbleToHand
()
and
(
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
or
not
chk
)
function
s
.
tdfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x5a13
)
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
spfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
,
tp
,
true
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
c
,
1
,
tp
,
LOCATION_HAND
)
function
s
.
filter1
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsCanBeFusionMaterial
()
and
c
:
IsAbleToRemove
()
end
function
s
.
filter2
(
c
,
e
,
tp
,
m
,
f
,
chkf
)
return
c
:
IsType
(
TYPE_FUSION
)
and
c
:
IsSetCard
(
0xa13
)
and
(
not
f
or
f
(
c
))
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_FUSION
,
tp
,
false
,
false
)
and
c
:
CheckFusionMaterial
(
m
,
nil
,
chkf
)
end
function
s
.
filter3
(
c
,
e
)
return
c
:
IsAbleToRemove
()
and
not
c
:
IsImmuneToEffect
(
e
)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
fufilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_FUSION
)
and
c
:
IsSetCard
(
0xa13
)
end
function
s
.
e1tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
rg
=
nil
if
Duel
.
IsExistingMatchingCard
(
s
.
spfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
,
tp
,
true
)
then
rg
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
spfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
,
tp
,
true
)
else
rg
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
spfilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
,
tp
,
false
)
local
b1
=
Duel
.
IsExistingMatchingCard
(
s
.
tdfilter
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
nil
)
and
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
local
chkf
=
tp
local
mg1
=
Duel
.
GetFusionMaterial
(
tp
)
local
mg2
=
Duel
.
GetMatchingGroup
(
s
.
filter1
,
tp
,
0
,
LOCATION_GRAVE
,
nil
)
if
#
mg2
>
0
then
mg1
:
Merge
(
mg2
)
end
if
rg
and
rg
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
rg
)
if
Duel
.
SendtoHand
(
rg
,
nil
,
REASON_EFFECT
)
~=
0
and
rg
:
FilterCount
(
Card
.
IsLocation
,
nil
,
LOCATION_HAND
)
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
then
Duel
.
SpecialSummon
(
e
:
GetHandler
(),
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
local
b2
=
Duel
.
IsExistingMatchingCard
(
s
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
mg1
,
nil
,
chkf
)
if
not
b2
then
local
ce
=
Duel
.
GetChainMaterial
(
tp
)
if
ce
~=
nil
then
local
fgroup
=
ce
:
GetTarget
()
local
mg3
=
fgroup
(
ce
,
e
,
tp
)
local
mf
=
ce
:
GetValue
()
b2
=
Duel
.
IsExistingMatchingCard
(
s
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
mg3
,
mf
,
chkf
)
end
end
local
b3
=
Duel
.
IsExistingMatchingCard
(
s
.
fufilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
Duel
.
GetFieldGroupCount
(
tp
,
0
,
LOCATION_MZONE
)
>
0
if
chk
==
0
then
return
(
b1
or
b2
or
b3
)
and
Duel
.
GetFlagEffect
(
tp
,
id
)
<
3
end
Duel
.
RegisterFlagEffect
(
tp
,
id
,
0
,
0
,
0
)
end
function
s
.
atkval
(
e
,
c
)
local
g
=
Duel
.
GetMatchingGroup
(
s
.
bfilter
,
c
:
GetControler
(),
LOCATION_MZONE
,
0
,
c
)
return
g
:
GetClassCount
(
Card
.
GetCode
)
*
700
end
function
s
.
bfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x1c1
)
end
function
s
.
setfilter
(
c
)
return
c
:
IsAllTypes
(
TYPE_TRAP
+
TYPE_CONTINUOUS
)
and
c
:
IsSSetable
()
end
function
s
.
settg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
setfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
end
function
s
.
setop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
setfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
)
local
tc
=
g
:
GetFirst
()
if
tc
and
Duel
.
SSet
(
tp
,
tc
)
~=
0
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
3
))
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SET_AVAILABLE
)
e1
:
SetCode
(
EFFECT_TRAP_ACT_IN_SET_TURN
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
function
s
.
e1op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
c
=
e
:
GetHandler
()
local
b1
=
Duel
.
IsExistingMatchingCard
(
s
.
tdfilter
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
nil
)
and
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
local
chkf
=
tp
local
mg1
=
Duel
.
GetFusionMaterial
(
tp
)
local
mg2
=
Duel
.
GetMatchingGroup
(
s
.
filter1
,
tp
,
0
,
LOCATION_GRAVE
,
nil
)
if
#
mg2
>
0
then
mg1
:
Merge
(
mg2
)
end
local
b2
=
Duel
.
IsExistingMatchingCard
(
s
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
mg1
,
nil
,
chkf
)
if
not
b2
then
local
ce
=
Duel
.
GetChainMaterial
(
tp
)
if
ce
~=
nil
then
local
fgroup
=
ce
:
GetTarget
()
local
mg3
=
fgroup
(
ce
,
e
,
tp
)
local
mf
=
ce
:
GetValue
()
b2
=
Duel
.
IsExistingMatchingCard
(
s
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
mg3
,
mf
,
chkf
)
end
end
local
b3
=
Duel
.
IsExistingMatchingCard
(
s
.
fufilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
Duel
.
GetFieldGroupCount
(
tp
,
0
,
LOCATION_MZONE
)
>
0
local
op
=
aux
.
SelectFromOptions
(
tp
,
{
b1
,
aux
.
Stringid
(
id
,
1
)},
{
b2
,
aux
.
Stringid
(
id
,
2
)},
{
b3
,
aux
.
Stringid
(
id
,
3
)})
if
op
==
1
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
tdfilter
,
tp
,
LOCATION_REMOVED
,
0
,
1
,
5
,
nil
)
if
#
sg
>
0
then
Duel
.
HintSelection
(
sg
)
if
Duel
.
SendtoDeck
(
sg
,
nil
,
2
,
REASON_EFFECT
)
>
0
and
sg
:
IsExists
(
Card
.
IsLocation
,
1
,
nil
,
LOCATION_DECK
+
LOCATION_EXTRA
)
then
Duel
.
BreakEffect
()
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
end
if
op
==
2
then
local
mg1
=
Duel
.
GetFusionMaterial
(
tp
):
Filter
(
s
.
filter3
,
nil
,
e
)
local
mg2
=
Duel
.
GetMatchingGroup
(
s
.
filter1
,
tp
,
0
,
LOCATION_GRAVE
,
nil
)
if
#
mg2
>
0
then
mg1
:
Merge
(
mg2
)
end
local
sg1
=
Duel
.
GetMatchingGroup
(
s
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
e
,
tp
,
mg1
,
nil
,
chkf
)
local
mg3
=
nil
local
sg2
=
nil
local
ce
=
Duel
.
GetChainMaterial
(
tp
)
if
ce
~=
nil
then
local
fgroup
=
ce
:
GetTarget
()
mg3
=
fgroup
(
ce
,
e
,
tp
)
local
mf
=
ce
:
GetValue
()
sg2
=
Duel
.
GetMatchingGroup
(
s
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
e
,
tp
,
mg3
,
mf
,
chkf
)
end
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
local
mat1
=
Duel
.
SelectFusionMaterial
(
tp
,
tc
,
mg1
,
nil
,
chkf
)
tc
:
SetMaterial
(
mat1
)
Duel
.
Remove
(
mat1
,
POS_FACEUP
,
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
,
mg3
,
nil
,
chkf
)
local
fop
=
ce
:
GetOperation
()
fop
(
ce
,
e
,
tp
,
tc
,
mat2
)
end
tc
:
CompleteProcedure
()
end
end
if
op
==
3
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
fufilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
if
#
sg
>
0
then
Duel
.
HintSelection
(
sg
)
if
Duel
.
Destroy
(
sg
,
REASON_EFFECT
)
>
0
then
local
dg
=
Duel
.
GetMatchingGroup
(
aux
.
TRUE
,
tp
,
0
,
LOCATION_MZONE
,
nil
)
if
#
dg
>
0
then
Duel
.
Destroy
(
dg
,
REASON_EFFECT
)
end
end
end
end
end
\ No newline at end of file
expansions/script/c79103080.lua
View file @
6acc04ad
...
...
@@ -3,6 +3,7 @@ local s,id,o=GetID()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
1118
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
...
...
@@ -10,41 +11,31 @@ function s.initial_effect(c)
e1
:
SetCost
(
s
.
cost
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
e1
:
SetLabel
(
0
)
c
:
RegisterEffect
(
e1
)
end
function
s
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
e
:
SetLabel
(
100
)
if
chk
==
0
then
return
true
end
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
costfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
costfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SendtoGrave
(
sg
,
REASON_COST
)
local
code
=
sg
:
GetFirst
():
GetCode
()
e
:
SetLabel
(
code
)
end
function
s
.
costfilter
(
c
,
e
,
tp
)
return
c
:
IsFaceup
()
and
c
:
GetOriginalLevel
()
>
0
and
Duel
.
IsExistingMatchingCard
(
s
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
c
,
e
,
tp
)
and
Duel
.
GetMZoneCount
(
tp
,
c
)
>
0
return
c
:
IsSetCard
(
0x5a13
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToGrave
()
and
Duel
.
IsExistingMatchingCard
(
s
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
c
,
c
:
GetCode
(),
e
,
tp
)
end
function
s
.
spfilter
(
c
,
tc
,
e
,
tp
)
return
c
:
GetOriginalLevel
()
==
tc
:
GetOriginalLevel
()
-
1
and
c
:
GetOriginalRace
()
==
tc
:
GetOriginalRace
()
and
c
:
GetOriginalAttribute
()
==
tc
:
GetOriginalAttribute
()
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
function
s
.
spfilter
(
c
,
code
,
e
,
tp
)
return
c
:
IsCode
(
code
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
e
:
GetLabel
()
~=
100
then
return
false
end
e
:
SetLabel
(
0
)
return
e
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
and
Duel
.
CheckReleaseGroup
(
tp
,
s
.
costfilter
,
1
,
nil
,
e
,
tp
)
end
e
:
SetLabel
(
0
)
local
g
=
Duel
.
SelectReleaseGroup
(
tp
,
s
.
costfilter
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
Release
(
g
,
REASON_COST
)
Duel
.
SetTargetCard
(
g
)
if
chk
==
0
then
return
e
:
IsCostChecked
()
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
local
code
=
e
:
GetLabel
(
code
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
tc
,
e
,
tp
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
spfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
code
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
...
...
expansions/script/c79103090.lua
View file @
6acc04ad
...
...
@@ -3,32 +3,45 @@ local s,id,o=GetID()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
1169
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_FUSION_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
--draw
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
1108
)
e2
:
SetCategory
(
CATEGORY_DRAW
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetCost
(
s
.
drcost
)
e2
:
SetTarget
(
s
.
drtg
)
e2
:
SetOperation
(
s
.
drop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
filter0
(
c
)
return
c
:
IsOnField
()
and
c
:
IsAbleToRemove
()
end
function
s
.
filter1
(
c
,
e
)
return
c
:
IsOnField
()
and
c
:
IsAbleToRemove
()
and
not
c
:
IsImmuneToEffect
(
e
)
function
s
.
filter1
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsCanBeFusionMaterial
()
and
c
:
IsAbleToRemove
()
end
function
s
.
filter2
(
c
,
e
,
tp
,
m
,
f
,
chkf
)
return
c
:
IsType
(
TYPE_FUSION
)
and
c
:
Is
Attribute
(
ATTRIBUTE_DARK
)
and
c
:
IsRace
(
RACE_MACHINE
)
and
(
not
f
or
f
(
c
))
return
c
:
IsType
(
TYPE_FUSION
)
and
c
:
Is
SetCard
(
0xa13
)
and
(
not
f
or
f
(
c
))
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_FUSION
,
tp
,
false
,
false
)
and
c
:
CheckFusionMaterial
(
m
,
nil
,
chkf
)
end
function
s
.
filter3
(
c
)
return
c
:
Is
Type
(
TYPE_MONSTER
)
and
c
:
IsCanBeFusionMaterial
()
and
c
:
IsAbleToRemove
(
)
function
s
.
filter3
(
c
,
e
)
return
c
:
Is
AbleToRemove
()
and
not
c
:
IsImmuneToEffect
(
e
)
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
chkf
=
tp
local
mg1
=
Duel
.
GetFusionMaterial
(
tp
):
Filter
(
s
.
filter0
,
nil
)
local
mg2
=
Duel
.
GetMatchingGroup
(
s
.
filter3
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
mg1
:
Merge
(
mg2
)
local
mg1
=
Duel
.
GetFusionMaterial
(
tp
)
local
mg2
=
Duel
.
GetMatchingGroup
(
s
.
filter1
,
tp
,
0
,
LOCATION_GRAVE
,
nil
)
if
#
mg2
>
0
then
mg1
:
Merge
(
mg2
)
end
local
res
=
Duel
.
IsExistingMatchingCard
(
s
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
mg1
,
nil
,
chkf
)
if
not
res
then
local
ce
=
Duel
.
GetChainMaterial
(
tp
)
...
...
@@ -39,16 +52,17 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
res
=
Duel
.
IsExistingMatchingCard
(
s
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
mg3
,
mf
,
chkf
)
end
end
return
res
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_ONFIELD
+
LOCATION_GRAVE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
1
,
tp
,
LOCATION_
HAND
+
LOCATION_
ONFIELD
+
LOCATION_GRAVE
)
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
chkf
=
tp
local
mg1
=
Duel
.
GetFusionMaterial
(
tp
):
Filter
(
s
.
filter1
,
nil
,
e
)
local
mg2
=
Duel
.
GetMatchingGroup
(
s
.
filter3
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
mg1
:
Merge
(
mg2
)
local
mg1
=
Duel
.
GetFusionMaterial
(
tp
):
Filter
(
s
.
filter3
,
nil
,
e
)
local
mg2
=
Duel
.
GetMatchingGroup
(
s
.
filter1
,
tp
,
0
,
LOCATION_GRAVE
,
nil
)
if
#
mg2
>
0
then
mg1
:
Merge
(
mg2
)
end
local
sg1
=
Duel
.
GetMatchingGroup
(
s
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
e
,
tp
,
mg1
,
nil
,
chkf
)
local
mg3
=
nil
local
sg2
=
nil
...
...
@@ -79,3 +93,17 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
tc
:
CompleteProcedure
()
end
end
function
s
.
drcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToDeckAsCost
()
end
Duel
.
SendtoDeck
(
e
:
GetHandler
(),
nil
,
2
,
REASON_COST
)
end
function
s
.
drtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
s
.
drop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
Duel
.
Draw
(
p
,
d
,
REASON_EFFECT
)
end
\ No newline at end of file
expansions/script/c79103100.lua
View file @
6acc04ad
...
...
@@ -3,25 +3,38 @@ local s,id,o=GetID()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_FUSION_SUMMON
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_FUSION_SUMMON
+
CATEGORY_DECKDES
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCountLimit
(
1
,
id
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
s
.
filter0
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsCanBeFusionMaterial
()
and
c
:
IsAbleToGrave
()
and
c
:
IsSetCard
(
0x5a13
)
end
function
s
.
filter1
(
c
,
e
)
return
not
c
:
IsImmuneToEffect
(
e
)
return
not
c
:
IsImmuneToEffect
(
e
)
and
c
:
IsLocation
(
LOCATION_HAND
)
and
c
:
IsSetCard
(
0x5a13
)
end
function
s
.
filter2
(
c
,
e
,
tp
,
m
,
f
,
chkf
)
return
c
:
IsType
(
TYPE_FUSION
)
and
(
not
f
or
f
(
c
))
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_FUSION
,
tp
,
false
,
false
)
and
c
:
CheckFusionMaterial
(
m
,
nil
,
chkf
)
return
c
:
IsType
(
TYPE_FUSION
)
and
c
:
IsSetCard
(
0xa13
)
and
(
not
f
or
f
(
c
))
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_FUSION
,
tp
,
false
,
false
)
and
c
:
CheckFusionMaterial
(
m
,
nil
,
chkf
)
end
function
s
.
filter3
(
c
)
return
c
:
IsLocation
(
LOCATION_HAND
)
and
c
:
IsSetCard
(
0x5a13
)
end
function
s
.
fcheck
(
tp
,
sg
,
fc
)
return
sg
:
GetCount
()
==
3
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
chkf
=
tp
local
mg1
=
Duel
.
GetFusionMaterial
(
tp
)
local
mg1
=
Duel
.
GetFusionMaterial
(
tp
):
Filter
(
s
.
filter3
,
nil
)
local
mg2
=
Duel
.
GetMatchingGroup
(
s
.
filter0
,
tp
,
LOCATION_DECK
,
0
,
nil
)
mg1
:
Merge
(
mg2
)
aux
.
FGoalCheckAdditional
=
s
.
fcheck
local
res
=
Duel
.
IsExistingMatchingCard
(
s
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
mg1
,
nil
,
chkf
)
aux
.
FGoalCheckAdditional
=
nil
if
not
res
then
local
ce
=
Duel
.
GetChainMaterial
(
tp
)
if
ce
~=
nil
then
...
...
@@ -38,15 +51,17 @@ end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
chkf
=
tp
local
mg1
=
Duel
.
GetFusionMaterial
(
tp
):
Filter
(
s
.
filter1
,
nil
,
e
)
local
mg2
=
Duel
.
GetMatchingGroup
(
s
.
filter0
,
tp
,
LOCATION_DECK
,
0
,
nil
)
mg1
:
Merge
(
mg2
)
local
sg1
=
Duel
.
GetMatchingGroup
(
s
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
e
,
tp
,
mg1
,
nil
,
chkf
)
local
mg
2
=
nil
local
mg
3
=
nil
local
sg2
=
nil
local
ce
=
Duel
.
GetChainMaterial
(
tp
)
if
ce
~=
nil
then
local
fgroup
=
ce
:
GetTarget
()
mg
2
=
fgroup
(
ce
,
e
,
tp
)
mg
3
=
fgroup
(
ce
,
e
,
tp
)
local
mf
=
ce
:
GetValue
()
sg2
=
Duel
.
GetMatchingGroup
(
s
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
e
,
tp
,
mg
2
,
mf
,
chkf
)
sg2
=
Duel
.
GetMatchingGroup
(
s
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
e
,
tp
,
mg
3
,
mf
,
chkf
)
end
if
sg1
:
GetCount
()
>
0
or
(
sg2
~=
nil
and
sg2
:
GetCount
()
>
0
)
then
local
sg
=
sg1
:
Clone
()
...
...
@@ -55,16 +70,18 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
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
aux
.
FGoalCheckAdditional
=
s
.
fcheck
local
mat1
=
Duel
.
SelectFusionMaterial
(
tp
,
tc
,
mg1
,
nil
,
chkf
)
aux
.
FGoalCheckAdditional
=
nil
tc
:
SetMaterial
(
mat1
)
Duel
.
SendtoGrave
(
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
,
mg
2
,
nil
,
chkf
)
local
mat2
=
Duel
.
SelectFusionMaterial
(
tp
,
tc
,
mg
3
,
nil
,
chkf
)
local
fop
=
ce
:
GetOperation
()
fop
(
ce
,
e
,
tp
,
tc
,
mat2
)
end
tc
:
CompleteProcedure
()
end
end
end
\ No newline at end of file
expansions/script/c79103110.lua
View file @
6acc04ad
...
...
@@ -3,82 +3,57 @@ local s,id,o=GetID()
function
s
.
initial_effect
(
c
)
--spsummon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_SPSUMMON_PROC
)
e1
:
SetProperty
(
EFFECT_FLAG_UNCOPYABLE
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
id
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetDescription
(
1118
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCode
(
EVENT_TO_GRAVE
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetCondition
(
s
.
spcon
)
e1
:
SetTarget
(
s
.
sptg
)
e1
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e1
)
--search
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e2
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
+
CATEGORY_GRAVE_ACTION
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_TO_GRAVE
)
e2
:
SetCountLimit
(
1
,
id
+
o
)
e2
:
SetCondition
(
s
.
thcon
)
e2
:
SetTarget
(
s
.
thtg
)
e2
:
SetOperation
(
s
.
thop
)
c
:
RegisterEffect
(
e2
)
--material effect
--spsummon
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
SetCode
(
EVENT_BE_MATERIAL
)
e3
:
SetProperty
(
EFFECT_FLAG_EVENT_PLAYER
)
e3
:
SetCountLimit
(
1
,
id
+
o
*
2
)
e3
:
SetCondition
(
s
.
effcon
)
e3
:
SetOperation
(
s
.
effop
)
e3
:
SetDescription
(
1118
)
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetRange
(
LOCATION_GRAVE
+
LOCATION_REMOVED
)
e3
:
SetCountLimit
(
1
,
id
+
1
)
e3
:
SetCondition
(
s
.
spcon2
)
e3
:
SetTarget
(
s
.
sptg
)
e3
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e3
)
end
function
s
.
spfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x103d
)
and
not
c
:
IsCode
(
id
)
end
function
s
.
spcon
(
e
,
c
)
if
c
==
nil
then
return
true
end
return
Duel
.
GetLocationCount
(
c
:
GetControler
(),
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
s
.
spfilter
,
c
:
GetControler
(),
LOCATION_MZONE
,
0
,
1
,
nil
)
function
s
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsType
(
TYPE_NORMAL
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
s
.
th
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
sp
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsPreviousLocation
(
LOCATION_ONFIELD
)
end
function
s
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0x203d
)
and
c
:
IsAbleToHand
()
end
function
s
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
thfilter
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
)
end
function
s
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
s
.
thfilter
),
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
s
.
spfilter
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
)
end
function
s
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
s
.
spfilter
),
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
end
function
s
.
effcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
bit
.
band
(
r
,
REASON_SYNCHRO
)
~=
0
and
e
:
GetHandler
():
GetReasonCard
():
IsSetCard
(
0x103d
)
end
function
s
.
effop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
rc
=
c
:
GetReasonCard
()
local
e1
=
Effect
.
CreateEffect
(
rc
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetTargetRange
(
0
,
LOCATION_MZONE
)
e1
:
SetValue
(
-
500
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
rc
:
RegisterEffect
(
e1
,
true
)
if
not
rc
:
IsType
(
TYPE_EFFECT
)
then
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_ADD_TYPE
)
e2
:
SetValue
(
TYPE_EFFECT
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
rc
:
RegisterEffect
(
e2
,
true
)
function
s
.
spcon2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
check
=
false
for
tc
in
aux
.
Next
(
eg
)
do
local
mg
=
tc
:
GetMaterial
()
if
tc
:
IsPreviousLocation
(
LOCATION_ONFIELD
)
and
tc
:
IsSetCard
(
0xa13
)
and
tc
:
IsType
(
TYPE_FUSION
)
and
mg
:
IsContains
(
e
:
GetHandler
())
then
check
=
true
end
end
r
c
:
RegisterFlagEffect
(
0
,
RESET_EVENT
+
RESETS_STANDARD
,
EFFECT_FLAG_CLIENT_HINT
,
1
,
0
,
aux
.
Stringid
(
id
,
3
))
r
eturn
check
end
\ No newline at end of file
expansions/script/c79103120.lua
View file @
6acc04ad
--星舰组件 破片炮塔
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--at
k up
--at
tack all
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCondition
(
s
.
rmcon
)
e1
:
SetValue
(
2000
)
e1
:
SetCode
(
EFFECT_ATTACK_ALL
)
e1
:
SetValue
(
1
)
c
:
RegisterEffect
(
e1
)
--
attack all
--
pierce
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_ATTACK_ALL
)
e2
:
SetValue
(
1
)
e2
:
SetCode
(
EFFECT_PIERCE
)
c
:
RegisterEffect
(
e2
)
--
battle remove
--
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
Set
Property
(
EFFECT_FLAG_SINGLE_RANGE
)
e3
:
Set
Code
(
EFFECT_BATTLE_DESTROY_REDIRECT
)
e3
:
Set
Range
(
LOCATION_MZONE
)
e3
:
Set
Value
(
LOCATION_REMOVED
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e3
:
Set
Code
(
EVENT_BE_MATERIAL
)
e3
:
Set
Property
(
EFFECT_FLAG_EVENT_PLAYER
)
e3
:
Set
Condition
(
s
.
indcon
)
e3
:
Set
Operation
(
s
.
indop
)
c
:
RegisterEffect
(
e3
)
--
special summon
--
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e4
:
SetDescription
(
1191
)
e4
:
SetCategory
(
CATEGORY_TOGRAVE
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetCode
(
EVENT_
LEAVE_FIELD
)
e4
:
SetCode
(
EVENT_
SUMMON_SUCCESS
)
e4
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e4
:
SetCountLimit
(
1
,
id
)
e4
:
SetCondition
(
s
.
spcon
)
e4
:
SetTarget
(
s
.
sptg
)
e4
:
SetOperation
(
s
.
spop
)
e4
:
SetTarget
(
s
.
tgtg
)
e4
:
SetOperation
(
s
.
tgop
)
c
:
RegisterEffect
(
e4
)
if
not
s
.
global_check
then
s
.
global_check
=
true
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_REMOVE
)
ge1
:
SetOperation
(
s
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
end
local
e5
=
e4
:
Clone
()
e5
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e5
)
end
function
s
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
RegisterFlagEffect
(
0
,
id
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
function
s
.
indcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
r
==
REASON_FUSION
and
e
:
GetHandler
():
GetReasonCard
():
IsSetCard
(
0xa13
)
end
function
s
.
rmcon
(
e
)
return
Duel
.
GetFlagEffect
(
0
,
id
)
>
0
end
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
s
.
indop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
IsPreviousLocation
(
LOCATION_ONFIELD
)
and
c
:
IsPreviousControler
(
tp
)
and
c
:
GetReasonPlayer
()
==
1
-
tp
local
rc
=
c
:
GetReasonCard
()
--attack all
local
e1
=
Effect
.
CreateEffect
(
rc
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_ATTACK_ALL
)
e1
:
SetValue
(
1
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
rc
:
RegisterEffect
(
e1
,
true
)
--pierce
local
e2
=
Effect
.
CreateEffect
(
rc
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_PIERCE
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
rc
:
RegisterEffect
(
e2
,
true
)
if
not
rc
:
IsType
(
TYPE_EFFECT
)
then
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
)
e4
:
SetCode
(
EFFECT_ADD_TYPE
)
e4
:
SetValue
(
TYPE_EFFECT
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
rc
:
RegisterEffect
(
e4
,
true
)
end
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e3
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetValue
(
1600
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
rc
:
RegisterEffect
(
e3
,
true
)
rc
:
RegisterFlagEffect
(
id
,
RESET_EVENT
+
RESETS_STANDARD
,
EFFECT_FLAG_CLIENT_HINT
,
1
,
0
,
aux
.
Stringid
(
id
,
1
))
end
function
s
.
spfilter
(
c
,
e
,
tp
)
return
not
c
:
IsCode
(
id
)
and
c
:
IsSetCard
(
0xcf
)
and
c
:
IsType
(
TYPE_SYNCHRO
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
nil
,
c
)
>
0
function
s
.
tgfilter
(
c
)
return
c
:
IsSetCard
(
0xa13
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToGrave
()
end
function
s
.
sp
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
spfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_
SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
function
s
.
tg
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_
TOGRAVE
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
s
.
sp
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_
SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
spfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
,
e
,
tp
)
function
s
.
tg
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_
TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
tgfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
S
pecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
Duel
.
S
endtoGrave
(
g
,
REASON_EFFECT
)
end
end
\ No newline at end of file
expansions/script/c79103130.lua
View file @
6acc04ad
--星舰组件 沙塔尔立场
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--special summon
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
))
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_END_PHASE
)
e1
:
SetRange
(
LOCATION_HAND
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetCondition
(
s
.
spcon
)
e1
:
SetTarget
(
s
.
sptg
)
e1
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e1
)
--cannot be target/effect indestructable
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_CANNOT_BE_EFFECT_TARGET
)
e2
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCondition
(
s
.
dcon
)
e2
:
SetValue
(
aux
.
tgoval
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
e3
:
SetValue
(
aux
.
indoval
)
c
:
RegisterEffect
(
e3
)
--Trap Set
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e4
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e4
:
SetCode
(
EVENT_CHAINING
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetCountLimit
(
1
,
id
+
o
)
e4
:
SetCondition
(
s
.
setcon
)
e4
:
SetTarget
(
s
.
settg
)
e4
:
SetOperation
(
s
.
setop
)
c
:
RegisterEffect
(
e4
)
--
Duel
.
AddCustomActivityCounter
(
id
,
ACTIVITY_CHAIN
,
s
.
chainfilter
)
end
function
s
.
chainfilter
(
re
,
tp
,
cid
)
local
rc
=
re
:
GetHandler
()
return
rc
:
IsCode
(
id
)
or
not
((
rc
:
GetType
()
==
TYPE_TRAP
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
))
or
(
rc
:
IsSetCard
(
0x17e
)))
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e5
:
SetCode
(
EVENT_BE_MATERIAL
)
e5
:
SetProperty
(
EFFECT_FLAG_EVENT_PLAYER
)
e5
:
SetCondition
(
s
.
indcon
)
e5
:
SetOperation
(
s
.
indop
)
c
:
RegisterEffect
(
e5
)
--
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
1118
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetTarget
(
s
.
sptg
)
e1
:
SetOperation
(
s
.
spop
)
c
:
RegisterEffect
(
e1
)
local
e4
=
e1
:
Clone
()
e4
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e4
)
end
function
s
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetCustomActivityCount
(
id
,
tp
,
ACTIVITY_CHAIN
)
>
0
or
Duel
.
GetCustomActivityCount
(
id
,
1
-
tp
,
ACTIVITY_CHAIN
)
>
0
function
s
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
c
:
IsSetCard
(
0xa13
)
end
function
s
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
,
POS_FACEUP_DEFENSE
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
c
,
1
,
0
,
0
)
and
Duel
.
IsExistingMatchingCard
(
s
.
spfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_GRAVE
)
end
function
s
.
spop
(
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_DEFENSE
)
end
function
s
.
dcon
(
e
)
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsFacedown
,
e
:
GetHandlerPlayer
(),
LOCATION_ONFIELD
,
0
,
1
,
nil
)
end
function
s
.
setcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
return
rc
:
GetType
()
==
TYPE_TRAP
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
s
.
setfilter
(
c
,
rc
)
return
not
c
:
IsCode
(
rc
:
GetCode
())
and
c
:
GetType
()
==
TYPE_TRAP
and
c
:
IsSSetable
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
s
.
spfilter
),
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
g
:
GetCount
()
>
0
then
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
function
s
.
settg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
rc
=
re
:
GetHandler
()
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
setfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
rc
)
end
function
s
.
indcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
r
==
REASON_FUSION
and
e
:
GetHandler
():
GetReasonCard
():
IsSetCard
(
0xa13
)
end
function
s
.
setop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
setfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
rc
)
if
g
:
GetCount
()
>
0
then
Duel
.
SSet
(
tp
,
g
:
GetFirst
())
function
s
.
indop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
rc
=
c
:
GetReasonCard
()
--cannot be target/effect indestructable
local
e2
=
Effect
.
CreateEffect
(
rc
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_CANNOT_BE_EFFECT_TARGET
)
e2
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
e2
:
SetValue
(
aux
.
tgoval
)
rc
:
RegisterEffect
(
e2
,
true
)
local
e1
=
e2
:
Clone
()
e1
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
e1
:
SetValue
(
aux
.
indoval
)
rc
:
RegisterEffect
(
e1
,
true
)
if
not
rc
:
IsType
(
TYPE_EFFECT
)
then
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
)
e4
:
SetCode
(
EFFECT_ADD_TYPE
)
e4
:
SetValue
(
TYPE_EFFECT
)
e4
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
rc
:
RegisterEffect
(
e4
,
true
)
end
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
e3
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetValue
(
1600
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
rc
:
RegisterEffect
(
e3
,
true
)
rc
:
RegisterFlagEffect
(
id
,
RESET_EVENT
+
RESETS_STANDARD
,
EFFECT_FLAG_CLIENT_HINT
,
1
,
0
,
aux
.
Stringid
(
id
,
1
))
end
\ No newline at end of file
expansions/script/c79103140.lua
View file @
6acc04ad
...
...
@@ -3,7 +3,7 @@ local s,id,o=GetID()
function
s
.
initial_effect
(
c
)
--tohand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
0
)
)
e1
:
SetDescription
(
1101
)
e1
:
SetCategory
(
CATEGORY_SEARCH
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
...
...
@@ -17,7 +17,7 @@ function s.initial_effect(c)
c
:
RegisterEffect
(
e2
)
--spsummon
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
id
,
1
)
)
e3
:
SetDescription
(
1101
)
e3
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetCode
(
EVENT_BE_MATERIAL
)
...
...
expansions/script/c79103150.lua
View file @
6acc04ad
--星舰战略 回收地堡
local
s
,
id
,
o
=
GetID
()
function
s
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
)
e1
:
SetDescription
(
1102
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetTarget
(
s
.
target
)
e1
:
SetOperation
(
s
.
activate
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetCountLimit
(
1
,
id
)
e1
:
SetTarget
(
s
.
rmtg
)
e1
:
SetOperation
(
s
.
rmop
)
c
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
1190
)
e2
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCountLimit
(
1
,
id
)
e2
:
SetCost
(
aux
.
bfgcost
)
e2
:
SetTarget
(
s
.
thtg
)
e2
:
SetOperation
(
s
.
thop
)
c
:
RegisterEffect
(
e2
)
end
function
s
.
filter
(
c
)
function
s
.
rm
filter
(
c
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToRemove
()
end
function
s
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
Is
Controler
(
1
-
tp
)
and
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
s
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
filter
,
tp
,
0
,
LOCATION_GRAVE
,
1
,
nil
)
end
function
s
.
rmtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
Is
Location
(
LOCATION_GRAVE
)
and
chkc
:
IsControler
(
1
-
tp
)
and
s
.
rm
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
s
.
rm
filter
,
tp
,
0
,
LOCATION_GRAVE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
filter
,
tp
,
0
,
LOCATION_GRAVE
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
g
,
1
,
1
-
tp
,
LOCATION_GRAVE
)
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
~=
0
and
tc
:
IsLocation
(
LOCATION_REMOVED
)
then
local
c
=
e
:
GetHandler
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e1
:
SetTarget
(
s
.
distg
)
e1
:
SetLabelObject
(
tc
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
,
2
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_CHAIN_SOLVING
)
e2
:
SetCondition
(
s
.
discon
)
e2
:
SetOperation
(
s
.
disop
)
e2
:
SetLabelObject
(
tc
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
,
2
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
local
g
=
Duel
.
SelectTarget
(
tp
,
s
.
rmfilter
,
tp
,
0
,
LOCATION_GRAVE
,
1
,
3
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
g
,
#
g
,
0
,
0
)
end
function
s
.
distg
(
e
,
c
)
local
tc
=
e
:
GetLabelObject
()
return
c
:
IsOriginalCodeRule
(
tc
:
GetOriginalCodeRule
())
and
(
c
:
IsType
(
TYPE_EFFECT
)
or
c
:
GetOriginalType
()
&
TYPE_EFFECT
~=
0
)
function
s
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
and
c
:
IsFaceup
()
and
c
:
IsLocation
(
LOCATION_REMOVED
)
end
function
s
.
discon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
e
:
GetLabelObject
()
return
re
:
IsActiveType
(
TYPE_MONSTER
)
and
re
:
GetHandler
():
IsOriginalCodeRule
(
tc
:
GetOriginalCodeRule
())
function
s
.
fufilter
(
c
)
return
c
:
IsSetCard
(
0xa13
)
and
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_FUSION
)
end
function
s
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
NegateEffect
(
ev
)
function
s
.
rmop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetTargetsRelateToChain
()
if
#
g
>
0
and
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
>
0
then
if
Duel
.
IsExistingMatchingCard
(
s
.
fufilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
g
:
IsExists
(
s
.
spfilter
,
1
,
nil
,
e
,
tp
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
2
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
g
:
FilterSelect
(
tp
,
s
.
spfilter
,
1
,
1
,
nil
,
e
,
tp
)
if
#
sg
>
0
then
Duel
.
SpecialSummon
(
sg
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
end
end
end
end
function
s
.
thfilter
(
c
)
return
c
:
IsSetCard
(
0x3a13
)
and
c
:
IsAbleToHand
()
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
s
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
s
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
s
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
s
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
#
g
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
\ No newline at end of file
expansions/script/c79103170.lua
View file @
6acc04ad
...
...
@@ -12,18 +12,31 @@ function s.initial_effect(c)
e1
:
SetOperation
(
s
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
s
.
counterfilter
(
c
)
return
c
:
IsRace
(
RACE_MACHINE
)
and
c
:
IsAttribute
(
ATTRIBUTE_DARK
)
end
function
s
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x
11b
)
and
c
:
IsType
(
TYPE_LINK
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x
a13
)
and
c
:
IsType
(
TYPE_FUSION
)
end
function
s
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
s
.
cfilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
and
Duel
.
IsChainNegatable
(
ev
)
and
(
re
:
IsActiveType
(
TYPE_MONSTER
)
or
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
)
and
Duel
.
IsChainNegatable
(
ev
)
and
re
:
IsActiveType
(
TYPE_MONSTER
+
TYPE_SPELL
+
TYPE_TRAP
)
end
function
s
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
NegateActivation
(
ev
)
and
re
:
GetHandler
():
IsRelateToEffect
(
re
)
then
Duel
.
Remove
(
eg
,
POS_FACEUP
,
REASON_EFFECT
)
local
c
=
e
:
GetHandler
()
if
Duel
.
NegateActivation
(
ev
)
then
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
id
,
1
))
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_CHAIN_SOLVING
)
e1
:
SetCondition
(
s
.
discon
)
e1
:
SetOperation
(
s
.
disop
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
function
s
.
discon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
rp
==
1
-
tp
and
Duel
.
IsChainDisablable
(
ev
)
and
re
:
IsActiveType
(
TYPE_MONSTER
+
TYPE_SPELL
+
TYPE_TRAP
)
end
function
s
.
disop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_CARD
,
0
,
id
)
local
rc
=
re
:
GetHandler
()
Duel
.
NegateEffect
(
ev
)
e
:
Reset
()
end
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment