Commit 638402c6 authored by wyykak's avatar wyykak

fix season mechanism

Provided by: kritosoft
Signed-off-by: wyykak's avatarwyykak <wyy_1414@126.com>
parent 773b50ff
Pipeline #10128 passed with stage
in 1 minute and 1 second
...@@ -3,17 +3,17 @@ Nef = Nef or {} ...@@ -3,17 +3,17 @@ Nef = Nef or {}
local os = require("os") local os = require("os")
-- require "nef/cardList" -- require "nef/cardList"
function Nef.unpack(t, i) function Nef.unpack(t, i)
i = i or 1 i = i or 1
if t[i] then if t[i] then
return t[i], Nef.unpack(t, i + 1) return t[i], Nef.unpack(t, i + 1)
end end
end end
function Nef.unpackOneMember(t, member, i) function Nef.unpackOneMember(t, member, i)
i = i or 1 i = i or 1
if t[i] and t[i][member] then if t[i] and t[i][member] then
return t[i][member], Nef.unpackOneMember(t, member, i+1) return t[i][member], Nef.unpackOneMember(t, member, i+1)
end end
end end
function Nef.AddSynchroProcedureWithDesc(c,f1,f2,ct,desc) function Nef.AddSynchroProcedureWithDesc(c,f1,f2,ct,desc)
...@@ -120,7 +120,7 @@ function Nef.EnablePendulumAttributeSP(c,num,filter,argTable,reg,tag) ...@@ -120,7 +120,7 @@ function Nef.EnablePendulumAttributeSP(c,num,filter,argTable,reg,tag)
c:RegisterEffect(e1) c:RegisterEffect(e1)
-- 由于utility处加载nef,不需要再无效效果 -- 由于utility处加载nef,不需要再无效效果
-- --disable HINTMSG_SPSUMMON -- --disable HINTMSG_SPSUMMON
-- local e2=Effect.CreateEffect(c) -- local e2=Effect.CreateEffect(c)
-- e2:SetType(EFFECT_TYPE_FIELD) -- e2:SetType(EFFECT_TYPE_FIELD)
-- e2:SetRange(LOCATION_PZONE) -- e2:SetRange(LOCATION_PZONE)
...@@ -172,7 +172,7 @@ function Nef.PConditionFilterSP(c,e,tp,lscale,rscale,filter,argTable,filter2,arg ...@@ -172,7 +172,7 @@ function Nef.PConditionFilterSP(c,e,tp,lscale,rscale,filter,argTable,filter2,arg
end end
local normalCondition = (c:IsLocation(LOCATION_HAND) or (c:IsFaceup() and c:IsType(TYPE_PENDULUM))) local normalCondition = (c:IsLocation(LOCATION_HAND) or (c:IsFaceup() and c:IsType(TYPE_PENDULUM)))
and lv>lscale and lv<rscale and not c:IsForbidden() and lv>lscale and lv<rscale and not c:IsForbidden()
and Nef.PendSummonCheck(c,e,tp,lscale,rscale,filter,argTable,filter2,argTable2,lpz,rpz) and Nef.PendSummonCheck(c,e,tp,lscale,rscale,filter,argTable,filter2,argTable2,lpz,rpz)
local spCondition = filter(c,Nef.unpack(argTable)) and filter2(c,Nef.unpack(argTable2)) local spCondition = filter(c,Nef.unpack(argTable)) and filter2(c,Nef.unpack(argTable2))
return spCondition and normalCondition return spCondition and normalCondition
end end
...@@ -191,7 +191,7 @@ function Nef.PConditionFilterSP2(c,e,tp,lscale,rscale,filter,argTable,filter2,ar ...@@ -191,7 +191,7 @@ function Nef.PConditionFilterSP2(c,e,tp,lscale,rscale,filter,argTable,filter2,ar
end end
function Nef.PendConditionSP() function Nef.PendConditionSP()
return function(e,c,og) return function(e,c,og)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
...@@ -232,13 +232,13 @@ function Nef.PendConditionSP() ...@@ -232,13 +232,13 @@ function Nef.PendConditionSP()
end end
function Nef.PendOperationSP() function Nef.PendOperationSP()
return function(e,tp,eg,ep,ev,re,r,rp,c,sg,og) return function(e,tp,eg,ep,ev,re,r,rp,c,sg,og)
local lpz = Duel.GetFieldCard(tp, LOCATION_PZONE, 0) local lpz = Duel.GetFieldCard(tp, LOCATION_PZONE, 0)
local rpz = Duel.GetFieldCard(tp, LOCATION_PZONE, 1) local rpz = Duel.GetFieldCard(tp, LOCATION_PZONE, 1)
local n1, filter1, argTable1, tag1, pexfunc1 = Nef.GetPendSPInfo(lpz) local n1, filter1, argTable1, tag1, pexfunc1 = Nef.GetPendSPInfo(lpz)
local n2, filter2, argTable2, tag2, pexfunc2 = Nef.GetPendSPInfo(rpz) local n2, filter2, argTable2, tag2, pexfunc2 = Nef.GetPendSPInfo(rpz)
local lscale = lpz:GetLeftScale() local lscale = lpz:GetLeftScale()
local rscale = rpz:GetRightScale() local rscale = rpz:GetRightScale()
if lscale > rscale then lscale, rscale = rscale, lscale end if lscale > rscale then lscale, rscale = rscale, lscale end
...@@ -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
...@@ -395,7 +395,7 @@ end ...@@ -395,7 +395,7 @@ end
function Nef.GetFieldLeftScale(tp) function Nef.GetFieldLeftScale(tp)
local lpz=Duel.GetFieldCard(tp, LOCATION_PZONE, 0) local lpz=Duel.GetFieldCard(tp, LOCATION_PZONE, 0)
if lpz then if lpz then
return lpz:GetLeftScale() return lpz:GetLeftScale()
else else
return return
...@@ -404,7 +404,7 @@ end ...@@ -404,7 +404,7 @@ end
function Nef.GetFieldRightScale(tp) function Nef.GetFieldRightScale(tp)
local rpz=Duel.GetFieldCard(tp, LOCATION_PZONE, 1) local rpz=Duel.GetFieldCard(tp, LOCATION_PZONE, 1)
if rpz then if rpz then
return rpz:GetRightScale() return rpz:GetRightScale()
else else
return return
...@@ -412,10 +412,10 @@ function Nef.GetFieldRightScale(tp) ...@@ -412,10 +412,10 @@ function Nef.GetFieldRightScale(tp)
end end
-- function Nef.PendSummonLimitTarget(e,c,sump,sumtype,sumpos,targetp) -- function Nef.PendSummonLimitTarget(e,c,sump,sumtype,sumpos,targetp)
-- local c = nil -- local c = nil
-- if e then c = e:GetHandler() end -- if e then c = e:GetHandler() end
-- return c and sumtype==SUMMON_TYPE_PENDULUM and _G["c" .. c:GetOriginalCode()].pend_filter==nil -- return c and sumtype==SUMMON_TYPE_PENDULUM and _G["c" .. c:GetOriginalCode()].pend_filter==nil
-- and (c == Duel.GetFieldCard(tp,LOCATION_SZONE, 6) or c == Duel.GetFieldCard(tp,LOCATION_SZONE, 7)) -- and (c == Duel.GetFieldCard(tp,LOCATION_SZONE, 6) or c == Duel.GetFieldCard(tp,LOCATION_SZONE, 7))
-- end -- end
function Nef.EnableDualAttributeSP(c) function Nef.EnableDualAttributeSP(c)
...@@ -466,13 +466,13 @@ end ...@@ -466,13 +466,13 @@ end
function Nef.GetRandomCardCode(num, command) function Nef.GetRandomCardCode(num, command)
-- local result = {} -- local result = {}
-- local commandList = { -- local commandList = {
-- [0] = "Main", -- [0] = "Main",
-- [1] = "Extra" -- [1] = "Extra"
-- } -- }
-- local cardType = commandList[command] -- local cardType = commandList[command]
-- for i=1,num do -- for i=1,num do
-- local r = math.random(1,#CardList[cardType]) -- local r = math.random(1,#CardList[cardType])
-- result[i] = CardList[cardType][r] -- result[i] = CardList[cardType][r]
-- end -- end
-- return result -- return result
end end
...@@ -525,7 +525,7 @@ function Nef.SelectGroup(tp,desc,g,f,cg,min,max,...) ...@@ -525,7 +525,7 @@ function Nef.SelectGroup(tp,desc,g,f,cg,min,max,...)
local cg=cg or Group.CreateGroup() local cg=cg or Group.CreateGroup()
sg:Merge(cg) sg:Merge(cg)
local ct=sg:GetCount() local ct=sg:GetCount()
local ag=g:Filter(Nef.CheckGroupRecursive,sg,sg,g,f,min,max,ext_params) local ag=g:Filter(Nef.CheckGroupRecursive,sg,sg,g,f,min,max,ext_params)
while ct<max and ag:GetCount()>0 do while ct<max and ag:GetCount()>0 do
local finish=(ct>=min and ct<=max and f(sg,...)) local finish=(ct>=min and ct<=max and f(sg,...))
local seg=sg:Clone() local seg=sg:Clone()
...@@ -553,7 +553,7 @@ function Nef.SelectGroupWithCancel(tp,desc,g,f,cg,min,max,...) ...@@ -553,7 +553,7 @@ function Nef.SelectGroupWithCancel(tp,desc,g,f,cg,min,max,...)
local cg=cg or Group.CreateGroup() local cg=cg or Group.CreateGroup()
sg:Merge(cg) sg:Merge(cg)
local ct=sg:GetCount() local ct=sg:GetCount()
local ag=g:Filter(Nef.CheckGroupRecursive,sg,sg,g,f,min,max,ext_params) local ag=g:Filter(Nef.CheckGroupRecursive,sg,sg,g,f,min,max,ext_params)
while ct<max and ag:GetCount()>0 do while ct<max and ag:GetCount()>0 do
local finish=(ct>=min and ct<=max and f(sg,...)) local finish=(ct>=min and ct<=max and f(sg,...))
local cancel=finish or ct==0 local cancel=finish or ct==0
...@@ -626,7 +626,7 @@ function Nef.AddXyzProcedureCustom(c,func,gf,minc,maxc,xm,...) ...@@ -626,7 +626,7 @@ function Nef.AddXyzProcedureCustom(c,func,gf,minc,maxc,xm,...)
local mt=_G["c" .. code] local mt=_G["c" .. code]
mt.xyz_filter=func or aux.TRUE mt.xyz_filter=func or aux.TRUE
mt.xyz_count=minc mt.xyz_count=minc
end end
local maxc=maxc or minc local maxc=maxc or minc
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
...@@ -758,7 +758,7 @@ function Nef.AddCommonCounter(num, code, tp) ...@@ -758,7 +758,7 @@ function Nef.AddCommonCounter(num, code, tp)
if tc:IsControler(tp) then if tc:IsControler(tp) then
tc:ResetFlagEffect(999900+code) tc:ResetFlagEffect(999900+code)
if tc:IsLocation(LOCATION_ONFIELD) and tag > 0 then if tc:IsLocation(LOCATION_ONFIELD) and tag > 0 then
tc:RegisterFlagEffect(999900+code, RESET_EVENT+0xfe0000, EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE, 0, 0, tc:RegisterFlagEffect(999900+code, RESET_EVENT+0xfe0000, EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE, 0, 0,
aux.Stringid(code, tag)) aux.Stringid(code, tag))
end end
end end
...@@ -791,7 +791,7 @@ function Nef.RefreshCommonCounter(c, code) ...@@ -791,7 +791,7 @@ function Nef.RefreshCommonCounter(c, code)
local tag = math.min(Nef.counter[c:GetControler()][code], 11) local tag = math.min(Nef.counter[c:GetControler()][code], 11)
c:ResetFlagEffect(999900+code) c:ResetFlagEffect(999900+code)
if tag > 0 then if tag > 0 then
c:RegisterFlagEffect(999900+code, RESET_EVENT+0xfe0000, EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE, 0, 0, c:RegisterFlagEffect(999900+code, RESET_EVENT+0xfe0000, EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE, 0, 0,
aux.Stringid(code, tag)) aux.Stringid(code, tag))
end end
end end
...@@ -868,7 +868,7 @@ end ...@@ -868,7 +868,7 @@ end
-- this group include cards in szone -- this group include cards in szone
function Nef.GetLinkArrowGroup(c) function Nef.GetLinkArrowGroup(c)
local g = Group.CreateGroup() local g = Group.CreateGroup()
if c:IsOnField() then if c:IsOnField() then
local tp = c:GetControler() local tp = c:GetControler()
local loc = c:GetLocation() local loc = c:GetLocation()
local seq = c:GetSequence() local seq = c:GetSequence()
...@@ -1041,12 +1041,12 @@ function Nef.RegisterBigFiendEffect(c,e) ...@@ -1041,12 +1041,12 @@ function Nef.RegisterBigFiendEffect(c,e)
ex:SetCode(EVENT_FREE_CHAIN) ex:SetCode(EVENT_FREE_CHAIN)
ex:SetHintTiming(0,0x1c0) ex:SetHintTiming(0,0x1c0)
end end
c:RegisterEffect(ex) c:RegisterEffect(ex)
end end
function Auxiliary.NonTuner(f,...) function Auxiliary.NonTuner(f,...)
local ext_params={...} local ext_params={...}
return function(target,syncard) return function(target,syncard)
return (not syncard or target:IsNotTuner(syncard)) and (not f or f(target,table.unpack(ext_params))) return (not syncard or target:IsNotTuner(syncard)) and (not f or f(target,table.unpack(ext_params)))
end end
end end
...@@ -1055,7 +1055,7 @@ if not Nef.SeedField then ...@@ -1055,7 +1055,7 @@ if not Nef.SeedField then
local class = {} local class = {}
class.seeds = {} class.seeds = {}
class.hint = true class.hint = true
function class.readZone(zone) function class.readZone(zone)
local zone0 = zone & 0xff local zone0 = zone & 0xff
local zone1 = zone >> 16 local zone1 = zone >> 16
...@@ -1095,14 +1095,14 @@ if not Nef.SeedField then ...@@ -1095,14 +1095,14 @@ if not Nef.SeedField then
return 1 << (seq - 16) return 1 << (seq - 16)
else else
return 1 << (seq + 16) return 1 << (seq + 16)
end end
end end
end end
end end
--[[ --[[
tp 种子持有者 tp 种子持有者
zone 目标区域 zone 目标区域
]] ]]
function class.addSeed(e, tp, zoneTP) function class.addSeed(e, tp, zoneTP)
local zone = class.fmtZone(tp, zoneTP) local zone = class.fmtZone(tp, zoneTP)
...@@ -1135,10 +1135,10 @@ if not Nef.SeedField then ...@@ -1135,10 +1135,10 @@ if not Nef.SeedField then
return true return true
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
...@@ -1151,36 +1151,36 @@ if not Nef.SeedField then ...@@ -1151,36 +1151,36 @@ if not Nef.SeedField then
local zone00, zone01 = 0, 0 local zone00, zone01 = 0, 0
local zone10, zone11 = 0, 0 local zone10, zone11 = 0, 0
for i = 0, 4 do for i = 0, 4 do
if class.seeds[i] then if class.seeds[i] then
local p = class.seeds[i][1] local p = class.seeds[i][1]
if p == 0 then if p == 0 then
zone00 = zone00 | 1<<i zone00 = zone00 | 1<<i
zone10 = zone10 | 1<<(i+16) zone10 = zone10 | 1<<(i+16)
else else
zone01 = zone01 | 1<<i zone01 = zone01 | 1<<i
zone11 = zone11 | 1<<(i+16) zone11 = zone11 | 1<<(i+16)
end end
end end
if class.seeds[i+16] then if class.seeds[i+16] then
local p = class.seeds[i+16][1] local p = class.seeds[i+16][1]
if p == 0 then if p == 0 then
zone00 = zone00 | 1<<(i+16) zone00 = zone00 | 1<<(i+16)
zone10 = zone10 | 1<<i zone10 = zone10 | 1<<i
else else
zone01 = zone01 | 1<<(i+16) zone01 = zone01 | 1<<(i+16)
zone11 = zone11 | 1<<i zone11 = zone11 | 1<<i
end end
end end
end end
for i = 5, 6 do for i = 5, 6 do
if class.seeds[i] then if class.seeds[i] then
local p = class.seeds[i][1] local p = class.seeds[i][1]
if p == 0 then if p == 0 then
zone00 = zone00 | 1<<i | 1<<(i+16) zone00 = zone00 | 1<<i | 1<<(i+16)
zone10 = zone10 | 1<<i | 1<<(i+16) zone10 = zone10 | 1<<i | 1<<(i+16)
else else
zone01 = zone01 | 1<<i | 1<<(i+16) zone01 = zone01 | 1<<i | 1<<(i+16)
zone11 = zone11 | 1<<i | 1<<(i+16) zone11 = zone11 | 1<<i | 1<<(i+16)
end end
end end
end end
...@@ -1266,7 +1266,7 @@ if not Nef.SeedField then ...@@ -1266,7 +1266,7 @@ if not Nef.SeedField then
if c:IsLocation(LOCATION_MZONE) then if c:IsLocation(LOCATION_MZONE) then
local p = c:GetControler() local p = c:GetControler()
local cseq = c:GetSequence() local cseq = c:GetSequence()
if p == 1 then if p == 1 then
p = 0 p = 0
if cseq < 5 then if cseq < 5 then
cseq = cseq + 16 cseq = cseq + 16
...@@ -1279,7 +1279,7 @@ if not Nef.SeedField then ...@@ -1279,7 +1279,7 @@ if not Nef.SeedField then
end end
function class.tg(e,tp,eg,ep,ev,re,r,rp,chk) function class.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk == 0 then if chk == 0 then
local seq = e:GetLabel() local seq = e:GetLabel()
return eg:IsExists(class.cfilter, 1, nil, seq) return eg:IsExists(class.cfilter, 1, nil, seq)
end end
...@@ -1366,29 +1366,22 @@ if not Nef.PLCounter then ...@@ -1366,29 +1366,22 @@ if not Nef.PLCounter then
function class.Add(tp, code, num) function class.Add(tp, code, num)
local eg = class._e[tp][code] local eg = class._e[tp][code]
if eg then if eg then
local e = eg:GetLabelObject()
e:Reset()
eg:Reset() eg:Reset()
end end
local e1 = Effect.GlobalEffect() local e1 = Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
local eg1 = Effect.GlobalEffect()
eg1:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_GRANT)
eg1:SetTargetRange(0xff, 0)
eg1:SetTarget(aux.TRUE)
local count = (class._n[tp][code] or 0) + num local count = (class._n[tp][code] or 0) + num
class._e[tp][code] = eg1 class._e[tp][code] = e1
class._n[tp][code] = count class._n[tp][code] = count
e1:SetDescription(aux.Stringid(code, count)) e1:SetDescription(aux.Stringid(code, count))
eg1:SetLabelObject(e1) Duel.RegisterEffect(e1, tp)
Duel.RegisterEffect(eg1, tp)
end end
function class.Get(tp, code) function class.Get(tp, code)
...@@ -1396,4 +1389,24 @@ if not Nef.PLCounter then ...@@ -1396,4 +1389,24 @@ if not Nef.PLCounter then
end end
Nef.PLCounter = class Nef.PLCounter = class
end
--seasonchange
function Nef.SeasonChange(c)
if Nef.Seasoncounter == nil then
Nef.Seasoncounter = true
local sea=Effect.CreateEffect(c)
sea:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
sea:SetCode(EVENT_PHASE_START+PHASE_STANDBY)
sea:SetOperation(Nef.addcount)
Duel.RegisterEffect(sea, 0)
end
end
function Nef.addcount(e,tp,eg,ep,ev,re,r,rp)
if Nef.PLCounter.Get(tp,999104) < 4 then
Nef.PLCounter.Add(tp,999104,1)
Nef.PLCounter.Add(1-tp,999104,1)
else
Nef.PLCounter.Add(tp,999104,-3)
Nef.PLCounter.Add(1-tp,999104,-3)
end
end end
\ No newline at end of file
...@@ -71,7 +71,12 @@ function c1192020.ofilter2(c) ...@@ -71,7 +71,12 @@ function c1192020.ofilter2(c)
end end
function c1192020.op2(e,tp,eg,ep,ev,re,r,rp) function c1192020.op2(e,tp,eg,ep,ev,re,r,rp)
-- --
if Duel.IsExistingMatchingCard(c1192020.ofilter2,tp,0xff,0xff,1,nil) then Nef.SetCommonCounter(1,999104,tp) end Debug.Message(Nef.PLCounter.Get(tp,999104))
if Nef.PLCounter.Get(tp,999104)~=0 then
local a=Nef.PLCounter.Get(tp,999104)
Nef.PLCounter.Add(tp,999104,1-a)
Nef.PLCounter.Add(1-tp,999104,1-a)
end
-- --
if Duel.Recover(tp,1500,REASON_EFFECT)<1 then return end if Duel.Recover(tp,1500,REASON_EFFECT)<1 then return end
-- --
......
--幻想时令『四时之兆』 --幻想时令『四时之兆』
local M = c999104 local M = c999104
local Mid = 999104 local Mid = 999104
require("expansions/script/nef/nef")
function M.initial_effect(c) function M.initial_effect(c)
-- --
aux.AddCodeList(c,1192020) aux.AddCodeList(c,1192020)
-- Nef.SeasonChange(c)
Nef.CommonCounterGroup(c, Mid)
if M.counter == nil then
M.counter = true
local ge0=Effect.CreateEffect(c)
ge0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ge0:SetCode(EVENT_PHASE_START+PHASE_STANDBY)
ge0:SetOperation(M.addcount)
Duel.RegisterEffect(ge0, 0)
end
--Activate --Activate
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE) e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN) e0:SetCode(EVENT_FREE_CHAIN)
e0:SetOperation(function (e,tp,eg,ep,ev,re,r,rp)
Nef.RefreshCommonCounter(c, Mid)
end)
c:RegisterEffect(e0) c:RegisterEffect(e0)
-- --
...@@ -54,16 +42,6 @@ function M.initial_effect(c) ...@@ -54,16 +42,6 @@ function M.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function M.addcount(e,tp,eg,ep,ev,re,r,rp)
for p = 0, 1 do
if Nef.GetCommonCounter(Mid, p) < 4 then
Nef.AddCommonCounter(1, Mid, p)
else
Nef.AddCommonCounter(-3, Mid, p)
end
end
end
function M.filter1(c) function M.filter1(c)
return c:IsSetCard(0x123) and c:IsAbleToHand() return c:IsSetCard(0x123) and c:IsAbleToHand()
end end
...@@ -92,7 +70,7 @@ end ...@@ -92,7 +70,7 @@ end
function M.target(e,tp,eg,ep,ev,re,r,rp,chk) function M.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk == 0 then if chk == 0 then
local flag = Nef.GetCommonCounter(Mid, tp) local flag = Nef.PLCounter.Get(tp,Mid)
local list = {20200, 22400, 23300, 10100} local list = {20200, 22400, 23300, 10100}
return flag > 0 and Duel.IsExistingMatchingCard(M["filter"..flag], tp, LOCATION_DECK, 0, 1, nil) return flag > 0 and Duel.IsExistingMatchingCard(M["filter"..flag], tp, LOCATION_DECK, 0, 1, nil)
and Duel.IsExistingMatchingCard(M.filter, tp, LOCATION_DECK, 0, 1, nil, list[flag]) and Duel.IsExistingMatchingCard(M.filter, tp, LOCATION_DECK, 0, 1, nil, list[flag])
...@@ -101,7 +79,7 @@ function M.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -101,7 +79,7 @@ function M.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function M.operation(e,tp,eg,ep,ev,re,r,rp) function M.operation(e,tp,eg,ep,ev,re,r,rp)
local flag = Nef.GetCommonCounter(Mid, tp) local flag = Nef.PLCounter.Get(tp,Mid)
local list = {20200, 22400, 23300, 10100} local list = {20200, 22400, 23300, 10100}
if flag > 0 and Duel.IsExistingMatchingCard(M["filter"..flag], tp, LOCATION_DECK, 0, 1, nil) if flag > 0 and Duel.IsExistingMatchingCard(M["filter"..flag], tp, LOCATION_DECK, 0, 1, nil)
and Duel.IsExistingMatchingCard(M.filter, tp, LOCATION_DECK, 0, 1, nil, list[flag]) then and Duel.IsExistingMatchingCard(M.filter, tp, LOCATION_DECK, 0, 1, nil, list[flag]) then
...@@ -129,6 +107,9 @@ function M.seasonop(e,tp,eg,ep,ev,re,r,rp) ...@@ -129,6 +107,9 @@ function M.seasonop(e,tp,eg,ep,ev,re,r,rp)
[10100] = 4, [10100] = 4,
} }
if list[code] then if list[code] then
Nef.SetCommonCounter(list[code], Mid, tp) local a=Nef.PLCounter.Get(tp,Mid)
local b=list[code]
Nef.PLCounter.Add(tp,Mid,b-a)
Nef.PLCounter.Add(1-tp,Mid,b-a)
end end
end end
...@@ -102,8 +102,6 @@ function M.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -102,8 +102,6 @@ function M.activate(e,tp,eg,ep,ev,re,r,rp)
local cost = te:GetCost() local cost = te:GetCost()
if cost then cost(te, tep, eg, ep, ev, re, r, rp, 1) end if cost then cost(te, tep, eg, ep, ev, re, r, rp, 1) end
Duel.RaiseEvent(tc, EVENT_CHAIN_SOLVED, tc:GetActivateEffect(), 0, tp, tp, Duel.GetCurrentChain()) Duel.RaiseEvent(tc, EVENT_CHAIN_SOLVED, tc:GetActivateEffect(), 0, tp, tp, Duel.GetCurrentChain())
Nef.RefreshCommonCounter(tc, 999104)
end end
-- immune -- immune
...@@ -136,11 +134,11 @@ end ...@@ -136,11 +134,11 @@ end
function M.tokentg(e,tp,eg,ep,ev,re,r,rp,chk) function M.tokentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local flag = Nef.GetCommonCounter(999104, tp) local flag = Nef.PLCounter.Get(tp,999104)
local list = { local list = {
[1] = {25161, 0x208, 0x4011, 2000, 2000, 5, RACE_PLANT, ATTRIBUTE_LIGHT}, [1] = {25161, 0x208, 0x4011, 2000, 2000, 5, RACE_PLANT, ATTRIBUTE_LIGHT},
[2] = {25160, 0x208, 0x4011, 1000, 1000, 1, RACE_PLANT, ATTRIBUTE_LIGHT}, [2] = {25160, 0x208, 0x4011, 1000, 1000, 1, RACE_PLANT, ATTRIBUTE_LIGHT},
[3] = {999300, 0x208, 0x4011, 0, 0, 2, RACE_PLANT, ATTRIBUTE_EARTH}, [3] = {999300, 0x208, 0x4011, 0, 0, 2, RACE_PLANT, ATTRIBUTE_EARTH},
[4] = {999999, 0x208, 0x4011, 900, 900, 9, RACE_AQUA, ATTRIBUTE_WATER}, [4] = {999999, 0x208, 0x4011, 900, 900, 9, RACE_AQUA, ATTRIBUTE_WATER},
} }
return flag > 0 and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 return flag > 0 and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
...@@ -151,12 +149,12 @@ function M.tokentg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -151,12 +149,12 @@ function M.tokentg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function M.tokenop(e,tp,eg,ep,ev,re,r,rp) function M.tokenop(e,tp,eg,ep,ev,re,r,rp)
local flag = Nef.GetCommonCounter(999104, tp) local flag = Nef.PLCounter.Get(tp,999104)
local list = { local list = {
[1] = {25161, 0x208, 0x4011, 2000, 2000, 5, RACE_PLANT, ATTRIBUTE_LIGHT}, [1] = {25161, 0x208, 0x4011, 2000, 2000, 5, RACE_PLANT, ATTRIBUTE_LIGHT},
[2] = {25160, 0x208, 0x4011, 1000, 1000, 1, RACE_PLANT, ATTRIBUTE_LIGHT}, [2] = {25160, 0x208, 0x4011, 1000, 1000, 1, RACE_PLANT, ATTRIBUTE_LIGHT},
[3] = {999300, 0x208, 0x4011, 0, 0, 2, RACE_PLANT, ATTRIBUTE_EARTH}, [3] = {999300, 0x208, 0x4011, 0, 0, 2, RACE_PLANT, ATTRIBUTE_EARTH},
[4] = {999999, 0x208, 0x4011, 900, 900, 9, 0x40, ATTRIBUTE_WATER}, [4] = {999999, 0x208, 0x4011, 900, 900, 9, 0x40, ATTRIBUTE_WATER},
} }
local ft = Duel.GetLocationCount(tp, LOCATION_MZONE) local ft = Duel.GetLocationCount(tp, LOCATION_MZONE)
local c = e:GetHandler() local c = e:GetHandler()
......
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