Commit 134aee54 authored by jwyxym's avatar jwyxym Committed by GitHub

Add files via upload

parent d7650427
...@@ -380,33 +380,24 @@ end ...@@ -380,33 +380,24 @@ end
---@param g Card|Group 要被上升攻击力的卡 ---@param g Card|Group 要被上升攻击力的卡
---@param val integer 要上升的攻击力(可以为负) ---@param val integer 要上升的攻击力(可以为负)
---@param reset integer|nil 指示重置的时点,默认为“回合结束时”。无论如何,都会在离场时重置。 ---@param reset integer|nil 指示重置的时点,默认为“回合结束时”。无论如何,都会在离场时重置。
function VgF.AtkUp(c,g,val,reset,resetcount,resettype,resetcode) function VgF.AtkUp(c,g,val,reset,resetcount)
if not c then return end if not c then return end
if not reset then reset=RESET_PHASE+PHASE_END end
if not resetcount then resetcount=1 end if not resetcount then resetcount=1 end
if not resettype then resettype=EFFECT_TYPE_FIELD end if not reset then reset=RESET_PHASE+PHASE_END end
if not val or val==0 then return end if not val or val==0 then return end
if VgF.GetValueType(g)=="Group" and g:GetCount()>0 then if VgF.GetValueType(g)=="Group" and g:GetCount()>0 then
local e={}
for tc in VgF.Next(g) do for tc in VgF.Next(g) do
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(val) e1:SetValue(val)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset,resetcount) e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset,resetcount)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
if resetcode then table.insert(e,e1)
local e2=Effect.CreateEffect(c)
e2:SetType(resettype+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(resetcode)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetOperation(function (te)
e1:Reset()
te:Reset()
end)
tc:RegisterEffect(e2)
end
end end
return e
elseif VgF.GetValueType(g)=="Card" then elseif VgF.GetValueType(g)=="Card" then
local tc=VgF.ReturnCard(g) local tc=VgF.ReturnCard(g)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -415,18 +406,7 @@ function VgF.AtkUp(c,g,val,reset,resetcount,resettype,resetcode) ...@@ -415,18 +406,7 @@ function VgF.AtkUp(c,g,val,reset,resetcount,resettype,resetcode)
e1:SetValue(val) e1:SetValue(val)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset,resetcount) e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset,resetcount)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
if resetcode>0 then return e1
local e2=Effect.CreateEffect(c)
e2:SetType(resettype+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(resetcode)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetOperation(function (te)
e1:Reset()
te:Reset()
end)
tc:RegisterEffect(e2)
end
end end
end end
---以c的名义,使g(中的每一张卡)的盾值上升val,并在reset时重置。 ---以c的名义,使g(中的每一张卡)的盾值上升val,并在reset时重置。
...@@ -434,13 +414,13 @@ end ...@@ -434,13 +414,13 @@ end
---@param g Card|Group 要被上升盾值的卡 ---@param g Card|Group 要被上升盾值的卡
---@param val integer 要上升的盾值(可以为负) ---@param val integer 要上升的盾值(可以为负)
---@param reset integer|nil 指示重置的时点,默认为“回合结束时”。无论如何,都会在离场时重置。 ---@param reset integer|nil 指示重置的时点,默认为“回合结束时”。无论如何,都会在离场时重置。
function VgF.DefUp(c,g,val,reset,resetcount,resettype,resetcode) function VgF.DefUp(c,g,val,reset,resetcount)
if not c then return end if not c then return end
if not reset then reset=RESET_PHASE+PHASE_END end if not reset then reset=RESET_PHASE+PHASE_END end
if not resetcount then resetcount=1 end if not resetcount then resetcount=1 end
if not resettype then resettype=EFFECT_TYPE_FIELD end
if not val or val==0 then return end if not val or val==0 then return end
if VgF.GetValueType(g)=="Group" and g:GetCount()>0 then if VgF.GetValueType(g)=="Group" and g:GetCount()>0 then
local e={}
for tc in VgF.Next(g) do for tc in VgF.Next(g) do
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
...@@ -448,19 +428,9 @@ function VgF.DefUp(c,g,val,reset,resetcount,resettype,resetcode) ...@@ -448,19 +428,9 @@ function VgF.DefUp(c,g,val,reset,resetcount,resettype,resetcode)
e1:SetValue(val) e1:SetValue(val)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset,resetcount) e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset,resetcount)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
if resetcode>0 then table.insert(e,e1)
local e2=Effect.CreateEffect(c)
e2:SetType(resettype+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(resetcode)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetOperation(function (te)
e1:Reset()
te:Reset()
end)
tc:RegisterEffect(e2)
end
end end
return e
elseif VgF.GetValueType(g)=="Card" then elseif VgF.GetValueType(g)=="Card" then
local tc=VgF.ReturnCard(g) local tc=VgF.ReturnCard(g)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -469,18 +439,7 @@ function VgF.DefUp(c,g,val,reset,resetcount,resettype,resetcode) ...@@ -469,18 +439,7 @@ function VgF.DefUp(c,g,val,reset,resetcount,resettype,resetcode)
e1:SetValue(val) e1:SetValue(val)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset,resetcount) e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset,resetcount)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
if resetcode>0 then return e1
local e2=Effect.CreateEffect(c)
e2:SetType(resettype+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(resetcode)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetOperation(function (te)
e1:Reset()
te:Reset()
end)
tc:RegisterEffect(e2)
end
end end
end end
---以c的名义,使g(中的每一张卡)的☆上升val,并在reset时重置。 ---以c的名义,使g(中的每一张卡)的☆上升val,并在reset时重置。
...@@ -488,13 +447,14 @@ end ...@@ -488,13 +447,14 @@ end
---@param g Card|Group 要被上升☆的卡 ---@param g Card|Group 要被上升☆的卡
---@param val integer 要上升的☆(可以为负) ---@param val integer 要上升的☆(可以为负)
---@param reset integer|nil 指示重置的时点,默认为“回合结束时”。无论如何,都会在离场时重置。 ---@param reset integer|nil 指示重置的时点,默认为“回合结束时”。无论如何,都会在离场时重置。
function VgF.StarUp(c,g,val,reset,resetcount,resettype,resetcode) function VgF.StarUp(c,g,val,reset,resetcount)
if not c or not g then return end if not c or not g then return end
if not reset then reset=RESET_PHASE+PHASE_END end if not reset then reset=RESET_PHASE+PHASE_END end
if not resetcount then resetcount=1 end if not resetcount then resetcount=1 end
if not resettype then resettype=EFFECT_TYPE_FIELD end
if not val or val==0 then return end if not val or val==0 then return end
if VgF.GetValueType(g)=="Group" and g:GetCount()>0 then if VgF.GetValueType(g)=="Group" and g:GetCount()>0 then
local t1={}
local t2={}
for tc in VgF.Next(g) do for tc in VgF.Next(g) do
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
...@@ -507,25 +467,10 @@ function VgF.StarUp(c,g,val,reset,resetcount,resettype,resetcode) ...@@ -507,25 +467,10 @@ function VgF.StarUp(c,g,val,reset,resetcount,resettype,resetcode)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_RSCALE) e2:SetCode(EFFECT_UPDATE_RSCALE)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
if resetcode>0 then table.insert(t1,e1)
local e3=Effect.CreateEffect(c) table.insert(t2,e2)
e3:SetType(resettype+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(resetcode)
e3:SetRange(LOCATION_MZONE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
e3:SetOperation(function (te)
e1:Reset()
te:Reset()
end)
tc:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetOperation(function (te)
e2:Reset()
te:Reset()
end)
tc:RegisterEffect(e4)
end
end end
return t1,t2
elseif VgF.GetValueType(g)=="Card" then elseif VgF.GetValueType(g)=="Card" then
local tc=VgF.ReturnCard(g) local tc=VgF.ReturnCard(g)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -539,24 +484,7 @@ function VgF.StarUp(c,g,val,reset,resetcount,resettype,resetcode) ...@@ -539,24 +484,7 @@ function VgF.StarUp(c,g,val,reset,resetcount,resettype,resetcode)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_RSCALE) e2:SetCode(EFFECT_UPDATE_RSCALE)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
if resetcode>0 then return e1,e2
local e3=Effect.CreateEffect(c)
e3:SetType(resettype+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(resetcode)
e3:SetRange(LOCATION_MZONE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
e3:SetOperation(function (te)
e1:Reset()
te:Reset()
end)
tc:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetOperation(function (te)
e2:Reset()
te:Reset()
end)
tc:RegisterEffect(e4)
end
end end
end end
---判断c是否可以以规则的手段到G区域。 ---判断c是否可以以规则的手段到G区域。
...@@ -619,11 +547,9 @@ end ...@@ -619,11 +547,9 @@ end
---@param num integer 灵魂爆发的数量 ---@param num integer 灵魂爆发的数量
---@return function 效果的Cost函数 ---@return function 效果的Cost函数
function VgF.OverlayCost(num) function VgF.OverlayCost(num)
function VgF.EnergyCost(num)
return function (e,tp,eg,ep,ev,re,r,rp,chk) return function (e,tp,eg,ep,ev,re,r,rp,chk)
return VgF.OverlayCostOp(num,e,tp,eg,ep,ev,re,r,rp,chk) return VgF.OverlayCostOp(num,e,tp,eg,ep,ev,re,r,rp,chk)
end end
end
end end
function VgF.OverlayCostOp(num,e,tp,eg,ep,ev,re,r,rp,chk) function VgF.OverlayCostOp(num,e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -818,6 +744,7 @@ function VgF.CheckPrison(p) ...@@ -818,6 +744,7 @@ function VgF.CheckPrison(p)
end end
--重置Effect --重置Effect
function VgF.EffectReset(c,e,code,con) function VgF.EffectReset(c,e,code,con)
if VgF.GetValueType(e)=="Effect" then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(code) e1:SetCode(code)
...@@ -827,8 +754,22 @@ function VgF.EffectReset(c,e,code,con) ...@@ -827,8 +754,22 @@ function VgF.EffectReset(c,e,code,con)
if VgF.GetValueType(con)=="function" then e1:SetCondition(con) end if VgF.GetValueType(con)=="function" then e1:SetCondition(con) end
e1:SetOperation(VgF.EffectResetOperation) e1:SetOperation(VgF.EffectResetOperation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
elseif VgF.GetValueType(e)=="table" then
for i,v in ipairs(e) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(code)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_ALL)
e1:SetLabelObject(v)
if VgF.GetValueType(con)=="function" then e1:SetCondition(con) end
e1:SetOperation(VgF.EffectResetOperation)
c:RegisterEffect(e1)
end
end
end end
function VgF.EffectResetOperation(e,tp,eg,ep,ev,re,r,rp) function VgF.EffectResetOperation(e,tp,eg,ep,ev,re,r,rp)
local e1=e:GetLabelObject() local e1=e:GetLabelObject()
if VgF.GetValueType(e1)=="Effect" then e1:Reset() end if VgF.GetValueType(e1)=="Effect" then e1:Reset() end
e:Reset()
end end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment