Commit 46044b17 authored by Nemo Ma's avatar Nemo Ma

maint

parent d0229a72
......@@ -1599,6 +1599,51 @@
31200016 0
31200014 0
31200012 0
#「空想」系列 - 萌萌尺酱
33310200 0
33310201 0
33310203 0
33310204 0
33310207 0
33310209 0
33310210 0
33310211 0
33310212 0
33310213 0
33310214 0
33310215 0
#230625
10113025 0
10173032 0
11451518 0
12812006 0
15000096 0
15000496 0
15004459 0
26692740 0
32909498 0
33310207 0
33310210 0
33310213 0
33330080 0
33331354 0
33701324 0
40011040 0
51728356 0
53759010 0
60001249 0
65130303 0
72100123 0
82209081 0
6109001 1
10105552 1
11561016 1
15000604 1
60159943 1
98920192 1
35399325 2
35399330 2
60150815 2
#230618
53796103 0
#230611
......@@ -1689,9 +1734,6 @@
79029060 0
82221053 0
98920304 0
33310207 1
33310210 1
33310213 1
83000087 1
6100020 2
9910088 2
......@@ -1857,7 +1899,6 @@
40009425 2
82224022 2
76029004 2
98920204 2
#230226
12852002 0
11612601 0
......@@ -2005,7 +2046,6 @@
14000116 0
31421004 0
65010201 0
6109001 2
#221120
14000118 0
22021830 0
......@@ -2549,7 +2589,6 @@
89388000 0
188853 1
40009278 1
53796032 1
#220717
25000404 0
33701420 0
......@@ -2643,7 +2682,6 @@
871100009 1
31421001 0
65010051 1
72412240 1
871100001 1
#220522
60001179 0
......@@ -2706,8 +2744,6 @@
40009259 0
14050005 0
22070090 1
9910717 2
67210000 2
#220327
12057601 0
12057606 0
......@@ -3447,7 +3483,6 @@
33403512 0
33403502 1
33403509 1
48130397 2 --Special
#210711
10700085 0
14000216 0
......@@ -3459,7 +3494,6 @@
14010099 1
79023004 2
89387021 2
60150815 1
#210627
33711601 0
33711501 1
......@@ -3582,7 +3616,6 @@
31470002 0
31470011 0
33330092 0
33701324 1
33711107 1
60159907 0
60159941 0
......@@ -3638,7 +3671,6 @@
79034052 0
14010062 1
22020490 1
33330080 1
79029233 1
#210404
14010199 0
......@@ -5078,7 +5110,6 @@
9950742 2
#Forbidden TCG
##MAIN DECK MONSTERS
53804307 0 --Blaster, Dragon Ruler of Infernos
94689206 0 --Block Dragon
8903700 0 --Djinn Releaser of Rituals
51858306 0 --Eclipse Wyvern
......@@ -5101,7 +5132,6 @@
21377582 0 --Master Peace, The True Dracoslaying King
23558733 0 --Phoenixian Cluster Amaryllis
1357146 0 --Ronintoadin
5592689 0 --Samsara Lotus
75732622 0 --Grinder Golem
57835716 0 --Orcust Harp Horror
67441435 0 --Glow-up Bulb
......@@ -5109,12 +5139,11 @@
6728559 0 --Archnemeses Protos
20292186 0 --Artifact Scythe
73356503 0 --Barrier Statue of the Stormwinds
69015963 0 --Cyber-Stein
17412721 0 --Elder Entity Norden EXTRA DECK MONSTERS
43387895 0 --Supreme King Dragon Starving Venom
15291624 0 --Thunder Dragon Colossus
92731385 0 --Tearlaments Kitkallos
25862691 0 --Ancient Fairy Dragon (Pre-errata)
65536818 0 --Denglong, First of the Yang Zing
3040496 0 --Chaos Ruler, the Chaotic Magical Dragon
94677445 0 --Ib the World Chalice Justiciar
63101919 0 --Tempest Magician
......@@ -5146,6 +5175,8 @@
70369116 0 --Predaplant Verte Anaconda
98095162 0 --Curious, the Lightsworn Dominion
27381364 0 --Spright Elf
33918636 0 --Superheavy Samurai Scarecrow
95474755 0 --Number 89: Diablosis the Mind Hacker
69243953 0 --Butterfly Dagger - Elma SPELLS CARDS
57953380 0 --Card of Safe Return
67616300 0 --Chicken Game
......@@ -5183,6 +5214,8 @@
80604091 0 --Ultimate Offering
80604092 0 --Ultimate Offering
5851097 0 --Vanity's Emptiness
43262273 0 --Appointer of the Red Lotus
1041278 0 --Branded Expulsion
#Limited TCG
7902349 1 --Left Arm of the forbidden one MAIN DECK MONSTERS
44519536 1 --Left Leg of the forbidden one
......@@ -5190,18 +5223,15 @@
8124921 1 --Right Leg of the forbidden one
61901281 1 --Black Dragon Collapserpent
33396948 1 --Exodia the Forbidden One
64034255 1 --Genex Ally birdman
99177923 1 --Infernity Archfiend
89399912 1 --Tempest, Dragon Ruler of Storms
26889158 1 --Salamangreat Gazelle
81275020 1 --Speedroid Terrortop
99234526 1 --White Dragon Wyverburster
78872731 1 --Zoodiac Ratpier
78080961 1 --SPYRAL Quik-Fix
33508719 1 --Morphing Jar
28985331 1 --Armageddon Knight
14536035 1 --Dark Grepher
69015963 1 --Cyber Stein
12958919 1 --Phantom Skyblaster
43694650 1 --Danger!? Jackalope?
99745551 1 --Danger!? Tsuchinoko?
......@@ -5211,10 +5241,8 @@
83190280 1 --Lunalight Tiger
17330916 1 --Performapal Monkeyboard
26118970 1 --Red Rose Dragon
9047460 1 --Blackwing - Steam the Cloak
34124316 1 --Cyber Jar
20663556 1 --Substitoad
17266660 1 --Herald of Orange Light
62320425 1 --Agido the Ancient Sentry
25926710 1 --Kelbek the Ancient Vanguard
63542003 1 --Keldo the Sacred Protector
......@@ -5222,6 +5250,9 @@
37961969 1 --Tearlaments Havnis
74078255 1 --Tearlaments Merrli
572850 1 --Tearlaments Scheiren
53804307 1 --Blaster, Dragon Ruler of Infernos
36521307 1 --Mathmech Circular
38814750 1 --PSY-Framegear Gamma
39512984 1 --Gem-Knight Master Diamond EXTRA DECK MONSTERS
25862681 1 --Ancient Fairy Dragon
90953320 1 --T.G. Hyper Librarian
......@@ -5229,6 +5260,8 @@
27552504 1 --Beatrice, Lady of Eternal
581014 1 --Daigusto Emeral
73539069 1 --Striker Dragon
65536818 1 --Denglong, First of the Yang Zing
48626373 1 --Kashtira Arise-Heart
95308449 1 --Final Countdown SPELL CARDS
81439173 1 --Foolish Burial
18144506 1 --Harpie's Feather Duster
......@@ -5236,8 +5269,6 @@
33782437 1 --One Day of Peace
2295440 1 --One for One
32807846 1 --Reinforcement of the Army
24010609 1 --Sky Striker Mecha Modules - Multirole
14733538 1 --Draco Face-off
73468603 1 --Set Rotation
73628505 1 --Terraforming
58577036 1 --Reasoning
......@@ -5259,17 +5290,22 @@
52340444 1 --Sky Striker Mecha - Hornet Drones
1845204 1 --Instant Fusion
37520316 1 --Mind Control
63166095 1 --Sky Striker Mobilize - Engage!
43040603 1 --Monster Gate
4031928 1 --Change of Heart
46448938 1 --Spellbook of Judgement
55584558 1 --Purrely Delicious Memory
32723153 1 --Magical Explosion --TRAP CARDS
35316708 1 --Time Seal
43262273 1 --Appointer of the Red Lotus
3734202 1 --Naturia Sacred Tree
#Semi-Limited TCG
9411399 2 --Destiny HERO - Malicious
8491961 2 --Lyrilusc - Recital Starling
17266660 2 --Herald of Orange Light
68304193 2 --Kashtira Unicorn
35261759 2 --Pot of Desires
63166095 2 --Sky Striker Mobilize - Engage!
14532163 2 --Lightning Storm
92107604 2 --Runick Fountain
15443125 2 --Spright Starter
!THE WILD LIST
20000 0
......@@ -6821,7 +6857,6 @@
10113048 0
10113098 0
10133016 0
10150030 2
10150098 0
10170006 1
10173016 1
......@@ -7028,7 +7063,6 @@
14010079 0
14010084 0
14010088 0
14010096 2
14010099 1
14010108 0
14010111 0
......@@ -7583,7 +7617,6 @@
33330048 0
33330076 1
33330078 2
33330080 1
33330092 0
33330093 1
33330102 0
......@@ -8457,7 +8490,6 @@
53752019 0
53796022 0
53796028 0
53796032 1
53796033 0
53796034 0
53797001 0
......
No preview for this file type
--末那愚子族型俱舍怒威族
function c11561000.initial_effect(c)
--SpecialSummon and remove
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,11561000)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2 end)
e1:SetTarget(c11561000.sprtg)
e1:SetOperation(c11561000.sprop)
c:RegisterEffect(e1)
--des
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,21561000)
e2:SetTarget(c11561000.destg)
e2:SetOperation(c11561000.desop)
c:RegisterEffect(e2)
--sp
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DESTROYED)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,31561000)
e3:SetCondition(function(e)
return e:GetHandler():IsReason(REASON_EFFECT+REASON_BATTLE) end)
e3:SetTarget(c11561000.sptg)
e3:SetOperation(c11561000.spop)
c:RegisterEffect(e3)
end
function c11561000.rmfil(c)
return c:IsSetCard(0x189,0x190) and c:IsAbleToRemove()
end
function c11561000.sprtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c11561000.rmfil,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c11561000.sprop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) and Duel.IsExistingMatchingCard(c11561000.rmfil,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil) then
local rg=Duel.SelectMatchingCard(tp,c11561000.rmfil,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end
end
function c11561000.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(function(c) return c:IsFaceup() and c:IsSetCard(0x189,0x190) end,tp,LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_MZONE)
end
function c11561000.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(function(c) return c:IsFaceup() and c:IsSetCard(0x189,0x190) end,tp,LOCATION_MZONE,0,nil)
if g:GetCount()>0 then
local dg=g:Select(tp,1,1,nil)
Duel.Destroy(dg,REASON_EFFECT)
end
end
function c11561000.spfil(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCode(11561000)
end
function c11561000.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11561000.spfil,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
e:SetLabel(Duel.AnnounceLevel(tp,1,6))
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c11561000.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local lv=e:GetLabel()
local g=Duel.GetMatchingGroup(c11561000.spfil,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local sg=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
if Duel.IsExistingMatchingCard(function(c,lv) return c:IsFaceup() and c:IsSetCard(0x189,0x190) and not c:IsLevel(lv) end,tp,LOCATION_MZONE,0,1,nil,lv) and Duel.SelectYesNo(tp,aux.Stringid(11561000,0)) then
Duel.BreakEffect()
local tc=Duel.SelectMatchingCard(tp,function(c,lv) return c:IsFaceup() and c:IsSetCard(0x189,0x190) and not c:IsLevel(lv) end,tp,LOCATION_MZONE,0,1,1,nil,lv):GetFirst()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_ADD_TYPE)
e1:SetValue(TYPE_TUNER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
end
--编程-零 伪造报文
local m=14000601
local cm=_G["c"..m]
cm.named_with_CodeNull=1
function cm.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCost(cm.eccost)
e1:SetCondition(cm.eccon)
e1:SetTarget(cm.ectg)
e1:SetOperation(cm.ecop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.spcon1)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetCondition(cm.spcon2)
c:RegisterEffect(e3)
end
function cm.eccost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsPublic() and c:GetFlagEffect(m)==0 end
c:RegisterFlagEffect(m,RESET_CHAIN,0,1)
end
function cm.eccon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and ((re:GetHandler():IsRace(RACE_CYBERSE) and rp==tp) or Duel.IsPlayerAffectedByEffect(tp,14000608))
end
function cm.spfilter(c,e,tp)
return c:IsRace(RACE_CYBERSE) and c:IsLevel(1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.ectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function cm.ecop(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,cm.repop)
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function cm.spcon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,14000601)
end
function cm.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,14000601)
end
function cm.filter(c,e,tp,code)
return not c:IsCode(code) and c:IsFaceup() and c:IsRace(RACE_CYBERSE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.rmfilter(c,e,tp)
return c:IsAbleToRemove() and c:IsFaceup() and ((c:IsControler(tp) and c:IsRace(RACE_CYBERSE)) or Duel.IsPlayerAffectedByEffect(tp,14000601))
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.rmfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,cm.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_REMOVED)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc or not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
if Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_REMOVED) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_REMOVED,0,1,nil,e,tp,tc:GetCode())and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
Duel.BreakEffect()
local mg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_REMOVED,0,nil,e,tp,tc:GetCode())
if #mg>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=mg:Select(tp,1,1,nil)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
\ No newline at end of file
--编程-零 远程端口
local m=14000602
local cm=_G["c"..m]
cm.named_with_CodeNull=1
function cm.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.spcon1)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCondition(cm.spcon2)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.thcon)
e3:SetCost(aux.bfgcost)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
end
function cm.spcon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,14000601)
end
function cm.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,14000601)
end
function cm.tdfilter(c,tp)
return c:IsAbleToDeck() and ((c:IsControler(tp) and c:IsRace(RACE_CYBERSE) and c:IsFaceup()) or Duel.IsPlayerAffectedByEffect(tp,14000601))
end
function cm.spfilter(c,e,tp)
return c:IsRace(RACE_CYBERSE) and c:IsLevel(1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.tdfilter(chkc,tp) end
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
and Duel.IsExistingTarget(cm.tdfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.tdfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c,tc=e:GetHandler(),Duel.GetFirstTarget()
if not c:IsRelateToEffect(e) then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
g:AddCard(e:GetHandler())
if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 and tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
end
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetTurnID()~=Duel.GetTurnCount() or c:GetReason()&REASON_RETURN==REASON_RETURN or c:GetReason()&REASON_LINK==REASON_LINK
end
function cm.thfilter(c)
return c:IsRace(RACE_CYBERSE) and c:IsType(TYPE_MONSTER) and c:IsLevel(1) 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) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--编程-零 越界标号
local m=14000603
local cm=_G["c"..m]
cm.named_with_CodeNull=1
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,cm.lkfilter,1,1)
c:EnableReviveLimit()
--todeck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_TODECK)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.tdcon1)
e1:SetTarget(cm.tdtg)
e1:SetOperation(cm.tdop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCondition(cm.tdcon2)
c:RegisterEffect(e2)
--hand link
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_HAND,0)
e3:SetTarget(cm.mattg)
e3:SetValue(cm.matval)
c:RegisterEffect(e3)
end
function cm.Code0(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_CodeNull
end
function cm.lkfilter(c)
return c:IsLinkRace(RACE_CYBERSE) and c:IsSummonType(SUMMON_TYPE_SPECIAL) and c:GetSummonLocation()==LOCATION_DECK
end
function cm.tdcon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,14000601)
end
function cm.tdcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,14000601)
end
function cm.tdfilter(c,tp)
return c:IsAbleToDeck() and ((c:IsControler(tp) and c:IsRace(RACE_CYBERSE) and c:IsFaceup()) or Duel.IsPlayerAffectedByEffect(tp,14000601))
end
function cm.thfilter(c,code)
return c:IsCode(code) and c:IsAbleToHand()
end
function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.tdfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.tdfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.tdfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,g:GetFirst():GetOwner(),LOCATION_DECK)
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc or not tc:IsRelateToEffect(e) then return end
local p,code=tc:GetOwner(),tc:GetCode()
if Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)==0 or not tc:IsLocation(LOCATION_DECK+LOCATION_EXTRA) then return end
if Duel.IsExistingMatchingCard(cm.thfilter,p,LOCATION_DECK,0,1,nil,code) and Duel.SelectYesNo(p,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(p,cm.thfilter,p,LOCATION_DECK,0,1,1,nil,code)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-p,g)
end
end
end
function cm.mfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_CYBERSE)
end
function cm.matval(e,lc,mg,c,tp)
if not lc:IsType(TYPE_LINK) then return false,nil end
return true,not mg or mg:IsExists(cm.mfilter,1,nil)
end
function cm.mattg(e,c)
return cm.Code0(c) and c:IsType(TYPE_MONSTER)
end
\ No newline at end of file
--编程-零 域名跳板
local m=14000604
local cm=_G["c"..m]
cm.named_with_CodeNull=1
function cm.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCost(cm.eccost)
e1:SetCondition(cm.eccon)
e1:SetTarget(cm.ectg)
e1:SetOperation(cm.ecop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCost(cm.spcost)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
end
function cm.Code0(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_CodeNull
end
function cm.eccost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsPublic() and c:GetFlagEffect(m)==0 end
c:RegisterFlagEffect(m,RESET_CHAIN,0,1)
end
function cm.eccon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and ((re:GetHandler():IsRace(RACE_CYBERSE) and rp==tp) or Duel.IsPlayerAffectedByEffect(tp,14000608))
end
function cm.spfilter(c,e,tp,code)
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.ectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return re:GetHandler():IsRelateToEffect(re) end
end
function cm.ecop(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,cm.repop)
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SendtoDeck(c,nil,2,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_DECK+LOCATION_EXTRA) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetCode()) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,c:GetCode())
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function cm.cfilter(c,e,tp)
return cm.Code0(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemoveAsCost() and Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,c,e,tp) end
Duel.Remove(c,POS_FACEUP,REASON_COST)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,c,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--编程-零 错误协议
local m=14000605
local cm=_G["c"..m]
cm.named_with_CodeNull=1
function cm.initial_effect(c)
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCost(cm.eccost)
e1:SetCondition(cm.eccon)
e1:SetTarget(cm.ectg)
e1:SetOperation(cm.ecop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCost(cm.rmcost)
e2:SetCondition(cm.rmcon1)
e2:SetTarget(cm.rmtg)
e2:SetOperation(cm.rmop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetCondition(cm.rmcon2)
c:RegisterEffect(e3)
end
function cm.Code0(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_CodeNull
end
function cm.eccost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsPublic() and c:GetFlagEffect(m)==0 end
c:RegisterFlagEffect(m,RESET_CHAIN,0,1)
end
function cm.eccon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and ((re:GetHandler():IsRace(RACE_CYBERSE) and rp==tp) or Duel.IsPlayerAffectedByEffect(tp,14000608))
end
function cm.ectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function cm.ecop(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,cm.repop)
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Draw(tp,1,REASON_EFFECT)
end
function cm.tgfilter(c,e,tp)
return c:IsFaceup() and ((c:IsControler(tp) and c:IsRace(RACE_CYBERSE)) or Duel.IsPlayerAffectedByEffect(tp,14000601)) and Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_DECK,0,1,nil,c:GetCode())
end
function cm.rmfilter(c,code)
return c:IsRace(RACE_CYBERSE) and c:IsAbleToRemove() and not c:IsCode(code)
end
function cm.rmcon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,14000601)
end
function cm.rmcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,14000601)
end
function cm.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemoveAsCost() end
Duel.Remove(c,POS_FACEUP,REASON_COST)
end
function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.tgfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,cm.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.rmfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,tc:GetCode())
if #g>0 then
local tc1=g:GetFirst()
if Duel.Remove(tc1,POS_FACEUP,REASON_EFFECT)~=0 and tc1:IsLocation(LOCATION_REMOVED) and cm.Code0(tc1) and tc1:IsCanBeSpecialSummoned(e,0,tp,false,false) and tc:IsAbleToGrave() and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
if tc:IsAbleToGrave() and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then
Duel.SpecialSummon(tc1,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
\ No newline at end of file
--编程-零 虚拟连接
local m=14000606
local cm=_G["c"..m]
cm.named_with_CodeNull=1
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,cm.lkfilter,2,2)
c:EnableReviveLimit()
--link material
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(14000601)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
end
function cm.lkfilter(c)
return c:IsLevel(1) and c:IsLinkRace(RACE_CYBERSE)
end
function cm.cfilter(c,tc)
return not c:IsPublic() and not c:IsCode(tc:GetLinkCode())
end
function cm.indtg(e,c)
return c:IsRace(RACE_CYBERSE) and c:IsFaceup()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local cg=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_EXTRA,0,1,1,nil,c)
if cg:GetCount()==0 then return end
Duel.ConfirmCards(1-tp,cg)
local code1,code2=cg:GetFirst():GetOriginalCodeRule()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_ADD_LINK_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(cm.indtg)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetValue(code1)
Duel.RegisterEffect(e1,tp)
if code2 then
local e2=e1:Clone()
e2:SetValue(code2)
Duel.RegisterEffect(e2,tp)
end
local e3=e1:Clone()
e3:SetCode(EFFECT_ADD_LINK_ATTRIBUTE)
e3:SetValue(cg:GetFirst():GetOriginalAttribute())
Duel.RegisterEffect(e3,tp)
local e4=e1:Clone()
e4:SetCode(EFFECT_ADD_LINK_RACE)
e4:SetValue(cg:GetFirst():GetOriginalRace())
Duel.RegisterEffect(e4,tp)
end
\ No newline at end of file
--编程-零 数据爆弹
local m=14000607
local cm=_G["c"..m]
cm.named_with_CodeNull=1
function cm.initial_effect(c)
--burn
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCost(cm.eccost)
e1:SetCondition(cm.eccon)
e1:SetTarget(cm.ectg)
e1:SetOperation(cm.ecop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCost(cm.rmcost)
e2:SetCondition(cm.rmcon1)
e2:SetTarget(cm.rmtg)
e2:SetOperation(cm.rmop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetCondition(cm.rmcon2)
c:RegisterEffect(e3)
end
function cm.Code0(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_CodeNull
end
function cm.eccost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsPublic() and c:GetFlagEffect(m)==0 end
c:RegisterFlagEffect(m,RESET_CHAIN,0,1)
end
function cm.eccon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and ((re:GetHandler():IsRace(RACE_CYBERSE) and rp==tp) or Duel.IsPlayerAffectedByEffect(tp,14000608))
end
function cm.spfilter(c,e,tp,code)
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.ectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function cm.ecop(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,cm.repop)
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(tp,800,REASON_EFFECT,true)
Duel.Damage(1-tp,800,REASON_EFFECT,true)
Duel.RDComplete()
end
function cm.tgfilter(c,e,tp)
return c:IsFaceup() and ((c:IsControler(tp) and c:IsRace(RACE_CYBERSE)) or Duel.IsPlayerAffectedByEffect(tp,14000601))
end
function cm.rmfilter(c,code)
return c:IsRace(RACE_CYBERSE) and not c:IsCode(code)
end
function cm.rmcon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,14000601)
end
function cm.rmcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,14000601)
end
function cm.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemoveAsCost() end
Duel.Remove(c,POS_FACEUP,REASON_COST)
end
function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.tgfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,cm.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp)
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local c,tc=e:GetHandler(),Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE)
e1:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e1:SetTarget(cm.distg)
e1:SetLabel(tc:GetOriginalCode())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetCondition(cm.discon)
e2:SetOperation(cm.disop)
e2:SetLabel(tc:GetOriginalCode())
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
local e3=e1:Clone()
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetValue(1)
Duel.RegisterEffect(e3,tp)
end
function cm.distg(e,c)
local code=e:GetLabel()
local code1,code2=c:GetOriginalCodeRule()
return code1==code or code2==code
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
local code=e:GetLabel()
local code1,code2=re:GetHandler():GetOriginalCodeRule()
return code1==code or code2==code
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
\ No newline at end of file
--编程-零 服务终端
local m=14000608
local cm=_G["c"..m]
cm.named_with_CodeNull=1
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,cm.lkfilter,2)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.spcon1)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCondition(cm.spcon2)
c:RegisterEffect(e2)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(m)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
end
function cm.lkfilter(c)
return c:IsLinkType(TYPE_LINK) and c:IsLinkRace(RACE_CYBERSE)
end
function cm.spcon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,14000601)
end
function cm.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,14000601)
end
function cm.rmfilter(c,tp)
return c:IsAbleToRemove() and ((c:IsControler(tp) and c:IsRace(RACE_CYBERSE) and c:IsFaceup()) or Duel.IsPlayerAffectedByEffect(tp,14000601))
end
function cm.spfilter(c,e,tp)
return c:IsFaceup() and c:IsRace(RACE_CYBERSE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.rmfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,cm.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_REMOVED)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
if #g>0 then
if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)==0 then return end
end
if not tc or not tc:IsRelateToEffect(e) then return end
if tc:GetAttack()<g:GetFirst():GetAttack() then
Duel.BreakEffect()
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
\ No newline at end of file
--编码-零 漏洞注入
local m=14000609
local cm=_G["c"..m]
cm.named_with_CodeNull=1
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.con)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--SpecialSummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
end
function cm.Code0(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_CodeNull
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)==0
end
function cm.filter(c)
return cm.Code0(c) and c:IsType(TYPE_MONSTER)
end
function cm.fselect(g,e,tp)
return aux.dncheck(g) and g:IsExists(cm.fcheck,1,nil,g,e,tp)
end
function cm.fcheck(c,g,e,tp)
return c:IsLocation(LOCATION_HAND+LOCATION_DECK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,1-tp)
and g:IsExists(cm.fcheck2,1,c)
end
function cm.fcheck2(c)
return c:IsLocation(LOCATION_DECK) and c:IsAbleToHand()
end
function cm.cfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,1-tp)
and (c:IsLocation(LOCATION_HAND) or not c:IsAbleToHand())
end
function cm.cfilter2(c,e,tp)
return not c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,1-tp)
and c:IsLocation(LOCATION_DECK) and c:IsAbleToHand()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_HAND+LOCATION_DECK,0,nil)
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0
and g:CheckSubGroup(cm.fselect,2,2,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0 then
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_HAND+LOCATION_DECK,0,nil)
local sc=nil
local hc=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local sg=g:SelectSubGroup(tp,cm.fselect,false,2,2,e,tp)
if sg and sg:GetCount()==2 then
if sg:IsExists(cm.cfilter,1,nil,e,tp) then
sc=sg:Filter(cm.cfilter,nil,e,tp):GetFirst()
hc=sg:GetFirst()
if hc==sc then hc=sg:GetNext() end
elseif sg:IsExists(cm.cfilter2,1,nil,e,tp) then
hc=sg:Filter(cm.cfilter2,nil,e,tp):GetFirst()
sc=sg:GetFirst()
if sc==hc then sc=sg:GetNext() end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sc=sg:FilterSelect(tp,cm.fcheck,1,1,nil,sg,e,tp):GetFirst()
hc=sg:GetFirst()
if hc==sc then hc=sg:GetNext() end
end
if sc and Duel.SpecialSummon(sc,0,tp,1-tp,false,false,POS_FACEUP_DEFENSE)~=0 and hc then
Duel.SendtoHand(hc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,hc)
end
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(cm.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not re:GetHandler():IsRace(RACE_CYBERSE)
end
function cm.spfilter(c,e,tp)
return c:IsRace(RACE_CYBERSE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,1-tp)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,1-tp,false,false,POS_FACEUP_DEFENSE)
end
end
\ No newline at end of file
--编码-零 自我复制
local m=14000610
local cm=_G["c"..m]
cm.named_with_CodeNull=1
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e1_1=e1:Clone()
e1_1:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e1_1)
--SearchCard
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
end
function cm.Code0(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_CodeNull
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return eg:GetCount()==1 and tc:IsLocation(LOCATION_MZONE) and tc:IsControler(tp) and tc:IsFaceup() and cm.Code0(tc)
end
function cm.nfilter(c,tc)
return c:IsCode(tc:GetCode())
end
function cm.spfilter1(c,tc,e,tp)
return cm.nfilter(c,tc) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=eg:GetFirst()
if chk==0 then
local g=Duel.GetMatchingGroup(cm.spfilter1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,tc,e,tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and g:GetCount()>0
end
tc:CreateEffectRelation(e)
local g=Duel.GetMatchingGroup(cm.spfilter1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,tc,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),PLAYER_ALL,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end
function cm.sp(g,tp,pos)
local sc=g:GetFirst()
while sc do
Duel.SpecialSummonStep(sc,0,tp,tp,false,false,pos)
sc=g:GetNext()
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft1>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then ft1=1 end
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.spfilter1),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,tc,e,tp)
if ft1>0 and tc:IsFaceup() and tc:IsRelateToEffect(e) then
if g:GetCount()<=ft1 then
cm.sp(g,tp,POS_FACEUP_ATTACK)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local fg=g:Select(tp,ft1,ft1,nil)
cm.sp(fg,tp,POS_FACEUP_ATTACK)
end
Duel.SpecialSummonComplete()
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.splimit(e,c)
return not c:IsType(TYPE_LINK) and c:IsLocation(LOCATION_EXTRA)
end
function cm.thfilter(c)
return c:IsCode(m) 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) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,nil)
if tc then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
\ No newline at end of file
--编码-零 特征伪装
local m=14000611
local cm=_G["c"..m]
cm.named_with_CodeNull=1
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_GRAVE)
e2:SetTarget(cm.reptg)
e2:SetValue(cm.repval)
e2:SetOperation(cm.repop)
c:RegisterEffect(e2)
end
function cm.Code0(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_CodeNull
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)==0
end
function cm.filter(c)
return cm.Code0(c) and c:IsType(TYPE_LINK) and c:IsType(TYPE_MONSTER)
end
function cm.cpfilter(c)
return c:IsType(TYPE_LINK) and c:IsType(TYPE_MONSTER)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,0,1,nil,tp) and Duel.IsExistingMatchingCard(cm.cpfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,0,1,1,nil,tp)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
local g=Duel.GetFieldGroup(tp,LOCATION_EXTRA,0)
if g:GetCount()>0 and tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
local tg=g:RandomSelect(1-tp,1)
Duel.ConfirmCards(1-tp,tg)
if tg:IsExists(cm.cpfilter,1,nil) then
local tc1=tg:GetFirst()
local code=tc1:GetOriginalCodeRule()
local cid=0
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(code)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
if not tc:IsType(TYPE_TRAPMONSTER) then
cid=tc:CopyEffect(code,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,1)
end
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetRange(LOCATION_MZONE)
e2:SetLabelObject(e1)
e2:SetLabel(cid)
e2:SetOperation(cm.rstop)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
end
function cm.rstop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local cid=e:GetLabel()
if cid~=0 then
c:ResetEffect(cid,RESET_COPY)
c:ResetEffect(RESET_DISABLE,RESET_EVENT)
end
local e1=e:GetLabelObject()
e1:Reset()
Duel.HintSelection(Group.FromCards(c))
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function cm.repfilter(c,tp)
return c:IsFaceup() and c:IsType(TYPE_LINK) and c:IsType(TYPE_MONSTER)
and c:IsOnField() and c:IsControler(tp) and c:IsReason(REASON_EFFECT+REASON_BATTLE) and not c:IsReason(REASON_REPLACE)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(cm.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
\ No newline at end of file
--编码-零 封包截取
local m=14000612
local cm=_G["c"..m]
cm.named_with_CodeNull=1
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--SearchCard
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(cm.thcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
end
function cm.Code0(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_CodeNull
end
function cm.cfilter(c)
return cm.Code0(c) and c:IsFaceup()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return ep==1-tp and Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil) and re:IsActiveType(TYPE_MONSTER)
end
function cm.tgfilter(c)
return c:IsRace(RACE_CYBERSE) and c:IsAbleToGrave()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,rp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,cm.repop)
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if sg:GetCount()>0 then
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end
function cm.rmfilter(c)
return cm.Code0(c) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.rmfilter,tp,LOCATION_GRAVE,0,1,1,nil)
g:AddCard(e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function cm.thfilter(c)
return cm.Code0(c) and not c:IsCode(m) 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) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--编码-零 关键节点
local m=14000613
local cm=_G["c"..m]
cm.named_with_CodeNull=1
function cm.initial_effect(c)
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCost(cm.eccost)
e1:SetCondition(cm.eccon)
e1:SetTarget(cm.ectg)
e1:SetOperation(cm.ecop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCost(cm.tgcost)
e2:SetCondition(cm.tgcon1)
e2:SetTarget(cm.tgtg)
e2:SetOperation(cm.tgop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetCondition(cm.tgcon2)
c:RegisterEffect(e3)
end
function cm.Code0(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_CodeNull
end
function cm.eccost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsPublic() and c:GetFlagEffect(m)==0 end
c:RegisterFlagEffect(m,RESET_CHAIN,0,1)
end
function cm.eccon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and ((re:GetHandler():IsRace(RACE_CYBERSE) and rp==tp) or Duel.IsPlayerAffectedByEffect(tp,14000608))
end
function cm.ectg(e,tp,eg,ep,ev,re,r,rp,chk)
local p=tp
if rp then
p=rp
end
if chk==0 then return Duel.IsPlayerCanSummon(p) and Duel.IsPlayerCanAdditionalSummon(p) and Duel.GetFlagEffect(p,m)==0 end
end
function cm.ecop(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,cm.repop)
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,m)~=0 then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(m,2))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e1:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_CYBERSE))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.tgfilter(c,e,tp)
return c:IsFaceup() and ((c:IsControler(tp) and c:IsRace(RACE_CYBERSE)) or Duel.IsPlayerAffectedByEffect(tp,14000601)) and Duel.IsExistingMatchingCard(cm.tgfilter1,tp,LOCATION_DECK,0,1,nil,c:GetCode())
end
function cm.tgfilter1(c,code)
return c:IsRace(RACE_CYBERSE) and c:IsAbleToGrave() and not c:IsCode(code)
end
function cm.tgcon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,14000601)
end
function cm.tgcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,14000601)
end
function cm.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemoveAsCost() end
Duel.Remove(c,POS_FACEUP,REASON_COST)
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.tgfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,cm.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,2,tp,LOCATION_DECK+LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter1,tp,LOCATION_DECK,0,1,1,nil,e,tp,tc:GetCode())
if #g>0 then
local tc1=g:GetFirst()
if Duel.SendtoGrave(tc1,REASON_EFFECT)~=0 and tc1:IsLocation(LOCATION_GRAVE) and tc1:IsCanBeSpecialSummoned(e,0,tp,false,false) and tc:IsAbleToGrave() and aux.NecroValleyFilter()(tc1) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
if Duel.SpecialSummon(tc1,0,tp,tp,false,false,POS_FACEUP)~=0 and tc:IsAbleToGrave() then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
end
end
\ No newline at end of file
--编码-零 僵尸电脑
local m=14000614
local cm=_G["c"..m]
cm.named_with_CodeNull=1
function cm.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,cm.matfilter,1,1)
--extra material
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e1:SetRange(LOCATION_EXTRA)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(cm.matval)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.eccon)
e2:SetTarget(cm.ectg)
e2:SetOperation(cm.ecop)
c:RegisterEffect(e2)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_LINK))
e3:SetValue(cm.val)
c:RegisterEffect(e3)
end
function cm.Code0(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_CodeNull
end
function cm.matval(e,lc,mg,c,tp)
if e:GetHandler()~=lc then return false,nil end
return true,not mg or not mg:IsExists(Card.IsControler,1,nil,1-tp)
end
cm.loaded_metatable_list=cm.loaded_metatable_list or {}
function cm.load_metatable(code)
local m1=_G["c"..code]
if m1 then return m1 end
local m2=cm.loaded_metatable_list[code]
if m2 then return m2 end
_G["c"..code]={}
if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then
local mt=_G["c"..code]
_G["c"..code]=nil
if mt then
cm.loaded_metatable_list[code]=mt
return mt
end
else
_G["c"..code]=nil
end
end
function cm.check_link_set_Code0(c)
if c:IsLinkCode(m) then return end
local codet={c:GetLinkCode()}
for j,code in pairs(codet) do
local mt=cm.load_metatable(code)
if mt then
for str,v in pairs(mt) do
if type(str)=="string" and str:find("_CodeNull") and v then return true end
end
end
end
return false
end
function cm.matfilter(c)
return cm.check_link_set_Code0(c)
end
function cm.eccon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and ((re:GetHandler():IsRace(RACE_CYBERSE) and rp==tp) or Duel.IsPlayerAffectedByEffect(tp,14000608))
end
function cm.thfilter(c)
return cm.Code0(c) and c:IsAbleToHand()
end
function cm.ectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function cm.ecop(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,cm.repop)
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
function cm.atktg(e,c)
return cm.Code0(c) and c:IsType(TYPE_LINK)
end
function cm.atkfilter(c)
return cm.Code0(c) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
end
function cm.val(e,c)
if cm.Code0(c) then
return Duel.GetMatchingGroupCount(cm.atkfilter,c:GetControler(),LOCATION_GRAVE+LOCATION_REMOVED,0,nil)*200
end
return Duel.GetMatchingGroupCount(cm.atkfilter,c:GetControler(),LOCATION_GRAVE+LOCATION_REMOVED,0,nil)*100
end
\ No newline at end of file
--编码-零 替身网域
local m=14000615
local cm=_G["c"..m]
cm.named_with_CodeNull=1
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,cm.lkfilter,2)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.eccon)
e1:SetTarget(cm.ectg)
e1:SetOperation(cm.ecop)
c:RegisterEffect(e1)
--copy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.cpcon)
e2:SetTarget(cm.cptg)
e2:SetOperation(cm.cpop)
c:RegisterEffect(e2)
end
function cm.lkfilter(c)
return c:IsLinkType(TYPE_LINK) and c:IsLinkRace(RACE_CYBERSE)
end
function cm.eccon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and ((re:GetHandler():IsRace(RACE_CYBERSE) and rp==tp) or Duel.IsPlayerAffectedByEffect(tp,14000608))
end
function cm.spfilter(c,e,tp)
local sp=c:GetOwner()
return c:IsType(TYPE_LINK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,sp) and Duel.GetLocationCount(sp,LOCATION_MZONE)>0
end
function cm.ectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end
end
function cm.ecop(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,cm.repop)
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tc:GetOwner(),false,false,POS_FACEUP)
end
end
end
function cm.cpcon(e,tp,eg,ep,ev,re,r,rp)
return eg --and not Duel.IsPlayerAffectedByEffect(tp,14000601)
end
function cm.tgfilter(c,e,tp)
return (c:IsFaceup() and c:IsControler(tp) and c:IsRace(RACE_CYBERSE)) or Duel.IsPlayerAffectedByEffect(tp,14000601)
end
function cm.cptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.tgfilter(chkc,e,tp) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(cm.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,cm.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c,e,tp)
end
function cm.cpop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsFaceup() then
local code=tc:GetOriginalCodeRule()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(code)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
c:CopyEffect(code,RESET_EVENT+RESETS_STANDARD,1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
\ No newline at end of file
--编码-零 数据溢出
local m=14000616
local cm=_G["c"..m]
cm.named_with_CodeNull=1
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.tgtg)
e2:SetOperation(cm.tgop)
c:RegisterEffect(e2)
end
function cm.Code0(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_CodeNull
end
function cm.thfilter(c)
return cm.Code0(c) and c:IsAbleToHand() and (c:IsLocation(LOCATION_DECK+LOCATION_GRAVE) or c:IsFaceup())
end
function cm.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local rg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_DECK+LOCATION_EXTRA+LOCATION_GRAVE,nil)
if chk==0 then
if #g<=0 then return end
local ct=g:GetSum(Card.GetLink)
local rt=ct-2
if ct>2 then
return #rg>=rt and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil)
elseif ct>0 then
return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil)
end
return false
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if #g>0 and g:GetSum(Card.GetLink)>0 then
local ct=g:GetSum(Card.GetLink)
local rt=ct-2
if ct>2 then ct=2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,ct,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
local rg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_DECK+LOCATION_EXTRA+LOCATION_GRAVE,nil)
if rt>0 and #rg>=rt then
Duel.BreakEffect()
local sg=rg:RandomSelect(tp,rt)
if #sg>0 then
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
end
end
end
end
function cm.tgfilter(c)
return cm.Code0(c) and not c:IsCode(m) and c:IsAbleToGrave()
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
\ No newline at end of file
--编码-零 指针指空
local m=14000617
local cm=_G["c"..m]
cm.named_with_CodeNull=1
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--togy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(cm.tgcost)
e2:SetTarget(cm.tgtg)
e2:SetOperation(cm.tgop)
c:RegisterEffect(e2)
end
function cm.Code0(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_CodeNull
end
function cm.cfilter(c)
return cm.Code0(c) and c:IsFaceup()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return ep==1-tp and Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil) and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and (re:GetHandler():IsAbleToGrave() or re:GetHandler():IsLocation(LOCATION_GRAVE))
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,cm.repop)
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoGrave(c,REASON_EFFECT)
end
end
function cm.rmfilter(c)
return cm.Code0(c) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function cm.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.rmfilter,tp,LOCATION_GRAVE,0,1,1,nil)
g:AddCard(e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function cm.tgfilter(c)
return not c:IsCanBeEffectTarget() and c:IsAbleToGrave()
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local tg=Duel.GetMatchingGroup(cm.tgfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if chk==0 then return #tg>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,tg,#tg,tp,LOCATION_ONFIELD)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetMatchingGroup(cm.tgfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if #tg>0 then
Duel.SendtoGrave(tg,REASON_RULE)
end
end
\ No newline at end of file
--深层编码-零
local m=14000618
local cm=_G["c"..m]
cm.named_with_CodeNull=1
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_FZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1)
e2:SetTarget(cm.tdtg)
e2:SetOperation(cm.tdop)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_FZONE)
e3:SetCondition(cm.thcon)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
if cm.counter==nil then
cm.counter=true
cm[0]={}
cm[1]={}
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_PHASE_START+PHASE_DRAW)
e4:SetOperation(cm.resetcount)
Duel.RegisterEffect(e4,0)
end
end
function cm.Code0(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_CodeNull
end
function cm.resetcount(e,tp,eg,ep,ev,re,r,rp)
cm[0]={}
cm[1]={}
end
function cm.tdfilter(c)
return c:IsFaceup() and cm.Code0(c) and c:IsAbleToDeck()
end
function cm.snfilter(c,code)
return c:IsCode(code) and c:IsAbleToHand()
end
function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and cm.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.tdfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.tdfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_DECK+LOCATION_EXTRA) and Duel.IsExistingMatchingCard(cm.snfilter,tp,LOCATION_DECK,0,1,nil,tc:GetCode()) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.snfilter,tp,LOCATION_DECK,0,1,1,nil,tc:GetCode())
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
end
function cm.cfilter(c,tp)
return c:IsFaceup() and cm.Code0(c) and c:IsType(TYPE_LINK) and c:IsControler(tp)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,tp)
end
function cm.tgfilter(c,tp,eg)
return eg:IsContains(c) and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil,c:GetAttribute())
end
function cm.thfilter(c)
return cm.Code0(c) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if not eg then return false end
local tg=eg:Filter(cm.cfilter,nil)
local tb1=cm[tp]
if chk==0 then
local tc=tg:GetFirst()
local ct=tc:GetLink()
while tc do
for i,v in pairs(tb1) do
if ct==v then
return false
end
end
tc=tg:GetNext()
end
return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil)
end
local tc=tg:GetFirst()
local ct=tc:GetLink()
while tc do
local lkctchk=false
for i,v in pairs(tb1) do
if ct==v then
lkctchk=true
end
end
if lkctchk==false then
table.insert(tb1,ct)
end
tc=tg:GetNext()
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--编码-零 身份篡改
local m=14000619
local cm=_G["c"..m]
cm.named_with_CodeNull=1
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--ReturnToHand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(cm.thcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
end
function cm.Code0(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_CodeNull
end
function cm.tgfilter(c,tp)
return c:IsFaceup() and Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_DECK,0,1,nil,c)
end
function cm.cfilter(c,tc)
return cm.Code0(c) and not c:IsCode(tc:GetCode()) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.tgfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,cm.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_DECK,0,1,1,nil,tc)
if g:GetCount()>0 then
local gc=g:GetFirst()
if Duel.SendtoGrave(gc,REASON_EFFECT)~=0 and gc:IsLocation(LOCATION_GRAVE) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(gc:GetCode())
tc:RegisterEffect(e1)
end
end
end
function cm.rmfilter(c)
return cm.Code0(c) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.rmfilter,tp,LOCATION_GRAVE,0,1,1,nil)
g:AddCard(e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function cm.thfilter(c)
return cm.Code0(c) and not c:IsCode(m) and c:IsFaceup() 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_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_REMOVED)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_REMOVED,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--编码-零 信息异常
local m=14000620
local cm=_G["c"..m]
cm.named_with_CodeNull=1
function cm.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(cm.etarget)
e2:SetValue(cm.efilter)
c:RegisterEffect(e2)
--cannot disable
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetCost(aux.bfgcost)
e3:SetTarget(cm.tgtg)
e3:SetOperation(cm.tgop)
c:RegisterEffect(e3)
local e_h=Effect.CreateEffect(c)
e_h:SetType(EFFECT_TYPE_SINGLE)
e_h:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e_h:SetCondition(cm.checkcon)
c:RegisterEffect(e_h)
end
function cm.Code0(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_CodeNull
end
function cm.hafilter(c)
return cm.Code0(c) and c:IsType(TYPE_LINK) and c:IsFaceup()
end
function cm.checkcon(e)
local res,teg,tep,tev,tre,tr,trp=Duel.CheckEvent(EVENT_CHAINING,true)
if res then
return trp~=e:GetHandlerPlayer() and Duel.IsExistingMatchingCard(cm.hafilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
end
function cm.etarget(e,c)
return c:IsType(TYPE_LINK) and c:IsType(TYPE_MONSTER) and c:IsFaceup()
end
function cm.efcfilter(c)
return c:IsType(TYPE_LINK) and c:IsType(TYPE_MONSTER) and c:IsFaceup()
end
function cm.efilter(e,te)
if te:GetOwnerPlayer()==e:GetHandlerPlayer() or not te:IsActivated() then return false end
if not te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return true end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
return not g or not g:IsExists(cm.efcfilter,1,nil)
end
function cm.effectfilter(e,ct)
local te=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT)
local tc=te:GetHandler()
return cm.Code0(tc)
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,m)==0 end
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_DISEFFECT)
e1:SetValue(cm.effectfilter)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
\ No newline at end of file
--诞影之国的辉煌之影
local m=14001511
local cm=_G["c"..m]
cm.named_with_EoS=1
function cm.initial_effect(c)
--set
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_MONSTER_SSET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
--replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_HAND)
e2:SetTarget(cm.reptg)
e2:SetValue(cm.repval)
e2:SetOperation(cm.repop)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_CUSTOM+m)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(0xff)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.setcon)
e3:SetTarget(cm.settg)
e3:SetOperation(cm.setop)
c:RegisterEffect(e3)
cm.changef_effect=e3
if not eos_pos_check then
eos_pos_check=true
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_SSET)
e4:SetOperation(cm.ssetcon)
Duel.RegisterEffect(e4,tp)
local e5=e4:Clone()
e5:SetCode(EVENT_MSET)
Duel.RegisterEffect(e5,tp)
local e6=e4:Clone()
e6:SetCode(EVENT_CHANGE_POS)
Duel.RegisterEffect(e6,tp)
local e7=e4:Clone()
e7:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(e7,tp)
end
--tohand
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(m,1))
e8:SetCategory(CATEGORY_TOHAND+CATEGORY_DESTROY)
e8:SetType(EFFECT_TYPE_QUICK_O)
e8:SetRange(LOCATION_GRAVE)
e8:SetCode(EVENT_FREE_CHAIN)
e8:SetCountLimit(1,m)
e8:SetCost(cm.thcost)
e8:SetTarget(cm.thtg)
e8:SetOperation(cm.thop)
c:RegisterEffect(e8)
end
function cm.EoS(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_EoS
end
function cm.repfilter(c,tp)
return not c:IsReason(REASON_REPLACE)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return (c:IsSSetable() or (c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0)) and eg:IsExists(cm.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,1-tp,m)
local c=e:GetHandler()
if c then
if c:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.SelectOption(tp,aux.Stringid(14001521,4),aux.Stringid(14001521,5))==0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,c)
elseif Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and c:IsSSetable() then
Duel.SSet(tp,c)
end
end
end
function cm.ssetfilter(c)
return cm.EoS(c) and c:GetOriginalType()&TYPE_MONSTER~=0
end
function cm.ssetcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetControler()
if eg and #eg:Filter(cm.ssetfilter,nil)>0 then
local eg1=eg:Filter(cm.ssetfilter,nil)
local tc=eg1:GetFirst()
while tc do
local code=tc:GetOriginalCodeRule()
local ccode=_G["c"..code]
if eg:IsContains(tc) and ccode.settg(e,tp,eg,ep,ev,re,r,rp,0) and Duel.GetFlagEffect(tp,code)==0 then
if Duel.GetCurrentChain()==0 then
if tc:IsFacedown() and Duel.SelectEffectYesNo(tp,tc) then
Duel.ChangePosition(tc,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE)
Duel.RaiseEvent(tc,EVENT_CUSTOM+code,e,0,0,0,0)
Duel.RegisterFlagEffect(tp,code,RESET_PHASE+PHASE_END,0,1)
end
else
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetReset(RESET_EVENT+EVENT_CHAIN_END+RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabelObject(tc)
e1:SetOperation(cm.retop)
Duel.RegisterEffect(e1,tp)
end
end
tc=eg1:GetNext()
end
end
--[[if eg:IsContains(c) and cm.settg(e,tp,eg,ep,ev,re,r,rp,0) and Duel.GetFlagEffect(tp,m)==0 then
if Duel.GetCurrentChain()==0 then
if c:IsFacedown() and Duel.SelectEffectYesNo(tp,c) then
Duel.ChangePosition(c,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,e,0,0,0,0)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
else
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetReset(RESET_EVENT+EVENT_CHAIN_END+RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetOperation(cm.retop)
Duel.RegisterEffect(e1,tp)
end
end]]
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
--local c=e:GetHandler()
local c=e:GetLabelObject()
local code=c:GetOriginalCodeRule()
if c and c:IsFacedown() and Duel.SelectEffectYesNo(tp,c) then
Duel.ChangePosition(c,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE)
Duel.RaiseEvent(c,EVENT_CUSTOM+code,e,0,0,0,0)
Duel.RegisterFlagEffect(tp,code,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return eg:IsContains(c)
end
function cm.filter(c,e,tp)
return cm.EoS(c) and (c:IsSSetable() or (c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0))
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
local tc=g:GetFirst()
if tc:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.SelectOption(tp,aux.Stringid(14001521,4),aux.Stringid(14001521,5))==0 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,tc)
elseif tc:IsSSetable() then
Duel.SSet(tp,tc)
end
end
end
function cm.tcfilter(c)
return c:IsFaceup() and c:IsCanTurnSet() and not c:IsLocation(LOCATION_PZONE)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tcfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.tcfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
if #g>0 then
local tc=g:GetFirst()
tc:CancelToGrave()
if tc:IsType(TYPE_MONSTER) then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
else
Duel.ChangePosition(tc,POS_FACEDOWN)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsAbleToHand() and c:IsRelateToEffect(e) then
if Duel.SendtoHand(c,tp,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_HAND) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,nil)
if #g>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
end
end
\ No newline at end of file
--诞影之国的虚伪之影
local m=14001512
local cm=_G["c"..m]
cm.named_with_EoS=1
function cm.initial_effect(c)
--set
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_MONSTER_SSET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
--replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_HAND)
e2:SetTarget(cm.reptg)
e2:SetValue(cm.repval)
e2:SetOperation(cm.repop)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_CUSTOM+m)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(0xff)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.setcon)
e3:SetTarget(cm.settg)
e3:SetOperation(cm.setop)
c:RegisterEffect(e3)
cm.changef_effect=e3
if not eos_pos_check then
eos_pos_check=true
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_SSET)
e4:SetOperation(cm.ssetcon)
Duel.RegisterEffect(e4,tp)
local e5=e4:Clone()
e5:SetCode(EVENT_MSET)
Duel.RegisterEffect(e5,tp)
local e6=e4:Clone()
e6:SetCode(EVENT_CHANGE_POS)
Duel.RegisterEffect(e6,tp)
local e7=e4:Clone()
e7:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(e7,tp)
end
--tohand
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(m,1))
e8:SetCategory(CATEGORY_TOHAND+CATEGORY_DESTROY)
e8:SetType(EFFECT_TYPE_QUICK_O)
e8:SetRange(LOCATION_GRAVE)
e8:SetCode(EVENT_FREE_CHAIN)
e8:SetCountLimit(1,m)
e8:SetCost(cm.thcost)
e8:SetTarget(cm.thtg)
e8:SetOperation(cm.thop)
c:RegisterEffect(e8)
end
function cm.EoS(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_EoS
end
function cm.repfilter(c,tp)
return not c:IsReason(REASON_REPLACE)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return (c:IsSSetable() or (c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0)) and eg:IsExists(cm.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,1-tp,m)
local c=e:GetHandler()
if c then
if c:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.SelectOption(tp,aux.Stringid(14001521,4),aux.Stringid(14001521,5))==0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,c)
elseif Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and c:IsSSetable() then
Duel.SSet(tp,c)
end
end
end
function cm.ssetfilter(c)
return cm.EoS(c) and c:GetOriginalType()&TYPE_MONSTER~=0
end
function cm.ssetcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetControler()
if eg and #eg:Filter(cm.ssetfilter,nil)>0 then
local eg1=eg:Filter(cm.ssetfilter,nil)
local tc=eg1:GetFirst()
while tc do
local code=tc:GetOriginalCodeRule()
local ccode=_G["c"..code]
if eg:IsContains(tc) and ccode.settg(e,tp,eg,ep,ev,re,r,rp,0) and Duel.GetFlagEffect(tp,code)==0 then
if Duel.GetCurrentChain()==0 then
if tc:IsFacedown() and Duel.SelectEffectYesNo(tp,tc) then
Duel.ChangePosition(tc,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE)
Duel.RaiseEvent(tc,EVENT_CUSTOM+code,e,0,0,0,0)
Duel.RegisterFlagEffect(tp,code,RESET_PHASE+PHASE_END,0,1)
end
else
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetReset(RESET_EVENT+EVENT_CHAIN_END+RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabelObject(tc)
e1:SetOperation(cm.retop)
Duel.RegisterEffect(e1,tp)
end
end
tc=eg1:GetNext()
end
end
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject()
local code=c:GetOriginalCodeRule()
if c and c:IsFacedown() and Duel.SelectEffectYesNo(tp,c) then
Duel.ChangePosition(c,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE)
Duel.RaiseEvent(c,EVENT_CUSTOM+code,e,0,0,0,0)
Duel.RegisterFlagEffect(tp,code,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return eg:IsContains(c)
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,nil,1,0,0)
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
local tc=g:GetFirst()
if tc and not tc:IsImmuneToEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=e1:Clone()
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
tc:RegisterEffect(e3)
end
end
end
function cm.tcfilter(c)
return c:IsFaceup() and c:IsCanTurnSet() and not c:IsLocation(LOCATION_PZONE)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tcfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.tcfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
if #g>0 then
local tc=g:GetFirst()
tc:CancelToGrave()
if tc:IsType(TYPE_MONSTER) then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
else
Duel.ChangePosition(tc,POS_FACEDOWN)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsAbleToHand() and c:IsRelateToEffect(e) then
if Duel.SendtoHand(c,tp,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_HAND) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,nil)
if #g>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
end
end
\ No newline at end of file
--诞影之国的祝福之影
local m=14001513
local cm=_G["c"..m]
cm.named_with_EoS=1
function cm.initial_effect(c)
--set
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_MONSTER_SSET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
--replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_HAND)
e2:SetTarget(cm.reptg)
e2:SetValue(cm.repval)
e2:SetOperation(cm.repop)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_DRAW+CATEGORY_HANDES)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_CUSTOM+m)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(0xff)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.setcon)
e3:SetTarget(cm.settg)
e3:SetOperation(cm.setop)
c:RegisterEffect(e3)
cm.changef_effect=e3
if not eos_pos_check then
eos_pos_check=true
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_SSET)
e4:SetOperation(cm.ssetcon)
Duel.RegisterEffect(e4,tp)
local e5=e4:Clone()
e5:SetCode(EVENT_MSET)
Duel.RegisterEffect(e5,tp)
local e6=e4:Clone()
e6:SetCode(EVENT_CHANGE_POS)
Duel.RegisterEffect(e6,tp)
local e7=e4:Clone()
e7:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(e7,tp)
end
--tohand
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(m,1))
e8:SetCategory(CATEGORY_TOHAND+CATEGORY_DESTROY)
e8:SetType(EFFECT_TYPE_QUICK_O)
e8:SetRange(LOCATION_GRAVE)
e8:SetCode(EVENT_FREE_CHAIN)
e8:SetCountLimit(1,m)
e8:SetCost(cm.thcost)
e8:SetTarget(cm.thtg)
e8:SetOperation(cm.thop)
c:RegisterEffect(e8)
end
function cm.EoS(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_EoS
end
function cm.repfilter(c,tp)
return not c:IsReason(REASON_REPLACE)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return (c:IsSSetable() or (c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0)) and eg:IsExists(cm.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,1-tp,m)
local c=e:GetHandler()
if c then
if c:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.SelectOption(tp,aux.Stringid(14001521,4),aux.Stringid(14001521,5))==0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,c)
elseif Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and c:IsSSetable() then
Duel.SSet(tp,c)
end
end
end
function cm.ssetfilter(c)
return cm.EoS(c) and c:GetOriginalType()&TYPE_MONSTER~=0
end
function cm.ssetcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetControler()
if eg and #eg:Filter(cm.ssetfilter,nil)>0 then
local eg1=eg:Filter(cm.ssetfilter,nil)
local tc=eg1:GetFirst()
while tc do
local code=tc:GetOriginalCodeRule()
local ccode=_G["c"..code]
if eg:IsContains(tc) and ccode.settg(e,tp,eg,ep,ev,re,r,rp,0) and Duel.GetFlagEffect(tp,code)==0 then
if Duel.GetCurrentChain()==0 then
if tc:IsFacedown() and Duel.SelectEffectYesNo(tp,tc) then
Duel.ChangePosition(tc,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE)
Duel.RaiseEvent(tc,EVENT_CUSTOM+code,e,0,0,0,0)
Duel.RegisterFlagEffect(tp,code,RESET_PHASE+PHASE_END,0,1)
end
else
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetReset(RESET_EVENT+EVENT_CHAIN_END+RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabelObject(tc)
e1:SetOperation(cm.retop)
Duel.RegisterEffect(e1,tp)
end
end
tc=eg1:GetNext()
end
end
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject()
local code=c:GetOriginalCodeRule()
if c and c:IsFacedown() and Duel.SelectEffectYesNo(tp,c) then
Duel.ChangePosition(c,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE)
Duel.RaiseEvent(c,EVENT_CUSTOM+code,e,0,0,0,0)
Duel.RegisterFlagEffect(tp,code,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return eg:IsContains(c)
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local ct=Duel.DiscardHand(tp,nil,1,2,REASON_EFFECT+REASON_DISCARD)
if ct>0 and Duel.IsPlayerCanDraw(tp,ct) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
Duel.Draw(tp,ct,REASON_EFFECT)
end
end
function cm.tcfilter(c)
return c:IsFaceup() and c:IsCanTurnSet() and not c:IsLocation(LOCATION_PZONE)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tcfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.tcfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
if #g>0 then
local tc=g:GetFirst()
tc:CancelToGrave()
if tc:IsType(TYPE_MONSTER) then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
else
Duel.ChangePosition(tc,POS_FACEDOWN)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsAbleToHand() and c:IsRelateToEffect(e) then
if Duel.SendtoHand(c,tp,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_HAND) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,nil)
if #g>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
end
end
\ No newline at end of file
--诞影之国的回归之影
local m=14001514
local cm=_G["c"..m]
cm.named_with_EoS=1
function cm.initial_effect(c)
--set
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_MONSTER_SSET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
--replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_HAND)
e2:SetTarget(cm.reptg)
e2:SetValue(cm.repval)
e2:SetOperation(cm.repop)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_CUSTOM+m)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(0xff)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.setcon)
e3:SetTarget(cm.settg)
e3:SetOperation(cm.setop)
c:RegisterEffect(e3)
cm.changef_effect=e3
if not eos_pos_check then
eos_pos_check=true
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_SSET)
e4:SetOperation(cm.ssetcon)
Duel.RegisterEffect(e4,tp)
local e5=e4:Clone()
e5:SetCode(EVENT_MSET)
Duel.RegisterEffect(e5,tp)
local e6=e4:Clone()
e6:SetCode(EVENT_CHANGE_POS)
Duel.RegisterEffect(e6,tp)
local e7=e4:Clone()
e7:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(e7,tp)
end
--tohand
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(m,1))
e8:SetCategory(CATEGORY_TOHAND+CATEGORY_DESTROY)
e8:SetType(EFFECT_TYPE_QUICK_O)
e8:SetRange(LOCATION_GRAVE)
e8:SetCode(EVENT_FREE_CHAIN)
e8:SetCountLimit(1,m)
e8:SetCost(cm.thcost)
e8:SetTarget(cm.thtg)
e8:SetOperation(cm.thop)
c:RegisterEffect(e8)
end
function cm.EoS(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_EoS
end
function cm.repfilter(c,tp)
return not c:IsReason(REASON_REPLACE)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return (c:IsSSetable() or (c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0)) and eg:IsExists(cm.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,1-tp,m)
local c=e:GetHandler()
if c then
if c:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.SelectOption(tp,aux.Stringid(14001521,4),aux.Stringid(14001521,5))==0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,c)
elseif Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and c:IsSSetable() then
Duel.SSet(tp,c)
end
end
end
function cm.ssetfilter(c)
return cm.EoS(c) and c:GetOriginalType()&TYPE_MONSTER~=0
end
function cm.ssetcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetControler()
if eg and #eg:Filter(cm.ssetfilter,nil)>0 then
local eg1=eg:Filter(cm.ssetfilter,nil)
local tc=eg1:GetFirst()
while tc do
local code=tc:GetOriginalCodeRule()
local ccode=_G["c"..code]
if eg:IsContains(tc) and ccode.settg(e,tp,eg,ep,ev,re,r,rp,0) and Duel.GetFlagEffect(tp,code)==0 then
if Duel.GetCurrentChain()==0 then
if tc:IsFacedown() and Duel.SelectEffectYesNo(tp,tc) then
Duel.ChangePosition(tc,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE)
Duel.RaiseEvent(tc,EVENT_CUSTOM+code,e,0,0,0,0)
Duel.RegisterFlagEffect(tp,code,RESET_PHASE+PHASE_END,0,1)
end
else
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetReset(RESET_EVENT+EVENT_CHAIN_END+RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabelObject(tc)
e1:SetOperation(cm.retop)
Duel.RegisterEffect(e1,tp)
end
end
tc=eg1:GetNext()
end
end
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject()
local code=c:GetOriginalCodeRule()
if c and c:IsFacedown() and Duel.SelectEffectYesNo(tp,c) then
Duel.ChangePosition(c,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE)
Duel.RaiseEvent(c,EVENT_CUSTOM+code,e,0,0,0,0)
Duel.RegisterFlagEffect(tp,code,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return eg:IsContains(c)
end
function cm.thfilter(c,tp)
return c:IsAbleToHand() and Duel.IsExistingMatchingCard(cm.tdfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,2,c)
end
function cm.tdfilter(c)
return c:IsAbleToDeck()
end
function cm.ckfilter(c)
return c:IsAbleToDeck() or c:IsAbleToHand()
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,PLAYER_ALL,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,PLAYER_ALL,LOCATION_GRAVE)
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tg=Duel.GetMatchingGroup(cm.ckfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
if #tg<3 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local hg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,tp)
if #hg>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local dg=Duel.SelectMatchingCard(tp,cm.tdfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,2,2,hg)
if #dg>0 then
Duel.SendtoHand(hg,nil,REASON_EFFECT)
Duel.SendtoDeck(dg,nil,2,REASON_EFFECT)
end
end
end
function cm.tcfilter(c)
return c:IsFaceup() and c:IsCanTurnSet() and not c:IsLocation(LOCATION_PZONE)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tcfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.tcfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
if #g>0 then
local tc=g:GetFirst()
tc:CancelToGrave()
if tc:IsType(TYPE_MONSTER) then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
else
Duel.ChangePosition(tc,POS_FACEDOWN)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsAbleToHand() and c:IsRelateToEffect(e) then
if Duel.SendtoHand(c,tp,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_HAND) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,nil)
if #g>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
end
end
\ No newline at end of file
--诞影之国的复生之影
local m=14001515
local cm=_G["c"..m]
cm.named_with_EoS=1
function cm.initial_effect(c)
--set
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_MONSTER_SSET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
--replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_HAND)
e2:SetTarget(cm.reptg)
e2:SetValue(cm.repval)
e2:SetOperation(cm.repop)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_POSITION)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_CUSTOM+m)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(0xff)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.setcon)
e3:SetTarget(cm.settg)
e3:SetOperation(cm.setop)
c:RegisterEffect(e3)
cm.changef_effect=e3
if not eos_pos_check then
eos_pos_check=true
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_SSET)
e4:SetOperation(cm.ssetcon)
Duel.RegisterEffect(e4,tp)
local e5=e4:Clone()
e5:SetCode(EVENT_MSET)
Duel.RegisterEffect(e5,tp)
local e6=e4:Clone()
e6:SetCode(EVENT_CHANGE_POS)
Duel.RegisterEffect(e6,tp)
local e7=e4:Clone()
e7:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(e7,tp)
end
--tohand
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(m,1))
e8:SetCategory(CATEGORY_TOHAND+CATEGORY_DESTROY)
e8:SetType(EFFECT_TYPE_QUICK_O)
e8:SetRange(LOCATION_GRAVE)
e8:SetCode(EVENT_FREE_CHAIN)
e8:SetCountLimit(1,m)
e8:SetCost(cm.thcost)
e8:SetTarget(cm.thtg)
e8:SetOperation(cm.thop)
c:RegisterEffect(e8)
end
function cm.EoS(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_EoS
end
function cm.repfilter(c,tp)
return not c:IsReason(REASON_REPLACE)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return (c:IsSSetable() or (c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0)) and eg:IsExists(cm.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,1-tp,m)
local c=e:GetHandler()
if c then
if c:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.SelectOption(tp,aux.Stringid(14001521,4),aux.Stringid(14001521,5))==0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,c)
elseif Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and c:IsSSetable() then
Duel.SSet(tp,c)
end
end
end
function cm.ssetfilter(c)
return cm.EoS(c) and c:GetOriginalType()&TYPE_MONSTER~=0
end
function cm.ssetcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetControler()
if eg and #eg:Filter(cm.ssetfilter,nil)>0 then
local eg1=eg:Filter(cm.ssetfilter,nil)
local tc=eg1:GetFirst()
while tc do
local code=tc:GetOriginalCodeRule()
local ccode=_G["c"..code]
if eg:IsContains(tc) and ccode.settg(e,tp,eg,ep,ev,re,r,rp,0) and Duel.GetFlagEffect(tp,code)==0 then
if Duel.GetCurrentChain()==0 then
if tc:IsFacedown() and Duel.SelectEffectYesNo(tp,tc) then
Duel.ChangePosition(tc,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE)
Duel.RaiseEvent(tc,EVENT_CUSTOM+code,e,0,0,0,0)
Duel.RegisterFlagEffect(tp,code,RESET_PHASE+PHASE_END,0,1)
end
else
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetReset(RESET_EVENT+EVENT_CHAIN_END+RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabelObject(tc)
e1:SetOperation(cm.retop)
Duel.RegisterEffect(e1,tp)
end
end
tc=eg1:GetNext()
end
end
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject()
local code=c:GetOriginalCodeRule()
if c and c:IsFacedown() and Duel.SelectEffectYesNo(tp,c) then
Duel.ChangePosition(c,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE)
Duel.RaiseEvent(c,EVENT_CUSTOM+code,e,0,0,0,0)
Duel.RegisterFlagEffect(tp,code,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return eg:IsContains(c)
end
function cm.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0 and tc:IsLocation(LOCATION_MZONE) and tc:IsFaceup() and tc:IsCanTurnSet() and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
end
end
function cm.tcfilter(c)
return c:IsFaceup() and c:IsCanTurnSet() and not c:IsLocation(LOCATION_PZONE)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tcfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.tcfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
if #g>0 then
local tc=g:GetFirst()
tc:CancelToGrave()
if tc:IsType(TYPE_MONSTER) then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
else
Duel.ChangePosition(tc,POS_FACEDOWN)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsAbleToHand() and c:IsRelateToEffect(e) then
if Duel.SendtoHand(c,tp,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_HAND) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,nil)
if #g>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
end
end
\ No newline at end of file
--诞影之国的阴险之影
local m=14001516
local cm=_G["c"..m]
cm.named_with_EoS=1
function cm.initial_effect(c)
--set
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_MONSTER_SSET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
--replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_HAND)
e2:SetTarget(cm.reptg)
e2:SetValue(cm.repval)
e2:SetOperation(cm.repop)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_CUSTOM+m)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(0xff)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.setcon)
e3:SetTarget(cm.settg)
e3:SetOperation(cm.setop)
c:RegisterEffect(e3)
cm.changef_effect=e3
if not eos_pos_check then
eos_pos_check=true
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_SSET)
e4:SetOperation(cm.ssetcon)
Duel.RegisterEffect(e4,tp)
local e5=e4:Clone()
e5:SetCode(EVENT_MSET)
Duel.RegisterEffect(e5,tp)
local e6=e4:Clone()
e6:SetCode(EVENT_CHANGE_POS)
Duel.RegisterEffect(e6,tp)
local e7=e4:Clone()
e7:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(e7,tp)
end
--tohand
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(m,1))
e8:SetCategory(CATEGORY_TOHAND+CATEGORY_DESTROY)
e8:SetType(EFFECT_TYPE_QUICK_O)
e8:SetRange(LOCATION_GRAVE)
e8:SetCode(EVENT_FREE_CHAIN)
e8:SetCountLimit(1,m)
e8:SetCost(cm.thcost)
e8:SetTarget(cm.thtg)
e8:SetOperation(cm.thop)
c:RegisterEffect(e8)
end
function cm.EoS(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_EoS
end
function cm.repfilter(c,tp)
return not c:IsReason(REASON_REPLACE)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return (c:IsSSetable() or (c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0)) and eg:IsExists(cm.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,1-tp,m)
local c=e:GetHandler()
if c then
if c:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.SelectOption(tp,aux.Stringid(14001521,4),aux.Stringid(14001521,5))==0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,c)
elseif Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and c:IsSSetable() then
Duel.SSet(tp,c)
end
end
end
function cm.ssetfilter(c)
return cm.EoS(c) and c:GetOriginalType()&TYPE_MONSTER~=0
end
function cm.ssetcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetControler()
if eg and #eg:Filter(cm.ssetfilter,nil)>0 then
local eg1=eg:Filter(cm.ssetfilter,nil)
local tc=eg1:GetFirst()
while tc do
local code=tc:GetOriginalCodeRule()
local ccode=_G["c"..code]
if eg:IsContains(tc) and ccode.settg(e,tp,eg,ep,ev,re,r,rp,0) and Duel.GetFlagEffect(tp,code)==0 then
if Duel.GetCurrentChain()==0 then
if tc:IsFacedown() and Duel.SelectEffectYesNo(tp,tc) then
Duel.ChangePosition(tc,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE)
Duel.RaiseEvent(tc,EVENT_CUSTOM+code,e,0,0,0,0)
Duel.RegisterFlagEffect(tp,code,RESET_PHASE+PHASE_END,0,1)
end
else
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetReset(RESET_EVENT+EVENT_CHAIN_END+RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabelObject(tc)
e1:SetOperation(cm.retop)
Duel.RegisterEffect(e1,tp)
end
end
tc=eg1:GetNext()
end
end
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject()
local code=c:GetOriginalCodeRule()
if c and c:IsFacedown() and Duel.SelectEffectYesNo(tp,c) then
Duel.ChangePosition(c,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE)
Duel.RaiseEvent(c,EVENT_CUSTOM+code,e,0,0,0,0)
Duel.RegisterFlagEffect(tp,code,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return eg:IsContains(c)
end
function cm.filter(c,e,tp)
return c:IsSSetable() or (c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0)
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if #g>0 then
local tc=g:GetFirst()
if tc:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.SelectOption(tp,aux.Stringid(14001521,4),aux.Stringid(14001521,5))==0 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
elseif tc:IsSSetable() then
Duel.SSet(tp,tc)
end
if Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if #g>0 then
local tc=g:GetFirst()
if tc:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.SelectOption(tp,aux.Stringid(14001521,4),aux.Stringid(14001521,5))==0 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
elseif tc:IsSSetable() then
Duel.SSet(tp,tc)
end
end
end
end
end
function cm.tcfilter(c)
return c:IsFaceup() and c:IsCanTurnSet() and not c:IsLocation(LOCATION_PZONE)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tcfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.tcfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
if #g>0 then
local tc=g:GetFirst()
tc:CancelToGrave()
if tc:IsType(TYPE_MONSTER) then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
else
Duel.ChangePosition(tc,POS_FACEDOWN)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsAbleToHand() and c:IsRelateToEffect(e) then
if Duel.SendtoHand(c,tp,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_HAND) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,nil)
if #g>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
end
end
\ No newline at end of file
--诞影之国的破灭之影
local m=14001517
local cm=_G["c"..m]
cm.named_with_EoS=1
function cm.initial_effect(c)
--set
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_MONSTER_SSET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
--replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_HAND)
e2:SetTarget(cm.reptg)
e2:SetValue(cm.repval)
e2:SetOperation(cm.repop)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_CUSTOM+m)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(0xff)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.setcon)
e3:SetTarget(cm.settg)
e3:SetOperation(cm.setop)
c:RegisterEffect(e3)
cm.changef_effect=e3
if not eos_pos_check then
eos_pos_check=true
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_SSET)
e4:SetOperation(cm.ssetcon)
Duel.RegisterEffect(e4,tp)
local e5=e4:Clone()
e5:SetCode(EVENT_MSET)
Duel.RegisterEffect(e5,tp)
local e6=e4:Clone()
e6:SetCode(EVENT_CHANGE_POS)
Duel.RegisterEffect(e6,tp)
local e7=e4:Clone()
e7:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(e7,tp)
end
--tohand
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(m,1))
e8:SetCategory(CATEGORY_TOHAND+CATEGORY_DESTROY)
e8:SetType(EFFECT_TYPE_QUICK_O)
e8:SetRange(LOCATION_GRAVE)
e8:SetCode(EVENT_FREE_CHAIN)
e8:SetCountLimit(1,m)
e8:SetCost(cm.thcost)
e8:SetTarget(cm.thtg)
e8:SetOperation(cm.thop)
c:RegisterEffect(e8)
end
function cm.EoS(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_EoS
end
function cm.repfilter(c,tp)
return not c:IsReason(REASON_REPLACE)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return (c:IsSSetable() or (c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0)) and eg:IsExists(cm.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,1-tp,m)
local c=e:GetHandler()
if c then
if c:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.SelectOption(tp,aux.Stringid(14001521,4),aux.Stringid(14001521,5))==0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,c)
elseif Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and c:IsSSetable() then
Duel.SSet(tp,c)
end
end
end
function cm.ssetfilter(c)
return cm.EoS(c) and c:GetOriginalType()&TYPE_MONSTER~=0
end
function cm.ssetcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetControler()
if eg and #eg:Filter(cm.ssetfilter,nil)>0 then
local eg1=eg:Filter(cm.ssetfilter,nil)
local tc=eg1:GetFirst()
while tc do
local code=tc:GetOriginalCodeRule()
local ccode=_G["c"..code]
if eg:IsContains(tc) and ccode.settg(e,tp,eg,ep,ev,re,r,rp,0) and Duel.GetFlagEffect(tp,code)==0 then
if Duel.GetCurrentChain()==0 then
if tc:IsFacedown() and Duel.SelectEffectYesNo(tp,tc) then
Duel.ChangePosition(tc,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE)
Duel.RaiseEvent(tc,EVENT_CUSTOM+code,e,0,0,0,0)
Duel.RegisterFlagEffect(tp,code,RESET_PHASE+PHASE_END,0,1)
end
else
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetReset(RESET_EVENT+EVENT_CHAIN_END+RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabelObject(tc)
e1:SetOperation(cm.retop)
Duel.RegisterEffect(e1,tp)
end
end
tc=eg1:GetNext()
end
end
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject()
local code=c:GetOriginalCodeRule()
if c and c:IsFacedown() and Duel.SelectEffectYesNo(tp,c) then
Duel.ChangePosition(c,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE)
Duel.RaiseEvent(c,EVENT_CUSTOM+code,e,0,0,0,0)
Duel.RegisterFlagEffect(tp,code,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return eg:IsContains(c)
end
function cm.rmfilter(c)
return c:IsAbleToRemove()
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local loc1,loc2=LOCATION_GRAVE,LOCATION_GRAVE
if not Duel.IsExistingMatchingCard(aux.TRUE,c:GetControler(),LOCATION_GRAVE,0,1,nil) then loc1=LOCATION_ONFIELD end
if not Duel.IsExistingMatchingCard(aux.TRUE,c:GetControler(),0,LOCATION_GRAVE,1,nil) then loc2=LOCATION_ONFIELD end
if chk==0 then return Duel.IsExistingMatchingCard(cm.rmfilter,tp,loc1,loc2,2,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,2,PLAYER_ALL,LOCATION_GRAVE+LOCATION_ONFIELD)
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local loc1,loc2=LOCATION_GRAVE,LOCATION_GRAVE
if not Duel.IsExistingMatchingCard(aux.TRUE,c:GetControler(),LOCATION_GRAVE,0,1,nil) then loc1=LOCATION_ONFIELD end
if not Duel.IsExistingMatchingCard(aux.TRUE,c:GetControler(),0,LOCATION_GRAVE,1,nil) then loc2=LOCATION_ONFIELD end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.rmfilter,tp,loc1,loc2,2,2,nil)
if #g>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
function cm.tcfilter(c)
return c:IsFaceup() and c:IsCanTurnSet() and not c:IsLocation(LOCATION_PZONE)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tcfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.tcfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
if #g>0 then
local tc=g:GetFirst()
tc:CancelToGrave()
if tc:IsType(TYPE_MONSTER) then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
else
Duel.ChangePosition(tc,POS_FACEDOWN)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsAbleToHand() and c:IsRelateToEffect(e) then
if Duel.SendtoHand(c,tp,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_HAND) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,nil)
if #g>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
end
end
\ No newline at end of file
--诞影之国的翻覆之影
local m=14001518
local cm=_G["c"..m]
cm.named_with_EoS=1
function cm.initial_effect(c)
--set
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_MONSTER_SSET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
--replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_HAND)
e2:SetTarget(cm.reptg)
e2:SetValue(cm.repval)
e2:SetOperation(cm.repop)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_POSITION)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_CUSTOM+m)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(0xff)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.setcon)
e3:SetTarget(cm.settg)
e3:SetOperation(cm.setop)
c:RegisterEffect(e3)
cm.changef_effect=e3
if not eos_pos_check then
eos_pos_check=true
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_SSET)
e4:SetOperation(cm.ssetcon)
Duel.RegisterEffect(e4,tp)
local e5=e4:Clone()
e5:SetCode(EVENT_MSET)
Duel.RegisterEffect(e5,tp)
local e6=e4:Clone()
e6:SetCode(EVENT_CHANGE_POS)
Duel.RegisterEffect(e6,tp)
local e7=e4:Clone()
e7:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(e7,tp)
end
--tohand
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(m,1))
e8:SetCategory(CATEGORY_TOHAND+CATEGORY_DESTROY)
e8:SetType(EFFECT_TYPE_QUICK_O)
e8:SetRange(LOCATION_GRAVE)
e8:SetCode(EVENT_FREE_CHAIN)
e8:SetCountLimit(1,m)
e8:SetCost(cm.thcost)
e8:SetTarget(cm.thtg)
e8:SetOperation(cm.thop)
c:RegisterEffect(e8)
end
function cm.EoS(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_EoS
end
function cm.repfilter(c,tp)
return not c:IsReason(REASON_REPLACE)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return (c:IsSSetable() or (c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0)) and eg:IsExists(cm.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,1-tp,m)
local c=e:GetHandler()
if c then
if c:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.SelectOption(tp,aux.Stringid(14001521,4),aux.Stringid(14001521,5))==0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,c)
elseif Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and c:IsSSetable() then
Duel.SSet(tp,c)
end
end
end
function cm.ssetfilter(c)
return cm.EoS(c) and c:GetOriginalType()&TYPE_MONSTER~=0
end
function cm.ssetcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetControler()
if eg and #eg:Filter(cm.ssetfilter,nil)>0 then
local eg1=eg:Filter(cm.ssetfilter,nil)
local tc=eg1:GetFirst()
while tc do
local code=tc:GetOriginalCodeRule()
local ccode=_G["c"..code]
if eg:IsContains(tc) and ccode.settg(e,tp,eg,ep,ev,re,r,rp,0) and Duel.GetFlagEffect(tp,code)==0 then
if Duel.GetCurrentChain()==0 then
if tc:IsFacedown() and Duel.SelectEffectYesNo(tp,tc) then
Duel.ChangePosition(tc,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE)
Duel.RaiseEvent(tc,EVENT_CUSTOM+code,e,0,0,0,0)
Duel.RegisterFlagEffect(tp,code,RESET_PHASE+PHASE_END,0,1)
end
else
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetReset(RESET_EVENT+EVENT_CHAIN_END+RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabelObject(tc)
e1:SetOperation(cm.retop)
Duel.RegisterEffect(e1,tp)
end
end
tc=eg1:GetNext()
end
end
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject()
local code=c:GetOriginalCodeRule()
if c and c:IsFacedown() and Duel.SelectEffectYesNo(tp,c) then
Duel.ChangePosition(c,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE)
Duel.RaiseEvent(c,EVENT_CUSTOM+code,e,0,0,0,0)
Duel.RegisterFlagEffect(tp,code,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return eg:IsContains(c)
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tcfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.tcfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if #g>0 then
local tc=g:GetFirst()
tc:CancelToGrave()
if tc:IsType(TYPE_MONSTER) then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
else
Duel.ChangePosition(tc,POS_FACEDOWN)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
end
function cm.tcfilter(c)
return c:IsFaceup() and c:IsCanTurnSet() and not c:IsLocation(LOCATION_PZONE)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tcfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.tcfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
if #g>0 then
local tc=g:GetFirst()
tc:CancelToGrave()
if tc:IsType(TYPE_MONSTER) then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
else
Duel.ChangePosition(tc,POS_FACEDOWN)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsAbleToHand() and c:IsRelateToEffect(e) then
if Duel.SendtoHand(c,tp,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_HAND) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,nil)
if #g>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
end
end
\ No newline at end of file
--诞影之国的始焉 诞生之影
local m=14001519
local cm=_G["c"..m]
cm.named_with_EoS=1
function cm.initial_effect(c)
--Synchro summon
aux.AddSynchroProcedure(c,nil,aux.Tuner(nil),1,1)
c:EnableReviveLimit()
--c:SetSPSummonOnce(m)
--set
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_MONSTER_SSET)
e0:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,2))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.exsetcon)
e1:SetOperation(cm.exsetop)
c:RegisterEffect(e1)
--replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_ONFIELD)
e2:SetTarget(cm.reptg)
e2:SetValue(cm.repval)
e2:SetOperation(cm.repop)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_CUSTOM+m)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(0xff)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.setcon)
e3:SetTarget(cm.settg)
e3:SetOperation(cm.setop)
c:RegisterEffect(e3)
cm.changef_effect=e3
if not eos_pos_check then
eos_pos_check=true
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_SSET)
e4:SetOperation(cm.ssetcon)
Duel.RegisterEffect(e4,tp)
local e5=e4:Clone()
e5:SetCode(EVENT_MSET)
Duel.RegisterEffect(e5,tp)
local e6=e4:Clone()
e6:SetCode(EVENT_CHANGE_POS)
Duel.RegisterEffect(e6,tp)
local e7=e4:Clone()
e7:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(e7,tp)
end
--tohand
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(m,1))
e8:SetCategory(CATEGORY_TOHAND+CATEGORY_DESTROY)
e8:SetType(EFFECT_TYPE_QUICK_O)
e8:SetRange(LOCATION_GRAVE)
e8:SetCode(EVENT_FREE_CHAIN)
e8:SetCountLimit(1,m)
e8:SetCost(cm.thcost)
e8:SetTarget(cm.thtg)
e8:SetOperation(cm.thop)
c:RegisterEffect(e8)
end
function cm.EoS(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_EoS
end
function cm.cfilter(c,tp)
return cm.EoS(c) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToGrave() and Duel.IsExistingMatchingCard(cm.cfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
end
function cm.cfilter1(c)
return cm.EoS(c) and c:IsFaceup() and c:IsCanTurnSet()
end
function cm.exsetcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,tp)
return #mg>0 and (Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 or c:IsSSetable()) and Duel.GetTurnPlayer()==tp and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function cm.exsetop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,tp,c)
local tg=mg:Select(tp,1,1,nil)
if not tg or #tg<=0 then return end
local mg1=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,tg)
local tg1=mg1:Select(tp,1,1,nil)
if tg1 and #tg1>0 then
if Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.SelectOption(tp,aux.Stringid(14001521,4),aux.Stringid(14001521,5))==0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,c)
elseif c:IsSSetable() then
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEDOWN,true)
Duel.ConfirmCards(1-tp,c)
Duel.RaiseEvent(c,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
Duel.BreakEffect()
Duel.SendtoGrave(tg,REASON_RULE)
local tc=tg1:GetFirst()
tc:CancelToGrave()
if tc:IsType(TYPE_MONSTER) then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
else
Duel.ChangePosition(tc,POS_FACEDOWN)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
end
function cm.filter(c,e,tp)
return cm.EoS(c) and (c:IsSSetable() or (c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0))
end
function cm.repfilter(c,tp)
return not c:IsReason(REASON_REPLACE)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) and eg:IsExists(cm.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,1-tp,m)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
local tc=g:GetFirst()
if tc:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.SelectOption(tp,aux.Stringid(14001521,4),aux.Stringid(14001521,5))==0 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,tc)
elseif tc:IsSSetable() then
Duel.SSet(tp,tc)
end
end
end
function cm.ssetfilter(c)
return cm.EoS(c) and c:GetOriginalType()&TYPE_MONSTER~=0
end
function cm.ssetcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetControler()
if eg and #eg:Filter(cm.ssetfilter,nil)>0 then
local eg1=eg:Filter(cm.ssetfilter,nil)
local tc=eg1:GetFirst()
while tc do
local code=tc:GetOriginalCodeRule()
local ccode=_G["c"..code]
if eg:IsContains(tc) and ccode.settg(e,tp,eg,ep,ev,re,r,rp,0) and Duel.GetFlagEffect(tp,code)==0 then
if Duel.GetCurrentChain()==0 then
if tc:IsFacedown() and Duel.SelectEffectYesNo(tp,tc) then
Duel.ChangePosition(tc,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE)
Duel.RaiseEvent(tc,EVENT_CUSTOM+code,e,0,0,0,0)
Duel.RegisterFlagEffect(tp,code,RESET_PHASE+PHASE_END,0,1)
end
else
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetReset(RESET_EVENT+EVENT_CHAIN_END+RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabelObject(tc)
e1:SetOperation(cm.retop)
Duel.RegisterEffect(e1,tp)
end
end
tc=eg1:GetNext()
end
end
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject()
local code=c:GetOriginalCodeRule()
if c and c:IsFacedown() and Duel.SelectEffectYesNo(tp,c) then
Duel.ChangePosition(c,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE)
Duel.RaiseEvent(c,EVENT_CUSTOM+code,e,0,0,0,0)
Duel.RegisterFlagEffect(tp,code,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return eg:IsContains(c)
end
function cm.cefilter(c,e,tp,eg,ep,ev,re,r,rp)
if not (cm.EoS(c) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToGrave() and not c:IsCode(m)) then return false end
local m=_G["c"..c:GetCode()]
if not m then return false end
local te=m.changef_effect
local tg=nil
if te then
tg=te:GetTarget()
end
return not tg or tg and tg(e,tp,eg,ep,ev,re,r,rp,0)
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cefilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD,0,1,nil,e,tp,eg,ep,ev,re,r,rp) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD)
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.cefilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD,0,1,1,nil,e,tp,eg,ep,ev,re,r,rp)
if #g>0 then
local tc=g:GetFirst()
if Duel.SendtoGrave(tc,REASON_EFFECT)~=0 then
local m=_G["c"..tc:GetCode()]
local te=m.changef_effect
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
end
end
function cm.tcfilter(c)
return c:IsFaceup() and c:IsCanTurnSet() and not c:IsLocation(LOCATION_PZONE)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tcfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.tcfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
if #g>0 then
local tc=g:GetFirst()
tc:CancelToGrave()
if tc:IsType(TYPE_MONSTER) then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
else
Duel.ChangePosition(tc,POS_FACEDOWN)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,0,0)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsAbleToHand() and c:IsRelateToEffect(e) then
if Duel.SendtoDeck(c,tp,2,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_EXTRA) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if #g>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
end
end
\ No newline at end of file
--诞影之国的始焉 消亡之影
local m=14001520
local cm=_G["c"..m]
cm.named_with_EoS=1
function cm.initial_effect(c)
--Xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_PSYCHO),5,2)
c:EnableReviveLimit()
--c:SetSPSummonOnce(m)
--set
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_MONSTER_SSET)
e0:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,2))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.exsetcon)
e1:SetOperation(cm.exsetop)
c:RegisterEffect(e1)
--replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_ONFIELD)
e2:SetTarget(cm.reptg)
e2:SetValue(cm.repval)
e2:SetOperation(cm.repop)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_CUSTOM+m)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(0xff)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.setcon)
e3:SetTarget(cm.settg)
e3:SetOperation(cm.setop)
c:RegisterEffect(e3)
cm.changef_effect=e3
if not eos_pos_check then
eos_pos_check=true
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_SSET)
e4:SetOperation(cm.ssetcon)
Duel.RegisterEffect(e4,tp)
local e5=e4:Clone()
e5:SetCode(EVENT_MSET)
Duel.RegisterEffect(e5,tp)
local e6=e4:Clone()
e6:SetCode(EVENT_CHANGE_POS)
Duel.RegisterEffect(e6,tp)
local e7=e4:Clone()
e7:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(e7,tp)
end
--tohand
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(m,1))
e8:SetCategory(CATEGORY_TOHAND+CATEGORY_DESTROY)
e8:SetType(EFFECT_TYPE_QUICK_O)
e8:SetRange(LOCATION_GRAVE)
e8:SetCode(EVENT_FREE_CHAIN)
e8:SetCountLimit(1,m)
e8:SetCost(cm.thcost)
e8:SetTarget(cm.thtg)
e8:SetOperation(cm.thop)
c:RegisterEffect(e8)
end
function cm.EoS(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_EoS
end
function cm.cfilter(c,tp)
return cm.EoS(c) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToGrave() and Duel.IsExistingMatchingCard(cm.cfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
end
function cm.cfilter1(c)
return cm.EoS(c) and c:IsFacedown()
end
function cm.exsetcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,tp)
return #mg>0 and (Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 or c:IsSSetable()) and Duel.GetTurnPlayer()==tp and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function cm.exsetop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,tp,c)
local tg=mg:Select(tp,1,1,nil)
if not tg or #tg<=0 then return end
local mg1=Duel.GetMatchingGroup(cm.cfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,tg)
local tg1=mg1:Select(tp,1,1,nil)
if tg1 and #tg1>0 then
if Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.SelectOption(tp,aux.Stringid(14001521,4),aux.Stringid(14001521,5))==0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,c)
elseif c:IsSSetable() then
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEDOWN,true)
Duel.ConfirmCards(1-tp,c)
Duel.RaiseEvent(c,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
Duel.BreakEffect()
Duel.SendtoGrave(tg,REASON_RULE)
local tc=tg1:GetFirst()
Duel.ChangePosition(tc,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE)
end
end
function cm.filter(c,e,tp)
return cm.EoS(c) and (c:IsSSetable() or (c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0))
end
function cm.repfilter(c,tp)
return not c:IsReason(REASON_REPLACE)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) and eg:IsExists(cm.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,1-tp,m)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
local tc=g:GetFirst()
if tc:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.SelectOption(tp,aux.Stringid(14001521,4),aux.Stringid(14001521,5))==0 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,tc)
elseif tc:IsSSetable() then
Duel.SSet(tp,tc)
end
end
end
function cm.ssetfilter(c)
return cm.EoS(c) and c:GetOriginalType()&TYPE_MONSTER~=0
end
function cm.ssetcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetControler()
if eg and #eg:Filter(cm.ssetfilter,nil)>0 then
local eg1=eg:Filter(cm.ssetfilter,nil)
local tc=eg1:GetFirst()
while tc do
local code=tc:GetOriginalCodeRule()
local ccode=_G["c"..code]
if eg:IsContains(tc) and ccode.settg(e,tp,eg,ep,ev,re,r,rp,0) and Duel.GetFlagEffect(tp,code)==0 then
if Duel.GetCurrentChain()==0 then
if tc:IsFacedown() and Duel.SelectEffectYesNo(tp,tc) then
Duel.ChangePosition(tc,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE)
Duel.RaiseEvent(tc,EVENT_CUSTOM+code,e,0,0,0,0)
Duel.RegisterFlagEffect(tp,code,RESET_PHASE+PHASE_END,0,1)
end
else
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetReset(RESET_EVENT+EVENT_CHAIN_END+RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabelObject(tc)
e1:SetOperation(cm.retop)
Duel.RegisterEffect(e1,tp)
end
end
tc=eg1:GetNext()
end
end
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject()
local code=c:GetOriginalCodeRule()
if c and c:IsFacedown() and Duel.SelectEffectYesNo(tp,c) then
Duel.ChangePosition(c,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE)
Duel.RaiseEvent(c,EVENT_CUSTOM+code,e,0,0,0,0)
Duel.RegisterFlagEffect(tp,code,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return eg:IsContains(c)
end
function cm.cefilter(c,e,tp,eg,ep,ev,re,r,rp)
if not (cm.EoS(c) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToGrave() and not c:IsCode(m)) then return false end
local m=_G["c"..c:GetCode()]
if not m then return false end
local te=m.changef_effect
local tg=nil
if te then
tg=te:GetTarget()
end
return not tg or tg and tg(e,tp,eg,ep,ev,re,r,rp,0)
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cefilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD,0,1,nil,e,tp,eg,ep,ev,re,r,rp) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD)
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.cefilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD,0,1,1,nil,e,tp,eg,ep,ev,re,r,rp)
if #g>0 then
local tc=g:GetFirst()
if Duel.SendtoGrave(tc,REASON_EFFECT)~=0 then
local m=_G["c"..tc:GetCode()]
local te=m.changef_effect
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
end
end
function cm.tcfilter(c)
return c:IsFaceup() and c:IsCanTurnSet() and not c:IsLocation(LOCATION_PZONE)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tcfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.tcfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
if #g>0 then
local tc=g:GetFirst()
tc:CancelToGrave()
if tc:IsType(TYPE_MONSTER) then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
else
Duel.ChangePosition(tc,POS_FACEDOWN)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,0,0)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsAbleToHand() and c:IsRelateToEffect(e) then
if Duel.SendtoDeck(c,tp,2,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_EXTRA) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if #g>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
end
end
\ No newline at end of file
--诞影之国 德维安特
local m=14001521
local cm=_G["c"..m]
cm.named_with_EoS=1
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--tograve
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_FZONE)
e2:SetCode(EVENT_MSET)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e2:SetCondition(cm.con)
e2:SetTarget(cm.tg)
e2:SetOperation(cm.op)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SSET)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EVENT_CHANGE_POS)
e4:SetCondition(cm.con1)
c:RegisterEffect(e4)
local e5=e2:Clone()
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
e5:SetCondition(cm.con1)
c:RegisterEffect(e5)
--spsummon
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e6:SetCode(EVENT_DESTROYED)
e6:SetProperty(EFFECT_FLAG_DELAY)
e6:SetTarget(cm.fltg)
e6:SetOperation(cm.flop)
c:RegisterEffect(e6)
end
function cm.EoS(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_EoS
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsControler,1,nil,tp)
end
function cm.confilter(c,tp)
return c:IsFacedown() and c:IsControler(tp)
end
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,tp)
end
function cm.filter(c)
return cm.EoS(c) and c:IsAbleToGrave()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function cm.flfilter(c,tp)
return c:IsCode(14001524) and c:IsType(TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function cm.fltg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.flfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,0,0)
end
function cm.flop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(14001521,6))
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.flfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp)
local tc=g:GetFirst()
if tc then
local te=tc:GetActivateEffect()
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
te:UseCountLimit(tp,1,true)
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
end
\ No newline at end of file
--诞影之国的分裂之影
local m=14001522
local cm=_G["c"..m]
cm.named_with_EoS=1
function cm.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.settg)
e1:SetOperation(cm.setop)
c:RegisterEffect(e1)
--SpecialSummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_MSET)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.con)
e2:SetTarget(cm.tg)
e2:SetOperation(cm.op)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SSET)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EVENT_CHANGE_POS)
e4:SetCondition(cm.con1)
c:RegisterEffect(e4)
local e5=e2:Clone()
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
e5:SetCondition(cm.con1)
c:RegisterEffect(e5)
end
function cm.EoS(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_EoS
end
function cm.filter(c,e,tp)
return cm.EoS(c) and (c:IsSSetable() or (c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0))
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,0)
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
local tc=g:GetFirst()
if tc:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.SelectOption(tp,aux.Stringid(14001521,4),aux.Stringid(14001521,5))==0 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,tc)
elseif tc:IsSSetable() then
Duel.SSet(tp,tc)
end
if tc:IsOnField() then
Duel.BreakEffect()
Duel.Destroy(tc,REASON_EFFECT)
end
end
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsControler,1,nil,tp)
end
function cm.confilter(c,tp)
return c:IsFacedown() and c:IsControler(tp)
end
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,tp)
end
function cm.spfilter(c,e,tp)
return cm.EoS(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--诞影之国的重合之影
local m=14001523
local cm=_G["c"..m]
cm.named_with_EoS=1
function cm.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.settg)
e1:SetOperation(cm.setop)
c:RegisterEffect(e1)
--SpecialSummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_MSET)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.con)
e2:SetTarget(cm.tg)
e2:SetOperation(cm.op)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SSET)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EVENT_CHANGE_POS)
e4:SetCondition(cm.con1)
c:RegisterEffect(e4)
local e5=e2:Clone()
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
e5:SetCondition(cm.con1)
c:RegisterEffect(e5)
end
function cm.EoS(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_EoS
end
function cm.filter(c)
return c:IsFaceup() and c:IsCanTurnSet() and not c:IsLocation(LOCATION_PZONE)
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,PLAYER_ALL,LOCATION_ONFIELD)
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
if #g>0 then
local tc=g:GetFirst()
tc:CancelToGrave()
if tc:IsType(TYPE_MONSTER) then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
else
Duel.ChangePosition(tc,POS_FACEDOWN)
Duel.RaiseEvent(tc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
if tc:IsOnField() then
Duel.BreakEffect()
Duel.Destroy(tc,REASON_EFFECT)
end
end
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsControler,1,nil,tp)
end
function cm.confilter(c,tp)
return c:IsFacedown() and c:IsControler(tp)
end
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,tp)
end
function cm.spfilter(c,e,tp)
return cm.EoS(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
end
end
\ No newline at end of file
--诞影之国 以特维德
local m=14001524
local cm=_G["c"..m]
cm.named_with_EoS=1
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--tograve
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_FZONE)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1)
e2:SetCondition(cm.con)
e2:SetTarget(cm.tg)
e2:SetOperation(cm.op)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DESTROYED)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetTarget(cm.fltg)
e3:SetOperation(cm.flop)
c:RegisterEffect(e3)
end
function cm.EoS(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_EoS
end
function cm.cfilter(c,tp)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousControler(tp)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,tp)
end
function cm.filter(c)
return (cm.EoS(c) and c:IsAbleToHand()) or c:IsAbleToDeck()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil)
if #g>0 then
local tc=g:GetFirst()
if cm.EoS(tc) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
else
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
end
end
function cm.flfilter(c,tp)
return c:IsCode(14001521) and c:IsType(TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function cm.fltg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.flfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,0,0)
end
function cm.flop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(14001521,6))
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.flfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp)
local tc=g:GetFirst()
if tc then
local te=tc:GetActivateEffect()
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
te:UseCountLimit(tp,1,true)
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
end
\ No newline at end of file
--『真燃剑舞·天地烬灭』
local m=14001550
local cm=_G["c"..m]
cm.named_with_Blazedance=1
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--act from hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
e2:SetHintTiming(0,TIMING_BATTLE_START+TIMING_BATTLE_END)
e2:SetCondition(cm.hacon)
e2:SetTarget(cm.hatg)
e2:SetOperation(cm.haop)
c:RegisterEffect(e2)
--battle damage
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
e3:SetRange(LOCATION_FZONE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,1)
e3:SetValue(1550)
c:RegisterEffect(e3)
--65535
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_SET_ATTACK_FINAL)
e4:SetRange(LOCATION_FZONE)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e4:SetCondition(cm.atkcon)
e4:SetTarget(cm.atktg)
e4:SetValue(65535)
c:RegisterEffect(e4)
--[[extra attack
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_EXTRA_ATTACK)
e5:SetRange(LOCATION_FZONE)
e5:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e5:SetCondition(cm.dacon)
e5:SetTarget(cm.datg)
e5:SetValue(1)
c:RegisterEffect(e5)
Duel.AddCustomActivityCounter(m,ACTIVITY_CHAIN,aux.FALSE)]]
--search
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(m,1))
e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_FZONE)
e6:SetHintTiming(0,TIMING_BATTLE_START+TIMING_BATTLE_END)
e6:SetCountLimit(1)
e6:SetCondition(cm.thcon)
e6:SetTarget(cm.thtg)
e6:SetOperation(cm.thop)
c:RegisterEffect(e6)
end
function cm.blazed(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Blazedance
end
function cm.hacon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE
end
function cm.hatg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetActivateEffect():IsActivatable(tp,true,true) end
Duel.SetChainLimit(aux.FALSE)
end
function cm.haop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c and c:IsRelateToEffect(e) then
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(c,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
local te=c:GetActivateEffect()
te:UseCountLimit(tp,1,true)
local tep=c:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(c,4179255,te,0,tp,tp,Duel.GetCurrentChain())
--Duel.RaiseEvent(c,EVENT_CUSTOM+14001550,te,0,tp,tp,Duel.GetCurrentChain())
end
end
function cm.atkcon(e)
return Duel.GetCurrentPhase()==PHASE_DAMAGE_CAL and Duel.GetAttacker() and Duel.GetAttackTarget()
end
function cm.atktg(e,c)
return c==Duel.GetAttacker()
end
function cm.dacon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
return Duel.GetCustomActivityCount(m,1-tp,ACTIVITY_CHAIN)~=0
end
function cm.datg(e,c)
return cm.blazed(c)
end
function cm.cfilter(c)
return c:IsFaceup() and cm.blazed(c)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE and (Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
or Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil))
end
function cm.thfilter(c)
return cm.blazed(c) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER)
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) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment