Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-222DIY-cards
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ai
ygopro-222DIY-cards
Commits
aefaf8b5
You need to sign in or sign up before continuing.
Commit
aefaf8b5
authored
Jun 27, 2019
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:purerosefallen/ygopro-222DIY-cards
parents
bca4d5b7
02d3b945
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
807 additions
and
805 deletions
+807
-805
expansions/script/c1000417.lua
expansions/script/c1000417.lua
+96
-98
expansions/script/c26807032.lua
expansions/script/c26807032.lua
+200
-196
expansions/script/c81012029.lua
expansions/script/c81012029.lua
+129
-129
expansions/script/c9980237.lua
expansions/script/c9980237.lua
+111
-111
expansions/script/c9980287.lua
expansions/script/c9980287.lua
+108
-108
expansions/script/c9980512.lua
expansions/script/c9980512.lua
+63
-63
expansions/script/c9980590.lua
expansions/script/c9980590.lua
+100
-100
No files found.
expansions/script/c1000417.lua
View file @
aefaf8b5
--魔法决战!
function
c1000417
.
initial_effect
(
c
)
c
:
SetUniqueOnField
(
1
,
1
,
1000417
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCost
(
c1000417
.
cost
)
e1
:
SetOperation
(
c1000417
.
activate
)
c
:
RegisterEffect
(
e1
)
--act in hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_TRAP_ACT_IN_HAND
)
e2
:
SetCondition
(
c1000417
.
handcon
)
c
:
RegisterEffect
(
e2
)
--activate limit
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_FIELD
)
e3
:
SetCode
(
EVENT_CHAINING
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetOperation
(
c1000417
.
aclimit1
)
c
:
RegisterEffect
(
e3
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_FIELD
)
e4
:
SetCode
(
EVENT_CHAIN_NEGATED
)
e4
:
SetRange
(
LOCATION_SZONE
)
e4
:
SetOperation
(
c1000417
.
aclimit2
)
c
:
RegisterEffect
(
e4
)
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetType
(
EFFECT_TYPE_FIELD
)
e5
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e5
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e5
:
SetRange
(
LOCATION_SZONE
)
e5
:
SetTargetRange
(
0
,
1
)
e5
:
SetCondition
(
c1000417
.
econ
)
e5
:
SetValue
(
c1000417
.
elimit
)
c
:
RegisterEffect
(
e5
)
end
function
c1000417
.
filter1
(
c
)
return
c
:
IsType
(
TYPE_CONTINUOUS
)
and
c
:
IsFaceup
()
and
c
:
IsAbleToGrave
()
and
not
c
:
IsCode
(
1000417
)
end
function
c1000417
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c1000417
.
filter1
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
local
g
=
Duel
.
GetMatchingGroup
(
c1000417
.
filter1
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
g
:
GetCount
(),
0
,
0
)
local
g
=
Duel
.
GetMatchingGroup
(
c1000417
.
filter1
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_EFFECT
)
end
function
c1000417
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
--destroy
local
c
=
e
:
GetHandler
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_STANDBY
)
e1
:
SetCountLimit
(
1
)
if
Duel
.
GetCurrentPhase
()
==
PHASE_STANDBY
and
Duel
.
GetTurnPlayer
()
==
tp
then
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_STANDBY
+
RESET_SELF_TURN
,
2
)
else
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_STANDBY
+
RESET_SELF_TURN
)
end
if
Duel
.
GetTurnPlayer
()
==
tp
and
Duel
.
GetCurrentPhase
()
==
PHASE_DRAW
then
e1
:
SetLabel
(
0
)
else
e1
:
SetLabel
(
Duel
.
GetTurnCount
())
end
e1
:
SetCondition
(
c1000417
.
descon
)
e1
:
SetOperation
(
c1000417
.
desop
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
c1000417
.
descon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetTurnPlayer
()
==
tp
and
Duel
.
GetTurnCount
()
~=
e
:
GetLabel
()
end
function
c1000417
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
Duel
.
Destroy
(
c
,
REASON_RULE
)
end
function
c1000417
.
cfilter
(
c
)
return
c
:
IsCode
(
1000406
)
and
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c1000417
.
handcon
(
e
)
local
g
=
Duel
.
GetFieldGroup
(
e
:
GetHandlerPlayer
(),
LOCATION_MZONE
,
0
)
return
g
:
IsExists
(
c1000417
.
cfilter
,
1
,
nil
)
end
function
c1000417
.
aclimit1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
ep
==
tp
or
not
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
return
end
e
:
GetHandler
():
RegisterFlagEffect
(
1000417
,
RESET_EVENT
+
0x3ff0000
+
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c1000417
.
aclimit2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
ep
==
tp
or
not
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
return
end
e
:
GetHandler
():
ResetFlagEffect
(
1000417
)
end
function
c1000417
.
econ
(
e
)
return
e
:
GetHandler
():
GetFlagEffect
(
1000417
)
~=
0
end
function
c1000417
.
elimit
(
e
,
te
,
tp
)
return
te
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
--魔法决战!
function
c1000417
.
initial_effect
(
c
)
c
:
SetUniqueOnField
(
1
,
1
,
1000417
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetCost
(
c1000417
.
cost
)
e1
:
SetOperation
(
c1000417
.
activate
)
c
:
RegisterEffect
(
e1
)
--act in hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_TRAP_ACT_IN_HAND
)
e2
:
SetCondition
(
c1000417
.
handcon
)
c
:
RegisterEffect
(
e2
)
--activate limit
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_FIELD
)
e3
:
SetCode
(
EVENT_CHAINING
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetOperation
(
c1000417
.
aclimit1
)
c
:
RegisterEffect
(
e3
)
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_FIELD
)
e4
:
SetCode
(
EVENT_CHAIN_NEGATED
)
e4
:
SetRange
(
LOCATION_SZONE
)
e4
:
SetOperation
(
c1000417
.
aclimit2
)
c
:
RegisterEffect
(
e4
)
local
e5
=
Effect
.
CreateEffect
(
c
)
e5
:
SetType
(
EFFECT_TYPE_FIELD
)
e5
:
SetCode
(
EFFECT_CANNOT_ACTIVATE
)
e5
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e5
:
SetRange
(
LOCATION_SZONE
)
e5
:
SetTargetRange
(
0
,
1
)
e5
:
SetCondition
(
c1000417
.
econ
)
e5
:
SetValue
(
c1000417
.
elimit
)
c
:
RegisterEffect
(
e5
)
end
function
c1000417
.
filter1
(
c
)
return
c
:
IsType
(
TYPE_CONTINUOUS
)
and
c
:
IsFaceup
()
and
c
:
IsAbleToGrave
()
and
not
c
:
IsCode
(
1000417
)
end
function
c1000417
.
cost
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c1000417
.
filter1
,
tp
,
LOCATION_SZONE
,
LOCATION_SZONE
,
1
,
nil
,
e
,
tp
)
end
local
g
=
Duel
.
GetMatchingGroup
(
c1000417
.
filter1
,
tp
,
LOCATION_SZONE
,
LOCATION_SZONE
,
nil
)
Duel
.
SendtoGrave
(
g
,
REASON_COST
)
end
function
c1000417
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
--destroy
local
c
=
e
:
GetHandler
()
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e1
:
SetRange
(
LOCATION_SZONE
)
e1
:
SetCode
(
EVENT_PHASE
+
PHASE_STANDBY
)
e1
:
SetCountLimit
(
1
)
if
Duel
.
GetCurrentPhase
()
==
PHASE_STANDBY
and
Duel
.
GetTurnPlayer
()
==
tp
then
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_STANDBY
+
RESET_SELF_TURN
,
2
)
else
e1
:
SetReset
(
RESET_EVENT
+
0x1fe0000
+
RESET_PHASE
+
PHASE_STANDBY
+
RESET_SELF_TURN
)
end
if
Duel
.
GetTurnPlayer
()
==
tp
and
Duel
.
GetCurrentPhase
()
==
PHASE_DRAW
then
e1
:
SetLabel
(
0
)
else
e1
:
SetLabel
(
Duel
.
GetTurnCount
())
end
e1
:
SetCondition
(
c1000417
.
descon
)
e1
:
SetOperation
(
c1000417
.
desop
)
Duel
.
RegisterEffect
(
e1
,
tp
)
end
function
c1000417
.
descon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetTurnPlayer
()
==
tp
and
Duel
.
GetTurnCount
()
~=
e
:
GetLabel
()
end
function
c1000417
.
desop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
Duel
.
Destroy
(
c
,
REASON_RULE
)
end
function
c1000417
.
cfilter
(
c
)
return
c
:
IsCode
(
1000406
)
and
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_MONSTER
)
end
function
c1000417
.
handcon
(
e
)
local
g
=
Duel
.
GetFieldGroup
(
e
:
GetHandlerPlayer
(),
LOCATION_MZONE
,
0
)
return
g
:
IsExists
(
c1000417
.
cfilter
,
1
,
nil
)
end
function
c1000417
.
aclimit1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
ep
==
tp
or
not
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
return
end
e
:
GetHandler
():
RegisterFlagEffect
(
1000417
,
RESET_EVENT
+
0x3ff0000
+
RESET_PHASE
+
PHASE_END
,
0
,
1
)
end
function
c1000417
.
aclimit2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
ep
==
tp
or
not
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
then
return
end
e
:
GetHandler
():
ResetFlagEffect
(
1000417
)
end
function
c1000417
.
econ
(
e
)
return
e
:
GetHandler
():
GetFlagEffect
(
1000417
)
~=
0
end
function
c1000417
.
elimit
(
e
,
te
,
tp
)
return
te
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
\ No newline at end of file
expansions/script/c26807032.lua
View file @
aefaf8b5
This diff is collapsed.
Click to expand it.
expansions/script/c81012029.lua
View file @
aefaf8b5
--小小的奖励·爱米莉
function
c81012029
.
initial_effect
(
c
)
--pendulum summon
aux
.
EnablePendulumAttribute
(
c
)
c
:
EnableReviveLimit
()
--draw
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_DRAW
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_DESTROYED
)
e1
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_DELAY
)
e1
:
SetRange
(
LOCATION_PZONE
)
e1
:
SetCountLimit
(
1
,
81012029
)
e1
:
SetCondition
(
c81012029
.
drcon
)
e1
:
SetTarget
(
c81012029
.
drtg
)
e1
:
SetOperation
(
c81012029
.
drop
)
c
:
RegisterEffect
(
e1
)
--atkup
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e2
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetValue
(
c81012029
.
val
)
c
:
RegisterEffect
(
e2
)
--negate
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
1
,
81012929
)
e3
:
SetTarget
(
c81012029
.
target
)
e3
:
SetOperation
(
c81012029
.
operation
)
c
:
RegisterEffect
(
e3
)
--tohand
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetCode
(
EVENT_RELEASE
)
e4
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e4
:
SetCountLimit
(
1
,
81092929
)
e4
:
SetTarget
(
c81012029
.
thtg
)
e4
:
SetOperation
(
c81012029
.
thop
)
c
:
RegisterEffect
(
e4
)
end
function
c81012029
.
cfilter
(
c
,
tp
)
return
c
:
IsPreviousLocation
(
LOCATION_ONFIELD
)
and
c
:
IsReason
(
REASON_EFFECT
)
end
function
c81012029
.
drcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
des
=
eg
:
GetFirst
()
if
des
:
IsReason
(
REASON_BATTLE
)
then
local
rc
=
des
:
GetReasonCard
()
return
rc
and
rc
:
IsType
(
TYPE_RITUAL
)
and
r
e
:
IsType
(
TYPE_PENDULUM
)
and
rc
:
IsControler
(
tp
)
and
rc
:
IsRelateToBattle
()
elseif
re
then
local
rc
=
re
:
GetHandler
()
return
eg
:
IsExists
(
c81012029
.
cfilter
,
1
,
nil
,
tp
)
and
rc
and
rc
:
IsType
(
TYPE_RITUAL
)
and
r
e
:
IsType
(
TYPE_PENDULUM
)
and
rc
:
IsControler
(
tp
)
and
re
:
IsActiveType
(
TYPE_MONSTER
)
end
return
false
end
function
c81012029
.
drtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
c81012029
.
drop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
Duel
.
Draw
(
p
,
d
,
REASON_EFFECT
)
end
function
c81012029
.
val
(
e
,
c
)
return
Duel
.
GetMatchingGroupCount
(
Card
.
IsFaceup
,
c
:
GetControler
(),
LOCATION_PZONE
,
LOCATION_PZONE
,
nil
,
nil
)
*
500
end
function
c81012029
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSummonType
(
SUMMON_TYPE_SPECIAL
)
end
function
c81012029
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
c81012029
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c81012029
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
Duel
.
SelectTarget
(
tp
,
c81012029
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
end
function
c81012029
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsFaceup
()
and
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
NegateRelatedChain
(
tc
,
RESET_TURN_SET
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetValue
(
RESET_TURN_SET
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
+
EFFECT_FLAG_CANNOT_DISABLE
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e3
:
SetValue
(
c81012029
.
efilter
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e3
)
end
end
function
c81012029
.
efilter
(
e
,
te
)
return
te
:
GetOwner
()
~=
e
:
GetOwner
()
end
function
c81012029
.
thfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_RITUAL
)
and
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
IsAbleToHand
()
and
not
c
:
IsCode
(
81012029
)
end
function
c81012029
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c81012029
.
thfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
c81012029
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c81012029
.
thfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
--小小的奖励·爱米莉
function
c81012029
.
initial_effect
(
c
)
--pendulum summon
aux
.
EnablePendulumAttribute
(
c
)
c
:
EnableReviveLimit
()
--draw
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_DRAW
)
e1
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e1
:
SetCode
(
EVENT_DESTROYED
)
e1
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_PLAYER_TARGET
+
EFFECT_FLAG_DELAY
)
e1
:
SetRange
(
LOCATION_PZONE
)
e1
:
SetCountLimit
(
1
,
81012029
)
e1
:
SetCondition
(
c81012029
.
drcon
)
e1
:
SetTarget
(
c81012029
.
drtg
)
e1
:
SetOperation
(
c81012029
.
drop
)
c
:
RegisterEffect
(
e1
)
--atkup
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e2
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetValue
(
c81012029
.
val
)
c
:
RegisterEffect
(
e2
)
--negate
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e3
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e3
:
SetCode
(
EVENT_FREE_CHAIN
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCountLimit
(
1
,
81012929
)
e3
:
SetTarget
(
c81012029
.
target
)
e3
:
SetOperation
(
c81012029
.
operation
)
c
:
RegisterEffect
(
e3
)
--tohand
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetCategory
(
CATEGORY_TOHAND
+
CATEGORY_SEARCH
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetCode
(
EVENT_RELEASE
)
e4
:
SetProperty
(
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e4
:
SetCountLimit
(
1
,
81092929
)
e4
:
SetTarget
(
c81012029
.
thtg
)
e4
:
SetOperation
(
c81012029
.
thop
)
c
:
RegisterEffect
(
e4
)
end
function
c81012029
.
cfilter
(
c
,
tp
)
return
c
:
IsPreviousLocation
(
LOCATION_ONFIELD
)
and
c
:
IsReason
(
REASON_EFFECT
)
end
function
c81012029
.
drcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
des
=
eg
:
GetFirst
()
if
des
:
IsReason
(
REASON_BATTLE
)
then
local
rc
=
des
:
GetReasonCard
()
return
rc
and
rc
:
IsType
(
TYPE_RITUAL
)
and
r
c
:
IsType
(
TYPE_PENDULUM
)
and
rc
:
IsControler
(
tp
)
and
rc
:
IsRelateToBattle
()
elseif
re
then
local
rc
=
re
:
GetHandler
()
return
eg
:
IsExists
(
c81012029
.
cfilter
,
1
,
nil
,
tp
)
and
rc
and
rc
:
IsType
(
TYPE_RITUAL
)
and
r
c
:
IsType
(
TYPE_PENDULUM
)
and
rc
:
IsControler
(
tp
)
and
re
:
IsActiveType
(
TYPE_MONSTER
)
end
return
false
end
function
c81012029
.
drtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
Duel
.
SetTargetPlayer
(
tp
)
Duel
.
SetTargetParam
(
1
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
c81012029
.
drop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
p
,
d
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_PLAYER
,
CHAININFO_TARGET_PARAM
)
Duel
.
Draw
(
p
,
d
,
REASON_EFFECT
)
end
function
c81012029
.
val
(
e
,
c
)
return
Duel
.
GetMatchingGroupCount
(
Card
.
IsFaceup
,
c
:
GetControler
(),
LOCATION_PZONE
,
LOCATION_PZONE
,
nil
,
nil
)
*
500
end
function
c81012029
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSummonType
(
SUMMON_TYPE_SPECIAL
)
end
function
c81012029
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
c81012029
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c81012029
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
Duel
.
SelectTarget
(
tp
,
c81012029
.
filter
,
tp
,
LOCATION_MZONE
,
LOCATION_MZONE
,
1
,
1
,
nil
)
end
function
c81012029
.
operation
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsFaceup
()
and
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
NegateRelatedChain
(
tc
,
RESET_TURN_SET
)
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e1
:
SetCode
(
EFFECT_DISABLE
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetProperty
(
EFFECT_FLAG_CANNOT_DISABLE
)
e2
:
SetCode
(
EFFECT_DISABLE_EFFECT
)
e2
:
SetValue
(
RESET_TURN_SET
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
+
EFFECT_FLAG_CANNOT_DISABLE
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetCode
(
EFFECT_IMMUNE_EFFECT
)
e3
:
SetValue
(
c81012029
.
efilter
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
tc
:
RegisterEffect
(
e3
)
end
end
function
c81012029
.
efilter
(
e
,
te
)
return
te
:
GetOwner
()
~=
e
:
GetOwner
()
end
function
c81012029
.
thfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsType
(
TYPE_RITUAL
)
and
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
IsAbleToHand
()
and
not
c
:
IsCode
(
81012029
)
end
function
c81012029
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
Duel
.
IsExistingMatchingCard
(
c81012029
.
thfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
c81012029
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectMatchingCard
(
tp
,
c81012029
.
thfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
)
if
g
:
GetCount
()
>
0
then
Duel
.
SendtoHand
(
g
,
nil
,
REASON_EFFECT
)
Duel
.
ConfirmCards
(
1
-
tp
,
g
)
end
end
expansions/script/c9980237.lua
View file @
aefaf8b5
--物语纪录·北白蛇神社
function
c9980237
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e1
)
--level
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_UPDATE_LEVEL
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetTargetRange
(
LOCATION_HAND
,
LOCATION_HAND
)
e2
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x5bc4
))
e2
:
SetValue
(
-
1
)
c
:
RegisterEffect
(
e2
)
--atkup
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e2
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsRace
,
RACE_SPELLCASTER
))
e2
:
SetValue
(
300
)
c
:
RegisterEffect
(
e2
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_TOHAND
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetRange
(
LOCATION_FZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_END_PHASE
)
e1
:
SetCondition
(
c9980237
.
thcon
)
e1
:
SetTarget
(
c9980237
.
thtg
)
e1
:
SetOperation
(
c9980237
.
thop
)
c
:
RegisterEffect
(
e1
)
--special summon
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
9980237
,
0
))
e4
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetCode
(
EVENT_LEAVE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_
DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e4
:
SetRange
(
LOCATION_FZONE
)
e4
:
SetCountLimit
(
1
)
e4
:
SetCondition
(
c9980237
.
spcon
)
e4
:
SetTarget
(
c9980237
.
sptg
)
e4
:
SetOperation
(
c9980237
.
spop
)
c
:
RegisterEffect
(
e4
)
end
function
c9980237
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
return
ph
==
PHASE_MAIN1
or
(
ph
>=
PHASE_BATTLE_START
and
ph
<=
PHASE_BATTLE
)
or
ph
==
PHASE_MAIN2
end
function
c9980237
.
thfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x5bc4
)
and
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
IsAbleToHand
()
end
function
c9980237
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
+
LOCATION_EXTRA
)
and
chkc
:
IsControler
(
tp
)
and
c9980237
.
thfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c9980237
.
thfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_EXTRA
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c9980237
.
thfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
1
,
0
,
0
)
end
function
c9980237
.
sumfilter
(
c
)
return
c
:
IsSetCard
(
0x5bc4
)
and
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
IsSummonable
(
true
,
nil
,
1
)
end
function
c9980237
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
~=
0
and
tc
:
IsLocation
(
LOCATION_HAND
)
then
local
g
=
Duel
.
GetMatchingGroup
(
c9980237
.
sumfilter
,
tp
,
LOCATION_HAND
,
0
,
nil
)
if
g
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
9980237
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SUMMON
)
local
sc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
ShuffleHand
(
tp
)
Duel
.
Summon
(
tp
,
sc
,
true
,
nil
,
1
)
else
Duel
.
ShuffleHand
(
tp
)
end
end
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980237
,
1
))
end
function
c9980237
.
spcfilter
(
c
,
tp
,
rp
)
return
c
:
IsPreviousPosition
(
POS_FACEUP
)
and
c
:
GetPreviousControler
()
==
tp
and
c
:
IsPreviousSetCard
(
0x5bc4
)
and
(
c
:
IsReason
(
REASON_BATTLE
)
or
(
rp
==
1
-
tp
and
c
:
IsReason
(
REASON_EFFECT
)))
end
function
c9980237
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
c9980237
.
spcfilter
,
1
,
nil
,
tp
,
rp
)
end
function
c9980237
.
filter
(
c
,
e
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x5bc4
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
(
c
:
IsLocation
(
LOCATION_GRAVE
)
or
(
c
:
IsLocation
(
LOCATION_EXTRA
)
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
c
)
>
0
))
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c9980237
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
+
LOCATION_EXTRA
)
and
chkc
:
IsControler
(
tp
)
and
c9980237
.
filter
(
chkc
,
e
,
tp
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingTarget
(
c9980237
.
filter
,
tp
,
LOCATION_GRAVE
+
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c9980237
.
filter
,
tp
,
LOCATION_GRAVE
+
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
1
,
0
,
0
)
end
function
c9980237
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP_ATTACK
)
end
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980237
,
1
))
end
--物语纪录·北白蛇神社
function
c9980237
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e1
)
--level
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_UPDATE_LEVEL
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetTargetRange
(
LOCATION_HAND
,
LOCATION_HAND
)
e2
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsSetCard
,
0x5bc4
))
e2
:
SetValue
(
-
1
)
c
:
RegisterEffect
(
e2
)
--atkup
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e2
:
SetRange
(
LOCATION_FZONE
)
e2
:
SetTargetRange
(
LOCATION_MZONE
,
LOCATION_MZONE
)
e2
:
SetTarget
(
aux
.
TargetBoolFunction
(
Card
.
IsRace
,
RACE_SPELLCASTER
))
e2
:
SetValue
(
300
)
c
:
RegisterEffect
(
e2
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_TOHAND
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetRange
(
LOCATION_FZONE
)
e1
:
SetCountLimit
(
1
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_END_PHASE
)
e1
:
SetCondition
(
c9980237
.
thcon
)
e1
:
SetTarget
(
c9980237
.
thtg
)
e1
:
SetOperation
(
c9980237
.
thop
)
c
:
RegisterEffect
(
e1
)
--special summon
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetDescription
(
aux
.
Stringid
(
9980237
,
0
))
e4
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_O
)
e4
:
SetCode
(
EVENT_LEAVE_FIELD
)
e4
:
SetProperty
(
EFFECT_FLAG_
CARD_TARGET
+
EFFECT_FLAG_DAMAGE_STEP
+
EFFECT_FLAG_DELAY
)
e4
:
SetRange
(
LOCATION_FZONE
)
e4
:
SetCountLimit
(
1
)
e4
:
SetCondition
(
c9980237
.
spcon
)
e4
:
SetTarget
(
c9980237
.
sptg
)
e4
:
SetOperation
(
c9980237
.
spop
)
c
:
RegisterEffect
(
e4
)
end
function
c9980237
.
thcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
return
ph
==
PHASE_MAIN1
or
(
ph
>=
PHASE_BATTLE_START
and
ph
<=
PHASE_BATTLE
)
or
ph
==
PHASE_MAIN2
end
function
c9980237
.
thfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x5bc4
)
and
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
IsAbleToHand
()
end
function
c9980237
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
+
LOCATION_EXTRA
)
and
chkc
:
IsControler
(
tp
)
and
c9980237
.
thfilter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c9980237
.
thfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_EXTRA
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_ATOHAND
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c9980237
.
thfilter
,
tp
,
LOCATION_GRAVE
+
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
1
,
0
,
0
)
end
function
c9980237
.
sumfilter
(
c
)
return
c
:
IsSetCard
(
0x5bc4
)
and
c
:
IsType
(
TYPE_PENDULUM
)
and
c
:
IsSummonable
(
true
,
nil
,
1
)
end
function
c9980237
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
~=
0
and
tc
:
IsLocation
(
LOCATION_HAND
)
then
local
g
=
Duel
.
GetMatchingGroup
(
c9980237
.
sumfilter
,
tp
,
LOCATION_HAND
,
0
,
nil
)
if
g
:
GetCount
()
>
0
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
9980237
,
0
))
then
Duel
.
BreakEffect
()
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SUMMON
)
local
sc
=
g
:
Select
(
tp
,
1
,
1
,
nil
):
GetFirst
()
Duel
.
ShuffleHand
(
tp
)
Duel
.
Summon
(
tp
,
sc
,
true
,
nil
,
1
)
else
Duel
.
ShuffleHand
(
tp
)
end
end
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980237
,
1
))
end
function
c9980237
.
spcfilter
(
c
,
tp
,
rp
)
return
c
:
IsPreviousPosition
(
POS_FACEUP
)
and
c
:
GetPreviousControler
()
==
tp
and
c
:
IsPreviousSetCard
(
0x5bc4
)
and
(
c
:
IsReason
(
REASON_BATTLE
)
or
(
rp
==
1
-
tp
and
c
:
IsReason
(
REASON_EFFECT
)))
end
function
c9980237
.
spcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
c9980237
.
spcfilter
,
1
,
nil
,
tp
,
rp
)
end
function
c9980237
.
filter
(
c
,
e
,
tp
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x5bc4
)
and
c
:
IsType
(
TYPE_MONSTER
)
and
(
c
:
IsLocation
(
LOCATION_GRAVE
)
or
(
c
:
IsLocation
(
LOCATION_EXTRA
)
and
Duel
.
GetLocationCountFromEx
(
tp
,
tp
,
c
)
>
0
))
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c9980237
.
sptg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
+
LOCATION_EXTRA
)
and
chkc
:
IsControler
(
tp
)
and
c9980237
.
filter
(
chkc
,
e
,
tp
)
end
if
chk
==
0
then
return
Duel
.
GetLocationCount
(
tp
,
LOCATION_MZONE
)
>
0
and
Duel
.
IsExistingTarget
(
c9980237
.
filter
,
tp
,
LOCATION_GRAVE
+
LOCATION_EXTRA
,
0
,
1
,
nil
,
e
,
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c9980237
.
filter
,
tp
,
LOCATION_GRAVE
+
LOCATION_EXTRA
,
0
,
1
,
1
,
nil
,
e
,
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
g
,
1
,
0
,
0
)
end
function
c9980237
.
spop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
then
return
end
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
SpecialSummon
(
tc
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP_ATTACK
)
end
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980237
,
1
))
end
expansions/script/c9980287.lua
View file @
aefaf8b5
--外传纪录·愤怒之梅丽莎
function
c9980287
.
initial_effect
(
c
)
c
:
EnableCounterPermit
(
0x1
)
--link summon
aux
.
AddLinkProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsLinkRace
,
RACE_SPELLCASTER
),
2
,
2
,
c9980287
.
lcheck
)
c
:
EnableReviveLimit
()
--counter
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCondition
(
c9980287
.
ctcon
)
e2
:
SetOperation
(
c9980287
.
ctop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e3
)
--atkup
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
)
e4
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e4
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetValue
(
c9980287
.
atkval
)
c
:
RegisterEffect
(
e4
)
--cannot target
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCode
(
EFFECT_CANNOT_BE_EFFECT_TARGET
)
e2
:
SetValue
(
aux
.
tgoval
)
c
:
RegisterEffect
(
e2
)
--indes
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
e3
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetValue
(
aux
.
indoval
)
c
:
RegisterEffect
(
e3
)
--to hand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
9980287
,
0
))
e1
:
SetCategory
(
CATEGORY_TOHAND
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
,
9980287
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_END_PHASE
)
e1
:
SetTarget
(
c9980287
.
thtg
)
e1
:
SetOperation
(
c9980287
.
thop
)
c
:
RegisterEffect
(
e1
)
--spsummon bgm
local
e8
=
Effect
.
CreateEffect
(
c
)
e8
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e8
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e8
:
SetOperation
(
c9980287
.
sumsuc
)
c
:
RegisterEffect
(
e8
)
local
e9
=
e8
:
Clone
()
e9
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
c
:
RegisterEffect
(
e9
)
end
function
c9980287
.
sumsuc
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980287
,
1
))
end
function
c9980287
.
lcheck
(
g
,
lc
)
return
g
:
IsExists
(
Card
.
IsLinkSetCard
,
1
,
nil
,
0xbc4
)
end
function
c9980287
.
cfilter
(
c
,
ec
)
if
c
:
IsLocation
(
LOCATION_MZONE
)
then
return
c
:
IsSetCard
(
0xbc4
)
and
c
:
IsFaceup
()
and
ec
:
GetLinkedGroup
():
IsContains
(
c
)
else
return
c
:
IsPreviousSetCard
(
0xbc4
)
and
c
:
IsPreviousPosition
(
POS_FACEUP
)
and
bit
.
extract
(
ec
:
GetLinkedZone
(
c
:
GetPreviousControler
()),
c
:
GetPreviousSequence
())
~=
0
end
end
function
c9980287
.
ctcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
c9980287
.
cfilter
,
1
,
nil
,
e
:
GetHandler
())
end
function
c9980287
.
ctop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
e
:
GetHandler
():
AddCounter
(
0x1
,
1
)
end
function
c9980287
.
atkval
(
e
,
c
)
return
Duel
.
GetCounter
(
c
:
GetControler
(),
1
,
0
,
0x1
)
*
100
end
function
c9980287
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsAbleToHand
()
end
function
c9980287
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsOnField
()
and
c9980287
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsCanRemoveCounter
(
tp
,
1
,
1
,
0x1
,
1
,
REASON_EFFECT
)
and
Duel
.
IsExistingTarget
(
c9980287
.
filter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RTOHAND
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c9980287
.
filter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
1
,
0
,
0
)
end
function
c9980287
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
IsCanRemoveCounter
(
tp
,
1
,
1
,
0x1
,
1
,
REASON_EFFECT
)
then
Duel
.
RemoveCounter
(
tp
,
1
,
1
,
0x1
,
1
,
REASON_EFFECT
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980287
,
1
))
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
end
end
end
--外传纪录·愤怒之梅丽莎
function
c9980287
.
initial_effect
(
c
)
c
:
EnableCounterPermit
(
0x1
)
--link summon
aux
.
AddLinkProcedure
(
c
,
aux
.
FilterBoolFunction
(
Card
.
IsLinkRace
,
RACE_SPELLCASTER
),
2
,
2
,
c9980287
.
lcheck
)
c
:
EnableReviveLimit
()
--counter
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_CONTINUOUS
)
e2
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCondition
(
c9980287
.
ctcon
)
e2
:
SetOperation
(
c9980287
.
ctop
)
c
:
RegisterEffect
(
e2
)
local
e3
=
e2
:
Clone
()
e3
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
c
:
RegisterEffect
(
e3
)
--atkup
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetType
(
EFFECT_TYPE_SINGLE
)
e4
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e4
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e4
:
SetRange
(
LOCATION_MZONE
)
e4
:
SetValue
(
c9980287
.
atkval
)
c
:
RegisterEffect
(
e4
)
--cannot target
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e2
:
SetRange
(
LOCATION_MZONE
)
e2
:
SetCode
(
EFFECT_CANNOT_BE_EFFECT_TARGET
)
e2
:
SetValue
(
aux
.
tgoval
)
c
:
RegisterEffect
(
e2
)
--indes
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EFFECT_INDESTRUCTABLE_EFFECT
)
e3
:
SetProperty
(
EFFECT_FLAG_SINGLE_RANGE
)
e3
:
SetRange
(
LOCATION_MZONE
)
e3
:
SetValue
(
aux
.
indoval
)
c
:
RegisterEffect
(
e3
)
--to hand
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetDescription
(
aux
.
Stringid
(
9980287
,
0
))
e1
:
SetCategory
(
CATEGORY_TOHAND
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetType
(
EFFECT_TYPE_QUICK_O
)
e1
:
SetRange
(
LOCATION_MZONE
)
e1
:
SetCountLimit
(
1
,
9980287
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_END_PHASE
)
e1
:
SetTarget
(
c9980287
.
thtg
)
e1
:
SetOperation
(
c9980287
.
thop
)
c
:
RegisterEffect
(
e1
)
--spsummon bgm
local
e8
=
Effect
.
CreateEffect
(
c
)
e8
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_CONTINUOUS
)
e8
:
SetCode
(
EVENT_SPSUMMON_SUCCESS
)
e8
:
SetOperation
(
c9980287
.
sumsuc
)
c
:
RegisterEffect
(
e8
)
local
e9
=
e8
:
Clone
()
e9
:
SetCode
(
EVENT_SUMMON_SUCCESS
)
c
:
RegisterEffect
(
e9
)
end
function
c9980287
.
sumsuc
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980287
,
1
))
end
function
c9980287
.
lcheck
(
g
,
lc
)
return
g
:
IsExists
(
Card
.
IsLinkSetCard
,
1
,
nil
,
0xbc4
)
end
function
c9980287
.
cfilter
(
c
,
ec
)
if
c
:
IsLocation
(
LOCATION_MZONE
)
then
return
c
:
IsSetCard
(
0xbc4
)
and
c
:
IsFaceup
()
and
ec
:
GetLinkedGroup
():
IsContains
(
c
)
else
return
c
:
IsPreviousSetCard
(
0xbc4
)
and
c
:
IsPreviousPosition
(
POS_FACEUP
)
and
bit
.
extract
(
ec
:
GetLinkedZone
(
c
:
GetPreviousControler
()),
c
:
GetPreviousSequence
())
~=
0
end
end
function
c9980287
.
ctcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
eg
:
IsExists
(
c9980287
.
cfilter
,
1
,
nil
,
e
:
GetHandler
())
end
function
c9980287
.
ctop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
e
:
GetHandler
():
AddCounter
(
0x1
,
1
)
end
function
c9980287
.
atkval
(
e
,
c
)
return
Duel
.
GetCounter
(
c
:
GetControler
(),
1
,
0
,
0x1
)
*
100
end
function
c9980287
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsAbleToHand
()
end
function
c9980287
.
thtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsOnField
()
and
c9980287
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsCanRemoveCounter
(
tp
,
1
,
1
,
0x1
,
1
,
REASON_EFFECT
)
and
Duel
.
IsExistingTarget
(
c9980287
.
filter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_RTOHAND
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c9980287
.
filter
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOHAND
,
g
,
1
,
0
,
0
)
end
function
c9980287
.
thop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
Duel
.
IsCanRemoveCounter
(
tp
,
1
,
1
,
0x1
,
1
,
REASON_EFFECT
)
then
Duel
.
RemoveCounter
(
tp
,
1
,
1
,
0x1
,
1
,
REASON_EFFECT
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
then
Duel
.
Hint
(
HINT_MUSIC
,
0
,
aux
.
Stringid
(
9980287
,
1
))
Duel
.
SendtoHand
(
tc
,
nil
,
REASON_EFFECT
)
end
end
end
expansions/script/c9980512.lua
View file @
aefaf8b5
--光之流法—辉彩华刃
function
c9980512
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_ATKCHANGE
+
CATEGORY_DEFCHANGE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DAMAGE_STEP
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
TIMING_DAMAGE_STEP
)
e1
:
SetCondition
(
c9980512
.
condition
)
e1
:
SetTarget
(
c9980512
.
target
)
e1
:
SetOperation
(
c9980512
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
c9980513
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0xcbcc
)
end
function
c9980512
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetCurrentPhase
()
~=
PHASE_DAMAGE
or
not
Duel
.
IsDamageCalculated
()
and
Duel
.
IsExistingMatchingCard
(
c9980513
.
cfilter
,
tp
,
LOCATION_PZONE
+
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
c9980512
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x5bcc
)
end
function
c9980512
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
c9980512
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c9980512
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
Duel
.
SelectTarget
(
tp
,
c9980512
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
Duel
.
SetChainLimit
(
c9980512
.
chainlm
)
end
function
c9980512
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SET_ATTACK_FINAL
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
e1
:
SetValue
(
tc
:
GetAttack
()
*
2
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_SET_DEFENSE_FINAL
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
e2
:
SetValue
(
tc
:
GetDefense
()
*
2
)
tc
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e3
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EVENT_PRE_BATTLE_DAMAGE
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
e3
:
SetCondition
(
c9980512
.
rdcon
)
e3
:
SetOperation
(
c9980512
.
rdop
)
tc
:
RegisterEffect
(
e3
)
end
end
function
c9980512
.
chainlm
(
e
,
rp
,
tp
)
return
tp
==
rp
end
function
c9980512
.
rdcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
ep
~=
tp
end
function
c9980512
.
rdop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
ChangeBattleDamage
(
ep
,
ev
/
2
)
end
--光之流法—辉彩华刃
function
c9980512
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_ATKCHANGE
+
CATEGORY_DEFCHANGE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
+
EFFECT_FLAG_DAMAGE_STEP
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetHintTiming
(
TIMING_DAMAGE_STEP
)
e1
:
SetCondition
(
c9980512
.
condition
)
e1
:
SetTarget
(
c9980512
.
target
)
e1
:
SetOperation
(
c9980512
.
activate
)
c
:
RegisterEffect
(
e1
)
end
function
c9980513
.
cfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0xcbcc
)
end
function
c9980512
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetCurrentPhase
()
~=
PHASE_DAMAGE
or
not
Duel
.
IsDamageCalculated
()
and
Duel
.
IsExistingMatchingCard
(
c9980513
.
cfilter
,
tp
,
LOCATION_PZONE
+
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
c9980512
.
filter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x5bcc
)
end
function
c9980512
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_MZONE
)
and
chkc
:
IsControler
(
tp
)
and
c9980512
.
filter
(
chkc
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c9980512
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_FACEUP
)
Duel
.
SelectTarget
(
tp
,
c9980512
.
filter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
1
,
nil
)
Duel
.
SetChainLimit
(
c9980512
.
chainlm
)
end
function
c9980512
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
tc
:
IsFaceup
()
then
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_SET_ATTACK_FINAL
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
e1
:
SetValue
(
tc
:
GetAttack
()
*
2
)
tc
:
RegisterEffect
(
e1
)
local
e2
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e2
:
SetType
(
EFFECT_TYPE_SINGLE
)
e2
:
SetCode
(
EFFECT_SET_DEFENSE_FINAL
)
e2
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
e2
:
SetValue
(
tc
:
GetDefense
()
*
2
)
tc
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e3
:
SetType
(
EFFECT_TYPE_CONTINUOUS
+
EFFECT_TYPE_SINGLE
)
e3
:
SetCode
(
EVENT_PRE_BATTLE_DAMAGE
)
e3
:
SetReset
(
RESET_EVENT
+
RESETS_STANDARD
+
RESET_PHASE
+
PHASE_END
)
e3
:
SetCondition
(
c9980512
.
rdcon
)
e3
:
SetOperation
(
c9980512
.
rdop
)
tc
:
RegisterEffect
(
e3
)
end
end
function
c9980512
.
chainlm
(
e
,
rp
,
tp
)
return
tp
==
rp
end
function
c9980512
.
rdcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
ep
~=
tp
end
function
c9980512
.
rdop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
Duel
.
ChangeBattleDamage
(
ep
,
ev
/
2
)
end
expansions/script/c9980590.lua
View file @
aefaf8b5
--降临卡片·奇妙降临
function
c9980590
.
initial_effect
(
c
)
--activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_END_PHASE
)
e1
:
SetCountLimit
(
1
.
9980590
)
e1
:
SetCondition
(
c9980590
.
con1
)
e1
:
SetTarget
(
c9980590
.
tg
)
e1
:
SetOperation
(
c9980590
.
op
)
c
:
RegisterEffect
(
e1
)
--remove
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
9980590
,
1
))
e3
:
SetCategory
(
CATEGORY_REMOVE
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCountLimit
(
1
.
99805900
)
e3
:
SetCondition
(
c9980590
.
con2
)
e3
:
SetTarget
(
c9980590
.
tg
)
e3
:
SetOperation
(
c9980590
.
op
)
c
:
RegisterEffect
(
e3
)
--to hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
9980590
,
0
))
e2
:
SetCategory
(
CATEGORY_TODECK
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_F
)
e2
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCondition
(
c9980590
.
tdcon
)
e2
:
SetTarget
(
c9980590
.
tdtg
)
e2
:
SetOperation
(
c9980590
.
tdop
)
c
:
RegisterEffect
(
e2
)
end
function
c9980590
.
con1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
c9980590
.
confilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
c9980590
.
con2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
IsPreviousLocation
(
LOCATION_DECK
)
and
c
:
IsReason
(
REASON_REVEAL
)
and
Duel
.
IsExistingMatchingCard
(
c9980590
.
confilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
c9980590
.
confilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x6bca
)
end
function
c9980590
.
setfilter
(
c
,
tp
)
return
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c
:
IsSSetable
(
true
)
and
(
c
:
IsType
(
TYPE_FIELD
)
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
)
end
function
c9980590
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chkc
then
return
chkc
:
IsControler
(
1
-
tp
)
and
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
c9980590
.
setfilter
(
chkc
,
tp
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c9980590
.
setfilter
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
e
:
GetHandler
(),
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c9980590
.
setfilter
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
1
,
e
:
GetHandler
(),
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_LEAVE_GRAVE
,
g
,
1
,
0
,
0
)
end
function
c9980590
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
(
tc
:
IsType
(
TYPE_FIELD
)
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
)
then
Duel
.
SSet
(
tp
,
tc
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_LEAVE_FIELD_REDIRECT
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_REDIRECT
)
e1
:
SetValue
(
LOCATION_REMOVED
)
tc
:
RegisterEffect
(
e1
,
true
)
end
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e1
:
SetValue
(
200
)
e1
:
SetTarget
(
c9980590
.
filter1
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
Duel
.
RegisterEffect
(
e2
,
tp
)
Duel
.
Remove
(
sg
,
POS_FACEUP
,
REASON_EFFECT
)
end
function
c9980590
.
filter1
(
e
,
c
)
return
c
:
IsSetCard
(
0x6bca
)
end
function
c9980590
.
rccfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x6bca
)
end
function
c9980590
.
tdcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetTurnPlayer
()
==
tp
and
Duel
.
IsExistingMatchingCard
(
c9980590
.
rccfilter
,
tp
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
function
c9980590
.
tdtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToDeck
()
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c9980590
.
tdop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
or
e
:
GetHandler
():
IsFacedown
()
then
return
end
Duel
.
SendtoDeck
(
e
:
GetHandler
(),
nil
,
2
,
REASON_EFFECT
)
--降临卡片·奇妙降临
function
c9980590
.
initial_effect
(
c
)
--activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetCategory
(
CATEGORY_REMOVE
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
e1
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e1
:
SetHintTiming
(
0
,
TIMINGS_CHECK_MONSTER
+
TIMING_END_PHASE
)
e1
:
SetCountLimit
(
1
.
9980590
)
e1
:
SetCondition
(
c9980590
.
con1
)
e1
:
SetTarget
(
c9980590
.
tg
)
e1
:
SetOperation
(
c9980590
.
op
)
c
:
RegisterEffect
(
e1
)
--remove
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetDescription
(
aux
.
Stringid
(
9980590
,
1
))
e3
:
SetCategory
(
CATEGORY_REMOVE
)
e3
:
SetType
(
EFFECT_TYPE_SINGLE
+
EFFECT_TYPE_TRIGGER_O
)
e3
:
SetProperty
(
EFFECT_FLAG_DELAY
)
e3
:
SetCode
(
EVENT_TO_GRAVE
)
e3
:
SetCountLimit
(
1
.
99805900
)
e3
:
SetCondition
(
c9980590
.
con2
)
e3
:
SetTarget
(
c9980590
.
tg
)
e3
:
SetOperation
(
c9980590
.
op
)
c
:
RegisterEffect
(
e3
)
--to hand
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
9980590
,
0
))
e2
:
SetCategory
(
CATEGORY_TODECK
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
+
EFFECT_TYPE_TRIGGER_F
)
e2
:
SetCode
(
EVENT_PHASE
+
PHASE_END
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetCondition
(
c9980590
.
tdcon
)
e2
:
SetTarget
(
c9980590
.
tdtg
)
e2
:
SetOperation
(
c9980590
.
tdop
)
c
:
RegisterEffect
(
e2
)
end
function
c9980590
.
con1
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
IsExistingMatchingCard
(
c9980590
.
confilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
c9980590
.
con2
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
return
c
:
IsPreviousLocation
(
LOCATION_DECK
)
and
c
:
IsReason
(
REASON_REVEAL
)
and
Duel
.
IsExistingMatchingCard
(
c9980590
.
confilter
,
tp
,
LOCATION_MZONE
,
0
,
1
,
nil
)
end
function
c9980590
.
confilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x6bca
)
end
function
c9980590
.
setfilter
(
c
,
tp
)
return
c
:
IsType
(
TYPE_SPELL
+
TYPE_TRAP
)
and
c
:
IsSSetable
(
true
)
and
(
c
:
IsType
(
TYPE_FIELD
)
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
)
end
function
c9980590
.
tg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chkc
then
return
chkc
:
IsControler
(
1
-
tp
)
and
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
c9980590
.
setfilter
(
chkc
,
tp
)
end
if
chk
==
0
then
return
Duel
.
IsExistingTarget
(
c9980590
.
setfilter
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
e
:
GetHandler
(),
tp
)
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SET
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c9980590
.
setfilter
,
tp
,
LOCATION_GRAVE
,
LOCATION_GRAVE
,
1
,
1
,
e
:
GetHandler
(),
tp
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_LEAVE_GRAVE
,
g
,
1
,
0
,
0
)
end
function
c9980590
.
op
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
tc
=
Duel
.
GetFirstTarget
()
if
tc
:
IsRelateToEffect
(
e
)
and
(
tc
:
IsType
(
TYPE_FIELD
)
or
Duel
.
GetLocationCount
(
tp
,
LOCATION_SZONE
)
>
0
)
then
Duel
.
SSet
(
tp
,
tc
)
Duel
.
ConfirmCards
(
1
-
tp
,
tc
)
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_SINGLE
)
e1
:
SetCode
(
EFFECT_LEAVE_FIELD_REDIRECT
)
e1
:
SetReset
(
RESET_EVENT
+
RESETS_REDIRECT
)
e1
:
SetValue
(
LOCATION_REMOVED
)
tc
:
RegisterEffect
(
e1
,
true
)
end
local
e1
=
Effect
.
CreateEffect
(
e
:
GetHandler
())
e1
:
SetType
(
EFFECT_TYPE_FIELD
)
e1
:
SetCode
(
EFFECT_UPDATE_ATTACK
)
e1
:
SetTargetRange
(
LOCATION_MZONE
,
0
)
e1
:
SetValue
(
200
)
e1
:
SetTarget
(
c9980590
.
filter1
)
e1
:
SetReset
(
RESET_PHASE
+
PHASE_END
)
Duel
.
RegisterEffect
(
e1
,
tp
)
local
e2
=
e1
:
Clone
()
e2
:
SetCode
(
EFFECT_UPDATE_DEFENSE
)
Duel
.
RegisterEffect
(
e2
,
tp
)
Duel
.
Remove
(
tc
,
POS_FACEUP
,
REASON_EFFECT
)
end
function
c9980590
.
filter1
(
e
,
c
)
return
c
:
IsSetCard
(
0x6bca
)
end
function
c9980590
.
rccfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x6bca
)
end
function
c9980590
.
tdcon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
return
Duel
.
GetTurnPlayer
()
==
tp
and
Duel
.
IsExistingMatchingCard
(
c9980590
.
rccfilter
,
tp
,
LOCATION_MZONE
+
LOCATION_GRAVE
,
0
,
1
,
nil
)
end
function
c9980590
.
tdtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
e
:
GetHandler
():
IsAbleToDeck
()
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
e
:
GetHandler
(),
1
,
0
,
0
)
end
function
c9980590
.
tdop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
not
e
:
GetHandler
():
IsRelateToEffect
(
e
)
or
e
:
GetHandler
():
IsFacedown
()
then
return
end
Duel
.
SendtoDeck
(
e
:
GetHandler
(),
nil
,
2
,
REASON_EFFECT
)
end
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment