Commit a4e46478 authored by nanahira's avatar nanahira

2020.06.08

parent 86ce3e0c
#created by Player
#main
1000402
1000406
1000407
1008000
1008001
1008002
1008003
1008007
1008008
1008014
1008015
1008020
1008021
1008022
1008023
1008024
1008025
1008027
1008037
1008038
1009001
1009002
1009003
1009004
1009005
1009006
1009007
1009008
1009009
1009010
1009015
1009018
1009019
1009020
1009021
1009022
1009023
1009030
1009031
1009032
1009033
1009034
1009035
1009036
1009037
1009039
1009040
#extra
1008010
1008011
1008032
1008033
1009011
1009012
1009013
1009014
1009016
1009017
!side
1009024
1009025
1009026
1009027
1009028
1009029
1009038
#created by Player
#main
9910279
9910293
9910378
9910379
9910380
10220000
11200105
11200107
11200210
16101107
16101109
16102000
16102001
16102005
16102006
17045007
17045008
26816011
26820006
26820008
30558001
30558002
30558003
30558004
30558005
30558006
30558008
30558009
30558011
30558013
33500501
33500502
33500503
33500510
#extra
11200207
17045006
26820005
26820007
30558007
!side
#created by Player
#main
53701001
53701002
53701004
53701005
53701006
53701008
53701010
53701019
53701022
53701024
53701030
53707001
53707002
53707003
53707004
53707005
53707007
53707008
53707009
53707013
53798001
53798002
53798003
53799021
53799035
53799036
53799037
53799038
53799039
53799040
53799043
#extra
53701003
53701009
53701015
53701017
53701026
53707006
53707010
53707011
53707012
53799041
!side
#created by Player
#main
75646001
75646003
75646011
75646549
75646801
75646850
75646851
75646853
82204215
82204216
82204217
82204218
82204219
82204220
82204221
82204222
82204223
82204224
82228600
82228601
82228602
82228604
82228605
82228606
82228607
82228608
82228610
82228612
82228613
82228614
82228615
82228616
#extra
75646051
75646059
75646063
75646074
75646852
75646854
82228603
82228609
82228611
!side
#created by Player
#main
81005008
81005021
81005024
81005025
81005039
81005040
81005041
81005047
81005049
81005052
81005053
81005054
81005060
81006022
81006026
81010041
81011041
81011042
81011043
81013010
81013011
81013019
81013020
81014052
81027019
81011031
#extra
81005004
81005050
81006019
81006027
81006033
81011040
81013012
81014031
!side
81005038
81006044
81011005
81013008
81013013
81014008
81014041
81014049
#created by Player
#main
81009006
81009025
81009029
81010006
81010013
81010023
81010024
81010025
81010026
81010031
81010033
81010034
81010041
81011039
#extra
81009001
81009002
81009003
81009004
81011025
81011052
81014002
!side
81009007
81009008
81009010
81009016
81009017
81009030
#created by Player
#main
17052935
17052938
17052939
17060945
17060946
19100000
19100001
19100004
26803009
26803010
26818001
26818003
26818004
26818005
26818006
26818008
26818015
26821017
30000200
30000205
30000220
33330080
53799047
53799048
53799052
75646002
75646007
75646015
75646270
75646301
#extra
17052940
75646052
75646060
75646064
75646066
75646075
!side
#created by Player
#main
81005065
81005067
81010045
81010046
81011059
81017028
81022015
81022016
81022017
81022018
81022019
81022020
81022021
81022022
81022023
81027020
81027021
81027022
81041033
87000011
87000012
87000013
87000014
87000015
87000016
87000017
87000020
87000021
87000022
87000023
#extra
81005066
81005068
81005069
81005070
81005071
87000018
87000019
87000024
!side
No preview for this file type
......@@ -198,6 +198,7 @@
12056005 1 --你偷看了?
12037003 0 --战场的巫鸣鸟 迦陵频伽
12037052 0 --极丽六鸟 紧那罗
12038003 1 --偶像P 普利兹姆
#140
14000509 2 --异态魔女·过去式
14000510 2 --异态魔女·进行时
......@@ -351,6 +352,7 @@
17060944 0 --双圣的战姬 乌莎哈
17010304 0 --劫虚之翼 路西法
17011103 0 --约束的天司长 圣德芬
17001055 0 --至高之神·宙斯
#180
18004008 0 --性感手枪拔枪术
18005010 0 --封锁的拟魂
......@@ -901,6 +903,7 @@
65071159 0 --光之种
65071158 1 --破土种光的生命树
65040049 0 --单向基因组
65030012 0 --树阴围绕的遥远耀光
#666
66619920 0 --AIW·绽放之蝶
#669
......@@ -990,6 +993,7 @@
81009006 2 --不悦目光·橘爱丽丝
81013013 0 --心无城府的学姐
81027019 1 --灯火之苍钟
81005071 0 --黑野紫
#822
82228501 1 --光之精灵王 斯嘉丽
82228505 1 --神秘之精灵王 米斯蒂克
......
expansions/pics/26818001.jpg

64.9 KB | W: | H:

expansions/pics/26818001.jpg

67.8 KB | W: | H:

expansions/pics/26818001.jpg
expansions/pics/26818001.jpg
expansions/pics/26818001.jpg
expansions/pics/26818001.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/26818003.jpg

66.6 KB | W: | H:

expansions/pics/26818003.jpg

68.1 KB | W: | H:

expansions/pics/26818003.jpg
expansions/pics/26818003.jpg
expansions/pics/26818003.jpg
expansions/pics/26818003.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/26818004.jpg

69.1 KB | W: | H:

expansions/pics/26818004.jpg

73.1 KB | W: | H:

expansions/pics/26818004.jpg
expansions/pics/26818004.jpg
expansions/pics/26818004.jpg
expansions/pics/26818004.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/26818005.jpg

73.8 KB | W: | H:

expansions/pics/26818005.jpg

73.8 KB | W: | H:

expansions/pics/26818005.jpg
expansions/pics/26818005.jpg
expansions/pics/26818005.jpg
expansions/pics/26818005.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/26818006.jpg

71.9 KB | W: | H:

expansions/pics/26818006.jpg

73.1 KB | W: | H:

expansions/pics/26818006.jpg
expansions/pics/26818006.jpg
expansions/pics/26818006.jpg
expansions/pics/26818006.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/26818008.jpg

64.7 KB | W: | H:

expansions/pics/26818008.jpg

66.7 KB | W: | H:

expansions/pics/26818008.jpg
expansions/pics/26818008.jpg
expansions/pics/26818008.jpg
expansions/pics/26818008.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/26818015.jpg

72 KB | W: | H:

expansions/pics/26818015.jpg

72.2 KB | W: | H:

expansions/pics/26818015.jpg
expansions/pics/26818015.jpg
expansions/pics/26818015.jpg
expansions/pics/26818015.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/75646007.jpg

52.3 KB | W: | H:

expansions/pics/75646007.jpg

53.2 KB | W: | H:

expansions/pics/75646007.jpg
expansions/pics/75646007.jpg
expansions/pics/75646007.jpg
expansions/pics/75646007.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/75646060.jpg

47.4 KB | W: | H:

expansions/pics/75646060.jpg

47.9 KB | W: | H:

expansions/pics/75646060.jpg
expansions/pics/75646060.jpg
expansions/pics/75646060.jpg
expansions/pics/75646060.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/75646301.jpg

48 KB | W: | H:

expansions/pics/75646301.jpg

48.6 KB | W: | H:

expansions/pics/75646301.jpg
expansions/pics/75646301.jpg
expansions/pics/75646301.jpg
expansions/pics/75646301.jpg
  • 2-up
  • Swipe
  • Onion skin
