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
3a8b4f55
Commit
3a8b4f55
authored
Feb 02, 2020
by
gg123gg
Committed by
GitHub
Feb 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add files via upload
parent
e15ea7b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
112 additions
and
112 deletions
+112
-112
expansions/script/c12005022.lua
expansions/script/c12005022.lua
+112
-112
No files found.
expansions/script/c12005022.lua
View file @
3a8b4f55
--小小的捉弄
function
c12005022
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetCondition
(
c12005022
.
condition
)
e1
:
SetTarget
(
c12005022
.
target
)
e1
:
SetOperation
(
c12005022
.
activate
)
c
:
RegisterEffect
(
e1
)
--asdasdasd
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
12005022
,
0
))
e2
:
SetCategory
(
CATEGORY_TODECK
+
CATEGORY_DRAW
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetTarget
(
c12005022
.
tdtg
)
e2
:
SetOperation
(
c12005022
.
tdop
)
c
:
RegisterEffect
(
e2
)
end
function
c12005022
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0xfbb
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c12005022
.
cfilter
(
c
)
return
c
:
IsType
(
TYPE_COUNTER
)
and
c
:
IsAbleToDeck
()
end
function
c12005022
.
tdtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
c
=
e
:
GetHandler
()
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
chkc
:
IsControler
(
tp
)
and
c12005022
.
cfilter
(
chkc
)
and
chkc
~=
c
end
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
and
Duel
.
IsExistingTarget
(
c12005022
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
c
)
and
c
:
IsAbleToDeck
()
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c12005022
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
2
,
c
)
local
rg
=
g
:
Clone
()
rg
:
AddCard
(
c
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
rg
,
rg
:
GetCount
(),
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
c12005022
.
tdop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsAbleToDeck
()
or
not
c
:
IsRelateToEffect
(
e
)
then
return
end
local
tg
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
)
local
sg
=
tg
:
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
)
sg
:
AddCard
(
c
)
if
Duel
.
SendtoDeck
(
sg
,
nil
,
2
,
REASON_EFFECT
)
>
0
then
local
og
=
Duel
.
GetOperatedGroup
()
if
og
:
IsExists
(
Card
.
IsLocation
,
1
,
nil
,
LOCATION_DECK
)
then
Duel
.
ShuffleDeck
(
tp
)
end
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
function
c12005022
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
re
:
IsHasCategory
(
CATEGORY_DRAW
+
CATEGORY_TOHAND
)
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
if
re
:
IsHasCategory
(
CATEGORY_DISABLE
+
CATEGORY_NEGATE
+
CATEGORY_DISABLE_SUMMON
)
then
return
Duel
.
IsChainNegatable
(
ev
)
end
return
true
end
function
c12005022
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
true
end
Duel
.
SetTargetPlayer
(
1
-
tp
)
Duel
.
SetTargetParam
(
100
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DAMAGE
,
nil
,
0
,
1
-
tp
,
100
)
local
ex
=
Duel
.
GetOperationInfo
(
ev
,
CATEGORY_REMOVE
)
if
re
:
IsHasCategory
(
CATEGORY_SPECIAL_SUMMON
)
then
e
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
c
,
1
,
0
,
0
)
end
if
re
:
IsHasCategory
(
CATEGORY_DRAW
+
CATEGORY_TOHAND
)
then
e
:
SetCategory
(
CATEGORY_DRAW
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
if
re
:
IsHasCategory
(
CATEGORY_DESTROY
+
CATEGORY_REMOVE
)
or
ex
then
e
:
SetCategory
(
CATEGORY_DESTROY
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
0
,
LOCATION_ONFIELD
)
end
if
re
:
IsHasCategory
(
CATEGORY_DISABLE
+
CATEGORY_NEGATE
+
CATEGORY_DISABLE_SUMMON
)
then
e
:
SetCategory
(
CATEGORY_DISABLE
+
CATEGORY_NEGATE
+
CATEGORY_DISABLE_SUMMON
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_NEGATE
,
eg
,
1
,
0
,
0
)
end
end
function
c12005022
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
,
rc
=
e
:
GetHandler
(),
re
:
GetHandler
()
if
Duel
.
Damage
(
1
-
tp
,
100
,
REASON_EFFECT
)
<=
0
then
return
end
local
b1
=
c
:
IsAbleToDeck
()
and
Duel
.
IsExistingMatchingCard
(
c12005022
.
spfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
)
and
re
:
IsHasCategory
(
CATEGORY_SPECIAL_SUMMON
)
local
b2
=
re
:
IsHasCategory
(
CATEGORY_DRAW
+
CATEGORY_TOHAND
)
local
b3
=
(
re
:
IsHasCategory
(
CATEGORY_DESTROY
+
CATEGORY_REMOVE
)
or
ex
)
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
local
b4
=
re
:
IsHasCategory
(
CATEGORY_DISABLE
+
CATEGORY_NEGATE
+
CATEGORY_DISABLE_SUMMON
)
if
not
(
b1
or
b2
or
b3
or
b4
)
then
return
end
Duel
.
BreakEffect
()
if
b1
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
12005022
,
1
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
c12005022
.
spfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
Duel
.
SpecialSummon
(
sg
,
0
,
tp
,
tp
,
false
,
false
)
~=
0
and
c
:
IsRelateToEffect
(
e
)
then
c
:
CancelToGrave
(
true
)
Duel
.
SendtoDeck
(
c
,
nil
,
0
,
REASON_EFFECT
)
end
end
if
b2
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
if
b3
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
12005022
,
3
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToGrave
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
tg
)
Duel
.
SendtoGrave
(
tg
,
REASON_EFFECT
)
end
if
b4
then
Duel
.
NegateActivation
(
ev
)
end
--小小的捉弄
function
c12005022
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_CHAINING
)
e1
:
SetCondition
(
c12005022
.
condition
)
e1
:
SetTarget
(
c12005022
.
target
)
e1
:
SetOperation
(
c12005022
.
activate
)
c
:
RegisterEffect
(
e1
)
--asdasdasd
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetDescription
(
aux
.
Stringid
(
12005022
,
0
))
e2
:
SetCategory
(
CATEGORY_TODECK
+
CATEGORY_DRAW
)
e2
:
SetType
(
EFFECT_TYPE_IGNITION
)
e2
:
SetProperty
(
EFFECT_FLAG_CARD_TARGET
)
e2
:
SetRange
(
LOCATION_GRAVE
)
e2
:
SetTarget
(
c12005022
.
tdtg
)
e2
:
SetOperation
(
c12005022
.
tdop
)
c
:
RegisterEffect
(
e2
)
end
function
c12005022
.
spfilter
(
c
,
e
,
tp
)
return
c
:
IsSetCard
(
0xfbb
)
and
c
:
IsCanBeSpecialSummoned
(
e
,
0
,
tp
,
false
,
false
)
end
function
c12005022
.
cfilter
(
c
)
return
c
:
IsType
(
TYPE_COUNTER
)
and
c
:
IsAbleToDeck
()
end
function
c12005022
.
tdtg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
,
chkc
)
local
c
=
e
:
GetHandler
()
if
chkc
then
return
chkc
:
IsLocation
(
LOCATION_GRAVE
)
and
chkc
:
IsControler
(
tp
)
and
c12005022
.
cfilter
(
chkc
)
and
chkc
~=
c
end
if
chk
==
0
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
and
Duel
.
IsExistingTarget
(
c12005022
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
c
)
and
c
:
IsAbleToDeck
()
end
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TODECK
)
local
g
=
Duel
.
SelectTarget
(
tp
,
c12005022
.
cfilter
,
tp
,
LOCATION_GRAVE
,
0
,
1
,
2
,
c
)
local
rg
=
g
:
Clone
()
rg
:
AddCard
(
c
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
rg
,
rg
:
GetCount
(),
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
function
c12005022
.
tdop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
=
e
:
GetHandler
()
if
not
c
:
IsAbleToDeck
()
or
not
c
:
IsRelateToEffect
(
e
)
then
return
end
local
tg
=
Duel
.
GetChainInfo
(
0
,
CHAININFO_TARGET_CARDS
)
local
sg
=
tg
:
Filter
(
Card
.
IsRelateToEffect
,
nil
,
e
)
sg
:
AddCard
(
c
)
if
Duel
.
SendtoDeck
(
sg
,
nil
,
2
,
REASON_EFFECT
)
>
0
then
local
og
=
Duel
.
GetOperatedGroup
()
if
og
:
IsExists
(
Card
.
IsLocation
,
1
,
nil
,
LOCATION_DECK
)
then
Duel
.
ShuffleDeck
(
tp
)
end
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
end
function
c12005022
.
condition
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
if
re
:
IsHasCategory
(
CATEGORY_DRAW
+
CATEGORY_TOHAND
)
then
return
Duel
.
IsPlayerCanDraw
(
tp
,
1
)
end
if
re
:
IsHasCategory
(
CATEGORY_DISABLE
+
CATEGORY_NEGATE
+
CATEGORY_DISABLE_SUMMON
)
then
return
Duel
.
IsChainNegatable
(
ev
)
end
return
true
end
function
c12005022
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
local
c
=
e
:
GetHandler
()
if
chk
==
0
then
return
true
end
Duel
.
SetTargetPlayer
(
1
-
tp
)
Duel
.
SetTargetParam
(
100
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DAMAGE
,
nil
,
0
,
1
-
tp
,
100
)
local
ex
=
Duel
.
GetOperationInfo
(
ev
,
CATEGORY_REMOVE
)
if
re
:
IsHasCategory
(
CATEGORY_SPECIAL_SUMMON
)
then
e
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_HAND
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TODECK
,
c
,
1
,
0
,
0
)
end
if
re
:
IsHasCategory
(
CATEGORY_DRAW
+
CATEGORY_TOHAND
)
then
e
:
SetCategory
(
CATEGORY_DRAW
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DRAW
,
nil
,
0
,
tp
,
1
)
end
if
re
:
IsHasCategory
(
CATEGORY_DESTROY
+
CATEGORY_REMOVE
)
or
ex
then
e
:
SetCategory
(
CATEGORY_DESTROY
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_TOGRAVE
,
nil
,
1
,
0
,
LOCATION_ONFIELD
)
end
if
re
:
IsHasCategory
(
CATEGORY_DISABLE
+
CATEGORY_NEGATE
+
CATEGORY_DISABLE_SUMMON
)
then
e
:
SetCategory
(
CATEGORY_DISABLE
+
CATEGORY_NEGATE
+
CATEGORY_DISABLE_SUMMON
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_NEGATE
,
eg
,
1
,
0
,
0
)
end
end
function
c12005022
.
activate
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
c
,
rc
=
e
:
GetHandler
(),
re
:
GetHandler
()
if
Duel
.
Damage
(
1
-
tp
,
100
,
REASON_EFFECT
)
<=
0
then
return
end
local
b1
=
Duel
.
IsExistingMatchingCard
(
c12005022
.
spfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
nil
,
e
,
tp
)
and
re
:
IsHasCategory
(
CATEGORY_SPECIAL_SUMMON
)
local
b2
=
re
:
IsHasCategory
(
CATEGORY_DRAW
+
CATEGORY_TOHAND
)
local
b3
=
(
re
:
IsHasCategory
(
CATEGORY_DESTROY
+
CATEGORY_REMOVE
)
or
ex
)
and
Duel
.
IsExistingMatchingCard
(
Card
.
IsAbleToGrave
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
nil
)
local
b4
=
re
:
IsHasCategory
(
CATEGORY_DISABLE
+
CATEGORY_NEGATE
+
CATEGORY_DISABLE_SUMMON
)
if
not
(
b1
or
b2
or
b3
or
b4
)
then
return
end
Duel
.
BreakEffect
()
if
b1
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
12005022
,
1
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
Duel
.
SelectMatchingCard
(
tp
,
c12005022
.
spfilter
,
tp
,
LOCATION_HAND
,
0
,
1
,
1
,
nil
,
e
,
tp
)
if
Duel
.
SpecialSummon
(
sg
,
0
,
tp
,
tp
,
false
,
false
,
POS_FACEUP
)
~=
0
and
c
:
IsRelateToEffect
(
e
)
then
c
:
CancelToGrave
(
true
)
Duel
.
SendtoDeck
(
c
,
nil
,
0
,
REASON_EFFECT
)
end
end
if
b2
then
Duel
.
Draw
(
tp
,
1
,
REASON_EFFECT
)
end
if
b3
and
Duel
.
SelectYesNo
(
tp
,
aux
.
Stringid
(
12005022
,
3
))
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_TOGRAVE
)
local
tg
=
Duel
.
SelectMatchingCard
(
tp
,
Card
.
IsAbleToGrave
,
tp
,
LOCATION_ONFIELD
,
LOCATION_ONFIELD
,
1
,
1
,
nil
)
Duel
.
HintSelection
(
tg
)
Duel
.
SendtoGrave
(
tg
,
REASON_EFFECT
)
end
if
b4
then
Duel
.
NegateActivation
(
ev
)
end
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