Commit 504dfc05 authored by GuGu's avatar GuGu

Update nef.lua

parent 64ef0c3e
Pipeline #35014 passed with stage
in 15 seconds
...@@ -366,7 +366,7 @@ function Nef.GetPendSPInfo(c) ...@@ -366,7 +366,7 @@ function Nef.GetPendSPInfo(c)
local pnum = type(mt.pend_num) == "number" and mt.pend_num or mt.pend_num(c) local pnum = type(mt.pend_num) == "number" and mt.pend_num or mt.pend_num(c)
pend_num = math.min(pend_num, pnum) pend_num = math.min(pend_num, pnum)
end end
if mt.pend_filter then if mt.pend_filter then
local f1=pend_filter local f1=pend_filter
local arg=mt.pend_arg or {1} local arg=mt.pend_arg or {1}
local f2_ori=mt.pend_filter local f2_ori=mt.pend_filter
...@@ -1076,7 +1076,7 @@ if not Nef.SeedField then ...@@ -1076,7 +1076,7 @@ if not Nef.SeedField then
end end
--[[ --[[
tp 种子持有者 tp 种子持有者
zone 目标区域 zone 目标区域
]] ]]
function class.addSeed(e, tp, zoneTP) function class.addSeed(e, tp, zoneTP)
...@@ -1111,9 +1111,9 @@ if not Nef.SeedField then ...@@ -1111,9 +1111,9 @@ if not Nef.SeedField then
end end
--[[ --[[
tp 种子持有者 tp 种子持有者
p seq的玩家 p seq的玩家
seq 相对玩家p目标区域序号 seq 相对玩家p目标区域序号
]] ]]
function class.addSeedWithSeq(e, tp, p, seq) function class.addSeedWithSeq(e, tp, p, seq)
local fix = p == tp and 0 or 16 local fix = p == tp and 0 or 16
...@@ -1359,7 +1359,7 @@ if not Nef.PLCounter then ...@@ -1359,7 +1359,7 @@ if not Nef.PLCounter then
local count = (class._n[tp][code] or 0) + num local count = (class._n[tp][code] or 0) + num
--椿季赛特供椿天场地 --椿季赛特供椿天场地
--if code==999104 then count=1 end --if code==999104 then count=1 end
class._e[tp][code] = e1 class._e[tp][code] = e1
...@@ -1369,6 +1369,46 @@ if not Nef.PLCounter then ...@@ -1369,6 +1369,46 @@ if not Nef.PLCounter then
--eg1:SetLabelObject(e1) --eg1:SetLabelObject(e1)
Duel.RegisterEffect(e1, tp) Duel.RegisterEffect(e1, tp)
end end
function class.AddWithPhaseReset(tp,code,num,phase,resetnum,resetcount,resettp,othercon)
class.Add(tp,code,num)
if phase==nil then return end
if resetnum==nil then resetnum=(class._n[tp][code] or 0) end
if resetcount==nil then resetcount=0 end
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+phase)
e1:SetCountLimit(1)
if resettp==nil then
e1:SetLabel(Duel.GetTurnCount())
else
e1:SetLabel(Duel.GetTurnCount(resettp))
end
if othercon==nil then
e1:SetCondition(class.resetcon(code,resetnum,resetcount,resettp))
else
e1:SetCondition(othercon)
end
e1:SetOperation(class.resetop(code,resetnum))
Duel.RegisterEffect(e1,tp)
end
function class.resetcon(code,resetnum,resetcount,resettp)
return function(e,tp,eg,ep,ev,re,r,rp)
if resettp==nil then
return Duel.GetTurnCount()>=e:GetLabel()+resetcount
else
return Duel.GetTurnCount(resettp)>=e:GetLabel()+resetcount and Duel.GetTurnPlayer()==resettp
end
end
end
function class.resetop(code,resetnum)
return function(e,tp,eg,ep,ev,re,r,rp)
local num=class.Get(tp,code)
class.Add(tp,code,resetnum-num)
e:Reset()
end
end
function class.Get(tp, code) function class.Get(tp, code)
return class._n[tp][code] or 0 return class._n[tp][code] or 0
......
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