Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
no81cards
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
Huangnan
no81cards
Commits
e5e8aed7
Commit
e5e8aed7
authored
May 10, 2022
by
Nemo Ma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
c57ae431
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
359 additions
and
375 deletions
+359
-375
expansions/no81.cdb
expansions/no81.cdb
+0
-0
expansions/script/c10700459.lua
expansions/script/c10700459.lua
+2
-2
expansions/script/c11451650.lua
expansions/script/c11451650.lua
+1
-1
expansions/script/c11451681.lua
expansions/script/c11451681.lua
+1
-1
expansions/script/c11451682.lua
expansions/script/c11451682.lua
+1
-1
expansions/script/c13254041.lua
expansions/script/c13254041.lua
+1
-1
expansions/script/c13254069.lua
expansions/script/c13254069.lua
+1
-1
expansions/script/c13254070.lua
expansions/script/c13254070.lua
+2
-2
expansions/script/c22020780.lua
expansions/script/c22020780.lua
+10
-8
expansions/script/c22020820.lua
expansions/script/c22020820.lua
+0
-1
expansions/script/c29010009.lua
expansions/script/c29010009.lua
+17
-49
expansions/script/c29010022.lua
expansions/script/c29010022.lua
+66
-72
expansions/script/c53713002.lua
expansions/script/c53713002.lua
+72
-68
expansions/script/c53713004.lua
expansions/script/c53713004.lua
+72
-71
expansions/script/c53713008.lua
expansions/script/c53713008.lua
+52
-51
expansions/script/c53713009.lua
expansions/script/c53713009.lua
+45
-44
expansions/script/c53799175.lua
expansions/script/c53799175.lua
+14
-1
expansions/script/c64800134.lua
expansions/script/c64800134.lua
+1
-1
expansions/script/c67200320.lua
expansions/script/c67200320.lua
+1
-0
No files found.
expansions/no81.cdb
View file @
e5e8aed7
No preview for this file type
expansions/script/c10700459.lua
View file @
e5e8aed7
...
...
@@ -6,7 +6,7 @@ function c10700459.initial_effect(c)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCode
(
EFFECT_INDESTRUCTABLE_BATTLE
)
e1
:
SetCondition
(
c10700459
.
atcon
)
e1
:
SetCondition
(
c10700459
.
atcon
2
)
e1
:
SetValue
(
1
)
c
:
RegisterEffect
(
e1
)
local
e4
=
Effect
.
CreateEffect
(
c
)
...
...
@@ -14,7 +14,7 @@ function c10700459.initial_effect(c)
e4
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
e4
:
SetCondition
(
c10700459
.
atcon
2
)
e4
:
SetCondition
(
c10700459
.
atcon
)
e4
:
SetValue
(
1
)
c
:
RegisterEffect
(
e4
)
--search
...
...
expansions/script/c11451650.lua
View file @
e5e8aed7
...
...
@@ -128,7 +128,7 @@ end
function
cm
.
stcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
flag
=
c
:
GetFlagEffectLabel
(
m
+
1
)
return
re
:
GetHandler
()
~=
c
and
tp
==
c
:
GetOwner
()
--
and (not flag or flag<3)
return
re
:
GetHandler
()
~=
c
and
tp
==
c
:
GetOwner
()
and
(
not
flag
or
flag
<
3
)
end
function
cm
.
sttg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
...
...
expansions/script/c11451681.lua
View file @
e5e8aed7
...
...
@@ -78,7 +78,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local
_SendToGrave
=
Duel
.
SendtoGrave
Duel
.
SendtoGrave
=
function
(
tg
,
r
)
if
r
==
REASON_MATERIAL
+
REASON_LINK
then
local
ct
=
Duel
.
Destroy
(
tg
,
r
)
local
ct
=
Duel
.
Destroy
(
tg
,
r
|
REASON_RULE
)
Duel
.
SendtoGrave
=
_SendToGrave
return
ct
else
...
...
expansions/script/c11451682.lua
View file @
e5e8aed7
...
...
@@ -167,7 +167,7 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp)
e3
:
SetRange
(
LOCATION_ONFIELD
)
e3
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e3
:
SetCondition
(
cm
.
econ
)
e3
:
SetValue
(
cm
.
e
filter
)
e3
:
SetValue
(
cm
.
e
val
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e3
)
end
...
...
expansions/script/c13254041.lua
View file @
e5e8aed7
...
...
@@ -146,7 +146,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
sg
=
g1
:
Select
(
tp
,
1
,
ct1
,
nil
)
Duel
.
DisableShuffleCheck
()
Duel
.
SSet
(
tp
,
sg
:
GetFirst
()
)
Duel
.
SSet
(
tp
,
sg
)
end
end
broken
=
true
...
...
expansions/script/c13254069.lua
View file @
e5e8aed7
...
...
@@ -124,7 +124,7 @@ function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
end
function
cm
.
activate1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
Duel
.
GetMatchingGroup
(
cm
.
tdfilter
,
tp
,
LOCATION_GRAVE
,
0
,
nil
)
local
g1
=
Duel
.
GetMatchingGroup
(
cm
.
spfilter
,
tp
,
LOCATION_DECK
+
LOCATION_EXTRA
,
0
,
nil
,
tama
.
tamas_sumElements
(
g
),
e
,
tp
)
local
g1
=
Duel
.
GetMatchingGroup
(
cm
.
spfilter
1
,
tp
,
LOCATION_DECK
+
LOCATION_EXTRA
,
0
,
nil
,
tama
.
tamas_sumElements
(
g
),
e
,
tp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
tg
=
g1
:
Select
(
tp
,
1
,
1
,
nil
)
local
tc
=
tg
:
GetFirst
()
...
...
expansions/script/c13254070.lua
View file @
e5e8aed7
...
...
@@ -67,14 +67,14 @@ function cm.filter(c,sp)
end
function
cm
.
drcon1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
cm
.
filter
,
1
,
nil
,
1
-
tp
)
and
(
not
re
:
IsHasType
(
EFFECT_TYPE_ACTIONS
)
or
re
:
IsHasType
(
EFFECT_TYPE_CONTINUOUS
))
and
(
not
re
or
(
not
re
:
IsHasType
(
EFFECT_TYPE_ACTIONS
)
or
re
:
IsHasType
(
EFFECT_TYPE_CONTINUOUS
)
))
end
function
cm
.
drop1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
DiscardDeck
(
tp
,
1
,
REASON_EFFECT
)
end
function
cm
.
regcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
cm
.
filter
,
1
,
nil
,
1
-
tp
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIONS
)
and
not
re
:
IsHasType
(
EFFECT_TYPE_CONTINUOUS
)
and
re
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIONS
)
and
not
re
:
IsHasType
(
EFFECT_TYPE_CONTINUOUS
)
end
function
cm
.
regop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_CHAIN
,
0
,
1
)
...
...
expansions/script/c22020780.lua
View file @
e5e8aed7
...
...
@@ -7,8 +7,8 @@ function c22020780.initial_effect(c)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_SPSUMMON
)
e1
:
SetCountLimit
(
1
,
22020780
+
EFFECT_COUNT_CODE_OATH
)
e1
:
SetCost
(
c22020780
.
cost
)
e1
:
SetCondition
(
c22020780
.
condition
)
e1
:
SetCost
(
c22020780
.
cost
)
e1
:
SetTarget
(
c22020780
.
target
)
e1
:
SetOperation
(
c22020780
.
activate
)
c
:
RegisterEffect
(
e1
)
...
...
@@ -25,17 +25,19 @@ function c22020780.filter(c)
return
c
:
IsCode
(
22020770
)
and
c
:
IsFaceup
()
end
function
c22020780
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c22020780
.
filter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DISABLE_SUMMON
,
eg
,
eg
:
GetCount
(),
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
eg
,
eg
:
GetCount
(),
0
,
0
)
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
c22020780
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
function
c22020780
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
Duel
.
NegateSummon
(
eg
)
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
22020780
,
1
))
Duel
.
Destroy
(
eg
,
REASON_EFFECT
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c22020780
.
filter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
c22020780
.
filter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
BreakEffect
(
)
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
22020780
,
1
)
)
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
22020780
,
2
))
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
...
...
expansions/script/c22020820.lua
View file @
e5e8aed7
...
...
@@ -25,7 +25,6 @@ function c22020820.initial_effect(c)
e3
:
SetType
(
EFFECT_TYPE_EQUIP
)
e3
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e3
:
SetValue
(
2000
)
e3
:
SetCondition
(
aux
.
IsUnionState
)
c
:
RegisterEffect
(
e3
)
--attack all
local
e4
=
Effect
.
CreateEffect
(
c
)
...
...
expansions/script/c29010009.lua
View file @
e5e8aed7
...
...
@@ -11,23 +11,12 @@ function c29010009.initial_effect(c)
e1
:
SetTarget
(
c29010009
.
target
)
e1
:
SetOperation
(
c29010009
.
activate
)
c
:
RegisterEffect
(
e1
)
--SpecialSummon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCost
(
c29010009
.
spcost
)
e2
:
SetTarget
(
c29010009
.
sptg
)
e2
:
SetOperation
(
c29010009
.
spop
)
c
:
RegisterEffect
(
e2
)
end
function
c29010009
.
costfilter
(
c
,
e
,
tp
)
return
c
:
IsDiscardable
()
and
Duel
.
IsExistingMatchingCard
(
c29010009
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
c
,
e
,
tp
)
end
function
c29010009
.
filter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0x
77af
)
and
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
return
c
:
IsSetCard
(
0x
87af
)
and
c
:
IsRace
(
RACE_FISH
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c29010009
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsDiscardable
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
REASON_COST
)
end
...
...
@@ -37,45 +26,24 @@ function c29010009.target(e,tp,eg,ep,ev,re,r,rp,chk)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c29010009
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_DECK
)
end
function
c29010009
.
setfilter
(
c
)
return
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
and
c
:
IsFaceup
()
end
function
c29010009
.
cfilter
(
c
,
e
,
tp
)
return
c
:
IsRace
(
RACE_FISH
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c29010009
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c29010009
.
filter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
e
:
GetHandler
():
CancelToGrave
()
end
function
c29010009
.
spcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
e
:
SetLabel
(
1
)
return
true
end
function
c29010009
.
ckfil
(
c
,
e
,
tp
)
return
c
:
IsControler
(
1
-
tp
)
and
c
:
IsAttribute
(
ATTRIBUTE_WATER
)
end
function
c29010009
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
if
e
:
GetLabel
()
==
0
then
return
false
end
e
:
SetLabel
(
0
)
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
29010009
,
0
,
0x4011
,
0
,
0
,
8
,
RACE_AQUA
,
ATTRIBUTE_WATER
)
and
eg
:
IsExists
(
c29010009
.
ckfil
,
1
,
nil
,
e
,
tp
)
end
e
:
SetLabel
(
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c29010009
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
29010009
,
0
,
0x4011
,
0
,
0
,
8
,
RACE_AQUA
,
ATTRIBUTE_WATER
)
then
c
:
AddMonsterAttribute
(
TYPE_NORMAL
)
Duel
.
SpecialSummon
(
c
,
0
,
tp
,
tp
,
true
,
false
,
POS_FACEUP
)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
SpecialSummon
(
g
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
then
local
g2
=
Duel
.
GetMatchingGroup
(
c29010009
.
setfilter
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
g2
:
GetCount
()
>
0
and
Duel
.
IsExistingMatchingCard
(
c29010009
.
cfilter
,
tp
,
0
,
LOCATION_MZONE
,
1
,
nil
)
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
29010009
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
sg
=
g2
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
SSet
(
tp
,
sg
)
end
end
end
end
\ No newline at end of file
expansions/script/c29010022.lua
View file @
e5e8aed7
--荒败之城 盐风
function
c29010022
.
initial_effect
(
c
)
--Activate
--activate
local
e0
=
Effect
.
CreateEffect
(
c
)
e0
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e0
:
SetCode
(
EVENT_FREE_CHAIN
)
e0
:
SetCountLimit
(
1
,
29010022
+
EFFECT_COUNT_CODE_OATH
)
c
:
RegisterEffect
(
e0
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetOperation
(
c29010022
.
activate
)
e1
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
)
e1
:
SetType
(
EFFECT_TYPE_IGNITION
)
e1
:
SetRange
(
LOCATION_FZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetTarget
(
c29010022
.
totg
)
e1
:
SetOperation
(
c29010022
.
toop
)
c
:
RegisterEffect
(
e1
)
--change code
aux
.
EnableChangeCode
(
c
,
22702055
)
--to hand
--special summon
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_TOKEN
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetCountLimit
(
1
,
29010022
)
e2
:
SetCost
(
c29010022
.
tkcost
)
e2
:
SetTarget
(
c29010022
.
tktg
)
e2
:
SetOperation
(
c29010022
.
tkop
)
e2
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_PLAYER_TARGET
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetCountLimit
(
1
)
e2
:
SetCondition
(
c29010022
.
spcon
)
e2
:
SetTarget
(
c29010022
.
sptg
)
e2
:
SetOperation
(
c29010022
.
spop
)
c
:
RegisterEffect
(
e2
)
end
function
c29010022
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
--effect gain
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_XYZ_LEVEL
)
e1
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetValue
(
c29010022
.
xyzlv
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_GRANT
)
e2
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e2
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsAttribute
,
ATTRIBUTE_WATER
))
e2
:
SetLabelObject
(
e1
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
,
2
)
Duel
.
RegisterEffect
(
e2
,
tp
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EFFECT_ADD_TYPE
)
e3
:
SetValue
(
TYPE_EFFECT
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_GRANT
)
e4
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e4
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsAttribute
,
ATTRIBUTE_WATER
))
e4
:
SetLabelObject
(
e3
)
e4
:
SetReset
(
RESET_PHASE
+
PHASE_END
,
2
)
Duel
.
RegisterEffect
(
e4
,
tp
)
function
c29010022
.
totg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
,
tp
)
>
1
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
29010025
,
nil
,
TYPES_TOKEN_MONSTER
,
1500
,
1500
,
1
,
RACE_AQUA
,
ATTRIBUTE_WATER
,
POS_FACEUP
,
1
-
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
end
function
c29010022
.
xyzlv
(
e
,
c
,
rc
)
return
0x80000
+
e
:
GetHandler
():
GetLevel
()
function
c29010022
.
toop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
,
tp
)
<=
0
or
not
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
29010025
,
nil
,
TYPES_TOKEN_MONSTER
,
1500
,
1500
,
1
,
RACE_AQUA
,
ATTRIBUTE_WATER
,
POS_FACEUP
,
1
-
tp
)
then
return
end
local
token
=
Duel
.
CreateToken
(
tp
,
29010025
)
Duel
.
SpecialSummon
(
token
,
0
,
tp
,
1
-
tp
,
false
,
false
,
POS_FACEUP
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_UNRELEASABLE_SUM
)
e1
:
SetValue
(
1
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
token
:
RegisterEffect
(
e1
,
true
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_UNRELEASABLE_NONSUM
)
token
:
RegisterEffect
(
e2
,
true
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EFFECT_CANNOT_BE_SYNCHRO_MATERIAL
)
token
:
RegisterEffect
(
e3
,
true
)
local
e4
=
e3
:
Clone
()
e4
:
SetCode
(
EFFECT_CANNOT_BE_FUSION_MATERIAL
)
token
:
RegisterEffect
(
e4
,
true
)
local
e5
=
e4
:
Clone
()
e5
:
SetCode
(
EFFECT_CANNOT_BE_LINK_MATERIAL
)
token
:
RegisterEffect
(
e5
,
true
)
Duel
.
SpecialSummonComplete
()
end
function
c29010022
.
tkcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
CheckLPCost
(
tp
,
800
)
end
Duel
.
PayLPCost
(
tp
,
800
)
function
c29010022
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
re
:
IsActiveType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
function
c29010022
.
thfilter
(
c
)
return
c
:
Is
SetCard
(
0x77af
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
(
c
:
IsAbleToHand
()
or
c
:
IsAbleToGrave
()
)
function
c29010022
.
spfilter
(
c
,
e
,
tp
)
return
c
:
Is
Attribute
(
ATTRIBUTE_WATER
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c29010022
.
tktg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
29010023
,
0
,
TYPES_TOKEN_MONSTER
,
1500
,
1500
,
1
,
RACE_AQUA
,
ATTRIBUTE_WATER
,
POS_FACEUP
,
1
-
tp
)
and
Duel
.
IsExistingMatchingCard
(
c29010022
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOKEN
,
nil
,
1
,
tp
,
0
)
function
c29010022
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingMatchingCard
(
c29010022
.
spfilter
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
+
LOCATION_GRAVE
)
end
function
c29010022
.
tkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
1
-
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
29010023
,
0
,
TYPES_TOKEN_MONSTER
,
1500
,
1500
,
1
,
RACE_AQUA
,
ATTRIBUTE_WATER
,
POS_FACEUP
,
1
-
tp
)
then
local
token
=
Duel
.
CreateToken
(
tp
,
29010023
)
if
Duel
.
SpecialSummon
(
token
,
0
,
tp
,
1
-
tp
,
false
,
false
,
POS_FACEUP
)
~=
0
and
Duel
.
IsExistingMatchingCard
(
c29010022
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
then
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c29010022
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
local
tc
=
g
:
GetFirst
()
if
tc
and
tc
:
IsAbleToHand
()
and
(
not
tc
:
IsAbleToGrave
()
or
Duel
.
SelectOption
(
tp
,
1190
,
1191
)
==
0
)
then
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
else
Duel
.
SendtoGrave
(
tc
,
REASON_EFFECT
)
end
end
end
function
c29010022
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
<=
0
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
c29010022
.
spfilter
),
tp
,
LOCATION_HAND
+
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
\ No newline at end of file
expansions/script/c53713002.lua
View file @
e5e8aed7
...
...
@@ -5,25 +5,35 @@ function cm.initial_effect(c)
c
:
EnableReviveLimit
()
aux
.
AddFusionProcFunRep
(
c
,
function
(
c
)
return
c
:
GetOriginalType
()
&
TYPE_TRAP
~=
0
and
c
:
IsFusionType
(
TYPE_MONSTER
)
end
,
2
,
true
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e2
:
SetCategory
(
CATEGORY_HANDES
+
CATEGORY_TOGRAVE
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetCountLimit
(
2
,
m
)
e2
:
SetCondition
(
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
Card
.
IsControler
,
1
,
nil
,
1
-
tp
)
end
)
e2
:
SetTarget
(
cm
.
alctg
)
e2
:
SetOperation
(
cm
.
alcop
)
e2
:
SetTarget
(
cm
.
alctg
1
)
e2
:
SetOperation
(
cm
.
alcop
1
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e3
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
Set
Type
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e4
:
SetC
ode
(
EVENT_SPSUMMON_SUCCESS
)
e4
:
Set
Condition
(
cm
.
con
)
e4
:
SetOperation
(
cm
.
op
)
local
e4
=
e2
:
Clone
(
)
e4
:
Set
Description
(
aux
.
Stringid
(
m
,
1
)
)
e4
:
SetC
ategory
(
CATEGORY_TOEXTRA
)
e4
:
Set
Target
(
cm
.
alctg2
)
e4
:
SetOperation
(
cm
.
alcop2
)
c
:
RegisterEffect
(
e4
)
local
e5
=
e4
:
Clone
()
e5
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e5
)
local
e6
=
Effect
.
CreateEffect
(
c
)
e6
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e6
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e6
:
SetCondition
(
cm
.
con
)
e6
:
SetOperation
(
cm
.
op
)
c
:
RegisterEffect
(
e6
)
end
function
cm
.
filter
(
c
,
tp
)
return
aux
.
NegateMonsterFilter
(
c
)
and
c
:
IsControler
(
1
-
tp
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
setfilter1
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
,
c
:
GetCode
())
...
...
@@ -37,68 +47,62 @@ end
function
cm
.
setfilter2
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCanTurnSet
()
and
c
:
GetType
()
&
0x20004
==
0x20004
end
function
cm
.
alctg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
b1
=
eg
:
IsExists
(
cm
.
filter
,
1
,
nil
,
tp
)
and
Duel
.
GetFieldGroupCount
(
1
-
tp
,
LOCATION_HAND
,
0
)
~=
0
local
b2
=
Duel
.
IsExistingMatchingCard
(
cm
.
tefilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
setfilter2
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
if
chk
==
0
then
return
b1
or
b2
end
local
op
=
0
if
b1
and
b2
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
0
),
aux
.
Stringid
(
m
,
1
))
elseif
b1
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
0
))
else
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
1
))
+
1
end
e
:
SetLabel
(
op
)
if
op
==
0
then
e
:
SetCategory
(
CATEGORY_HANDES
+
CATEGORY_TOGRAVE
)
Duel
.
SetTargetCard
(
eg
)
local
g
=
eg
:
Filter
(
cm
.
filter
,
nil
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
1
-
tp
,
LOCATION_HAND
)
else
e
:
SetCategory
(
CATEGORY_TOEXTRA
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOEXTRA
,
nil
,
1
,
tp
,
LOCATION_ONFIELD
)
end
function
cm
.
alctg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
eg
:
IsExists
(
cm
.
filter
,
1
,
nil
,
tp
)
and
Duel
.
GetFieldGroupCount
(
1
-
tp
,
LOCATION_HAND
,
0
)
~=
0
end
Duel
.
SetTargetCard
(
eg
)
local
g
=
eg
:
Filter
(
cm
.
filter
,
nil
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
g
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
1
-
tp
,
LOCATION_HAND
)
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
end
function
cm
.
alctg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
tefilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
setfilter2
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOEXTRA
,
nil
,
1
,
tp
,
LOCATION_ONFIELD
)
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
end
function
cm
.
alcop1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
g
=
eg
:
Filter
(
cm
.
filter
,
nil
,
tp
):
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
)
local
tc
=
g
:
GetFirst
()
if
not
tc
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
if
#
g
>
1
then
tc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
setfilter1
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
,
tc
:
GetCode
())
local
sc
=
sg
:
GetFirst
()
if
not
sc
then
return
end
Duel
.
HintSelection
(
Group
.
FromCards
(
sc
,
tc
))
sc
:
CancelToGrave
()
local
pos
=
Duel
.
ChangePosition
(
sc
,
POS_FACEDOWN
)
if
pos
==
0
then
return
end
if
sc
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
then
Duel
.
RaiseEvent
(
sc
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
if
tc
:
IsDisabled
()
then
return
end
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
Duel
.
AdjustInstantly
()
Duel
.
NegateRelatedChain
(
tc
,
RESET_TURN_SET
)
local
hg
=
Duel
.
GetFieldGroup
(
1
-
tp
,
LOCATION_HAND
,
0
)
if
#
hg
==
0
then
return
end
local
gg
=
hg
:
RandomSelect
(
1
-
tp
,
1
)
Duel
.
SendtoGrave
(
Group
.
__add
(
tc
,
gg
),
REASON_EFFECT
)
end
function
cm
.
alcop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetLabel
()
==
0
then
local
g
=
eg
:
Filter
(
cm
.
filter
,
nil
,
tp
):
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
)
local
tc
=
g
:
GetFirst
()
if
not
tc
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
if
#
g
>
1
then
tc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
setfilter1
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
,
tc
:
GetCode
())
local
sc
=
sg
:
GetFirst
()
if
not
sc
then
return
end
Duel
.
HintSelection
(
Group
.
FromCards
(
sc
,
tc
))
sc
:
CancelToGrave
()
local
pos
=
Duel
.
ChangePosition
(
sc
,
POS_FACEDOWN
)
if
pos
==
0
then
return
end
if
sc
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
then
Duel
.
RaiseEvent
(
sc
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
if
tc
:
IsDisabled
()
then
return
end
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
tc
:
RegisterEffect
(
e1
)
Duel
.
AdjustInstantly
()
Duel
.
NegateRelatedChain
(
tc
,
RESET_TURN_SET
)
local
hg
=
Duel
.
GetFieldGroup
(
1
-
tp
,
LOCATION_HAND
,
0
)
if
#
hg
==
0
then
return
end
local
gg
=
hg
:
RandomSelect
(
1
-
tp
,
1
)
Duel
.
SendtoGrave
(
Group
.
__add
(
tc
,
gg
),
REASON_EFFECT
)
else
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
tefilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
#
g
==
0
then
return
end
if
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_EFFECT
)
==
0
or
not
g
:
GetFirst
():
IsLocation
(
LOCATION_EXTRA
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
setfilter2
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
2
,
nil
)
if
#
sg
==
0
then
return
end
Duel
.
HintSelection
(
sg
)
local
rg
=
Group
.
CreateGroup
()
for
tc
in
aux
.
Next
(
sg
)
do
tc
:
CancelToGrave
()
if
Duel
.
ChangePosition
(
tc
,
POS_FACEDOWN
)
~=
0
and
tc
:
IsFacedown
()
then
rg
:
AddCard
(
tc
)
end
end
Duel
.
RaiseEvent
(
rg
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
function
cm
.
alcop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
tefilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
#
g
==
0
then
return
end
if
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_EFFECT
)
==
0
or
not
g
:
GetFirst
():
IsLocation
(
LOCATION_EXTRA
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
setfilter2
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
2
,
nil
)
if
#
sg
==
0
then
return
end
Duel
.
HintSelection
(
sg
)
local
rg
=
Group
.
CreateGroup
()
for
tc
in
aux
.
Next
(
sg
)
do
tc
:
CancelToGrave
()
if
Duel
.
ChangePosition
(
tc
,
POS_FACEDOWN
)
~=
0
and
tc
:
IsFacedown
()
then
rg
:
AddCard
(
tc
)
end
end
Duel
.
RaiseEvent
(
rg
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
function
cm
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_FUSION
)
...
...
expansions/script/c53713004.lua
View file @
e5e8aed7
...
...
@@ -4,25 +4,31 @@ cm.name="ALC之脑 TIS"
function
cm
.
initial_effect
(
c
)
aux
.
AddFusionProcFunRep
(
c
,
function
(
c
)
return
c
:
GetOriginalType
()
&
TYPE_TRAP
~=
0
and
c
:
IsFusionType
(
TYPE_MONSTER
)
end
,
2
,
true
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
3
))
e3
:
SetCategory
(
CATEGORY_
DESTROY
)
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e3
:
SetCategory
(
CATEGORY_
REMOVE
)
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
2
,
m
)
e3
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_END_PHASE
)
e3
:
SetTarget
(
cm
.
alctg
)
e3
:
SetOperation
(
cm
.
alcop
)
e3
:
SetTarget
(
cm
.
alctg
1
)
e3
:
SetOperation
(
cm
.
alcop
1
)
c
:
RegisterEffect
(
e3
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e4
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e4
:
SetCondition
(
cm
.
con
)
e4
:
SetTarget
(
cm
.
tg
)
e4
:
SetOperation
(
cm
.
op
)
local
e4
=
e3
:
Clone
()
e4
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e4
:
SetCategory
(
CATEGORY_TOEXTRA
)
e4
:
SetTarget
(
cm
.
alctg2
)
e4
:
SetOperation
(
cm
.
alcop2
)
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_SPSUMMON_SUCCESS
)
e5
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e5
:
SetCondition
(
cm
.
con
)
e5
:
SetTarget
(
cm
.
tg
)
e5
:
SetOperation
(
cm
.
op
)
c
:
RegisterEffect
(
e5
)
end
function
cm
.
setfilter1
(
c
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsCanTurnSet
()
and
Duel
.
IsExistingMatchingCard
(
function
(
c
,
code
)
return
(
c
:
IsFaceup
()
or
c
:
IsLocation
(
LOCATION_GRAVE
))
and
c
:
IsCode
(
code
)
end
,
tp
,
0
,
LOCATION_ONFIELD
+
LOCATION_GRAVE
,
1
,
nil
,
c
:
GetCode
())
...
...
@@ -33,67 +39,61 @@ end
function
cm
.
setfilter2
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCanTurnSet
()
and
c
:
GetType
()
&
0x20004
==
0x20004
end
function
cm
.
alctg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
b1
=
Duel
.
IsExistingMatchingCard
(
cm
.
setfilter1
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
,
tp
)
and
Duel
.
GetFieldGroupCount
(
1
-
tp
,
LOCATION_DECK
,
0
)
>
4
local
b2
=
Duel
.
IsExistingMatchingCard
(
cm
.
tefilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
setfilter2
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
if
chk
==
0
then
return
b1
or
b2
end
local
op
=
0
if
b1
and
b2
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
0
),
aux
.
Stringid
(
m
,
1
))
elseif
b1
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
0
))
else
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
1
))
+
1
end
e
:
SetLabel
(
op
)
if
op
==
0
then
e
:
SetCategory
(
CATEGORY_REMOVE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
5
,
1
-
tp
,
LOCATION_DECK
)
else
e
:
SetCategory
(
CATEGORY_TOEXTRA
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOEXTRA
,
nil
,
1
,
tp
,
LOCATION_ONFIELD
)
function
cm
.
alctg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
setfilter1
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
,
tp
)
and
Duel
.
GetFieldGroupCount
(
1
-
tp
,
LOCATION_DECK
,
0
)
>
4
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_REMOVE
,
nil
,
5
,
1
-
tp
,
LOCATION_DECK
)
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
end
function
cm
.
alctg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
tefilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
setfilter2
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOEXTRA
,
nil
,
1
,
tp
,
LOCATION_ONFIELD
)
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
end
function
cm
.
alcop1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
setfilter1
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
,
tp
)
local
sc
=
sg
:
GetFirst
()
if
not
sc
then
return
end
Duel
.
HintSelection
(
sg
)
sc
:
CancelToGrave
()
local
pos
=
Duel
.
ChangePosition
(
sc
,
POS_FACEDOWN
)
if
pos
==
0
then
return
end
if
sc
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
then
Duel
.
RaiseEvent
(
sc
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
local
g
=
Duel
.
GetDecktopGroup
(
1
-
tp
,
5
)
if
#
g
>
0
then
Duel
.
BreakEffect
()
Duel
.
DisableShuffleCheck
()
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
cm
.
alcop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetLabel
()
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
setfilter1
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
,
tp
)
local
sc
=
sg
:
GetFirst
()
if
not
sc
then
return
end
Duel
.
HintSelection
(
sg
)
sc
:
CancelToGrave
()
local
pos
=
Duel
.
ChangePosition
(
sc
,
POS_FACEDOWN
)
if
pos
==
0
then
return
end
if
sc
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
then
Duel
.
RaiseEvent
(
sc
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
local
g
=
Duel
.
GetDecktopGroup
(
1
-
tp
,
5
)
if
#
g
>
0
then
Duel
.
BreakEffect
()
Duel
.
DisableShuffleCheck
()
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
end
else
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
tefilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
#
g
==
0
then
return
end
if
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_EFFECT
)
==
0
or
not
g
:
GetFirst
():
IsLocation
(
LOCATION_EXTRA
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
setfilter2
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
99
,
nil
)
if
#
sg
==
0
then
return
end
Duel
.
HintSelection
(
sg
)
local
rg
=
Group
.
CreateGroup
()
for
tc
in
aux
.
Next
(
sg
)
do
tc
:
CancelToGrave
()
if
Duel
.
ChangePosition
(
tc
,
POS_FACEDOWN
)
~=
0
and
tc
:
IsFacedown
()
then
rg
:
AddCard
(
tc
)
end
end
Duel
.
RaiseEvent
(
rg
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
for
rc
in
aux
.
Next
(
rg
)
do
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
rc
:
RegisterEffect
(
e1
,
true
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetOperation
(
cm
.
reset
)
e2
:
SetLabelObject
(
e1
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
function
cm
.
alcop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
tefilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
#
g
==
0
then
return
end
if
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_EFFECT
)
==
0
or
not
g
:
GetFirst
():
IsLocation
(
LOCATION_EXTRA
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
setfilter2
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
99
,
nil
)
if
#
sg
==
0
then
return
end
Duel
.
HintSelection
(
sg
)
local
rg
=
Group
.
CreateGroup
()
for
tc
in
aux
.
Next
(
sg
)
do
tc
:
CancelToGrave
()
if
Duel
.
ChangePosition
(
tc
,
POS_FACEDOWN
)
~=
0
and
tc
:
IsFacedown
()
then
rg
:
AddCard
(
tc
)
end
end
Duel
.
RaiseEvent
(
rg
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
for
rc
in
aux
.
Next
(
rg
)
do
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_CANNOT_TRIGGER
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
rc
:
RegisterEffect
(
e1
,
true
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetOperation
(
cm
.
reset
)
e2
:
SetLabelObject
(
e1
)
e2
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e2
,
tp
)
end
end
function
cm
.
reset
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
...
...
@@ -109,6 +109,7 @@ function cm.setfilter3(c)
end
function
cm
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
setfilter3
,
tp
,
LOCATION_DECK
+
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
end
function
cm
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
...
...
expansions/script/c53713008.lua
View file @
e5e8aed7
...
...
@@ -5,15 +5,23 @@ function cm.initial_effect(c)
c
:
EnableReviveLimit
()
aux
.
AddFusionProcFunRep
(
c
,
function
(
c
)
return
c
:
GetOriginalType
()
&
TYPE_TRAP
~=
0
and
c
:
IsFusionType
(
TYPE_MONSTER
)
end
,
2
,
true
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e2
:
SetCategory
(
CATEGORY_DESTROY
+
CATEGORY_REMOVE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e2
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetCondition
(
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
Card
.
IsSummonLocation
,
1
,
nil
,
LOCATION_EXTRA
)
end
)
e2
:
SetTarget
(
cm
.
alctg
)
e2
:
SetOperation
(
cm
.
alcop
)
e2
:
SetTarget
(
cm
.
alctg
1
)
e2
:
SetOperation
(
cm
.
alcop
1
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e3
:
SetCategory
(
CATEGORY_TOEXTRA
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetTarget
(
cm
.
alctg2
)
e3
:
SetOperation
(
cm
.
alcop2
)
c
:
RegisterEffect
(
e3
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e4
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
...
...
@@ -24,57 +32,50 @@ end
function
cm
.
setfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsCanTurnSet
()
and
c
:
GetType
()
&
0x20004
==
0x20004
end
function
cm
.
alctg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
function
cm
.
alctg
1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
c
,
g
=
e
:
GetHandler
(),
eg
:
Filter
(
Card
.
IsSummonLocation
,
nil
,
LOCATION_EXTRA
)
if
chkc
then
return
chkc
:
IsOnField
()
and
chkc
~=
e
:
GetHandler
()
and
not
g
:
IsContains
(
chkc
)
end
local
b1
=
Duel
.
IsExistingTarget
(
aux
.
TRUE
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
g
)
and
Duel
.
GetFlagEffect
(
tp
,
m
)
==
0
local
b2
=
c
:
IsAbleToExtra
()
and
Duel
.
IsExistingMatchingCard
(
cm
.
setfilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
and
Duel
.
GetFlagEffect
(
tp
,
m
+
50
)
==
0
if
chk
==
0
then
return
b1
or
b2
end
local
op
=
0
if
b1
and
b2
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
0
),
aux
.
Stringid
(
m
,
1
))
elseif
b1
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
0
))
else
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
1
))
+
1
end
e
:
SetLabel
(
op
)
if
op
==
0
then
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
e
:
SetCategory
(
CATEGORY_DESTROY
+
CATEGORY_REMOVE
)
e
:
SetProperty
(
EFFECT_FLAG_DELAY
+
EFFECT_FLAG_CARD_TARGET
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
dg
=
Duel
.
SelectTarget
(
tp
,
aux
.
TRUE
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
g
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
dg
,
1
,
0
,
0
)
else
Duel
.
RegisterFlagEffect
(
tp
,
m
+
50
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
e
:
SetCategory
(
CATEGORY_TOEXTRA
)
e
:
SetProperty
(
EFFECT_FLAG_DELAY
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOEXTRA
,
c
,
1
,
0
,
0
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
aux
.
TRUE
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
g
)
and
Duel
.
GetFlagEffect
(
tp
,
m
)
==
0
end
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_DESTROY
)
local
dg
=
Duel
.
SelectTarget
(
tp
,
aux
.
TRUE
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
g
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
dg
,
1
,
0
,
0
)
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
end
function
cm
.
alctg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
c
,
g
=
e
:
GetHandler
(),
eg
:
Filter
(
Card
.
IsSummonLocation
,
nil
,
LOCATION_EXTRA
)
if
chk
==
0
then
return
c
:
IsAbleToExtra
()
and
Duel
.
IsExistingMatchingCard
(
cm
.
setfilter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
and
Duel
.
GetFlagEffect
(
tp
,
m
+
50
)
==
0
end
Duel
.
RegisterFlagEffect
(
tp
,
m
+
50
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOEXTRA
,
c
,
1
,
0
,
0
)
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
end
function
cm
.
alcop1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
not
tc
:
IsRelateToEffect
(
e
)
then
return
end
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
local
dc
=
Duel
.
GetOperatedGroup
():
GetFirst
()
if
not
dc
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
if
not
Duel
.
IsExistingMatchingCard
(
Card
.
IsFaceup
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
,
dc
:
GetCode
())
then
return
end
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
rg
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
0
,
LOCATION_GRAVE
,
1
,
3
,
nil
)
if
#
rg
>
0
then
Duel
.
Remove
(
rg
,
POS_FACEUP
,
REASON_EFFECT
)
end
end
function
cm
.
alcop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetLabel
()
==
0
then
local
tc
=
Duel
.
GetFirstTarget
()
if
not
tc
:
IsRelateToEffect
(
e
)
then
return
end
Duel
.
Destroy
(
tc
,
REASON_EFFECT
)
local
dc
=
Duel
.
GetOperatedGroup
():
GetFirst
()
if
not
dc
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
if
not
Duel
.
IsExistingMatchingCard
(
Card
.
IsFaceup
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
,
dc
:
GetCode
())
then
return
end
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
rg
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
0
,
LOCATION_GRAVE
,
1
,
3
,
nil
)
if
#
rg
>
0
then
Duel
.
Remove
(
rg
,
POS_FACEUP
,
REASON_EFFECT
)
end
else
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
or
c
:
IsFacedown
()
then
return
end
if
Duel
.
SendtoDeck
(
c
,
nil
,
2
,
REASON_EFFECT
)
==
0
or
not
c
:
IsLocation
(
LOCATION_EXTRA
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
setfilter2
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
2
,
nil
)
if
#
sg
==
0
then
return
end
Duel
.
HintSelection
(
sg
)
local
rg
=
Group
.
CreateGroup
()
for
tc
in
aux
.
Next
(
sg
)
do
tc
:
CancelToGrave
()
if
Duel
.
ChangePosition
(
tc
,
POS_FACEDOWN
)
~=
0
and
tc
:
IsFacedown
()
then
rg
:
AddCard
(
tc
)
end
end
Duel
.
RaiseEvent
(
rg
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
function
cm
.
alcop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsRelateToEffect
(
e
)
or
c
:
IsFacedown
()
then
return
end
if
Duel
.
SendtoDeck
(
c
,
nil
,
2
,
REASON_EFFECT
)
==
0
or
not
c
:
IsLocation
(
LOCATION_EXTRA
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
setfilter2
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
2
,
nil
)
if
#
sg
==
0
then
return
end
Duel
.
HintSelection
(
sg
)
local
rg
=
Group
.
CreateGroup
()
for
tc
in
aux
.
Next
(
sg
)
do
tc
:
CancelToGrave
()
if
Duel
.
ChangePosition
(
tc
,
POS_FACEDOWN
)
~=
0
and
tc
:
IsFacedown
()
then
rg
:
AddCard
(
tc
)
end
end
Duel
.
RaiseEvent
(
rg
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
function
cm
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_FUSION
)
...
...
expansions/script/c53713009.lua
View file @
e5e8aed7
...
...
@@ -5,16 +5,23 @@ function cm.initial_effect(c)
c
:
EnableReviveLimit
()
aux
.
AddFusionProcFunRep
(
c
,
function
(
c
)
return
c
:
GetOriginalType
()
&
TYPE_TRAP
~=
0
and
c
:
IsFusionType
(
TYPE_MONSTER
)
end
,
2
,
true
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
2
))
e2
:
SetDescription
(
aux
.
Stringid
(
m
,
0
))
e2
:
SetCategory
(
CATEGORY_NEGATE
+
CATEGORY_TOGRAVE
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DAMAGE_CAL
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCountLimit
(
2
,
m
)
e2
:
SetCondition
(
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
rp
~=
tp
and
not
e
:
GetHandler
():
IsStatus
(
STATUS_BATTLE_DESTROYED
)
and
Duel
.
IsChainNegatable
(
ev
)
end
)
e2
:
SetTarget
(
cm
.
alctg
)
e2
:
SetOperation
(
cm
.
alcop
)
e2
:
SetTarget
(
cm
.
alctg
1
)
e2
:
SetOperation
(
cm
.
alcop
1
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetDescription
(
aux
.
Stringid
(
m
,
1
))
e3
:
SetCategory
(
CATEGORY_TOEXTRA
)
e3
:
SetTarget
(
cm
.
alctg2
)
e3
:
SetOperation
(
cm
.
alcop2
)
c
:
RegisterEffect
(
e3
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e4
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
...
...
@@ -31,50 +38,44 @@ end
function
cm
.
setfilter2
(
c
)
return
c
:
GetType
()
&
0x20004
==
0x20004
and
c
:
IsSSetable
()
end
function
cm
.
alctg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
b1
=
Duel
.
IsExistingMatchingCard
(
cm
.
setfilter1
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
,
eg
:
GetFirst
():
GetCode
())
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToGrave
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
local
b2
=
Duel
.
IsExistingMatchingCard
(
cm
.
tefilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
setfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
if
chk
==
0
then
return
b1
or
b2
end
local
op
=
0
if
b1
and
b2
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
0
),
aux
.
Stringid
(
m
,
1
))
elseif
b1
then
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
0
))
else
op
=
Duel
.
SelectOption
(
tp
,
aux
.
Stringid
(
m
,
1
))
+
1
end
e
:
SetLabel
(
op
)
if
op
==
0
then
e
:
SetCategory
(
CATEGORY_NEGATE
+
CATEGORY_TOGRAVE
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_NEGATE
,
eg
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
1
-
tp
,
LOCATION_ONFIELD
)
else
e
:
SetCategory
(
CATEGORY_TOEXTRA
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOEXTRA
,
nil
,
1
,
tp
,
LOCATION_ONFIELD
)
end
function
cm
.
alctg1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
setfilter1
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
,
eg
:
GetFirst
():
GetCode
())
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToGrave
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_NEGATE
,
eg
,
1
,
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
1
-
tp
,
LOCATION_ONFIELD
)
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
end
function
cm
.
alctg2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
tefilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
cm
.
setfilter2
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOEXTRA
,
nil
,
1
,
tp
,
LOCATION_ONFIELD
)
Duel
.
Hint
(
HINT_OPSELECTED
,
1
-
tp
,
e
:
GetDescription
())
end
function
cm
.
alcop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
e
:
GetLabel
()
==
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
sc
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
setfilter1
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
,
eg
:
GetFirst
():
GetCode
()):
GetFirst
()
if
not
sc
then
return
end
Duel
.
HintSelection
(
Group
.
FromCards
(
sc
))
sc
:
CancelToGrave
()
local
pos
=
Duel
.
ChangePosition
(
sc
,
POS_FACEDOWN
)
if
pos
==
0
then
return
end
if
sc
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
then
Duel
.
RaiseEvent
(
sc
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
if
not
Duel
.
NegateActivation
(
ev
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToGrave
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
g
)
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
else
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
tefilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
#
g
==
0
then
return
end
if
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_EFFECT
)
==
0
or
not
g
:
GetFirst
():
IsLocation
(
LOCATION_EXTRA
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
cm
.
setfilter2
),
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
if
#
sg
==
0
then
return
end
Duel
.
SSet
(
tp
,
sg
:
GetFirst
())
function
cm
.
alcop1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
sc
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
setfilter1
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
,
eg
:
GetFirst
():
GetCode
()):
GetFirst
()
if
not
sc
then
return
end
Duel
.
HintSelection
(
Group
.
FromCards
(
sc
))
sc
:
CancelToGrave
()
local
pos
=
Duel
.
ChangePosition
(
sc
,
POS_FACEDOWN
)
if
pos
==
0
then
return
end
if
sc
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
then
Duel
.
RaiseEvent
(
sc
,
EVENT_SSET
,
e
,
REASON_EFFECT
,
tp
,
tp
,
0
)
end
if
not
Duel
.
NegateActivation
(
ev
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToGrave
,
tp
,
0
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
g
)
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
end
function
cm
.
alcop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
tefilter
,
tp
,
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
#
g
==
0
then
return
end
if
Duel
.
SendtoDeck
(
g
,
nil
,
2
,
REASON_EFFECT
)
==
0
or
not
g
:
GetFirst
():
IsLocation
(
LOCATION_EXTRA
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
aux
.
NecroValleyFilter
(
cm
.
setfilter2
),
tp
,
LOCATION_GRAVE
,
0
,
1
,
1
,
nil
)
if
#
sg
==
0
then
return
end
Duel
.
SSet
(
tp
,
sg
:
GetFirst
())
end
function
cm
.
con
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
e
:
GetHandler
():
IsSummonType
(
SUMMON_TYPE_FUSION
)
end
...
...
expansions/script/c53799175.lua
View file @
e5e8aed7
...
...
@@ -51,13 +51,26 @@ function cm.remcost(e,tp,eg,ep,ev,re,r,rp,chk)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
if
Duel
.
GetCurrentPhase
()
==
PHASE_END
then
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
,
2
)
e1
:
SetValue
(
Duel
.
GetTurnCount
())
rc
:
RegisterFlagEffect
(
m
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
,
0
,
2
)
else
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
e1
:
SetValue
(
0
)
rc
:
RegisterFlagEffect
(
m
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
e1
:
SetLabelObject
(
rc
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCondition
(
cm
.
retcon
)
e1
:
SetOperation
(
cm
.
retop
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
end
function
cm
.
retcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
GetTurnCount
()
==
e
:
GetValue
()
then
return
false
end
return
e
:
GetLabelObject
():
GetFlagEffect
(
m
)
~=
0
end
function
cm
.
retop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
ReturnToField
(
e
:
GetLabelObject
())
end
...
...
expansions/script/c64800134.lua
View file @
e5e8aed7
...
...
@@ -3,7 +3,7 @@ local m=64800134
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
--synchro summon
aux
.
AddSynchroProcedure
(
c
,
aux
.
FilterBoolFunction
(
nil
)
,
aux
.
NonTuner
(
nil
),
1
)
aux
.
AddSynchroProcedure
(
c
,
nil
,
aux
.
NonTuner
(
nil
),
1
)
c
:
EnableReviveLimit
()
--decrease atk/def
local
e2
=
Effect
.
CreateEffect
(
c
)
...
...
expansions/script/c67200320.lua
View file @
e5e8aed7
...
...
@@ -69,6 +69,7 @@ function c67200320.target(event)
local
te
,
ceg
,
cep
,
cev
,
cre
,
cr
,
crp
=
g
:
GetFirst
():
CheckActivateEffect
(
false
,
true
,
true
)
Duel
.
GetCurrentChain
=
_GetCurrentChain
Duel
.
SendtoHand
(
g
,
nil
,
REASON_COST
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
e
:
SetProperty
(
te
:
GetProperty
())
local
tg
=
te
:
GetTarget
()
if
tg
then
tg
(
e
,
tp
,
ceg
,
cep
,
cev
,
cre
,
cr
,
crp
,
1
)
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