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
Nemo Ma
no81cards
Commits
59a68af3
Commit
59a68af3
authored
Apr 02, 2025
by
POLYMER
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
23d16351
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
426 additions
and
364 deletions
+426
-364
expansions/script/c11410000.lua
expansions/script/c11410000.lua
+41
-9
expansions/script/c11450997.lua
expansions/script/c11450997.lua
+4
-8
expansions/script/c11451548.lua
expansions/script/c11451548.lua
+3
-5
expansions/script/c11451652.lua
expansions/script/c11451652.lua
+5
-7
expansions/script/c11451655.lua
expansions/script/c11451655.lua
+1
-4
expansions/script/c11451835.lua
expansions/script/c11451835.lua
+2
-5
expansions/script/c28321714.lua
expansions/script/c28321714.lua
+1
-0
expansions/script/c89390000.lua
expansions/script/c89390000.lua
+85
-84
expansions/script/c89390001.lua
expansions/script/c89390001.lua
+85
-84
expansions/script/c89390002.lua
expansions/script/c89390002.lua
+146
-145
expansions/script/c89390100.lua
expansions/script/c89390100.lua
+10
-2
expansions/script/c89390102.lua
expansions/script/c89390102.lua
+10
-2
expansions/script/c89390106.lua
expansions/script/c89390106.lua
+10
-2
expansions/script/c89390108.lua
expansions/script/c89390108.lua
+10
-2
expansions/script/c91300037.lua
expansions/script/c91300037.lua
+3
-3
expansions/script/c91300051.lua
expansions/script/c91300051.lua
+1
-1
expansions/script/special.lua
expansions/script/special.lua
+9
-1
No files found.
expansions/script/c11410000.lua
View file @
59a68af3
...
...
@@ -97,16 +97,42 @@ if not Duel.LoadScript and loadfile then
return
require_list
[
str
]
end
end
if
not
dofile
and
Duel
.
LoadScript
then
function
dofile
(
str
)
require_list
=
require_list
or
{}
local
name
=
str
for
word
in
string.gmatch
(
str
,
"%w+"
)
do
name
=
word
end
if
not
require_list
[
str
]
then
require_list
[
str
]
=
Duel
.
LoadScript
(
name
)
end
return
require_list
[
str
]
end
function
loadfile
(
str
)
require_list
=
require_list
or
{}
local
name
=
str
for
word
in
string.gmatch
(
str
,
"%w+"
)
do
name
=
word
end
return
function
()
if
not
require_list
[
str
]
then
require_list
[
str
]
=
Duel
.
LoadScript
(
name
)
end
return
require_list
[
str
]
end
end
end
function
cm
.
nnfilter
(
c
,
ec
)
if
c
:
GetOriginalType
()
==
0x11
or
c
:
GetOriginalType
()
==
0x1011
then
return
false
end
if
c
:
GetOriginalType
()
&
0x11
==
0x11
and
c
:
GetOriginalType
()
&
TYPE_PENDULUM
==
0
then
return
false
end
if
not
c
.
initial_effect
then
return
true
end
return
false
end
function
cm
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
--if apricot_nightfall_adjust then return end
apricot_nightfall_adjust
=
true
e
:
Reset
()
local
c
=
e
:
GetHandler
()
e
:
Reset
()
local
tp
=
c
:
GetControler
()
local
g
=
Duel
.
GetMatchingGroup
(
nil
,
tp
,
LOCATION_DECK
,
0
,
nil
)
if
c
:
IsLocation
(
LOCATION_DECK
)
and
#
g
>=
36
then
...
...
@@ -120,16 +146,22 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
if
not
cm
.
r
then
cm
.
r
=
Duel
.
GetFieldGroup
(
0
,
LOCATION_DECK
+
LOCATION_HAND
,
LOCATION_DECK
+
LOCATION_EXTRA
):
GetSum
(
Card
.
GetCode
)
end
--[[local tab={}
for i=1,10000000 do
tab[cm.r]=true
cm.roll(1,#g)
if i%100000==0 then Debug.Message(cm.r) end
if tab[cm.r] then Debug.Message(i.." "..cm.r) end
end--]]
local
ct
=
cm
.
roll
(
1
,
#
g
)
-
1
local
tc
=
g
:
Filter
(
function
(
c
)
return
c
:
GetSequence
()
==
ct
end
,
nil
):
GetFirst
()
if
KOISHI_CHECK
then
c
:
SetEntityCode
(
tc
:
GetOriginalCode
())
local
ini
=
cm
.
initial_effect
cm
.
initial_effect
=
function
()
end
c
:
ReplaceEffect
(
m
,
0
)
c
:
SetStatus
(
STATUS_EFFECT_REPLACED
,
false
)
cm
.
initial_effect
=
ini
if
tc
.
initial_effect
then
tc
.
initial_effect
(
c
)
end
if
tc
:
GetOriginalType
()
&
0x11
~=
0x11
or
tc
:
GetOriginalType
()
&
TYPE_PENDULUM
>
0
then
c
:
ReplaceEffect
(
tc
:
GetOriginalCode
(),
0
)
else
c
:
ReplaceEffect
(
80316585
,
0
)
end
Duel
.
DisableShuffleCheck
()
Duel
.
Exile
(
tc
,
0
)
else
...
...
@@ -165,7 +197,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
GetID
=
function
()
return
_G
[
"c"
..
int
],
int
,
int
<
100000000
and
1
or
100
end
require
(
"expansions/script/c"
..
int
)
pcall
(
require
,
"expansions/script/c"
..
int
)
local
ini
=
ac
.
initial_effect
if
ini
then
stack
[
#
stack
+
1
]
=
ac
end
end
...
...
expansions/script/c11450997.lua
View file @
59a68af3
...
...
@@ -48,14 +48,10 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
if
KOISHI_CHECK
then
local
code
=
g
:
GetFirst
():
GetOriginalCode
()
c
:
SetEntityCode
(
code
)
local
ini
=
cm
.
initial_effect
cm
.
initial_effect
=
function
()
end
c
:
ReplaceEffect
(
m
,
0
)
cm
.
initial_effect
=
ini
if
not
g
:
GetFirst
():
IsType
(
TYPE_NORMAL
)
or
g
:
GetFirst
():
IsType
(
TYPE_PENDULUM
)
then
local
cn
=
getmetatable
(
g
:
GetFirst
())
if
cn
then
cn
.
initial_effect
(
c
)
end
--c:ReplaceEffect(code,0)
if
g
:
GetFirst
():
GetOriginalType
()
&
0x11
~=
0x11
or
g
:
GetFirst
():
GetOriginalType
()
&
TYPE_PENDULUM
>
0
then
c
:
ReplaceEffect
(
code
,
0
)
else
c
:
ReplaceEffect
(
80316585
,
0
)
end
Duel
.
ConfirmCards
(
1
-
tp
,
c
)
Duel
.
ShuffleDeck
(
tp
)
...
...
expansions/script/c11451548.lua
View file @
59a68af3
...
...
@@ -68,6 +68,7 @@ function cm.cpop(e,tp,eg,ep,ev,re,r,rp)
local
tc
=
Duel
.
GetFirstTarget
()
local
g
=
Duel
.
GetMatchingGroup
(
cm
.
filter2
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
tc
,
tc
:
GetLevel
())
if
tc
and
c
:
IsRelateToEffect
(
e
)
and
tc
:
IsRelateToEffect
(
e
)
and
(
not
tc
:
IsLocation
(
LOCATION_MZONE
)
or
tc
:
IsFaceup
())
and
#
g
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
local
fc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
local
code
=
tc
:
GetOriginalCode
()
local
e1
=
Effect
.
CreateEffect
(
c
)
...
...
@@ -78,13 +79,10 @@ function cm.cpop(e,tp,eg,ep,ev,re,r,rp)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
)
fc
:
RegisterEffect
(
e1
)
if
fc
:
IsImmuneToEffect
(
e
)
then
return
end
if
tc
:
GetOriginalType
()
&
TYPE_NORMAL
==
0
then
if
tc
:
GetOriginalType
()
&
0x11
~=
0x11
or
tc
:
GetOriginalType
()
&
TYPE_PENDULUM
>
0
then
fc
:
ReplaceEffect
(
code
,
RESET_EVENT
+
RESETS_STANDARD
,
1
)
else
local
ini
=
cm
.
initial_effect
cm
.
initial_effect
=
function
()
end
fc
:
ReplaceEffect
(
m
,
RESET_EVENT
+
RESETS_STANDARD
,
1
)
cm
.
initial_effect
=
ini
fc
:
ReplaceEffect
(
80316585
,
RESET_EVENT
+
RESETS_STANDARD
,
1
)
end
end
end
\ No newline at end of file
expansions/script/c11451652.lua
View file @
59a68af3
...
...
@@ -25,7 +25,7 @@ function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local
rc
=
re
:
GetHandler
()
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
0x20000000
+
m
)
e1
:
SetCode
(
EFFECT_FLAG_EFFECT
+
m
)
e1
:
SetLabelObject
(
re
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
+
EFFECT_FLAG_UNCOPYABLE
+
EFFECT_FLAG_IGNORE_IMMUNE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
...
...
@@ -56,6 +56,8 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
end
end--]]
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsOriginalCodeRule
,
tp
,
0xff
,
0xff
,
nil
,
ac
)
local
og
=
Duel
.
GetOverlayGroup
(
0
,
1
,
1
):
Filter
(
Card
.
IsOriginalCodeRule
,
nil
,
ac
)
g
:
Merge
(
og
)
local
reg
=
Card
.
RegisterEffect
local
ctl
=
Effect
.
SetCountLimit
Effect
.
SetCountLimit
=
function
(
se
,
ct
,
code
)
...
...
@@ -76,7 +78,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
reg
(
sc
,
se
,
true
)
if
cm
[
se
]
then
cm
[
se
]
=
nil
local
eset
=
{
sc
:
IsHasEffect
(
0x20000000
+
m
)}
local
eset
=
{
sc
:
IsHasEffect
(
EFFECT_FLAG_EFFECT
+
m
)}
if
#
eset
>
0
then
local
ct
=
0
for
_
,
ee
in
pairs
(
eset
)
do
...
...
@@ -88,11 +90,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
end
for
tc
in
aux
.
Next
(
g
)
do
if
tc
.
initial_effect
then
local
ini
=
cm
.
initial_effect
cm
.
initial_effect
=
function
()
end
tc
:
ReplaceEffect
(
m
,
0
)
cm
.
initial_effect
=
ini
tc
.
initial_effect
(
tc
)
tc
:
ReplaceEffect
(
tc
:
GetOriginalCode
(),
0
)
end
end
Card
.
RegisterEffect
=
reg
...
...
expansions/script/c11451655.lua
View file @
59a68af3
...
...
@@ -44,10 +44,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsPlayerCanSpecialSummonMonster
(
tp
,
58192742
,
0
,
0x11
,
300
,
200
,
1
,
RACE_INSECT
,
ATTRIBUTE_EARTH
)
then
if
KOISHI_CHECK
then
c
:
SetEntityCode
(
58192742
,
true
)
local
ini
=
cm
.
initial_effect
cm
.
initial_effect
=
function
()
end
c
:
ReplaceEffect
(
m
,
0
)
cm
.
initial_effect
=
ini
c
:
ReplaceEffect
(
80316585
,
0
)
else
Duel
.
Remove
(
c
,
POS_FACEDOWN
,
REASON_RULE
)
c
=
Duel
.
CreateToken
(
tp
,
58192742
)
...
...
expansions/script/c11451835.lua
View file @
59a68af3
...
...
@@ -185,13 +185,10 @@ function cm.mvop(e,tp,eg,ep,ev,re,r,rp,opt,lab)
local
tc
=
g2
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
local
code
=
tc
:
GetOriginalCode
()
if
not
fc
:
IsImmuneToEffect
(
e
)
then
if
tc
:
GetOriginalType
()
&
TYPE_NORMAL
==
0
then
if
tc
:
GetOriginalType
()
&
0x11
~=
0x11
or
tc
:
GetOriginalType
()
&
TYPE_PENDULUM
>
0
then
fc
:
ReplaceEffect
(
code
,
RESET_EVENT
+
RESETS_STANDARD
,
1
)
else
local
ini
=
cm
.
initial_effect
cm
.
initial_effect
=
function
()
end
fc
:
ReplaceEffect
(
m
,
RESET_EVENT
+
RESETS_STANDARD
,
1
)
cm
.
initial_effect
=
ini
fc
:
ReplaceEffect
(
80316585
,
RESET_EVENT
+
RESETS_STANDARD
,
1
)
end
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
...
...
expansions/script/c28321714.lua
View file @
59a68af3
...
...
@@ -43,6 +43,7 @@ function c28321714.activate(e,tp,eg,ep,ev,re,r,rp)
Duel
.
ConfirmDecktop
(
p
,
ct
)
local
g
=
Duel
.
GetDecktopGroup
(
p
,
ct
)
if
#
g
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
sg
=
g
:
FilterSelect
(
tp
,
c28321714
.
thfilter
,
0
,
#
g
,
nil
)
if
#
sg
>
0
then
Duel
.
DisableShuffleCheck
()
...
...
expansions/script/c89390000.lua
View file @
59a68af3
...
...
@@ -2,108 +2,109 @@
local
m
=
89390000
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
+
CATEGORY_REMOVE
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetRange
(
LOCATION_MZONE
+
LOCATION_HAND
)
e2
:
SetCondition
(
cm
.
thcon
)
e2
:
SetCost
(
cm
.
thcost
)
e2
:
SetTarget
(
cm
.
thtg
)
e2
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e2
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_TODECK
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetCode
(
EVENT_REMOVE
)
e1
:
SetTarget
(
cm
.
srettg
)
e1
:
SetOperation
(
cm
.
sretop
)
c
:
RegisterEffect
(
e1
)
if
not
cm
.
global_check
then
cm
.
global_check
=
true
cm
[
0
]
=
{}
cm
[
1
]
=
{}
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetOperation
(
cm
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
local
ge2
=
ge1
:
Clone
()
ge2
:
SetCode
(
EVENT_CHAIN_NEGATED
)
ge2
:
SetOperation
(
cm
.
regop2
)
Duel
.
RegisterEffect
(
ge2
,
0
)
local
ge4
=
Effect
.
CreateEffect
(
c
)
ge4
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge4
:
SetCode
(
EVENT_PHASE_START
+
PHASE_DRAW
)
ge4
:
SetOperation
(
cm
.
clearop
)
Duel
.
RegisterEffect
(
ge4
,
0
)
end
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
+
CATEGORY_REMOVE
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetRange
(
LOCATION_MZONE
+
LOCATION_HAND
)
e2
:
SetCondition
(
cm
.
thcon
)
e2
:
SetCost
(
cm
.
thcost
)
e2
:
SetTarget
(
cm
.
thtg
)
e2
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e2
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_TODECK
+
CATEGORY_TOHAND
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetCode
(
EVENT_REMOVE
)
e1
:
SetTarget
(
cm
.
srettg
)
e1
:
SetOperation
(
cm
.
sretop
)
c
:
RegisterEffect
(
e1
)
if
not
cm
.
global_check
then
cm
.
global_check
=
true
cm
[
0
]
=
{}
cm
[
1
]
=
{}
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetOperation
(
cm
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
local
ge2
=
ge1
:
Clone
()
ge2
:
SetCode
(
EVENT_CHAIN_NEGATED
)
ge2
:
SetOperation
(
cm
.
regop2
)
Duel
.
RegisterEffect
(
ge2
,
0
)
local
ge4
=
Effect
.
CreateEffect
(
c
)
ge4
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge4
:
SetCode
(
EVENT_PHASE_START
+
PHASE_DRAW
)
ge4
:
SetOperation
(
cm
.
clearop
)
Duel
.
RegisterEffect
(
ge4
,
0
)
end
end
function
cm
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
rp
==
1
-
tp
return
rp
==
1
-
tp
end
function
cm
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToRemoveAsCost
()
end
Duel
.
Remove
(
e
:
GetHandler
(),
POS_FACEUP
,
REASON_COST
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToRemoveAsCost
()
end
Duel
.
Remove
(
e
:
GetHandler
(),
POS_FACEUP
,
REASON_COST
)
end
function
cm
.
thfilter
(
c
)
return
c
:
IsRace
(
RACE_PSYCHO
)
and
not
c
:
IsCode
(
m
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
return
c
:
IsRace
(
RACE_PSYCHO
)
and
not
c
:
IsCode
(
m
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetChainLimit
(
aux
.
FALSE
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetChainLimit
(
aux
.
FALSE
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
tg
:
GetCount
()
>
0
then
local
tc
=
tg
:
GetFirst
()
if
Duel
.
Remove
(
tg
,
POS_FACEUP
,
REASON_EFFECT
)
==
0
or
not
tc
:
IsLocation
(
LOCATION_REMOVED
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
tg
:
GetCount
()
>
0
then
local
tc
=
tg
:
GetFirst
()
if
Duel
.
Remove
(
tg
,
POS_FACEUP
,
REASON_EFFECT
)
==
0
or
not
tc
:
IsLocation
(
LOCATION_REMOVED
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
end
function
cm
.
srettg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
e
:
GetHandler
(),
1
,
0
,
0
)
Duel
.
SetChainLimit
(
aux
.
FALSE
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
e
:
GetHandler
(),
1
,
0
,
0
)
Duel
.
SetChainLimit
(
aux
.
FALSE
)
end
function
cm
.
sretop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
SendtoDeck
(
c
,
nil
,
2
,
REASON_EFFECT
)
>
0
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToHand
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
and
Duel
.
GetFlagEffect
(
tp
,
m
)
==
0
then
local
copyt
=
cm
[
tp
]
local
exg
=
Group
.
CreateGroup
()
for
k
,
v
in
pairs
(
copyt
)
do
if
k
and
v
then
exg
:
AddCard
(
k
)
end
end
local
cd
=
3
if
c89390009
then
cd
=
c89390009
.
cd
end
if
exg
:
GetClassCount
(
Card
.
GetOriginalCode
)
>=
cd
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RTOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToHand
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
if
g
:
GetCount
()
==
1
then
Duel
.
HintSelection
(
g
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
end
end
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
SendtoDeck
(
c
,
nil
,
2
,
REASON_EFFECT
)
>
0
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToHand
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
and
Duel
.
GetFlagEffect
(
tp
,
m
)
==
0
then
local
copyt
=
cm
[
tp
]
local
exg
=
Group
.
CreateGroup
()
for
k
,
v
in
pairs
(
copyt
)
do
if
k
and
v
then
exg
:
AddCard
(
k
)
end
end
local
cd
=
3
if
c89390009
then
cd
=
c89390009
.
cd
end
if
exg
:
GetClassCount
(
Card
.
GetOriginalCode
)
>=
cd
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RTOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToHand
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
if
g
:
GetCount
()
==
1
then
Duel
.
HintSelection
(
g
)
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
end
end
end
function
cm
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
if
re
:
IsActiveType
(
TYPE_MONSTER
)
and
rc
:
IsRace
(
RACE_PSYCHO
)
then
cm
[
rp
][
rc
]
=
1
end
local
rc
=
re
:
GetHandler
()
if
re
:
IsActiveType
(
TYPE_MONSTER
)
and
rc
:
IsRace
(
RACE_PSYCHO
)
then
if
cm
[
rp
][
rc
]
then
cm
[
rp
][
rc
]
=
cm
[
rp
][
rc
]
+
1
else
cm
[
rp
][
rc
]
=
1
end
end
end
function
cm
.
regop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
cm
[
rp
][
re
:
GetHandler
()]
=
nil
local
rc
=
re
:
GetHandler
()
if
cm
[
rp
][
rc
]
then
cm
[
rp
][
rc
]
=
cm
[
rp
][
rc
]
-
1
else
cm
[
rp
][
rc
]
=
nil
end
end
function
cm
.
clearop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
cm
[
0
]
=
{}
cm
[
1
]
=
{}
cm
[
0
]
=
{}
cm
[
1
]
=
{}
end
expansions/script/c89390001.lua
View file @
59a68af3
...
...
@@ -2,108 +2,109 @@
local
m
=
89390001
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
+
CATEGORY_REMOVE
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetRange
(
LOCATION_MZONE
+
LOCATION_HAND
)
e2
:
SetCondition
(
cm
.
thcon
)
e2
:
SetCost
(
cm
.
thcost
)
e2
:
SetTarget
(
cm
.
thtg
)
e2
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e2
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_TODECK
+
CATEGORY_REMOVE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetCode
(
EVENT_REMOVE
)
e1
:
SetTarget
(
cm
.
srettg
)
e1
:
SetOperation
(
cm
.
sretop
)
c
:
RegisterEffect
(
e1
)
if
not
cm
.
global_check
then
cm
.
global_check
=
true
cm
[
0
]
=
{}
cm
[
1
]
=
{}
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetOperation
(
cm
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
local
ge2
=
ge1
:
Clone
()
ge2
:
SetCode
(
EVENT_CHAIN_NEGATED
)
ge2
:
SetOperation
(
cm
.
regop2
)
Duel
.
RegisterEffect
(
ge2
,
0
)
local
ge4
=
Effect
.
CreateEffect
(
c
)
ge4
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge4
:
SetCode
(
EVENT_PHASE_START
+
PHASE_DRAW
)
ge4
:
SetOperation
(
cm
.
clearop
)
Duel
.
RegisterEffect
(
ge4
,
0
)
end
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
+
CATEGORY_REMOVE
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetRange
(
LOCATION_MZONE
+
LOCATION_HAND
)
e2
:
SetCondition
(
cm
.
thcon
)
e2
:
SetCost
(
cm
.
thcost
)
e2
:
SetTarget
(
cm
.
thtg
)
e2
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e2
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_TODECK
+
CATEGORY_REMOVE
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetCode
(
EVENT_REMOVE
)
e1
:
SetTarget
(
cm
.
srettg
)
e1
:
SetOperation
(
cm
.
sretop
)
c
:
RegisterEffect
(
e1
)
if
not
cm
.
global_check
then
cm
.
global_check
=
true
cm
[
0
]
=
{}
cm
[
1
]
=
{}
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetOperation
(
cm
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
local
ge2
=
ge1
:
Clone
()
ge2
:
SetCode
(
EVENT_CHAIN_NEGATED
)
ge2
:
SetOperation
(
cm
.
regop2
)
Duel
.
RegisterEffect
(
ge2
,
0
)
local
ge4
=
Effect
.
CreateEffect
(
c
)
ge4
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge4
:
SetCode
(
EVENT_PHASE_START
+
PHASE_DRAW
)
ge4
:
SetOperation
(
cm
.
clearop
)
Duel
.
RegisterEffect
(
ge4
,
0
)
end
end
function
cm
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
rp
==
1
-
tp
return
rp
==
1
-
tp
end
function
cm
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToRemoveAsCost
()
end
Duel
.
Remove
(
e
:
GetHandler
(),
POS_FACEUP
,
REASON_COST
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToRemoveAsCost
()
end
Duel
.
Remove
(
e
:
GetHandler
(),
POS_FACEUP
,
REASON_COST
)
end
function
cm
.
thfilter
(
c
)
return
c
:
IsRace
(
RACE_PSYCHO
)
and
not
c
:
IsCode
(
m
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
return
c
:
IsRace
(
RACE_PSYCHO
)
and
not
c
:
IsCode
(
m
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetChainLimit
(
aux
.
FALSE
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetChainLimit
(
aux
.
FALSE
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
tg
:
GetCount
()
>
0
then
local
tc
=
tg
:
GetFirst
()
if
Duel
.
Remove
(
tg
,
POS_FACEUP
,
REASON_EFFECT
)
==
0
or
not
tc
:
IsLocation
(
LOCATION_REMOVED
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
tg
:
GetCount
()
>
0
then
local
tc
=
tg
:
GetFirst
()
if
Duel
.
Remove
(
tg
,
POS_FACEUP
,
REASON_EFFECT
)
==
0
or
not
tc
:
IsLocation
(
LOCATION_REMOVED
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
end
function
cm
.
srettg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
e
:
GetHandler
(),
1
,
0
,
0
)
Duel
.
SetChainLimit
(
aux
.
FALSE
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
e
:
GetHandler
(),
1
,
0
,
0
)
Duel
.
SetChainLimit
(
aux
.
FALSE
)
end
function
cm
.
sretop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
SendtoDeck
(
c
,
nil
,
2
,
REASON_EFFECT
)
>
0
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
nil
)
and
Duel
.
GetFlagEffect
(
tp
,
m
)
==
0
then
local
copyt
=
cm
[
tp
]
local
exg
=
Group
.
CreateGroup
()
for
k
,
v
in
pairs
(
copyt
)
do
if
k
and
v
then
exg
:
AddCard
(
k
)
end
end
local
cd
=
3
if
c89390009
then
cd
=
c89390009
.
cd
end
if
exg
:
GetClassCount
(
Card
.
GetOriginalCode
)
>=
cd
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
2
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
g
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
end
end
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
SendtoDeck
(
c
,
nil
,
2
,
REASON_EFFECT
)
>
0
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
nil
)
and
Duel
.
GetFlagEffect
(
tp
,
m
)
==
0
then
local
copyt
=
cm
[
tp
]
local
exg
=
Group
.
CreateGroup
()
for
k
,
v
in
pairs
(
copyt
)
do
if
k
and
v
then
exg
:
AddCard
(
k
)
end
end
local
cd
=
3
if
c89390009
then
cd
=
c89390009
.
cd
end
if
exg
:
GetClassCount
(
Card
.
GetOriginalCode
)
>=
cd
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
2
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
HintSelection
(
g
)
Duel
.
Remove
(
g
,
POS_FACEUP
,
REASON_EFFECT
)
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
end
end
end
function
cm
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
if
re
:
IsActiveType
(
TYPE_MONSTER
)
and
rc
:
IsRace
(
RACE_PSYCHO
)
then
cm
[
rp
][
rc
]
=
1
end
local
rc
=
re
:
GetHandler
()
if
re
:
IsActiveType
(
TYPE_MONSTER
)
and
rc
:
IsRace
(
RACE_PSYCHO
)
then
if
cm
[
rp
][
rc
]
then
cm
[
rp
][
rc
]
=
cm
[
rp
][
rc
]
+
1
else
cm
[
rp
][
rc
]
=
1
end
end
end
function
cm
.
regop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
cm
[
rp
][
re
:
GetHandler
()]
=
nil
local
rc
=
re
:
GetHandler
()
if
cm
[
rp
][
rc
]
then
cm
[
rp
][
rc
]
=
cm
[
rp
][
rc
]
-
1
else
cm
[
rp
][
rc
]
=
nil
end
end
function
cm
.
clearop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
cm
[
0
]
=
{}
cm
[
1
]
=
{}
cm
[
0
]
=
{}
cm
[
1
]
=
{}
end
expansions/script/c89390002.lua
View file @
59a68af3
...
...
@@ -2,179 +2,180 @@
local
m
=
89390002
local
cm
=
_G
[
"c"
..
m
]
function
cm
.
initial_effect
(
c
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
+
CATEGORY_REMOVE
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetRange
(
LOCATION_MZONE
+
LOCATION_HAND
)
e2
:
SetCondition
(
cm
.
thcon
)
e2
:
SetCost
(
cm
.
thcost
)
e2
:
SetTarget
(
cm
.
thtg
)
e2
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e2
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_FUSION_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetCode
(
EVENT_REMOVE
)
e1
:
SetTarget
(
cm
.
srettg
)
e1
:
SetOperation
(
cm
.
sretop
)
c
:
RegisterEffect
(
e1
)
if
not
cm
.
global_check
then
cm
.
global_check
=
true
cm
[
0
]
=
{}
cm
[
1
]
=
{}
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetOperation
(
cm
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
local
ge2
=
ge1
:
Clone
()
ge2
:
SetCode
(
EVENT_CHAIN_NEGATED
)
ge2
:
SetOperation
(
cm
.
regop2
)
Duel
.
RegisterEffect
(
ge2
,
0
)
local
ge4
=
Effect
.
CreateEffect
(
c
)
ge4
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge4
:
SetCode
(
EVENT_PHASE_START
+
PHASE_DRAW
)
ge4
:
SetOperation
(
cm
.
clearop
)
Duel
.
RegisterEffect
(
ge4
,
0
)
end
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
+
CATEGORY_REMOVE
)
e2
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e2
:
SetCode
(
EVENT_CHAINING
)
e2
:
SetRange
(
LOCATION_MZONE
+
LOCATION_HAND
)
e2
:
SetCondition
(
cm
.
thcon
)
e2
:
SetCost
(
cm
.
thcost
)
e2
:
SetTarget
(
cm
.
thtg
)
e2
:
SetOperation
(
cm
.
thop
)
c
:
RegisterEffect
(
e2
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
+
CATEGORY_SPECIAL_SUMMON
+
CATEGORY_FUSION_SUMMON
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_F
)
e1
:
SetCode
(
EVENT_REMOVE
)
e1
:
SetTarget
(
cm
.
srettg
)
e1
:
SetOperation
(
cm
.
sretop
)
c
:
RegisterEffect
(
e1
)
if
not
cm
.
global_check
then
cm
.
global_check
=
true
cm
[
0
]
=
{}
cm
[
1
]
=
{}
local
ge1
=
Effect
.
CreateEffect
(
c
)
ge1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge1
:
SetCode
(
EVENT_CHAINING
)
ge1
:
SetOperation
(
cm
.
checkop
)
Duel
.
RegisterEffect
(
ge1
,
0
)
local
ge2
=
ge1
:
Clone
()
ge2
:
SetCode
(
EVENT_CHAIN_NEGATED
)
ge2
:
SetOperation
(
cm
.
regop2
)
Duel
.
RegisterEffect
(
ge2
,
0
)
local
ge4
=
Effect
.
CreateEffect
(
c
)
ge4
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
ge4
:
SetCode
(
EVENT_PHASE_START
+
PHASE_DRAW
)
ge4
:
SetOperation
(
cm
.
clearop
)
Duel
.
RegisterEffect
(
ge4
,
0
)
end
end
function
cm
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
rp
==
1
-
tp
return
rp
==
1
-
tp
end
function
cm
.
thcost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToRemoveAsCost
()
end
Duel
.
Remove
(
e
:
GetHandler
(),
POS_FACEUP
,
REASON_COST
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToRemoveAsCost
()
end
Duel
.
Remove
(
e
:
GetHandler
(),
POS_FACEUP
,
REASON_COST
)
end
function
cm
.
thfilter
(
c
)
return
c
:
IsRace
(
RACE_PSYCHO
)
and
not
c
:
IsCode
(
m
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
return
c
:
IsRace
(
RACE_PSYCHO
)
and
not
c
:
IsCode
(
m
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsAbleToHand
()
end
function
cm
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetChainLimit
(
aux
.
FALSE
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
nil
)
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToRemove
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
e
:
GetHandler
())
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_DECK
)
Duel
.
SetChainLimit
(
aux
.
FALSE
)
end
function
cm
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
tg
:
GetCount
()
>
0
then
local
tc
=
tg
:
GetFirst
()
if
Duel
.
Remove
(
tg
,
POS_FACEUP
,
REASON_EFFECT
)
==
0
or
not
tc
:
IsLocation
(
LOCATION_REMOVED
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_REMOVE
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToRemove
,
tp
,
LOCATION_HAND
+
LOCATION_ONFIELD
,
0
,
1
,
1
,
nil
)
if
tg
:
GetCount
()
>
0
then
local
tc
=
tg
:
GetFirst
()
if
Duel
.
Remove
(
tg
,
POS_FACEUP
,
REASON_EFFECT
)
==
0
or
not
tc
:
IsLocation
(
LOCATION_REMOVED
)
then
return
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
cm
.
thfilter
,
tp
,
LOCATION_DECK
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
end
function
cm
.
srettg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
e
:
GetHandler
(),
1
,
0
,
0
)
Duel
.
SetChainLimit
(
aux
.
FALSE
)
if
chk
==
0
then
return
true
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
e
:
GetHandler
(),
1
,
0
,
0
)
Duel
.
SetChainLimit
(
aux
.
FALSE
)
end
function
cm
.
sretop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
SendtoDeck
(
c
,
nil
,
2
,
REASON_EFFECT
)
>
0
and
cm
.
ckecktarget
(
e
,
tp
)
and
Duel
.
GetFlagEffect
(
tp
,
m
)
==
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
local
chkf
=
tp
local
mg1
=
Duel
.
GetFusionMaterial
(
tp
)
local
copyt
=
cm
[
tp
]
local
exg
=
Group
.
CreateGroup
()
for
k
,
v
in
pairs
(
copyt
)
do
if
k
and
v
then
exg
:
AddCard
(
k
)
end
end
local
cd
=
3
if
c89390009
then
cd
=
c89390009
.
cd
end
if
exg
:
GetClassCount
(
Card
.
GetOriginalCode
)
>=
cd
then
local
mg2
=
Duel
.
GetMatchingGroup
(
cm
.
filter0
,
tp
,
LOCATION_DECK
,
0
,
nil
,
tp
,
exg
)
mg1
:
Merge
(
mg2
)
end
aux
.
FCheckAdditional
=
cm
.
fcheck
local
sg1
=
Duel
.
GetMatchingGroup
(
cm
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
e
,
tp
,
mg1
,
nil
,
chkf
)
aux
.
FCheckAdditional
=
nil
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
(
cm
.
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
aux
.
FCheckAdditional
=
cm
.
fcheck
local
mat1
=
Duel
.
SelectFusionMaterial
(
tp
,
tc
,
mg1
,
nil
,
chkf
)
aux
.
FCheckAdditional
=
nil
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
()
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
end
local
c
=
e
:
GetHandler
()
if
c
:
IsRelateToEffect
(
e
)
and
Duel
.
SendtoDeck
(
c
,
nil
,
2
,
REASON_EFFECT
)
>
0
and
cm
.
ckecktarget
(
e
,
tp
)
and
Duel
.
GetFlagEffect
(
tp
,
m
)
==
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
m
,
0
))
then
local
chkf
=
tp
local
mg1
=
Duel
.
GetFusionMaterial
(
tp
)
local
copyt
=
cm
[
tp
]
local
exg
=
Group
.
CreateGroup
()
for
k
,
v
in
pairs
(
copyt
)
do
if
k
and
v
then
exg
:
AddCard
(
k
)
end
end
local
cd
=
3
if
c89390009
then
cd
=
c89390009
.
cd
end
if
exg
:
GetClassCount
(
Card
.
GetOriginalCode
)
>=
cd
then
local
mg2
=
Duel
.
GetMatchingGroup
(
cm
.
filter0
,
tp
,
LOCATION_DECK
,
0
,
nil
,
tp
,
exg
)
mg1
:
Merge
(
mg2
)
end
aux
.
FCheckAdditional
=
cm
.
fcheck
local
sg1
=
Duel
.
GetMatchingGroup
(
cm
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
e
,
tp
,
mg1
,
nil
,
chkf
)
aux
.
FCheckAdditional
=
nil
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
(
cm
.
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
aux
.
FCheckAdditional
=
cm
.
fcheck
local
mat1
=
Duel
.
SelectFusionMaterial
(
tp
,
tc
,
mg1
,
nil
,
chkf
)
aux
.
FCheckAdditional
=
nil
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
()
Duel
.
RegisterFlagEffect
(
tp
,
m
,
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
end
end
function
cm
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
if
re
:
IsActiveType
(
TYPE_MONSTER
)
and
rc
:
IsRace
(
RACE_PSYCHO
)
then
cm
[
rp
][
rc
]
=
1
end
local
rc
=
re
:
GetHandler
()
if
re
:
IsActiveType
(
TYPE_MONSTER
)
and
rc
:
IsRace
(
RACE_PSYCHO
)
then
if
cm
[
rp
][
rc
]
then
cm
[
rp
][
rc
]
=
cm
[
rp
][
rc
]
+
1
else
cm
[
rp
][
rc
]
=
1
end
end
end
function
cm
.
regop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
cm
[
rp
][
re
:
GetHandler
()]
=
nil
local
rc
=
re
:
GetHandler
()
if
cm
[
rp
][
rc
]
then
cm
[
rp
][
rc
]
=
cm
[
rp
][
rc
]
-
1
else
cm
[
rp
][
rc
]
=
nil
end
end
function
cm
.
clearop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
cm
[
0
]
=
{}
cm
[
1
]
=
{}
cm
[
0
]
=
{}
cm
[
1
]
=
{}
end
function
cm
.
filter0
(
c
,
tp
,
g
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsCanBeFusionMaterial
()
and
c
:
IsAbleToRemove
()
and
c
:
IsRace
(
RACE_PSYCHO
)
and
g
:
IsExists
(
aux
.
FilterEqualFunction
(
Card
.
GetOriginalCode
,
c
:
GetOriginalCode
()),
1
,
nil
)
return
c
:
IsType
(
TYPE_MONSTER
)
and
c
:
IsCanBeFusionMaterial
()
and
c
:
IsAbleToRemove
()
and
c
:
IsRace
(
RACE_PSYCHO
)
and
g
:
IsExists
(
aux
.
FilterEqualFunction
(
Card
.
GetOriginalCode
,
c
:
GetOriginalCode
()),
1
,
nil
)
end
function
cm
.
filter1
(
c
,
e
)
return
not
c
:
IsImmuneToEffect
(
e
)
and
c
:
IsAbleToRemove
()
and
c
:
IsRace
(
RACE_PSYCHO
)
return
not
c
:
IsImmuneToEffect
(
e
)
and
c
:
IsAbleToRemove
()
and
c
:
IsRace
(
RACE_PSYCHO
)
end
function
cm
.
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
(
not
f
or
f
(
c
))
and
c
:
IsCanBeSpecialSummoned
(
e
,
SUMMON_TYPE_FUSION
,
tp
,
false
,
false
)
and
c
:
CheckFusionMaterial
(
m
,
nil
,
chkf
)
end
function
cm
.
ckecktarget
(
e
,
tp
)
local
chkf
=
tp
local
mg1
=
Duel
.
GetFusionMaterial
(
tp
)
local
copyt
=
cm
[
tp
]
local
exg
=
Group
.
CreateGroup
()
for
k
,
v
in
pairs
(
copyt
)
do
if
k
and
v
then
exg
:
AddCard
(
k
)
end
end
local
cd
=
3
if
c89390009
then
cd
=
c89390009
.
cd
end
if
exg
:
GetClassCount
(
Card
.
GetOriginalCode
)
>=
cd
then
local
mg2
=
Duel
.
GetMatchingGroup
(
cm
.
filter0
,
tp
,
LOCATION_DECK
,
0
,
nil
,
tp
,
exg
)
mg1
:
Merge
(
mg2
)
end
aux
.
FCheckAdditional
=
cm
.
fcheck
local
res
=
Duel
.
IsExistingMatchingCard
(
cm
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
mg1
,
nil
,
chkf
)
aux
.
FCheckAdditional
=
nil
if
not
res
then
local
ce
=
Duel
.
GetChainMaterial
(
tp
)
if
ce
~=
nil
then
local
fgroup
=
ce
:
GetTarget
()
local
mg3
=
fgroup
(
ce
,
e
,
tp
)
local
mf
=
ce
:
GetValue
()
res
=
Duel
.
IsExistingMatchingCard
(
cm
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
mg3
,
mf
,
chkf
)
end
end
return
res
local
chkf
=
tp
local
mg1
=
Duel
.
GetFusionMaterial
(
tp
)
local
copyt
=
cm
[
tp
]
local
exg
=
Group
.
CreateGroup
()
for
k
,
v
in
pairs
(
copyt
)
do
if
k
and
v
then
exg
:
AddCard
(
k
)
end
end
local
cd
=
3
if
c89390009
then
cd
=
c89390009
.
cd
end
if
exg
:
GetClassCount
(
Card
.
GetOriginalCode
)
>=
cd
then
local
mg2
=
Duel
.
GetMatchingGroup
(
cm
.
filter0
,
tp
,
LOCATION_DECK
,
0
,
nil
,
tp
,
exg
)
mg1
:
Merge
(
mg2
)
end
aux
.
FCheckAdditional
=
cm
.
fcheck
local
res
=
Duel
.
IsExistingMatchingCard
(
cm
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
mg1
,
nil
,
chkf
)
aux
.
FCheckAdditional
=
nil
if
not
res
then
local
ce
=
Duel
.
GetChainMaterial
(
tp
)
if
ce
~=
nil
then
local
fgroup
=
ce
:
GetTarget
()
local
mg3
=
fgroup
(
ce
,
e
,
tp
)
local
mf
=
ce
:
GetValue
()
res
=
Duel
.
IsExistingMatchingCard
(
cm
.
filter2
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
,
mg3
,
mf
,
chkf
)
end
end
return
res
end
function
cm
.
fcheck
(
tp
,
sg
,
fc
)
return
not
sg
:
IsExists
(
aux
.
NOT
(
Card
.
IsRace
),
1
,
nil
,
RACE_PSYCHO
)
return
not
sg
:
IsExists
(
aux
.
NOT
(
Card
.
IsRace
),
1
,
nil
,
RACE_PSYCHO
)
end
expansions/script/c89390100.lua
View file @
59a68af3
...
...
@@ -123,17 +123,25 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
end
function
s
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
if
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
s
[
0
][
re
:
GetHandler
()]
then
re
:
GetHandler
():
RegisterFlagEffect
(
id
+
100
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_CHAIN
,
0
,
1
)
end
if
Duel
.
GetCurrentChain
()
>=
4
then
for
i
=
1
,
ev
do
local
te
=
Duel
.
GetChainInfo
(
i
,
CHAININFO_TRIGGERING_EFFECT
)
if
te
:
IsActiveType
(
TYPE_MONSTER
)
then
if
te
:
GetHandler
():
GetFlagEffect
(
id
+
100
)
>
0
then
s
[
0
][
te
:
GetHandler
()]
=
1
end
end
end
end
function
s
.
regop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
s
[
0
][
re
:
GetHandler
()]
=
nil
if
re
:
GetHandler
():
GetFlagEffect
(
id
+
100
)
>
0
then
re
:
GetHandler
():
IsHasEffect
(
EFFECT_FLAG_EFFECT
+
id
+
100
):
Reset
()
if
re
:
GetHandler
():
GetFlagEffect
(
id
+
100
)
==
0
then
s
[
0
][
re
:
GetHandler
()]
=
nil
end
end
end
function
s
.
clearop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
s
[
0
]
=
{}
...
...
expansions/script/c89390102.lua
View file @
59a68af3
...
...
@@ -122,17 +122,25 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
end
function
s
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
if
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
s
[
0
][
re
:
GetHandler
()]
then
re
:
GetHandler
():
RegisterFlagEffect
(
id
+
100
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_CHAIN
,
0
,
1
)
end
if
Duel
.
GetCurrentChain
()
>=
4
then
for
i
=
1
,
ev
do
local
te
=
Duel
.
GetChainInfo
(
i
,
CHAININFO_TRIGGERING_EFFECT
)
if
te
:
IsActiveType
(
TYPE_MONSTER
)
then
if
te
:
GetHandler
():
GetFlagEffect
(
id
+
100
)
>
0
then
s
[
0
][
te
:
GetHandler
()]
=
1
end
end
end
end
function
s
.
regop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
s
[
0
][
re
:
GetHandler
()]
=
nil
if
re
:
GetHandler
():
GetFlagEffect
(
id
+
100
)
>
0
then
re
:
GetHandler
():
IsHasEffect
(
EFFECT_FLAG_EFFECT
+
id
+
100
):
Reset
()
if
re
:
GetHandler
():
GetFlagEffect
(
id
+
100
)
==
0
then
s
[
0
][
re
:
GetHandler
()]
=
nil
end
end
end
function
s
.
clearop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
s
[
0
]
=
{}
...
...
expansions/script/c89390106.lua
View file @
59a68af3
...
...
@@ -143,17 +143,25 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
end
function
s
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
if
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
s
[
0
][
re
:
GetHandler
()]
then
re
:
GetHandler
():
RegisterFlagEffect
(
id
+
100
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_CHAIN
,
0
,
1
)
end
if
Duel
.
GetCurrentChain
()
>=
4
then
for
i
=
1
,
ev
do
local
te
=
Duel
.
GetChainInfo
(
i
,
CHAININFO_TRIGGERING_EFFECT
)
if
te
:
IsActiveType
(
TYPE_MONSTER
)
then
if
te
:
GetHandler
():
GetFlagEffect
(
id
+
100
)
>
0
then
s
[
0
][
te
:
GetHandler
()]
=
1
end
end
end
end
function
s
.
regop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
s
[
0
][
re
:
GetHandler
()]
=
nil
if
re
:
GetHandler
():
GetFlagEffect
(
id
+
100
)
>
0
then
re
:
GetHandler
():
IsHasEffect
(
EFFECT_FLAG_EFFECT
+
id
+
100
):
Reset
()
if
re
:
GetHandler
():
GetFlagEffect
(
id
+
100
)
==
0
then
s
[
0
][
re
:
GetHandler
()]
=
nil
end
end
end
function
s
.
clearop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
s
[
0
]
=
{}
...
...
expansions/script/c89390108.lua
View file @
59a68af3
...
...
@@ -145,17 +145,25 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
end
function
s
.
checkop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
rc
=
re
:
GetHandler
()
if
re
:
IsActiveType
(
TYPE_MONSTER
)
and
not
s
[
0
][
re
:
GetHandler
()]
then
re
:
GetHandler
():
RegisterFlagEffect
(
id
+
100
,
RESET_EVENT
+
RESETS_STANDARD
+
RESET_CHAIN
,
0
,
1
)
end
if
Duel
.
GetCurrentChain
()
>=
4
then
for
i
=
1
,
ev
do
local
te
=
Duel
.
GetChainInfo
(
i
,
CHAININFO_TRIGGERING_EFFECT
)
if
te
:
IsActiveType
(
TYPE_MONSTER
)
then
if
te
:
GetHandler
():
GetFlagEffect
(
id
+
100
)
>
0
then
s
[
0
][
te
:
GetHandler
()]
=
1
end
end
end
end
function
s
.
regop2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
s
[
0
][
re
:
GetHandler
()]
=
nil
if
re
:
GetHandler
():
GetFlagEffect
(
id
+
100
)
>
0
then
re
:
GetHandler
():
IsHasEffect
(
EFFECT_FLAG_EFFECT
+
id
+
100
):
Reset
()
if
re
:
GetHandler
():
GetFlagEffect
(
id
+
100
)
==
0
then
s
[
0
][
re
:
GetHandler
()]
=
nil
end
end
end
function
s
.
clearop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
s
[
0
]
=
{}
...
...
expansions/script/c91300037.lua
View file @
59a68af3
...
...
@@ -61,12 +61,12 @@ end
function
s
.
stop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
not
(
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsControler
(
tp
)
and
not
tc
:
IsImmuneToEffect
(
e
))
then
return
end
local
zone
=
1
<<
tc
:
GetSequence
()
local
zone
=
1
<<
4
-
tc
:
GetSequence
()
local
oc
=
Duel
.
GetMatchingGroup
(
s
.
seqfilter
,
tp
,
0
,
LOCATION_MZONE
,
nil
,
tc
:
GetSequence
()):
GetFirst
()
if
oc
then
Duel
.
Destroy
(
oc
,
REASON_RULE
)
end
if
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
id
,
2
))
and
Duel
.
GetControl
(
tc
,
1
-
tp
,
0
,
0
,
zone
)
then
if
Duel
.
GetControl
(
tc
,
1
-
tp
,
0
,
0
,
zone
)
then
local
oc
=
Duel
.
GetMatchingGroup
(
s
.
seqfilter
,
tp
,
0
,
LOCATION_SZONE
,
nil
,
tc
:
GetSequence
()):
GetFirst
()
if
oc
then
Duel
.
Destroy
(
oc
,
REASON_RULE
)
...
...
@@ -89,5 +89,5 @@ function s.stop(e,tp,eg,ep,ev,re,r,rp)
end
end
function
s
.
seqfilter
(
c
,
seq
)
return
c
:
GetSequence
()
==
seq
return
4
-
c
:
GetSequence
()
==
seq
end
\ No newline at end of file
expansions/script/c91300051.lua
View file @
59a68af3
...
...
@@ -71,7 +71,7 @@ function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return
false
end
end
function
s
.
thfilter
(
c
,
chk
)
function
s
.
thfilter
(
c
,
e
,
chk
)
return
c
:
IsRace
(
RACE_ZOMBIE
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
s
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
...
...
expansions/script/special.lua
View file @
59a68af3
...
...
@@ -182,7 +182,15 @@ function Auxiliary.PreloadUds()
return
0
end
end
if
not
Card
.
GetLinkMarker
then
function
Card
.
GetLinkMarker
(
c
)
local
res
=
0
for
i
=
0
,
8
do
if
i
~=
4
and
c
:
IsLinkMarker
(
1
<<
i
)
then
res
=
res
|
(
1
<<
i
)
end
return
res
end
end
local
_CRegisterEffect
=
Card
.
RegisterEffect
function
Card
.
RegisterEffect
(
c
,
e
,
...
)
if
aux
.
GetValueType
(
c
)
~=
"Card"
then
error
(
"Card.RegisterEffect没有输入正确的Card参数。"
,
2
)
return
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