Commit 6c37805e authored by POLYMER's avatar POLYMER

fix

parent 62f05eb2
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
...@@ -288,7 +288,7 @@ fucg.cod = { ...@@ -288,7 +288,7 @@ fucg.cod = {
CH = EVENT_CHAINING , CH = EVENT_CHAINING ,
--[[ --[[
EVENT_FLIP =1001 --翻转时 EVENT_FLIP =1001 --翻转时
EVENT_DISCARD =1018 --丢弃手牌时 EVENT_DISCARD =1018 --丢弃手牌时
EVENT_CHAIN_SOLVING =1020 --连锁处理开始时(EVENT_CHAIN_ACTIVATING之後) EVENT_CHAIN_SOLVING =1020 --连锁处理开始时(EVENT_CHAIN_ACTIVATING之後)
EVENT_CHAIN_ACTIVATING =1021 --连锁处理准备中 EVENT_CHAIN_ACTIVATING =1021 --连锁处理准备中
EVENT_CHAIN_SOLVED =1022 --连锁处理结束时 EVENT_CHAIN_SOLVED =1022 --连锁处理结束时
...@@ -303,8 +303,8 @@ EVENT_MSET =1106 --放置怪兽时 ...@@ -303,8 +303,8 @@ EVENT_MSET =1106 --放置怪兽时
EVENT_SSET =1107 --放置魔陷时 EVENT_SSET =1107 --放置魔陷时
EVENT_DRAW =1110 --抽卡时 EVENT_DRAW =1110 --抽卡时
EVENT_DAMAGE =1111 --造成战斗/效果伤害时 EVENT_DAMAGE =1111 --造成战斗/效果伤害时
EVENT_RECOVER =1112 --回复生命值时 EVENT_RECOVER =1112 --回复生命值时
EVENT_PREDRAW =1113 --抽卡阶段通常抽卡前 EVENT_PREDRAW =1113 --抽卡阶段通常抽卡前
EVENT_CONTROL_CHANGED =1120 --控制权变更 EVENT_CONTROL_CHANGED =1120 --控制权变更
EVENT_EQUIP =1121 --装备卡装备时 EVENT_EQUIP =1121 --装备卡装备时
EVENT_ATTACK_ANNOUNCE =1130 --攻击宣言时 EVENT_ATTACK_ANNOUNCE =1130 --攻击宣言时
...@@ -315,7 +315,7 @@ EVENT_PRE_DAMAGE_CALCULATE =1134 --伤害计算时(羽斬) ...@@ -315,7 +315,7 @@ EVENT_PRE_DAMAGE_CALCULATE =1134 --伤害计算时(羽斬)
EVENT_DAMAGE_CALCULATING =1135 --N/A EVENT_DAMAGE_CALCULATING =1135 --N/A
EVENT_PRE_BATTLE_DAMAGE =1136 --即将产生战斗伤害(只能使用EFFECT_TYPE_CONTINUOUS) EVENT_PRE_BATTLE_DAMAGE =1136 --即将产生战斗伤害(只能使用EFFECT_TYPE_CONTINUOUS)
EVENT_BATTLE_END =1137 --N/A EVENT_BATTLE_END =1137 --N/A
EVENT_BATTLED =1138 --伤害计算后(异女、同反转效果时点) EVENT_BATTLED =1138 --伤害计算后(异女、同反转效果时点)
EVENT_BATTLE_DESTROYING =1139 --以战斗破坏怪兽送去墓地时(BF-苍炎之修罗) EVENT_BATTLE_DESTROYING =1139 --以战斗破坏怪兽送去墓地时(BF-苍炎之修罗)
EVENT_BATTLE_DESTROYED =1140 --被战斗破坏送去墓地时(杀人番茄等) EVENT_BATTLE_DESTROYED =1140 --被战斗破坏送去墓地时(杀人番茄等)
EVENT_DAMAGE_STEP_END =1141 --伤害步骤结束时 EVENT_DAMAGE_STEP_END =1141 --伤害步骤结束时
......
...@@ -21,6 +21,7 @@ function s.initial_effect(c) ...@@ -21,6 +21,7 @@ function s.initial_effect(c)
e2:SetOperation(s.spop) e2:SetOperation(s.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=e2:Clone() local e3=e2:Clone()
e3:SetDescription(aux.Stringid(id,1))
e3:SetCode(EVENT_CHAINING) e3:SetCode(EVENT_CHAINING)
e3:SetCondition(s.spcon2) e3:SetCondition(s.spcon2)
e3:SetTarget(s.sptg2) e3:SetTarget(s.sptg2)
...@@ -68,11 +69,13 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -68,11 +69,13 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget() local d=Duel.GetAttackTarget()
if Duel.Remove(d,0,REASON_EFFECT+REASON_TEMPORARY)>0 and d:IsLocation(LOCATION_REMOVED) then if Duel.Remove(d,0,REASON_EFFECT+REASON_TEMPORARY)>0 and d:IsLocation(LOCATION_REMOVED) then
d:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1) d:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
local og=Group.FromCards(d)
og:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(d) e1:SetLabelObject(og)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetCondition(s.retcon) e1:SetCondition(s.retcon)
e1:SetOperation(s.retop) e1:SetOperation(s.retop)
...@@ -80,7 +83,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -80,7 +83,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local num=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_ONFIELD,nil):GetClassCount(s.ccfilter) local num=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_ONFIELD,nil):GetClassCount(s.ccfilter)
Duel.Recover(tp,num*1200,REASON_EFFECT) Duel.Recover(tp,num*1200,REASON_EFFECT)
end end
end end
end end
function s.cfilter(c,tp) function s.cfilter(c,tp)
...@@ -93,17 +96,17 @@ function s.spcon2(e,tp,eg,ep,ev,re,r,rp) ...@@ -93,17 +96,17 @@ function s.spcon2(e,tp,eg,ep,ev,re,r,rp)
end end
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS):Filter(s.cfilter,nil) local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS):Filter(s.cfilter,nil,tp)
if chk==0 then if chk==0 then
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetMZoneCount(tp,g)>0 return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetMZoneCount(tp,g)>0
end end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,0) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,0)
end end
function s.spop2(e,tp,eg,ep,ev,re,r,rp) function s.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS):Filter(s.cfilter,nil) local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS):Filter(s.cfilter,nil,tp)
if Duel.Remove(g,0,REASON_EFFECT+REASON_TEMPORARY)>0 and g:IsExists(Card.IsLocation,1,nil,LOCATION_REMOVED) then if Duel.Remove(g,0,REASON_EFFECT+REASON_TEMPORARY)>0 and g:IsExists(Card.IsLocation,1,nil,LOCATION_REMOVED) then
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED) local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED)
if og:GetCount()==0 then return end if og:GetCount()==0 then return end
...@@ -115,7 +118,7 @@ function s.spop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -115,7 +118,7 @@ function s.spop2(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(d) e1:SetLabelObject(og)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetCondition(s.retcon) e1:SetCondition(s.retcon)
e1:SetOperation(s.retop) e1:SetOperation(s.retop)
......
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