......@@ -3,7 +3,6 @@ if not pcall(function() require("expansions/script/c10199991") end) then require
local m=10199990
local vm=10199991
local Version_Number=20200409
-----------------------"Part_Effect_Base"-----------------------
--Effect: Get default hint string for Duel.Hint ,use in effect target
......@@ -114,7 +113,7 @@ function rsef.GetRegisterRange(cardtbl)
end
--Effect: Get Flag for SetProperty
function rsef.GetRegisterProperty(mixflag)
local flagstringlist={"tg","ptg","de","dsp","dcal","ii","sa","ir","sr","bs","uc","cd","cn","ch","lz","at","sp"}
local flagstringlist={"tg","ptg","de","dsp","dcal","ii","sa","ir","sr","bs","uc","cd","cn","ch","lz","at","sp","ep"}
return rsof.Mix_Value_To_Table(mixflag,flagstringlist,rsflag.flaglist)
end
rsflag.GetRegisterProperty=rsef.GetRegisterProperty
......@@ -446,14 +445,14 @@ function rsef.SV_ATTRIBUTE(cardtbl,atttbl,valtbl,con,resettbl,flag,desctbl,ctlim
for k,effectcode in ipairs(effectcodetbl) do
local range=rsef.GetRegisterRange(cardtbl)
if rsof.Table_List(rangelist["pzone"],effectcode) then range=LOCATION_PZONE end
if rsof.Table_List(rangelist["nil"],effectcode) then range=nil end
--if rsof.Table_List(rangelist["nil"],effectcode) then range=nil end
if effectvaluetbl[k] then
local e1=nil
if type(effectvaluetbl[k])~="string" then
e1=rsef.SV(cardtbl,effectcode,effectvaluetbl[k],range,con,resettbl,flag,desctbl)
else -- use for set code
e1=rsef.SV(cardtbl,effectcode,0,range,con,resettbl,flag,desctbl)
rsef.valinfo[e1]=effectvaluetbl[k]
rsval.valinfo[e1]=effectvaluetbl[k]
if c2:GetFlagEffect(rscode.Previous_Set_Code)==0 then
local e2=rsef.SC({c2,true},EVENT_LEAVE_FIELD_P,nil,nil,"cd,uc",nil,rsef.presetop)
c2:RegisterFlagEffect(rscode.Previous_Set_Code,0,0,1)
......@@ -740,22 +739,24 @@ function rsef.FV_INDESTRUCTABLE(cardtbl,indstbl,valtbl,tg,tgrangetbl,con,resettb
end
--Field Val Effect: Other Limit
function rsef.FV_LIMIT(cardtbl,lotbl,valtbl,tg,tgrangetbl,con,resettbl,flag,desctbl)
local codetbl1={"dis","dise","tri","atk","atkan","datk","ress","resns","td","th","cp","res"}
local codetbl2={ EFFECT_DISABLE,EFFECT_DISABLE_EFFECT,EFFECT_CANNOT_TRIGGER,EFFECT_CANNOT_ATTACK,EFFECT_CANNOT_ATTACK_ANNOUNCE,EFFECT_CANNOT_DIRECT_ATTACK,EFFECT_CANNOT_RELEASE,EFFECT_UNRELEASABLE_SUM,EFFECT_UNRELEASABLE_NONSUM,EFFECT_CANNOT_TO_DECK,EFFECT_CANNOT_TO_HAND,EFFECT_CANNOT_CHANGE_POSITION }
local codetbl1={"dis","dise","tri","atk","atkan","datk","res","ress","resns","td","th","cp","cpe"}
local codetbl2={ EFFECT_DISABLE,EFFECT_DISABLE_EFFECT,EFFECT_CANNOT_TRIGGER,EFFECT_CANNOT_ATTACK,EFFECT_CANNOT_ATTACK_ANNOUNCE,EFFECT_CANNOT_DIRECT_ATTACK,EFFECT_CANNOT_RELEASE,EFFECT_UNRELEASABLE_SUM,EFFECT_UNRELEASABLE_NONSUM,EFFECT_CANNOT_TO_DECK,EFFECT_CANNOT_TO_HAND,EFFECT_CANNOT_CHANGE_POSITION,EFFECT_CANNOT_CHANGE_POS_E }
local effectcodetbl,effectvaluetbl=rsof.Table_Suit(lotbl,codetbl1,codetbl2,valtbl)
local resulteffecttbl={}
local range=rsef.GetRegisterRange(cardtbl)
if not tgrangetbl then tgrangetbl={ 0,LOCATION_MZONE } end
for k,effectcode in ipairs(effectcodetbl) do
local e1=rsef.FV(cardtbl,effectcode,effectvaluetbl[k],tg,tgrangetbl,range,con,resettbl,flag,desctbl)
local flag2=rsef.GetRegisterProperty(flag)|EFFECT_FLAG_SET_AVAILABLE
flag2=effectcode==EFFECT_CANNOT_CHANGE_POSITION and flag2 or flag2|EFFECT_FLAG_IGNORE_IMMUNE
local e1=rsef.FV(cardtbl,effectcode,effectvaluetbl[k],tg,tgrangetbl,range,con,resettbl,flag2,desctbl)
table.insert(resulteffecttbl,e1)
end
return table.unpack(resulteffecttbl)
end
--Field Val Effect: Other Limit (affect Player)
function rsef.FV_LIMIT_PLAYER(cardtbl,lotbl,valtbl,tg,tgrangetbl,con,resettbl,flag,desctbl)
local codetbl1={"act","sum","sp","th","dr","td","tg","res","rm","sbp","sm1","sm2","sdp","ssp","sset","mset","dish","disd","fp"}
local codetbl2={ EFFECT_CANNOT_ACTIVATE,EFFECT_CANNOT_SUMMON,EFFECT_CANNOT_SPECIAL_SUMMON,EFFECT_CANNOT_TO_HAND,EFFECT_CANNOT_DRAW,EFFECT_CANNOT_TO_DECK,EFFECT_CANNOT_TO_GRAVE,EFFECT_CANNOT_RELEASE,EFFECT_CANNOT_REMOVE,EFFECT_CANNOT_BP,EFFECT_SKIP_M1,EFFECT_SKIP_M2,EFFECT_SKIP_DP,EFFECT_SKIP_SP,EFFECT_CANNOT_SSET,EFFECT_CANNOT_MSET,EFFECT_CANNOT_DISCARD_HAND,EFFECT_CANNOT_DISCARD_DECK,EFFECT_CANNOT_FLIP_SUMMON }
local codetbl1={"act","sum","sp","th","dr","td","tg","res","rm","sbp","sm1","sm2","sdp","ssp","sset","mset","dish","disd","fp","cp"}
local codetbl2={ EFFECT_CANNOT_ACTIVATE,EFFECT_CANNOT_SUMMON,EFFECT_CANNOT_SPECIAL_SUMMON,EFFECT_CANNOT_TO_HAND,EFFECT_CANNOT_DRAW,EFFECT_CANNOT_TO_DECK,EFFECT_CANNOT_TO_GRAVE,EFFECT_CANNOT_RELEASE,EFFECT_CANNOT_REMOVE,EFFECT_CANNOT_BP,EFFECT_SKIP_M1,EFFECT_SKIP_M2,EFFECT_SKIP_DP,EFFECT_SKIP_SP,EFFECT_CANNOT_SSET,EFFECT_CANNOT_MSET,EFFECT_CANNOT_DISCARD_HAND,EFFECT_CANNOT_DISCARD_DECK,EFFECT_CANNOT_FLIP_SUMMON,EFFECT_CANNOT_CHANGE_POSITION }
local effectcodetbl,effectvaluetbl=rsof.Table_Suit(lotbl,codetbl1,codetbl2,valtbl)
local resulteffecttbl={}
local range=rsef.GetRegisterRange(cardtbl)
......@@ -855,23 +856,23 @@ function rsef.ACT(cardtbl,code,desctbl,ctlimittbl,cate,flag,con,cost,tg,op,timin
end
--Activate Effect: Equip Spell
function rsef.ACT_EQUIP(cardtbl,eqfilter,desctbl,ctlimittbl,con,cost)
if not desctbl then desctbl=rshint.eq end
if not eqfilter then eqfilter=Card.IsFaceup end
desctbl=desctbl or rshint.eq
eqfilter=eqfilter or Card.IsFaceup
local eqfilter2=eqfilter
eqfilter=function(c,e,tp)
return c:IsFaceup() and eqfilter2(c,tp)
end
local e1=rsef.ACT(cardtbl,nil,desctbl,ctlimittbl,"eq","tg",con,cost,rstg.target({eqfilter,"eq",LOCATION_MZONE,LOCATION_MZONE,1}),rsef.ACT_EQUIP_op)
local e2=rsef.SV(cardtbl,EFFECT_EQUIP_LIMIT,rsef.ACT_EQUIP_val(eqfilter),nil,nil,nil,"cd")
local e1=rsef.ACT(cardtbl,nil,desctbl,ctlimittbl,"eq","tg",con,cost,rstg.target({eqfilter,"eq",LOCATION_MZONE,LOCATION_MZONE,1}),rsef.ACT_EQUIP_Op)
local e2=rsef.SV(cardtbl,EFFECT_EQUIP_LIMIT,rsef.ACT_EQUIP_Val(eqfilter),nil,nil,nil,"cd")
return e1,e2
end
function rsef.ACT_EQUIP_op(e,tp,eg,ep,ev,re,r,rp)
function rsef.ACT_EQUIP_Op(e,tp,eg,ep,ev,re,r,rp)
local tc=rscf.GetTargetCard(Card.IsFaceup)
if e:GetHandler():IsRelateToEffect(e) and tc then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function rsef.ACT_EQUIP_val(eqfilter)
function rsef.ACT_EQUIP_Val(eqfilter)
return function(e,c)
local tp=e:GetHandlerPlayer()
return eqfilter(c,tp)
......@@ -985,9 +986,18 @@ function rsef.FC_AttachEffect(cardtbl,force,attachtime,desctbl,ctlimittbl,flag,r
local e1=rsef.FC(cardtbl,attachcode,desctbl,nil,flag,range,rsef.FC_AttachEffect_Con(e0,attachcon),rsef.FC_AttachEffect_Op(e0,force),resettbl)
e1:SetValue(attachop)
e1:SetLabelObject(e0)
local desc=not desctbl and 0 or rsef.RegisterDescription(nil,desctbl,true)
if aux.GetValueType(var2)=="Card" then
local desc=not desctbl and 0 or rsef.RegisterDescription(nil,desctbl,true)
var2:RegisterFlagEffect(attachcode,reset,EFFECT_FLAG_CLIENT_HINT,resetct,e1:GetFieldID(),desc)
else
local e1=Effect.CreateEffect(c1)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(0x10000000+attachcode)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetDescription(desc)
e1:SetTargetRange(1,0)
e1:SetReset(reset,resetct)
Duel.RegisterEffect(e1,var2)
end
if rsef.FC_AttachEffect_Switch then return e1 end
rsef.FC_AttachEffect_Switch=true
......@@ -1033,11 +1043,11 @@ end
function rsef.ChangeChainOperation2(ev,changeop,ischange)
rsef.ChangeChainOperation(ev,changeop)
if ischange then return end
rsef.baseop[ev]=changeop
rsop.baseop[ev]=changeop
end
function rsef.FC_AttachEffect_ChangeOp(e,tp,eg,ep,ev,re,r,rp)
local baseop=re:GetOperation() or aux.TRUE
baseop=rsef.baseop[ev] or baseop
baseop=rsop.baseop[ev] or baseop
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVED)
......@@ -1052,11 +1062,11 @@ function rsef.FC_AttachEffect_Reset(re1,baseop)
rsef.attacheffect[ev]=nil
rsef.attacheffectf[ev]=nil
rsef.solveeffect[ev]=nil
rsef.baseop[ev]=nil
rsop.baseop[ev]=nil
local rc=re:GetHandler()
local res1=re:IsHasType(EFFECT_TYPE_ACTIVATE) and rc:IsType(TYPE_PENDULUM+TYPE_FIELD+TYPE_CONTINUOUS)
local res1=re:IsHasType(EFFECT_TYPE_ACTIVATE) and rc:IsType(TYPE_PENDULUM+TYPE_FIELD+TYPE_CONTINUOUS+TYPE_EQUIP)
local res2=#({rc:IsHasEffect(EFFECT_REMAIN_FIELD)})>0
if (res1 or res2) and not rsef.baseop[ev2] then
if (res1 or res2) and not rsop.baseop[ev2] then
re:SetOperation(baseop)
rc:CancelToGrave(true)
end
......@@ -1148,93 +1158,81 @@ function rsef.FC_AttachEffect_ChangeOp2(baseop)
rsef.FC_AttachEffect_Solve(rsef.solveeffect[ev2],0x4,e,tp,eg,ep,ev,re,r,rp)
end
end
----------------"Part_Effect_SingleContinuous"----------------
--Single Continues: Base set
function rsef.SC(cardtbl,code,desctbl,ctlimittbl,flag,con,op,resettbl)
return rsef.Register(cardtbl,EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS,code,desctbl,ctlimittbl,nil,flag,nil,con,nil,nil,op,nil,nil,nil,resettbl)
end
-------------------"Part_Summon_Function"---------------------
--Summon Function: Quick Special Summon buff
--valtbl:{atk,def,lv}
--waytbl:{way,resettbl}
function rssf.SummonBuff(valtbl,dis,trigger,leaveloc,waytbl)
return function(c,sc,e,tp,sg)
local reset=((c==sc and not sg or #sg==1) and rsreset.est_d or rsreset.est)
if valtbl then
local atk,def,lv=valtbl[1],valtbl[2],valtbl[3]
rsef.SV_SET({c,sc,true},"atk,def",{atk,def},nil,reset)
rsef.SV_CHANGE({c,sc,true},"lv",lv,nil,reset)
end
if dis then
rsef.SV_LIMIT({c,sc,true},"dis,dise",nil,nil,reset)
end
if trigger then
rsef.SV_LIMIT({c,tc,true},"tri",nil,nil,reset)
end
if type(leaveloc)=="number" then
local flag=nil
if c==sc then flag=EFFECT_CANNOT_DISABLE end
rsef.SV_REDIRECT({c,sc,true},"leave",leaveloc,nil,rsreset.ered,flag)
end
if waytbl then
if type(waytbl)=="string" then waytbl={waytbl} end
if type(waytbl)=="boolean" then waytbl={"des"} end
local way=waytbl[1]
local resettbl=waytbl[2]
if not resettbl then resettbl={0,1} end
local reset2,resetct,resetplayer=resettbl[1],resettbl[2],resettbl[3]
local fid=c:GetFieldID()
for tc in aux.Next(sg) do
tc:RegisterFlagEffect(rscode.Summon_Flag,rsreset.est+reset2,0,resetct,fid)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
if reset2 and reset2~=0 then
e1:SetReset(reset2,resetct)
end
e1:SetDescription(rshint.epleave)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
sg:KeepAlive()
e1:SetLabelObject(sg)
e1:SetCondition(rssf.SummonBuff_Con(fid,resetct,resetplayer))
e1:SetOperation(rssf.SummonBuff_Op(fid,way))
Duel.RegisterEffect(e1,tp)
end
end
--Effect Function:XXX card/group will leave field in XXX Phase , often use in special summon
function rsef.FC_PHASELEAVE(cardtbl,sg,times,whos,phase,leaveway,resettbl)
--times: nil every phase
-- 0 next phase
-- 1 or + times phase
--whos: nil each player
-- 0 yours phase (tp)
-- 1 your opponent's phase (1-tp)
local c1,var2=rsef.GetRegisterCard(cardtbl)
local cphase=Duel.GetCurrentPhase()
local turnctlist={Duel.GetTurnCount(),Duel.GetTurnCount(var2),Duel.GetTurnCount(1-var2)}
local turnp=Duel.GetTurnPlayer()
phase=phase or PHASE_END
leaveway=leaveway or "des"
if times==0 and whos==0 and turnp==tp then
times=cphase<=phase and 2 or 1
end
if times==0 and whos==1 and turnp~=tp then
times=cphase<=phase and 2 or 1
end
local fid=c1:GetFieldID()
for tc in aux.Next(sg) do
tc:RegisterFlagEffect(rscode.Phase_Leave_Flag,rsreset.est+RESET_PHASE+phase,0,0,fid)
end
local e1=rsef.FC(cardtbl,EVENT_PHASE+phase,rshint.epleave,1,"ii",nil,rsef.FC_PhaseLeave_Con(cphase,turnctlist,turnp,fid,times,whos),rsef.FC_PhaseLeave_Op(leaveway,fid),resettbl)
sg:KeepAlive()
e1:SetLabelObject(sg)
return e1
end
function rssf.SummonBuff_Filter(c,e,fid)
return c:GetFlagEffectLabel(rscode.Summon_Flag)==fid
function rsef.FC_PhaseLeave_Filter(c,fid)
return c:GetFlagEffectLabel(rscode.Phase_Leave_Flag)==fid
end
function rssf.SummonBuff_Con(fid,resetct,resetplayer)
function rsef.FC_PhaseLeave_Con(cphase,turnctlist,turnp,fid,times,whos)
return function(e,tp,eg,ep,ev,re,r,rp)
local ecphase=Duel.GetCurrentPhase()
local eturnp=Duel.GetTurnPlayer()
local eturnct,eturncttp,eturnctop=Duel.GetTurnCount(),Duel.GetTurnCount(tp),Duel.GetTurnCount()
local turnct,turncttp,turnctop=turnctlist[1],turnctlist[2],turnctlist[3]
local g=e:GetLabelObject()
local rg=g:Filter(rssf.SummonBuff_Filter,nil,e,fid)
if rg:GetCount()<=0 then
g:DeleteGroup() e:Reset()
return false
local rg=g:Filter(rsef.FC_PhaseLeave_Filter,nil,fid)
local reset=false
local solve=false
if #rg<=0 then reset=true end
if times and times>0 and not whos then
if eturnct>turnct+(times-1) then reset=true end
if eturnct==turnct+(times-1) then solve=true end
end
if resetplayer and resetplayer~=Duel.GetTurnPlayer() then return false
if times and times>0 and whos==0 and eturnp==tp then
if eturncttp>turncttp+(times-1) then reset=true end
if eturncttp==turncttp+(times-1) then solve=true end
end
local tid1=rg:GetFirst():GetTurnID()
local tid2=Duel.GetTurnCount()
if resetct==0 and tid1~=tid2 then return false end
if resetct>1 and tid1==tid2 then return false end
return true
if times and times>0 and whos==0 and eturnp~=tp then
if eturnctop>turnctop+(times-1) then reset=true end
if eturnctop==turnctop+(times-1) then solve=true end
end
if not times then
solve=true
end
if reset then
g:DeleteGroup()
e:Reset()
return false
end
return solve
end
end
function rssf.SummonBuff_Op(fid,way)
function rsef.FC_PhaseLeave_Op(way,fid)
return function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetOwner()
Duel.Hint(HINT_CARD,0,c:GetOriginalCode())
local g=e:GetLabelObject()
local rg=g:Filter(rssf.SummonBuff_Filter,nil,e,fid)
if way=="des" then Duel.Destroy(rg,REASON_EFFECT)
local rg=g:Filter(rsef.FC_PhaseLeave_Filter,nil,fid)
if type(way)=="function" then way(rg,e,tp,eg,ep,ev,re,r,rp)
elseif way=="des" then Duel.Destroy(rg,REASON_EFFECT)
elseif way=="th" then Duel.SendtoHand(rg,nil,REASON_EFFECT)
elseif way=="td" then Duel.SendtoDeck(rg,nil,2,REASON_EFFECT)
elseif way=="tdt" then Duel.SendtoDeck(rg,nil,0,REASON_EFFECT)
......@@ -1242,42 +1240,80 @@ function rssf.SummonBuff_Op(fid,way)
elseif way=="rm" then Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
elseif way=="tg" then Duel.SendtoGrave(rg,REASON_EFFECT)
end
if g:FilterCount(rssf.SummonBuff_Filter,nil,e,fid)<=0 then
g:DeleteGroup()
e:Reset()
end
end
end
----------------"Part_Effect_SingleContinuous"----------------
--Single Continues: Base set
function rsef.SC(cardtbl,code,desctbl,ctlimittbl,flag,con,op,resettbl)
return rsef.Register(cardtbl,EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS,code,desctbl,ctlimittbl,nil,flag,nil,con,nil,nil,op,nil,nil,nil,resettbl)
end
-------------------"Part_Summon_Function"---------------------
--Summon Function: Set Default Parameter
function rssf.GetSSDefaultParameter(sstype,ssplayer,tplayer,ignorecon,ignorerevie,pos)
sstype= sstype or 0
ssplayer=ssplayer or Duel.GetChainInfo(0,CHAININFO_TRIGGERING_PLAYER)
tplayer=tplayer or ssplayer
ignorecon=ignorecon or false
ignorerevie=ignorerevie or false
pos=pos or POS_FACEUP
return sstype,ssplayer,tplayer,ignorecon,ignorerevie,pos
end
--Summon Function: Duel.SpecialSummon + buff
function rssf.SpecialSummon(ssgorc,sstype,ssplayer,tplayer,ignorecon,ignorerevie,pos,zone,sumfun)
function rssf.SpecialSummon(ssgorc,sstype,ssplayer,tplayer,ignorecon,ignorerevie,pos,zone,sumcardfun,sumgroupfun)
sstype,ssplayer,tplayer,ignorecon,ignorerevie,pos=rssf.GetSSDefaultParameter(sstype,ssplayer,tplayer,ignorecon,ignorerevie,pos)
local ct=0
if zone then
ct=Duel.SpecialSummon(ssgorc,sstype,ssplayer,tplayer,ignorecon,ignorerevie,pos,zone)
else
ct=Duel.SpecialSummon(ssgorc,sstype,ssplayer,tplayer,ignorecon,ignorerevie,pos)
local g=Group.CreateGroup()
local sg=rsgf.Mix2(ssgorc)
for sc in aux.Next(sg) do
if rssf.SpecialSummonStep(sc,sstype,ssplayer,tplayer,ignorecon,ignorerevie,pos,zone,sumcardfun) then
ct=ct+1
g:AddCard(sc)
end
end
if ct>0 then
Duel.SpecialSummonComplete()
end
local g=Duel.GetOperatedGroup()
if #g>0 and sumfun then
local c=g:GetFirst():GetReasonEffect():GetHandler()
for tc in aux.Next(g) do
sumfun(c,tc,e,tp,g)
for sc in aux.Next(g) do
if sc:GetFlagEffect(rscode.Pre_Complete_Proc)>0 then
sc:CompleteProcedure()
sc:ResetFlagEffect(rscode.Pre_Complete_Proc)
end
end
return ct,g
end
local e=g:GetFirst():GetReasonEffect()
local tp=e:GetHandlerPlayer()
local c=g:GetFirst():GetReasonEffect():GetHandler()
if #g>0 and sumgroupfun then
if type(sumgroupfun)=="table" then
rsef.FC_PHASELEAVE({c,tp},g,table.unpack(sumgroupfun))
elseif type(sumgroupfun)=="string" then
rsef.FC_PHASELEAVE({c,tp},g,nil,nil,PHASE_END,sumgroupfun)
elseif type(sumcardfun)=="function" then
sumgroupfun(g,c,e,tp)
end
end
return ct,g,g:GetFirst()
end
--Summon Function: Duel.SpecialSummonStep + buff
function rssf.SpecialSummonStep(sscard,sstype,ssplayer,tplayer,ignorecon,ignorerevie,pos,zone,sumfun)
function rssf.SpecialSummonStep(sc,sstype,ssplayer,tplayer,ignorecon,ignorerevie,pos,zone,sumcardfun)
sstype,ssplayer,tplayer,ignorecon,ignorerevie,pos=rssf.GetSSDefaultParameter(sstype,ssplayer,tplayer,ignorecon,ignorerevie,pos)
local tf=false
if zone then
tf=Duel.SpecialSummonStep(sscard,sstype,ssplayer,tplayer,ignorecon,ignorerevie,pos,zone)
tf=Duel.SpecialSummonStep(sc,sstype,ssplayer,tplayer,ignorecon,ignorerevie,pos,zone)
else
tf=Duel.SpecialSummonStep(sscard,sstype,ssplayer,tplayer,ignorecon,ignorerevie,pos)
tf=Duel.SpecialSummonStep(sc,sstype,ssplayer,tplayer,ignorecon,ignorerevie,pos)
end
if tf and sumfun then
local c=sscard:GetReasonEffect():GetHandler()
sumfun(c,sscard,e,tp)
if tf and sumcardfun then
local e=sc:GetReasonEffect()
local tp=e:GetHandlerPlayer()
local c=sc:GetReasonEffect():GetHandler()
if type(sumcardfun)=="table" then
rscf.QuickBuff({c,sc,true},table.unpack(sumcardfun))
elseif type(sumcardfun)=="function" then
sumcardfun(c,sc,e,tp,g)
end
end
return tf,sscard
end
......@@ -1321,17 +1357,7 @@ function rssf.SpecialSummonEither(ssgorc,e,sstype,ssplayer,tplayer,ignorecon,ign
if #ssg>0 then
Duel.SpecialSummonComplete()
end
return #ssg,ssg
end
--Summon Function: Set Default Parameter
function rssf.GetSSDefaultParameter(sstype,ssplayer,tplayer,ignorecon,ignorerevie,pos)
if not sstype then sstype=0 end
if not ssplayer then ssplayer=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_PLAYER) end
if not tplayer then tplayer=ssplayer end
if not ignorecon then ignorecon=false end
if not ignorerevie then ignorerevie=false end
if not pos then pos=POS_FACEUP end
return sstype,ssplayer,tplayer,ignorecon,ignorerevie,pos
return #ssg,ssg,ssg:GetFirst()
end
-------------------"Part_Value_Function"---------------------
......@@ -1362,7 +1388,7 @@ function rsval.indct(string1,string2)
end
--value: unaffected by opponent's card effects
function rsval.imoe(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer()
return e:GetOwnerPlayer()~=re:GetHandlerPlayer()
end
--value: unaffected by other card effects
function rsval.imes(e,re)
......@@ -1389,7 +1415,7 @@ function rsval.cdisneg(filter)
return function(e,ct)
local p=e:GetHandlerPlayer()
local te,tp,loc=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER,CHAININFO_TRIGGERING_LOCATION)
return (not filter and p==tp) or filter(e,p,te,tp,loc)
return (not filter and p==tp) or (filter and filter(e,p,te,tp,loc))
end
end
......@@ -1419,6 +1445,7 @@ function rstg.disnegtg(disorneg,waystring)
local _,_,filterfun=rsof.Table_Suit(waystring,waylist,waylist2)
local _,_,filterfun2,cate=rsof.Table_Suit(waystring,waylist,waylist3,catelist)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local rc=re:GetHandler()
if chk==0 then return
--filterfun(rc)
......@@ -1430,8 +1457,13 @@ function rstg.disnegtg(disorneg,waystring)
Duel.SetOperationInfo(0,cate,eg,1,0,0)
end
end
if c:IsType(TYPE_CONTINUOUS+TYPE_FIELD+TYPE_PENDULUM) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsOnField() and c:IsRelateToEffect(e) then
rsef.relationinfo[Duel.GetCurrentChain()]=true
else
rsef.relationinfo[Duel.GetCurrentChain()]=false
end
end
end
end
function rstg.distg(waystring)
return function(...)
return rstg.disnegtg("dis",waystring)(...)
......@@ -1476,7 +1508,12 @@ function rstg.GetTargetAttribute(e,tp,eg,ep,ev,re,r,rp,targetlist)
selecthint=catevalue[3]
end
end
local listtype=targetlist[10]
local _,catelist2,catestringlist=rsef.GetRegisterCategory(catelist)
if listtype and listtype=="cost" and rsof.Table_List(catelist2,CATEGORY_HANDES) then
catelist2={ CATEGORY_TOGRAVE }
selecthint=selecthint or HINTMSG_DISCARD
end
local loc1,loc2=targetlist[3],targetlist[4]
if type(loc1)=="function" then
loc1=loc1(e,tp,eg,ep,ev,re,r,rp)
......@@ -1495,7 +1532,6 @@ function rstg.GetTargetAttribute(e,tp,eg,ep,ev,re,r,rp,targetlist)
local exceptfun=targetlist[7]
local isoptional=targetlist[8]
--local selecthint=targetlist[9]
local listtype=targetlist[10]
if not listtype then
listtype="target"
end
......@@ -1579,15 +1615,41 @@ end
function rstg.GetTargetCheckAndSelectFun(b2,catelist)
local targetcheckfun= not b2 and Duel.IsExistingMatchingCard or Duel.IsExistingTarget
local targetselectfun= not b2 and Duel.SelectMatchingCard or Duel.SelectTarget
local playertargetlist={ CATEGORY_DRAW,CATEGORY_DECKDES,CATEGORY_RECOVER,CATEGORY_DAMAGE } --CATEGORY_HANDES
local playertargetlist={ CATEGORY_DRAW,CATEGORY_DECKDES,CATEGORY_RECOVER,CATEGORY_DAMAGE,CATEGORY_HANDES } --
for _,cate in pairs(playertargetlist) do
if rsof.Table_List(catelist,cate) then
targetcheckfun=rstg.Target_Fun_Check_Fun(cate)
targetcheckfun=rstg.PlayerTarget_Set_Usingct(cate)
targetselectfun=rstg.Target_Fun_Select_Fun(cate)
end
end
return targetcheckfun,targetselectfun
end
function rstg.PlayerTarget_Set_Usingct(cate)
return function(filter,tp,spct,opct,minct2_nouse,exceptg,e,tp,eg,ep,ev,re,r,rp,usingg,usingct,targetvalue1,targetvalue2,...)
if spct>0 then
usingct[tp][cate]=usingct[tp][cate] or 0
local spct2=usingct[tp][cate]+spct
usingct[tp][cate]=spct2
if cate==CATEGORY_DRAW and not Duel.IsPlayerCanDraw(tp,spct2) then return false end
if cate==CATEGORY_HANDES and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)<spct2 then return false end
if cate==CATEGORY_DECKDES and not Duel.IsPlayerCanDiscardDeck(tp,spct2) then return false end
end
if opct>0 then
usingct[1-tp][cate]=usingct[1-tp][cate] or 0
local opct2=usingct[1-tp][cate]+opct
usingct[1-tp][cate]=opct2
if cate==CATEGORY_DRAW and not Duel.IsPlayerCanDraw(1-tp,opct2) then return false end
if cate==CATEGORY_HANDES and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)<opct2 then return false end
if cate==CATEGORY_DECKDES and not Duel.IsPlayerCanDiscardDeck(1-tp,opct2) then return false end
end
return spct>0 or opct>0
end
end
function rstg.Target_Fun_Select_Fun(cate)
return function(selectp,filter_nouse,locp_nouse,spct,opct,minct_nouse,maxct_nouse,exceptg,e,tp,eg,ep,ev,re,r,rp,usingg,usingct,targetvalue1,...)
rstg.PlayerTarget_Set_Usingct(cate,tp,spct,opct,usingct)
end
end
--Effect target: Check chkc & chk
function rstg.TargetCheck(e,tp,eg,ep,ev,re,r,rp,chk,chkc,valuetype,...)
local targetlist={rstg.list(valuetype,...)}
......@@ -1628,50 +1690,6 @@ function rstg.TargetCheck(e,tp,eg,ep,ev,re,r,rp,chk,chkc,valuetype,...)
end
end
end
function rstg.PlayerTarget_Set_Usingct(cate,tp,spct,opct,usingct)
if spct>0 then
usingct[tp][cate]=usingct[tp][cate] or 0
local spct2=usingct[tp][cate]+spct
usingct[tp][cate]=spct2
if cate==CATEGORY_DRAW and not Duel.IsPlayerCanDraw(tp,spct2) then return false end
--if cate==CATEGORY_HANDES and not Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>=spct2 then return false end
if cate==CATEGORY_DECKDES and not Duel.IsPlayerCanDiscardDeck(tp,spct2) then return false end
end
if opct>0 then
usingct[1-tp][cate]=usingct[1-tp][cate] or 0
local opct2=usingct[1-tp][cate]+opct
usingct[1-tp][cate]=opct2
if cate==CATEGORY_DRAW and not Duel.IsPlayerCanDraw(1-tp,opct2) then return false end
--if cate==CATEGORY_HANDES and not Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>=opct2 then return false end
if cate==CATEGORY_DECKDES and not Duel.IsPlayerCanDiscardDeck(1-tp,opct2) then return false end
end
return true
end
function rstg.Target_Fun_Check_Fun(cate)
return function(filter,tp,spct,opct,minct2_nouse,exceptg,e,tp,eg,ep,ev,re,r,rp,usingg,usingct,targetvalue1,targetvalue2,...)
if not rstg.PlayerTarget_Set_Usingct(cate,tp,spct,opct,usingct) then return false end
if not targetvalue2 then return true end
local ffunction,catelist,catestringlist,catefun,selecthint,loc1,loc2,minct,maxct,exceptfun,isoptional,listtype = rstg.GetTargetAttribute(e,tp,eg,ep,ev,re,r,rp,targetvalue2)
local b1,b2,b3,b4,b5=rstg.CheckTargetlistType(listtype)
local targetfun=rstg.GetTargetCheckAndSelectFun(b2,catelist)
local exceptg=rsgf.GetExceptGroup(exceptfun,b4,e,tp,eg,ep,ev,re,r,rp)
return targetfun(rstg.TargetFilter,tp,loc1,loc2,minct2,exceptg,e,tp,eg,ep,ev,re,r,rp,usingg,usingct,targetvalue2,...)
end
end
function rstg.Target_Fun_Select_Fun(cate)
return function(selectp,filter_nouse,locp_nouse,spct,opct,minct_nouse,maxct_nouse,exceptg,e,tp,eg,ep,ev,re,r,rp,usingg,usingct,targetvalue1,...)
rstg.PlayerTarget_Set_Usingct(cate,tp,spct,opct,usingct)
return Group.CreateGroup(),{[tp]=spct,[1-tp]=opct}
end
end
function rstg.Target_Fun_Check_NullFun(filter,tp,spct,opct,minct2_nouse,exceptg,e,tp,eg,ep,ev,re,r,rp,usingg,usingct,targetvalue1,targetvalue2,...)
if not targetvalue2 then return true end
local ffunction,catelist,catestringlist,catefun,selecthint,loc1,loc2,minct,maxct,exceptfun,isoptional,listtype = rstg.GetTargetAttribute(e,tp,eg,ep,ev,re,r,rp,targetvalue2)
local b1,b2,b3,b4,b5=rstg.CheckTargetlistType(listtype)
local targetfun=rstg.GetTargetCheckAndSelectFun(b2,catelist)
local exceptg=rsgf.GetExceptGroup(exceptfun,b4,e,tp,eg,ep,ev,re,r,rp)
return targetfun(rstg.TargetFilter,tp,loc1,loc2,minct2,exceptg,e,tp,eg,ep,ev,re,r,rp,usingg,usingct,targetvalue2,...)
end
--Effect target: Target filter
function rstg.TargetFilter(c,e,tp,eg,ep,ev,re,r,rp,usingg,usingct,targetvalue1,targetvalue2,...)
local usingg2=usingg:Clone()
......@@ -1777,7 +1795,7 @@ function rstg.TargetSelectNoInfo(e,tp,eg,ep,ev,re,r,rp,valuetype,...)
end
--target
if b4 and type(loc1)=="table" then
local solvelist=rsef.targetlist[chainid]
local solvelist=rstg.targetlist[chainid]
local solvegroup=Group.CreateGroup()
for _,listindex in pairs(loc1) do
if listindex==0 then
......@@ -1791,7 +1809,7 @@ function rstg.TargetSelectNoInfo(e,tp,eg,ep,ev,re,r,rp,valuetype,...)
selectgroup=solvegroup:Filter(rstg.targetsolvefilter,exceptg,e,tp,eg,ep,ev,re,r,rp,usingg,usingct,ffunction)
end
--operation info catelist
local playertargetcatelist={ CATEGORY_DRAW,CATEGORY_RECOVER,CATEGORY_DAMAGE,CATEGORY_DECKDES } --CATEGORY_HANDES
local playertargetcatelist={ CATEGORY_DRAW,CATEGORY_RECOVER,CATEGORY_DAMAGE,CATEGORY_DECKDES,CATEGORY_HANDES } --
for _,cate in ipairs(catelist) do
local selectinfolist=b1 and costinfolist or cateinfolist
--because player use 0 and 1 , some caculate like 0+1=1 ,cannot get PLAYER_ALL(3) ,so first treat base player as 1 and 2
......@@ -1850,10 +1868,10 @@ function rstg.TargetSelectNoInfo(e,tp,eg,ep,ev,re,r,rp,valuetype,...)
if not costres or (aux.GetValueType(costres)=="Group" and #costres<=0) then return end
elseif b2 or b3 then
if b2 then
if not rsef.targetlist[chainid] then
rsef.targetlist[chainid]={}
if not rstg.targetlist[chainid] then
rstg.targetlist[chainid]={}
end
table.insert(rsef.targetlist[chainid],rsgf.Group_To_Table(selectgroup))
table.insert(rstg.targetlist[chainid],rsgf.Group_To_Table(selectgroup))
end
targettotalgroup:Merge(selectgroup)
end
......@@ -1872,10 +1890,10 @@ function rstg.TargetSelect(e,tp,eg,ep,ev,re,r,rp,valuetype,...)
--because player use 0 and 1 , some caculate like 0+1=1 ,cannot get PLAYER_ALL(3) ,so first treat base player as 1 and 2, inverse operation
local playerlist={[0]=0,[1]=0,[2]=1,[3]=3}
infop=playerlist[infop]
local playertargetcatelist={ CATEGORY_DRAW,CATEGORY_RECOVER,CATEGORY_DAMAGE,CATEGORY_DECKDES } --CATEGORY_HANDES
local playertargetcatelist={ CATEGORY_DRAW,CATEGORY_RECOVER,CATEGORY_DAMAGE,CATEGORY_DECKDES,CATEGORY_HANDES } --
if rsof.Table_List(playertargetcatelist,cate) then
local spvalue=infoloc[tp]
local opvalue=infoloc[1-tp]
local opvalue=infoloc[1-tp]
local infovalue=0
if spvalue>0 and opvalue>0 then infovalue=math.min(spvalue,opvalue)
else
......@@ -2229,8 +2247,11 @@ function rscon.phase(p1,...)
local phase_ndcal=function()
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
local stringlist={"dp","sp","mp1","bp","bsp","dam","damndcal","dambdcal","dcal","ndcal","mp2","ep"}
local phaselist={PHASE_DRAW,PHASE_STANDBY,PHASE_MAIN1,phase_bp,PHASE_BATTLE_STEP,phase_dam,PHASE_DAMAGE,phase_dambdcal,PHASE_DAMAGE_CAL,phase_ndcal,PHASE_MAIN2,PHASE_END }
local phase_mp=function()
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
local stringlist={"dp","sp","mp1","bp","bsp","dam","damndcal","dambdcal","dcal","ndcal","mp2","ep","mp"}
local phaselist={PHASE_DRAW,PHASE_STANDBY,PHASE_MAIN1,phase_bp,PHASE_BATTLE_STEP,phase_dam,PHASE_DAMAGE,phase_dambdcal,PHASE_DAMAGE_CAL,phase_ndcal,PHASE_MAIN2,PHASE_END,phase_mp }
local mainstringlist={}
local turnplayerlist={}
local parlist2=rsof.String_Number_To_Table(parlist)
......@@ -2239,8 +2260,8 @@ function rscon.phase(p1,...)
table.insert(mainstringlist,mainstring)
table.insert(turnplayerlist,splitstring)
end
local phaselist2=rsof.Table_Suit(mainstringlist,stringlist,phaselist)
for index,phase in pairs(phaselist2) do
local phaselist2=rsof.Table_Suit(mainstringlist,stringlist,phaselist)
for index,phase in pairs(phaselist2) do
if turnplayerlist[index] then
if (turnplayerlist[index]=="_s" and turnp~=tp) or (turnplayerlist[index]=="_o" and turnp==tp ) then return false end
end
......@@ -2253,19 +2274,19 @@ function rscon.phase(p1,...)
end
--Condition in Main Phase
function rscon.phmp(e)
return rscon.phase("mp1,mp2")
return rscon.phase("mp1,mp2")(e)
end
--Condition: Phase no damage calculate , for change atk/def
function rscon.adcon(e)
return rscon.phase("ndcal")
return rscon.phase("ndcal")(e)
end
--Condition: Battle Phase
function rscon.phbp(e)
return rscon.phase("bp")
return rscon.phase("bp")(e)
end
--Condition: Phase damage calculate,but not calculate
function rscon.dambdcal(e)
return rscon.phase("dambdcal")
return rscon.phase("dambdcal")(e)
end
--Condition in ADV or SP Summon Sucess
function rscon.sumtype(sumtbl,sumfilter,matchall)
......@@ -2443,6 +2464,9 @@ function rsop.disnegop(disorneg,waystring)
if type(waystring)==nil then waystring="des" end
if not waystring then waystring="nil" end
return function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local relate=rsef.relationinfo[Duel.GetCurrentChain()]
if relate and not c:IsRelateToEffect(e) then return end
local ct=0
local rc=re:GetHandler()
if disorneg=="sum" then
......@@ -2736,7 +2760,7 @@ function rsop.SelectOption(p,...)
local off=1
local ops={}
local opval={}
for k,v in ipairs(functionlist) do
for k,v in pairs(functionlist) do
if rsof.Check_Boolean(v) and k~=#functionlist then
local selecthint=functionlist[k+1]
if type(selecthint)=="table" then ops[off]=aux.Stringid(selecthint[1],selecthint[2])
......@@ -2976,7 +3000,7 @@ function rsgf.GetExceptGroup(exceptfun,b4,e,tp,eg,ep,ev,re,r,rp)
exceptg:AddCard(c)
end
elseif excepttype=="function" then
exceptg=exceptfun(e,tp,eg,ep,ev,re,r,rp)
exceptg=rsgf.Mix2(exceptfun(e,tp,eg,ep,ev,re,r,rp))
end
local ct=not exceptg and 0 or #exceptg
return exceptg,ct
......@@ -3110,53 +3134,60 @@ function rsgf.SelectSolve(g,selecthint,sp,filter,minct,maxct,exceptg,solvefun,..
solveparlist[len2]=solvepar
end
local res=not solvefun and {tg,tg:GetFirst()} or {solvefun2(tg,table.unpack(solveparlist))}
rsop.nohint=false
rsop.solveprlen=nil
rsop.nohint=false
return table.unpack(res)
end
Group.SelectSolve=rsgf.SelectSolve
--Group:Select card from group and send to hand
function rsgf.SelectToHand(g,sp,filter,minct,maxct,exceptg,solvepar,...)
solvepar=rsop.GetFollowingSolvepar(solvepar,4)
rsop.nohint=true
return rsgf.SelectSolve(g,"th",sp,filter,minct,maxct,exceptg,{rsop.SendtoHand,table.unpack(solvepar)},...)
end
Group.SelectToHand=rsgf.SelectToHand
--Group:Select card from group and send to grave
function rsgf.SelectToGrave(g,sp,filter,minct,maxct,exceptg,solvepar,...)
solvepar=rsop.GetFollowingSolvepar(solvepar,2)
rsop.nohint=true
return rsgf.SelectSolve(g,"tg",sp,filter,minct,maxct,exceptg,{rsop.SendtoGrave,table.unpack(solvepar)},...)
end
Group.SelectToGrave=rsgf.SelectToGrave
--Group:Select card from group and release
function rsgf.SelectRelease(g,sp,filter,minct,maxct,exceptg,solvepar,...)
solvepar=rsop.GetFollowingSolvepar(solvepar,2)
rsop.nohint=true
return rsgf.SelectSolve(g,"tg",sp,filter,minct,maxct,exceptg,{rsop.Release,table.unpack(solvepar)},...)
end
Group.SelectRelease=rsgf.SelectRelease
--Group:Select card from group and send to deck
function rsgf.SelectToDeck(g,sp,filter,minct,maxct,exceptg,solvepar,...)
solvepar=rsop.GetFollowingSolvepar(solvepar,4)
rsop.nohint=true
return rsgf.SelectSolve(g,"td",sp,filter,minct,maxc,t,exceptg,{rsop.SendtoDeck,table.unpack(solvepar)},...)
end
Group.SelectToDeck=rsgf.SelectToDeck
--Group:Select card from group and destroy
function rsgf.SelectDestroy(g,sp,filter,minct,maxct,exceptg,solvepar,...)
solvepar=rsop.GetFollowingSolvepar(solvepar,2)
rsop.nohint=true
return rsgf.SelectSolve(g,"des",sp,filter,minct,maxct,exceptg,{rsop.Destroy,table.unpack(solvepar)},...)
end
Group.SelectDestroy=rsgf.SelectDestroy
--Group:Select card from group and remove
function rsgf.SelectRemove(g,sp,filter,minct,maxct,exceptg,solvepar,...)
solvepar=rsop.GetFollowingSolvepar(solvepar,3)
rsop.nohint=true
return rsgf.SelectSolve(g,"rm",sp,filter,minct,maxct,exceptg,{rsop.Remove,table.unpack(solvepar)},...)
end
Group.SelectRemove=rsgf.SelectRemove
--Group:Select card from group and special summon
function rsgf.SelectSpecialSummon(g,sp,filter,minct,maxct,exceptg,solvepar,...)
solvepar=rsop.GetFollowingSolvepar(solvepar,8)
--solvepar=rsop.GetFollowingSolvepar(solvepar,8)
solvepar = type(solvepar)=="table" and solvepar or {solvepar}
local e=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_EFFECT)
local ex_par=not ... and {e,sp} or {...}
return rsgf.SelectSolve(g,"sp",sp,filter,minct,maxct,exceptg,{rssf.SpecialSummon,table.unpack(solvepar)},table.unpack(ex_par))
return rsgf.SelectSolve(g,"sp",sp,filter,minct,maxct,exceptg,rsop.SelectSpecialSummon_Operation(solvepar),table.unpack(ex_par))
end
Group.SelectSpecialSummon=rsgf.SelectSpecialSummon
......@@ -3195,13 +3226,22 @@ function rscf.DefineSet_Fun(prefix1,prefix2,seriesstring)
end
--Register qucik attribute buff in cards
function rscf.QuickBuff(reglist,...)
local bufflist={...}
local c1,c2=rsef.GetRegisterCard(reglist)
local bufflist={...}
local reset=rsreset.est
local reset2=c1~=c2 and rsreset.est or rsreset.est_d
if #bufflist&1==1 then
reset=bufflist[#bufflist]
reset2=c1~=c2 and bufflist[#bufflist] or bufflist[#bufflist]|RESET_DISABLE
local reset,reset2
if not rsof.Table_List(bufflist,"reset") then
table.insert(bufflist,"reset")
table.insert(bufflist,rsreset.est)
end
local _,ct=rsof.Table_List(bufflist,"reset")
local resetval=bufflist[ct+1]
if resetval and type(resetval)~="string" then
reset=resetval
if c1==c2 then
reset2=type(resetval)=="table" and {resetval[1]|RESET_DISABLE,resetval[2] } or resetval|RESET_DISABLE
else
reset2=resetval
end
end
local setlist={"atk","def","batk","bdef","atkf","deff"}
local uplist={"atk+","def+","lv+","rk+"}
......@@ -3210,19 +3250,29 @@ function rscf.QuickBuff(reglist,...)
local limitlist={"dis","dise","tri","atk","atkan","datk","ress","resns","td","th","cp","cost"}
local matlimitlist={"fus","syn","xyz","link"}
local leavelist={"leave"}
local phaselist={"ep","sp"}
local funlist=rsof.Table_Mix(setlist,uplist,changelist,addlist,limitlist,matlimitlist,leavelist)
local splist={"mat","pc"}
--local phaselist={"ep","sp"}
local funlist=rsof.Table_Mix(setlist,uplist,changelist,addlist,limitlist,matlimitlist,leavelist,splist)
local funlistatt=rsof.Table_Mix(setlist,uplist,changelist,addlist)
--local nulllist={}
--for i=1,#stringlist do
--table.insert(nulllist,"hape")
--end
local effectlist={}
for index,value in pairs(bufflist) do
if index&1==1 then
local vallist=type(bufflist[index+1])~=table and {bufflist[index+1]} or bufflist[index+1]
local stringlist=rsof.String_Number_To_Table(value)
local _,effectvaluelist=rsof.Table_Suit(value,funlist,{},vallist)
for index,par in pairs(bufflist) do
local vtype=type(par)
local parnext=bufflist[index+1]
local vtypenext=type(parnext)
if vtype=="string" and par~="reset" then
local vallist
if not parnext or vtypenext=="string" then
vallist={}
end
if parnext and vtypenext~="string" then
vallist=vtypenext~="table" and {parnext} or parnext
end
local stringlist=rsof.String_Number_To_Table(par)
local _,effectvaluelist=rsof.Table_Suit(par,funlist,{},vallist)
for k,codestring in pairs(stringlist) do
if rsof.Table_List(funlistatt,codestring) then
e1=rsef.SV_ATTRIBUTE(reglist,codestring,effectvaluelist[k],nil,reset2)
......@@ -3236,7 +3286,16 @@ function rscf.QuickBuff(reglist,...)
if rsof.Table_List(leavelist,codestring) then
e1=rsef.SV_REDIRECT(reglist,codestring,effectvaluelist[k],nil,rsreset.ered,"cd")
end
table.insert(effectlist,e1)
if rsof.Table_List(splist,codestring) then
if codestring=="mat" then
c2:SetMaterial(effectvaluelist[k])
end
if codestring=="cp" then
c2:RegisterFlagEffect(rscode.Pre_Complete_Proc,rsreset.est,0,1)
end
else
table.insert(effectlist,e1)
end
end
end
end
......@@ -3275,35 +3334,50 @@ function rscf.SetSummonCondition(cardtbl,isnsable,sumvalue,iseffectspsum,resettb
tc2:EnableReviveLimit()
end
end
if not sumvalue then sumvalue=aux.FALSE end
local e1=rsef.SV(cardtbl,EFFECT_SPSUMMON_CONDITION,sumvalue,nil,nil,resettbl,"uc,cd")
sumvalue = sumvalue or aux.FALSE
local e1=rsef.SV(cardtbl,EFFECT_SPSUMMON_CONDITION,sumvalue,nil,nil,resettbl,"uc,cd,sr")
return e1
end
rssf.SetSummonCondition=rscf.SetSummonCondition
--Check Built-in SetCode / Series Main Set
function rscf.CheckSetCardMainSet(c,settype,series1,...)
local stringlist=rsof.String_Number_To_Table({series1,...})
local serieslist={series1,...}
local seriesnormallist={}
local seriescustomlist={}
for _,series in pairs(serieslist) do
if type(series)=="number" then
table.insert(seriesnormallist,series)
else
table.insert(seriescustomlist,series)
end
end
local stringlist=rsof.String_Number_To_Table(seriescustomlist)
local codelist={}
local effectlist={}
local addcodelist={}
if settype=="base" then
if #seriesnormallist>0 and c:IsSetCard(table.unpack(seriesnormallist)) then return true end
codelist={c:GetCode()}
effectlist={c:IsHasEffect(EFFECT_ADD_SETCODE)}
elseif settype=="fus" then
if #seriesnormallist>0 and c:IsFusionSetCard(table.unpack(seriesnormallist)) then return true end
codelist={c:GetFusionCode()}
effectlist={c:IsHasEffect(EFFECT_ADD_FUSION_SETCODE),c:IsHasEffect(EFFECT_ADD_SETCODE)}
elseif settype=="link" then
if #seriesnormallist>0 and c:IsLinkSetCard(table.unpack(seriesnormallist)) then return true end
codelist={c:GetLinkCode()}
effectlist={c:IsHasEffect(EFFECT_ADD_LINK_SETCODE),c:IsHasEffect(EFFECT_ADD_SETCODE)}
elseif settype=="org" then
if #seriesnormallist>0 and c:IsOriginalSetCard(table.unpack(seriesnormallist)) then return true end
codelist={c:GetOriginalCode()}
effectlist={}
elseif settype=="pre" then
if #seriesnormallist>0 and c:IsPreviousSetCard(table.unpack(seriesnormallist)) then return true end
codelist={c:GetPreviousCodeOnField()}
effectlist=rscf.Previous_Set_Code_List
end
for _,effect in pairs(effectlist) do
local string=rsef.valinfo[effect]
local string=rsval.valinfo[effect]
if type(string)=="string" then
table.insert(addcodelist,string)
end
......@@ -3377,9 +3451,11 @@ function rscf.RecordSummonProcedure()
return e0
end
end
rscf.RecordSummonProcedure()
rssf.RecordSummonProcedure=rscf.RecordSummonProcedure
--directly enable will cause bugs, but i am lazy to find what cards i have used this function
rssf.RecordSummonProcedure()
function rscf.RecordSummonProcedure_Operation(e,tp)
local g=Duel.GetMatchingGroup(Card.IsType,0,0xff,0xff,nil,rscf.extype-TYPE_PENDULUM)
local g=Duel.GetMatchingGroup(Card.IsType,0,0xff,0xff,nil,rscf.extype)
local f6=aux.AddSynchroProcedure
local f7=aux.AddSynchroMixProcedure
local f8=aux.AddXyzProcedure
......@@ -3391,8 +3467,8 @@ function rscf.RecordSummonProcedure_Operation(e,tp)
aux.AddXyzProcedureLevelFree=rscf.GetBaseXyzProduce2
aux.AddLinkProcedure=rscf.GetBaseLinkProduce1
for tc in aux.Next(g) do
--Method ResetEffect/ReplaceEffect is issue at Raise Event
tc:ResetEffect(tc:GetOriginalCode(),RESET_CARD)
--Method ResetEffect/ReplaceEffect will cause issue at Raise Event
tc:ReplaceEffect(80316585,0)
local mt=getmetatable(tc)
if mt.initial_effect then
mt.initial_effect(tc)
......@@ -4148,7 +4224,7 @@ function rscf.DarkTuner(f,...)
local typelist={target:IsHasEffect(EFFECT_ADD_TYPE)}
local bool=false
for _,e in pairs(typelist) do
if rsef.valinfo[e]=="TYPE_DARKTUNER" then
if rsval.valinfo[e]=="TYPE_DARKTUNER" then
bool=true
break
end
......@@ -4157,7 +4233,7 @@ function rscf.DarkTuner(f,...)
end
end
--Card filter: face up + filter
function rscf.FilterFaceUp(f,...)
function rscf.fufilter(f,...)
local ext_params={...}
return function(target)
return f(target,table.unpack(ext_params)) and target:IsFaceup()
......@@ -4475,6 +4551,16 @@ function rsof.Table_To_Desc(hintlist)
end
return table.unpack(newlist)
end
--other function: Count for table value
function rsof.Table_Count(list,cval)
local ctlist={}
for index,value in pairs(list) do
if value==cval then
table.insert(ctlist,index)
end
end
return #ctlist,ctlist
end
--other function: check a value is true or false
function rsof.Check_Boolean(value,booleanvaule)
if type(booleanvaule)=="nil" or booleanvaule==true then return
......
......@@ -22,13 +22,15 @@ rshint={} --"Hint Function"
rsloc={} --"Location Function"
--Info Variable
rsef.valinfo ={} --"Value for inside series, inside type etc."
rsval.valinfo ={} --"Value for inside series, inside type etc."
rscost.costinfo ={} --"Cost information, for record cost value"
rsef.targetlist ={} --"Target group list, for rstg.GetTargetAttribute"
rsop.opinfo={} --"Operation information, for record something"
rsef.relationinfo={} --"Field,Pendulum,Continous leave field"
rstg.targetlist ={} --"Target group list, for rstg.GetTargetAttribute"
rsef.attacheffect ={} --"Effect information for attach effects"
rsef.attacheffectf ={}
rsef.solveeffect ={}
rsef.baseop={}
rsop.baseop={}
rscf.synchro_material_action={} --"Custom syn material's action"
rscf.xyz_material_action={} --"Custom xyz material's action"
......@@ -58,12 +60,13 @@ rscode.Extra_Effect_Activate = m+100 --"Attach Effect"
rscode.Extra_Effect_BSolve = m+200
rscode.Extra_Effect_ASolve = m+800
rscode.Summon_Flag = m+300 --"Summon Flag for SummonBuff"
rscode.Phase_Leave_Flag = m+300 --"Summon Flag for SummonBuff"
rscode.Extra_Synchro_Material= m+400 --"Extra Synchro Material"
rscode.Extra_Xyz_Material = m+401 --"Extra Xyz Material"
rscode.Utility_Xyz_Material = m+500 --"Utility Xyz Material"
rscode.Previous_Set_Code = m+600 --"Previous Set Code"
rscode.Synchro_Material = m+700 --"Record synchro proceudre target"
rscode.Pre_Complete_Proc = m+900 --"Previous c:CompleteProcedure"
--Hint Message Variable
rshint.act=aux.Stringid(m,0) --"activate spell/trap"
......@@ -74,7 +77,7 @@ rshint.spproc=aux.Stringid(m,4) --"SS by self produce"
rshint.negeffect=aux.Stringid(19502505,1) --"negate activation"
rshint.eq=aux.Stringid(68184115,0) --"cards will equip"
rshint.te=aux.Stringid(24094258,3) --"add to extra deck"
rshint.xyz=HINTMSG_XMATERIAL --"cards will be overlay cards"
rshint.xyz=HINTMSG_XMATERIAL --"cards will become overlay cards"
rshint.diseffect=aux.Stringid(39185163,1) --"negate effect"
rshint.negsum=aux.Stringid(m+1,1) --"negate summon"
rshint.negsp=aux.Stringid(74892653,0) --"negate special summon"
......@@ -82,12 +85,14 @@ rshint.darktuner=aux.Stringid(m,14) --"treat as dark tuner"
rshint.darksynchro=aux.Stringid(m,15) --"treat as dark synchro"
rshint.choose=aux.Stringid(23912837,1) --"choose 1 effect"
rshint.epleave=aux.Stringid(m,3) --"end phase leave field"
rshint.finshcopy=aux.Stringid(43387895,1) --"reset copy effect"
--Property Variable
rsflag.flaglist = { EFFECT_FLAG_CARD_TARGET,EFFECT_FLAG_PLAYER_TARGET,EFFECT_FLAG_DELAY,EFFECT_FLAG_DAMAGE_STEP,EFFECT_FLAG_DAMAGE_CAL,
EFFECT_FLAG_IGNORE_IMMUNE,EFFECT_FLAG_SET_AVAILABLE,EFFECT_FLAG_IGNORE_RANGE,EFFECT_FLAG_SINGLE_RANGE,EFFECT_FLAG_BOTH_SIDE,
EFFECT_FLAG_UNCOPYABLE,EFFECT_FLAG_CANNOT_DISABLE,EFFECT_FLAG_CANNOT_NEGATE,EFFECT_FLAG_CLIENT_HINT,EFFECT_FLAG_LIMIT_ZONE,
EFFECT_FLAG_ABSOLUTE_TARGET,EFFECT_FLAG_SPSUM_PARAM }
EFFECT_FLAG_ABSOLUTE_TARGET,EFFECT_FLAG_SPSUM_PARAM,
EFFECT_FLAG_EVENT_PLAYER }
rsflag.tg_d = EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY
rsflag.dsp_d = EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY
rsflag.dsp_tg = EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET
......@@ -109,18 +114,25 @@ rscate.neg_des = CATEGORY_NEGATE+CATEGORY_DESTROY
rscf.typelist = { TYPE_MONSTER,TYPE_NORMAL,TYPE_EFFECT,TYPE_DUAL,TYPE_UNION,TYPE_TOON,TYPE_TUNER,TYPE_RITUAL,TYPE_FUSION,TYPE_SYNCHRO,TYPE_XYZ,TYPE_LINK,TYPE_TOKEN,TYPE_PENDULUM,TYPE_SPSUMMON,TYPE_FLIP,TYPE_SPIRIT,
TYPE_SPELL,TYPE_EQUIP,TYPE_FIELD,TYPE_CONTINUOUS,TYPE_QUICKPLAY,
TYPE_TRAP,TYPE_COUNTER,TYPE_TRAPMONSTER }
rscf.extype = TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_PENDULUM+TYPE_LINK
rscf.extype = TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK
rscf.extype_r = rscf.extype + TYPE_RITUAL
rscf.extype_np = rscf.extype - TYPE_PENDULUM
rscf.extype_p = rscf.extype + TYPE_PENDULUM
rscf.extype_rp = rscf.extype + TYPE_RITUAL + TYPE_PENDULUM
rscf.exlist = { TYPE_FUSION,TYPE_SYNCHRO,TYPE_XYZ,TYPE_LINK }
rscf.exlist_r = { TYPE_FUSION,TYPE_SYNCHRO,TYPE_XYZ,TYPE_LINK,TYPE_RITUAL }
rscf.exlist_p = { TYPE_FUSION,TYPE_SYNCHRO,TYPE_XYZ,TYPE_LINK,TYPE_PENDULUM }
rscf.exlist_rp = { TYPE_FUSION,TYPE_SYNCHRO,TYPE_XYZ,TYPE_LINK,TYPE_PENDULUM,TYPE_RITUAL }
--Location Variable
rsloc.hd=LOCATION_HAND+LOCATION_DECK
rsloc.hg=LOCATION_HAND+LOCATION_GRAVE
rsloc.dg=LOCATION_DECK+LOCATION_GRAVE
rsloc.gr=LOCATION_GRAVE+LOCATION_REMOVED
rsloc.dgr=LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED
rsloc.hdg=LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE
rsloc.de=LOCATION_DECK+LOCATION_EXTRA
rsloc.mg=LOCATION_MZONE+LOCATION_GRAVE
rsloc.og=LOCATION_ONFIELD+LOCATION_GRAVE
rsloc.hmg=LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE
rsloc.hog=LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE
rsloc.all=0xff
......@@ -128,6 +140,7 @@ rsloc.all=0xff
--Escape Old Functions
function rsof.Escape_Old_Functions()
rsof.DefineCard = rscf.DefineCard
rscf.FilterFaceUp = rscf.fufilter
rsof.SendtoHand = rsop.SendtoHand
rsof.SendtoDeck = rsop.SendtoDeck
rsof.SendtoGrave = rsop.SendtoGrave
......@@ -138,7 +151,35 @@ function rsof.Escape_Old_Functions()
rsof.SelectOption_Page= rsop.SelectOption_Page
rsof.SelectNumber= rsop.AnnounceNumber
rsof.SelectNumber_List= rsop.AnnounceNumber_List
rsof.IsSet = rscf.DefineSet
rsof.IsSet = rscf.DefineSet
--some card use old SummonBuff's phase leave field parterment, must fix them in their luas
rssf.SummonBuff=function(attlist,isdis,isdistig,selfleave,phaseleave)
local bufflist={}
if attlist then
for index,par in pairs(attlist) do
if par then
if index==1 then att="atkf" end
if index==2 then att="deff" end
if index==3 then att="lv" end
table.insert(bufflist,att)
table.insert(bufflist,par)
end
end
end
if isdis then
table.insert(bufflist,"dis,dise")
table.insert(bufflist,true)
end
if isdistig then
table.insert(bufflist,"tri")
table.insert(bufflist,true)
end
if selfleave then
table.insert(bufflist,"leave")
table.insert(bufflist,selfleave)
end
return bufflist
end
end
......@@ -26,18 +26,18 @@ local rssmf = Special_Mode_Fast_Duel
local rssmm = Special_Mode_Multiple_Duel
local rssmu = Special_Mode_Universal_Duel
#Gale
#Gale 1472676207
local rsve = Voison
local rsneov= Neons
local tfrsv = T.Fairies
local rsss = Star_Spirit
#ChiJiang
#ChiJiang 626386490
local rsnm = Nightmare
local rslf = Little_Fox
local rccv = Thermonuclear
#XiaoMi
#XiaoMi 643865567
local rssg = Sex_Gun
local rsps = Pseudo_Soul
local rsdcc = Dragon_Chess_Corps
......@@ -51,29 +51,43 @@ local rsvw = Virus_Wrom
local rsia = Indolent_Angel
local rsso = Simulated_Organism
#NianBao
#NianBao 583322404
local rslap = Lapin
local rskh = Karehana
#XiaoDaoHeng
#XiaoDaoHeng 1614895649
local rslrd = Life_DeathRound_Dance
#Huang
#Huang 1184387005
local rsts = Trinity_Sword
#Luoxing
#Luoxing 1151483512
local rsdt = Dark_Tale
local rsod = Order
#YunZeZhun
#YunZeZhun 1587361112
local rsphh = Phantom_Thieves_Of_Hearts
local rsgc = Guard_City
#ZhenDong
#ZhenDong
local rsfv = Fgo/Assassin
#JingJing
#JingJing 1772438857
local rsba = BlueAngel
#Akashic 3204027606
local rszg = Zogu
local rsgs = Gran_Sphere
local rsoc = Oligocene_Civilization
local rsgol = Giant_of_Light
local rssb = Space_Beasts
#HeiBai 1172777968
local rstm = Toaru_Majutsu_no_Index
#2558566212
local rsgod = God
--Set Code
#Scl
--local = 0x1330
......@@ -120,7 +134,7 @@ local = 0xc334
local Oraclesmith = 0x3335
local DevilHunter = 0x5335
local DevilSlayer = 0x6335
local DMC = 0x9335
local DMC = 0x9335
local Ashenone = 0xa335
local Cinderlord = 0xc335
......
--雷维翁魔兽使
local m=17052935
local cm=_G["c"..m]
function cm.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOKEN+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,17052935)
e1:SetTarget(cm.tktg)
e1:SetOperation(cm.tkop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(cm.tkcon)
c:RegisterEffect(e2)
end
function cm.tkcon(e,tp,eg,ep,ev,re,r,rp)
return re and re:GetHandler():IsSetCard(0x27f2)
end
function cm.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,17050899,0,0x4011,1000,1000,3,RACE_BEAST,ATTRIBUTE_LIGHT,POS_FACEUP) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==1 then
e:GetHandler():RegisterFlagEffect(17052935,RESET_CHAIN,0,1)
end
end
function cm.tkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,17050899,0,0x4011,1000,1000,3,RACE_BEAST,ATTRIBUTE_LIGHT,POS_FACEUP) then return end
local cou=1
if e:GetHandler():GetFlagEffect(17052935)>0 and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.SelectYesNo(tp,aux.Stringid(17052935,1)) then
cou=2
end
for i=1,cou do
local token=Duel.CreateToken(tp,17050899)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(1)
token:RegisterEffect(e1,true)
local e6=Effect.CreateEffect(e:GetHandler())
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_ADD_SETCODE)
e6:SetValue(0x27f2)
token:RegisterEffect(e6)
token:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(17052935,2))
end
Duel.SpecialSummonComplete()
end
--电闪雷鸣
local m=17052938
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(17052938,1))
e3:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_GRAVE)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
end
function cm.cfilter(c)
return c:IsFaceup() and c:IsCode(17050927)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp or Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function cm.ctfilter(c)
return c:IsFaceup() and c:IsSetCard(0x27f2)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingMatchingCard(cm.ctfilter,tp,LOCATION_MZONE,0,1,e:GetHandler())
and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
local ct=Duel.GetMatchingGroupCount(cm.ctfilter,tp,LOCATION_MZONE,0,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local g=tg:Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
function cm.spfilter(c,e,tp)
return c:IsCode(17050927) and c:IsType(TYPE_SYNCHRO)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function cm.tdfilter(c)
return c:IsSetCard(0x27f2) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.tdfilter(chkc) and chkc~=e:GetHandler()
and aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.tdfilter,tp,LOCATION_GRAVE,0,2,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.tdfilter,tp,LOCATION_GRAVE,0,2,2,e:GetHandler())
g:AddCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,3,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL) then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
g:AddCard(e:GetHandler())
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if sg:GetCount()>2 then
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local spg=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=spg:GetFirst()
if tc then
Duel.SpecialSummon(tc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
end
end
end
--雷电爆发
local m=17052939
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--Negate
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetCondition(cm.necon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.netg)
e2:SetOperation(cm.neop)
c:RegisterEffect(e2)
end
function cm.cfilter(c,tp)
local atk=c:GetAttack()
if atk<0 then atk=0 end
return c:IsFaceup() and c:IsSetCard(0x27f2) and c:IsType(TYPE_MONSTER)
and Duel.IsExistingMatchingCard(cm.dfilter,tp,0,LOCATION_MZONE,1,nil,atk)
end
function cm.dfilter(c,atk)
return c:IsFaceup() and c:GetAttack()<=atk
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.cfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.cfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,cm.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
local sg=Duel.GetMatchingGroup(cm.dfilter,tp,0,LOCATION_MZONE,nil,g:GetFirst():GetAttack())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local g=Duel.GetMatchingGroup(cm.dfilter,tp,0,LOCATION_MZONE,nil,tc:GetAttack())
Duel.Destroy(g,REASON_EFFECT)
end
function cm.nefilter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsSetCard(0x27f2)
end
function cm.necon(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return g and g:IsExists(cm.nefilter,1,nil,tp)
and Duel.IsChainNegatable(ev)
end
function cm.netg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true 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 cm.neop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
\ No newline at end of file
--雷维翁公爵·尤里乌斯
local m=17052940
local cm=_G["c"..m]
function cm.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsSetCard,0x27f2),1)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(17052940,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(cm.discost)
e1:SetTarget(cm.distg)
e1:SetOperation(cm.disop)
c:RegisterEffect(e1)
--destroy replace
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(cm.desreptg)
e3:SetOperation(cm.desrepop)
c:RegisterEffect(e3)
end
function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and aux.disfilter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.disfilter1,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,aux.disfilter1,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function cm.desrepfilter(c)
return c:IsSetCard(0x27f2) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck() and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
end
function cm.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
and Duel.IsExistingMatchingCard(cm.desrepfilter,tp,LOCATION_GRAVE,0,1,nil) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function cm.desrepop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.desrepfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.HintSelection(g)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT+REASON_REPLACE)
end
--叛逆型 炼金亚瑟
local m=17060945
local cm=_G["c"..m]
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--atk up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetRange(LOCATION_PZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1)
e1:SetTarget(cm.atktg)
e1:SetOperation(cm.atkop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17060945,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCost(cm.spcost)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(17060945,1))
e3:SetCategory(CATEGORY_TOGRAVE+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,17060945)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
end
function cm.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0x87f3)
end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.atkfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,cm.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END,2)
tc:RegisterEffect(e1)
end
end
function cm.rmfilter(c)
return c:IsType(TYPE_PENDULUM) and c:IsAbleToRemoveAsCost()
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_GRAVE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.rmfilter,tp,LOCATION_GRAVE,0,2,2,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function cm.cfilter(c)
return c:IsType(TYPE_PENDULUM) and c:GetOriginalLevel()>0 and c:IsAbleToGrave() and c:IsFaceup()
end
function cm.filter(c,e,tp)
local rg=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_EXTRA,0,nil)
local lv=c:GetLevel()
return lv>0 and c:IsType(TYPE_PENDULUM) and c:IsSetCard(0x7f0) and c:IsAbleToHand() and rg:CheckWithSumEqual(Card.GetLevel,lv,1,99)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thfilter(c,lv)
return c:IsLevel(lv) and c:IsType(TYPE_PENDULUM) and c:IsSetCard(0x7f0) and c:IsAbleToHand()
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK,0,nil,e,tp)
local lvt={}
local pc=1
for i=1,12 do
if g:IsExists(cm.thfilter,1,nil,i) then lvt[pc]=i pc=pc+1 end
end
lvt[pc]=nil
local lv=Duel.AnnounceNumber(tp,table.unpack(lvt))
local rg=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_EXTRA,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=rg:SelectWithSumEqual(tp,Card.GetLevel,lv,1,99)
Duel.SendtoGrave(sg,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local thg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil,lv)
if thg:GetCount()>0 then
Duel.SendtoHand(thg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,thg)
end
end
\ No newline at end of file
--风装型 摩根
local m=17060946
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
c:SetSPSummonOnce(17060946)
--pendulum summon
aux.EnablePendulumAttribute(c,false)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(1160)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCost(cm.reg)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,17060946)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetDescription(aux.Stringid(17060946,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(TIMING_SPSUMMON,TIMING_BATTLE_START)
e3:SetCondition(cm.spcon)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
--set
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(17060946,2))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetCondition(cm.setcon)
e4:SetTarget(cm.settg)
e4:SetOperation(cm.setop)
c:RegisterEffect(e4)
--immune
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e5:SetCode(EFFECT_IMMUNE_EFFECT)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(LOCATION_MZONE,0)
e5:SetTarget(cm.immtg)
e5:SetCondition(cm.immcon)
e5:SetValue(cm.efilter)
c:RegisterEffect(e5)
end
function cm.reg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:GetHandler():RegisterFlagEffect(17060946,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(17060946)~=0
end
function cm.thfilter(c)
return c:IsType(TYPE_PENDULUM) and c:IsType(TYPE_RITUAL) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local dg=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil)
return dg:GetClassCount(Card.GetCode)>=3
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetClassCount(Card.GetCode)>=3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg1=g:SelectSubGroup(tp,aux.dncheck,false,3,3)
Duel.ConfirmCards(1-tp,sg1)
local cg=sg1:RandomSelect(1-tp,1)
local tc=cg:GetFirst()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ShuffleDeck(tp)
end
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
if Duel.GetTurnPlayer()==tp then
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
else
return (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE)
end
end
function cm.filterF(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then
Duel.SetSelectedCard(c)
return mg:CheckWithSumGreater(Card.GetRitualLevel,rc:GetLevel(),rc)
else return false end
end
function cm.matfilter(c,rc)
return c:IsCanBeRitualMaterial(rc) and c:IsType(TYPE_PENDULUM)
end
function cm.mfilterf(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then
Duel.SetSelectedCard(c)
return mg:CheckWithSumGreater(Card.GetRitualLevel,rc:GetLevel(),rc)
else return false end
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local mg=Duel.GetRitualMaterial(tp):Filter(cm.matfilter,c,c)
local ft=Duel.GetMZoneCount(tp)
if not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) or c:GetFlagEffect(17060945)>0 then return false end
if c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,mg,c)==0 then return false end
if ft>0 then
return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
else
return mg:IsExists(cm.mfilterf,1,nil,tp,mg,c)
end
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
c:RegisterFlagEffect(17060945,RESET_CHAIN,0,1)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return end
local tc=e:GetHandler()
local mg=Duel.GetRitualMaterial(tp):Filter(cm.matfilter,c,c)
local ft=Duel.GetMZoneCount(tp)
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
local mat=nil
if ft>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:FilterSelect(tp,cm.mfilterf,1,1,nil,tp,mg,tc)
Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
mat:Merge(mat2)
end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function cm.setfilter(c)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and not c:IsForbidden()
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1))
and Duel.IsExistingMatchingCard(cm.setfilter,tp,LOCATION_EXTRA,0,1,nil) end
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.setfilter,tp,LOCATION_EXTRA,0,nil)
local ct=0
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then ct=ct+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then ct=ct+1 end
if ct>0 and g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local sg=g:Select(tp,1,ct,nil)
local sc=sg:GetFirst()
while sc do
Duel.MoveToField(sc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
sc=sg:GetNext()
end
end
end
function cm.immcon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_PENDULUM)
end
function cm.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer() and te:IsActiveType(TYPE_MONSTER)
end
function cm.immtg(e,c)
return c~=e:GetHandler()
end
--夜下少女
local m=26803008
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
--to grave
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.tgcon)
e1:SetTarget(cm.tgtg)
e1:SetOperation(cm.tgop)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m+900)
e2:SetCondition(cm.negcon)
e2:SetCost(cm.negcost)
e2:SetTarget(cm.negtg)
e2:SetOperation(cm.negop)
c:RegisterEffect(e2)
end
function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,2,0,LOCATION_ONFIELD)
end
function cm.thfilter(c)
return c:IsType(TYPE_RITUAL) and c:IsAbleToHand()
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(nil,1-tp,LOCATION_ONFIELD,0,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE)
local sg=g:Select(1-tp,2,2,nil)
Duel.HintSelection(sg)
Duel.SendtoGrave(sg,REASON_RULE)
local dg=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_ONFIELD,nil)
local kg=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil)
if dg:GetCount()==0 and kg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
kg=kg:Select(tp,1,1,nil)
Duel.BreakEffect()
Duel.SendtoHand(kg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,kg)
Duel.ShuffleDeck(tp)
end
end
end
function cm.negcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function cm.costfilter(c)
return bit.band(c:GetType(),0x81)==0x81 and c:IsAbleToDeckAsCost()
end
function cm.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
function cm.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true 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 cm.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--不解的凝视
local m=26803010
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(m,ACTIVITY_CHAIN,aux.FALSE)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCustomActivityCount(m,1-tp,ACTIVITY_CHAIN)>=18
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_HAND,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_HAND,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SetChainLimit(aux.FALSE)
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_HAND,nil)
if g:GetCount()>0 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(0,1)
e1:SetValue(aux.TRUE)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
end
end
......@@ -30,7 +30,7 @@ function cm.initial_effect(c)
e2:SetHintTiming(TIMING_MAIN_END)
e2:SetCountLimit(1,m+900)
e2:SetCondition(cm.askcon)
e2:SetCost(cm.askcost)
e2:SetCost(cm.atkcost)
e2:SetOperation(cm.askop)
c:RegisterEffect(e2)
--multiatk
......@@ -91,10 +91,10 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetValue(2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(1)
c:RegisterEffect(e1)
end
end
......@@ -102,23 +102,16 @@ function cm.askcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
return Duel.IsAbleToEnterBP() and Duel.GetTurnPlayer()==1-tp
end
function cm.askcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,cm.costfilter,1,nil) end
local sg=Duel.SelectReleaseGroup(tp,cm.costfilter,1,1,nil)
Duel.Release(sg,REASON_COST)
end
function cm.askop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetValue(cm.indct)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(cm.atlimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.indct(e,re,r,rp)
if bit.band(r,REASON_BATTLE)~=0 then
return 1
else return 0 end
function cm.atlimit(e,c)
return c:IsCode(26818000,26818001) and c:IsFaceup()
end
......@@ -9,14 +9,21 @@ function cm.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCountLimit(1,m+EFFECT_COUNT_CODE_DUEL)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--spsummon limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_SPSUMMON_CONDITION)
e3:SetValue(cm.splimit)
c:RegisterEffect(e3)
end
function cm.spcfilter(c)
return c:IsFaceup() and c:IsLevel(9)
return c:IsFaceup() and c:IsCode(26818000,26818001)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.spcfilter,tp,LOCATION_MZONE,0,1,nil)
......@@ -39,3 +46,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
c:RegisterEffect(e1,true)
end
end
function cm.splimit(e,se,sp,st)
local c=e:GetHandler()
return not c:IsLocation(LOCATION_GRAVE) or Duel.GetTurnCount()~=c:GetTurnID() or c:IsReason(REASON_RETURN)
end
......@@ -34,4 +34,34 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetOperation(cm.regop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetCondition(cm.damcon)
e2:SetOperation(cm.damop)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetLabelObject(e1)
Duel.RegisterEffect(e2,tp)
end
function cm.regfilter(c)
return c:IsCode(26818000,26818001)
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(cm.regfilter,1,nil) then
e:SetLabel(1)
end
end
function cm.damcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabelObject():GetLabel()~=1
end
function cm.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.SetLP(tp,Duel.GetLP(tp)/2)
end
......@@ -4,51 +4,28 @@ local cm=_G["c"..m]
xpcall(function() require("expansions/script/c26800000") end,function() require("script/c26800000") end)
function cm.initial_effect(c)
Amana.Majsoul(c)
--destroy replace
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EFFECT_DESTROY_REPLACE)
e1:SetRange(LOCATION_HAND)
e1:SetTarget(cm.reptg)
e1:SetValue(cm.repval)
e1:SetOperation(cm.repop)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_GRAVE)
e2:SetTarget(cm.septg)
e2:SetValue(cm.sepval)
e2:SetOperation(cm.sepop)
c:RegisterEffect(e2)
end
function cm.repfilter(c,tp)
return c:IsFaceup() and c:IsCode(26818000,26818001) and c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsReason(REASON_EFFECT+REASON_BATTLE) and not c:IsReason(REASON_REPLACE)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() and not c:IsStatus(STATUS_DESTROY_CONFIRMED)
and eg:IsExists(cm.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT+REASON_DISCARD)
end
function cm.sepfilter(c,tp)
return c:IsFaceup() and (aux.IsCodeListed(c,26818000) or aux.IsCodeListed(c,26818001)) and not c:IsCode(m)
and c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsReason(REASON_EFFECT+REASON_BATTLE) and not c:IsReason(REASON_REPLACE)
end
function cm.septg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(cm.sepfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function cm.sepval(e,c)
return cm.sepfilter(c,e:GetHandlerPlayer())
end
function cm.sepop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
--to field
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.tftg)
e3:SetOperation(cm.tfop)
c:RegisterEffect(e3)
end
function cm.tffilter(c,tp)
return c:IsType(TYPE_SPELL) and c:IsType(TYPE_CONTINUOUS) and not c:IsForbidden() and (aux.IsCodeListed(c,26818000) or aux.IsCodeListed(c,26818001))
end
function cm.tftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(cm.tffilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,tp) end
end
function cm.tfop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.tffilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
......@@ -18,13 +18,13 @@ function cm.initial_effect(c)
c:RegisterEffect(e2)
end
function cm.cfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:GetPreviousControler()==1-tp and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil)
return eg:IsExists(cm.cfilter,1,nil,tp)
end
function cm.thfilter(c)
return c:IsLevel(3,9) and not c:IsCode(m) and c:IsAbleToHand()
return c:IsLevel(3) and not c:IsCode(m) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.thfilter(chkc) end
......
......@@ -4,15 +4,19 @@ local cm=_G["c"..m]
xpcall(function() require("expansions/script/c26800000") end,function() require("script/c26800000") end)
function cm.initial_effect(c)
Amana.Majsoul(c)
--cannot select battle target
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetValue(cm.atlimit)
c:RegisterEffect(e1)
--atk/def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(cm.atktg)
e2:SetValue(1000)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
end
function cm.atktg(e,c)
return c:IsCode(26818000,26818001)
end
function cm.atlimit(e,c)
return c:IsFaceup() and c:IsLevel(9)
end
\ No newline at end of file
......@@ -4,35 +4,47 @@ local cm=_G["c"..m]
xpcall(function() require("expansions/script/c26800000") end,function() require("script/c26800000") end)
function cm.initial_effect(c)
Amana.Majsoul(c)
--double damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(cm.damtg)
e1:SetValue(aux.ChangeBattleDamage(1,DOUBLE_DAMAGE))
c:RegisterEffect(e1)
--actlimit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,1)
e3:SetCondition(cm.actcon)
e3:SetValue(1)
c:RegisterEffect(e3)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m)
e2:SetCost(cm.spcost)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
end
function cm.damtg(e,c)
return c:IsCode(26818000,26818001) and c:GetBattleTarget()~=nil
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function cm.cfilter(c,tp)
return c:IsFaceup() and (aux.IsCodeListed(c,26818000) or aux.IsCodeListed(c,26818001)) and c:IsControler(tp)
function cm.cfilter(c,e,tp)
return c:IsFaceup() and (aux.IsCodeListed(c,26818000) or aux.IsCodeListed(c,26818001)) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost(POS_FACEUP) and Duel.GetMZoneCount(tp,c)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetCode())
end
function cm.actcon(e)
local tp=e:GetHandlerPlayer()
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
return (a and cm.cfilter(a,tp)) or (d and cm.cfilter(d,tp))
function cm.spfilter(c,e,tp,code)
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil,e,tp)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
e:SetLabel(g:GetFirst():GetCode())
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,e:GetLabel())
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--银幕音乐会·白狐
local m=26821017
local cm=_G["c"..m]
cm.named_with_SliverScene=1
function cm.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.spcon)
e1:SetCost(cm.cost)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m+900)
e2:SetCondition(cm.condition)
e2:SetCost(cm.cost)
e2:SetTarget(cm.target)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
end
function cm.IsSliverScene(c)
local m=_G["c"..c:GetCode()]
return m and (m.named_with_SliverScene or c:IsCode(26821000,26821999))
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCurrentPhase()==PHASE_MAIN1 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.cfilter(c)
return c:IsFaceup() and cm.IsSliverScene(c) and not c:IsCode(m)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.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 cm.efilter(c)
return c:IsFaceup() and c:IsCode(26821000)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and Duel.IsExistingMatchingCard(cm.efilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function cm.filter(c,e,tp)
return cm.IsSliverScene(c) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
if not Duel.IsExistingMatchingCard(cm.efilter,tp,LOCATION_ONFIELD,0,1,nil) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,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
......@@ -23,7 +23,7 @@ function c30000205.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,30000205)
e2:SetCountLimit(1,30000206)
e2:SetCost(c30000205.cost)
e2:SetTarget(c30000205.target1)
e2:SetOperation(c30000205.operation)
......@@ -32,7 +32,7 @@ function c30000205.initial_effect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_REMOVE)
e3:SetCountLimit(1,30000206)
e3:SetCountLimit(1,30000207)
e3:SetTarget(c30000205.sttg)
e3:SetOperation(c30000205.stop)
c:RegisterEffect(e3)
......
--混沌的轮回 循环
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m,cm=rscf.DefineCard(30000220)
function cm.initial_effect(c)
local e1=rsef.ACT(c,nil,nil,nil,"td,dr",nil,nil,nil,cm.tg,cm.act)
local e2=rsef.I(c,{m,0},nil,"td,dr","tg",LOCATION_GRAVE,aux.exccon,nil,rstg.target({cm.tdfilter,"td",LOCATION_GRAVE+LOCATION_REMOVED,0,2 },rsop.list(Card.IsAbleToDeck,"td"),rsop.list(nil,"dr",1)),cm.drop)
if cm.actct then return end
cm.actct=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_NEGATED)
ge1:SetOperation(cm.regop)
Duel.RegisterEffect(ge1,tp)
end
function cm.checkfun(att)
return function(c)
return (c:IsType(TYPE_MONSTER) and c:IsAttribute(att)) or ((c:IsComplexType(TYPE_SPELL+TYPE_PENDULUM) and c:GetAttribute()&att>0))
end
end
cm.hnchecks={cm.checkfun(ATTRIBUTE_LIGHT),cm.checkfun(ATTRIBUTE_DARK)}
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler():IsCode(m) then
cm.actct=math.max(cm.actct-1,0)
end
end
function cm.cfilter(c)
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsAbleToDeck()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,nil)
if chk==0 then return g:CheckSubGroupEach(cm.hnchecks,aux.TRUE) and Duel.IsPlayerCanDraw(tp,cm.actct+3) end
cm.actct=cm.actct+1
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,tp,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function cm.act(e,tp)
local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,nil)
if not g:CheckSubGroupEach(cm.hnchecks,aux.TRUE) then return end
local tg=g:SelectSubGroupEach(tp,cm.hnchecks,false,aux.TRUE)
local hg=tg:Filter(Card.IsLocation,nil,LOCATION_HAND)
if #hg>0 then
Duel.ConfirmCards(1-tp,hg)
end
Duel.HintSelection(tg-hg)
if Duel.SendtoDeck(tg,nil,2,REASON_EFFECT)>0 then
Duel.Draw(tp,cm.actct+2,REASON_EFFECT)
end
end
function cm.tdfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_DARK+ATTRIBUTE_LIGHT) and c:IsAbleToDeck()
end
function cm.drop(e,tp)
local tg=rsgf.GetTargetGroup()
local c=aux.ExceptThisCard(e)
if not c or #tg<=0 then return end
tg:AddCard(c)
if Duel.SendtoDeck(tg,nil,2,REASON_EFFECT)>0 then
local og=Duel.GetOperatedGroup()
if og:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then
Duel.ShuffleDeck(tp)
end
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--CRuritor FluWers
local m=33330080
local cm=_G["c"..m]
function c33330080.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_POSITION+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
c:RegisterEffect(e2)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetDecktopGroup(tp,10)
if chk==0 then
if c:IsLocation(LOCATION_HAND) then
return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_EXTRA,0,5,c) and g:FilterCount(Card.IsAbleToRemoveAsCost,nil,POS_FACEDOWN)==10
else
return g:FilterCount(Card.IsAbleToRemoveAsCost,nil,POS_FACEDOWN)==10
end
end
if e:GetHandler():IsStatus(STATUS_ACT_FROM_HAND) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_EXTRA,0,5,99,c)
Duel.Remove(g,POS_FACEDOWN,REASON_COST)
end
Duel.DisableShuffleCheck()
Duel.Remove(g,POS_FACEDOWN,REASON_COST)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
if chk==0 then return g:IsExists(Card.IsFaceup,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,nil,0,0)
end
function cm.tdfil(c)
return c:IsFaceup() and not c:IsType(TYPE_LINK) and not (c:IsType(TYPE_PENDULUM) and c:IsType(TYPE_SPELL)) and not c:IsType(TYPE_TOKEN)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_MUSIC,0,aux.Stringid(33330080,0))
if not Duel.IsPlayerCanRemove(1-tp) and not Duel.IsPlayerAffectedByEffect(1-tp,EFFECT_CANNOT_MSET) and not Duel.IsPlayerAffectedByEffect(1-tp,EFFECT_CANNOT_SSET) then return end
local g=Duel.GetMatchingGroup(cm.tdfil,1-tp,LOCATION_ONFIELD,0,nil)
local gc=Duel.GetMatchingGroupCount(Card.IsFacedown,tp,LOCATION_REMOVED,0,nil)//10
if #g>0 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SET)
local sg=g:FilterSelect(1-tp,cm.tdfil,gc,gc,nil,1-tp,POS_FACEDOWN,REASON_RULE)
Duel.ChangePosition(sg,POS_FACEDOWN_DEFENSE)
Duel.Remove(sg,POS_FACEDOWN,REASON_RULE)
local rg=Duel.GetMatchingGroup(Card.IsFacedown,1-tp,LOCATION_ONFIELD,0,nil)
Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)
end
end
local m=53799047
local cm=_G["c"..m]
cm.name="苦涩的节制"
function cm.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,m+EFFECT_COUNT_CODE_DUEL+EFFECT_COUNT_CODE_OATH)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_DECK,0,5,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local cg=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_DECK,0,nil)
if cg:GetCount()<5 then return end
Duel.ConfirmCards(1-tp,cg)
Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(m,0))
local g=cg:Select(1-tp,5,5,nil)
if g:GetCount()<5 then return end
Duel.ConfirmCards(tp,g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
g:Sub(sg)
Duel.SendtoGrave(g,REASON_EFFECT)
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_GRAVE)
for oc in aux.Next(og) do
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_TRIGGER)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_GRAVE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
oc:RegisterEffect(e3)
end
end
local m=53799048
local cm=_G["c"..m]
cm.name="台风魔女甜点师"
function cm.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
end
function cm.spfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function cm.fselect(g,tp)
return Duel.GetMZoneCount(tp,g)>0 and g:GetClassCount(Card.GetAttribute)==#g
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local rg=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_REMOVED,0,nil)
return rg:CheckSubGroup(cm.fselect,2,2,tp)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local rg=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_REMOVED,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,0))
local sg=rg:SelectSubGroup(tp,cm.fselect,true,2,2,tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.SendtoGrave(g,REASON_COST+REASON_RETURN)
g:DeleteGroup()
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_REMOVE)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.rmlimit)
e1:SetLabel(tc:GetOriginalAttribute())
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
tc=g:GetNext()
end
end
function cm.rmlimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:GetOriginalAttribute()==e:GetLabel() and not c:IsLocation(LOCATION_ONFIELD)
end
local m=53799052
local cm=_G["c"..m]
cm.name="苦涩的杀灭"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--to grave
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,m)
e3:SetCost(cm.tgcost)
e3:SetTarget(cm.tgtg)
e3:SetOperation(cm.tgop)
c:RegisterEffect(e3)
end
function cm.tgcfilter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() and Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,c:GetCode())
end
function cm.tgfilter(c,code)
return c:IsType(TYPE_MONSTER) and c:IsCode(code) and c:IsAbleToGrave()
end
function cm.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgcfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.tgcfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,tp)
e:SetLabel(g:GetFirst():GetCode())
Duel.SendtoGrave(g,REASON_COST)
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,e:GetLabel())
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
......@@ -6,7 +6,6 @@ function c75646007.initial_effect(c)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,75646007)
e1:SetCondition(c75646007.spcon)
c:RegisterEffect(e1)
--Destroy
......@@ -72,7 +71,7 @@ function c75646007.chainop(e,tp,eg,ep,ev,re,r,rp)
Duel.SetChainLimit(c75646007.chainlm)
else
Duel.SetChainLimit(aux.FALSE)
end
end
end
end
function c75646007.chainlm(e,rp,tp)
......
--崩坏学园 宁蒂
local m=75646015
local cm=_G["c"..m]
function cm.initial_effect(c)
--indes
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(aux.dscon)
e1:SetCost(cm.cost)
e1:SetTarget(cm.eqtg)
e1:SetOperation(cm.eqop)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_START)
e2:SetCondition(cm.recon)
e2:SetTarget(cm.retg)
e2:SetOperation(cm.reop)
c:RegisterEffect(e2)
--act limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(cm.chaincon)
e3:SetOperation(cm.chainop)
c:RegisterEffect(e3)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.efilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x2c0)
and Duel.IsExistingMatchingCard(cm.eqfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,c)
end
function cm.eqfilter(c,tc)
return c:IsType(TYPE_EQUIP) and c:IsSetCard(0x2c0) and c:CheckEquipTarget(tc) and (c:IsLocation(LOCATION_DECK+LOCATION_GRAVE) or c:IsFaceup())
end
function cm.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and cm.efilter(chkc,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(cm.efilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,cm.efilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
end
function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.eqfilter),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,tc)
local eq=g:GetFirst()
if eq then
Duel.Equip(tp,eq,tc,true)
eq:AddCounter(0x1b,2)
end
end
function cm.recon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local d=Duel.GetAttackTarget()
return c==Duel.GetAttacker() and d and d:IsPosition(POS_FACEDOWN_DEFENSE)
end
function cm.retg(e,tp,eg,ep,ev,re,r,rp,chk)
local d=Duel.GetAttackTarget()
if chk==0 then return d:IsAbleToRemove() end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,d,1,0,0)
end
function cm.reop(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget()
if d:IsRelateToBattle() and d:IsPosition(POS_FACEDOWN_DEFENSE) then
Duel.Remove(d,POS_FACEDOWN,REASON_RULE)
end
end
function cm.chaincon(e)
local ph=Duel.GetCurrentPhase()
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
end
function cm.chainop(e,tp,eg,ep,ev,re,r,rp)
local es=re:GetHandler()
if es:IsSetCard(0x2c0) and es:IsType(TYPE_EQUIP)
and es:GetEquipTarget()==e:GetHandler() and re:IsActiveType(TYPE_SPELL) and ep==tp then
if Duel.IsPlayerAffectedByEffect(e:GetHandler():GetControler(),75646210) then
Duel.SetChainLimit(cm.chainlm)
else
Duel.SetChainLimit(aux.FALSE)
end
end
end
function cm.chainlm(e,rp,tp)
return tp==rp
end
\ No newline at end of file
--童话世界的三连星
local m=75646075
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,75646549)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcMix(c,true,true,aux.FilterBoolFunction(Card.IsFusionSetCard,0x92c2),aux.FilterBoolFunction(Card.IsFusionSetCard,0xa2c2),aux.FilterBoolFunction(Card.IsFusionSetCard,0xc2c2))
aux.AddContactFusionProcedure(c,Card.IsAbleToGraveAsCost,LOCATION_MZONE,0,Duel.SendtoGrave,REASON_COST)
--Remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetTarget(cm.remtg)
e1:SetOperation(cm.remop)
c:RegisterEffect(e1)
--actlimit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(1,1)
e2:SetValue(cm.actlimit)
c:RegisterEffect(e2)
--disable
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DISABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e3:SetTarget(cm.distg)
c:RegisterEffect(e3)
--disable effect
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAIN_SOLVING)
e4:SetRange(LOCATION_MZONE)
e4:SetOperation(cm.disop)
c:RegisterEffect(e4)
--Special Summon
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,1))
e5:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE)
e5:SetCategory(CATEGORY_TOGRAVE)
e5:SetCode(EVENT_LEAVE_FIELD)
e5:SetCondition(cm.tgcon)
e5:SetTarget(cm.tgtg)
e5:SetOperation(cm.tgop)
c:RegisterEffect(e5)
end
function cm.filter(c)
return c:IsAbleToRemove() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.remtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
Duel.SetChainLimit(aux.FALSE)
end
function cm.remop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetReset(RESET_EVENT+0x1ff0000)
e1:SetValue(g:GetCount()*200)
c:RegisterEffect(e1)
end
end
function cm.actlimit(e,te,tp)
return (te:IsHasType(EFFECT_TYPE_ACTIVATE) and te:IsActiveType(TYPE_SPELL)) or te:IsActiveType(TYPE_SPELL)
end
function cm.distg(e,c)
return c:IsType(TYPE_TRAP)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local tl=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
if tl==LOCATION_SZONE and re:IsActiveType(TYPE_TRAP) then
Duel.NegateEffect(ev)
end
end
function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousPosition(POS_FACEUP) and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function cm.filter2(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
Duel.SendtoGrave(g,REASON_EFFECT+REASON_RETURN)
end
\ No newline at end of file
--崩坏神格 米梅
local m=75646270
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,75646000,75646153)
c:SetUniqueOnField(1,0,m)
--equip limit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_EQUIP_LIMIT)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetValue(cm.eqlimit)
c:RegisterEffect(e0)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--def and atk up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetValue(cm.val)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_ATTACK)
c:RegisterEffect(e3)
local ex2=e2:Clone()
ex2:SetType(EFFECT_TYPE_XMATERIAL)
ex2:SetCondition(cm.con)
c:RegisterEffect(ex2)
local ex3=e3:Clone()
ex3:SetType(EFFECT_TYPE_XMATERIAL)
ex3:SetCondition(cm.con)
c:RegisterEffect(ex3)
--Untargetable
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e4:SetValue(aux.tgoval)
c:RegisterEffect(e4)
local ex4=e4:Clone()
ex4:SetType(EFFECT_TYPE_XMATERIAL)
ex4:SetCondition(cm.con)
c:RegisterEffect(ex4)
--atklimit
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_EQUIP)
e5:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e5:SetValue(aux.imval1)
c:RegisterEffect(e5)
local ex5=e5:Clone()
ex5:SetType(EFFECT_TYPE_XMATERIAL)
ex5:SetCondition(cm.con)
c:RegisterEffect(ex5)
--search
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetRange(LOCATION_GRAVE)
e6:SetCountLimit(3,75646150)
e6:SetCost(cm.thcost)
e6:SetTarget(cm.thtg)
e6:SetOperation(cm.thop)
c:RegisterEffect(e6)
end
function cm.eqlimit(e,c)
return c:IsSetCard(0x2c0)
end
function cm.filter(c)
return c:IsFaceup() and c:IsSetCard(0x2c0)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function cm.con(e)
local c=e:GetHandler()
return c:IsHasEffect(75646072,e:GetHandlerPlayer())
end
function cm.val(e)
local tp=e:GetHandlerPlayer()
local ct=Duel.GetLocationCount(tp,LOCATION_SZONE,PLAYER_NONE,0)+Duel.GetLocationCount(tp,LOCATION_MZONE,PLAYER_NONE,0)
return ct*300
end
function cm.cfilter(c)
return aux.IsCodeListed(c,75646000) and c:IsAbleToRemoveAsCost()
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
g:AddCard(e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function cm.thfilter(c)
return c:IsSetCard(0x2c0) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
......@@ -23,11 +23,14 @@ function c75646301.initial_effect(c)
c:RegisterEffect(e2)
c75646301.act_effect=e2
end
function c75646301.thfilter(c)
return c:IsAbleToHand()
end
function c75646301.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local loc=LOCATION_ONFIELD
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then loc=LOCATION_MZONE end
if chkc then return chkc:IsLocation(loc) and chkc:IsControler(tp) and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,loc,0,1,nil) and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
if chkc then return chkc:IsLocation(loc) and chkc:IsControler(tp) and c75646301.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c75646301.thfilter,tp,loc,0,1,nil) and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,loc,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
......
--星海·一月
local m=81005065
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--to deck
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(cm.descon1)
e2:SetCost(cm.thcost)
e2:SetTarget(cm.tdtg)
e2:SetOperation(cm.tdop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetCondition(cm.descon2)
c:RegisterEffect(e3)
end
function cm.filter(c)
return c:IsFaceup() and bit.band(c:GetType(),0x20004)==0x20004 and c:IsAbleToGraveAsCost()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_ONFIELD,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_ONFIELD,0,2,2,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function cm.spfilter(c,e,tp)
return aux.IsCodeListed(c,81005036) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
and not Duel.IsExistingMatchingCard(cm.efilter,tp,LOCATION_ONFIELD,0,1,nil,c:GetCode())
end
function cm.efilter(c,code)
return c:IsFaceup() and c:IsCode(code)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,true,POS_FACEUP)
g:GetFirst():CompleteProcedure()
Duel.Hint(HINT_MUSIC,0,aux.Stringid(m,0))
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetRange(LOCATION_MZONE)
e3:SetAbsoluteRange(tp,1,0)
e3:SetTarget(cm.splimit)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
g:GetFirst():RegisterEffect(e3,true)
end
end
function cm.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not se:GetHandler():IsType(TYPE_TRAP+TYPE_SPELL) and c:IsLocation(LOCATION_EXTRA)
end
function cm.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_CONTINUOUS) and c:IsType(TYPE_TRAP)
end
function cm.descon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function cm.descon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost()
and Duel.CheckReleaseGroup(tp,nil,1,nil) end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
local g=Duel.SelectReleaseGroup(tp,nil,1,1,nil)
Duel.Release(g,REASON_COST)
end
function cm.tdfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.tdfilter,tp,LOCATION_GRAVE,0,1,2,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
--鲜为人知的天使护士
local m=81005066
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,99,cm.lcheck)
c:EnableReviveLimit()
--cannot be link material
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetValue(1)
c:RegisterEffect(e1)
--fusion summon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m)
e2:SetCost(cm.spcost)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
end
function cm.lcheck(g,lc)
return g:IsExists(Card.IsLinkType,2,nil,TYPE_EFFECT)
end
function cm.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeckAsCost()
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_HAND,0,1,1,nil)
if g:GetFirst():IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,g)
end
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
function cm.filter0(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function cm.filter1(c,e)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and not c:IsImmuneToEffect(e) and c:IsAbleToDeck()
end
function cm.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetMatchingGroup(cm.filter0,tp,LOCATION_REMOVED,0,nil)
local res=Duel.IsExistingMatchingCard(cm.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(cm.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_TODECK,nil,1,tp,LOCATION_REMOVED)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chkf=tp
local mg1=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_REMOVED,0,nil,e)
local sg1=Duel.GetMatchingGroup(cm.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(cm.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()
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)
Duel.SendtoDeck(mat1,nil,2,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
local c=e:GetHandler()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetTarget(cm.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function cm.splimit(e,c)
return not c:IsType(TYPE_FUSION) and c:IsLocation(LOCATION_EXTRA)
end
--砂冢明音·青空之下
local m=81005067
local cm=_G["c"..m]
function cm.initial_effect(c)
--code
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e0:SetCode(EFFECT_CHANGE_CODE)
e0:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e0:SetValue(81011027)
c:RegisterEffect(e0)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(cm.spcost)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DESTROYED)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.sscon)
e2:SetTarget(cm.sstg)
e2:SetOperation(cm.ssop)
c:RegisterEffect(e2)
end
function cm.costfilter(c,tp)
return (bit.band(c:GetOriginalType(),TYPE_SPELL)~=0 or bit.band(c:GetOriginalType(),TYPE_TRAP)~=0) and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_ONFIELD,0,2,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_ONFIELD,0,2,2,nil,tp)
Duel.SendtoGrave(g,REASON_COST)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function cm.scfilter(c,tp)
return (bit.band(c:GetOriginalType(),TYPE_SPELL)~=0 or bit.band(c:GetOriginalType(),TYPE_TRAP)~=0) and c:GetPreviousControler()==tp
and c:IsPreviousLocation(LOCATION_ONFIELD)
and c:GetReasonPlayer()==1-tp
end
function cm.sscon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.scfilter,1,nil,tp)
end
function cm.sefilter(c)
return c:IsCode(81011027) and c:IsFaceup()
end
function cm.sstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)>0 and Duel.IsExistingMatchingCard(cm.sefilter,tp,LOCATION_ONFIELD,0,1,nil)end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,0,LOCATION_MZONE)
end
function cm.ssop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local ct=Duel.GetMatchingGroupCount(cm.sefilter,tp,LOCATION_ONFIELD,0,nil)
if g:GetCount()>0 and ct>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:Select(tp,1,ct,nil)
Duel.HintSelection(sg)
Duel.SendtoGrave(sg,REASON_RULE)
end
end
--七草一花·宿命
local m=81005068
local cm=_G["c"..m]
xpcall(function() require("expansions/script/c81000000") end,function() require("script/c81000000") end)
function cm.initial_effect(c)
Tenka.EightOne(c)
aux.AddSynchroMixProcedure(c,aux.Tuner(Card.IsSynchroType,TYPE_SYNCHRO),aux.Tuner(Card.IsSynchroType,TYPE_SYNCHRO),aux.Tuner(Card.IsSynchroType,TYPE_SYNCHRO),aux.NonTuner(Card.IsCode,81011039),1,1)
c:EnableReviveLimit()
--banish
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.destg)
e1:SetOperation(cm.desop)
c:RegisterEffect(e1)
--disable attack
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCountLimit(1,m+900)
e2:SetCondition(cm.atkcon)
e2:SetCost(cm.atkcost)
e2:SetTarget(cm.atktg)
e2:SetOperation(cm.atkop)
c:RegisterEffect(e2)
end
function cm.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_TRAP) and c:IsType(TYPE_CONTINUOUS)
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(cm.cfilter,tp,LOCATION_ONFIELD,0,nil)
if ct==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_ONFIELD,1,ct,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return tc:IsControler(1-tp)
end
function cm.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,aux.TRUE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(tp,aux.TRUE,1,1,nil)
Duel.Release(g,REASON_COST)
end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateAttack() then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--樱守美羽
local m=81005069
local cm=_G["c"..m]
xpcall(function() require("expansions/script/c81000000") end,function() require("script/c81000000") end)
function cm.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),aux.NonTuner(Card.IsRace,RACE_ZOMBIE),1)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.condition)
e2:SetTarget(cm.target)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_MZONE,nil)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and c:IsReason(REASON_BATTLE+REASON_EFFECT)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:GetPreviousControler()==tp
end
function cm.filter(c,e,tp)
return c:IsLevelBelow(4) and c:IsRace(RACE_ZOMBIE) and not c:IsCode(m) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
local rec=e:GetHandler():GetBaseAttack()
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(rec)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,rec)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
local c=e:GetHandler()
if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.BreakEffect()
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
end
--星希花音
local m=81005070
local cm=_G["c"..m]
function cm.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_WARRIOR),3,2)
c:EnableReviveLimit()
--attack up
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(cm.atkcost)
e1:SetOperation(cm.atkop)
c:RegisterEffect(e1)
--Chain Attack
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_START)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(cm.asktg)
e2:SetOperation(cm.askop)
c:RegisterEffect(e2)
end
function cm.atkcost(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.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1200)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
function cm.asktg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ac=Duel.GetAttacker()
if chk==0 then return ac:IsControler(tp) and ac:IsRace(RACE_WARRIOR) and ac~=c
and c:GetAttackAnnouncedCount()==0 and c:IsAttackable() end
Duel.SetTargetCard(c)
end
function cm.askop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ac=Duel.GetAttacker()
local atk=c:GetAttack()
if atk<1 then return end
if ac:IsFaceup() and ac:IsRelateToBattle() and c:IsRelateToEffect(e) then
local e1=nef(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=nef(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.askcon)
e2:SetValue(atk)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE)
ac:RegisterEffect(e2)
end
end
function cm.askcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ph=Duel.GetCurrentPhase()
return (ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL) and c:IsRelateToBattle()
end
--黑野紫
local m=81005071
local cm=_G["c"..m]
function cm.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,m+900)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--destroy replace
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_DESTROY_REPLACE)
e4:SetTarget(cm.reptg)
e4:SetOperation(cm.repop)
c:RegisterEffect(e4)
end
function cm.tgfilter(c,tp)
return c:IsFaceup() and c:IsType(TYPE_SPELL) and c:IsType(TYPE_CONTINUOUS)
and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil,c:GetCode())
end
function cm.thfilter(c,code)
return c:IsType(TYPE_CONTINUOUS) and c:IsType(TYPE_SPELL) and c:IsAbleToHand() and not c:IsCode(code)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and cm.tgfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.tgfilter,tp,LOCATION_ONFIELD,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,cm.tgfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil,tc:GetCode())
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
function cm.cefilter(c)
return c:IsFaceup() and c:IsType(TYPE_CONTINUOUS) and c:IsType(TYPE_SPELL)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp and Duel.IsExistingMatchingCard(cm.cefilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function cm.spfilter(c,e,tp)
return c:IsRace(RACE_SPELLCASTER) and c:IsLevel(3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function cm.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)
end
end
function cm.repfilter(c,e)
return c:IsFaceup() and c:IsType(TYPE_SPELL) and c:IsType(TYPE_CONTINUOUS)
and c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsReason(REASON_REPLACE) and c:IsOnField() and c:IsFaceup()
and Duel.IsExistingMatchingCard(cm.repfilter,tp,LOCATION_ONFIELD,0,1,c,e) end
if Duel.SelectEffectYesNo(tp,c,96) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
local g=Duel.SelectMatchingCard(tp,cm.repfilter,tp,LOCATION_ONFIELD,0,1,1,c,e)
Duel.SetTargetCard(g)
g:GetFirst():SetStatus(STATUS_DESTROY_CONFIRMED,true)
return true
else return false end
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
g:GetFirst():SetStatus(STATUS_DESTROY_CONFIRMED,false)
Duel.Destroy(g,REASON_EFFECT+REASON_REPLACE)
end
--Dye the sky
local m=81010045
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.filter(c,e,tp)
return c:IsType(TYPE_PENDULUM) and c:IsType(TYPE_RITUAL)
end
function cm.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsType(TYPE_RITUAL) and c:IsLevelAbove(8)
end
function cm.mfilter(c)
return c:IsType(TYPE_PENDULUM)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsType,nil,TYPE_PENDULUM)
local mg2=nil
if Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil) then
mg2=Duel.GetMatchingGroup(aux.RitualExtraFilter,tp,LOCATION_GRAVE,0,nil,cm.mfilter)
end
return Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,cm.filter,e,tp,mg,mg2,Card.GetLevel,"Greater")
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
if Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil) then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,tp,LOCATION_GRAVE)
e:SetLabel(1)
else
e:SetLabel(0)
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsType,nil,TYPE_PENDULUM)
local mg2=nil
if e:GetLabel()==1 then
mg2=Duel.GetMatchingGroup(aux.RitualExtraFilter,tp,LOCATION_GRAVE,0,nil,cm.mfilter)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,1,nil,cm.filter,e,tp,mg,mg2,Card.GetLevel,"Greater")
local tc=tg:GetFirst()
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if mg2 then
mg:Merge(mg2)
end
if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp)
else
mg:RemoveCard(tc)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
--Amnesia-collapse-
local m=81010046
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddRitualProcGreater2(c,cm.ritual_filter)
--ritual summon
local e1=aux.AddRitualProcGreater2(c,cm.ritual_filter)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCode(0)
e1:SetRange(LOCATION_GRAVE)
e1:SetCondition(cm.condition)
e1:SetCost(aux.bfgcost)
end
function cm.ritual_filter(c)
return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_PENDULUM)
end
function cm.filter(c)
return c:IsFaceup() and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_PENDULUM)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,2,nil) and aux.exccon(e)
end
--Memory-Go-Round
local m=81011059
local cm=_G["c"..m]
xpcall(function() require("expansions/script/c37564765") end,function() require("script/c37564765") end)
cm.Senya_desc_with_nanahira=true
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m+900)
e2:SetCondition(cm.setcon)
e2:SetTarget(cm.settg)
e2:SetOperation(cm.setop)
c:RegisterEffect(e2)
end
function cm.cfilter(c)
return c:IsFaceup() and c:IsCode(37564765)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function cm.filter(c)
return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and aux.IsCodeListed(c,37564765) and c:IsAbleToDeck()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED+LOCATION_GRAVE) and chkc:IsControler(tp) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,5,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
function cm.setfilter(c,tp)
return c:IsFaceup() and c:IsCode(37564765) and c:IsControler(tp)
end
function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.setfilter,1,nil,tp)
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SSet(tp,c)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1)
end
end
--高山纱代子的华丽开演
local m=81017028
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.con)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.ac)
c:RegisterEffect(e1)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_GRAVE)
e3:SetCost(aux.bfgcost)
e3:SetTarget(cm.destg)
e3:SetOperation(cm.desop)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(m,ACTIVITY_SUMMON,cm.counterfilter)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
Duel.AddCustomActivityCounter(m,ACTIVITY_FLIPSUMMON,cm.counterfilter)
end
function cm.counterfilter(c)
return c:IsRace(RACE_WARRIOR)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SUMMON)==0
and Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0
and Duel.GetCustomActivityCount(m,tp,ACTIVITY_FLIPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.sumlimit)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e2,tp)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_FLIP_SUMMON)
Duel.RegisterEffect(e3,tp)
end
function cm.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsRace(RACE_WARRIOR)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
end
function cm.spfilter(c,e,tp)
return c:IsSetCard(0x819) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.ac(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp)
local ft=math.min(Duel.GetLocationCount(tp,LOCATION_MZONE),g:GetCount(),ct)
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,ft,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
function cm.bfilter(c)
return c:IsFaceup() and c:IsSetCard(0x819)
end
function cm.gfilter(c)
return c:IsFaceup() and not c:IsRace(RACE_FAIRY)
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.bfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(cm.gfilter,tp,0,LOCATION_MZONE,1,nil) end
local ct=Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPPO)
local g=Duel.SelectTarget(tp,cm.gfilter,tp,0,LOCATION_MZONE,1,ct,nil)
if Duel.IsExistingMatchingCard(cm.acfilter,tp,0,LOCATION_MZONE,1,nil) and not Duel.IsExistingMatchingCard(cm.acfilter,tp,LOCATION_MZONE,0,1,nil) then
Duel.SetChainLimit(cm.chainlm)
end
end
function cm.acfilter(c)
return c:IsFaceup() and c:IsRace(RACE_FAIRY)
end
function cm.chainlm(e,rp,tp)
return tp==rp
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local g=tg:Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 then
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetValue(RACE_FAIRY)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
end
--紧急事态·拉蒂
local m=81022015
local cm=_G["c"..m]
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--to extra
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.tdtg)
e1:SetOperation(cm.tdop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m+900)
e2:SetCost(cm.thcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--gain
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_EVENT_PLAYER)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetCondition(cm.mtcon)
e3:SetOperation(cm.mtop)
c:RegisterEffect(e3)
end
function cm.tdfilter(c)
return c:IsRace(RACE_PYRO) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
end
function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and cm.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,cm.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function cm.mtcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_RITUAL
and eg:IsExists(Card.IsType,1,nil,TYPE_PENDULUM)
end
function cm.mtop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=eg:Filter(Card.IsType,nil,TYPE_PENDULUM)
local rc=g:GetFirst()
if not rc then return end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_HANDES+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLED)
e1:SetTarget(cm.drtg)
e1:SetOperation(cm.drop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_ADD_TYPE)
e3:SetValue(TYPE_EFFECT)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e3,true)
end
rc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,2))
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
if Duel.Draw(tp,2,REASON_EFFECT)~=0 then
Duel.BreakEffect()
Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)
end
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function cm.thfilter(c)
return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetTargetRange(1,0)
e3:SetTarget(cm.splimit)
e3:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,2)
Duel.RegisterEffect(e3,tp)
end
function cm.splimit(e,c)
return not c:IsRace(RACE_PYRO)
end
--学院制服·安洁莉娜
local m=81022016
local cm=_G["c"..m]
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--spsummon2
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m+900)
e2:SetTarget(cm.sptg2)
e2:SetOperation(cm.spop2)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function cm.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsType(TYPE_RITUAL)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.filter(c,e,sp)
return c:IsRace(RACE_PYRO) and c:IsCanBeSpecialSummoned(e,0,sp,false,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if not e:GetHandler():IsRelateToEffect(e) then return end
if not Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.cfilter2(c,e,tp)
return c:IsCode(m) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.cfilter2,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.cfilter2,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
--Call Our Name
local m=81022017
local cm=_G["c"..m]
function cm.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,m+EFFECT_COUNT_CODE_OATH)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--negate attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(cm.condition)
e2:SetCost(aux.bfgcost)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
end
function cm.costfilter(c)
return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_SPELL) and c:IsDiscardable()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,cm.costfilter,1,1,REASON_COST+REASON_DISCARD,nil)
end
function cm.filter(c)
return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.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 cm.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp) and Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
a:RegisterEffect(e1)
if d then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(1)
e2:SetReset(RESET_PHASE+PHASE_DAMAGE)
d:RegisterEffect(e2)
end
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e3,tp)
end
--突然的请求·安洁莉娜
local m=81022018
local cm=_G["c"..m]
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
c:EnableReviveLimit()
--pendulum set
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.thcon)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m+900)
e2:SetCost(cm.tscost)
e2:SetTarget(cm.tstg)
e2:SetOperation(cm.tsop)
c:RegisterEffect(e2)
--direct attack
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_DIRECT_ATTACK)
e4:SetCondition(cm.dircon)
c:RegisterEffect(e4)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
end
function cm.counterfilter(c)
return c:IsRace(RACE_PYRO)
end
function cm.cfilter(c)
return c:IsRace(RACE_PYRO) and c:IsFaceup() and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_PENDULUM)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDestructable()
and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,c) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,c,1,0,0)
end
function cm.thop(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 g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()==0 then return end
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local sg=g:Select(tp,1,1,nil)
Duel.HintSelection(sg)
local tc=sg:GetFirst()
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)
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)
tc:RegisterEffect(e2)
local e4=e1:Clone()
e4:SetCode(EFFECT_CANNOT_ATTACK)
tc:RegisterEffect(e4)
end
end
function cm.dfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function cm.tscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.dfilter,tp,LOCATION_EXTRA,0,1,nil) and Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.dfilter,tp,LOCATION_EXTRA,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
Duel.RegisterEffect(e1,tp)
end
function cm.splimit(e,c)
return not c:IsRace(RACE_PYRO)
end
function cm.tsfilter(c)
return c:IsRace(RACE_PYRO) and c:IsAbleToHand()
end
function cm.tstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tsfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.tsop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.tsfilter,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 cm.hfilter(c)
return c:IsFaceup() and c:IsRace(RACE_PYRO)
end
function cm.dircon(e)
local tp=e:GetHandlerPlayer()
return not Duel.IsExistingMatchingCard(cm.hfilter,tp,0,LOCATION_MZONE,1,nil)
end
--BLUE FRACTAL
local m=81022019
local cm=_G["c"..m]
function cm.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,m)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--return
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,m)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.ctarget)
e2:SetOperation(cm.coperation)
c:RegisterEffect(e2)
end
function cm.filter(c)
return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_SPELL) and c:IsSSetable()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc and Duel.SSet(tp,tc)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function cm.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_SPELL)
end
function cm.ctarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_REMOVED,0,1,nil) end
local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_REMOVED,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0)
end
function cm.coperation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_REMOVED,0,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT+REASON_RETURN)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(cm.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function cm.aclimit(e,re,tp)
return re:GetActivateLocation()==LOCATION_GRAVE and re:IsActiveType(TYPE_SPELL) and re:GetHandler():IsType(TYPE_RITUAL)
end
--棒球选手·理子
local m=81022020
local cm=_G["c"..m]
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--atk
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_UPDATE_ATTACK)
e0:SetRange(LOCATION_PZONE)
e0:SetTargetRange(LOCATION_MZONE,0)
e0:SetTarget(cm.atktg)
e0:SetValue(1000)
c:RegisterEffect(e0)
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.spcon)
e2:SetCost(cm.spcost)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
end
function cm.atktg(e,c)
return c:IsRace(RACE_PYRO)
end
function cm.splimit(e,c,sump,sumtype,sumpos,targetp)
return not c:IsRace(RACE_PYRO)
end
function cm.afilter(c)
return c:IsFaceup() and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_PENDULUM)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.afilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.spcost(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 cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if chk==0 then return g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
--被发现了·安洁莉娜
local m=81022021
local cm=_G["c"..m]
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
c:EnableReviveLimit()
--disable
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetRange(LOCATION_PZONE)
e0:SetCode(EVENT_CHAIN_SOLVING)
e0:SetCondition(cm.discon)
e0:SetOperation(cm.disop)
c:RegisterEffect(e0)
--pendulum set
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.pencost)
e1:SetTarget(cm.pentg)
e1:SetOperation(cm.penop)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_GRAVE)
e2:SetTarget(cm.reptg)
e2:SetValue(cm.repval)
e2:SetOperation(cm.repop)
c:RegisterEffect(e2)
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsChainDisablable(ev) and re:IsHasCategory(CATEGORY_REMOVE) and e:GetHandler():GetFlagEffect(m)==0
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.SelectEffectYesNo(tp,e:GetHandler()) then return end
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
if not Duel.NegateEffect(ev) then return end
Duel.BreakEffect()
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
function cm.pencost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.penfilter(c)
return c:IsRace(RACE_PYRO) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden()
end
function cm.pentg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and cm.penfilter(chkc) end
if chk==0 then return (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1))
and Duel.IsExistingTarget(cm.penfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectTarget(tp,cm.penfilter,tp,LOCATION_GRAVE,0,1,1,nil)
end
function cm.penop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return end
if tc:IsRelateToEffect(e) and Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)>0 then
end
end
function cm.repfilter(c,tp)
return c:IsFaceup() and c:IsLocation(LOCATION_ONFIELD)
and c:IsControler(tp)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and aux.exccon(e) and eg:IsExists(cm.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
--出勤路上·拉蒂
local m=81022022
local cm=_G["c"..m]
xpcall(function() require("expansions/script/c81000000") end,function() require("script/c81000000") end)
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_DESTROYED)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
end
function cm.cfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT)
and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,tp)
end
function cm.spfilter(c,e,tp)
return c:IsRace(RACE_PYRO) and c:IsType(TYPE_PENDULUM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_HAND+LOCATION_DECK+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
--意外的偶遇·爱米莉
local m=81022023
local cm=_G["c"..m]
xpcall(function() require("expansions/script/c81000000") end,function() require("script/c81000000") end)
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
function cm.qfilter(c,e,tp,m,ft)
if not (c:IsType(TYPE_PENDULUM) and c:IsType(TYPE_RITUAL)) or bit.band(c:GetType(),0x81)~=0x81
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
if ft>0 then
return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
else
return mg:IsExists(cm.qfilterF,1,nil,tp,mg,c)
end
end
function cm.qfilterF(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then
Duel.SetSelectedCard(c)
return mg:CheckWithSumGreater(Card.GetRitualLevel,rc:GetLevel(),rc)
else return false end
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return ft>-1 and Duel.IsExistingMatchingCard(cm.qfilter,tp,LOCATION_HAND,0,1,nil,e,tp,mg,ft)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,cm.qfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg,ft)
local tc=tg:GetFirst()
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
local mat=nil
if ft>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:FilterSelect(tp,cm.qfilterF,1,1,nil,tp,mg,tc)
Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
mat:Merge(mat2)
end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
--灯火之魔女·舞蝶
local m=81027020
local cm=_G["c"..m]
xpcall(function() require("expansions/script/c81000000") end,function() require("script/c81000000") end)
function cm.initial_effect(c)
Tenka.Asamiya(c)
--draw
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.drcon)
e1:SetTarget(cm.drtg)
e1:SetOperation(cm.drop)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_RELEASE)
e2:SetCountLimit(1,m+900)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
end
function cm.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function cm.drfilter(c)
return c:IsFaceup() and c:IsCode(81027000)
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetMatchingGroupCount(cm.drfilter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return ct>0 and Duel.IsPlayerCanDraw(tp,ct) end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local d=Duel.GetMatchingGroupCount(cm.drfilter,tp,LOCATION_MZONE,0,nil)
Duel.Draw(p,d,REASON_EFFECT)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_RITUAL)
end
function cm.thfilter(c)
return aux.IsCodeListed(c,81027000) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--灯火之魔女·物语
local m=81027021
local cm=_G["c"..m]
xpcall(function() require("expansions/script/c81000000") end,function() require("script/c81000000") end)
function cm.initial_effect(c)
Tenka.Asamiya(c)
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.rmcon)
e1:SetTarget(cm.rmtg)
e1:SetOperation(cm.rmop)
c:RegisterEffect(e1)
--activate limit
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_DRAW_PHASE)
e2:SetCountLimit(1,m+900)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(cm.cost)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
end
function cm.rmcon(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
local bc=Duel.GetAttackTarget()
if not bc then return false end
if tc:IsControler(1-tp) then tc,bc=bc,tc end
if tc:IsFaceup() and tc:IsRace(RACE_SPELLCASTER) and c:IsType(TYPE_RITUAL) then
e:SetLabelObject(bc)
return true
else return false end
end
function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local bc=e:GetLabelObject()
if chk==0 then return bc:IsAbleToRemove() and Duel.GetFlagEffect(tp,m)==0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,bc,1,0,0)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetLabelObject()
if bc:IsRelateToBattle() and bc:IsControler(1-tp) and Duel.Remove(bc,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then
bc:SetTurnCounter(0)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,3)
e1:SetLabelObject(bc)
e1:SetCountLimit(1)
e1:SetCondition(cm.retcon)
e1:SetOperation(cm.retop)
Duel.RegisterEffect(e1,tp)
end
end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
local ct=tc:GetTurnCounter()
ct=ct+1
tc:SetTurnCounter(ct)
if ct==3 then
Duel.ReturnToField(tc)
end
end
function cm.costfilter(c)
return c:IsCode(81027000) and c:IsDiscardable()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,cm.costfilter,1,1,REASON_COST+REASON_DISCARD)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1_1=Effect.CreateEffect(c)
e1_1:SetType(EFFECT_TYPE_FIELD)
e1_1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1_1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1_1:SetTargetRange(0,1)
e1_1:SetValue(1)
e1_1:SetCondition(cm.con1_1)
e1_1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1_1,tp)
end
function cm.con1_1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()>1
end
--影霊衣の万華鏡
function c87000022.initial_effect(c)
--灯火之约定
local m=81027022
local cm=_G["c"..m]
xpcall(function() require("expansions/script/c81000000") end,function() require("script/c81000000") end)
function cm.initial_effect(c)
aux.AddCodeList(c,81027000)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,87000022)
e1:SetTarget(c87000022.target)
e1:SetOperation(c87000022.activate)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--search
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,87000022)
e2:SetCondition(c87000022.thcon)
e2:SetCost(c87000022.thcost)
e2:SetTarget(c87000022.thtg)
e2:SetOperation(c87000022.thop)
e2:SetCountLimit(1,m+900)
e2:SetCondition(cm.condition)
e2:SetCost(cm.cost)
e2:SetTarget(cm.target)
e2:SetOperation(cm.activate)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
end
function c87000022.spfilter(c,e,tp,mc)
return c:IsSetCard(0xaff) and bit.band(c:GetType(),0x81)==0x81 and (not c.mat_filter or c.mat_filter(mc))
function cm.counterfilter(c)
return c:GetSummonLocation()~=LOCATION_EXTRA
end
function cm.spfilter(c,e,tp,mc)
return c:IsCode(81027000) and bit.band(c:GetType(),0x81)==0x81 and (not c.mat_filter or c.mat_filter(mc,tp))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true)
and mc:IsCanBeRitualMaterial(c)
end
function c87000022.rfilter(c,mc)
function cm.rfilter(c,mc)
local mlv=mc:GetRitualLevel(c)
if mlv==mc:GetLevel() then return false end
local lv=c:GetLevel()
return lv==bit.band(mlv,0xffff) or lv==bit.rshift(mlv,16)
end
function c87000022.filter(c,e,tp)
local sg=Duel.GetMatchingGroup(c87000022.spfilter,tp,LOCATION_HAND,0,c,e,tp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if c:IsLocation(LOCATION_MZONE) then ft=ft+1 end
return sg:IsExists(c87000022.rfilter,1,nil,c) or sg:CheckWithSumEqual(Card.GetLevel,c:GetLevel(),1,ft)
function cm.filter(c,e,tp)
local sg=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_HAND,0,c,e,tp,c)
return sg:IsExists(cm.rfilter,1,nil,c) or sg:CheckWithSumEqual(Card.GetLevel,c:GetLevel(),1,1)
end
function c87000022.mfilter(c)
function cm.mfilter(c)
return c:GetLevel()>0 and c:IsAbleToGrave()
end
function c87000022.mzfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp)
function cm.mzfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and c:GetSequence()<5
end
function c87000022.target(e,tp,eg,ep,ev,re,r,rp,chk)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<0 then return false end
local mg=Duel.GetRitualMaterial(tp)
if ft>0 then
local mg2=Duel.GetMatchingGroup(c87000022.mfilter,tp,LOCATION_EXTRA,0,nil)
local mg2=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_EXTRA,0,nil)
mg:Merge(mg2)
else
mg=mg:Filter(c87000022.mzfilter,nil,tp)
mg=mg:Filter(cm.mzfilter,nil,tp)
end
return mg:IsExists(c87000022.filter,1,nil,e,tp)
return mg:IsExists(cm.filter,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c87000022.activate(e,tp,eg,ep,ev,re,r,rp)
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<0 then return end
local mg=Duel.GetRitualMaterial(tp)
if ft>0 then
local mg2=Duel.GetMatchingGroup(c87000022.mfilter,tp,LOCATION_EXTRA,0,nil)
local mg2=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_EXTRA,0,nil)
mg:Merge(mg2)
else
mg=mg:Filter(Card.IsLocation,nil,LOCATION_MZONE)
mg=mg:Filter(cm.mzfilter,nil,tp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg:FilterSelect(tp,c87000022.filter,1,1,nil,e,tp)
local mat=mg:FilterSelect(tp,cm.filter,1,1,nil,e,tp)
local mc=mat:GetFirst()
if not mc then return end
local sg=Duel.GetMatchingGroup(c87000022.spfilter,tp,LOCATION_HAND,0,mc,e,tp,mc)
local sg=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_HAND,0,mc,e,tp,mc)
if mc:IsLocation(LOCATION_MZONE) then ft=ft+1 end
local b1=sg:IsExists(c87000022.rfilter,1,nil,mc)
local b2=sg:CheckWithSumEqual(Card.GetLevel,mc:GetLevel(),1,ft)
if b1 and (not b2 or Duel.SelectYesNo(tp,aux.Stringid(87000022,0))) then
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local b1=sg:IsExists(cm.rfilter,1,nil,mc)
local b2=sg:CheckWithSumEqual(Card.GetLevel,mc:GetLevel(),1,1)
if b1 and (not b2 or Duel.SelectYesNo(tp,aux.Stringid(m,0))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:FilterSelect(tp,c87000022.rfilter,1,1,nil,mc)
local tg=sg:FilterSelect(tp,cm.rfilter,1,1,nil,mc)
local tc=tg:GetFirst()
tc:SetMaterial(mat)
if not mc:IsLocation(LOCATION_EXTRA) then
......@@ -92,7 +99,7 @@ function c87000022.activate(e,tp,eg,ep,ev,re,r,rp)
tc:CompleteProcedure()
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:SelectWithSumEqual(tp,Card.GetLevel,mc:GetLevel(),1,ft)
local tg=sg:SelectWithSumEqual(tp,Card.GetLevel,mc:GetLevel(),1,1)
local tc=tg:GetFirst()
while tc do
tc:SetMaterial(mat)
......@@ -113,32 +120,22 @@ function c87000022.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummonComplete()
end
end
function c87000022.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function c87000022.cfilter(c)
return c:IsSetCard(0xaff) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 and aux.exccon(e)
end
function c87000022.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c87000022.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c87000022.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
g:AddCard(e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0
and aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,0) end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
Duel.RegisterEffect(e1,tp)
aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,1)
end
function c87000022.thfilter(c)
return c:IsSetCard(0xaff) and c:IsAbleToHand()
end
function c87000022.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c87000022.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c87000022.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c87000022.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
function cm.splimit(e,c)
return c:IsLocation(LOCATION_EXTRA)
end
--GLORIOUS DAYS
local m=81041033
local cm=_G["c"..m]
xpcall(function() require("expansions/script/c81000000") end,function() require("script/c81000000") end)
function cm.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetCategory(CATEGORY_SPECIAL_SUMMON)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetTarget(cm.qtarget)
e0:SetOperation(cm.qactivate)
c:RegisterEffect(e0)
--change name
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetRange(LOCATION_GRAVE+LOCATION_HAND)
e1:SetValue(81041005)
c:RegisterEffect(e1)
--spsummon
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,m)
e4:SetTarget(cm.sptg)
e4:SetOperation(cm.spop)
c:RegisterEffect(e4)
end
function cm.qfilter(c,e,tp,m,ft)
if not (c:IsType(TYPE_PENDULUM) and c:IsAttack(1550) and c:IsDefense(1050)) or bit.band(c:GetType(),0x81)~=0x81
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
if ft>0 then
return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
else
return mg:IsExists(cm.qfilterF,1,nil,tp,mg,c)
end
end
function cm.qfilterF(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then
Duel.SetSelectedCard(c)
return mg:CheckWithSumGreater(Card.GetRitualLevel,rc:GetLevel(),rc)
else return false end
end
function cm.qtarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return ft>-1 and Duel.IsExistingMatchingCard(cm.qfilter,tp,LOCATION_HAND,0,1,nil,e,tp,mg,ft)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function cm.qactivate(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,cm.qfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg,ft)
local tc=tg:GetFirst()
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
local mat=nil
if ft>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:FilterSelect(tp,cm.qfilterF,1,1,nil,tp,mg,tc)
Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
mat:Merge(mat2)
end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
Duel.Hint(HINT_MUSIC,0,aux.Stringid(m,math.random(0,1)))
tc:CompleteProcedure()
end
end
function cm.spfilter(c)
return c:IsFaceup() and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_PENDULUM) and c:IsLevelAbove(4)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.spfilter(chkc) end
if chk==0 then return e:GetHandler():IsAbleToHand()
and Duel.IsExistingTarget(cm.spfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsImmuneToEffect(e) or tc:IsLevelBelow(3) then return end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(-3)
tc:RegisterEffect(e1)
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
function c87000011.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--splimit
--splimit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e2:SetRange(LOCATION_PZONE)
e2:SetTargetRange(1,0)
e2:SetTarget(c87000011.splimit)
c:RegisterEffect(e2)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(87000011,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1)
e3:SetCost(c87000011.cost)
e3:SetTarget(c87000011.target)
e3:SetOperation(c87000011.operation)
c:RegisterEffect(e3)
--ritual level
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_RITUAL_LEVEL)
e6:SetValue(c87000011.rlevel)
c:RegisterEffect(e6)
--tohand
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(87000011,0))
e5:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_RELEASE)
e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e5:SetCountLimit(1,87000011)
e5:SetTarget(c87000011.thtg)
e5:SetOperation(c87000011.thop)
c:RegisterEffect(e5)
end
function c87000011.splimit(e,c,tp,sumtp,sumpos)
return not c:IsSetCard(0xaff)
end
function c87000011.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,800) end
Duel.PayLPCost(tp,800)
end
function c87000011.filter(c)
return c:IsSetCard(0xaff) and not c:IsCode(87000011) and c:IsAbleToHand()
end
function c87000011.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c87000011.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c87000011.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c87000011.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 c87000011.rlevel(e,c)
local lv=e:GetHandler():GetLevel()
if c:IsSetCard(0xaff) then
local clv=c:GetLevel()
return lv*65536+clv
else return lv end
end
function c87000011.thfilter1(c)
return c:GetCode()==87000012 and c:IsAbleToHand()
end
function c87000011.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c87000011.thfilter1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c87000011.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c87000011.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
\ No newline at end of file
function c87000012.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--splimit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e2:SetRange(LOCATION_PZONE)
e2:SetTargetRange(1,0)
e2:SetTarget(c87000012.splimit)
c:RegisterEffect(e2)
--to deck
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1)
e1:SetTarget(c87000012.drtg)
e1:SetOperation(c87000012.drop)
c:RegisterEffect(e1)
--ritual level
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_RITUAL_LEVEL)
e6:SetValue(c87000012.rlevel)
c:RegisterEffect(e6)
--tohand
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(87000012,0))
e5:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_RELEASE)
e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e5:SetCountLimit(1,87000012)
e5:SetTarget(c87000012.thtg)
e5:SetOperation(c87000012.thop)
c:RegisterEffect(e5)
end
function c87000012.splimit(e,c,tp,sumtp,sumpos)
return not c:IsSetCard(0xaff)
end
function c87000012.thfilter(c)
return c:IsSetCard(0xaff) and c:IsAbleToDeck()
end
function c87000012.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and c87000012.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c87000012.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c87000012.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function c87000012.drop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
end
function c87000012.rlevel(e,c)
local lv=e:GetHandler():GetLevel()
if c:IsSetCard(0xaff) then
local clv=c:GetLevel()
return lv*65536+clv
else return lv end
end
function c87000012.thfilter1(c)
return c:GetCode()==87000011 and c:IsAbleToHand()
end
function c87000012.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c87000012.thfilter1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c87000012.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c87000012.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
\ No newline at end of file
--五星一式
function c87000013.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c87000013.splimit)
c:RegisterEffect(e1)
--todeck
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,87000013)
e2:SetCondition(c87000013.descon2)
e2:SetTarget(c87000013.destg2)
e2:SetOperation(c87000013.desop2)
c:RegisterEffect(e2)
--become material
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetCondition(c87000013.condition)
e3:SetOperation(c87000013.operation)
c:RegisterEffect(e3)
end
function c87000013.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_RITUAL)==SUMMON_TYPE_RITUAL
end
function c87000013.descon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_RITUAL
end
function c87000013.destg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsAbleToDeck() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function c87000013.desop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
end
function c87000013.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return r==REASON_XYZ and c:GetReasonCard():IsSetCard(0xaff)
end
function c87000013.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(rc)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_QUICK_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c87000013.atkcon)
e1:SetOperation(c87000013.atkop)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e2,true)
end
end
function c87000013.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_XYZ
end
function c87000013.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
end
end
--五星三式
function c87000014.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c87000014.splimit)
c:RegisterEffect(e1)
--HANDES
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_HANDES)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,87000014)
e2:SetCondition(c87000014.descon2)
e2:SetTarget(c87000014.destg2)
e2:SetOperation(c87000014.desop2)
c:RegisterEffect(e2)
--become material
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetCondition(c87000014.condition)
e3:SetOperation(c87000014.operation)
c:RegisterEffect(e3)
end
function c87000014.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_RITUAL)==SUMMON_TYPE_RITUAL
end
function c87000014.descon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_RITUAL
end
function c87000014.destg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
Duel.SetOperationInfo(0,CATEGORY_HANDES,0,0,1-tp,1)
end
function c87000014.desop2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND,nil)
if g:GetCount()==0 then return end
local sg=g:RandomSelect(1-tp,1)
Duel.SendtoGrave(sg,REASON_DISCARD+REASON_EFFECT)
end
function c87000014.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return r==REASON_XYZ and c:GetReasonCard():IsSetCard(0xaff)
end
function c87000014.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(rc)
e1:SetDescription(aux.Stringid(87000014,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c87000014.drcon)
e1:SetTarget(c87000014.drtg)
e1:SetOperation(c87000014.drop)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e2,true)
end
end
function c87000014.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_XYZ
end
function c87000014.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c87000014.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--五星二式
function c87000015.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c87000015.splimit)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,87000015)
e2:SetCondition(c87000015.descon2)
e2:SetTarget(c87000015.destg2)
e2:SetOperation(c87000015.desop2)
c:RegisterEffect(e2)
--become material
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetCondition(c87000015.condition)
e3:SetOperation(c87000015.operation)
c:RegisterEffect(e3)
end
function c87000015.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_RITUAL)==SUMMON_TYPE_RITUAL
end
function c87000015.descon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_RITUAL
end
function c87000015.destg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c87000015.desop2(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
end
function c87000015.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return r==REASON_XYZ and c:GetReasonCard():IsSetCard(0xaff)
end
function c87000015.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(rc)
e1:SetDescription(aux.Stringid(87000015,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c87000015.matcon)
e1:SetTarget(c87000015.mattg)
e1:SetOperation(c87000015.matop)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e2,true)
end
end
function c87000015.matcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_XYZ
end
function c87000015.matfilter(c)
return c:IsSetCard(0xaff) and c:IsType(TYPE_MONSTER)
end
function c87000015.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c87000015.matfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c87000015.matfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectTarget(tp,c87000015.matfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
function c87000015.matop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
Duel.Overlay(c,Group.FromCards(tc))
end
end
\ No newline at end of file
--四星一式
function c87000016.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c87000016.splimit)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(87000016,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCountLimit(1,87000016)
e2:SetCost(c87000016.thcost)
e2:SetTarget(c87000016.thtg)
e2:SetOperation(c87000016.thop)
c:RegisterEffect(e2)
--equip
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_EQUIP)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,87000016)
e3:SetCondition(c87000016.eqcon)
e3:SetTarget(c87000016.eqtg)
e3:SetOperation(c87000016.eqop)
c:RegisterEffect(e3)
end
function c87000016.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_RITUAL)==SUMMON_TYPE_RITUAL
end
function c87000016.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c87000016.thfilter(c)
return c:IsSetCard(0xaff) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c87000016.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c87000016.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c87000016.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c87000016.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 c87000016.eqcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c87000016.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
end
function c87000016.eqlimit(e,c)
return e:GetOwner()==c
end
function c87000016.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.Equip(tp,c,tc,true)
--Add Equip limit
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c87000016.eqlimit)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_ATTACK)
c:RegisterEffect(e3)
end
end
--四星二式
function c87000017.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c87000017.splimit)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(87000017,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCountLimit(1,87000017)
e2:SetCost(c87000017.thcost)
e2:SetTarget(c87000017.thtg)
e2:SetOperation(c87000017.thop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(87000017,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,87000017)
e3:SetCondition(c87000017.spcon)
e3:SetTarget(c87000017.sptg)
e3:SetOperation(c87000017.spop)
c:RegisterEffect(e3)
end
function c87000017.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_RITUAL)==SUMMON_TYPE_RITUAL
end
function c87000017.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c87000017.thfilter(c)
return c:IsSetCard(0xaff) and c:IsType(TYPE_MONSTER) and c:IsType(TYPE_RITUAL) and c:IsAbleToHand()
end
function c87000017.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c87000017.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c87000017.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c87000017.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 c87000017.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_RITUAL
end
function c87000017.spfilter(c,e,tp)
return c:IsSetCard(0xaff) and bit.band(c:GetType(),0x81)==0x81 and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c87000017.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_DECK) and chkc:IsControler(tp) and c87000017.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c87000017.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c87000017.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c87000017.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 c87000018.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0xaff),7,3,nil,nil,5)
c:EnableReviveLimit()
--atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c87000018.atkval)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(87000018,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c87000018.reptg)
c:RegisterEffect(e2)
--cannot be target
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c87000018.tgcon)
e4:SetValue(aux.tgoval)
c:RegisterEffect(e4)
end
function c87000018.atkval(e,c)
return c:GetOverlayCount()*800
end
function c87000018.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_EFFECT) end
if Duel.SelectYesNo(tp,aux.Stringid(87000018,0)) then
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_EFFECT)
return true
else return false end
end
function c87000018.tgcon(e)
return e:GetHandler():GetOverlayCount()>=1
end
--八阶量子式
function c87000019.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0xaff),8,4,c87000019.ovfilter,aux.Stringid(87000019,0))
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c87000019.splimit)
c:RegisterEffect(e1)
--material
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(87000019,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_BATTLE_START)
e2:SetTarget(c87000019.target)
e2:SetOperation(c87000019.operation)
c:RegisterEffect(e2)
--special summon
--cannot target
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e6:SetRange(LOCATION_MZONE)
e6:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e6:SetValue(aux.tgoval)
c:RegisterEffect(e6)
--indes
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e7:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e7:SetRange(LOCATION_MZONE)
e7:SetValue(c87000019.indval)
c:RegisterEffect(e7)
end
function c87000019.ovfilter(c)
return c:IsFaceup() and c:IsCode(87000018) and c:GetOverlayCount()==0
end
function c87000019.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_XYZ)==SUMMON_TYPE_XYZ
end
function c87000019.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tc=c:GetBattleTarget()
if chk==0 then return tc and c:IsType(TYPE_XYZ) and not tc:IsType(TYPE_TOKEN) and tc:IsAbleToChangeControler() end
end
function c87000019.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetBattleTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToBattle() and not tc:IsImmuneToEffect(e) then
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
Duel.Overlay(c,Group.FromCards(tc))
end
end
function c87000019.indval(e,re,tp)
return tp~=e:GetHandlerPlayer()
end
--仪式聚合体
function c87000020.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0xaff),aux.NonTuner(Card.IsSetCard,0xaff),1)
c:EnableReviveLimit()
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(87000020,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,87000020)
e2:SetTarget(c87000020.trtg)
e2:SetOperation(c87000020.trop)
c:RegisterEffect(e2)
--level
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(87000020,0))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,87000020)
e3:SetCost(c87000020.lvcost)
e3:SetTarget(c87000020.lvtg)
e3:SetOperation(c87000020.lvop)
c:RegisterEffect(e3)
end
function c87000020.filter(c)
return c:IsSetCard(0xaff) and c:IsAbleToHand()
end
function c87000020.trtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c87000020.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c87000020.trop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c87000020.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 c87000020.lvcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c87000020.filter1(c)
local lv=c:GetLevel()
return c:IsFaceup() and c:IsSetCard(0xaff) and lv>0 and lv~=7
end
function c87000020.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c87000020.filter1,tp,LOCATION_MZONE,0,1,nil) end
end
function c87000020.lvop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c87000020.filter1,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(7)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
--水晶石
function c87000021.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,87000021)
e1:SetTarget(c87000021.target)
e1:SetOperation(c87000021.activate)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,87000021)
e2:SetCondition(c87000021.thcon)
e2:SetCost(c87000021.thcost)
e2:SetTarget(c87000021.thtg)
e2:SetOperation(c87000021.thop)
c:RegisterEffect(e2)
end
function c87000021.filter(c,e,tp,m)
if not c:IsSetCard(0xaff) or bit.band(c:GetType(),0x81)~=0x81
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
if c:IsCode(21105106) then return c:ritual_custom_condition(m) end
local mg=nil
if c.mat_filter then
mg=m:Filter(c.mat_filter,c)
else
mg=m:Clone()
mg:RemoveCard(c)
end
return mg:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c)
end
function c87000021.mfilter(c)
return c:IsSetCard(0xaff) and c:IsType(TYPE_MONSTER) and not c:IsType(TYPE_XYZ) and c:IsAbleToRemove()
end
function c87000021.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg1=Duel.GetRitualMaterial(tp)
local mg2=Duel.GetMatchingGroup(c87000021.mfilter,tp,LOCATION_GRAVE,0,nil)
mg1:Merge(mg2)
return Duel.IsExistingMatchingCard(c87000021.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg1)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c87000021.activate(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetRitualMaterial(tp)
local mg2=Duel.GetMatchingGroup(c87000021.mfilter,tp,LOCATION_GRAVE,0,nil)
mg1:Merge(mg2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c87000021.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg1)
if tg:GetCount()>0 then
local tc=tg:GetFirst()
if tc:IsCode(21105106) then
tc:ritual_custom_operation(mg1)
local mat=tc:GetMaterial()
Duel.ReleaseRitualMaterial(mat)
else
mg1:RemoveCard(tc)
if tc.mat_filter then
mg1=mg1:Filter(tc.mat_filter,nil)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg1:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,99,tc)
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
end
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
function c87000021.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function c87000021.cfilter(c)
return c:IsSetCard(0xaff) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c87000021.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c87000021.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c87000021.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
g:AddCard(e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c87000021.thfilter(c)
return c:IsSetCard(0xaff) and c:IsAbleToHand()
end
function c87000021.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c87000021.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c87000021.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c87000021.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
\ No newline at end of file
--来自神的预示
function c87000023.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,87000023)
e1:SetTarget(c87000023.target)
e1:SetOperation(c87000023.activate)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,87000023)
e2:SetCondition(c87000023.thcon)
e2:SetCost(c87000023.thcost)
e2:SetTarget(c87000023.thtg)
e2:SetOperation(c87000023.thop)
c:RegisterEffect(e2)
end
function c87000023.filter(c,e,tp,m)
if not c:IsSetCard(0xaff) or bit.band(c:GetType(),0x81)~=0x81
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) or c:IsHasEffect(EFFECT_NECRO_VALLEY) then return false end
if c:IsCode(21105106) then return c:ritual_custom_condition(m) end
local mg=nil
if c.mat_filter then
mg=m:Filter(c.mat_filter,c)
else
mg=m:Clone()
mg:RemoveCard(c)
end
return mg:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c)
end
function c87000023.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg1=Duel.GetRitualMaterial(tp)
return Duel.IsExistingMatchingCard(c87000023.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,mg1)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c87000023.activate(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetRitualMaterial(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c87000023.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,mg1)
if tg:GetCount()>0 then
local tc=tg:GetFirst()
if tc:IsCode(21105106) then
tc:ritual_custom_operation(mg1)
local mat=tc:GetMaterial()
Duel.ReleaseRitualMaterial(mat)
else
mg1:RemoveCard(tc)
if tc.mat_filter then
mg1=mg1:Filter(tc.mat_filter,nil)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg1:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,99,tc)
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
end
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
function c87000023.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function c87000023.cfilter(c)
return c:IsSetCard(0xaff) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c87000023.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c87000023.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c87000023.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
g:AddCard(e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c87000023.thfilter(c)
return c:IsSetCard(0xaff) and c:IsAbleToHand()
end
function c87000023.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c87000023.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c87000023.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c87000023.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 c87000024.initial_effect(c)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,87000024)
e2:SetCost(c87000024.spcost)
e2:SetTarget(c87000024.sptg)
e2:SetOperation(c87000024.spop)
c:RegisterEffect(e2)
end
function c87000024.cfilter(c)
return c:IsSetCard(0xaff) and c:IsDiscardable()
end
function c87000024.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c87000024.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,c87000024.cfilter,1,1,REASON_COST+REASON_DISCARD)
end
function c87000024.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 c87000024.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x47e0000)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
end
end
\ No newline at end of file
--�¶�
function c87000025.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0xaff),12,5,c87000025.ovfilter,aux.Stringid(87000025,0))
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c87000025.splimit)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_DISABLE_SPSUMMON)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
c:RegisterEffect(e2)
--remove
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCondition(c87000025.rmcon)
e3:SetCost(c87000025.rmcost)
e3:SetTarget(c87000025.rmtg)
e3:SetOperation(c87000025.rmop)
c:RegisterEffect(e3)
--atk
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetValue(c87000025.value)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetRange(LOCATION_MZONE)
e5:SetCode(EFFECT_UPDATE_DEFENSE)
e5:SetValue(c87000025.value)
c:RegisterEffect(e5)
--immune
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_IMMUNE_EFFECT)
e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e6:SetRange(LOCATION_MZONE)
e6:SetValue(c87000025.efilter6)
c:RegisterEffect(e6)
end
function c87000025.ovfilter(c)
return c:IsFaceup() and c:IsCode(87000019) and c:GetOverlayCount()>=10
end
function c87000025.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_XYZ)==SUMMON_TYPE_XYZ
end
function c87000025.rmcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_XYZ and e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,87000019)
end
function c87000025.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_BATTLE_PHASE)==0
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_BP)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
end
function c87000025.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c87000025.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
function c87000025.value(e,c)
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_REMOVED,LOCATION_REMOVED)*1000
end
function c87000025.efilter6(e,te)
return te:GetOwner()~=e:GetOwner()
end
--
function c87000026.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0xaff),3,3)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(87000026,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,87000026)
e1:SetCost(c87000026.spcost)
e1:SetTarget(c87000026.sptg)
e1:SetOperation(c87000026.spop1)
c:RegisterEffect(e1)
--xyz material
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(87000026,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1,88000026)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(c87000026.target)
e3:SetOperation(c87000026.operation)
c:RegisterEffect(e3)
end
function c87000026.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c87000026.filter(c,e,tp,zone)
return c:IsCode(87000018) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
end
function c87000026.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local zone=e:GetHandler():GetLinkedZone(tp)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c87000026.filter(chkc,e,tp,zone) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c87000026.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp,zone) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c87000026.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,zone)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c87000026.spop1(e,tp,eg,ep,ev,re,r,rp)
local zone=e:GetHandler():GetLinkedZone(tp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone)
end
end
function c87000026.filter1(c)
return c:IsFaceup() and c:IsCode(87000019)
end
function c87000026.filter2(c)
return c:IsSetCard(0xaff) and c:IsType(TYPE_MONSTER)
end
function c87000026.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c87000026.filter1,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(c87000026.filter2,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(87000026,2))
Duel.SelectTarget(tp,c87000026.filter1,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(87000026,3))
local g=Duel.SelectTarget(tp,c87000026.filter2,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
function c87000026.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local tc1=g:Filter(Card.IsLocation,nil,LOCATION_MZONE):GetFirst()
local g2=g:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
if tc1 and tc1:IsFaceup() and not tc1:IsImmuneToEffect(e) and g2:GetCount()>0 then
Duel.Overlay(tc1,g2)
end
end
......@@ -261,9 +261,9 @@
#DefineCard(code,"SCP_J") SCP基金会
#空鸽 1058604496 170 0x7f0-0x7ff
!counter 0x7f2 调停指示物
!counter 0x57f2 刃镜指示物
!counter 0x17f2 迷幻指示物
!counter 0x17f2 刃镜指示物
!counter 0x7f3 调停指示物
!counter 0x17f4 迷幻指示物
!setname 0x7f0 亚瑟
!setname 0x17f0 佣兵亚瑟
!setname 0x27f0 富豪亚瑟
......@@ -280,6 +280,7 @@
!setname 0x17f3 交响型
!setname 0x27f3 暗堕型
!setname 0x47f3 王位
!setname 0x87f3 叛逆型
#is_named_with_domovo_i 多莫维依
#is_named_with_Dark_Degenerate 暗堕型
#is_named_with_Gran 古兰
......@@ -362,6 +363,8 @@
#AddCodeList(26818000) 九条璃雨卡名记述
#AddCodeList(26818001) 明智英树卡名记述
#沃亚森斯奥克斯 2201771890 300 0x???-0x???
#饼干猫 2428706561 305 0x300-0x30f
!setname 0x305 空中都市
!setname 0x307 破灭幻械
......@@ -666,7 +669,9 @@
!setname 0x32c2 失落终端
!setname 0x52c2 雷电芽衣
!setname 0x62c2 蓬莱寺九霄
!setname 0x92c2 布洛妮娅
!setname 0xa2c2 希儿
!setname 0xc2c2 杏·玛尔
!setname 0x32c3 柯罗伊
!setname 0x62c3 虚轴之庭
!setname 0x32c4 鹿乃
......@@ -720,7 +725,7 @@
!setname 0x129d 植占师
#Yuki 2574476144 870 0xaf0-0xaff
!setname 0xaff 零式
!setname 0xaff 阴阳零式
#葉月 ?????????? 876 0x???-0x???
......
This source diff could not be displayed because it is too large. You can view the blob instead.
2020/5/25 22:43:50
\ No newline at end of file
2020/6/10 20:57:50
\ No newline at end of file
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