Commit 4bb6b8d6 authored by salix5's avatar salix5 Committed by GitHub

add aux.GetCappedValue() (#1830)

parent 698c62fa
......@@ -29,7 +29,7 @@ function c29253591.synlimit(e,c)
return not c:IsSetCard(0x29)
end
function c29253591.slevel(e,c)
local lv=e:GetHandler():GetLevel()
local lv=aux.GetCappedValue(e:GetHandler(),Card.GetLevel)
return (4<<16)+lv
end
function c29253591.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -18,7 +18,7 @@ function c29888389.initial_effect(c)
c:RegisterEffect(e2)
end
function c29888389.rlevel(e,c)
local lv=e:GetHandler():GetLevel()
local lv=aux.GetCappedValue(e:GetHandler(),Card.GetLevel)
if c:IsAttribute(ATTRIBUTE_WATER) then
local clv=c:GetLevel()
return (lv<<16)+clv
......
......@@ -8,7 +8,7 @@ function c34334692.initial_effect(c)
c:RegisterEffect(e1)
end
function c34334692.rlevel(e,c)
local lv=e:GetHandler():GetLevel()
local lv=aux.GetCappedValue(e:GetHandler(),Card.GetLevel)
if c:IsAttribute(ATTRIBUTE_DARK) then
local clv=c:GetLevel()
return (lv<<16)+clv
......
......@@ -18,7 +18,7 @@ function c4632019.initial_effect(c)
c:RegisterEffect(e2)
end
function c4632019.synclv(e,c)
local lv=e:GetHandler():GetLevel()
local lv=aux.GetCappedValue(e:GetHandler(),Card.GetLevel)
return (8<<16)+lv
end
function c4632019.efcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -18,7 +18,7 @@ function c47106439.initial_effect(c)
c:RegisterEffect(e2)
end
function c47106439.rlevel(e,c)
local lv=e:GetHandler():GetLevel()
local lv=aux.GetCappedValue(e:GetHandler(),Card.GetLevel)
if c:IsAttribute(ATTRIBUTE_WATER) then
local clv=c:GetLevel()
return (lv<<16)+clv
......
......@@ -20,7 +20,7 @@ function c90307777.initial_effect(c)
c:RegisterEffect(e2)
end
function c90307777.rlevel(e,c)
local lv=e:GetHandler():GetLevel()
local lv=aux.GetCappedValue(e:GetHandler(),Card.GetLevel)
if c:IsSetCard(0xb4) then
local clv=c:GetLevel()
return (lv<<16)+clv
......
......@@ -21,7 +21,7 @@ function c92676637.initial_effect(c)
c:RegisterEffect(e2)
end
function c92676637.slevel(e,c)
local lv=e:GetHandler():GetLevel()
local lv=aux.GetCappedValue(e:GetHandler(),Card.GetLevel)
return (2<<16)+lv
end
function c92676637.drcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -2,6 +2,7 @@
MIN_ID =1000 --4 digits, by DataManager::GetDesc()
MAX_ID =268435455 --28 bits, by DataManager::GetDesc()
MAX_COUNTER =65535 --max number for adding/removing counters, by card::add_counter(), field::remove_counter()
MAX_PARAMETER =0xffff
--Locations 区域
LOCATION_DECK =0x01 --卡组
LOCATION_HAND =0x02 --手牌
......
......@@ -2813,3 +2813,11 @@ end
function Auxiliary.IsSpecialSummonedByEffect(e)
return not ((e:GetCode()==EFFECT_SPSUMMON_PROC or e:GetCode()==EFFECT_SPSUMMON_PROC_G) and e:GetProperty()&(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)==(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE))
end
--
function Auxiliary.GetCappedValue(c,f)
if f(c)>MAX_PARAMETER then
return MAX_PARAMETER
else
return f(c)
end
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