Commit 464f9301 authored by Huangnan's avatar Huangnan

fix

parent a217e3bb
Pipeline #40005 failed with stages
in 6 minutes and 19 seconds
......@@ -18,7 +18,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
......
......@@ -28,7 +28,7 @@ function fuef.FG(owner, obj, target, force)
owner, obj, target, force = nil, owner, obj, target
end
return fuef.New(log, "F+G", nil, owner, target, force):OBJ(obj)
return fuef.New(log, "F+G", nil, owner, target, force):Obj(obj)
end
--- 建立剩余需要 cod 的 fuef
......@@ -308,7 +308,7 @@ function fuef:Clone(cod, target, force)
log:Info("check self.typ is F+G")
if E.typ == EFFECT_TYPE_FIELD + EFFECT_TYPE_GRANT then
E:OBJ(cod)
E:Obj(cod)
else
E.cod = fusf.ParseConstantKey("cod", cod)
log:Info("set self.cod : "..E.cod)
......@@ -878,9 +878,9 @@ function fuef:Obj(val)
if self:InitCheck(log, "obj", val) then return self end
if typ == "string" then
local e = fusf.Getcm(self).elist[val]
local e = fusf.Getcm(self).e_list[val]
if not e or not e.e then
error("Obj: elist entry for '" .. val .. "' is missing or invalid", 2)
error("Obj: e_list entry for '" .. val .. "' is missing or invalid", 2)
end
val = fusf.CheckType(e.e, "Effect")
end
......
--创导龙裔·觉醒者
dofile("expansions/script/c20000000.lua")
fu_GD = fu_GD or { }
--
function fu_GD.SelfDraw_con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DRAW and rp==tp
-------------------
function fu_GD.NInitial(cat, loc, f, v)
local cm, m = fusf.Initial(fu_GD)
cat = table.concat({"TD+DR", cat}, "+")
local pgf = fugf.MakeFilter(loc, f, v)
local insert = function(c)
cm.public = fuef.I(c):Cat(cat):Ran("H"):Ctl(m):Func("Pcos,Ptg(%1),Pop(%1)", pgf)
end
fusf.InsertInitial(insert)
cm.pe1 = fuef.FC("DR"):Ran("H"):Func("SelfDraw_con,NPop1")
return cm, m
end
function fu_GD.RInitial(glo)
local cm, m = fusf.Initial(fu_GD, glo)
fusf.AddCode(455)
fusf.ReviveLimit()
cm.pe1 = fuef.F(m):Pro("PTG"):Ran("M"):Tran(1, 0):Con("RPcon1")
cm.pe2 = fuef.SC("SP"):Func("RPcon1,RPop2")
return cm, m
end
-------------------
-- 龙族仪式怪兽从场上离开的场合
function fu_GD.DRM_leave_con(e,tp,eg,ep,ev,re,r,rp)
return fugf.Filter(eg,"IsTyp+IsRac+IsPLoc","RI+M,DR,M",1)
end
function fu_GD.CanReturnDraw_tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp) and fugf.GetFilter(tp,"H","AbleTo+Not",{"D",e},1) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
local rm_g = fugf.MakeFilter("M", "IsTyp", "RI+M")
-- 获取回卡组的最大数量
function fu_GD.GetReCount(tp)
if not Duel.IsPlayerAffectedByEffect(tp, 20000457) then return 2 end
return math.max(2, #rm_g(tp) + 1)
end
--Normal initial
function fu_GD.N_initial(add_cat, f1_loc, f1_func, f1_val)
local func = fugf.GetNoP(f1_loc, f1_func, f1_val)
local pe = fuef.I():CAT("TD+DR"..(add_cat and "+"..add_cat or "")):RAN("H"):CTL("m"):Func("N_cos1,N_tg1(%1),N_op1(%1)", func)
local cm, m = fuef.initial(fu_GD, _glo, "public_effect", pe)
cm.pe1 = fuef.FC("DR"):RAN("H"):Func("SelfDraw_con,N_op2")
return cm, m
-- 获取置顶的最大数量
function fu_GD.GetSetCount(tp)
if not Duel.IsPlayerAffectedByEffect(tp, 20000458) then return 1 end
return #rm_g(tp) + 1
end
function fu_GD.N_cos1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
fuef.S(e,EFFECT_PUBLIC):DES("PUB"):PRO("HINT"):RES("STD+PH/ED+OPPO")
-- 召唤词
function fu_GD.Hint(tp, m, mg, rc)
if not rc:IsSetCard(0x3fd4) then return end
mg = fugf.Filter(mg, "IsSet", "bfd4")
if #mg ~= 1 then return end
local mcode = mg:GetFirst():GetCode()
Duel.Hint(24, tp, aux.Stringid(mcode, 0))
Duel.Hint(24, tp, aux.Stringid(m, 0))
end
function fu_GD.N_tg1(func)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return fu_GD.CanReturnDraw_tg(e,tp,eg,ep,ev,re,r,rp,chk) and #func(tp)>0 end
fu_GD.CanReturnDraw_tg(e,tp,eg,ep,ev,re,r,rp,chk)
end
-------------------
local return_g = fugf.MakeFilter("H", "AbleTo+Not", "D,%1")
function fu_GD.ReDraw_tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp) and #return_g(tp, e) > 0 end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
end
function fu_GD.ReturnDeck(e, tp)
-- 这张卡以外的自己手卡最多2张回到卡组洗切
-- 这张卡以外的自己手卡最多2张回到卡组洗切
function fu_GD.ToDeck(e, tp)
local max = fu_GD.GetReCount(tp)
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK)
local max, maxn = 2, #fugf.GetFilter(tp, "M", "IsTyp", "RI+M") + 1
if Duel.IsPlayerAffectedByEffect(tp, 20000457) and maxn > max then max = maxn end
local g = fugf.Select(tp, "H", "AbleTo+Not", {"D", e}, 1, max)
local g = fugf.Select(tp, return_g(tp, e), 1, max)
if #g > 2 then Duel.Hint(HINT_CARD, 1 - tp, 20000457) end
return Duel.SendtoDeck(g, nil, 2, REASON_EFFECT)
end
function fu_GD.SetDeckTop(e, tp, func)
-- 在卡组最上面放置
local max = Duel.IsPlayerAffectedByEffect(tp, 20000458) and (#fugf.GetFilter(tp, "M", "IsTyp", "RI+M") + 1) or 1
-- 在卡组最上面放置
function fu_GD.SetTop(e, tp, g)
local max = fu_GD.GetSetCount(tp)
Duel.Hint(HINT_SELECTMSG, tp, aux.Stringid(20000450, 1))
local g = fugf.Select(tp, func(tp), "GChk", nil, 1, max)
g = fugf.Select(tp, g, "GChk", nil, 1, max)
if #g == 0 then return false end
local gg = fugf.Filter(g, "IsLoc", "G")
if #gg > 0 then Duel.SendtoDeck(gg, nil, 0, REASON_EFFECT) end
......@@ -50,48 +72,66 @@ function fu_GD.SetDeckTop(e, tp, func)
for c in aux.Next(g) do
Duel.MoveSequence(c, SEQ_DECKTOP)
end
if #g > 1 then Duel.SortDecktop(tp, tp, #g) end
if #g > 1 then
Duel.Hint(HINT_CARD, 1 - tp, 20000458)
Duel.SortDecktop(tp, tp, #g)
end
Duel.ConfirmDecktop(tp, #g)
return true
end
-- 那之后,自己抽出回去的数量
function fu_GD.DrawReturn(tp, ct)
-- 那之后,自己抽出回去的数量
if Duel.IsPlayerAffectedByEffect(tp, 20000459) and Duel.SelectYesNo(tp, aux.Stringid(20000459, 0)) then
Duel.Hint(HINT_CARD, 1-tp, 20000459)
if Duel.IsPlayerAffectedByEffect(tp, 20000459) and Duel.SelectYesNo(tp, aux.Stringid(20000459, 2)) then
Duel.Hint(HINT_CARD, 1 - tp, 20000459)
ct = ct + 1
end
Duel.BreakEffect()
Duel.Draw(tp, ct, REASON_EFFECT)
end
function fu_GD.N_op1(func)
------------------- public
function fu_GD.Pcos(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
fuef.S(e,EFFECT_PUBLIC):Des("PUB"):Pro("HINT"):Res("STD+ED+OPPO")
end
function fu_GD.Ptg(gf)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return fu_GD.ReDraw_tg(e,tp,eg,ep,ev,re,r,rp,chk) and #gf(tp, eg) > 0 end
fu_GD.ReDraw_tg(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function fu_GD.Pop(gf)
return function(e,tp,eg,ep,ev,re,r,rp)
local ct = fu_GD.ReturnDeck(e, tp)
local ct = fu_GD.ToDeck(e, tp)
if ct == 0 then return end
if not fu_GD.SetDeckTop(e, tp, func) then return end
if not fu_GD.SetTop(e, tp, gf(tp, eg)) then return end
fu_GD.DrawReturn(tp, ct)
end
end
function fu_GD.N_op2(e,tp,eg,ep,ev,re,r,rp)
-------------------
function fu_GD.SelfDraw_con(e,tp,eg,ep,ev,re,r,rp)
return not fusf.IsPhase("DP") and rp == tp
end
function fu_GD.NPop1(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsPublic() then return end
local e1 = fuef.S(e,EFFECT_UPDATE_LEVEL):VAL(ev)
fuef.FC(e,"ADJ",tp):OP("N_op2op2"):OBJ(e1.e)
local e1 = fuef.S(e,EFFECT_UPDATE_LEVEL):Val(ev)
fuef.FC(e,"ADJ",tp):Op("NPop1op1"):Obj(e1.e)
end
function fu_GD.N_op2op2(e,tp,eg,ep,ev,re,r,rp)
function fu_GD.NPop1op1(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetLabelObject():GetHandler()
if not (c:IsLocation(LOCATION_HAND) and c:IsPublic()) then
if fucf.Filter(c, "~(IsLoc+IsPublic)", "H") then
e:GetLabelObject():Reset()
e:Reset()
end
end
-- ritual monster initial
function fu_GD.RM_initial(_glo)
local cm, m = fuef.initial(fu_GD, _glo, "AddCode,ReviveLimit", 455)
cm.pe1 = fuef.F(m):PRO("PTG"):RAN("M"):TRAN(1,0):CON("RM_con1")
return cm, m
end
function fu_GD.RM_con1(e)
-------------------
function fu_GD.RPcon1(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function fu_GD.RPop2(e,tp)
local m = e:GetHandler():GetCode()
Duel.Hint(24, tp, aux.Stringid(m, 0))
Duel.Hint(24, tp, aux.Stringid(m, 1))
end
if self_code ~= 20000450 then return end
-----------------------------------------------------------------------------------
fu_GD.N_initial("GA", "DG", "IsTyp+IsRac+IsLoc/AbleTo", "RI+M,DR,D,D")
\ No newline at end of file
fu_GD.NInitial("GA", "DG", "IsTyp+IsRac+IsLoc/AbleTo", "RI+M,DR,D,D")
\ No newline at end of file
--创导龙裔·集结者
dofile("expansions/script/c20000450.lua")
fu_GD.N_initial(nil, "D", "IsTyp+IsSet-IsCode", "M,bfd4,451")
\ No newline at end of file
fu_GD.NInitial(nil, "D", "IsTyp+IsSet-IsCode", "M,bfd4,451")
\ No newline at end of file
--创导龙裔·复苏者
dofile("expansions/script/c20000450.lua")
fu_GD.N_initial("GA", "G", "AbleTo+IsSet", "D,3fd4")
\ No newline at end of file
fu_GD.NInitial("GA", "G", "AbleTo+IsSet", "D,3fd4")
\ No newline at end of file
--创导龙裔·探求者
dofile("expansions/script/c20000450.lua")
fu_GD.N_initial(nil, "D", "IsTyp+IsSet", "S/T,bfd4")
\ No newline at end of file
fu_GD.NInitial(nil, "D", "IsTyp+IsSet", "S/T,bfd4")
\ No newline at end of file
--创导龙裔的秘仪
dofile("expansions/script/c20000450.lua")
local cm, m = fuef.initial(fu_GD)
cm.e1 = fuef.A():CAT("RE"):Func("tg1,op1")
cm.e2 = fuef.FTO("LEA"):CAT("TD+DR+GA"):PRO("DE"):RAN("G"):CTL(m):Func("DRM_leave_con,tg2,op2")
local cm, m = fusf.Initial(fu_GD)
--e1
cm.e1 = fuef.A():Cat("REL+RE+SP"):Func("tg1,op1")
local e1g1 = fugf.MakeFilter("HG", "IsTyp+IsRac+CanSp+AbleTo", "RI+M,DR,%1,*R")
local e1g2 = fugf.MakeFilter("H", "IsTyp+IsPublic", "M")
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return fugf.GetFilter(tp,"HG","IsTyp+IsRac+CanSp+AbleTo","RI+M,DR,%1,*R",1,{e,"RI",tp}) and fugf.GetFilter(tp,"H","IsTyp+IsPublic","M",1) end
if chk==0 then return #e1g1(tp, {e,"RI"}) > 0 and #e1g2(tp) > 0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg = fugf.Select(tp,"HG","IsTyp+IsRac+CanSp+AbleTo","RI+M,DR,%1,*R",1,1,{e,"RI",tp})
if #rg ~= 1 then return end
if Duel.Remove(rg,POS_FACEUP,REASON_EFFECT) == 0 then return end
local rg = fugf.Select(tp, e1g1(tp, {e,"RI"}), "GChk")
if Duel.Remove(rg, POS_FACEUP, REASON_EFFECT) == 0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg = fugf.Select(tp,"H","IsTyp+IsPublic","M",1)
if #sg ~= 1 then return end
Duel.ConfirmCards(1-tp,sg)
local sg = fugf.Select(tp, e1g2(tp))
if #sg == 0 then return end
Duel.ConfirmCards(1 - tp, sg)
local fid = rg:GetFirst():GetFieldID()
fusf.RegFlag(rg + sg, m, "STD", "HINT", fid, 0)
fuef.FC(e,"ADJ",tp):Func("op1con1,op1op1"):LAB(fid)
fusf.RegFlag(rg + sg, m, "STD", "HINT", 1, fid)
fuef.FC(e, "ADJ", tp):Func("op1con1,op1op1"):Lab(fid)
end
function cm.op1con1(e,tp,eg,ep,ev,re,r,rp)
local fid = e:GetLabel()
local rc = fugf.GetFilter(tp,"R","IsFlagLab",{m,fid}):GetFirst()
local sc = fugf.GetFilter(tp,"H","IsFlagLab",{m,fid}):GetFirst()
if not (rc and sc) then
local rc = fugf.GetFilter(tp, "R", "IsFlagLab", {m, fid}):GetFirst()
local sc = fugf.GetFilter(tp, "H", "IsFlagLab", {m, fid}):GetFirst()
if not (rc and sc) then
e:Reset()
return false
end
return sc:IsCanBeRitualMaterial(rc) and sc:IsLevelAbove(rc:GetLevel()) and (sc.mat_filter or aux.TRUE)(rc)
return sc:IsCanBeRitualMaterial(rc) and sc:IsLevelAbove(rc:GetLevel())
and (sc.mat_filter or aux.TRUE)(rc)
end
function cm.op1op1(e,tp,eg,ep,ev,re,r,rp)
local fid = e:GetLabel()
local rc = fugf.GetFilter(tp,"R","IsFlagLab",{m,fid}):GetFirst()
local sg = fugf.GetFilter(tp,"H","IsFlagLab",{m,fid})
local rc = fugf.GetFilter(tp, "R", "IsFlagLab", {m, fid}):GetFirst()
local sg = fugf.GetFilter(tp, "H", "IsFlagLab", {m, fid})
if not rc or #sg ~= 1 then return end
Duel.Hint(HINT_CARD, tp, m)
fu_GD.Hint(tp, m, sg, rc)
rc:SetMaterial(sg)
Duel.Hint(HINT_CARD,0,m)
Duel.ReleaseRitualMaterial(sg)
Duel.SpecialSummon(rc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
Duel.SpecialSummon(rc, SUMMON_TYPE_RITUAL, tp, tp, false, true, POS_FACEUP)
rc:CompleteProcedure()
e:Reset()
end
--e2
cm.e2 = fuef.FTO("LEA"):Cat("TD+DR+GA"):Pro("DE"):Ran("G"):Ctl(m):Func("DRM_leave_con,tg2,op2")
local e2g1 = fugf.MakeFilter("D", "IsTyp", "RI+S")
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and e:GetHandler():IsAbleToDeck() and fugf.GetFilter(tp,"D","IsTyp+AbleTo","RI+S,D",1) end
if chk==0 then return Duel.IsPlayerCanDraw(tp, 1) and e:GetHandler():IsAbleToDeck() and #e2g1(tp) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.op2f(g,c)
return g:IsContains(c)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local max, maxn = 2, #fugf.GetFilter(tp, "M", "IsTyp", "RI+M") + 1
if Duel.IsPlayerAffectedByEffect(tp, 20000457) and maxn > max then max = maxn end
local max = fu_GD.GetReCount(tp) - 1
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
Duel.SetSelectedCard(e:GetHandler())
local g = fugf.GetFilter(tp,"G","AbleTo+GChk","D"):SelectSubGroup(tp,cm.op2f,false,1,max,e:GetHandler())
local g = fugf.Select(tp, "G", "AbleTo+Not+GChk", "D,%1", 1, max, e) + e:GetHandler()
if Duel.SendtoDeck(g, nil, 2, REASON_EFFECT) == 0 then return end
if not fu_GD.SetDeckTop(e, tp, fugf.GetNoP("D","IsTyp+AbleTo","RI+S,D")) then return end
if not fu_GD.SetTop(e, tp, e2g1(tp)) then return end
fu_GD.DrawReturn(tp, 1)
end
\ No newline at end of file
--创导龙裔的转生
dofile("expansions/script/c20000450.lua")
local cm, m = fuef.initial(fu_GD)
cm.e1 = fuef.A():CAT("SP"):Func("tg1,op1")
cm.e2 = fuef.FC(EFFECT_DESTROY_REPLACE):RAN("G"):Func("val2,tg2,op2")
local cm, m = fusf.Initial(fu_GD)
--e1
function cm.tg1ff(g,tp,c,lv)
cm.e1 = fuef.A():Cat("REL+SP"):Func("tg1,op1")
function cm.tg1f2(g, tp, c, lv)
if #fugf.Filter(g, "IsRac", "SP") < 1 or Duel.GetMZoneCount(tp, g, tp) == 0 then return false end
Duel.SetSelectedCard(g)
return g:IsExists(Card.IsRace,nil,1,RACE_SPELLCASTER) and g:CheckWithSumGreater(Card.GetRitualLevel,lv,c)
and Duel.GetMZoneCount(tp,g,tp)>0 and (not c.mat_group_check or c.mat_group_check(g,tp))
return g:CheckWithSumGreater(Card.GetRitualLevel, lv, c) and (c.mat_group_check or aux.TRUE)(g, tp)
end
function cm.tg1f(rc,e,tp,mg)
if not fucf.Filter(rc, "IsTyp+IsSet+CanSp", "RI+M,3fd4", {e, SUMMON_TYPE_RITUAL, tp, false, true}) then return false end
function cm.tg1f1(rc, e, tp, mg)
if fucf.Filter(rc, "~(IsTyp+IsSet+CanSp)", "RI+M,3fd4,(%1,RI)", e) then return false end
mg = mg:Filter(Card.IsCanBeRitualMaterial, rc, rc):Filter(rc.mat_filter or aux.TRUE, rc, tp)
return mg:CheckSubGroup(cm.tg1ff,1,#mg,tp,rc,rc:GetLevel())
local lv = rc:GetLevel()
aux.GCheckAdditional = aux.RitualCheckAdditional(rc, lv, "Greater")
local res = mg:CheckSubGroup(cm.tg1f2, 1, math.min(#mg, lv), tp, rc, lv)
aux.GCheckAdditional = nil
return res
end
local e1g1 = fugf.MakeFilter("HD", cm.tg1f1, "%1,%2,%3")
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return fugf.GetFilter(tp,"HD",cm.tg1f,{e,tp,Duel.GetRitualMaterial(tp)},1) end
if chk==0 then return #e1g1(tp, e, tp, Duel.GetRitualMaterial(tp)) > 0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local mg = Duel.GetRitualMaterial(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc = fugf.Select(tp,"HD",cm.tg1f,{e,tp,mg}):GetFirst()
if not tc then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mg = fugf.Filter(mg,"IsCanBeRitualMaterial+Not+%1","%2,%2,%3",nil,(tc.mat_filter or aux.TRUE),tc,tp)
mg = mg:SelectSubGroup(tp,cm.tg1ff,false,1,#mg,tp,tc,tc:GetLevel())
tc:SetMaterial(mg)
Duel.ReleaseRitualMaterial(mg)
local rc, sg
repeat
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
rc = fugf.Select(tp, e1g1(tp, e, tp, mg)):GetFirst()
if not rc then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
sg = mg:Filter(Card.IsCanBeRitualMaterial, rc, rc):Filter(rc.mat_filter or aux.TRUE, rc, tp)
local lv = rc:GetLevel()
aux.GCheckAdditional = aux.RitualCheckAdditional(rc, lv, "Greater")
sg = sg:SelectSubGroup(tp, cm.tg1f2, true, 1, math.min(#sg, lv), tp, rc, lv)
aux.GCheckAdditional = nil
until sg
fu_GD.Hint(tp, m, sg, rc)
rc:SetMaterial(sg)
Duel.ReleaseRitualMaterial(sg)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
if #mg == 1 then fuef.S(e,EFFECT_INDESTRUCTABLE_EFFECT,tc):DES(m,0):PRO("SR+CD+HINT"):RAN("M"):VAL(1):RES("STD") end
if mg:IsExists(Card.IsSetCard,nil,1,0xbfd4) then fuef.S(e,EFFECT_CANNOT_BE_EFFECT_TARGET,tc):DES(m,1):PRO("HINT"):VAL("tgoval"):RES("STD") end
Duel.SpecialSummon(rc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
rc:CompleteProcedure()
if #sg == 1 then
fuef.S(e,EFFECT_INDESTRUCTABLE_EFFECT,rc):Des(1):Pro("IG+SR+CD+HINT"):Ran("M"):Val(1):Res("STD")
end
if #fugf.Filter(sg, "IsSet", "bfd4") > 0 then
fuef.S(e,EFFECT_CANNOT_BE_EFFECT_TARGET,rc):Des(2):Pro("IG+HINT"):Val("tgoval"):Res("STD")
end
end
--e2
cm.e2 = fuef.FC(EFFECT_DESTROY_REPLACE):Ran("G"):Func("val2,tg2,op2")
local e1f1 = fugf.MakeGroupFilter("IsPos+IsTyp+IsRac+IsRea+IsLoc+IsCon","FU,RI+M,DR,EFF+BAT-REP,M,%1")
function cm.val2(e,c)
return fucf.Filter(c,"IsPos+IsTyp+IsRac+IsRea+IsLoc+IsCon","FU,RI+M,DR,EFF+BAT-REP,M",e:GetHandlerPlayer())
return e1f1(Group.FromCards(c), 1, e:GetHandlerPlayer())
end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove()
and fugf.Filter(eg,"IsPos+IsTyp+IsRac+IsRea+IsLoc+IsCon","FU,RI+M,DR,EFF+BAT-REP,M,"..tp,1) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
if chk==0 then return e:GetHandler():IsAbleToRemove() and e1f1(eg, 1, tp) end
return Duel.SelectEffectYesNo(tp, e:GetHandler(), 96)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
Duel.Remove(e:GetHandler(), POS_FACEUP, REASON_EFFECT)
Duel.Hint(HINT_CARD,0,m)
end
\ No newline at end of file
--创导龙裔的煉成
dofile("expansions/script/c20000450.lua")
local cm, m = fuef.initial(fu_GD)
local cm, m = fusf.Initial(fu_GD)
--e1
cm.e1 = fuef.A()
--e2
cm.e2 = fuef.QO():CAT("SP"):RAN("S"):CTL(m):Func("con2,tg2,op2")
cm.e2 = fuef.QO():Cat("SP"):Ran("S"):Ctl(m):Func("con2,tg2,op2")
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return fugf.GetFilter(tp,"H","IsPublic",nil,1)
end
function cm.tg2ff(g,tp,c,lv)
function cm.tg2f2(g, tp, c, lv)
local mc = #fugf.Filter(g, "IsLoc", "M")
if mc > 1 or (mc == 1 and Duel.GetMZoneCount(tp, g, tp) == 0) then return false end
Duel.SetSelectedCard(g)
if not (g:CheckWithSumGreater(Card.GetRitualLevel,lv,c) and Duel.GetMZoneCount(tp,g,tp)>0
and (not c.mat_group_check or c.mat_group_check(g,tp))) then return false end
if g:GetFirst():IsLocation(LOCATION_MZONE) then
return #g == 1
end
return not fugf.Filter(g,"~IsPublic",nil,1)
return g:CheckWithSumGreater(Card.GetRitualLevel, lv, c) and (c.mat_group_check or aux.TRUE)(g, tp)
end
function cm.tg2f(rc,e,tp,mg)
if not fucf.Filter(rc, "IsTyp+IsRac+CanSp", "RI+M,DR", {e, SUMMON_TYPE_RITUAL, tp, false, true}) then return false end
function cm.tg2f1(rc, e, tp, mg, hg)
if fucf.Filter(rc, "~(IsTyp+IsRac+CanSp)", "RI+M,DR,(%1,RI)", e) then return false end
local lv = rc:GetLevel()
hg = hg:Filter(Card.IsCanBeRitualMaterial, rc, rc):Filter(rc.mat_filter or aux.TRUE, rc, tp)
if hg:CheckSubGroup(cm.tg2f2, 1, 1, tp, rc, lv) then return true end
mg = mg:Filter(Card.IsCanBeRitualMaterial, rc, rc):Filter(rc.mat_filter or aux.TRUE, rc, tp)
if fugf.Filter(mg,"IsTyp+IsRac+IsLoc","RI+M,DR,M"):CheckSubGroup(cm.tg2ff,1,1,tp,rc,rc:GetLevel()) then return true end
return fugf.Filter(mg,"IsLoc+IsPublic","H"):CheckSubGroup(cm.tg2ff,1,#mg,tp,rc,rc:GetLevel())
aux.GCheckAdditional = aux.RitualCheckAdditional(rc, lv, "Greater")
local res = mg:CheckSubGroup(cm.tg2f2, 1, math.min(#mg, lv), tp, rc, lv)
aux.GCheckAdditional = nil
return res
end
local function GetRM(e, tp)
local mg = Duel.GetRitualMaterial(tp)
local hg = fugf.Filter(mg, "IsLoc+IsPublic", "H")
mg = fugf.Filter(mg, "IsTyp+IsRac+IsLoc", "RI+M,DR,M")
return fugf.GetFilter(tp, "HG", cm.tg2f1, "%1,%2,%3,%4", nil, e, tp, mg, hg), mg + hg
end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return fugf.GetFilter(tp,"HG",cm.tg2f,{e,tp,Duel.GetRitualMaterial(tp)},1) end
if chk==0 then return #GetRM(e, tp)> 0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local mg = Duel.GetRitualMaterial(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local rc = fugf.Select(tp,"HG",aux.NecroValleyFilter(cm.tg2f),{e,tp,mg}):GetFirst()
if not rc then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mg = mg:Filter(Card.IsCanBeRitualMaterial, rc, rc):Filter(rc.mat_filter or aux.TRUE, rc, tp)
mg = fugf.Filter(mg,"IsTyp+IsRac+IsLoc","RI+M,DR,M") + fugf.Filter(mg,"IsLoc+IsPublic","H")
mg = mg:SelectSubGroup(tp,cm.tg2ff,false,1,#mg,tp,rc,rc:GetLevel())
rc:SetMaterial(mg)
Duel.ReleaseRitualMaterial(mg)
local rg, mg = GetRM(e, tp)
local rc, sg
repeat
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
rc = fugf.Select(tp, rg, "GChk"):GetFirst()
if not rc then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
sg = mg:Filter(Card.IsCanBeRitualMaterial, rc, rc):Filter(rc.mat_filter or aux.TRUE, rc, tp)
local lv = rc:GetLevel()
aux.GCheckAdditional = aux.RitualCheckAdditional(rc, lv, "Greater")
sg = sg:SelectSubGroup(tp, cm.tg2f2, true, 1, math.min(#sg, lv), tp, rc, lv)
aux.GCheckAdditional = nil
until sg
fu_GD.Hint(tp, m, sg, rc)
rc:SetMaterial(sg)
Duel.ReleaseRitualMaterial(sg)
Duel.BreakEffect()
Duel.SpecialSummon(rc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
rc:CompleteProcedure()
end
--e3
function cm.f3(e,tp,eg)
function cm.f3(tp, eg)
local mg = Group.CreateGroup()
for rc in aux.Next(fugf.Filter(eg,"IsSTyp+IsRac","RI,DR")) do
mg = mg + fugf.Filter(rc:GetMaterial(),"IsLoc+IsTyp+AbleTo","G,M,D")
end
return mg
end
cm.e3 = fuef.FTO("SP"):CAT("TD+DR+GA"):RAN("S"):CTL(1):Func("con3,N_tg1(%1),N_op1(%1)", cm.f3)
cm.e3 = fuef.FTO("SP"):Cat("TD+DR+GA"):Ran("S"):Ctl(1):Func("con3,Ptg(%1),Pop(%1)", cm.f3)
function cm.con3(e,tp,eg,ep,ev,re,r,rp)
return fugf.Filter(eg,"IsSTyp+IsRac","RI,DR",1)
end
\ No newline at end of file
--曜日之创导龙
dofile("expansions/script/c20000450.lua")
local cm, m = fu_GD.RM_initial()
cm.e1 = fuef.FTO("DR"):CAT("RE"):PRO("DE"):RAN("M"):CTL(1):Func("SelfDraw_con,tg1,op1")
local cm, m = fu_GD.RInitial()
cm.e1 = fuef.FTO("DR"):Cat("RE"):Pro("DE"):Ran("M"):Ctl(1):Func("SelfDraw_con,tg1,op1")
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
local g = fugf.Get(tp,"+MSG")
if chk==0 then return #g>0 end
local g = fugf.Get(tp, "+MSG")
if chk==0 then return #g > 0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g = fugf.Select(tp,"+MSG",nil,nil,1,ev)
if #g<=0 then return end
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
local g = fugf.Select(tp, "+MSG", "Gchk", nil, 1, ev)
Duel.Remove(g, POS_FACEUP, REASON_EFFECT)
end
\ No newline at end of file
--击星之创导龙
dofile("expansions/script/c20000450.lua")
local cm, m = fu_GD.RM_initial("glo")
cm.e1 = fuef.S(EFFECT_EXTRA_ATTACK):RAN("M"):VAL("val1")
cm.val1 = function(e) return cm.glo[e:GetHandlerPlayer() + 1] + 1 end
local cm, m = fu_GD.RInitial("glo")
cm.e1 = fuef.S(EFFECT_EXTRA_ATTACK):Ran("M"):Val("val1")
function cm.val1(e)
return cm.glo[e:GetHandlerPlayer() + 1] + 1
end
--ge1
cm.ge1 = fuef.FC("PHS+DP"):OP("glo_op1")("DR"):Func("SelfDraw_con,glo_op2")
cm.glo_op1 = function() cm.glo = {0, 0} end
cm.glo_op2 = function(e,tp,eg,ep,ev,re,r,rp) cm.glo[ep + 1] = cm.glo[ep + 1] + ev end
\ No newline at end of file
cm.ge1 = fuef.FC("PHS+DP"):Op("glo_op1")("DR"):Func("SelfDraw_con,glo_op2")
function cm.glo_op1()
cm.glo = {0, 0}
end
function cm.glo_op2(e,tp,eg,ep,ev,re,r,rp)
cm.glo[ep + 1] = cm.glo[ep + 1] + ev
end
\ No newline at end of file
--威天之创导龙
dofile("expansions/script/c20000450.lua")
local cm, m = fu_GD.RM_initial()
--e1
cm.e1 = fuef.FTO("DR"):PRO("DE+TG"):RAN("M"):CTL(1):Func("SelfDraw_con,tg1,op1")
local cm, m = fu_GD.RInitial()
cm.e1 = fuef.FTO("DR"):Pro("DE+TG"):Ran("M"):Ctl(1):Func("SelfDraw_con,tg1,op1")
function cm.tg1f(g)
return function(e,ep,tp)
return not g:IsContains(e:GetHandler())
end
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) end
if chk==0 then return fugf.GetFilter(tp,"+MS","TgChk",e,1) end
local g = fugf.GetFilter(tp, "+MS", "TgChk", e)
if chkc then return g:IsContains(chkc) end
if chk==0 then return #g > 0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g = fugf.SelectTg(tp,"+MS","TgChk",e,1,ev)
g = fugf.SelectTg(tp, g, 1, ev)
Duel.SetChainLimit(cm.tg1f(g))
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local tc = fusf.GetTarget(e)
if not tc then return end
local e1 = fuef.S(e,EFFECT_DISABLE,tc):Des(3):Pro("HINT"):Con("op1con1"):Res("STD")
e1(EFFECT_CANNOT_TRIGGER):Con("op1con2")
end
local e1g1 = fugf.MakeFilter("M", "IsTyp+IsRac+IsPos", "RI+M,DR,FU")
function cm.op1con1(e)
if not fugf.GetFilter(e:GetOwnerPlayer(),"M","IsTyp+IsRac+IsPos","RI+M,DR,FU",1) then return false end
if #e1g1(e:GetOwnerPlayer()) == 0 then return false end
local c = e:GetHandler()
if c:IsType(TYPE_TRAPMONSTER) then
return c:IsFaceup()
......@@ -27,10 +34,5 @@ function cm.op1con1(e)
end
end
function cm.op1con2(e)
return fugf.GetFilter(e:GetOwnerPlayer(),"M","IsTyp+IsRac+IsPos","RI+M,DR,FU",1)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local g = Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if #g==0 then return end
fuef.S(e,EFFECT_DISABLE,g):DES(1):PRO("HINT"):CON("op1con1"):RES("STD")(EFFECT_CANNOT_TRIGGER):CON("op1con2")
return #e1g1(e:GetOwnerPlayer()) > 0
end
\ No newline at end of file
--创导龙裔·研究者
dofile("expansions/script/c20000450.lua")
local cm, m = fuef.initial(fu_GD, _glo)
cm.e1 = fuef.STO("DR"):RAN("H"):PRO("DAM"):CTL(m):Func("con1,N_cos1,tg1,op1")
cm.e2 = fuef.QO():RAN("H"):PRO("TG"):CTL(m):Func("con2,tg2,op2")
local cm, m = fusf.Initial(fu_GD)
--e1
cm.e1 = fuef.STO("DR"):Ran("H"):Pro("DAM"):Ctl(m):Func("con1,Pcos,tg1,op1")
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return (r & REASON_EFFECT == REASON_EFFECT) and fucf.Filter(re:GetHandler(), "IsSet+IsTyp", "bfd4,M")
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
local te = re:GetHandler().public_effect
local te = re:GetHandler().public
if not te then return false end
te = te.e
local tg = te:GetTarget()
......@@ -21,18 +20,19 @@ function cm.op1(e,tp,eg,ep,ev,re,r,rp)
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
--e2
cm.e2 = fuef.QO():Ran("H"):Pro("TG"):Ctl(m):Func("con2,tg2,op2")
function cm.con2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPublic() and Duel.GetTurnPlayer() ~= tp
end
function cm.tg2tg1(e,c)
return not fusf.Creat_CF("IsSet+IsTyp","3fd4,RI+M")(c)
return not fucf.Filter(c, "IsSet+IsTyp", "3fd4,RI+M")
end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local e1 = fuef.F(e,EFFECT_CANNOT_SPECIAL_SUMMON,tp):PRO("PTG"):TRAN(1,0):TG("tg2tg1")
local e1 = fuef.F(e,EFFECT_CANNOT_SPECIAL_SUMMON,tp):Pro("PTG"):Tran(1,0):Tg("tg2tg1")
local g = fugf.GetFilter(tp,"G","IsTyp+CheckActivateEffect+TgChk",{"RI+S",{true,true,false},e})
e1.e:Reset()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and g:IsContains(chkc) end
if chk==0 then return #g > 0 end
if chkc then return g:IsContains(chkc) end
if chk == 0 then return #g > 0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
g = fugf.SelectTg(tp, g)
local te, ceg, cep, cev, cre, cr, crp = g:GetFirst():CheckActivateEffect(true,true,true)
......@@ -44,7 +44,7 @@ function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.ClearOperationInfo(0)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local e1 = fuef.F(e,EFFECT_CANNOT_SPECIAL_SUMMON,tp):PRO("PTG"):TRAN(1,0):TG("tg2tg1")
local e1 = fuef.F(e,EFFECT_CANNOT_SPECIAL_SUMMON,tp):Pro("PTG"):Tran(1,0):Tg("tg2tg1")
local te=e:GetLabelObject()
if te then
e:SetLabelObject(te:GetLabelObject())
......
--创导龙裔的咒引
dofile("expansions/script/c20000450.lua")
local cm, m = fuef.initial(fu_GD)
cm.e1 = fuef.A():CAT("TD+DR"):Func("tg1,op1")
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp) and fugf.GetFilter(tp,"H","AbleTo+Not",{"D",e},1) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
end
local cm, m = fusf.Initial(fu_GD)
cm.e1 = fuef.A():Cat("TD+DR"):Func("ReDraw_tg,op1")
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local ct = fu_GD.ReturnDeck(e, tp)
local ct = fu_GD.ToDeck(e, tp)
if ct == 0 then return end
Duel.BreakEffect()
fu_GD.DrawReturn(tp, ct)
end
\ No newline at end of file
--创导龙裔·构形者
dofile("expansions/script/c20000450.lua")
local func = fugf.GetNoP("DG", "IsCode", 464)
local pe = fuef.STO("DR"):RAN("H"):PRO("DAM"):CTL("m"):Func("p_con1,N_cos1,N_tg1(%1),N_op1(%1)", func)
local cm, m = fuef.initial(fu_GD, _glo, "public_effect", pe)
cm.e1 = fuef.FC("DR"):RAN("H"):Func("SelfDraw_con,N_op2")
--pe
function cm.p_con1(e,tp,eg,ep,ev,re,r,rp)
return (r & REASON_EFFECT == REASON_EFFECT) and fucf.Filter(re:GetHandler(), "IsSet+IsTyp", "bfd4,M")
end
\ No newline at end of file
local cm, m = fusf.Initial(fu_GD)
--insert
local e1g1 = fugf.MakeFilter("DG", "IsCode", 464)
local insert = function(c)
cm.public = fuef.STO(c,"DR"):Ran("H"):Pro("DAM"):Ctl(m):Func("Pcos,Ptg(%1),Pop(%1)",e1g1)
end
fusf.InsertInitial(insert)
--e1
cm.e1 = fuef.FC("DR"):Ran("H"):Func("SelfDraw_con,NPop1")
\ No newline at end of file
--创导龙裔·龙缠者
--龙缠之创导龙裔
dofile("expansions/script/c20000450.lua")
local cm, m = fuef.initial(fu_GD, nil, "AddCode,ReviveLimit", 464)
cm.e1 = fuef.E(EFFECT_UPDATE_ATTACK, false):VAL("val1")
cm.e2 = fuef.E(EFFECT_DESTROY_SUBSTITUTE, false):VAL("val2")
cm.e3 = fuef.FG("e1"):RAN("M"):TRAN("S"):TG("tg3")("e2")
cm.e4 = fuef.I():CAT("GA+EQ"):RAN("M"):CTL(1):Func("tg4,op4")
cm.e5 = fuef.QO("CH"):CAT("NEGA+RE"):RAN("M"):PRO("DAM+CAL"):CTL(m):Func("con5,nbtg,op5")
local cm, m = fusf.Initial(fu_GD)
fusf.AddCode(464)
fusf.ReviveLimit()
-- e1
cm.e1 = fuef.E(EFFECT_UPDATE_ATTACK, false):Val("val1")
function cm.val1(e, c)
return math.floor(e:GetHandler():GetAttack() / 2)
end
-- e2
cm.e2 = fuef.E(EFFECT_DESTROY_SUBSTITUTE, false):Val("val2")
function cm.val2(e,re,r,rp)
return r & (REASON_BATTLE|REASON_EFFECT) ~= 0
end
-- e3
cm.e3 = fuef.FG("e1"):Ran("M"):Tran("S"):Tg("tg3")("e2")
function cm.tg3(e, c)
return fugf.Filter(e:GetHandler():GetEquipGroup(), "IsRac","DR")
end
-- e4
cm.e4 = fuef.I():Cat("GA+EQ"):Ran("M"):Ctl(1):Func("tg4,op4")
local e4g1 = fugf.MakeFilter("DG", "IsTyp+IsRac+CanBeEq","RI+M,DR,(%1,%2)")
function cm.tg4(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return fugf.GetFilter(tp, "DG", "IsTyp+IsRac+CanEq","RI+M,DR,%1", 1, tp) end
if chk==0 then return #e4g1(tp, tp, e:GetHandler()) > 0 end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,1-tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.op4(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
if not (c:IsFaceup() and c:IsRelateToEffect(e)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local ec = fugf.Select(tp, "DG", "IsTyp+IsRac+CanEq+GChk","RI+M,DR,%1", 1, 1, tp):GetFirst()
local ec = fugf.Select(tp, e4g1(tp, tp, c), "GChk"):GetFirst()
fusf.Equip(e,tp,ec,c)
end
-- e5
cm.e5 = fuef.QO("CH"):Cat("NEGA+RE"):Ran("M"):Pro("DAM+CAL"):Ctl(m):Func("con5,nbtg,op5")
function cm.con5(e,tp,eg,ep,ev,re,r,rp)
local c, rc = e:GetHandler(), re:GetHandler()
return not c:IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and re:IsActiveType(TYPE_MONSTER) and c:IsAttackAbove(rc:GetAttack())
return not c:IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
and re:IsActiveType(TYPE_MONSTER) and c:IsAttackAbove(rc:GetAttack())
end
function cm.op5(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
end
end
-- e6
cm.e6 = fuef.SC("SP"):Func("RPcon1,RPop2")
\ No newline at end of file
--构龙之创导
dofile("expansions/script/c20000450.lua")
local cm, m = fuef.initial(fu_GD, nil, "AddCode", 463)
cm.e1 = fuef.A():CAT("REL+SP+EQ"):Func("tg1,op1")
cm.e2 = fuef.I():CAT("EQ"):RAN("G"):PRO("TG"):Func("bfgcost,tg2,op2")
local cm, m = fusf.Initial(fu_GD)
fusf.AddCode(463)
--e1
function cm.tg1f2(c, tp)
return fucf.Filter(c, "IsLoc+IsPublic", "H") and fugf.GetFilter(tp, "HG", "IsTyp+IsRac+CanEq+IsLv+Not", {"RI+M,DR", tp, -c:GetLevel(), c}, 1)
cm.e1 = fuef.A():Cat("REL+SP+EQ"):Func("tg1,op1")
function cm.tg1f2(c, tp, rc, eg)
return fugf.Filter(eg, "CanBeEq+IsLv+Not", {{tp, rc}, -c:GetLevel(), c}, 1)
end
function cm.tg1f(rc, e, tp, mg)
if not fucf.Filter(rc, "IsTyp+IsCode+CanSp", "RI+M,463", {e, "RI", tp}) then return false end
function cm.tg1f1(rc, e, tp, mg, eg)
if fucf.Filter(rc, "~(IsTyp+IsCode+CanSp)", "RI+M,463,(%1,RI)", e) then return false end
mg = mg:Filter(Card.IsCanBeRitualMaterial, rc, rc):Filter(rc.mat_filter or aux.TRUE, rc, tp)
return fugf.Filter(mg, cm.tg1f2, tp, 1)
return fugf.Filter(mg, cm.tg1f2, {tp, rc, eg}, 1)
end
local e1g1 = fugf.MakeFilter("D", cm.tg1f1, "%1,%2,%3,%4")
local function GetME(tp)
local mg = fugf.Filter(Duel.GetRitualMaterial(tp), "IsLoc+IsSet+IsPublic", "H,bfd4")
local eg = fugf.GetFilter(tp, "HG", "IsTyp+IsRac", "RI+M,DR")
return mg, eg
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return fugf.GetFilter(tp,"D",cm.tg1f,{e,tp,Duel.GetRitualMaterial(tp)},1) end
if chk==0 then return #e1g1(tp, e, tp, GetME(tp)) > 0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local mg = Duel.GetRitualMaterial(tp)
local mg, eg = GetME(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local rc = fugf.Select(tp,"D",cm.tg1f,{e,tp,mg}):GetFirst()
local rc = fugf.Select(tp, e1g1(tp, e, tp, mg, eg)):GetFirst()
if not rc then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mg = mg:Filter(Card.IsCanBeRitualMaterial, rc, rc):Filter(rc.mat_filter or aux.TRUE, rc, tp)
mg = fugf.Select(tp, mg, cm.tg1f2, tp)
mg = fugf.Select(tp, mg, cm.tg1f2, {tp, rc, eg})
fu_GD.Hint(tp, m, mg, rc)
rc:SetMaterial(mg)
Duel.ReleaseRitualMaterial(mg)
Duel.BreakEffect()
Duel.SpecialSummon(rc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
rc:CompleteProcedure()
local mc = mg:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
mc = fugf.Select(tp, "HG", "IsTyp+IsRac+CanEq+IsLv", {"RI+M,DR", tp, -mc:GetLevel()}):GetFirst()
fusf.Equip(e,tp,mc,rc)
local selfdescon = function(e) return e:GetHandler():GetEquipCount() == 0 end
fuef.S(e, EFFECT_SELF_DESTROY, rc):PRO("SR"):RAN("M"):CON(selfdescon):RES("STD")
eg = fugf.Select(tp, eg, "CanBeEq+IsLv", {{tp, rc}, -mg:GetFirst():GetLevel()}):GetFirst()
fusf.Equip(e, tp, eg, rc)
fuef.S(e, EFFECT_SELF_DESTROY, rc):Pro("IG+SR"):Ran("M"):Con(cm.op1con1):Res("STD")
end
function cm.op1con1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetEquipCount() == 0
end
--e2
cm.e2 = fuef.I():Cat("EQ"):Ran("G"):Pro("TG"):Func("bfgcost,tg2,op2")
function cm.tg2f1(c, e, g, tp)
if fucf.Filter(c,"~(IsPos+IsTyp+TgChk+IsAbleToChangeControler)","FU,EF,%1",e) then return false end
return fugf.Filter(g, "CanEq", {c, tp}, 1)
end
local e2g2 = fugf.MakeFilter("M", "IsPos+IsCode", "FU,463")
local e2g1 = fugf.MakeFilter("+M", cm.tg2f1, "%1,%2,%3")
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g = fugf.GetFilter(tp,"+M","IsPos+IsTyp+TgChk+IsAbleToChangeControler","FU,EF,%1",nil,e)
local g = e2g1(tp, e, e2g2(tp), tp)
if chkc then return g:IsContains(chkc) end
if chk==0 then return #g>0 and fugf.GetFilter(tp,"M","IsPos+IsCode+CanEq","FU,463,%1",nil,tp) end
if chk==0 then return #g > 0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
g = fugf.SelectTg(tp,g)
g = fugf.SelectTg(tp, g)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local ec = Duel.GetFirstTarget()
local ec = fusf.GetTarget(e, "FU")
if not ec or ec:IsControler(tp) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
if not (ec and ec:IsFaceup() and ec:IsRelateToEffect(e) and ec:IsControler(1-tp)) then return end
local c = fugf.GetFilter(tp,"M","IsPos+IsCode+CanEq","FU,463,%1",nil,tp):GetFirst()
fusf.Equip(e,tp,ec,c)
local c = fugf.Select(tp, e2g2(tp), "CanEq", {ec, tp}):GetFirst()
fusf.Equip(e, tp, ec, c)
end
\ No newline at end of file
--创导龙裔的再构
dofile("expansions/script/c20000450.lua")
local cm, m = fuef.initial(fu_GD)
cm.e1 = fuef.A("LEA"):CAT("SP+RE"):PRO("DE"):Func("DRM_leave_con,tg1,op1")
cm.e2 = fuef.QO():CAT("TD+DR"):RAN("G"):Func("bfgcost,CanReturnDraw_tg,op2")
local cm, m = fusf.Initial(fu_GD)
--e1
function cm.tg1f1(g,tp,c,lv)
cm.e1 = fuef.A("LEA"):Cat("SP+RE"):Pro("DE"):Func("DRM_leave_con,tg1,op1")
function cm.tg1f2(g, tp, c, lv)
Duel.SetSelectedCard(g)
return g:CheckWithSumGreater(Card.GetRitualLevel,lv,c) and Duel.GetMZoneCount(tp,nil,tp)>0
and (not c.mat_group_check or c.mat_group_check(g,tp))
return g:CheckWithSumGreater(Card.GetRitualLevel, lv, c) and (c.mat_group_check or aux.TRUE)(g, tp)
end
function cm.tg1f(rc,e,tp,mg)
if not fucf.Filter(rc,"IsTyp+IsRac+IsPLoc+CanSp","RI+M,DR,M",{e,"RI",tp}) then return false end
function cm.tg1f1(rc, e, tp, mg)
if fucf.Filter(rc, "~(IsTyp+IsRac+CanSp)", "RI+M,DR,(%1,RI)", e) then return false end
mg = mg:Filter(rc.mat_filter or aux.TRUE, rc, tp)
return mg:CheckSubGroup(cm.tg1f1,1,#mg,tp,rc,rc:GetLevel())
local lv = rc:GetLevel()
aux.GCheckAdditional = aux.RitualCheckAdditional(rc, lv, "Greater")
local res = mg:CheckSubGroup(cm.tg1f2, 1, math.min(#mg, lv), tp, rc, lv)
aux.GCheckAdditional = nil
return res
end
local e1g1 = fugf.MakeFilter("G", "IsSet+IsLv+IsTyp+AbleTo", "bfd4,+1,M,R")
local e1f1 = fugf.MakeGroupFilter(cm.tg1f1, "%1,%2,%3")
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
local mg = fugf.GetFilter(tp,"G","IsSet+IsLv+IsTyp+AbleTo","bfd4,+1,M,R")
if chk==0 then return fugf.Filter(eg,cm.tg1f,{e,tp,mg},1) end
if chk==0 then return e1f1(eg, 1, e, tp, e1g1(tp)) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local mg = fugf.GetFilter(tp,"G","IsSet+IsLv+IsTyp+AbleTo+GChk","bfd4,+1,M,R")
local rc = fugf.Filter(eg,aux.NecroValleyFilter(cm.tg1f),{e,tp,mg})
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
if #rc > 1 then rc = fugf.Select(tp,rc) end
rc = rc:GetFirst()
if not rc then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
mg = mg:Filter(rc.mat_filter or aux.TRUE, rc, tp)
mg = mg:SelectSubGroup(tp,cm.tg1f1,false,1,#mg,tp,rc,rc:GetLevel())
rc:SetMaterial(mg)
Duel.ReleaseRitualMaterial(mg)
local mg = e1g1(tp)
local rg = e1f1(eg, nil, e, tp, mg)
local rc, sg
repeat
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
rc = fugf.Select(tp, rg, "GChk"):GetFirst()
if not rc then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
sg = mg:Filter(rc.mat_filter or aux.TRUE, rc, tp)
local lv = rc:GetLevel()
aux.GCheckAdditional = aux.RitualCheckAdditional(rc, lv, "Greater")
sg = sg:SelectSubGroup(tp, cm.tg1f2, true, 1, math.min(#sg, lv), tp, rc, lv)
aux.GCheckAdditional = nil
until sg
Duel.Hint(24, tp, aux.Stringid(m, 0))
Duel.Hint(24, tp, aux.Stringid(m, 1))
rc:SetMaterial(sg)
Duel.ReleaseRitualMaterial(sg)
Duel.BreakEffect()
Duel.SpecialSummon(rc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
rc:CompleteProcedure()
fu_GD.Hint(tp, m, sg, rc)
end
--e2
cm.e2 = fuef.QO():Cat("TD+DR"):Ran("G"):Func("bfgcost,ReDraw_tg,op2")
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK)
local ct = Duel.SendtoDeck(fugf.Select(tp, "H", "AbleTo", "D", 1, 99), nil, 2, REASON_EFFECT)
if ct == 0 then return end
fu_GD.DrawReturn(tp, ct)
end
end
\ No newline at end of file
......@@ -13,10 +13,7 @@ dofile("expansions/script/c20099998.lua")
function fugf.MakeGroupFilter(f, v)
return function(g, n, ...)
fusf.CheckArgType("MakeGroupFilter", 1, g, "Group")
local ok, res = pcall(fusf.CheckArgType,"MakeGroupFilter", 2, n, "nil/number")
if not ok then
error(res, 2)
end
fusf.CheckArgType("MakeGroupFilter", 2, n, "nil/number")
g = g:Filter(fucf.MakeCardFilter(f, v, ...), nil)
if not n then return g end
return n > 0 and #g >= n or #g <= -n
......@@ -163,7 +160,7 @@ function fucf.MakeCardFilter(func, args, ...)
}
local temp = Cal[func]
if temp == nil then
error("invalid operators : " .. func)
error(string.format("invalid operators : '%s'", func))
end
stack[#stack + 1] = temp
else
......@@ -174,7 +171,7 @@ function fucf.MakeCardFilter(func, args, ...)
local arg = arg_table[arg_ind]
arg_ind = arg_ind + 1
if type(arg) ~= "table" then arg = { arg, n = 1 } end
stack[#stack + 1] = func(c, table.unpack(arg, 1, arg.n))
stack[#stack + 1] = func(c, table.unpack(arg, 1, arg.n)) or false
end
end
return table.remove(stack)
......@@ -368,7 +365,7 @@ function fucf.CanBeEq(c, tp, ec, chk_loc)
elseif c:IsType(TYPE_EQUIP) then
return c:CheckEquipTarget(ec)
end
error("CanBeEq : mismatch card type", 2)
return false
end
--- 检查卡片 c 的种类为 cod 的标识效果的数量比较 n 的结果
-- @param c Card 要检查的卡片
......
......@@ -883,22 +883,22 @@ function fusf.Equip(e, tp, eg, c)
eg = fusf.ToGroup(eg)
if Duel.GetLocationCount(tp, LOCATION_SZONE) < #eg then return false end
c = fusf.CheckArgType("Equip", 4, c or e:GetHandler(), "Card")
local _, c = fusf.CheckArgType("Equip", 4, c or e:GetHandler(), "Card")
if c:IsFacedown() then return false end
local limit = function(e, c) return c == e:GetLabelObject() end
if typ == "Card" then
local ec = eg:GetFirst()
if not Duel.Equip(tp, ec, c) then return false end
if ec:IsType(TYPE_MONSTER) then
fuef.S(e, EFFECT_EQUIP_LIMIT, ec):PRO("CD"):VAL(limit):OBJ(c):RES("STD")
if fucf.IsOTyp(ec, "M") then
fuef.S(e, EFFECT_EQUIP_LIMIT, ec):Pro("CD"):Val(limit):Obj(c):Res("STD")
end
return true
end
for ec in aux.Next(eg) do
Duel.Equip(tp, ec, c, true, true)
if ec:IsType(TYPE_MONSTER) then
fuef.S(e, EFFECT_EQUIP_LIMIT, ec):PRO("CD"):VAL(limit):OBJ(c):RES("STD")
if fucf.IsOTyp(ec, "M") then
fuef.S(e, EFFECT_EQUIP_LIMIT, ec):Pro("CD"):Val(limit):Obj(c):Res("STD")
end
end
Duel.EquipComplete()
......
......@@ -5,7 +5,7 @@ function s.initial_effect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_HAND)
e3:SetCountLimit(1,id+o)
e3:SetCountLimit(1,id+10086)
e3:SetCondition(s.spcon)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
......
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