Commit 87cc50a2 authored by Nemo Ma's avatar Nemo Ma

fix

parent dbdc8b0e
...@@ -74,9 +74,9 @@ fuef.FTF = fuef.Act(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F,"") ...@@ -74,9 +74,9 @@ fuef.FTF = fuef.Act(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F,"")
fuef.STO = fuef.Act(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O,"RAN") fuef.STO = fuef.Act(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O,"RAN")
fuef.STF = fuef.Act(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F,"RAN") fuef.STF = fuef.Act(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F,"RAN")
fuef.S = fuef.NoAct(EFFECT_TYPE_SINGLE,"TRAN,TG") fuef.S = fuef.NoAct(EFFECT_TYPE_SINGLE,"TRAN,TG")
fuef.SC = fuef.NoAct(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS,"RAN,TRAN,VAL,TG") fuef.SC = fuef.NoAct(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS,"TRAN,VAL,TG")
fuef.F = fuef.NoAct(EFFECT_TYPE_FIELD,"") fuef.F = fuef.NoAct(EFFECT_TYPE_FIELD,"")
fuef.FC = fuef.NoAct(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS,"TRAN,VAL,TG") fuef.FC = fuef.NoAct(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS,"TRAN,VAL,TG")
fuef.FG = fuef.NoAct(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT,"COD,PRO,VAL,CTL,TG,OP") fuef.FG = fuef.NoAct(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT,"DES,COD,PRO,VAL,CTL,OP")
fuef.E = fuef.NoAct(EFFECT_TYPE_EQUIP,"DES,RAN,TRAN,CTL,TG,OP") fuef.E = fuef.NoAct(EFFECT_TYPE_EQUIP,"DES,RAN,TRAN,CTL,TG,OP")
fuef.EC = fuef.NoAct(EFFECT_TYPE_EQUIP+EFFECT_TYPE_CONTINUOUS,"DES,PRO,RAN,TRAN,VAL,CTL") fuef.EC = fuef.NoAct(EFFECT_TYPE_EQUIP+EFFECT_TYPE_CONTINUOUS,"DES,PRO,RAN,TRAN,VAL,CTL")
\ No newline at end of file
if fucg then return end if fucg then return end
fucg, fusf = { }, { } fucg, fusf = { }, { }
--------------------------------------"Support function" --------------------------------------"Support function"
function fusf.CutString(str,cut) function fusf.CutString(str,cut,from)
str = str..cut str = str..cut
local list, index, ch = {}, 1, "" local list, index, ch = {}, 1, ""
while index <= #str do while index <= #str do
...@@ -28,9 +28,9 @@ function fusf.DeleteNil(list) ...@@ -28,9 +28,9 @@ function fusf.DeleteNil(list)
end end
return setlist return setlist
end end
function fusf.Loc(locs,chk) function fusf.Loc(locs,chk,from)
local Loc = {0,0} local Loc = {0,0}
for i,l1 in ipairs(fusf.CutString(locs,"+")) do for i,l1 in ipairs(fusf.CutString(locs,"+","fusf.Loc")) do
for j = 1,#l1 do for j = 1,#l1 do
local loc = string.sub(l1,j,j) local loc = string.sub(l1,j,j)
Loc[i] = Loc[i] + fucg.ran[string.upper(loc)] Loc[i] = Loc[i] + fucg.ran[string.upper(loc)]
...@@ -55,7 +55,7 @@ end ...@@ -55,7 +55,7 @@ end
function fusf.Func(func) function fusf.Func(func)
return function(e,val) return function(e,val)
if not (fusf.NotNil(val) and func) then return end if not (fusf.NotNil(val) and func) then return end
if type(val) == "string" then val = (string.match(val,"%d") and tonumber(val)) or aux["val"] or val end if type(val) == "string" then val = (string.match(val,"%d") and tonumber(val)) or aux[val] or val end
Effect["Set"..func](e,val) Effect["Set"..func](e,val)
end end
end end
...@@ -107,9 +107,9 @@ function fusf.PostFix_Trans(str,val) ...@@ -107,9 +107,9 @@ function fusf.PostFix_Trans(str,val)
return tTrans return tTrans
end end
function fusf.CutDis(str,dis) function fusf.CutDis(str,dis)
if Dis == "" then return fusf.CutString(str,",") end if Dis == "" then return fusf.CutString(str,",","CutDis1") end
local ch, Dis = "", fusf.CutString(dis,",") local ch, Dis = "", fusf.CutString(dis,",","CutDis2")
for _,S in ipairs(fusf.CutString(str,",")) do for _,S in ipairs(fusf.CutString(str,",","CutDis3")) do
for i,D in ipairs(Dis) do for i,D in ipairs(Dis) do
if S == D then if S == D then
table.remove(Dis,i) table.remove(Dis,i)
...@@ -118,14 +118,14 @@ function fusf.CutDis(str,dis) ...@@ -118,14 +118,14 @@ function fusf.CutDis(str,dis)
end end
if S ~= "" then ch = ch..","..S end if S ~= "" then ch = ch..","..S end
end end
return fusf.CutString(string.sub(ch,2),",") return fusf.CutString(string.sub(ch,2),",","CutDis4")
end end
function fusf.Value_Trans(val) function fusf.Value_Trans(val)
val = type(val) == "table" and val or { val } val = type(val) == "table" and val or { val }
local var = {} local var = {}
for i,V in ipairs(val) do for i,V in ipairs(val) do
if type(V) == "string" then if type(V) == "string" then
for _,ch in ipairs(fusf.CutString(V,",")) do for _,ch in ipairs(fusf.CutString(V,",","Value_Trans")) do
if ch == "%" then if ch == "%" then
ch = table.remove(val, i + 1) ch = table.remove(val, i + 1)
elseif ch == "" then elseif ch == "" then
...@@ -432,7 +432,6 @@ fucg.eff = { ...@@ -432,7 +432,6 @@ fucg.eff = {
OP = fusf.Func("Operation"), OP = fusf.Func("Operation"),
RES = function(e,...) if #{...}>0 then Effect.SetReset(e,fusf.res({...})) end end, RES = function(e,...) if #{...}>0 then Effect.SetReset(e,fusf.res({...})) end end,
LAB = Effect.SetLabel, LAB = Effect.SetLabel,
OBJ = Effect.SetLabelObject,
} }
function fucg.eff.DES(e,val) function fucg.eff.DES(e,val)
if not fusf.NotNil(val) then return end if not fusf.NotNil(val) then return end
...@@ -449,7 +448,7 @@ function fucg.eff.CAT(e,val) ...@@ -449,7 +448,7 @@ function fucg.eff.CAT(e,val)
if not fusf.NotNil(val) then return end if not fusf.NotNil(val) then return end
local cat = type(val) == "string" and 0 or val local cat = type(val) == "string" and 0 or val
if type(val) == "string" then if type(val) == "string" then
for _,V in ipairs(fusf.CutString(val,"+")) do for _,V in ipairs(fusf.CutString(val,"+","CAT")) do
cat = cat + fucg.cat[string.upper(V)] cat = cat + fucg.cat[string.upper(V)]
end end
end end
...@@ -463,7 +462,7 @@ function fucg.eff.PRO(e,val) ...@@ -463,7 +462,7 @@ function fucg.eff.PRO(e,val)
if not fusf.NotNil(val) then return end if not fusf.NotNil(val) then return end
local pro = type(val) == "string" and 0 or val local pro = type(val) == "string" and 0 or val
if type(val) == "string" then if type(val) == "string" then
for _,V in ipairs(fusf.CutString(val,"+")) do for _,V in ipairs(fusf.CutString(val,"+","PRO")) do
pro = pro + fucg.pro[string.upper(V)] pro = pro + fucg.pro[string.upper(V)]
end end
end end
...@@ -473,7 +472,7 @@ function fucg.eff.CTL(e,val) ...@@ -473,7 +472,7 @@ function fucg.eff.CTL(e,val)
if not fusf.NotNil(val) then return end if not fusf.NotNil(val) then return end
local ctl = {nil,nil,0} local ctl = {nil,nil,0}
if type(val) == "string" then if type(val) == "string" then
for _,v in ipairs(fusf.CutString(val,"+")) do for _,v in ipairs(fusf.CutString(val,"+","CTL")) do
ctl[3] = string.match(v,"[ODS]") and fucg.ctl[v] or ctl[3] ctl[3] = string.match(v,"[ODS]") and fucg.ctl[v] or ctl[3]
ctl[2] = string.match(v,"m") and e:GetOwner():GetOriginalCode() or ctl[2] ctl[2] = string.match(v,"m") and e:GetOwner():GetOriginalCode() or ctl[2]
ctl[1] = string.match(v,"%d") and tonumber(v) or ctl[1] ctl[1] = string.match(v,"%d") and tonumber(v) or ctl[1]
...@@ -487,17 +486,22 @@ function fucg.eff.CTL(e,val) ...@@ -487,17 +486,22 @@ function fucg.eff.CTL(e,val)
end end
end end
if ctl[3] ~= 0 and not ctl[2] then ctl[2] = e:GetOwner():GetOriginalCode() end if ctl[3] ~= 0 and not ctl[2] then ctl[2] = e:GetOwner():GetOriginalCode() end
ctl[2] = ctl[2] + table.remove(ctl) ctl[2] = (ctl[2] or 0) + table.remove(ctl)
ctl[1] = ctl[1] or 1 ctl[1] = ctl[1] or 1
e:SetCountLimit(table.unpack(ctl)) e:SetCountLimit(table.unpack(ctl))
end end
function fucg.eff.RAN(e,val) function fucg.eff.RAN(e,val)
if not fusf.NotNil(val) then return end if not fusf.NotNil(val) then return end
e:SetRange(fusf.Loc(val)) e:SetRange(fusf.Loc(val,nil,"RAN"))
end end
function fucg.eff.TRAN(e,val) function fucg.eff.TRAN(e,val)
if not fusf.NotNil(val) then return end if not fusf.NotNil(val) then return end
e:SetTargetRange(fusf.Loc(val)) e:SetTargetRange(fusf.Loc(val,nil,"TRAN"))
end
function fucg.eff.OBJ(e,val)
if not fusf.NotNil(val) then return end
if type(val) == "table" then val = val[1] end
e:SetLabelObject(val)
end end
function fucg.eff.CLO(e) function fucg.eff.CLO(e)
if not fusf.NotNil(e) then return end if not fusf.NotNil(e) then return end
......
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