Commit 18e42877 authored by Grajade's avatar Grajade

Update c1110000.lua

parent d48d2c11
...@@ -8,8 +8,8 @@ function cm.AddSpsummonSelf(c,fcon,fop,limit,code) ...@@ -8,8 +8,8 @@ function cm.AddSpsummonSelf(c,fcon,fop,limit,code)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
if limit then e1:SetCountLimit(limit,code+EFFECT_COUNT_CODE_OATH) end if limit then e1:SetCountLimit(limit,code+EFFECT_COUNT_CODE_OATH) end
e1:SetCondition(cm.AddSpsummonSelfFcon(fcon)) end e1:SetCondition(cm.AddSpsummonSelfFcon(fcon))
e1:SetOperation(cm.AddSpsummonSelfFop(fop)) end e1:SetOperation(cm.AddSpsummonSelfFop(fop))
e1:SetValue(SUMMON_VALUE_SELF) e1:SetValue(SUMMON_VALUE_SELF)
c:RegisterEffect(e1) c:RegisterEffect(e1)
return e1 return e1
...@@ -29,7 +29,7 @@ function cm.AddSpsummonSelfFop(fop) ...@@ -29,7 +29,7 @@ function cm.AddSpsummonSelfFop(fop)
end end
end end
-- --
function cm.CardSingleUpdateAttack(c,tc,val,reset) function cm.CardSingleUpdateAttack(c,tc,val,reset,fcon)
local e1=Effect.CreateEffect(tc) local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
...@@ -40,10 +40,11 @@ function cm.CardSingleUpdateAttack(c,tc,val,reset) ...@@ -40,10 +40,11 @@ function cm.CardSingleUpdateAttack(c,tc,val,reset)
elseif aux.GetValueType(val)=="function" then elseif aux.GetValueType(val)=="function" then
e1:SetValue(cm.CardSingleUpdateAttackVal(val)) e1:SetValue(cm.CardSingleUpdateAttackVal(val))
end end
e1:SetCondition(cm.CardSingleUpdateAttackFcon(fcon))
if reset then e1:SetReset(reset) end if reset then e1:SetReset(reset) end
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function cm.CardSingleUpdateDefense(c,tc,val,reset) function cm.CardSingleUpdateDefense(c,tc,val,reset,fcon)
local e1=Effect.CreateEffect(tc) local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
...@@ -54,6 +55,7 @@ function cm.CardSingleUpdateDefense(c,tc,val,reset) ...@@ -54,6 +55,7 @@ function cm.CardSingleUpdateDefense(c,tc,val,reset)
elseif aux.GetValueType(val)=="function" then elseif aux.GetValueType(val)=="function" then
e1:SetValue(cm.CardSingleUpdateAttackVal(val)) e1:SetValue(cm.CardSingleUpdateAttackVal(val))
end end
e1:SetCondition(cm.CardSingleUpdateAttackFcon(fcon))
if reset then e1:SetReset(reset) end if reset then e1:SetReset(reset) end
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
...@@ -61,3 +63,52 @@ function cm.CardSingleUpdateAttackVal(val) ...@@ -61,3 +63,52 @@ function cm.CardSingleUpdateAttackVal(val)
return return
function(e,c) return val(e,c) end function(e,c) return val(e,c) end
end end
function cm.CardSingleUpdateAttackFcon(fcon)
return
function(e,c)
if fcon then return fcon(e,c) end
return true
end
end
--
function cm.CardSingleChangeCode(c,tc,code,reset,fcon)
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(code)
e1:SetReset(reset)
e1:SetCondition(cm.CardSingleChangeCodeFcon(fcon))
c:RegisterEffect(e1)
end
function cm.CardSingleChangeCodeFcon(fcon)
return
function(e,c)
if fcon then return fcon(e,c) end
return true
end
end
--
function cm.CardSelectingMoveSequenceNear(c,tc,loc)
local flag=0
local seq=c:GetSequence()
if seq>0 and Duel.CheckLocation(tp,loc,seq-1) then
if loc==LOCATION_MZONE then
flag=bit.replace(flag,0x1,seq-1)
else
flag=bit.replace(flag,0x1,seq+7)
end
end
if seq<4 and Duel.CheckLocation(tp,loc,seq+1) then
if loc==LOCATION_SZONE then
flag=bit.replace(flag,0x1,seq+1)
else
flag=bit.replace(flag,0x1,seq+7)
end
end
flag=bit.bxor(flag,0xff)
local s=Duel.SelectDisableField(tp,1,LOCATION_SZONE,0,~flag)
if loc==LOCATION_MZONE then nseq=math.log(s,2) end
if loc==LOCATION_SZONE then nseq=math.log(s,2)-8 end
Duel.MoveSequence(tc,nseq)
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