Commit 48686c13 authored by Nemo Ma's avatar Nemo Ma

rearrange 壶

parent 6c22786a
No preview for this file type
xpcall(function() dofile("expansions/script/c20099998.lua") end,function() dofile("script/c20099998.lua") end)
if fuef then return end
fuef = { }
--------------------------------------------------------------------------"Effect function"
function fuef:New(owner,handler,isAct,typ,dis)
local E = setmetatable({ }, self)
self.__index = self
function self:__add(var) return self:Set(table.unpack(fusf.CutString(var,",",nil,"__add"))):Register() end
function self:__call(cod,handler,...) --copy
local sets = {...}
sets = type(sets) == "table" and #sets == 1 and sets[1] or sets
if type(sets) == "string" and not sets:match(":") then
local var = {self.e:GetOwner(), handler or self.gettor, cod or self.e:GetCode(), sets}
if self.detial[2] == "I" or self.detial[2] == "F+G" then var = {self.e:GetOwner(), handler or self.gettor, sets} end
return fuef.T_reg(table.unpack(self.detial))(table.unpack(var))
else
local E = setmetatable({ }, getmetatable(self))
E.gettor = handler or self.gettor
E.e = self.e:Clone()
return E:Set({"COD",cod or self.e:GetCode()},...):Register()
end
end
function self:__eq(table) Debug.Message(getmetatable(self) == table) end
if aux.GetValueType(fusf.GetCardTable(owner)[1])~="Card" then Debug.Message(aux.GetValueType(owner)) end
E.e = fucg.eff.CRE(fusf.GetCardTable(owner)[1])
E.gettor = handler
E.detial = {isAct,typ,dis}
return E
end
function fuef:Set(...)
local sets = {...}
if #sets == 0 then return self end
if #sets <= 2 and type(sets[1]) == "string" and not sets[1]:find(":") then sets = {sets} end
sets = fusf.Value_Trans(table.unpack(sets))
for _,set in ipairs(sets) do
if type(set) == "string" and set:find(":") then set = fusf.CutString(set,":",nil,"Set") end
set = type(set) == "table" and set or {set}
local f = type(set[1]) == "string" and fucg.eff[set[1] ] or set[1]
table.remove(set,1)
f(self,table.unpack(set))
end
return self
end
function fuef:Register(handler)
handler = handler or self.gettor
if not handler then return self end
handler = type(handler) == "table" and handler or { handler }
self.gettor = handler
local Ignore = handler[2] or false
local Handler = type(handler[1]) == "number" and handler[1] or fusf.GetCardTable(handler[1])
local E = self.e:Clone()
self.e:Reset()
if self.gclo then
for _,ge in ipairs(self.gclo) do
ge:Reset()
end
self.gclo = {}
end
self.e = E
if type(Handler) == "number" then
Duel.RegisterEffect(self.e,Handler)
else
table.remove(Handler):RegisterEffect(self.e,Ignore)
for _,C in ipairs(Handler) do
E = self.e:Clone()
self.gclo = self.gclo or {}
self.gclo[#self.gclo+1] = E
C:RegisterEffect(E,Ignore)
end
end
return self
end
function fuef.T_reg(isAct,typ,dis)
return function(c,rc,...)
local v,var = fusf.Value_Trans(...),{ }
if isAct then
local _cod = dis:match("COD") and 1 or table.remove(v,1)
var = dis:match("COD") and { } or { {"COD" , fusf.NotNil(_cod) and _cod or "FC"} }
end
local dis = (#dis>0 and dis.."," or "")..(isAct and "COD,TRAN,VAL" or "CAT,COS")
for i,val in ipairs(fusf.CutString("COD,DES,CAT,PRO,RAN,TRAN,VAL,CTL,CON,COS,TG,OP,RES,LAB,OBJ",",",dis)) do
var[#var + 1] = fusf.NotNil(v[i]) and { val , v[i] } or nil
end
return fuef:New(c,rc,isAct,typ,dis):Set("TYP:"..typ,table.unpack(var)):Register()
end
end
function fuef.typ_register(isAct,str)
for _,set in ipairs(fusf.CutString(str,"|",nil,"typ_register1")) do
set = fusf.CutString(set,":",nil,"typ_register2")
local name = ""
for _,var in ipairs(fusf.CutString(set[1],"+",nil,"typ_register3")) do
name = name..var
end
fuef[name] = fuef.T_reg(isAct,set[1],set[2] or "")
end
end
fuef.B_A = fuef.T_reg(1,"A","RAN")
fuef.A = function(c,rc) return fuef.B_A(c,rc or c) end
fuef.typ_register(1,"I:COD|QO|QF|F+TO|F+TF|S+TO:RAN|S+TF:RAN")
fuef.typ_register(nil,"S:TRAN,TG|S+C:TRAN,VAL,TG|F|F+C:TRAN,VAL,TG|F+G:DES,COD,PRO,VAL,CTL,OP|E:DES,RAN,TRAN,CTL,TG,OP|E+C:DES,PRO,RAN,TRAN,VAL,CTL")
fuef.typ_register(nil,"X:TRAN,TG")
\ No newline at end of file
--幻梦无亘龙
xpcall(function() dofile("expansions/script/c20000000.lua") end,function() dofile("script/c20000000.lua") end)
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddCodeList(c,20000051,20000057)
fuef.SC(c,c,"SP,,,,,con1,op1")
fuef.FTO(c,c,EVENT_PHASE+PHASE_BATTLE_START,"0,ATK,,M,1,,,tg2,op2")
end
--e1
cm.con1=function(e,tp,eg,ep,ev,re,r,rp)return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=fugf.GetFilter(tp,"D","IsTyp+IsCod+CheckEquipTarget+CheckUniqueOnField-IsForbidden",{"EQ,57",c,{tp,LOCATION_SZONE}})
if #g==0 or not fucf.Filter(c,"IsPos+IsLoc","FU,M") or Duel.GetLocationCount(tp,LOCATION_SZONE)==0 or not Duel.SelectYesNo(tp,1068) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=g:Select(tp,1,1,nil):GetFirst()
if not tc then return end
Duel.Equip(tp,tc,c,true,true)
Duel.EquipComplete()
end
--e2
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return fugf.GetFilter(tp,"M","IsRac+IsPos","DR,FU",1) end
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local c,g,atk,e1=e:GetHandler(),fugf.GetFilter(tp,"M","IsRac+IsPos-IsImmuneToEffect",{"DR,FU",e}),0
for tc in aux.Next(g) do
atk=atk+tc:GetAttack()
e1=fuef.S(c,tc,EFFECT_SET_ATTACK_FINAL,",,,0,,,,EV+STD+PH/BPE")
atk=atk-tc:GetAttack()
end
if not (c:IsFaceup() and c:IsRelateToEffect(e)) then return end
e1(nil,c,"VAL:"..(atk))
end
\ No newline at end of file
--无亘皇帝之显现
xpcall(function() dofile("expansions/script/c20000000.lua") end,function() dofile("script/c20000000.lua") end)
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,20000050)
_ = fuef.A(c) + "CAT:SP,TG:tg1,OP:op1"
end
--e1
cm.Rf1 = function(c) return c:IsCode(20000050) end
function cm.Rmgf1(n,chk)
if chk then
return function(tp,g,c) return #fugf.Filter(g,"IsLoc","D")<=n end
else
return function(g) return #fugf.Filter(g,"IsLoc","D")<=n end
end
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp)
local rg=fugf.GetFilter(tp,"D","IsSet+AbleTo+IsLv","3fd0,R,+1")
local n=Duel.GetFlagEffect(tp,m)==0 and 1 or 0
aux.RCheckAdditional=cm.Rmgf1(n,1)
aux.RGCheckAdditional=cm.Rmgf1(n)
n = fugf.GetFilter(tp,"HG","RitualUltimateFilter",{cm.Rf1,e,tp,mg,rg,Card.GetLevel,"Greater"},1)
aux.RCheckAdditional=nil
aux.RGCheckAdditional=nil
return n
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,tp,LOCATION_DECK)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp)
local rg=fugf.GetFilter(tp,"D","IsSet+AbleTo+IsLv","3fd0,R,+1")
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local n=Duel.GetFlagEffect(tp,m)==0 and 1 or 0
aux.RCheckAdditional=cm.Rmgf1(n,1)
aux.RGCheckAdditional=cm.Rmgf1(n)
local tc=fugf.SelectFilter(tp,"HG","RitualUltimateFilter+GChk",{{cm.Rf1,e,tp,mg,rg,Card.GetLevel,"Greater"}}):GetFirst()
if not tc then return end
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
mg:Merge(rg)
mg=mg:Filter(tc.mat_filter or aux.TRUE,tc,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
mg=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
aux.GCheckAdditional=nil
if not mg or #mg==0 then
aux.RCheckAdditional=nil
aux.RGCheckAdditional=nil
return
end
tc:SetMaterial(mg)
rg=fugf.Filter(mg,"IsLoc","D")
if #rg>0 then
mg:Sub(rg)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
Duel.ReleaseRitualMaterial(mg)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
aux.RCheckAdditional=nil
aux.RGCheckAdditional=nil
end
\ No newline at end of file
--无亘龙 特里纳塔奇
xpcall(function() dofile("expansions/script/c20000000.lua") end,function() dofile("script/c20000000.lua") end)
fu_imm = fu_imm or {}
function fu_imm.initial(cm,cat,typ,...)
cm.initial_effect = fu_imm.give(cm,cat,typ,...)
return cm
end
function fu_imm.give(cm,cat,typ,...)
local list = {...}
return function(c)
cm.lib = fu_imm
local E = fuef[typ](c,nil,table.unpack(list))
fuef.FG(c,c,"GR,M+0,give_con1,give_tg1,,",E.e)
fuef.STO(c,c,"BM,",cat,"DE",c:GetCode(),"give_con2,,tg2,op2")
end
end
fu_imm.give_con1 = function(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetFlagEffect(20000052)>0 end
fu_imm.give_tg1 = function(e,c) return fucf.Filter(c,"IsTyp+IsRac","RI+M,DR") end
function fu_imm.give_con2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if fucf.IsLoc(c,"GR") and r==REASON_RITUAL and fucf.IsRac(c:GetReasonCard(),"DR") then
c:RegisterFlagEffect(20000052,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(20000052,0))
return true
end
return false
end
--------------------------------
if not self_table then return false end
local cm = fu_imm.initial(self_table,"SH","SC",EVENT_BATTLE_DAMAGE,",,M,1,con1,op1")
--e1
cm.con1 = function(e,tp,eg,ep,ev,re,r,rp) return ep~=tp end
cm.op1 = function(e,tp,eg,ep,ev,re,r,rp) Duel.Draw(tp,1,REASON_EFFECT) end
--e2
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return fugf.GetFilter(tp,"D","IsTyp+AbleTo","RI+M,H",1) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=fugf.SelectFilter(tp,"D","IsTyp+AbleTo","RI+M,H")
if #g==0 then return end
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
\ No newline at end of file
--无亘龙 农兰
xpcall(function() dofile("expansions/script/c20000052.lua") end,function() dofile("script/c20000052.lua") end)
local cm = self_table
function cm.initial_effect(c)
aux.AddCodeList(c,20000051)
fu_imm.give(cm,"SH","SC",EVENT_BATTLED,",,M,1,,op1")(c)
end
--e1
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local d=Duel.GetAttackTarget()
if d==c then d=Duel.GetAttacker() end
if d and d:IsStatus(STATUS_BATTLE_DESTROYED) and d:IsType(TYPE_EFFECT) and not c:IsStatus(STATUS_BATTLE_DESTROYED) then
_ = fuef.S(c,d,EFFECT_DISABLE) + "RES:EV+STD"
end
end
--e2
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return fugf.GetFilter(tp,"D","IsTyp+AbleTo","RI+S,H",1) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.op2tg1(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsRace(RACE_DRAGON) and sumtype==SUMMON_TYPE_RITUAL
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=fugf.SelectFilter(tp,"D","IsTyp+AbleTo","RI+S,H"):GetFirst()
if not tc then return end
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
if not tc:IsSetCard(0x3fd0) then fuef.F(e,tp,EFFECT_CANNOT_SPECIAL_SUMMON,",PTG,,1+0,,,,op2tg1,,PH/ED") end
end
\ No newline at end of file
--无亘龙 杜米利奥尼
xpcall(function() dofile("expansions/script/c20000052.lua") end,function() dofile("script/c20000052.lua") end)
local cm = fu_imm.initial(self_table,"SH","FC",EVENT_CHAIN_SOLVED,",,M,,con1,op1")
--e1
cm.con1 = function(e,tp,eg,ep,ev,re,r,rp)return re and re:GetHandler()==e:GetHandler()end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
for c in aux.Next(fugf.GetFilter(tp,"M","IsTyp+IsRac+IsPos","RI+M,DR,FU")) do
fuef.S(e,c,EFFECT_UPDATE_ATTACK,",,M,250,,,,EV+STD")
end
end
--e2
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler():GetReasonCard()
if chk==0 then return fugf.Filter(c:GetMaterial(),"IsRLv",{"+1",c},1) and fugf.GetFilter(tp,"D","IsSet+AbleTo","3fd0,H",1) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler():GetReasonCard()
local g=fugf.Filter(c:GetMaterial(),"IsRLv",{"+1",c})
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
g=fugf.SelectFilter(tp,"D","IsSet+AbleTo","3fd0,H",nil,1,#g)
if #g==0 then return end
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
\ No newline at end of file
--无亘龙 赞米利亚登
xpcall(function() dofile("expansions/script/c20000052.lua") end,function() dofile("script/c20000052.lua") end)
local cm = self_table
function cm.initial_effect(c)
fu_imm.give(cm,"TH","F",EFFECT_CHANGE_DAMAGE,",PTG,M,+1,val1")(c)
if cm.glo then return end
cm.glo={0,0}
fuef.FC(c,0,EVENT_PHASE_START+PHASE_DRAW,",,,,,op3*1")(EVENT_BATTLE_DAMAGE,0,"OP:op3*")
end
--e1
function cm.val1(e,re,dam,r,rp,rc)
return r==REASON_BATTLE and cm.glo[2-rp]>dam and cm.glo[2-rp] or dam
end
--e2
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return #e:GetHandler():GetReasonCard():GetMaterial()>0 and fugf.GetFilter(tp,"GR","IsSet+AbleTo+IsPos","3fd0,H,FU",1) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetHandler():GetReasonCard():GetMaterial()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
g=fugf.SelectFilter(tp,"GR","IsSet+AbleTo+IsPos+GChk","3fd0,H,FU",nil,1,#g)
if #g==0 then return end
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
--e3
function cm.op3(chk)
return function(e,tp,eg,ep,ev,re,r,rp)
if chk then cm.glo={0,0}
else cm.glo[ep+1]=ev>cm.glo[ep+1] and ev or cm.glo[ep+1] end
end
end
\ No newline at end of file
--无亘龙 古戈尔普勒克斯
xpcall(function() dofile("expansions/script/c20000052.lua") end,function() dofile("script/c20000052.lua") end)
local cm = self_table
function cm.initial_effect(c)
fu_imm.give(cm,"","SC",EVENT_BATTLE_DESTROYING,",,M,,bdocon,op1")(c)
_ = fuef.FC(c,c,EFFECT_DESTROY_REPLACE,",,G,m,,op3") + "TG:tg3,VAL:val3"
end
--e1
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_DESTROY)
local g=fugf.SelectFilter(1-tp,"HMS")
if #g==0 then return end
Duel.Destroy(g,REASON_EFFECT)
end
--e2
cm.tg2 = aux.FALSE
--e3
function cm.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and fugf.Filter(eg,"IsTyp+IsRac+IsRea+IsPos+IsLoc+IsControler",{"RI+M,DR,EFF/BAT-REP,FU,M",tp},1) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function cm.val3(e,c)
return fucf.Filter(c,"IsTyp+IsRac+IsRea+IsPos+IsLoc+IsControler",{"RI+M,DR,EFF/BAT-REP,FU,M",e:GetHandlerPlayer()})
end
function cm.op3(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
\ No newline at end of file
--梦幻暗物质
xpcall(function() dofile("expansions/script/c20000000.lua") end,function() dofile("script/c20000000.lua") end)
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,20000050)
fuef.S(c,c,EFFECT_EQUIP_LIMIT,",CD,,val1")
fuef.B_A(c,c,",,EQ,TG+CTG,,,,tg2,op2")
fuef.F(c,c,EFFECT_TO_GRAVE_REDIRECT,",IG+AR+SET,S,A+A",LOCATION_REMOVED,",,tg3")
fuef.E(c,c,EFFECT_PIERCE,",1")(EFFECT_IMMUNE_EFFECT,c,"VAL:val5,CON:con5")
end
--e1
function cm.val1(e,c)
return c:IsCode(20000050)
end
--e2
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=fugf.GetFilter(tp,"M","IsCod+TgChk+IsFaceup",{50,e})
if chkc then return g:IsContains(chkc) end
if chk==0 then return #g>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
fugf.SelectTg(tp,"M","IsCod+TgChk+IsFaceup",{50,e})
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() and c:CheckUniqueOnField(tp) then
Duel.Equip(tp,c,tc)
end
end
--e3
function cm.tg3(e,c)
return c:GetOwner()~=e:GetHandlerPlayer() and c:IsReason(REASON_DESTROY) and c:IsReason(REASON_BATTLE+REASON_EFFECT)
end
--e4
function cm.val5(e,te)
return te:GetOwnerPlayer()~=e:GetOwnerPlayer()
end
function cm.con5(e)
local ph=Duel.GetCurrentPhase()
return not (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE)
end
--幻梦龙 无限
xpcall(function() dofile("expansions/script/c20000000.lua") end,function() dofile("script/c20000000.lua") end)
local cm = self_table
function cm.initial_effect(c)
aux.EnablePendulumAttribute(c)
aux.AddCodeList(c,20000059)
fuef.I(c,c,"SH,SH,,P,m,,cos2,tg2,op2")(nil,c,",,,E,,,bfgcost,tg1,op1")
end
--e1
function cm.tgf1(c)
return c:IsFaceup() and not c:IsAttack(c:GetBaseAttack())
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsFaceup() and fugf.GetFilter(tp,"M+M",cm.tgf1,nil,1) end
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local g = fugf.GetFilter(tp,"M+M",cm.tgf1)
for tc in aux.Next(fugf.GetFilter(tp,"M+M",cm.tgf1)) do
local atk = tc:GetAttack()
fuef.S(e,tc,EFFECT_SET_BASE_ATTACK,",,"..atk..",,,EV+STD")
atk = tc:GetBaseAttack()
fuef.S(e,tc,EFFECT_SET_ATTACK_FINAL,",,"..atk..",,,EV+STD")
end
end
--e2
function cm.cos2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return fugf.GetFilter(tp,"H","IsDiscardable",nil,1) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return fugf.GetFilter(tp,"D","IsCod+AbleTo","59,H",1) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=fugf.SelectFilter(tp,"D","IsCod+AbleTo","59,H")
if #g==0 then return end
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
\ No newline at end of file
--幻梦龙 零
xpcall(function() dofile("expansions/script/c20000000.lua") end,function() dofile("script/c20000000.lua") end)
local cm = self_table
function cm.initial_effect(c)
aux.EnablePendulumAttribute(c)
aux.AddCodeList(c,20000050)
fuef.I(c,c,",REC,PTG,E,,,bfgcost,tg1,op1")(nil,c,"SP,SP+DES,TG,P,m,,,tg2,op2")
end
--e1
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
local g,atk = fugf.GetFilter(tp,"M","IsFaceup"):GetMaxGroup(Card.GetBaseAttack)
if chk==0 then return e:GetHandler():IsFaceup() and g and #g>0 end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(atk)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,atk)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local g,atk = fugf.GetFilter(p,"M+","IsFaceup"):GetMaxGroup(Card.GetBaseAttack)
if #g==0 then return end
Duel.Recover(p,atk,REASON_EFFECT)
end
--e2
function cm.tgf2(c,e,tp)
return fucf.Filter(c,"TgChk+IsOTyp+(IsLoc/IsPos)",e,"M,M,FU") and fugf.GetFilter(tp,"D","IsCod+CanSp",{50,{e,tp,0,1}},1)
and Duel.GetMZoneCount(tp,c)>0 and c ~= e:GetHandler()
end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=fugf.GetFilter(tp,"MS",cm.tgf2,{e,tp})
if chkc then return chkc:IsControler(tp) and g:IsContains(chkc) end
if chk==0 then return #g>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g = fugf.SelectTg(tp,"MS",cm.tgf2,{e,tp}) + e:GetHandler()
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) + e:GetHandler()
if #tg~=2 or Duel.Destroy(tg,REASON_EFFECT)~=2 or Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=fugf.SelectFilter(tp,"D","IsCod+CanSp",{50,{e,tp,0,1}},1):GetFirst()
if not tc then return end
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
end
\ No newline at end of file
--虚数转生
xpcall(function() dofile("expansions/script/c20000000.lua") end,function() dofile("script/c20000000.lua") end)
local cm,m,o=GetID()
function cm.initial_effect(c)
fuef.A(c)
fuef.FTO(c,c,"m,TH,TH+GA,DE,S,m,,,tg1,op1")
if cm.glo then return end
cm.glo = fuef.FC(c,0,"SP,,,,,,op2")(EVENT_LEAVE_FIELD_P,0,"OP:op3")
end
--e1
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
local g,b = Group.CreateGroup()
for c in aux.Next(eg) do
b = true
for tc in aux.Next(c:GetMaterial()) do
if b then b = fucf.Filter(tc,"IsLoc+IsRea+AbleTo","GR,RI+MAT,H") and tc:GetReasonCard() == c end
end
if b and chk==0 then return 1 end
end
if chk==0 then return false end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local g,b = Group.CreateGroup()
for c in aux.Next(eg) do
b = true
for tc in aux.Next(c:GetMaterial()) do
if b then b = fucf.Filter(tc,"IsLoc+IsRea+AbleTo+GChk","GR,RI+MAT,H") and tc:GetReasonCard() == c end
end
if b then g = g + c end
end
if #g==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
g = (#g==1 and g or g:Select(tp,1,1,nil)):GetFirst():GetMaterial()
Duel.HintSelection(g)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
--e2
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
for c in aux.Next(fugf.Filter(eg,"IsSTyp","RI")) do
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
--e3
function cm.op3(e,tp,eg,ep,ev,re,r,rp)
local g = Group.CreateGroup()
for c in aux.Next(eg) do
if c:GetFlagEffect(m)>0 then g = g + c end
end
if #g>0 then Duel.RaiseEvent(g,EVENT_CUSTOM+m,re,r,rp,ep,ev) end
end
\ No newline at end of file
--无亘幻梦传说
xpcall(function() dofile("expansions/script/c20000000.lua") end,function() dofile("script/c20000000.lua") end)
local cm,m,o = GetID()
function cm.initial_effect(c)
fuef.A(c)
fuef.F(c,c,EFFECT_DIRECT_ATTACK,",,F,M+M,,,,tg1")
fuef.FTO(c,c,EVENT_PHASE+PHASE_BATTLE,",,,F,1,con2,,,op2")
if cm.glo then return end
cm.op4()
fuef.FC(c,0,EVENT_BATTLE_DAMAGE,",,,,,op3")(EVENT_PHASE_START+PHASE_DRAW,0,"OP:op4")
end
--e1
function cm.tg1(e,c)
return c:IsAttackBelow(1000)
end
--e2
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return cm.glo[tp+1]>0
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local val = cm.glo[tp]
fuef.F(e,tp,EFFECT_CHANGE_DAMAGE,",PTG,,1+0,op2val1,,,,,PH/ED|2,"..val)
end
function cm.op2val1(e,re,dam,r,rp,rc)
local val = dam - e:GetLabel()
return val>0 and dam or 0
end
--e3
function cm.op3(e,tp,eg,ep,ev,re,r,rp)
cm.glo[rp+1] = cm.glo[rp+1] + (ev or 0)
end
--e4
function cm.op4(e,tp,eg,ep,ev,re,r,rp)
cm.glo = {0,0}
end
\ No newline at end of file
--无亘风暴
xpcall(function() dofile("expansions/script/c20000000.lua") end,function() dofile("script/c20000000.lua") end)
local cm,m,o=GetID()
function cm.initial_effect(c)
fuef.B_A(c,c,",,TH,,,,,tg1,op1")
end
--e1
function cm.tgf1(g,atk)
return g:IsExists(Card.IsAttackBelow,1,nil,atk)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
local atk = 0
for c in aux.Next(fugf.GetFilter(tp,"M","IsTyp+IsPos","RI+M,FU")) do
atk = atk + c:GetAttack()
end
local g = fugf.GetFilter(tp,"M","IsPos","FU")
if chk==0 then return g:CheckSubGroup(cm.tgf1,1,#g,atk) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function cm.opf1(g,atk)
for c in aux.Next(g) do
atk = atk - c:GetAttack()
end
return atk>0
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local atk = 0
for c in aux.Next(fugf.GetFilter(tp,"M","IsTyp+IsPos","RI+M,FU")) do
atk = atk + c:GetAttack()
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g = fugf.GetFilter(tp,"+M","IsPos","FU"):SelectSubGroup(tp,cm.opf1,false,1,99,atk)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
--幻梦无亘帝龙
xpcall(function() dofile("expansions/script/c20000000.lua") end,function() dofile("script/c20000000.lua") end)
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,20000050,20000051)
aux.EnableChangeCode(c,20000050,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE)
fuef.QO(c,c,"CH,,NEGA+DES,DAM+CAL,M,1,con1,,tg1,op1")
end
--e1
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
local c,rc=e:GetHandler(),re:GetHandler()
local g = fugf.Get(tp,"M+M"):GetMaxGroup(Card.GetBaseAttack)
return re:IsActiveType(TYPE_MONSTER) and rc:IsOnField() and not c:IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and g and not g:IsContains(rc)
end
function cm.tg1(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.op1(e,tp,eg,ep,ev,re,r,rp)
local c,rc=e:GetHandler(),re:GetHandler()
if Duel.NegateActivation(ev) and rc:IsRelateToEffect(re) and Duel.Destroy(rc,REASON_EFFECT)~=0 and rc:GetBaseAttack()>=0
and c:IsRelateToEffect(e) and c:IsFaceup() then
local atk = c:GetBaseAttack() + rc:GetBaseAttack()
fuef.S(c,c,EFFECT_UPDATE_ATTACK,",,,"..(rc:GetBaseAttack())..",,,,EV+STD+PH/ED")
end
end
\ No newline at end of file
--无亘皇帝之跃升
xpcall(function() dofile("expansions/script/c20000000.lua") end,function() dofile("script/c20000000.lua") end)
local cm,m,o=GetID()
function cm.initial_effect(c)
aux.AddCodeList(c,20000050)
aux.AddRitualProcGreater2(c,aux.FilterBoolFunction(Card.IsCode,20000050),nil,aux.TRUE,nil,nil,cm.opr)
fuef.FTO(c,c,"SP,,TH+GA,,G,m,con1,,tg1,op1")
end
--r
function cm.opr(e,tp,eg,ep,ev,re,r,rp,tc,mat)
local atk = 0
for c in aux.Next(mat) do
atk = atk + c:GetBaseAttack()
end
atk = math.floor(atk/2) + tc:GetBaseAttack()
fuef.S(e,tc,EFFECT_SET_BASE_ATTACK,",IG,,"..(atk)..",,,,EV+STD")
end
--e1
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return fugf.Filter(eg,"IsSTyp","RI",1)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return fugf.GetFilter(tp,"G","IsTyp+AbleTo+Not",{"RI+S,H",e},1) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
local c=e:GetHandler()
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoHand(c,nil,REASON_EFFECT)>0 then
local g=fugf.GetFilter(tp,"G","IsTyp+AbleTo+GChk","RI+M,H")
if #g>0 and Duel.SelectYesNo(tp,1190) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
g=g:Select(tp,1,1,nil)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
xpcall(function() dofile("expansions/script/c20099999.lua") end,function() dofile("script/c20099999.lua") end)
if fucf then return end
fucf, fugf = { }, { }
--------------------------------------"Card function"
function fucf.Filter(c,f,...)
local v = {...}
v = #v==1 and v[1] or v
return fugf.Filter(Group.FromCards(c),f,v,1)
end
function fucf.Compare(c,f,n,meth,...)
if type(f) == "string" then f = fucf[f] or Card[f] or aux[f] end
local v = {...}
v = type(v[1]) =="table" and #v==1 and v[1] or v
if meth == "A" then
return f(c,table.unpack(v))>=n
elseif meth == "B" then
return f(c,table.unpack(v))<=n
end
return f(c,table.unpack(v))==n
end
fucf.A = function(c,f,n,...) return fucf.Compare(c,f,n,"A",...) end
fucf.B = function(c,f,n,...) return fucf.Compare(c,f,n,"B",...) end
fucf.E = function(c,f,n,...) return fucf.Compare(c,f,n,nil,...) end
function fucf.IsN(func)
return function(c,val,exval)
local _func,_val = func,val
if type(val) == "string" then
_val = tonumber(_val:match("%d"))
if val:match("+") then return Card[_func](c,exval) >= _val end
if val:match("-") then return Card[_func](c,exval) <= _val end
end
return Card[_func](c,exval) == _val
end
end
fucf.IsRk = fucf.IsN("GetRank")
fucf.IsLv = fucf.IsN("GetLevel")
fucf.IsRLv = fucf.IsN("GetRitualLevel")
fucf.IsLk = fucf.IsN("GetLink")
function fucf.Not(c,val)
if aux.GetValueType(val) == "Card" then
return c ~= val
elseif aux.GetValueType(val) == "Effect" then
return c ~= val:GetHandler()
elseif aux.GetValueType(val) == "Group" then
return not val:IsContains(c)
elseif aux.GetValueType(val) == "function" then
return not val(c)
end
return false
end
function fucf.IsSet(c,set)
if type(set) == "number" then return c:IsSetCard(set) end
for _,Set in ipairs(fusf.CutString(set,"/")) do
Set=tonumber(Set,16)
if Set and c:IsSetCard(Set) then return true end
end
return false
end
function fucf.AbleTo(c,loc)
local func = {
["H"] = "Hand" ,
["D"] = "Deck" ,
["G"] = "Grave" ,
["R"] = "Remove",
["E"] = "Extra" ,
}
local iscos = string.sub(loc,1,1) == "*"
if iscos then loc = string.sub(loc,2) end
return Card["IsAbleTo"..func[loc]..(iscos and "AsCost" or "")](c)
end
function fucf.CanSp(c,e,tp,typ,nochk,nolimit,pos,totp,zone)
return c:IsCanBeSpecialSummoned(e, typ, tp, nochk or false, nolimit or false, pos or POS_FACEUP, totp or tp,zone or 0xff)
end
fucf.IsCod = function(c,cod) return c:IsCode(tonumber(cod)<19999999 and (tonumber(cod)+20000000) or tonumber(cod)) end
fucf.TgChk = Card.IsCanBeEffectTarget
fucf.GChk = function(c) return not c:IsHasEffect(EFFECT_NECRO_VALLEY) end
fucf.IsImm = Card.IsImmuneToEffect
fucf.IsCon = Card.IsControler
fucf.IsPCon = Card.IsPreviousControler
fucf.IsLoc = function(c,loc) return c:IsLocation(fusf.Loc(loc)) end
fucf.IsPLoc = function(c,loc) return c:IsPreviousLocation(fusf.Loc(loc)) end
fucf.IsRea = fusf.Check_Constant(function(c,v) return c:GetReason()&v==v end,fucg.rea)
fucf.IsTyp = fusf.Check_Constant(function(c,v) return c:GetType()&v==v end,fucg.typ)
fucf.IsSTyp = fusf.Check_Constant(function(c,v) return c:IsSummonType(v) end,fucg.styp)
fucf.IsOTyp = fusf.Check_Constant(function(c,v) return c:GetOriginalType()&v==v end,fucg.typ)
fucf.IsAtt = fusf.Check_Constant(function(c,v) return c:GetAttribute()&v==v end,fucg.att)
fucf.IsRac = fusf.Check_Constant(function(c,v) return c:GetRace()&v==v end,fucg.rac)
fucf.IsPos = fusf.Check_Constant(function(c,v) return c:IsPosition(v) end,fucg.pos)
fucf.IsPPos = fusf.Check_Constant(function(c,v) return c:IsPreviousPosition(v) end,fucg.pos)
--------------------------------------"Group function"
function fugf.Filter(g,f,v,n)
v = type(v) == "table" and v or { v }
local func = type(f) == "string" and fusf.PostFix_Trans(f,v) or { f }
local _g, var = { }, fusf.Value_Trans(table.unpack(v))
--------------------------------------------
if #func==1 then
if type(func[1]) == "string" then func[1] = fucf[func[1] ] or Card[func[1] ] or aux[func[1] ] end
g = g:Filter(func[1] or aux.TRUE,nil,table.unpack(var))
elseif fusf.NotNil(func) then
local CalL, CalR
for _,val in ipairs(func) do
if val == "~" then
_g[#_g] = g - _g[#_g]
elseif type(val) == "string" and #val == 1 then
CalR = table.remove(_g)
CalL = table.remove(_g)
local tCalc = {
["+"] = CalL & CalR,
["-"] = CalL - CalR,
["/"] = CalL + CalR
}
table.insert(_g, tCalc[val])
else
if type(val) == "string" then val = fucf[val] or Card[val] or aux[val] end
local V = table.remove(var,1)
V = V and (type(V) =="table" and V or {V}) or { }
table.insert(_g, g:Filter(val,nil,table.unpack(V)))
end
end
g = table.remove(_g)
end
if n then return n>0 and #g>=n or (n<0 and #g<-n) end
return g
end
fugf.Get = function(tp,loc) return Duel.GetFieldGroup(tp,fusf.Loc(loc)) end
fugf.GetFilter = function(tp,loc,f,v,n) return fugf.Filter(fugf.Get(tp,loc),f,v,n) end
fugf.SelectFilter = function(tp,loc,f,v,c,min,max,sp) return fugf.GetFilter(tp,loc,f,v):Select(sp or tp,min or 1,max or min or 1,c) end
function fugf.SelectTg(tp,loc,f,v,c,min,max,sp)
local g=fugf.SelectFilter(tp,loc,f,v,c,min,max,sp)
Duel.SetTargetCard(g)
return g
end
\ No newline at end of file
This diff is collapsed.
......@@ -771,6 +771,7 @@
#小壶 1701585682 200 0xfd0-0xfdf
!setname 0x3fd0 无亘
!setname 0xbfd0 无亘帝
#VHisc 916214730 332
!setname 0x321 锻溶
......@@ -1196,6 +1197,12 @@
#无言之音 166 0xb60-0xb6f
#奇跡の早苗 2060043514 961 0x7a0-0x7af
!setname 0x07e0 奇迹指示物
!setname 0x37e0 苍蓝奇迹
!setname 0x57e0 千禧年科技学院
!setname 0x67e0 研讨会
#???
!setname 0xcf38 晶傀
!setname 0xa77 业狱火
......@@ -1215,6 +1222,16 @@
!setname 0x289 萤火
!setname 0x28a 绿宝石
!setname 0x28b 黑彗星
!counter 0x1283 闪耀指示物
!setname 0x569 诞地
!setname 0x3569 诞地领主
!setname 0x5569 幻绮诞地
!setname 0x6569 深腐诞地
!setname 0x9569 血戮诞地
!setname 0xa569 幽域诞地
!setname 0xc569 秘林诞地
!counter 0xf3 深境指示物
#TYGOC Submissions
#Desruc_6872 987
......
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