Commit a1fd3202 authored by Nemo Ma's avatar Nemo Ma

opd

parent e8198940
......@@ -1730,6 +1730,61 @@
15004479 0
15004491 0
15004493 0
#「空隙」 - 沃亚森斯奥克斯
30008800 0
30008801 0
30008802 0
30008803 0
30008804 0
30008805 0
30008806 0
30008807 0
30008808 0
30008809 0
30008810 0
#「星光歌剧」 - 02
33405001 0
33405002 0
33405003 0
33405004 0
33405005 0
33405006 0
33405007 0
33405008 0
33405009 0
65010019 0
65010086 0
65010087 0
65010088 0
65010089 0
65010090 0
65010091 0
65010092 0
65010093 0
65010094 0
65010095 0
65010096 0
65010097 0
65010098 0
65010099 0
65010101 0
65010102 0
65010106 0
65010107 0
65010121 0
65010122 0
65010124 0
65010125 0
65010126 0
65010127 0
65010129 0
65010130 0
65010131 0
65010132 0
65010585 0
65010586 0
65010587 0
65020218 0
#Tears are now in Japari Park Again!
572850 1
4928565 0
......@@ -1746,6 +1801,31 @@
60362066 0
74920585 0
77103950 1
#230820
53755004 2
53755003 2
53755002 2
53755001 2
98940037 1
87498786 0
65010124 0
65010122 0
11451751 1
11451755 1
82209081 1
65010099 0
65010098 0
65010092 0
65010090 0
53799086 0
42620114 0
42620099 0
42620078 0
22348002 0
10150088 0
10106004 0
7489826 0
6109001 0
#230813
10105560 0
14010001 0
......@@ -1778,8 +1858,6 @@
11451701 0
79029550 0
82204264 0
82209088 0
82209090 0
82209146 0
91010023 0
9911075 1
......@@ -1833,10 +1911,8 @@
60001249 0
65130303 0
72100123 0
82209081 0
6109001 1
10105552 1
15000604 1
60159943 1
98920192 1
35399325 2
......@@ -1864,7 +1940,6 @@
11621401 1
11621406 1
19198178 1
22348002 1
22348003 1
22348004 1
25800252 1
......@@ -1899,10 +1974,8 @@
31423201 1
43990008 1
60002125 1
65010099 1
82209010 1
98920104 1
98940002 1
#230514
88880220 1
88888002 1
......@@ -1938,7 +2011,6 @@
10173079 2
#230423
9990226 0
11560703 0
11560717 0
22070340 0
30005016 0
......@@ -3468,8 +3540,6 @@
65010096 0
65010097 0
65010586 0
65010092 1
65010122 1
67200100 1
#211114
1000376 0
......@@ -5183,7 +5253,6 @@
14010206 1
33700311 1
33700903 1
#33700905 1
33700792 2
40008150 1
40008160 1
......@@ -5193,11 +5262,6 @@
40008590 1
40008610 1
40008420 1
#60150803 1
#60150806 1
65010090 1
65010124 1
#65010127 1
9951070 1
9951097 1
9951098 1
......@@ -5208,10 +5272,8 @@
9950998 1
9951062 1
9951067 1
#118038143 2
9950448 1
9950452 1
#33403500 1
9950624 1
9950681 0
9950425 1
......@@ -5292,7 +5354,6 @@
13257346 2
33700316 2
33700405 2
65010098 2
117960683 0
9950742 2
#Forbidden TCG
......@@ -6166,6 +6227,8 @@
!THE WILDEST LIST
#forbidden
44910027 0
60002302 0
82209077 0
#limit
121593977 1
121082832 1
......
No preview for this file type
--无序
local s,id,o=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,s.ffilter,6,false)
--material limit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_MATERIAL_LIMIT)
e0:SetValue(s.matlimit)
c:RegisterEffect(e0)
--spsummon condition
local e01=Effect.CreateEffect(c)
e01:SetType(EFFECT_TYPE_SINGLE)
e01:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e01:SetCode(EFFECT_SPSUMMON_CONDITION)
e01:SetValue(aux.fuslimit)
c:RegisterEffect(e01)
--tribute check
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_MATERIAL_CHECK)
e1:SetValue(s.valcheck)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_IGNORE_BATTLE_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(1)
c:RegisterEffect(e2)
--cannot target
local e31=e2:Clone()
e31:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
c:RegisterEffect(e31)
--indes
local e32=e2:Clone()
e32:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e32)
--change effect
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(id)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(1,1)
c:RegisterEffect(e4)
--change lv
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
e5:SetOperation(s.lvop)
c:RegisterEffect(e5)
--to deck
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e6:SetReset(RESET_EVENT+RESETS_REDIRECT)
e6:SetValue(LOCATION_DECK)
c:RegisterEffect(e6)
--change target
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e7:SetCode(EVENT_ATTACK_ANNOUNCE)
e7:SetRange(LOCATION_MZONE)
e7:SetCondition(s.atkcon)
e7:SetOperation(s.atkop)
c:RegisterEffect(e7)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
ge1:SetCode(EVENT_PREDRAW)
ge1:SetRange(LOCATION_EXTRA)
ge1:SetCountLimit(1,id+EFFECT_COUNT_CODE_DUEL)
ge1:SetOperation(s.fuop)
Duel.RegisterEffect(ge1,0)
s[0]=0
s[1]=0
local _SelectMatchingCard=Duel.SelectMatchingCard
local _SelectReleaseGroup=Duel.SelectReleaseGroup
local _SelectReleaseGroupEx=Duel.SelectReleaseGroupEx
local _SelectSubGroup=Group.SelectSubGroup
local _SelectTarget=Duel.SelectTarget
local _SelectTribute=Duel.SelectTribute
local _SelectUnselect=Group.SelectUnselect
local _DiscardHand=Duel.DiscardHand
local _DRemoveOverlayCard=Duel.RemoveOverlayCard
local _CRemoveOverlayCard=Card.RemoveOverlayCard
local _FilterSelect=Group.FilterSelect
local _Select=Group.Select
function Duel.SelectMatchingCard(sp,f,p,s,o,min,max,nc,...)
if Duel.IsPlayerAffectedByEffect(0,id) then
local g=Duel.GetMatchingGroup(f,p,s,o,nc,...)
return g:Select(sp,min,max,nc)
else
return _SelectMatchingCard(sp,f,p,s,o,min,max,nc,...)
end
end
function Duel.SelectReleaseGroup(sp,f,min,max,nc,...)
if Duel.IsPlayerAffectedByEffect(0,id) then
local g=s.filter(Duel.GetReleaseGroup(sp),f,nil,...)
return g:Select(sp,min,max,nc)
else
return _SelectReleaseGroup(sp,f,min,max,nc,...)
end
end
function Duel.SelectReleaseGroupEx(sp,f,min,max,nc,...)
if Duel.IsPlayerAffectedByEffect(0,id) then
local g=s.filter(Duel.GetReleaseGroup(sp,true),f,nil,...)
return g:Select(sp,min,max,nc)
else
return _SelectReleaseGroupEx(sp,f,min,max,nc,...)
end
end
function Group.SelectSubGroup(g,tp,f,cancelable,min,max,...)
if Duel.IsPlayerAffectedByEffect(0,id) then
return g:Select(tp,min,max,nil)
else
return _SelectSubGroup(g,tp,f,cancelable,min,max,...)
end
end
function Duel.SelectTarget(sp,f,p,s,o,min,max,nc,...)
if Duel.IsPlayerAffectedByEffect(0,id) then
local e=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_EFFECT)
local tgf=function(c,...) return (not f or f(c,...)) and c:IsCanBeEffectTarget(e) end
local g=Duel.GetMatchingGroup(tgf,p,s,o,nc,...)
local tg=g:Select(sp,min,max,nc)
Duel.SetTargetCard(tg)
return tg
else
return _SelectTarget(sp,f,p,s,o,min,max,nc,...)
end
end
function Duel.SelectTribute(sp,ac,min,max,mg,top)
if Duel.IsPlayerAffectedByEffect(0,id) then
local f=function(c) return Duel.GetMZoneCount(top,c,sp)>0 end
local f2=function(c,ac) return Duel.GetMZoneCount(top,c,sp)>0 and (Duel.GetTributeGroup(ac):IsContains(c) or not c:IsOnField()) end
local g=Duel.GetTributeGroup(ac):Filter(f,nil)
if mg then g=mg:Filter(f2,nil,ac) end
return g:Select(sp,min,max,nil)
else
return _SelectTribute(sp,ac,min,max,mg,top)
end
end
function Group.SelectUnselect(cg,sg,tp,finish,cancel,min,max)
if Duel.IsPlayerAffectedByEffect(0,id) then
if finish then return end
if not cg or cg:GetCount()<=0 then return end
local tc=cg:RandomSelect(tp,1)
return tc
else
return _SelectUnselect(cg,sg,tp,finish,cancel,min,max)
end
end
function Duel.DiscardHand(sp,f,min,max,r,nc,...)
if Duel.IsPlayerAffectedByEffect(0,id) then
local dg=s.filter(Duel.GetFieldGroup(sp,LOCATION_HAND,0),f,nc,...)
dg=dg:Select(sp,min,max,nc)
return Duel.SendtoGrave(dg,r)
else
return _DiscardHand(sp,f,min,max,r,nc,...)
end
end
function Duel.RemoveOverlayCard(sp,s,o,min,max,r)
if Duel.IsPlayerAffectedByEffect(0,id) then
local og=Duel.GetOverlayGroup(sp,s,o)
og=og:Select(sp,min,max,nil)
local e=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_EFFECT)
local dc=og:GetFirst()
local c=nil
if dc then c=dc:GetOverlayTarget() end
local ct=Duel.SendtoGrave(og,r)
if c and e then Duel.RaiseSingleEvent(c,EVENT_DETACH_MATERIAL,e,0,0,0,0) end
return ct
else
return _DRemoveOverlayCard(sp,s,o,min,max,r)
end
end
function Card.RemoveOverlayCard(oc,sp,min,max,r)
if Duel.IsPlayerAffectedByEffect(0,id) then
local og=oc:GetOverlayGroup()
og=og:Select(sp,min,max,nil)
local e=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_EFFECT)
local ct=Duel.SendtoGrave(og,r)
if ct>0 and e then Duel.RaiseSingleEvent(oc,EVENT_DETACH_MATERIAL,e,0,0,0,0) end
return ct
else
return _CRemoveOverlayCard(oc,sp,min,max,r)
end
end
function Group.FilterSelect(g,sp,f,min,max,nc,...)
if Duel.IsPlayerAffectedByEffect(0,id) then
local fg=s.filter(g,f,nc,...)
return fg:Select(sp,min,max,nc)
else
return _FilterSelect(g,sp,f,min,max,nc,...)
end
end
function Group.Select(g,sp,min,max,nc)
if Duel.IsPlayerAffectedByEffect(0,id) then
local ng=g:Clone()
if aux.GetValueType(nc)=="Card" then ng:RemoveCard(nc) end
if aux.GetValueType(nc)=="Group" then ng:Sub(nc) end
Duel.Hint(HINT_CARD,0,id)
--local ct=Duel.GetFlagEffectLabel(sp,m)
--Duel.SetFlagEffectLabel(sp,m,ct+1)
s[sp]=s[sp]+1
return ng:RandomSelect(sp,s.roll(min,max))
else
return _Select(g,sp,min,max,nc)
end
end
local _SpecialSummonStep=Duel.SpecialSummonStep
local _SpecialSummon=Duel.SpecialSummon
local _Summon=Duel.Summon
local _MSet=Duel.MSet
local _SelectDisableField=Duel.SelectDisableField
function Duel.SpecialSummonStep(c,sumt,sump,tp,noc,nol,pos,zone)
if Duel.IsPlayerAffectedByEffect(0,id) then
local zonet={0x01,0x02,0x04,0x08,0x10,0x20,0x40}
if not c:IsLocation(LOCATION_EXTRA) then zonet={0x01,0x02,0x04,0x08,0x10} end
local zoneToRemove = {}
if zone==nil then
zone=0x7f
end
for i,v in pairs(zonet) do
if not Duel.CheckLocation(tp,LOCATION_MZONE,math.log(v,2)) or v|zone ==0 then
table.insert(zoneToRemove,i)
end
end
for i = #zoneToRemove,1,-1 do
table.remove(zonet,zoneToRemove[i])
end
zone=zonet[s.roll(1,#zonet)]
end
if zone then return _SpecialSummonStep(tg,sumt,sump,tp,noc,nol,pos,zone) else return _SpecialSummonStep(tg,sumt,sump,tp,noc,nol,pos) end
end
function Duel.SpecialSummon(tg,sumt,sump,tp,noc,nol,pos,zone)
if Duel.IsPlayerAffectedByEffect(0,id) then
local num=0
if aux.GetValueType(tg)=="Card" then
if Duel.SpecialSummonStep(tg,sumt,sump,tp,noc,nol,pos,zone) then
num=1
end
Duel.SpecialSummonComplete()
return num
end
if aux.GetValueType(tg)=="Group" then
for tc in aux.Next(tg) do
if Duel.SpecialSummonStep(tc,sumt,sump,tp,noc,nol,pos,zone) then
num=num+1
end
end
Duel.SpecialSummonComplete()
end
return num
else
if zone then return _SpecialSummon(tg,sumt,sump,tp,noc,nol,pos,zone) else return _SpecialSummon(tg,sumt,sump,tp,noc,nol,pos) end
end
end
function Duel.Summon(tp,c,ign,se,min,zone)
if Duel.IsPlayerAffectedByEffect(0,id) then
local zonet={0x01,0x02,0x04,0x08,0x10}
local zoneToRemove = {}
if zone==nil then
zone=0x1f
end
for i,v in pairs(zonet) do
if not (Duel.CheckLocation(tp,LOCATION_MZONE,math.log(v,2)) or Duel.CheckTribute(c,1,nil,nil,nil,v) and c:IsSummonable(ign,se,1,v)) or v|zone ==0 then
table.insert(zoneToRemove,i)
end
end
for i = #zoneToRemove,1,-1 do
table.remove(zonet,zoneToRemove[i])
end
zone=zonet[s.roll(1,#zonet)]
end
if min and zone then
_Summon(tp,c,ign,se,min,zone)
else if min then
_Summon(tp,c,ign,se,min)
else
_Summon(tp,c,ign,se)
end
end
end
function Duel.MSet(tp,c,ign,e,min,zone)
if Duel.IsPlayerAffectedByEffect(0,id) then
local zonet={0x01,0x02,0x04,0x08,0x10}
local zoneToRemove = {}
if zone==nil then
zone=0x1f
end
for i,v in pairs(zonet) do
if not (Duel.CheckLocation(tp,LOCATION_MZONE,math.log(v,2)) or Duel.CheckTribute(c,1,nil,nil,nil,v) and c:IsMSetable(ign,se,1,v)) or v|zone ==0 then
table.insert(zoneToRemove,i)
end
end
for i = #zoneToRemove,1,-1 do
table.remove(zonet,zoneToRemove[i])
end
zone=zonet[s.roll(1,#zonet)]
end
if min and zone then
_MSet(tp,c,ign,se,min,zone)
else if min then
_MSet(tp,c,ign,se,min)
else
_MSet(tp,c,ign,se)
end
end
end
function Duel.SelectDisableField(tp,count,s,o,filter)
if Duel.IsPlayerAffectedByEffect(0,id) then
else
return _SelectDisableField(tp,count,s,o,filter)
end
end
local _AnnounceAttribute=Duel.AnnounceAttribute
local _AnnounceCoin=Duel.AnnounceCoin
local _AnnounceLevel=Duel.AnnounceLevel
local _AnnounceNumber=Duel.AnnounceNumber
local _AnnounceRace=Duel.AnnounceRace
local _AnnounceType=Duel.AnnounceType
function Duel.AnnounceAttribute(p,count,att)
if Duel.IsPlayerAffectedByEffect(0,id) then
local attt={0x01,0x02,0x04,0x08,0x10,0x20,0x40}
local AttToRemove={}
for i,v in pairs(attt) do
if v|att ==0 then
table.insert(AttToRemove,i)
end
end
for i = #AttToRemove,1,-1 do
table.remove(attt,AttToRemove[i])
end
local catt=0
if count>#attt then return end
for i=1,count do
local k=s.roll(1,#attt)
catt=catt+attt[k]
table.remove(attt,k)
end
Duel.Hint(HINT_ATTRIB,1,catt)
Duel.Hint(HINT_ATTRIB,0,catt)
return catt
else
_AnnounceAttribute(p,count,att)
end
end
function Duel.AnnounceCoin(p,...)
if Duel.IsPlayerAffectedByEffect(0,id) then
local i =s.roll(0,1)
Duel.Hint(HINT_OPSELECTED,1,aux.Stringid(id,i+4))
Duel.Hint(HINT_OPSELECTED,0,aux.Stringid(id,i+4))
return i
else
_AnnounceCoin(p,...)
end
end
function Duel.AnnounceLevel(p,min,max,...)
if Duel.IsPlayerAffectedByEffect(0,id) then
if min==nil then min=1 end
if max==nil then max=12 end
local lvnum = {}
for v=min,max do
for i=1,select("#",...) do
local val = select(i,...)
if v==val then
break
end
end
table.insert(lvnum,v)
end
local clv=lvnum[s.roll(1,#lvnum)]
Duel.Hint(HINT_NUMBER,1,clv)
Duel.Hint(HINT_NUMBER,0,clv)
return clv
else
if min and max then
_AnnounceLevel(p,min,max,...)
else if min then _AnnounceLevel(p,min)
else _AnnounceLevel(p) end end
end
end
function Duel.AnnounceNumber(p,...)
if Duel.IsPlayerAffectedByEffect(0,id) then
local numt = {...}
local cno = math.random(select("#", ...))
Duel.Hint(HINT_NUMBER,1,numt[cno])
Duel.Hint(HINT_NUMBER,0,numt[cno])
return numt[cno],cno
else
_AnnounceNumber(p,...)
end
end
function Duel.AnnounceRace(p,count,ra)
if Duel.IsPlayerAffectedByEffect(0,id) then
local rat={0x1,0x2,0x4,0x8,0x10,0x20,0x40,0x80,0x100,0x200,0x400,0x800,0x1000,0x2000,0x4000,0x8000,0x10000,0x20000,0x40000,0x80000,0x100000,0x200000,0x400000,0x800000,0x100000,0x200000}
local raToRemove={}
for i,v in pairs(rat) do
if v|ra ==0 then
table.insert(raToRemove,i)
end
end
for i = #raToRemove,1,-1 do
table.remove(rat,raToRemove[i])
end
local cra=0
if count>#rat then return end
for i=1,count do
local k=s.roll(1,#rat)
cra=cra+rat[k]
table.remove(rat,k)
end
Duel.Hint(HINT_RACE,1,cra)
Duel.Hint(HINT_RACE,0,cra)
return cra
else
_AnnounceRace(p,count,ra)
end
end
function Duel.AnnounceType(p,...)
if Duel.IsPlayerAffectedByEffect(0,id) then
local i=s.roll(0,2)
Duel.Hint(HINT_OPSELECTED,1,aux.Stringid(id,i+1))
Duel.Hint(HINT_OPSELECTED,0,aux.Stringid(id,i+1))
return i
else
_AnnounceType(p,...)
end
end
end
end
local Fusg={{},{}}
local A=1103515245
local B=12345
local M=32767
function s.roll(min,max)
min=tonumber(min)
max=tonumber(max)
s.r=((s.r*A+B)%M)/M
if min~=nil then
if max==nil then
return math.floor(s.r*min)+1
else
max=max-min+1
return math.floor(s.r*max+min)
end
end
return s.r
end
function s.filter(g,f,nc,...)
if aux.GetValueType(f)=="function" then return g:Filter(f,nc,...) end
local ng=g:Clone()
if aux.GetValueType(nc)=="Card" then ng:RemoveCard(nc) end
if aux.GetValueType(nc)=="Group" then ng:Sub(nc) end
return ng
end
function s.ffilter(c,fc,sub,mg,sg)
if not sg then return true end
return not sg:IsExists(Card.IsFusionCode,1,c,c:GetFusionCode())
end
function s.matlimit(e,c,fc,st)
if st~=SUMMON_TYPE_FUSION then return true end
local code=c:GetFusionCode()
local ftable=Fusg[e:GetHandler():GetOwner()+1]
for i=1,6 do
if ftable[i]==code then return true end
end
return false
end
function s.fuop(e,tp,eg,ep,ev,re,r,rp)
if not s.r then
local result=0
local g=Duel.GetFieldGroup(0,0xff,0xff):RandomSelect(2,8)
local ct={}
local c=g:GetFirst()
for i=0,7 do
ct[c]=i
c=g:GetNext()
end
for i=0,10 do
result=result+(ct[g:RandomSelect(2,1):GetFirst()]<<(3*i))
end
g:DeleteGroup()
s.r=result&0xffffffff
end
for p=0,1 do
if Duel.IsExistingMatchingCard(Card.IsOriginalCodeRule,p,LOCATION_EXTRA,0,1,nil,id) then
local g1=Duel.GetFieldGroup(p,LOCATION_DECK+LOCATION_HAND,0):Filter(Card.IsType,nil,TYPE_MONSTER)
if g1:GetClassCount(Card.GetCode)<6 then return end
local fg=Group.CreateGroup()
local tc=g1:GetFirst()
while tc and fg:GetCount()<6 do
g1:RemoveCard(tc)
if fg:Filter(Card.IsCode,nil,tc:GetCode()):GetCount()==0 then fg:AddCard(Duel.CreateToken(p,tc:GetCode())) end
tc=g1:RandomSelect(p,1):GetFirst()
end
if fg:GetCount()==6 then
local cc=fg:GetFirst()
for i=1,6 do
Fusg[p+1][i]=cc:GetCode()
cc=fg:GetNext()
end
Duel.ConfirmCards(p,fg)
end
end
end
end
function s.valcheck(e,c)
local mg=c:GetMaterial()
local tc=mg:GetFirst()
local atk=0
local def=0
while tc do
if tc:GetTextAttack()>0 then atk=atk+tc:GetTextAttack() end
if tc:GetTextDefense()>0 then def=def+tc:GetTextDefense() end
local re1=Effect.CreateEffect(c)
re1:SetType(EFFECT_TYPE_SINGLE)
re1:SetCode(EFFECT_ADD_RACE)
re1:SetValue(tc:GetRace())
re1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
c:RegisterEffect(re1)
local re2=re1:Clone()
re2:SetCode(EFFECT_ADD_ATTRIBUTE)
re2:SetValue(tc:GetAttribute())
c:RegisterEffect(re2)
tc=mg:GetNext()
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE)
e2:SetValue(def)
c:RegisterEffect(e2)
end
function s.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local num = s.roll(1,12)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(num)
c:RegisterEffect(e1)
end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(0,id)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,id)
local ac=Duel.GetAttacker()
local tc=Duel.SelectMatchingCard(ac:GetControler(),nil,ac:GetControler(),0,LOCATION_MZONE,1,1,nil):GetFirst()
if not Duel.GetAttacker():IsImmuneToEffect(e) then
Duel.ChangeAttackTarget(tc)
end
end
--奥西里斯的万雷牢
function c11579800.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_STANDBY_PHASE)
c:RegisterEffect(e1)
--
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(c11579800.xxcon1)
e1:SetTarget(c11579800.xxtg1)
e1:SetOperation(c11579800.xxop1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(c11579800.xxcon2)
e1:SetTarget(c11579800.xxtg2)
e1:SetOperation(c11579800.xxop2)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c11579800.xxcon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(function(c) return c:IsFaceup() and c:IsCode(10000020) end,tp,LOCATION_MZONE,0,1,nil) and eg:IsExists(Card.IsSummonPlayer,1,nil,1-tp)
end
function c11579800.xckfil1(c,tp)
return c:IsFaceup() and c:IsAttackPos() and c:IsSummonPlayer(1-tp)
end
function c11579800.xxtg1(e,tp,eg,ep,ev,re,r,rp,chk)
local g=eg:Filter(c11579800.xckfil1,nil,tp)
if chk==0 then return true end
Duel.SetTargetCard(g)
end
function c11579800.xxop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local dg=Group.CreateGroup()
local c=e:GetHandler()
local tc=g:GetFirst()
while tc do
local preatk=tc:GetAttack()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-2000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
if preatk~=0 and tc:IsAttack(0) then dg:AddCard(tc) end
tc=g:GetNext()
end
Duel.Destroy(dg,REASON_EFFECT)
end
function c11579800.xxcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(function(c) return c:IsFaceup() and c:IsCode(10000020) end,tp,LOCATION_MZONE,0,1,nil) and eg:IsExists(Card.IsSummonPlayer,1,nil,1-tp)
end
function c11579800.xckfil2(c,tp)
return c:IsFaceup() and c:IsDefensePos() and c:IsSummonPlayer(1-tp)
end
function c11579800.xxtg2(e,tp,eg,ep,ev,re,r,rp,chk)
local g=eg:Filter(c11579800.xckfil2,nil,tp)
if chk==0 then return true end
Duel.SetTargetCard(g)
end
function c11579800.xxop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local dg=Group.CreateGroup()
local c=e:GetHandler()
local tc=g:GetFirst()
while tc do
local predef=tc:GetDefense()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetValue(-2000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
if predef~=0 and tc:IsDefense(0) then dg:AddCard(tc) end
tc=g:GetNext()
end
Duel.Destroy(dg,REASON_EFFECT)
end
--クラリアの蟲惑魔
function c11601001.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_INSECT+RACE_PLANT),2,2)
c:EnableReviveLimit()
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c11601001.imcon)
e1:SetValue(c11601001.efilter)
c:RegisterEffect(e1)
--set instead of send to grave
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVED)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c11601001.setcon)
e2:SetOperation(c11601001.setop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(11601001,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,11601001)
e3:SetCondition(c11601001.spcon)
e3:SetTarget(c11601001.sptg)
e3:SetOperation(c11601001.spop)
c:RegisterEffect(e3)
end
function c11601001.imcon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c11601001.efilter(e,te)
return te:IsActiveType(TYPE_TRAP)
end
function c11601001.setcon(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
return Duel.GetFlagEffect(tp,11601001)==0 and rp==tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_TRAP)
and rc:GetType()==TYPE_TRAP and rc:IsRelateToEffect(re) and rc:IsCanTurnSet() and rc:IsStatus(STATUS_LEAVE_CONFIRMED) and rc:IsSetCard(0x4c,0x89)
end
function c11601001.setop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if Duel.SelectEffectYesNo(tp,rc,aux.Stringid(11601001,1)) then
rc:CancelToGrave()
Duel.ChangePosition(rc,POS_FACEDOWN)
Duel.RaiseEvent(rc,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
Duel.RegisterFlagEffect(tp,11601001,RESET_PHASE+PHASE_END,0,0)
end
end
function c11601001.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c11601001.spfilter(c,e,tp)
return c:IsSetCard(0x108a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c11601001.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c11601001.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c11601001.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c11601001.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c11601001.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
--シトリスの蟲惑魔
local s,id,o=GetID()
function s.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,4,2)
c:EnableReviveLimit()
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetCondition(s.imcon)
e1:SetValue(s.efilter)
c:RegisterEffect(e1)
--Search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id)
e2:SetCost(s.thcost)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
--material
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_CUSTOM+id)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,id+o)
e3:SetTarget(s.mttg)
e3:SetOperation(s.mtop)
c:RegisterEffect(e3)
local g=Group.CreateGroup()
aux.RegisterMergedDelayedEvent(c,id,EVENT_TO_GRAVE,g)
aux.RegisterMergedDelayedEvent(c,id,EVENT_REMOVE,g)
end
function s.imcon(e)
local c=e:GetHandler()
return c:GetOverlayCount()>0
end
function s.efilter(e,re)
if re:IsActiveType(TYPE_TRAP) then return true end
local g=e:GetHandler():GetOverlayGroup():Filter(Card.IsType,nil,TYPE_MONSTER)
local race=0
for tc in aux.Next(g) do
race=race|tc:GetOriginalRace()
end
local rc=re:GetHandler()
return re:GetOwner()~=e:GetOwner() and race~=0
and rc:IsRace(race) and re:IsActivated()
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function s.thfilter(c)
return c:IsSetCard(0x108a) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.cfilter(c,tp)
return not c:IsType(TYPE_TOKEN) and c:IsType(TYPE_MONSTER)
and c:GetOwner()==1-tp and c:IsReason(REASON_EFFECT)
and c:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED)
and c:IsFaceupEx() and c:IsCanOverlay()
end
function s.mttg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=eg:Filter(s.cfilter,nil,tp)
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) and #g>0 end
Duel.SetTargetCard(g)
end
function s.mtop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=eg:Filter(s.cfilter,nil,tp)
local mg=g:Filter(aux.NecroValleyFilter(Card.IsRelateToChain),nil)
if #mg>0 and c:IsRelateToChain() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local og=mg:Select(tp,1,1,nil)
Duel.Overlay(c,og)
end
end
--フレシアの蟲惑魔
function c11601003.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,4,2)
c:EnableReviveLimit()
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetCondition(c11601003.imcon)
e1:SetValue(c11601003.efilter)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c11601003.imtg)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e3)
--cannot be target
local e4=e3:Clone()
e4:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e4:SetValue(aux.tgoval)
c:RegisterEffect(e4)
--copy trap
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(11601003,0))
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetRange(LOCATION_MZONE)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetHintTiming(0x3c0)
e5:SetCountLimit(1)
e5:SetCost(c11601003.cost)
e5:SetTarget(c11601003.target)
e5:SetOperation(c11601003.operation)
c:RegisterEffect(e5)
end
function c11601003.imcon(e)
return e:GetHandler():GetOverlayCount()>0
end
function c11601003.efilter(e,te)
return te:IsActiveType(TYPE_TRAP)
end
function c11601003.imtg(e,c)
return c:IsSetCard(0x108a) and not c:IsCode(11601003,6511113)
end
function c11601003.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c11601003.filter(c)
return c:GetType()==TYPE_TRAP and c:IsSetCard(0x4c,0x89) and c:IsAbleToGraveAsCost()
and c:CheckActivateEffect(false,true,false)~=nil
end
function c11601003.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST)
and Duel.IsExistingMatchingCard(c11601003.filter,tp,LOCATION_DECK,0,1,nil)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c11601003.filter,tp,LOCATION_DECK,0,1,1,nil)
local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(false,true,true)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
Duel.SendtoGrave(g,REASON_COST)
e:SetProperty(te:GetProperty())
local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
Duel.ClearOperationInfo(0)
end
function c11601003.operation(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if not te then return end
e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
--カズーラの蟲惑魔
function c11601004.initial_effect(c)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(c11601004.efilter)
c:RegisterEffect(e1)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(11601004,0))
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,11601004)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c11601004.spcon)
e3:SetTarget(c11601004.sptg)
e3:SetOperation(c11601004.spop)
c:RegisterEffect(e3)
end
function c11601004.efilter(e,te)
local c=te:GetHandler()
return c:GetType()==TYPE_TRAP and c:IsSetCard(0x4c,0x89)
end
function c11601004.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=re:GetHandler()
return rp==tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and c:GetType()==TYPE_TRAP and c:IsSetCard(0x4c,0x89)
end
function c11601004.filter(c,e,tp,ft)
return c:IsSetCard(0x108a) and not c:IsCode(11601004) and c:IsType(TYPE_MONSTER) and (c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
end
function c11601004.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return Duel.IsExistingMatchingCard(c11601004.filter,tp,LOCATION_DECK,0,1,nil,e,tp,ft) end
end
function c11601004.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,c11601004.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp,ft)
local tc=g:GetFirst()
if tc then
if ft>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and (not tc:IsAbleToHand() or Duel.SelectOption(tp,1190,1152)==1) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
else
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
end
--ジーナの蟲惑魔
function c11601005.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11601005,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,11601005)
e1:SetCost(c11601005.spcost)
e1:SetTarget(c11601005.sptg)
e1:SetOperation(c11601005.spop)
c:RegisterEffect(e1)
--immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetValue(c11601005.efilter)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(11601005,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,11601005)
e3:SetCondition(c11601005.setcon)
e3:SetCost(aux.bfgcost)
e3:SetTarget(c11601005.settg)
e3:SetOperation(c11601005.setop)
c:RegisterEffect(e3)
end
function c11601005.costfilter(c)
return c:IsFacedown() and c:IsType(TYPE_TRAP) and c:IsAbleToGraveAsCost()
end
function c11601005.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11601005.costfilter,tp,LOCATION_SZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c11601005.costfilter,tp,LOCATION_SZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c11601005.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c11601005.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c11601005.efilter(e,te)
local c=te:GetHandler()
return c:GetType()==TYPE_TRAP and c:IsSetCard(0x4c,0x89)
end
function c11601005.confilter(c)
return c:GetSequence()<5
end
function c11601005.setcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(c11601005.confilter,tp,LOCATION_SZONE,0,nil)==0
end
function c11601005.setfilter(c)
return c:GetType()==TYPE_TRAP and c:IsSetCard(0x4c,0x89) and c:IsSSetable()
end
function c11601005.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c11601005.setfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c11601005.setfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectTarget(tp,c11601005.setfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
function c11601005.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SSet(tp,tc)
end
end
--ティオの蟲惑魔
function c11601006.initial_effect(c)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(c11601006.efilter)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(11601006,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(c11601006.sptg)
e2:SetOperation(c11601006.spop)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(11601006,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCountLimit(1,11601006)
e3:SetTarget(c11601006.settg)
e3:SetOperation(c11601006.setop)
c:RegisterEffect(e3)
end
function c11601006.efilter(e,te)
local c=te:GetHandler()
return c:GetType()==TYPE_TRAP and c:IsSetCard(0x4c,0x89)
end
function c11601006.filter(c,e,tp)
return c:IsSetCard(0x108a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c11601006.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c11601006.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c11601006.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c11601006.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c11601006.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
function c11601006.setfilter(c)
return c:GetType()==TYPE_TRAP and c:IsSetCard(0x4c,0x89) and c:IsSSetable()
end
function c11601006.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c11601006.setfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c11601006.setfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectTarget(tp,c11601006.setfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
function c11601006.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SSet(tp,tc)~=0 then
local fid=e:GetHandler():GetFieldID()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
if Duel.GetTurnPlayer()==tp then
e1:SetLabel(Duel.GetTurnCount())
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,2)
else
e1:SetLabel(0)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN)
end
e1:SetLabelObject(tc)
e1:SetValue(fid)
e1:SetCondition(c11601006.rmcon)
e1:SetOperation(c11601006.rmop)
Duel.RegisterEffect(e1,tp)
tc:RegisterFlagEffect(11601006,RESET_EVENT+RESETS_STANDARD,0,1,fid)
end
end
function c11601006.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetLabel() and Duel.GetTurnPlayer()==tp
end
function c11601006.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(11601006)==e:GetValue() then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
--アティプスの蟲惑魔
local s,id,o=GetID()
function s.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,3,s.lcheck)
c:EnableReviveLimit()
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(s.imcon)
e1:SetValue(s.efilter)
c:RegisterEffect(e1)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetCondition(s.atkcon)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x108a))
e2:SetValue(1000)
c:RegisterEffect(e2)
--disable
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetCategory(CATEGORY_DISABLE+CATEGORY_REMOVE+CATEGORY_DESTROY+CATEGORY_GRAVE_ACTION)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(s.distg)
e3:SetOperation(s.disop)
c:RegisterEffect(e3)
end
function s.lcheck(g)
return g:IsExists(Card.IsLinkRace,1,nil,RACE_INSECT+RACE_PLANT)
end
function s.imcon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function s.efilter(e,te)
return te:IsActiveType(TYPE_TRAP)
end
function s.cfilter(c)
return c:GetType()==TYPE_TRAP
end
function s.atkcon(e)
return Duel.IsExistingMatchingCard(s.cfilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,1,nil)
end
function s.filter(c)
return c:IsFaceup() and c:IsRace(RACE_INSECT+RACE_PLANT)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ct=Duel.GetMatchingGroupCount(s.filter,tp,LOCATION_MZONE,0,nil)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and aux.NegateAnyFilter(chkc) end
if chk==0 then return ct>0 and Duel.IsExistingTarget(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectTarget(tp,aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,#g,0,0)
end
function s.rmfilter(c)
return c:GetType()==TYPE_TRAP and c:IsAbleToRemove()
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetTargetsRelateToChain():Filter(Card.IsFaceup,nil)
if #g==0 then return end
local tc=g:GetFirst()
while tc do
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
tc=g:GetNext()
end
Duel.AdjustInstantly(c)
if Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.rmfilter),tp,LOCATION_GRAVE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.rmfilter),tp,LOCATION_GRAVE,0,1,1,nil)
local tg=g:Filter(Card.IsFaceup,nil)
if #rg>0 and #tg>0 and Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=tg:Select(tp,1,1,nil)
Duel.HintSelection(sg)
Duel.Destroy(sg,REASON_EFFECT)
end
end
end
--プティカの蟲惑魔
local s,id,o=GetID()
function s.initial_effect(c)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(s.efilter)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,id)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
--remove
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,id+o)
e3:SetTarget(s.rmtg)
e3:SetOperation(s.rmop)
c:RegisterEffect(e3)
end
function s.efilter(e,te)
local c=te:GetHandler()
return c:GetType()==TYPE_TRAP and c:IsSetCard(0x4c,0x89)
end
function s.thfilter(c)
return c:IsCode(12801833) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.rmfilter(c)
return c:IsSummonType(SUMMON_TYPE_SPECIAL) and c:IsAbleToRemove()
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and s.rmfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.rmfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,s.rmfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetCondition(s.spcon)
e1:SetOperation(s.spop)
if Duel.GetCurrentPhase()==PHASE_STANDBY then
e1:SetLabel(Duel.GetTurnCount())
e1:SetReset(RESET_PHASE+PHASE_STANDBY,2)
else
e1:SetLabel(0)
e1:SetReset(RESET_PHASE+PHASE_STANDBY)
end
Duel.RegisterEffect(e1,1-tp)
end
function s.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetLabel() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,id)
if Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--アトラの蟲惑魔
function c11601009.initial_effect(c)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(c11601009.efilter)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_HAND,0)
e2:SetTarget(c11601009.etarget)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_INACTIVATE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(c11601009.chainfilter)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_DISEFFECT)
e4:SetRange(LOCATION_MZONE)
e4:SetValue(c11601009.chainfilter)
c:RegisterEffect(e4)
end
function c11601009.efilter(e,te)
local c=te:GetHandler()
return c:GetType()==TYPE_TRAP and c:IsSetCard(0x4c,0x89)
end
function c11601009.etarget(e,c)
return c:GetType()==TYPE_TRAP and c:IsSetCard(0x4c,0x89)
end
function c11601009.chainfilter(e,ct)
local p=e:GetHandlerPlayer()
local te,tp=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
return p==tp and te:IsHasType(EFFECT_TYPE_ACTIVATE) and te:GetActiveType()==TYPE_TRAP
end
--アロメルスの蟲惑魔
function c11601010.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,4,2,nil,nil,99)
c:EnableReviveLimit()
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetCondition(c11601010.imcon)
e1:SetValue(c11601010.efilter)
c:RegisterEffect(e1)
--spsummon1
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(11601010,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,11601010)
e2:SetCost(c11601010.spcost1)
e2:SetTarget(c11601010.sptg1)
e2:SetOperation(c11601010.spop1)
c:RegisterEffect(e2)
--spsummon2
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(11601010,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_CUSTOM+11601010)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,59071625)
e3:SetCondition(c11601010.spcon2)
e3:SetCost(c11601010.spcost2)
e3:SetTarget(c11601010.sptg2)
e3:SetOperation(c11601010.spop2)
c:RegisterEffect(e3)
local g=Group.CreateGroup()
aux.RegisterMergedDelayedEvent(c,11601010,EVENT_TO_GRAVE,g)
aux.RegisterMergedDelayedEvent(c,11601010,EVENT_REMOVE,g)
end
function c11601010.imcon(e)
return e:GetHandler():GetOverlayCount()>0
end
function c11601010.efilter(e,te)
return te:IsActiveType(TYPE_TRAP)
end
function c11601010.spcost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end
function c11601010.spfilter1(c,e,tp)
return c:IsLevel(4) and c:IsRace(RACE_INSECT+RACE_PLANT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c11601010.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c11601010.spfilter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c11601010.spop1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c11601010.spfilter1),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c11601010.cfilter(c,tp)
return c:IsPreviousLocation(LOCATION_MZONE)
and (c:IsLocation(LOCATION_GRAVE) or (c:IsLocation(LOCATION_REMOVED) and c:IsFaceup()))
and c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==tp and c:IsPreviousControler(1-tp)
end
function c11601010.spcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c11601010.cfilter,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function c11601010.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c11601010.spfilter2(c,e,tp,g)
return g:IsContains(c) and c11601010.cfilter(c,tp)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c11601010.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and c11601010.spfilter2(chkc,e,tp,eg) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c11601010.spfilter2,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,1,nil,e,tp,eg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c11601010.spfilter2,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,1,1,nil,e,tp,eg)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c11601010.spop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--セラの蟲惑魔
function c11601011.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,c11601011.matfilter,1,1)
c:EnableReviveLimit()
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c11601011.imcon)
e1:SetValue(c11601011.efilter)
c:RegisterEffect(e1)
--
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(11601011,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,11601011)
e3:SetCondition(c11601011.spcon)
e3:SetTarget(c11601011.sptg)
e3:SetOperation(c11601011.spop)
c:RegisterEffect(e3)
--set
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(11601011,1))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,73639100)
e4:SetCondition(c11601011.setcon)
e4:SetTarget(c11601011.settg)
e4:SetOperation(c11601011.setop)
c:RegisterEffect(e4)
end
function c11601011.matfilter(c)
return c:IsLinkSetCard(0x108a) and not c:IsLinkType(TYPE_LINK)
end
function c11601011.imcon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c11601011.efilter(e,te)
return te:IsActiveType(TYPE_TRAP)
end
function c11601011.spcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():GetType()==TYPE_TRAP
end
function c11601011.cfilter(c,code)
return c:IsFaceup() and c:IsCode(code)
end
function c11601011.spfilter(c,e,tp)
return c:IsSetCard(0x108a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and not Duel.IsExistingMatchingCard(c11601011.cfilter,tp,LOCATION_ONFIELD,0,1,nil,c:GetCode())
end
function c11601011.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c11601011.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c11601011.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,c11601011.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c11601011.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
return re:IsActiveType(TYPE_MONSTER) and rc~=c and rc:IsSetCard(0x108a) and rc:IsControler(tp)
end
function c11601011.setfilter(c)
return c:IsSetCard(0x4c,0x89) and c:GetType()==TYPE_TRAP and c:IsSSetable()
end
function c11601011.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11601011.setfilter,tp,LOCATION_DECK,0,1,nil) end
end
function c11601011.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c11601011.setfilter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.SSet(tp,tc)
end
end
--キノの蟲惑魔
local s,id,o=GetID()
function s.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetValue(s.efilter)
c:RegisterEffect(e2)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_SZONE,0)
e3:SetTarget(s.indtg)
e3:SetValue(s.indct)
c:RegisterEffect(e3)
end
function s.cfilter(c)
return c:IsSetCard(0x108a) and c:IsFaceup()
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) then return false end
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.splimit(e,c)
return not c:IsRace(RACE_INSECT+RACE_PLANT) and c:IsLocation(LOCATION_EXTRA)
end
function s.efilter(e,te)
local c=te:GetHandler()
return c:GetType()==TYPE_TRAP and c:IsSetCard(0x4c,0x89)
end
function s.indtg(e,c)
return c:IsFacedown() and c:GetSequence()<5
end
function s.indct(e,re,r,rp)
if bit.band(r,REASON_EFFECT)~=0 then
return 1
else return 0 end
end
--ランカの蟲惑魔
function c11601013.initial_effect(c)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(c11601013.efilter)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(11601013,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetTarget(c11601013.thtg)
e2:SetOperation(c11601013.thop)
c:RegisterEffect(e2)
--return
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(11601013,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1)
e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetTarget(c11601013.rettg)
e3:SetOperation(c11601013.retop)
c:RegisterEffect(e3)
end
function c11601013.efilter(e,te)
local c=te:GetHandler()
return c:GetType()==TYPE_TRAP and c:IsSetCard(0x4c,0x89)
end
function c11601013.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x108a) and c:IsAbleToHand()
end
function c11601013.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11601013.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c11601013.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c11601013.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c11601013.retfilter(c)
return c:IsFacedown() and c:IsAbleToHand()
end
function c11601013.rettg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and c11601013.retfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c11601013.retfilter,tp,LOCATION_SZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c11601013.retfilter,tp,LOCATION_SZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c11601013.retop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFacedown()
and Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_HAND) then
local g=Duel.GetMatchingGroup(Card.IsSSetable,tp,LOCATION_HAND,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(11601013,2)) then
Duel.ShuffleHand(tp)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=g:Select(tp,1,1,nil)
Duel.SSet(tp,sg,tp,false)
end
end
end
--リセの蟲惑魔
function c11601014.initial_effect(c)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c11601014.efilter)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_LEAVE_GRAVE)
e2:SetDescription(aux.Stringid(11601014,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,11601014)
e2:SetCost(c11601014.setcost)
e2:SetTarget(c11601014.settg)
e2:SetOperation(c11601014.setop)
c:RegisterEffect(e2)
end
function c11601014.efilter(e,te)
local c=te:GetHandler()
return c:GetType()==TYPE_TRAP and c:IsSetCard(0x4c,0x89)
end
function c11601014.setfilter(c)
return c:IsSetCard(0x4c,0x89) and c:GetType()==TYPE_TRAP and c:IsSSetable()
end
function c11601014.fselect(g)
return g:GetClassCount(Card.GetLocation)==g:GetCount() and aux.dncheck(g)
end
function c11601014.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c11601014.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c11601014.setfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>=2 and g:CheckSubGroup(c11601014.fselect,2,2) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,0)
end
function c11601014.setop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<2 then return end
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c11601014.setfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=g:SelectSubGroup(tp,c11601014.fselect,false,2,2)
if sg and #sg==2 then
if Duel.SSet(tp,sg)==0 then return end
local tc=sg:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
tc:RegisterEffect(e1)
tc=sg:GetNext()
end
end
end
--トリオンの蟲惑魔
function c11601015.initial_effect(c)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(c11601015.efilter)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(11601015,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetTarget(c11601015.thtg)
e2:SetOperation(c11601015.thop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(11601015,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetTarget(c11601015.destg)
e3:SetOperation(c11601015.desop)
c:RegisterEffect(e3)
end
function c11601015.efilter(e,te)
local c=te:GetHandler()
return c:GetType()==TYPE_TRAP and c:IsSetCard(0x4c,0x89)
end
function c11601015.filter(c)
return c:GetType()==TYPE_TRAP and c:IsSetCard(0x4c,0x89) and c:IsAbleToHand()
end
function c11601015.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11601015.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c11601015.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c11601015.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c11601015.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c11601015.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and c11601015.desfilter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c11601015.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c11601015.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--隐匿虫 蟑螂
local m=11626300
local cm=_G["c"..m]
function c11626300.initial_effect(c)
--to deck
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,11626300)
e1:SetCondition(c11626300.htdcon)
e1:SetCost(c11626300.htdcost)
e1:SetTarget(c11626300.htdtg)
e1:SetOperation(c11626300.htdop)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_HAND)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(c11626300.descon)
e2:SetTarget(c11626300.destg)
e2:SetOperation(c11626300.desop)
c:RegisterEffect(e2)
--SpecialSummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(11626300,2))
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetTarget(c11626300.indtg)
e3:SetCondition(c11626300.indcon)
e3:SetOperation(c11626300.indop)
c:RegisterEffect(e3)
if not c11626300.global_check then
c11626300.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(c11626300.checkop)
Duel.RegisterEffect(ge1,0)
end
Duel.AddCustomActivityCounter(11626300,ACTIVITY_SPSUMMON,c11626300.counterfilter)
end
c11626300.SetCard_YM_Crypticinsect=true
function c11626300.checkop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if rc:IsType(TYPE_MONSTER) and not rc:IsRace(RACE_INSECT) then
Duel.RegisterFlagEffect(rp,11626300,RESET_PHASE+PHASE_END,0,1)
end
end
function c11626300.counterfilter(c)
return c:IsRace(RACE_INSECT)
end
--01
function c11626300.htdcon(e,tp,eg,ep,ev,re,r,rp)
local p=e:GetHandler():GetOwner()
return tp==p and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c11626300.htdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,11626300)==0 and Duel.GetCustomActivityCount(11626300,tp,ACTIVITY_SPSUMMON)==0 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(c11626300.actlimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e2:SetTargetRange(1,0)
e2:SetTarget(c11626300.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c11626300.actlimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not re:GetHandler():IsRace(RACE_INSECT)
end
function c11626300.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsRace(RACE_INSECT)
end
function c11626300.htdfil(c)
return c:IsAbleToDeck() and c.SetCard_YM_Crypticinsect and c:IsType(TYPE_MONSTER)
end
function c11626300.htdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
end
function c11626300.hsrfil(c)
return c.SetCard_YM_Crypticinsect and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c11626300.htdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if (not c:IsRelateToEffect(e)) or (not c:IsLocation(LOCATION_HAND)) then return end
Duel.SendtoDeck(c,1-tp,1,REASON_EFFECT)
if not c:IsLocation(LOCATION_DECK) then return end
Duel.ShuffleDeck(1-tp)
c:ReverseInDeck()
if Duel.IsExistingMatchingCard(c11626300.hsrfil,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(11626300,0)) then
Duel.BreakEffect()
local dg=Duel.SelectMatchingCard(tp,c11626300.hsrfil,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(dg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,dg)
--
if Duel.GetFlagEffect(tp,1111111)==0 then
Duel.RegisterFlagEffect(tp,1111111,0,0,0)
if not cm.gchk then
cm.gchk=true
cm[0]=3
cm[1]=3
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c11626300.hxspecon)
e1:SetOperation(c11626300.hxspeop)
Duel.RegisterEffect(e1,1-tp)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11626300,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(11626300)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,1-tp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(c11626300.damval)
Duel.RegisterEffect(e1,1-tp)
end
end
end
function c11626300.hxspecon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsSummonPlayer,1,nil,tp)
end
function c11626300.pbfil(c)
return not c:IsPublic() and c:IsAbleToDeck() and not c.SetCard_YM_Crypticinsect
end
function c11626300.hxspeop(e,tp,eg,ep,ev,re,r,rp)
if cm[rp]<=1 then
cm[rp]=3
local c=e:GetHandler()
if eg:IsExists(Card.IsSummonPlayer,1,nil,tp) then
Duel.Hint(HINT_CARD,0,11626300)
Duel.Draw(tp,1,REASON_EFFECT)
if Duel.IsExistingMatchingCard(c11626300.pbfil,tp,LOCATION_HAND,0,1,nil) and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>=8 then
local sg=Duel.GetMatchingGroup(c11626300.pbfil,tp,LOCATION_HAND,0,nil):RandomSelect(tp,1)
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoDeck(sg,nil,1,REASON_EFFECT)
end
end
else cm[rp]=cm[rp]-1 end
end
function c11626300.damval(e,re,val,r,rp)
if r&REASON_EFFECT~=0 and re then
local rc=re:GetHandler()
if not rc.SetCard_YM_Crypticinsect then
return 100
end
end
return val
end
--02
function c11626300.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_DECK) and e:GetHandler():IsPreviousPosition(POS_FACEUP)
end
function c11626300.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c11626300.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,1-tp,1-tp,false,false,POS_FACEUP)
Duel.Draw(tp,1,REASON_EFFECT)
else
Duel.Destroy(c,REASON_EFFECT)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--03
--mxph
function cm.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.indtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsOnField() and cm.desfilter(chkc) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.desfilter,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(cm.desfilter,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.indcon(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler().SetCard_YM_Crypticinsect -- and re:GetHandler():IsType(TYPE_MONSTER)
end
function cm.thfil(c)
return c.SetCard_YM_Crypticinsect and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.indop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,cm.desfilter,1-tp,LOCATION_ONFIELD,0,1,2,nil)
if Duel.Destroy(dg,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(cm.thfil,tp,LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfil,tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
\ No newline at end of file
--隐匿虫 木卫二画皮
local m=11626301
local cm=_G["c"..m]
function c11626301.initial_effect(c)
--to deck
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,11626301)
e1:SetCondition(c11626301.htdcon)
e1:SetCost(c11626301.htdcost)
e1:SetTarget(c11626301.htdtg)
e1:SetOperation(c11626301.htdop)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_HAND)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(c11626301.descon)
e2:SetTarget(c11626301.destg)
e2:SetOperation(c11626301.desop)
c:RegisterEffect(e2)
--SpecialSummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(11626301,2))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetTarget(c11626301.indtg)
e3:SetCondition(c11626301.indcon)
e3:SetOperation(c11626301.indop)
c:RegisterEffect(e3)
if not c11626301.global_check then
c11626301.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(c11626301.checkop)
Duel.RegisterEffect(ge1,0)
end
Duel.AddCustomActivityCounter(11626301,ACTIVITY_SPSUMMON,c11626301.counterfilter)
end
c11626301.SetCard_YM_Crypticinsect=true
function c11626301.checkop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if rc:IsType(TYPE_MONSTER) and not rc:IsRace(RACE_INSECT) then
Duel.RegisterFlagEffect(rp,11626301,RESET_PHASE+PHASE_END,0,1)
end
end
function c11626301.counterfilter(c)
return c:IsRace(RACE_INSECT)
end
--01
function c11626301.htdcon(e,tp,eg,ep,ev,re,r,rp)
local p=e:GetHandler():GetOwner()
return tp==p and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c11626301.htdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,11626301)==0 and Duel.GetCustomActivityCount(11626301,tp,ACTIVITY_SPSUMMON)==0 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(c11626301.actlimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e2:SetTargetRange(1,0)
e2:SetTarget(c11626301.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c11626301.actlimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not re:GetHandler():IsRace(RACE_INSECT)
end
function c11626301.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsRace(RACE_INSECT)
end
function c11626301.htdfil(c)
return c:IsAbleToDeck() and c.SetCard_YM_Crypticinsect and c:IsType(TYPE_MONSTER)
end
function c11626301.htdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,tp,LOCATION_HAND)
end
function c11626301.hsrfil(c)
return c.SetCard_YM_Crypticinsect and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c11626301.htdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if (not c:IsRelateToEffect(e)) or (not c:IsLocation(LOCATION_HAND)) then return end
Duel.SendtoDeck(c,1-tp,1,REASON_EFFECT)
if not c:IsLocation(LOCATION_DECK) then return end
Duel.ShuffleDeck(1-tp)
c:ReverseInDeck()
if Duel.IsExistingMatchingCard(c11626301.hsrfil,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(11626301,0)) then
Duel.BreakEffect()
local dg=Duel.SelectMatchingCard(tp,c11626301.hsrfil,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(dg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,dg)
--
if Duel.GetFlagEffect(tp,1111112)==0 then
Duel.RegisterFlagEffect(tp,1111112,0,0,0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c11626301.hxtgecon)
e1:SetOperation(c11626301.hxtgeop)
Duel.RegisterEffect(e1,1-tp)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11626301,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(11626301)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,1-tp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(c11626301.damval)
Duel.RegisterEffect(e1,1-tp)
end
end
end
function c11626301.hxtgecon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsControler,1,nil,tp) and Duel.GetCurrentPhase()~=PHASE_END --and not Duel.GetCurrentPhase()==PHASE_END
end
function c11626301.pbfil(c)
return not c:IsPublic() and c:IsAbleToDeck() and not c.SetCard_YM_Crypticinsect
end
function c11626301.hxtgeop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if eg:IsExists(Card.IsControler,1,nil,tp) then
Duel.Hint(HINT_CARD,0,11626301)
Duel.Draw(tp,1,REASON_EFFECT)
if Duel.IsExistingMatchingCard(c11626301.pbfil,tp,LOCATION_HAND,0,1,nil) and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>=8 then
local sg=Duel.GetMatchingGroup(c11626301.pbfil,tp,LOCATION_HAND,0,nil):RandomSelect(tp,1)
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoDeck(sg,nil,1,REASON_EFFECT)
end
end
end
function c11626301.damval(e,re,val,r,rp)
if r&REASON_EFFECT~=0 and re then
local rc=re:GetHandler()
if not rc.SetCard_YM_Crypticinsect then
return 100
end
end
return val
end
--02
function c11626301.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_DECK) and e:GetHandler():IsPreviousPosition(POS_FACEUP)
end
function c11626301.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c11626301.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,1-tp,1-tp,false,false,POS_FACEUP)
Duel.Draw(tp,1,REASON_EFFECT)
else
Duel.Destroy(c,REASON_EFFECT)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--03
--fex
function cm.indtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_EXTRA,nil)
if chk==0 then return g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function cm.indcon(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler().SetCard_YM_Crypticinsect -- and re:GetHandler():IsType(TYPE_MONSTER)
end
function cm.indop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
if g:GetCount()>0 then
Duel.ConfirmCards(tp,g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tg=g:FilterSelect(tp,Card.IsAbleToRemove,1,1,nil)
if tg:GetCount()>0 then
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end
Duel.ShuffleExtra(1-tp)
end
end
\ No newline at end of file
--隐匿虫 寄生蛹
local m=11626302
local cm=_G["c"..m]
function c11626302.initial_effect(c)
--to deck
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,11626302)
e1:SetCondition(c11626302.htdcon)
e1:SetCost(c11626302.htdcost)
e1:SetTarget(c11626302.htdtg)
e1:SetOperation(c11626302.htdop)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_HAND)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(c11626302.descon)
e2:SetTarget(c11626302.destg)
e2:SetOperation(c11626302.desop)
c:RegisterEffect(e2)
--SpecialSummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(11626302,2))
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCondition(c11626302.indcon)
e3:SetOperation(c11626302.indop)
c:RegisterEffect(e3)
if not c11626302.global_check then
c11626302.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(c11626302.checkop)
Duel.RegisterEffect(ge1,0)
end
Duel.AddCustomActivityCounter(11626302,ACTIVITY_SPSUMMON,c11626302.counterfilter)
end
c11626302.SetCard_YM_Crypticinsect=true
function c11626302.checkop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if rc:IsType(TYPE_MONSTER) and not rc:IsRace(RACE_INSECT) then
Duel.RegisterFlagEffect(rp,11626302,RESET_PHASE+PHASE_END,0,1)
end
end
function c11626302.counterfilter(c)
return c:IsRace(RACE_INSECT)
end
--01
function c11626302.htdcon(e,tp,eg,ep,ev,re,r,rp)
local p=e:GetHandler():GetOwner()
return tp==p and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c11626302.htdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,11626302)==0 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(c11626302.actlimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e2:SetTargetRange(1,0)
e2:SetTarget(c11626302.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c11626302.actlimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not re:GetHandler():IsRace(RACE_INSECT)
end
function c11626302.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsRace(RACE_INSECT)
end
function c11626302.htdfil(c)
return c:IsAbleToDeck() and c.SetCard_YM_Crypticinsect and c:IsType(TYPE_MONSTER)
end
function c11626302.htdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
end
function c11626302.htdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if (not c:IsRelateToEffect(e)) or (not c:IsLocation(LOCATION_HAND)) then return end
Duel.SendtoDeck(c,1-tp,1,REASON_EFFECT)
if not c:IsLocation(LOCATION_DECK) then return end
Duel.ShuffleDeck(1-tp)
c:ReverseInDeck()
if Duel.IsPlayerCanDraw(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(11626302,0)) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
--
if Duel.GetFlagEffect(tp,1111113)==0 then
Duel.RegisterFlagEffect(tp,1111113,0,0,0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_TO_HAND)
e1:SetCondition(c11626302.hxthecon)
e1:SetOperation(c11626302.hxtheop)
Duel.RegisterEffect(e1,1-tp)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11626302,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(11626302)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,1-tp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(c11626302.damval)
Duel.RegisterEffect(e1,1-tp)
end
end
end
function c11626302.hxthckfil(c,tp)
return c:IsControler(tp) and not c:IsReason(REASON_DRAW)
end
function c11626302.hxthecon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c11626302.hxthckfil,1,nil,tp)
end
function c11626302.pbfil(c)
return not c:IsPublic() and c:IsAbleToDeck() and not c.SetCard_YM_Crypticinsect
end
function c11626302.hxtheop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if eg:IsExists(Card.IsControler,1,nil,tp) then
Duel.Hint(HINT_CARD,0,11626302)
Duel.Draw(tp,1,REASON_EFFECT)
if Duel.IsExistingMatchingCard(c11626302.pbfil,tp,LOCATION_HAND,0,1,nil) and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>=8 then
local sg=Duel.GetMatchingGroup(cm.pbfil,tp,LOCATION_HAND,0,nil):RandomSelect(tp,1)
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoDeck(sg,nil,1,REASON_EFFECT)
end
end
end
function c11626302.damval(e,re,val,r,rp)
if r&REASON_EFFECT~=0 and re then
local rc=re:GetHandler()
if not rc.SetCard_YM_Crypticinsect then
return 100
end
end
return val
end
--02
function c11626302.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_DECK) and e:GetHandler():IsPreviousPosition(POS_FACEUP)
end
function c11626302.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c11626302.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,1-tp,1-tp,false,false,POS_FACEUP)
Duel.Draw(tp,1,REASON_EFFECT)
else
Duel.Destroy(c,REASON_EFFECT)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--03
--tk
function cm.indcon(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler().SetCard_YM_Crypticinsect and Duel.IsAbleToEnterBP() -- and re:GetHandler():IsType(TYPE_MONSTER)
end
function cm.indop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e1:SetCountLimit(1)
e1:SetCondition(cm.xtdcon)
e1:SetOperation(cm.xtdop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.xtdcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,0,1,nil)
end
function cm.xtdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SendtoDeck(sg,nil,1,REASON_EFFECT)
end
end
\ No newline at end of file
--隐匿虫 苍蝇
local m=11626303
local cm=_G["c"..m]
function c11626303.initial_effect(c)
--to deck
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,11626303)
e1:SetCondition(c11626303.htdcon)
e1:SetCost(c11626303.htdcost)
e1:SetTarget(c11626303.htdtg)
e1:SetOperation(c11626303.htdop)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_HAND)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(c11626303.descon)
e2:SetTarget(c11626303.destg)
e2:SetOperation(c11626303.desop)
c:RegisterEffect(e2)
--SpecialSummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(11626303,2))
e3:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetTarget(c11626303.indtg)
e3:SetCondition(c11626303.indcon)
e3:SetOperation(c11626303.indop)
c:RegisterEffect(e3)
if not c11626303.global_check then
c11626303.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(c11626303.checkop)
Duel.RegisterEffect(ge1,0)
end
Duel.AddCustomActivityCounter(11626303,ACTIVITY_SPSUMMON,c11626303.counterfilter)
end
c11626303.SetCard_YM_Crypticinsect=true
function c11626303.checkop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if rc:IsType(TYPE_MONSTER) and not rc:IsRace(RACE_INSECT) then
Duel.RegisterFlagEffect(rp,11626303,RESET_PHASE+PHASE_END,0,1)
end
end
function c11626303.counterfilter(c)
return c:IsRace(RACE_INSECT)
end
--01
function c11626303.htdcon(e,tp,eg,ep,ev,re,r,rp)
local p=e:GetHandler():GetOwner()
return tp==p and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c11626303.htdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,11626303)==0 and Duel.GetCustomActivityCount(11626303,tp,ACTIVITY_SPSUMMON)==0 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(c11626303.actlimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e2:SetTargetRange(1,0)
e2:SetTarget(c11626303.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c11626303.actlimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not re:GetHandler():IsRace(RACE_INSECT)
end
function c11626303.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsRace(RACE_INSECT)
end
function c11626303.htdfil(c)
return c:IsAbleToDeck() and c.SetCard_YM_Crypticinsect and c:IsType(TYPE_MONSTER)
end
function c11626303.htdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,tp,LOCATION_HAND)
end
function c11626303.hsrfil(c)
return c.SetCard_YM_Crypticinsect and c:IsAbleToHand()
end
function c11626303.htdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if (not c:IsRelateToEffect(e)) or (not c:IsLocation(LOCATION_HAND)) then return end
Duel.SendtoDeck(c,1-tp,1,REASON_EFFECT)
if not c:IsLocation(LOCATION_DECK) then return end
Duel.ShuffleDeck(1-tp)
c:ReverseInDeck()
if Duel.IsExistingMatchingCard(c11626303.hsrfil,tp,LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(11626303,0)) then
Duel.BreakEffect()
local dg=Duel.SelectMatchingCard(tp,c11626303.hsrfil,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoHand(dg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,dg)
--
if Duel.GetFlagEffect(tp,1111114)==0 then
Duel.RegisterFlagEffect(tp,1111114,0,0,0)
if not cm.gchk then
cm.gchk=true
cm[0]=3
cm[1]=3
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c11626303.hxtgecon)
e1:SetOperation(c11626303.hxtgeop)
Duel.RegisterEffect(e1,1-tp)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11626303,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(11626303)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,1-tp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(c11626303.damval)
Duel.RegisterEffect(e1,1-tp)
end
end
end
function c11626303.hxtgecon(e,tp,eg,ep,ev,re,r,rp)
return rp==tp
end
function c11626303.pbfil(c)
return not c:IsPublic() and c:IsAbleToDeck() and not c.SetCard_YM_Crypticinsect
end
function c11626303.hxtgeop(e,tp,eg,ep,ev,re,r,rp)
if cm[rp]<=1 then
cm[rp]=3
local c=e:GetHandler()
if rp==tp then
Duel.Hint(HINT_CARD,0,11626303)
Duel.Draw(tp,1,REASON_EFFECT)
if Duel.IsExistingMatchingCard(c11626303.pbfil,tp,LOCATION_HAND,0,1,nil) and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>=8 then
local sg=Duel.GetMatchingGroup(cm.pbfil,tp,LOCATION_HAND,0,nil):RandomSelect(tp,1)
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoDeck(sg,nil,1,REASON_EFFECT)
end
end
else cm[rp]=cm[rp]-1 end
end
function c11626303.damval(e,re,val,r,rp)
if r&REASON_EFFECT~=0 and re then
local rc=re:GetHandler()
if not rc.SetCard_YM_Crypticinsect then
return 100
end
end
return val
end
--02
function c11626303.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_DECK) and e:GetHandler():IsPreviousPosition(POS_FACEUP)
end
function c11626303.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c11626303.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,1-tp,1-tp,false,false,POS_FACEUP)
Duel.Draw(tp,1,REASON_EFFECT)
else
Duel.Destroy(c,REASON_EFFECT)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--03
function c11626303.indtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_ONFIELD,nil)
if chk==0 then return g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE+CATEGORY_DISABLE,g,1,0,0)
end
function c11626303.indcon(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler().SetCard_YM_Crypticinsect -- and re:GetHandler():IsType(TYPE_MONSTER)
end
function c11626303.indop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_ONFIELD,nil)
if g:GetCount()>0 then
local dg=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,1,nil)
local tc=dg:GetFirst()
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
end
-- if tc:IsType(TYPE_MONSTER) then
-- local e0=Effect.CreateEffect(c)
-- e0:SetType(EFFECT_TYPE_SINGLE)
-- e0:SetCode(EFFECT_SET_ATTACK_FINAL)
-- e0:SetValue(0)
-- e0:SetReset(RESET_EVENT+RESETS_STANDARD)
-- tc:RegisterEffect(e0)
-- end
end
end
--隐匿虫 蚂蚁
local m=11626304
local cm=_G["c"..m]
function c11626304.initial_effect(c)
--to deck
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,11626304)
e1:SetCondition(c11626304.htdcon)
e1:SetCost(c11626304.htdcost)
e1:SetTarget(c11626304.htdtg)
e1:SetOperation(c11626304.htdop)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_HAND)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(c11626304.descon)
e2:SetTarget(c11626304.destg)
e2:SetOperation(c11626304.desop)
c:RegisterEffect(e2)
--SpecialSummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(11626304,2))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetTarget(c11626304.indtg)
e3:SetCondition(c11626304.indcon)
e3:SetOperation(c11626304.indop)
c:RegisterEffect(e3)
if not c11626304.global_check then
c11626304.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(c11626304.checkop)
Duel.RegisterEffect(ge1,0)
end
Duel.AddCustomActivityCounter(11626304,ACTIVITY_SPSUMMON,c11626304.counterfilter)
end
c11626304.SetCard_YM_Crypticinsect=true
function c11626304.checkop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if rc:IsType(TYPE_MONSTER) and not rc:IsRace(RACE_INSECT) then
Duel.RegisterFlagEffect(rp,11626304,RESET_PHASE+PHASE_END,0,1)
end
end
function c11626304.counterfilter(c)
return c:IsRace(RACE_INSECT)
end
--01
function c11626304.htdcon(e,tp,eg,ep,ev,re,r,rp)
local p=e:GetHandler():GetOwner()
return tp==p and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c11626304.htdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,11626304)==0 and Duel.GetCustomActivityCount(11626304,tp,ACTIVITY_SPSUMMON)==0 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(c11626304.actlimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e2:SetTargetRange(1,0)
e2:SetTarget(c11626304.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c11626304.actlimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not re:GetHandler():IsRace(RACE_INSECT)
end
function c11626304.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsRace(RACE_INSECT)
end
function c11626304.htdfil(c)
return c:IsAbleToDeck() and c.SetCard_YM_Crypticinsect and c:IsType(TYPE_MONSTER)
end
function c11626304.htdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,tp,LOCATION_HAND)
end
function c11626304.hsrfil(c)
return c.SetCard_YM_Crypticinsect and c:IsAbleToHand()
end
function c11626304.htdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if (not c:IsRelateToEffect(e)) or (not c:IsLocation(LOCATION_HAND)) then return end
Duel.SendtoDeck(c,1-tp,1,REASON_EFFECT)
if not c:IsLocation(LOCATION_DECK) then return end
Duel.ShuffleDeck(1-tp)
c:ReverseInDeck()
if Duel.IsExistingMatchingCard(c11626304.htdfil,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(11626304,0)) then
Duel.BreakEffect()
local dc=Duel.SelectMatchingCard(tp,c11626304.htdfil,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
Duel.SendtoDeck(dc,1-tp,2,REASON_EFFECT)
if not dc:IsLocation(LOCATION_DECK) then return end
Duel.ShuffleDeck(1-tp)
dc:ReverseInDeck()
--
if Duel.GetFlagEffect(tp,1111115)==0 then
Duel.RegisterFlagEffect(tp,1111115,0,0,0)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_ATTACK_COST)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetCost(c11626304.atcost)
e3:SetOperation(c11626304.atop)
Duel.RegisterEffect(e3,1-tp)
--accumulate
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(0x10000000+11626304)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(1,0)
Duel.RegisterEffect(e4,1-tp)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11626304,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(11626304)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,1-tp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(c11626304.damval)
Duel.RegisterEffect(e1,1-tp)
end
end
end
function c11626304.atcost(e,c,tp)
local ct=Duel.GetFlagEffect(tp,11626304)
return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil)
end
function c11626304.atop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,11626304)
local sg=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND,0,nil):RandomSelect(tp,1)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
Duel.Draw(tp,1,REASON_COST)
end
function c11626304.damval(e,re,val,r,rp)
if r&REASON_EFFECT~=0 and re then
local rc=re:GetHandler()
if not rc.SetCard_YM_Crypticinsect then
return 100
end
end
return val
end
--02
function c11626304.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_DECK) and e:GetHandler():IsPreviousPosition(POS_FACEUP)
end
function c11626304.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c11626304.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,1-tp,1-tp,false,false,POS_FACEUP)
Duel.Draw(tp,1,REASON_EFFECT)
else
Duel.Destroy(c,REASON_EFFECT)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--03
--ph
function cm.indtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.indcon(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler().SetCard_YM_Crypticinsect -- and re:GetHandler():IsType(TYPE_MONSTER)
end
function cm.indop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,nil) then
local dg=Duel.SelectMatchingCard(tp,nil,1-tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.Destroy(dg,REASON_EFFECT)
end
end
\ No newline at end of file
--隐匿虫 蜈蚣
local m=11626305
local cm=_G["c"..m]
function c11626305.initial_effect(c)
--to deck
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,11626305)
e1:SetCondition(c11626305.htdcon)
e1:SetCost(c11626305.htdcost)
e1:SetTarget(c11626305.htdtg)
e1:SetOperation(c11626305.htdop)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_HAND)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(c11626305.descon)
e2:SetTarget(c11626305.destg)
e2:SetOperation(c11626305.desop)
c:RegisterEffect(e2)
--SpecialSummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(11626305,2))
e3:SetCategory(CATEGORY_CONTROL)
e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetTarget(c11626305.indtg)
e3:SetCondition(c11626305.indcon)
e3:SetOperation(c11626305.indop)
c:RegisterEffect(e3)
if not c11626305.global_check then
c11626305.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(c11626305.checkop)
Duel.RegisterEffect(ge1,0)
end
Duel.AddCustomActivityCounter(11626305,ACTIVITY_SPSUMMON,c11626305.counterfilter)
end
c11626305.SetCard_YM_Crypticinsect=true
function c11626305.checkop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if rc:IsType(TYPE_MONSTER) and not rc:IsRace(RACE_INSECT) then
Duel.RegisterFlagEffect(rp,11626305,RESET_PHASE+PHASE_END,0,1)
end
end
function c11626305.counterfilter(c)
return c:IsRace(RACE_INSECT)
end
--01
function c11626305.htdcon(e,tp,eg,ep,ev,re,r,rp)
local p=e:GetHandler():GetOwner()
return tp==p and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c11626305.htdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,11626305)==0 and Duel.GetCustomActivityCount(11626305,tp,ACTIVITY_SPSUMMON)==0 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(c11626305.actlimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e2:SetTargetRange(1,0)
e2:SetTarget(c11626305.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c11626305.actlimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not re:GetHandler():IsRace(RACE_INSECT)
end
function c11626305.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsRace(RACE_INSECT)
end
function c11626305.htdfil(c)
return c:IsAbleToDeck() and c.SetCard_YM_Crypticinsect and c:IsType(TYPE_MONSTER)
end
function c11626305.htdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,tp,LOCATION_HAND)
end
function c11626305.hsrfil(c)
return c.SetCard_YM_Crypticinsect and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function c11626305.htdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if (not c:IsRelateToEffect(e)) or (not c:IsLocation(LOCATION_HAND)) then return end
Duel.SendtoDeck(c,1-tp,1,REASON_EFFECT)
if not c:IsLocation(LOCATION_DECK) then return end
Duel.ShuffleDeck(1-tp)
c:ReverseInDeck()
local mg=Duel.GetFieldGroup(tp,0,LOCATION_DECK)
if mg:GetCount()>2 and Duel.SelectYesNo(tp,aux.Stringid(11626305,0)) then
Duel.BreakEffect()
Duel.SortDecktop(tp,1-tp,3)
--
if Duel.GetFlagEffect(tp,1111116)==0 then
Duel.RegisterFlagEffect(tp,1111116,0,0,0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SSET)
e1:SetCondition(c11626305.hxthecon)
e1:SetOperation(c11626305.hxtheop)
Duel.RegisterEffect(e1,1-tp)
local e2=e1:Clone()
e2:SetCode(EVENT_MSET)
Duel.RegisterEffect(e2,1-tp)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11626305,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(11626305)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,1-tp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(c11626305.damval)
Duel.RegisterEffect(e1,1-tp)
end
end
end
function c11626305.hxthecon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsControler,1,nil,tp)
end
function c11626305.pbfil(c)
return not c:IsPublic() and c:IsAbleToDeck() and not c.SetCard_YM_Crypticinsect
end
function c11626305.hxtheop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if eg:IsExists(Card.IsControler,1,nil,tp) then
Duel.Hint(HINT_CARD,0,11626305)
Duel.Draw(tp,1,REASON_EFFECT)
if Duel.IsExistingMatchingCard(c11626305.pbfil,tp,LOCATION_HAND,0,1,nil) and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>=8 then
local sg=Duel.GetMatchingGroup(cm.pbfil,tp,LOCATION_HAND,0,nil):RandomSelect(tp,1)
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoDeck(sg,nil,1,REASON_EFFECT)
end
end
end
function c11626305.damval(e,re,val,r,rp)
if r&REASON_EFFECT~=0 and re then
local rc=re:GetHandler()
if not rc.SetCard_YM_Crypticinsect then
return 100
end
end
return val
end
--02
function c11626305.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_DECK) and e:GetHandler():IsPreviousPosition(POS_FACEUP)
end
function c11626305.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c11626305.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,1-tp,1-tp,false,false,POS_FACEUP)
Duel.Draw(tp,1,REASON_EFFECT)
else
Duel.Destroy(c,REASON_EFFECT)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--03
--ntr
function cm.indtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function cm.indcon(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler().SetCard_YM_Crypticinsect -- and re:GetHandler():IsType(TYPE_MONSTER)
end
function cm.indop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local dg=Duel.SelectMatchingCard(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil)
local tc=dg:GetFirst()
if tc then
Duel.GetControl(tc,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_RACE)
e2:SetValue(RACE_INSECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
end
--隐匿虫母
function c11626306.initial_effect(c)
c:SetSPSummonOnce(11626306)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_INSECT),2,2)
--cannot special summon
local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(aux.linklimit)
c:RegisterEffect(e0)
--extra material
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11626306,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(c11626306.hspcon)
e1:SetTarget(c11626306.LinkTarget)
e1:SetOperation(c11626306.LinkOperation)
e1:SetValue(SUMMON_TYPE_LINK)
c:RegisterEffect(e1)
--limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(1,0)
e2:SetTarget(function (e,c)
return not c:IsRace(RACE_INSECT) end)
c:RegisterEffect(e2)
--up and damage
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_DRAW)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c11626306.udcon)
e3:SetOperation(c11626306.udop)
c:RegisterEffect(e3)
--
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(11626306,1))
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,11626306)
e4:SetTarget(c11626306.sttg)
e4:SetOperation(c11626306.stop)
c:RegisterEffect(e4)
--
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(11626306,2))
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1,11626306)
e5:SetTarget(c11626306.sttg2)
e5:SetCost(c11626306.stcost)
e5:SetOperation(c11626306.stop2)
c:RegisterEffect(e5)
--
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e6:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e6:SetValue(c11626306.linklimit)
c:RegisterEffect(e6)
--
local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(11626306,3))
e7:SetType(EFFECT_TYPE_QUICK_O)
e7:SetCode(EVENT_FREE_CHAIN)
e7:SetRange(LOCATION_MZONE)
e7:SetCountLimit(1,11626307)
e7:SetTarget(c11626306.sptg)
e7:SetOperation(c11626306.spop)
c:RegisterEffect(e7)
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(11626306,4))
e8:SetType(EFFECT_TYPE_QUICK_O)
e8:SetCode(EVENT_FREE_CHAIN)
e8:SetRange(LOCATION_MZONE)
e8:SetCountLimit(1,11626307)
e8:SetTarget(c11626306.sptg2)
e8:SetCost(c11626306.stcost)
e8:SetOperation(c11626306.spop2)
c:RegisterEffect(e8)
end
c11626306.SetCard_YM_Crypticinsect=true
function c11626306.matfilter(c)
return c.SetCard_YM_Crypticinsect
end
function c11626306.linklimit(e,c)
if not c then return false end
return not c.SetCard_YM_Crypticinsect
end
function c11626306.hctfil(c)
return c:IsType(TYPE_MONSTER) and c.SetCard_YM_Crypticinsect and c:IsAbleToDeckAsCost()
end
function c11626306.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and Duel.IsExistingMatchingCard(c11626306.hctfil,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil)
end
function c11626306.issetcard(c,lc)
return c:IsType(TYPE_MONSTER) and c.SetCard_YM_Crypticinsect and c:IsCanBeLinkMaterial(lc)
end
function c11626306.cfilter(c)
return c:IsRace(RACE_INSECT) and c:IsFaceup()
end
function c11626306.GetLinkMaterials(tp,f,lc,e)
local mg=Duel.GetMatchingGroup(c11626306.cfilter,tp,LOCATION_MZONE,0,nil,f,lc,e)
local mg2=Duel.GetMatchingGroup(Auxiliary.LExtraFilter,tp,LOCATION_SZONE,LOCATION_ONFIELD,nil,f,lc,tp)
local mg3=Duel.GetMatchingGroup(c11626306.issetcard,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,lc)
if mg2:GetCount()>0 then mg:Merge(mg2) end
if mg3:GetCount()>0 then mg:Merge(mg3) end
return mg
end
function c11626306.hspcon(e,c,og,lmat,min,max)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local minc=2
local maxc=2
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
if minc>maxc then return false end
end
local tp=c:GetControler()
local mg=nil
if og then
mg=og:Filter(Auxiliary.LConditionFilter,nil,nil,c,e)
else
mg=c11626306.GetLinkMaterials(tp,nil,c,e)
end
if lmat~=nil then
if not Auxiliary.LConditionFilter(lmat,nil,c,e) then return false end
mg:AddCard(lmat)
end
--local fg=Auxiliary.GetMustMaterialGroup(tp,EFFECT_MUST_BE_LMATERIAL)
--if fg:IsExists(Auxiliary.MustMaterialCounterFilter,1,nil,mg) then return false end
--Duel.SetSelectedCard(fg)
return mg:CheckSubGroup(Auxiliary.LCheckGoal,minc,maxc,tp,c,nil,lmat)
end
function c11626306.LinkTarget(e,tp,eg,ep,ev,re,r,rp,chk,c,og,lmat,min,max)
local minc=2
local maxc=2
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
if minc>maxc then return false end
end
local mg=nil
if og then
mg=og:Filter(Auxiliary.LConditionFilter,nil,nil,c,e)
else
mg=c11626306.GetLinkMaterials(tp,nil,c,e)
end
if lmat~=nil then
if not Auxiliary.LConditionFilter(lmat,nil,c,e) then return false end
mg:AddCard(lmat)
end
--local fg=Auxiliary.GetMustMaterialGroup(tp,EFFECT_MUST_BE_LMATERIAL)
--Duel.SetSelectedCard(fg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
local cancel=Duel.IsSummonCancelable()
local sg=mg:SelectSubGroup(tp,Auxiliary.LCheckGoal,cancel,minc,maxc,tp,c,nil,lmat)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function c11626306.LinkOperation(e,tp,eg,ep,ev,re,r,rp,c,og,lmat,min,max)
local g=e:GetLabelObject()
c:SetMaterial(g)
Auxiliary.LExtraMaterialCount(g,c,tp)
local sg=g:Filter(Card.IsLocation,nil,LOCATION_HAND+LOCATION_GRAVE)
g=g-sg
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_LINK)
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoDeck(sg,nil,2,REASON_MATERIAL+REASON_LINK)
g:DeleteGroup()
sg:DeleteGroup()
end
--01
function c11626306.udcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil)
end
function c11626306.udop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if ep~=tp and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) then
Duel.Hint(HINT_CARD,0,11626306)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
local x=0
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(ev*100)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
x=x+1
tc=g:GetNext()
end
Duel.Damage(1-tp,ev*100,REASON_EFFECT)
end
end
--02
function c11626306.sttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_DECK,0,5,nil) end
end
function c11626306.stop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.IsExistingMatchingCard(nil,tp,LOCATION_DECK,0,5,nil) then
Duel.ConfirmDecktop(1-tp,5)
Duel.SortDecktop(tp,1-tp,5)
end
end
--
function c11626306.stcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,e:GetHandler(),tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(tp,nil,1,1,e:GetHandler(),tp)
Duel.Release(g,REASON_COST)
end
function c11626306.sttg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_DECK,0,5,nil) and Duel.IsPlayerCanDraw(tp,1) end
end
function c11626306.stop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.IsExistingMatchingCard(nil,tp,LOCATION_DECK,0,5,nil) then
Duel.ConfirmDecktop(1-tp,5)
Duel.SortDecktop(tp,1-tp,5)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--
function c11626306.spfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c.SetCard_YM_Crypticinsect and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c11626306.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 and Duel.IsExistingMatchingCard(nil,tp,LOCATION_DECK,0,3,nil) end
end
function c11626306.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
Duel.ConfirmCards(tp,g)
Duel.ConfirmDecktop(1-tp,3)
local dg=Duel.GetDecktopGroup(1-tp,3)
g:Merge(dg)
if g:GetCount()>0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:FilterSelect(tp,c11626306.spfilter,1,ft,nil,e,tp)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
Duel.Draw(1-tp,sg:GetCount(),REASON_EFFECT)
end
end
Duel.ShuffleHand(1-tp)
end
function c11626306.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 and Duel.IsExistingMatchingCard(nil,tp,LOCATION_DECK,0,3,nil) end
end
function c11626306.spop2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(1-tp,LOCATION_HAND,0)
Duel.ConfirmCards(tp,g)
Duel.ConfirmDecktop(1-tp,3)
local dg=Duel.GetDecktopGroup(1-tp,3)
g:Merge(dg)
if g:GetCount()>0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:FilterSelect(tp,c11626306.spfilter,1,ft,nil,e,tp)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
Duel.Draw(1-tp,sg:GetCount(),REASON_EFFECT)
Duel.ShuffleHand(1-tp)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
\ No newline at end of file
--害虫滋生
function c11626307.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11626307,1))
e1:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c11626307.accost)
e1:SetTarget(c11626307.actg)
e1:SetOperation(c11626307.acop)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(11626307,2))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCost(c11626307.accost2)
e2:SetTarget(c11626307.actg2)
e2:SetOperation(c11626307.acop2)
c:RegisterEffect(e2)
if not c11626307.global_check then
c11626307.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(c11626307.checkop)
Duel.RegisterEffect(ge1,0)
end
Duel.AddCustomActivityCounter(11626307,ACTIVITY_SPSUMMON,c11626307.counterfilter)
end
function c11626307.counterfilter(c)
return c.SetCard_YM_Crypticinsect
end
function c11626307.checkop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if rc:IsType(TYPE_MONSTER) and not rc.SetCard_YM_Crypticinsect then
Duel.RegisterFlagEffect(rp,11626307,RESET_PHASE+PHASE_END,0,1)
end
end
function c11626307.accost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,11626307)==0 and Duel.GetCustomActivityCount(11626307,tp,ACTIVITY_SPSUMMON)==0 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(c11626307.actlimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetTargetRange(1,0)
e2:SetTarget(c11626307.splimit)
Duel.RegisterEffect(e2,tp)
end
function c11626307.splimit(e,c)
return not c.SetCard_YM_Crypticinsect
end
function c11626307.actlimit(e,re,tp)
local rc=re:GetHandler()
return rc:IsType(TYPE_MONSTER) and not rc.SetCard_YM_Crypticinsect
end
function c11626307.dpbfil(c)
return c:IsAbleToDeck() and c.SetCard_YM_Crypticinsect and c:IsType(TYPE_MONSTER)
end
function c11626307.actg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11626307.dpbfil,tp,LOCATION_DECK,0,2,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c11626307.acop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c11626307.dpbfil,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 then
local sg=g:Select(tp,2,2,nil)
Duel.ConfirmCards(1-tp,sg)
local tc=sg:RandomSelect(1-tp,1):GetFirst()
Duel.ShuffleDeck(tp)
Duel.SendtoDeck(tc,1-tp,2,REASON_EFFECT)
if not tc:IsLocation(LOCATION_DECK) then return end
Duel.ShuffleDeck(1-tp)
tc:ReverseInDeck()
local xg=sg:Filter(aux.TRUE,tc)
Duel.SendtoHand(xg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,xg)
end
end
--
function c11626307.costfil(c)
return c:IsRace(RACE_INSECT) and c:IsType(TYPE_MONSTER)
end
function c11626307.accost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,11626307)==0 and Duel.GetCustomActivityCount(11626307,tp,ACTIVITY_SPSUMMON)==0 and Duel.CheckReleaseGroup(tp,c11626307.costfil,1,nil,tp) 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(c11626307.actlimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetTargetRange(1,0)
e2:SetTarget(c11626307.splimit)
Duel.RegisterEffect(e2,tp)
local g=Duel.SelectReleaseGroup(tp,c11626307.costfil,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c11626307.actg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11626307.dpbfil,tp,LOCATION_DECK,0,2,nil) and Duel.IsPlayerCanDraw(tp,2) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c11626307.acop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c11626307.dpbfil,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 then
local sg=g:Select(tp,2,2,nil)
Duel.ConfirmCards(1-tp,sg)
local tc=sg:RandomSelect(1-tp,1):GetFirst()
Duel.ShuffleDeck(tp)
Duel.SendtoDeck(tc,1-tp,2,REASON_EFFECT)
if not tc:IsLocation(LOCATION_DECK) then return end
Duel.ShuffleDeck(1-tp)
tc:ReverseInDeck()
local xg=sg:Filter(aux.TRUE,tc)
Duel.SendtoHand(xg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,xg)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--隐匿虫堆积的角落
function c11626308.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,11626308)
e1:SetOperation(c11626308.activate)
c:RegisterEffect(e1)
--to deck
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DAMAGE_STEP)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,21626308)
e2:SetCondition(c11626308.tdcon)
e2:SetTarget(c11626308.tdtg)
e2:SetOperation(c11626308.tdop)
c:RegisterEffect(e2)
--damage
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1)
e3:SetCondition(c11626308.drcon)
e3:SetTarget(c11626308.drtg)
e3:SetOperation(c11626308.drop)
c:RegisterEffect(e3)
if not c11626308.global_check then
c11626308.global_check=true
local ge1=Effect.CreateEffect(c)
c11626308[0]=0
c11626308[1]=0
ge1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ge1:SetCode(EVENT_RELEASE)
ge1:SetOperation(c11626308.addcount)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge2:SetOperation(c11626308.clearop)
Duel.RegisterEffect(ge2,0)
end
end
c11626308.SetCard_YM_Crypticinsect=true
function c11626308.addcount(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
if tc:IsType(TYPE_MONSTER) and tc.SetCard_YM_Crypticinsect then
local p=tc:GetReasonPlayer()
c11626308[p]=c11626308[p]+1
end
tc=eg:GetNext()
end
end
function c11626308.clearop(e,tp,eg,ep,ev,re,r,rp)
c11626308[0]=0
c11626308[1]=0
end
--
function c11626308.thfilter(c)
return c:IsType(TYPE_MONSTER) and c.SetCard_YM_Crypticinsect and c:IsAbleToHand()
end
function c11626308.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c11626308.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(11626308,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function c11626308.tdcon(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and rc and rc.SetCard_YM_Crypticinsect
end
function c11626308.tdfil(c,rc)
return c:IsAbleToDeck() and c:IsType(TYPE_MONSTER) and c.SetCard_YM_Crypticinsect and not c:IsCode(rc:GetCode())
end
function c11626308.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local rc=re:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c11626308.tdfil,tp,LOCATION_DECK,0,1,nil,rc) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_DECK)
end
function c11626308.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
local g=Duel.GetMatchingGroup(c11626308.tdfil,tp,LOCATION_DECK,0,nil,rc)
if g:GetCount()>0 then
local sg=g:Select(tp,1,2,nil)
Duel.SendtoDeck(sg,1-tp,2,REASON_EFFECT)
if sg:FilterCount(Card.IsLocation,nil,LOCATION_DECK)~=sg:GetCount() then return end
Duel.ShuffleDeck(1-tp)
local tc=sg:GetFirst()
while tc do
tc:ReverseInDeck()
tc=sg:GetNext()
end
end
end
--
function c11626308.dackfil(c)
local re=c:GetReasonEffect()
return c.SetCard_YM_Crypticinsect and c:IsReason(REASON_EFFECT) and re:IsActiveType(TYPE_MONSTER)
end
function c11626308.drcon(e,tp,eg,ep,ev,re,r,rp)
return c11626308[tp]>0
end
function c11626308.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return true end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,nil,0,LOCATION_GRAVE+LOCATION_REMOVED)
end
function c11626308.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,1,c11626308[tp],nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
\ No newline at end of file
--隐匿虫 阴险蝎
local m=11626309
local cm=_G["c"..m]
function c11626309.initial_effect(c)
--to deck
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,11626309)
e1:SetCondition(c11626309.htdcon)
e1:SetCost(c11626309.htdcost)
e1:SetTarget(c11626309.htdtg)
e1:SetOperation(c11626309.htdop)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_HAND)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(c11626309.descon)
e2:SetTarget(c11626309.destg)
e2:SetOperation(c11626309.desop)
c:RegisterEffect(e2)
--SpecialSummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(11626309,2))
e3:SetCategory(CATEGORY_DRAW+CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCondition(c11626309.indcon)
e3:SetTarget(c11626309.indtg)
e3:SetOperation(c11626309.indop)
c:RegisterEffect(e3)
if not c11626309.global_check then
c11626309.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(c11626309.checkop)
Duel.RegisterEffect(ge1,0)
end
Duel.AddCustomActivityCounter(11626309,ACTIVITY_SPSUMMON,c11626309.counterfilter)
end
c11626309.SetCard_YM_Crypticinsect=true
function c11626309.checkop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if rc:IsType(TYPE_MONSTER) and not rc:IsRace(RACE_INSECT) then
Duel.RegisterFlagEffect(rp,11626309,RESET_PHASE+PHASE_END,0,1)
end
end
function c11626309.counterfilter(c)
return c:IsRace(RACE_INSECT)
end
--01
function c11626309.htdcon(e,tp,eg,ep,ev,re,r,rp)
local p=e:GetHandler():GetOwner()
return tp==p and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c11626309.htdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,11626309)==0 and Duel.GetCustomActivityCount(11626309,tp,ACTIVITY_SPSUMMON)==0 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(c11626309.actlimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e2:SetTargetRange(1,0)
e2:SetTarget(c11626309.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c11626309.actlimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not re:GetHandler():IsRace(RACE_INSECT)
end
function c11626309.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsRace(RACE_INSECT)
end
function c11626309.htdfil(c)
return c:IsAbleToDeck() and c.SetCard_YM_Crypticinsect and c:IsType(TYPE_MONSTER)
end
function c11626309.htdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,tp,LOCATION_HAND)
end
function c11626309.htgfil(c)
return c.SetCard_YM_Crypticinsect and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c11626309.htdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if (not c:IsRelateToEffect(e)) or (not c:IsLocation(LOCATION_HAND)) then return end
Duel.SendtoDeck(c,1-tp,1,REASON_EFFECT)
if not c:IsLocation(LOCATION_DECK) then return end
Duel.ShuffleDeck(1-tp)
c:ReverseInDeck()
if Duel.IsExistingMatchingCard(c11626309.htgfil,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(11626309,0)) then
Duel.BreakEffect()
local dg=Duel.SelectMatchingCard(tp,c11626309.htgfil,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(dg,REASON_EFFECT)
--
if Duel.GetFlagEffect(tp,1111110)==0 then
Duel.RegisterFlagEffect(tp,1111110,0,0,0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e1:SetCountLimit(1)
e1:SetCondition(c11626309.hxbtecon)
e1:SetOperation(c11626309.hxbteop)
Duel.RegisterEffect(e1,1-tp)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11626309,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(11626309)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,1-tp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(c11626309.damval)
Duel.RegisterEffect(e1,1-tp)
end
end
end
function c11626309.hxbtecon(e,tp,eg,ep,ev,re,r,rp)
local x=Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)
return Duel.IsPlayerCanDraw(tp,x)
end
function c11626309.pbfil(c)
return not c:IsPublic() and c:IsAbleToDeck() and not c.SetCard_YM_Crypticinsect
end
function c11626309.hxbteop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local x=Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)
if Duel.IsPlayerCanDraw(tp,x) then
Duel.Hint(HINT_CARD,0,11626309)
if Duel.Draw(tp,x,REASON_EFFECT)>0 and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>8 then
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TODECK)
local sg=Duel.GetMatchingGroup(cm.pbfil,tp,LOCATION_HAND,0,nil):RandomSelect(tp,g:GetCount()-8)
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
end
end
end
function c11626309.damval(e,re,val,r,rp)
if r&REASON_EFFECT~=0 and re then
local rc=re:GetHandler()
if not rc.SetCard_YM_Crypticinsect then
return 100
end
end
return val
end
--02
function c11626309.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_DECK) and e:GetHandler():IsPreviousPosition(POS_FACEUP)
end
function c11626309.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c11626309.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,1-tp,1-tp,false,false,POS_FACEUP)
Duel.Draw(tp,1,REASON_EFFECT)
else
Duel.Destroy(c,REASON_EFFECT)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--03
--st
function cm.indtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
if chk==0 then return ct>0 and Duel.IsPlayerCanDraw(1-tp,ct) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,1-tp,ct)
end
function cm.indcon(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler().SetCard_YM_Crypticinsect -- and re:GetHandler():IsType(TYPE_MONSTER)
end
function cm.pbfil(c)
return c:IsAbleToDeck() and not c.SetCard_YM_Crypticinsect
end
function cm.indop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
if ct==0 then return end
if Duel.Draw(1-tp,ct,REASON_EFFECT)>0 and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>7 then
ct=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TODECK)
local sg=Duel.SelectMatchingCard(1-tp,cm.pbfil,1-tp,LOCATION_HAND,0,ct-7,ct-7,nil)
Duel.ConfirmCards(tp,sg)
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
--分裂的隐匿虫
function c11626310.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11626310,0))
e1:SetCategory(CATEGORY_RELEASE+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,11626310+EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetTarget(c11626310.target)
e1:SetOperation(c11626310.activate)
c:RegisterEffect(e1)
--Activate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(11626310,1))
e2:SetCategory(CATEGORY_RELEASE+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,11626310+EFFECT_COUNT_CODE_OATH)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e2:SetTarget(c11626310.target2)
e2:SetOperation(c11626310.activate2)
c:RegisterEffect(e2)
end
c11626310.SetCard_YM_Crypticinsect=true
function c11626310.filter(c)
return c.SetCard_YM_Crypticinsect and c:IsType(TYPE_MONSTER) and c:IsReleasable()
end
function c11626310.filter2(c)
return c.SetCard_YM_Crypticinsect and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c11626310.posfilter(c)
return not c:IsPublic() and c:IsAbleToDeck() and not c.SetCard_YM_Crypticinsect
end
function c11626310.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11626310.filter,tp,LOCATION_DECK,0,1,nil) and Duel.IsPlayerCanDraw(1-tp,2) end
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,tp,LOCATION_DECK)
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,1-tp,2)
end
function c11626310.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c11626310.filter2,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_EFFECT)
Duel.Draw(p,d,REASON_EFFECT)
if Duel.IsExistingMatchingCard(c11626310.posfilter,1-tp,LOCATION_HAND,0,2,nil) then
local sg=Duel.SelectMatchingCard(1-tp,c11626310.posfilter,1-tp,LOCATION_HAND,0,2,2,nil)
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
end
end
---
function c11626310.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11626310.filter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsPlayerCanDraw(tp,2) end
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,tp,LOCATION_MZONE)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c11626310.activate2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c11626310.filter,tp,LOCATION_MZONE,0,1,1,nil)
if g:GetCount()>0 and Duel.Release(g,REASON_EFFECT)~=0 then
Duel.Draw(p,d,REASON_EFFECT)
end
end
--隐匿虫的赠礼
function c11626311.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c11626311.target)
e1:SetOperation(c11626311.operation)
c:RegisterEffect(e1)
end
c11626311.SetCard_YM_Crypticinsect=true
function c11626311.filter(c)
return c.SetCard_YM_Crypticinsect and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck() and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE))
end
function c11626311.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c11626311.filter(chkc) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,2)
and Duel.IsExistingTarget(c11626311.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,4,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c11626311.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,4,4,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,4,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c11626311.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=4 then return end
if tg:GetCount()>0 then
local tc=tg:GetFirst()
while tc do
if tc:IsType(TYPE_LINK) then
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
tc=tg:GetNext()
else
Duel.SendtoDeck(tc,1-tp,1,REASON_EFFECT)
Duel.ShuffleDeck(1-tp)
tc:ReverseInDeck()
tc=tg:GetNext()
end
end
local ct=tg:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA+LOCATION_DECK)
if ct>0 then
Duel.BreakEffect()
Duel.Draw(tp,2,REASON_EFFECT)
end
end
end
\ No newline at end of file
--隐匿虫 蜘蛛
local m=11626312
local cm=_G["c"..m]
function c11626312.initial_effect(c)
--RELEASE
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_RELEASE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.htdcon)
e1:SetCost(cm.htdcost)
e1:SetTarget(cm.htdtg)
e1:SetOperation(cm.htdop)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_HAND)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(cm.descon)
e2:SetTarget(cm.destg)
e2:SetOperation(cm.desop)
c:RegisterEffect(e2)
--SpecialSummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetTarget(cm.indtg)
e3:SetCondition(cm.indcon)
e3:SetOperation(cm.indop)
c:RegisterEffect(e3)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
end
cm.SetCard_YM_Crypticinsect=true
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if rc:IsType(TYPE_MONSTER) and not rc:IsRace(RACE_INSECT) then
Duel.RegisterFlagEffect(rp,m,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.counterfilter(c)
return c:IsRace(RACE_INSECT)
end
--01
function cm.htdcon(e,tp,eg,ep,ev,re,r,rp)
local p=e:GetHandler():GetOwner()
return tp==p and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function cm.htdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,m)==0 and Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 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.actlimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e2:SetTargetRange(1,0)
e2:SetTarget(cm.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function cm.actlimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not re:GetHandler():IsRace(RACE_INSECT)
end
function cm.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsRace(RACE_INSECT)
end
--
function cm.htdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,tp,LOCATION_HAND)
end
function cm.hsrfil(c)
return c:IsReleasableByEffect() and c:IsType(TYPE_MONSTER)
end
function cm.htdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if (not c:IsRelateToEffect(e)) or (not c:IsLocation(LOCATION_HAND)) then return end
Duel.SendtoDeck(c,1-tp,1,REASON_EFFECT)
if not c:IsLocation(LOCATION_DECK) then return end
Duel.ShuffleDeck(1-tp)
c:ReverseInDeck()
if Duel.IsExistingMatchingCard(cm.hsrfil,tp,LOCATION_MZONE,0,1,nil) and Duel.IsPlayerCanDraw(tp,2) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.BreakEffect()
local dg=Duel.SelectMatchingCard(tp,cm.hsrfil,tp,LOCATION_MZONE,0,1,1,nil)
Duel.HintSelection(dg)
Duel.Release(dg,REASON_EFFECT)
Duel.Draw(tp,2,REASON_EFFECT)
--
if Duel.GetFlagEffect(tp,1111122)==0 then
Duel.RegisterFlagEffect(tp,1111122,0,0,0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_REMOVE)
e1:SetCondition(cm.hxtgecon)
e1:SetOperation(cm.hxtgeop)
Duel.RegisterEffect(e1,1-tp)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(m)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,1-tp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(cm.damval)
Duel.RegisterEffect(e1,1-tp)
end
end
end
function cm.hxtgecon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.remfilter,1,nil) and eg:IsExists(Card.IsControler,1,nil,tp)
end
function cm.remfilter(c)
return not c:IsType(TYPE_TOKEN)
end
function cm.pbfil(c)
return not c:IsPublic() and c:IsAbleToDeck() and not c.SetCard_YM_Crypticinsect
end
function cm.hxtgeop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if eg:IsExists(Card.IsControler,1,nil,tp) then
Duel.Hint(HINT_CARD,0,m)
Duel.Draw(tp,1,REASON_EFFECT)
if Duel.IsExistingMatchingCard(cm.pbfil,tp,LOCATION_HAND,0,1,nil) and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>=8 then
local sg=Duel.GetMatchingGroup(cm.pbfil,tp,LOCATION_HAND,0,nil):RandomSelect(tp,1)
Duel.ConfirmCards(1-tp,sg)
Duel.SendtoDeck(sg,nil,1,REASON_EFFECT)
end
end
end
function cm.damval(e,re,val,r,rp)
if r&REASON_EFFECT~=0 and re then
local rc=re:GetHandler()
if not rc.SetCard_YM_Crypticinsect then
return 100
end
end
return val
end
--02
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_DECK) and e:GetHandler():IsPreviousPosition(POS_FACEUP)
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,1-tp,1-tp,false,false,POS_FACEUP)
Duel.Draw(tp,1,REASON_EFFECT)
else
Duel.Destroy(c,REASON_EFFECT)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--03
--fex
function cm.indtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
end
function cm.indcon(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler().SetCard_YM_Crypticinsect -- and re:GetHandler():IsType(TYPE_MONSTER)
end
function cm.indop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
local tc=g:GetFirst()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UNRELEASABLE_SUM)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(1)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UNRELEASABLE_NONSUM)
tc:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e3:SetValue(cm.fuslimit)
tc:RegisterEffect(e3)
local e4=e1:Clone()
e4:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
tc:RegisterEffect(e4)
local e5=e1:Clone()
e5:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
tc:RegisterEffect(e5)
local e6=e1:Clone()
e6:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
tc:RegisterEffect(e6)
end
end
function cm.fuslimit(e,c,sumtype)
return sumtype==SUMMON_TYPE_FUSION
end
\ No newline at end of file
--隐匿虫的繁衍
local m=11626313
local cm=_G["c"..m]
function c11626313.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--02
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,m)
e2:SetCost(cm.cost)
e2:SetTarget(cm.target2)
e2:SetOperation(cm.activate2)
c:RegisterEffect(e2)
end
cm.SetCard_YM_Crypticinsect=true
function cm.thfilter(c)
return c:IsFaceup() and c.SetCard_YM_Crypticinsect and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.tfilter(c)
return c.SetCard_YM_Crypticinsect and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.tafilter(c,e)
return c:IsFaceup() and c:IsCanBeEffectTarget(e)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() and cm.ctfilter(chkc) end
if chk==0 then
local g=Duel.GetMatchingGroup(cm.tafilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e)
local gg=Duel.GetMatchingGroup(cm.tfilter,tp,LOCATION_MZONE,0,nil)
return gg:GetCount()>0 and g:GetCount()>1
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g1=Duel.SelectTarget(tp,cm.thfilter,tp,LOCATION_MZONE,0,1,1,nil)
e:SetLabelObject(g1:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g2=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,g1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g1,1,0,0)
end
function cm.spfilter(c,e,tp,ra)
return c:IsRace(ra) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local hc=e:GetLabelObject()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc=g:GetFirst()
if tc==hc then tc=g:GetNext() end
local sg=Duel.GetMatchingGroup(cm.spfilter,1-tp,LOCATION_DECK,0,nil,e,1-tp,tc:GetRace())
if hc:IsRelateToEffect(e) and hc:IsControler(tp) and Duel.SendtoHand(hc,nil,REASON_EFFECT)~=0 and hc:IsLocation(LOCATION_HAND) and tc:IsRelateToEffect(e) then
if tc:IsControler(tp) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
Duel.Draw(tp,1,REASON_EFFECT)
if tc:IsControler(1-tp) and sg:GetCount()>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(1-tp,aux.Stringid(m,3)) then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local sg1=sg:Select(1-tp,1,1,nil)
Duel.SpecialSummon(sg1,0,1-tp,1-tp,false,false,POS_FACEUP)
local tc2=sg1:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetValue(RACE_INSECT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc2:RegisterEffect(e1)
end
end
end
--
function cm.costfil(c,tp)
return c:IsRace(RACE_INSECT) and c:IsType(TYPE_MONSTER) and Duel.IsExistingTarget(cm.thfilter,tp,LOCATION_MZONE,0,1,c)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupEx(tp,cm.costfil,1,nil,tp) end
local g=Duel.SelectReleaseGroupEx(tp,cm.costfil,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() and cm.ctfilter(chkc) end
if chk==0 then
local g=Duel.GetMatchingGroup(cm.tafilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e)
local gg=Duel.GetMatchingGroup(cm.tfilter,tp,LOCATION_MZONE,0,nil)
return gg:GetCount()>0 and g:GetCount()>1
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g1=Duel.SelectTarget(tp,cm.thfilter,tp,LOCATION_MZONE,0,1,1,nil)
e:SetLabelObject(g1:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g2=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,g1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g1,1,0,0)
end
function cm.activate2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local hc=e:GetLabelObject()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc=g:GetFirst()
if tc==hc then tc=g:GetNext() end
local sg=Duel.GetMatchingGroup(cm.spfilter,1-tp,LOCATION_DECK,0,nil,e,1-tp,tc:GetRace())
if hc:IsRelateToEffect(e) and hc:IsControler(tp) and Duel.SendtoHand(hc,nil,REASON_EFFECT)~=0 and hc:IsLocation(LOCATION_HAND) and tc:IsRelateToEffect(e) then
if tc:IsControler(tp) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
Duel.Draw(tp,1,REASON_EFFECT)
if tc:IsControler(1-tp) and sg:GetCount()>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(1-tp,aux.Stringid(m,3)) then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local sg1=sg:Select(1-tp,1,1,nil)
Duel.SpecialSummon(sg1,0,1-tp,1-tp,false,false,POS_FACEUP)
local tc2=sg1:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetValue(RACE_INSECT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc2:RegisterEffect(e1)
end
end
if Duel.IsExistingMatchingCard(cm.tfilter,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,4)) then
local dg=Duel.SelectMatchingCard(tp,cm.tfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(dg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,dg)
end
end
\ No newline at end of file
--煌海舰-
local m=25800308
local cm=_G["c"..m]
function cm.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
--
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_EXTRA)
e0:SetValue(SUMMON_TYPE_XYZ)
e0:SetCondition(cm.sprcon)
e0:SetOperation(cm.sprop)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.drcost)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
e2:SetCondition(cm.spcon2)
e2:SetTarget(cm.sptg2)
c:RegisterEffect(e2)
end
function cm.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function cm.sprfilter(c,tp,g,sc)
return ((c:GetOriginalAttribute()&ATTRIBUTE_WATER~=0 and c:GetOriginalLevel()==4 and c:IsLocation(LOCATION_SZONE))
or (c:IsFaceup() and c:IsLocation(LOCATION_MZONE) and c:IsLevel(4) and c:IsAttribute(ATTRIBUTE_WATER)))
and c:IsCanBeXyzMaterial(nil)
end
function cm.spgckfil(g,e,tp)
return Duel.GetLocationCountFromEx(tp,tp,g,nil)
end
function cm.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_ONFIELD,0,nil)
return g:CheckSubGroup(cm.spgckfil,2,2,e,tp)
end
function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_ONFIELD,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g1=g:SelectSubGroup(tp,cm.spgckfil,false,2,2,e,tp)
c:SetMaterial(g1)
Duel.Overlay(c,g1)
end
----
function cm.spfilter(c,e,tp,mc)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsType(TYPE_XYZ) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 and c:IsRank(4)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) then return end
if c:IsFaceup() and c:IsRelateToEffect(e) and c:IsControler(tp) and not c:IsImmuneToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c)
local sc=g:GetFirst()
if sc then
local mg=c:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(sc,mg)
end
sc:SetMaterial(Group.FromCards(c))
Duel.Overlay(sc,Group.FromCards(c))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
end
end
end
----2
function cm.spcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSetCard(0x6212)
end
function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
\ No newline at end of file
--
function c67200910.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(67200910,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,67200910)
e2:SetCondition(c67200910.spcon)
e2:SetTarget(c67200910.sptg)
e2:SetOperation(c67200910.spop)
c:RegisterEffect(e2)
--Destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(67200910,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCountLimit(1,67200911)
e3:SetCondition(c67200910.descon)
e3:SetTarget(c67200910.destg)
e3:SetOperation(c67200910.desop)
c:RegisterEffect(e3)
end
function c67200910.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsEnvironment(67200912,PLAYER_ALL,LOCATION_FZONE)
end
function c67200910.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c67200910.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
---
function c67200910.descon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function c67200910.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c67200910.desop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e1:SetCountLimit(1)
e1:SetOperation(c67200910.desop1)
e1:SetReset(RESET_PHASE+PHASE_BATTLE_START)
Duel.RegisterEffect(e1,tp)
end
function c67200910.desop1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(67200910,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=g:Select(tp,1,1,nil)
Duel.Destroy(g1,REASON_EFFECT)
end
end
\ No newline at end of file
--废都死境
function c67200912.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,67200912+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(c67200912.activate)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c67200912.atktg)
e2:SetValue(500)
c:RegisterEffect(e2)
--Special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(67200912,0))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e4:SetCode(EVENT_DESTROYED)
e4:SetCountLimit(1,67200913)
e4:SetTarget(c67200912.sptg)
e4:SetOperation(c67200912.spop)
c:RegisterEffect(e4)
end
function c67200912.filter(c)
return c:IsSetCard(0x967b) and c:IsAbleToHand()
end
function c67200912.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,0,e:GetHandler())
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
local g11=Duel.GetOperatedGroup()
local g2=g11:GetCount()
if Duel.IsExistingMatchingCard(c67200912.filter,tp,LOCATION_DECK,0,g2,nil) and Duel.SelectYesNo(tp,aux.Stringid(67200912,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g1=Duel.SelectMatchingCard(tp,c67200912.filter,tp,LOCATION_DECK,0,g2,g2,nil)
Duel.SendtoHand(g1,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g1)
end
end
end
--
function c67200912.atktg(e,c)
return c:IsSetCard(0x967b)
end
--
function c67200912.spfilter(c,e,tp)
return c:IsSetCard(0x967b) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) and c:IsType(TYPE_MONSTER)
end
function c67200912.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c67200912.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c67200912.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c67200912.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c67200912.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
end
end
--废都雷狼
function c67200914.initial_effect(c)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(67200914,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,67200914)
e2:SetCondition(c67200914.spcon)
e2:SetTarget(c67200914.sptg)
e2:SetOperation(c67200914.spop)
c:RegisterEffect(e2)
--Destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(67200914,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCountLimit(1,67200915)
e3:SetCondition(c67200914.descon)
e3:SetTarget(c67200914.destg)
e3:SetOperation(c67200914.desop)
c:RegisterEffect(e3)
end
function c67200914.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsEnvironment(67200912,PLAYER_ALL,LOCATION_FZONE)
end
function c67200914.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c67200914.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
---
function c67200914.descon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function c67200914.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c67200914.desop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e1:SetCountLimit(1)
e1:SetOperation(c67200914.desop1)
e1:SetReset(RESET_PHASE+PHASE_BATTLE_START)
Duel.RegisterEffect(e1,tp)
end
function c67200914.filter1(c,e,tp)
return c:IsCode(67200914) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c67200914.filter2(c,e,tp,mc)
local mg=Group.FromCards(c,mc)
return not c:IsType(TYPE_TUNER) and c:IsSetCard(0x967b) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(c67200914.scfilter2,tp,LOCATION_EXTRA,0,1,nil,mg)
end
function c67200914.spfilter2(c,mg)
return c:IsSynchroSummonable(nil,mg,mg:GetCount()-1,mg:GetCount()-1)
end
function c67200914.desop1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and Duel.IsPlayerCanSpecialSummonCount(tp,2) and Duel.IsExistingMatchingCard(c67200914.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(c67200914.filter2,tp,LOCATION_GRAVE,0,1,nil,e,tp,e:GetHandler()) and not Duel.IsPlayerAffectedByEffect(tp,59822133) and Duel.SelectYesNo(tp,aux.Stringid(67200914,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c67200914.filter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
local sc=g:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectMatchingCard(tp,c67200914.filter2,tp,LOCATION_GRAVE,0,1,1,sc,e,tp,sc)
g:Merge(g2)
local ct=Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
local syg=Duel.GetMatchingGroup(c67200914.spfilter2,tp,LOCATION_EXTRA,0,nil,g)
if ct>=2 and syg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=syg:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),nil,g,g:GetCount()-1,g:GetCount()-1)
end
end
end
--废都循猎者
function c67200916.initial_effect(c)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(67200916,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,67200916)
e2:SetCondition(c67200916.spcon)
e2:SetTarget(c67200916.sptg)
e2:SetOperation(c67200916.spop)
c:RegisterEffect(e2)
--Destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(67200916,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCountLimit(1,67200917)
e3:SetCondition(c67200916.descon)
e3:SetTarget(c67200916.destg)
e3:SetOperation(c67200916.desop)
c:RegisterEffect(e3)
end
function c67200916.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsEnvironment(67200912,PLAYER_ALL,LOCATION_FZONE)
end
function c67200916.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c67200916.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
---
function c67200916.descon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function c67200916.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c67200916.desop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e1:SetCountLimit(1)
e1:SetOperation(c67200916.desop1)
e1:SetReset(RESET_PHASE+PHASE_BATTLE_START)
Duel.RegisterEffect(e1,tp)
end
function c67200916.filter0(c,e)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck() and not c:IsImmuneToEffect(e)
end
function c67200916.filter1(c,e,tp,m,f,chkf)
if not (c:IsType(TYPE_FUSION) and (not f or f(c)) and c:IsSetCard(0x967b)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)) then return false end
local res=c:CheckFusionMaterial(m,e:GetHandler(),chkf)
return res
end
function c67200916.flfilter(c)
return c:IsCode(67200916) and c:IsLocation(LOCATION_GRAVE)
end
function c67200916.desop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chkf=tp
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(c67200916.filter0),tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil,e)
local res=Duel.IsExistingMatchingCard(c67200916.filter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,nil,chkf)
if res and Duel.SelectYesNo(tp,aux.Stringid(67200916,2)) then
local sg1=Duel.GetMatchingGroup(c67200916.filter1,tp,LOCATION_EXTRA,0,nil,e,tp,mg,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c67200916.filter1,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg,e:GetHandler(),chkf)
tc:SetMaterial(mat1)
if mat1:IsExists(c67200916.fdfilter,1,nil) then
local cg=mat1:Filter(c67200916.fdfilter,nil)
Duel.ConfirmCards(1-tp,cg)
end
aux.PlaceCardsOnDeckBottom(tp,mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,e:GetHandler(),chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
end
function c67200916.fdfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsFacedown()
end
\ No newline at end of file
--废都魔翼·灭世
function c67200918.initial_effect(c)
--fusion
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,67200916,aux.FilterBoolFunction(Card.IsFusionSetCard,0x967b),2,true,true)
aux.EnablePendulumAttribute(c,false)
--destroy & summon
local e0=Effect.CreateEffect(c)
e0:SetCategory(CATEGORY_DESTROY)
e0:SetType(EFFECT_TYPE_IGNITION)
e0:SetRange(LOCATION_PZONE)
e0:SetCountLimit(1,67200920)
--e0:SetCondition(c67200918.des1con)
e0:SetTarget(c67200918.des1tg)
e0:SetOperation(c67200918.des1op)
c:RegisterEffect(e0)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(67200918,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_EXTRA)
e2:SetCountLimit(1,67200918)
e2:SetCondition(c67200918.spcon)
e2:SetTarget(c67200918.sptg)
e2:SetOperation(c67200918.spop)
c:RegisterEffect(e2)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(67200918,1))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,67200919)
e1:SetTarget(c67200918.destg)
e1:SetOperation(c67200918.desop)
c:RegisterEffect(e1)
end
function c67200918.des1con(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(nil,tp,LOCATION_PZONE,0,1,e:GetHandler())
end
function c67200918.des1tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDestructable() end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function c67200918.des1op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e1:SetCountLimit(1)
e1:SetOperation(c67200918.desop1)
e1:SetReset(RESET_PHASE+PHASE_BATTLE_START)
Duel.RegisterEffect(e1,tp)
end
end
function c67200918.desop1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(67200918,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=g:Select(tp,1,1,nil)
Duel.Destroy(g1,REASON_EFFECT)
end
end
--
function c67200918.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.IsEnvironment(67200912,PLAYER_ALL,LOCATION_FZONE) and c:IsFaceup()
end
function c67200918.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c67200918.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c67200918.destg(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
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c67200918.pcfilter(c)
return c:IsSetCard(0x967b) and c:IsType(TYPE_PENDULUM) and c:IsFaceup() and not c:IsForbidden()
end
function c67200918.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if g:GetCount()>0 then
if Duel.Destroy(g,REASON_EFFECT)~=0 then
if (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) and Duel.IsExistingMatchingCard(c67200918.pcfilter,tp,LOCATION_EXTRA,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(67200918,2)) then
local g=Duel.SelectMatchingCard(tp,c67200918.pcfilter,tp,LOCATION_EXTRA,0,1,1,nil)
if g:GetCount()>0 then
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
end
end
end
\ No newline at end of file
--废都圣翼·救世
function c67200921.initial_effect(c)
c:EnableReviveLimit()
aux.EnablePendulumAttribute(c,false)
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x967b),aux.NonTuner(Card.IsSetCard,0x967b),1)
--destroy & summon
local e0=Effect.CreateEffect(c)
e0:SetCategory(CATEGORY_DESTROY)
e0:SetType(EFFECT_TYPE_IGNITION)
e0:SetRange(LOCATION_PZONE)
e0:SetCountLimit(1,67200923)
--e0:SetCondition(c67200921.des1con)
e0:SetTarget(c67200921.des1tg)
e0:SetOperation(c67200921.des1op)
c:RegisterEffect(e0)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(67200921,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_EXTRA)
e1:SetCountLimit(1,67200921)
e1:SetCondition(c67200921.spcon)
e1:SetTarget(c67200921.sptg)
e1:SetOperation(c67200921.spop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(67200921,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,67200919)
e2:SetTarget(c67200921.destg)
e2:SetOperation(c67200921.desop)
c:RegisterEffect(e2)
end
function c67200921.des1con(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(nil,tp,LOCATION_PZONE,0,1,e:GetHandler())
end
function c67200921.des1tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDestructable() end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function c67200921.des1op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e1:SetCountLimit(1)
e1:SetOperation(c67200921.desop1)
e1:SetReset(RESET_PHASE+PHASE_BATTLE_START)
Duel.RegisterEffect(e1,tp)
end
end
function c67200921.desop1(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.nzatk,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if #g==0 then return end
Duel.HintSelection(g)
local tc=g:GetFirst()
if tc and Duel.SelectYesNo(tp,aux.Stringid(67200921,3)) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(0)
tc:RegisterEffect(e1)
end
end
--
function c67200921.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.IsEnvironment(67200912,PLAYER_ALL,LOCATION_FZONE) and c:IsFaceup()
end
function c67200921.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c67200921.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--
function c67200921.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c67200921.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c67200921.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(c67200921.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function c67200921.pcfilter(c)
return c:IsSetCard(0x967b) and c:IsType(TYPE_PENDULUM) and c:IsFaceup() and not c:IsForbidden()
end
function c67200921.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c67200921.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
if (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) and Duel.IsExistingMatchingCard(c67200921.pcfilter,tp,LOCATION_EXTRA,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(67200921,2)) then
local g=Duel.SelectMatchingCard(tp,c67200921.pcfilter,tp,LOCATION_EXTRA,0,1,1,nil)
if g:GetCount()>0 then
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
end
end
\ No newline at end of file
--废都虹翼·轮回
function c67200924.initial_effect(c)
c:SetSPSummonOnce(67200924)
c:EnableReviveLimit()
aux.EnablePendulumAttribute(c,false)
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon rule
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(c67200924.sprcon)
e2:SetOperation(c67200924.sprop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(67200924,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCondition(c67200924.spcon)
e3:SetTarget(c67200924.sptg)
e3:SetOperation(c67200924.spop)
c:RegisterEffect(e3)
end
function c67200924.sprfilter(c)
return c:IsFaceup() and c:IsLevelAbove(5) and c:IsReleasable()
end
function c67200924.sprfilter1(c,tp,g,sc)
local lv=c:GetLevel()
return c:IsCode(67200918) and g:IsExists(c67200924.sprfilter2,1,c,tp,c,sc)
end
function c67200924.sprfilter2(c,tp,mc,sc)
local sg=Group.FromCards(c,mc)
return c:IsCode(67200921)
and Duel.GetLocationCountFromEx(tp,tp,sg,sc)>0
end
function c67200924.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(c67200924.sprfilter,tp,LOCATION_MZONE,0,nil)
return g:IsExists(c67200924.sprfilter1,1,nil,tp,g,c)
end
function c67200924.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c67200924.sprfilter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g1=g:FilterSelect(tp,c67200924.sprfilter1,1,1,nil,tp,g,c)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g2=g:FilterSelect(tp,c67200924.sprfilter2,1,1,mc,tp,mc,c,mc:GetLevel())
g1:Merge(g2)
Duel.Release(g1,REASON_COST)
end
--
function c67200924.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c67200924.spfilter1(c,e,tp)
return c:IsCode(67200918) and c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c67200924.spfilter2(c,e,tp)
return c:IsCode(67200921) and c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c67200924.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCountFromEx(tp,tp,nil,c)>1
and Duel.IsExistingMatchingCard(c67200924.spfilter1,tp,LOCATION_EXTRA,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(c67200924.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp) and not Duel.IsPlayerAffectedByEffect(tp,59822133) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_EXTRA)
end
function c67200924.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp,tp,nil,c)<2 or Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c67200924.spfilter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectMatchingCard(tp,c67200924.spfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
g:Merge(g1)
if g:GetCount()==2 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--废都巡龙
function c67200925.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,nil,2,3,c67200925.lcheck)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(67200925,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,67200925)
e1:SetCondition(c67200925.thcon1)
e1:SetTarget(c67200925.thtg1)
e1:SetOperation(c67200925.thop1)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(67200925,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,67200926)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetTarget(c67200925.sptg)
e2:SetOperation(c67200925.spop)
c:RegisterEffect(e2)
end
function c67200925.lcheck(g,lc)
return g:IsExists(Card.IsLinkSetCard,1,nil,0x967b)
end
--
function c67200925.thcon1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c67200925.thfilter1(c)
return c:IsCode(67200912) and c:IsAbleToHand()
end
function c67200925.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c67200925.thfilter1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c67200925.thop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c67200925.thfilter1,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--
function c67200925.tgfilter(c,tp)
return (c:IsType(TYPE_SPELL) or c:IsType(TYPE_TRAP))
end
function c67200925.spfilter(c,e,tp)
return not c:IsCode(67200925) and c:IsSetCard(0x967b) and c:IsDestructable()
end
function c67200925.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c67200925.tgfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c67200925.tgfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,tp)
and Duel.IsExistingMatchingCard(c67200925.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c67200925.tgfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c67200925.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c67200925.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
end
\ No newline at end of file
--废都界碑
function c67200927.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(67200927,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,67200927+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c67200927.target)
e1:SetOperation(c67200927.activate)
c:RegisterEffect(e1)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCountLimit(1,67200928)
e3:SetCondition(c67200927.spcon)
e3:SetTarget(c67200927.sptg)
e3:SetOperation(c67200927.spop)
c:RegisterEffect(e3)
end
function c67200927.filter1(c)
return c:IsSetCard(0x967b) and c:IsDestructable()
end
function c67200927.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c67200927.filter1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_DECK)
end
function c67200927.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c67200927.filter1,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
--
function c67200927.spcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function c67200927.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and
Duel.IsPlayerCanSpecialSummonMonster(tp,67200927,0,TYPES_EFFECT_TRAP_MONSTER,0,2000,5,RACE_ZOMBIE,ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c67200927.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,67200927,0,TYPES_EFFECT_TRAP_MONSTER,0,2000,5,RACE_ZOMBIE,ATTRIBUTE_DARK) then return end
c:AddMonsterAttribute(TYPE_EFFECT+TYPE_TRAP)
Duel.SpecialSummon(c,SUMMON_VALUE_SELF,tp,tp,true,false,POS_FACEUP)
end
\ No newline at end of file
--废都巡礼者
function c67200929.initial_effect(c)
local e0=aux.AddThisCardInGraveAlreadyCheck(c)
--spsummon itself
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(67200929,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetLabelObject(e0)
e2:SetCountLimit(1,67200929)
e2:SetCondition(c67200929.spcon)
e2:SetTarget(c67200929.sptg)
e2:SetOperation(c67200929.spop)
c:RegisterEffect(e2)
--destory
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCountLimit(1,67200930)
e3:SetCondition(c67200929.descon)
e3:SetTarget(c67200929.destg)
e3:SetOperation(c67200929.desop)
c:RegisterEffect(e3)
end
function c67200929.egfilter(c,se)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsReason(REASON_EFFECT)
and (not c:IsPreviousLocation(LOCATION_ONFIELD) or (c:GetPreviousTypeOnField()&TYPE_MONSTER>0 and not c:IsPreviousLocation(LOCATION_SZONE)))
and (se==nil or c:GetReasonEffect()~=se)
end
function c67200929.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(c67200929.egfilter,1,nil,se) and not eg:IsContains(c)
end
function c67200929.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c67200929.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--
function c67200929.descon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function c67200929.desfilter1(c)
return c:IsCode(67200931) and c:IsDestructable()
end
function c67200929.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c67200929.desfilter1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_DECK)
end
function c67200929.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c67200929.desfilter1,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
\ No newline at end of file
--废都浸礼者
function c67200931.initial_effect(c)
local e0=aux.AddThisCardInGraveAlreadyCheck(c)
--fusion spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(67200931,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetLabelObject(e0)
e2:SetCountLimit(1,67200931)
e2:SetCondition(c67200931.spcon)
e2:SetTarget(c67200931.sptg)
e2:SetOperation(c67200931.spop)
c:RegisterEffect(e2)
--destory
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCountLimit(1,67200932)
e3:SetCondition(c67200931.descon)
e3:SetTarget(c67200931.destg)
e3:SetOperation(c67200931.desop)
c:RegisterEffect(e3)
end
function c67200931.egfilter(c,se)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsReason(REASON_EFFECT)
and (not c:IsPreviousLocation(LOCATION_ONFIELD) or (c:GetPreviousTypeOnField()&TYPE_MONSTER>0 and not c:IsPreviousLocation(LOCATION_SZONE)))
and (se==nil or c:GetReasonEffect()~=se)
end
function c67200931.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(c67200931.egfilter,1,nil,se) and not eg:IsContains(c)
end
function c67200931.filter1(c,e)
return not c:IsImmuneToEffect(e) and c:IsDestructable(e)
end
function c67200931.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c)) and c:IsSetCard(0x967b)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c67200931.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local res=Duel.IsExistingMatchingCard(c67200931.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c67200931.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_ONFIELD)
end
function c67200931.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c67200931.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(c67200931.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c67200931.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
local res=false
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
if Duel.Destroy(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)==#mat1 then
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
res=true
end
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
res=true
end
if res then
tc:CompleteProcedure()
end
end
end
--
function c67200931.descon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function c67200931.desfilter1(c)
return c:IsCode(67200929) and c:IsDestructable()
end
function c67200931.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c67200931.desfilter1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_DECK)
end
function c67200931.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c67200931.desfilter1,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
--废都洗礼者
function c67200933.initial_effect(c)
--fusion
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,67200929,aux.FilterBoolFunction(Card.IsFusionSetCard,0x967b),1,true,true)
--Destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(67200933,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,67200933)
e3:SetCondition(c67200933.descon)
e3:SetTarget(c67200933.destg)
e3:SetOperation(c67200933.desop)
c:RegisterEffect(e3)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(67200933,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,67200934)
e2:SetCondition(c67200933.discon)
e2:SetTarget(c67200933.distg)
e2:SetOperation(c67200933.disop)
c:RegisterEffect(e2)
end
--
function c67200933.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY)
and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c67200933.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c67200933.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--
function c67200933.discon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
end
function c67200933.thfilter(c)
return c:IsFaceup()
end
function c67200933.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c67200933.thfilter,rp,0,LOCATION_MZONE,1,nil) end
end
function c67200933.disop(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,c67200933.repop)
end
function c67200933.repop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.SelectMatchingCard(tp,c67200933.thfilter,tp,0,LOCATION_MZONE,1,1,nil)
if sg:GetCount()>0 then
Duel.Destroy(sg,REASON_EFFECT)
end
end
--废都奇点
function c67200935.initial_effect(c)
--Activate(effect)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_ACTIVATE)
e4:SetCode(EVENT_CHAINING)
e4:SetCountLimit(1,67200935)
e4:SetCondition(c67200935.condition)
e4:SetTarget(c67200935.target)
e4:SetOperation(c67200935.activate)
c:RegisterEffect(e4)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCountLimit(1,67200936)
e3:SetCondition(c67200935.spcon)
e3:SetTarget(c67200935.sptg)
e3:SetOperation(c67200935.spop)
c:RegisterEffect(e3)
end
function c67200935.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsChainNegatable(ev) and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE))
end
function c67200935.filter1(c)
return c:IsSetCard(0x967b) and c:IsDestructable() and c:IsFaceupEx() and c:IsType(TYPE_MONSTER)
end
function c67200935.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c67200935.filter1,tp,LOCATION_MZONE+LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c67200935.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c67200935.filter1,tp,LOCATION_MZONE+LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
end
--
function c67200935.spcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function c67200935.thfilter(c)
return c:IsCode(67200912) and c:IsAbleToHand()
end
function c67200935.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c67200935.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE+LOCATION_DECK)
end
function c67200935.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c67200935.thfilter),tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
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