Commit 02401a9c authored by Nemo Ma's avatar Nemo Ma

fix

parent 0a729313
...@@ -197,6 +197,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -197,6 +197,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
for _,te3 in pairs(re3) do for _,te3 in pairs(re3) do
if not te3:GetLabelObject() then
local cost=te3:GetCost() local cost=te3:GetCost()
if cost and not cost(te3,te,tp) then if cost and not cost(te3,te,tp) then
local tg=te3:GetTarget() local tg=te3:GetTarget()
...@@ -206,6 +207,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -206,6 +207,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
end
local dc=Duel.CreateToken(tp,m+50) local dc=Duel.CreateToken(tp,m+50)
local de=dc:GetActivateEffect() local de=dc:GetActivateEffect()
local ae2={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_ACTIVATE)} local ae2={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_ACTIVATE)}
...@@ -219,6 +221,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -219,6 +221,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
for _,te3 in pairs(ae3) do for _,te3 in pairs(ae3) do
if not te3:GetLabelObject() then
local cost=te3:GetCost() local cost=te3:GetCost()
if cost and not cost(te3,de,tp) then if cost and not cost(te3,de,tp) then
local tg=te3:GetTarget() local tg=te3:GetTarget()
...@@ -228,6 +231,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -228,6 +231,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
end
local ret1,ret2={},{} local ret1,ret2={},{}
for k,v1 in pairs(t1) do for k,v1 in pairs(t1) do
local equal=false local equal=false
...@@ -283,6 +287,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -283,6 +287,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
if ret2[k]==5 then if ret2[k]==5 then
if not v:GetLabelObject() then
local cost=v:GetCost() local cost=v:GetCost()
if cost and not cost(v,te,tp) then if cost and not cost(v,te,tp) then
local tg=v:GetTarget() local tg=v:GetTarget()
...@@ -294,6 +299,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -294,6 +299,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
end
for k,v in pairs(ret3) do for k,v in pairs(ret3) do
if ret4[k]==4 then if ret4[k]==4 then
local val=v:GetValue() local val=v:GetValue()
...@@ -303,6 +309,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -303,6 +309,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
if ret4[k]==5 then if ret4[k]==5 then
if not v:GetLabelObject() then
local cost=v:GetCost() local cost=v:GetCost()
if cost and not cost(v,de,tp) then if cost and not cost(v,de,tp) then
local tg=v:GetTarget() local tg=v:GetTarget()
...@@ -314,6 +321,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -314,6 +321,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
end
end end
function cm.chcon(_con,res) function cm.chcon(_con,res)
return function(e,...) return function(e,...)
...@@ -337,12 +345,12 @@ function cm.chtg(_tg,res) ...@@ -337,12 +345,12 @@ function cm.chtg(_tg,res)
end end
function cm.chval(_val,res) function cm.chval(_val,res)
return function(e,re,...) return function(e,re,...)
local x=re local x=nil
if aux.GetValueType(re)=="Effect" then x=re:GetHandler() else if aux.GetValueType(re)=="Effect" then x=re:GetHandler() elseif aux.GetValueType(re)=="Card" then
local rc=Duel.CreateToken(tp,m+50) local rc=Duel.CreateToken(tp,m+50)
re=rc:GetActivateEffect() re=rc:GetActivateEffect()
end else return res end
if x:IsHasEffect(m) then return res end if x and x:IsHasEffect(m) then return res end
return _val(e,re,...) return _val(e,re,...)
end end
end end
......
...@@ -60,7 +60,7 @@ function cm.chainfilter(re,tp,cid) ...@@ -60,7 +60,7 @@ function cm.chainfilter(re,tp,cid)
return not re:IsActiveType(TYPE_MONSTER) return not re:IsActiveType(TYPE_MONSTER)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local cost=Duel.GetMatchingGroup(function(c)return c:IsSetCard(0x553b) and c:IsReleasable()end,tp,LOCATION_ONFIELD,0,nil) local cost=Duel.GetMatchingGroup(function(c)return c:IsSetCard(0x553b) and c:IsReleasable()end,tp,LOCATION_ONFIELD,0,e:GetHandler())
if chk==0 then return #cost>0 and not e:GetHandler():IsForbidden() and e:GetHandler():CheckUniqueOnField(tp) and Duel.GetCustomActivityCount(m,tp,ACTIVITY_CHAIN)==0 end if chk==0 then return #cost>0 and not e:GetHandler():IsForbidden() and e:GetHandler():CheckUniqueOnField(tp) and Duel.GetCustomActivityCount(m,tp,ACTIVITY_CHAIN)==0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=cost:Select(tp,1,1,e:GetHandler()) local g=cost:Select(tp,1,1,e:GetHandler())
...@@ -202,6 +202,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -202,6 +202,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
for _,te3 in pairs(re3) do for _,te3 in pairs(re3) do
if not te3:GetLabelObject() then
local cost=te3:GetCost() local cost=te3:GetCost()
if cost and not cost(te3,te,tp) then if cost and not cost(te3,te,tp) then
local tg=te3:GetTarget() local tg=te3:GetTarget()
...@@ -211,6 +212,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -211,6 +212,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
end
local dc=Duel.CreateToken(tp,m+50) local dc=Duel.CreateToken(tp,m+50)
local de=dc:GetActivateEffect() local de=dc:GetActivateEffect()
local ae2={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_ACTIVATE)} local ae2={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_ACTIVATE)}
...@@ -224,6 +226,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -224,6 +226,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
for _,te3 in pairs(ae3) do for _,te3 in pairs(ae3) do
if not te3:GetLabelObject() then
local cost=te3:GetCost() local cost=te3:GetCost()
if cost and not cost(te3,de,tp) then if cost and not cost(te3,de,tp) then
local tg=te3:GetTarget() local tg=te3:GetTarget()
...@@ -233,6 +236,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -233,6 +236,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
end
local ret1,ret2={},{} local ret1,ret2={},{}
for k,v1 in pairs(t1) do for k,v1 in pairs(t1) do
local equal=false local equal=false
...@@ -288,6 +292,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -288,6 +292,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
if ret2[k]==5 then if ret2[k]==5 then
if not v:GetLabelObject() then
local cost=v:GetCost() local cost=v:GetCost()
if cost and not cost(v,te,tp) then if cost and not cost(v,te,tp) then
local tg=v:GetTarget() local tg=v:GetTarget()
...@@ -299,6 +304,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -299,6 +304,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
end
for k,v in pairs(ret3) do for k,v in pairs(ret3) do
if ret4[k]==4 then if ret4[k]==4 then
local val=v:GetValue() local val=v:GetValue()
...@@ -308,6 +314,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -308,6 +314,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
if ret4[k]==5 then if ret4[k]==5 then
if not v:GetLabelObject() then
local cost=v:GetCost() local cost=v:GetCost()
if cost and not cost(v,de,tp) then if cost and not cost(v,de,tp) then
local tg=v:GetTarget() local tg=v:GetTarget()
...@@ -319,6 +326,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -319,6 +326,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
end
end end
function cm.chcon(_con,res) function cm.chcon(_con,res)
return function(e,...) return function(e,...)
...@@ -342,12 +350,12 @@ function cm.chtg(_tg,res) ...@@ -342,12 +350,12 @@ function cm.chtg(_tg,res)
end end
function cm.chval(_val,res) function cm.chval(_val,res)
return function(e,re,...) return function(e,re,...)
local x=re local x=nil
if aux.GetValueType(re)=="Effect" then x=re:GetHandler() else if aux.GetValueType(re)=="Effect" then x=re:GetHandler() elseif aux.GetValueType(re)=="Card" then
local rc=Duel.CreateToken(tp,m+50) local rc=Duel.CreateToken(tp,m+50)
re=rc:GetActivateEffect() re=rc:GetActivateEffect()
end else return res end
if x:IsHasEffect(m) then return res end if x and x:IsHasEffect(m) then return res end
return _val(e,re,...) return _val(e,re,...)
end end
end end
......
...@@ -56,7 +56,7 @@ function cm.chainfilter(re,tp,cid) ...@@ -56,7 +56,7 @@ function cm.chainfilter(re,tp,cid)
return not re:IsActiveType(TYPE_MONSTER) return not re:IsActiveType(TYPE_MONSTER)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local cost=Duel.GetMatchingGroup(function(c)return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable()end,tp,LOCATION_ONFIELD,0,nil) local cost=Duel.GetMatchingGroup(function(c)return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable()end,tp,LOCATION_ONFIELD,0,e:GetHandler())
if chk==0 then return #cost>2 and not e:GetHandler():IsForbidden() and e:GetHandler():CheckUniqueOnField(tp) and Duel.GetCustomActivityCount(m,tp,ACTIVITY_CHAIN)==0 end if chk==0 then return #cost>2 and not e:GetHandler():IsForbidden() and e:GetHandler():CheckUniqueOnField(tp) and Duel.GetCustomActivityCount(m,tp,ACTIVITY_CHAIN)==0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=cost:Select(tp,3,3,e:GetHandler()) local g=cost:Select(tp,3,3,e:GetHandler())
...@@ -143,14 +143,15 @@ function cm.regop(e,tp,eg,ep,ev,re,r,rp) ...@@ -143,14 +143,15 @@ function cm.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+(m+50*e:GetLabel()),re,r,rp,ep,ev) Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+(m+50*e:GetLabel()),re,r,rp,ep,ev)
e:Reset() e:Reset()
end end
function cm.filter(c,e) function cm.filter(c,e,tp)
local ct,se,p=e:GetLabel() local ct,se,p=e:GetLabel()
local seq=c:GetSequence() local seq=c:GetSequence()
if c:IsLocation(LOCATION_MZONE) then seq=aux.MZoneSequence(c:GetSequence()) end if c:IsLocation(LOCATION_MZONE) then seq=aux.MZoneSequence(c:GetSequence()) end
return seq<5 and math.abs(se-math.abs(seq-4))==0 and c:IsAbleToGrave() if c:GetControler()~=tp then seq=math.abs(seq-4) end
return seq<5 and math.abs(se-seq)==0 and c:IsAbleToGrave()
end end
function cm.actg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.actg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return cm.filter(chkc,e) and chkc:IsOnField() end if chkc then return cm.filter(chkc,e,tp) and chkc:IsOnField() end
local c=e:GetHandler() local c=e:GetHandler()
local ct,se,p=e:GetLabel() local ct,se,p=e:GetLabel()
if chk==0 then if chk==0 then
...@@ -162,10 +163,10 @@ function cm.actg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -162,10 +163,10 @@ function cm.actg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
break break
end end
end end
return res and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,e) and c:IsLocation(LOCATION_GRAVE+LOCATION_MZONE) and c:GetType()&0x20004==0x20004 and c:GetControler()==p return res and Duel.IsExistingTarget(cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler(),e,tp) and c:IsLocation(LOCATION_GRAVE+LOCATION_MZONE) and c:GetType()&0x20004==0x20004 and c:GetControler()==p
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,e) local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler(),e,tp)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
local le={Duel.IsPlayerAffectedByEffect(tp,m)} local le={Duel.IsPlayerAffectedByEffect(tp,m)}
...@@ -313,6 +314,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -313,6 +314,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
for _,te3 in pairs(re3) do for _,te3 in pairs(re3) do
if not te3:GetLabelObject() then
local cost=te3:GetCost() local cost=te3:GetCost()
if cost and not cost(te3,te,tp) then if cost and not cost(te3,te,tp) then
local tg=te3:GetTarget() local tg=te3:GetTarget()
...@@ -322,6 +324,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -322,6 +324,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
end
local dc=Duel.CreateToken(tp,m+50) local dc=Duel.CreateToken(tp,m+50)
local de=dc:GetActivateEffect() local de=dc:GetActivateEffect()
de:SetCategory(CATEGORY_TOGRAVE) de:SetCategory(CATEGORY_TOGRAVE)
...@@ -336,6 +339,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -336,6 +339,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
for _,te3 in pairs(ae3) do for _,te3 in pairs(ae3) do
if not te3:GetLabelObject() then
local cost=te3:GetCost() local cost=te3:GetCost()
if cost and not cost(te3,de,tp) then if cost and not cost(te3,de,tp) then
local tg=te3:GetTarget() local tg=te3:GetTarget()
...@@ -345,6 +349,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -345,6 +349,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
end
local ret1,ret2={},{} local ret1,ret2={},{}
for k,v1 in pairs(t1) do for k,v1 in pairs(t1) do
local equal=false local equal=false
...@@ -400,6 +405,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -400,6 +405,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
if ret2[k]==5 then if ret2[k]==5 then
if not v:GetLabelObject() then
local cost=v:GetCost() local cost=v:GetCost()
if cost and not cost(v,te,tp) then if cost and not cost(v,te,tp) then
local tg=v:GetTarget() local tg=v:GetTarget()
...@@ -411,6 +417,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -411,6 +417,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
end
for k,v in pairs(ret3) do for k,v in pairs(ret3) do
if ret4[k]==4 then if ret4[k]==4 then
local val=v:GetValue() local val=v:GetValue()
...@@ -420,6 +427,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -420,6 +427,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
if ret4[k]==5 then if ret4[k]==5 then
if not v:GetLabelObject() then
local cost=v:GetCost() local cost=v:GetCost()
if cost and not cost(v,de,tp) then if cost and not cost(v,de,tp) then
local tg=v:GetTarget() local tg=v:GetTarget()
...@@ -431,6 +439,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -431,6 +439,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
end
end end
function cm.chcon(_con,res) function cm.chcon(_con,res)
return function(e,...) return function(e,...)
...@@ -454,12 +463,12 @@ function cm.chtg(_tg,res) ...@@ -454,12 +463,12 @@ function cm.chtg(_tg,res)
end end
function cm.chval(_val,res) function cm.chval(_val,res)
return function(e,re,...) return function(e,re,...)
local x=re local x=nil
if aux.GetValueType(re)=="Effect" then x=re:GetHandler() else if aux.GetValueType(re)=="Effect" then x=re:GetHandler() elseif aux.GetValueType(re)=="Card" then
local rc=Duel.CreateToken(tp,m+50) local rc=Duel.CreateToken(tp,m+50)
re=rc:GetActivateEffect() re=rc:GetActivateEffect()
end else return res end
if x:IsHasEffect(m) then return res end if x and x:IsHasEffect(m) then return res end
return _val(e,re,...) return _val(e,re,...)
end end
end end
......
...@@ -56,7 +56,7 @@ function cm.chainfilter(re,tp,cid) ...@@ -56,7 +56,7 @@ function cm.chainfilter(re,tp,cid)
return not re:IsActiveType(TYPE_MONSTER) return not re:IsActiveType(TYPE_MONSTER)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local cost=Duel.GetMatchingGroup(function(c)return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable()end,tp,LOCATION_ONFIELD,0,nil) local cost=Duel.GetMatchingGroup(function(c)return c:IsType(TYPE_CONTINUOUS) and c:IsReleasable()end,tp,LOCATION_ONFIELD,0,e:GetHandler())
if chk==0 then return #cost>2 and not e:GetHandler():IsForbidden() and e:GetHandler():CheckUniqueOnField(tp) and Duel.GetCustomActivityCount(m,tp,ACTIVITY_CHAIN)==0 end if chk==0 then return #cost>2 and not e:GetHandler():IsForbidden() and e:GetHandler():CheckUniqueOnField(tp) and Duel.GetCustomActivityCount(m,tp,ACTIVITY_CHAIN)==0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=cost:Select(tp,3,3,e:GetHandler()) local g=cost:Select(tp,3,3,e:GetHandler())
...@@ -140,14 +140,15 @@ function cm.regop(e,tp,eg,ep,ev,re,r,rp) ...@@ -140,14 +140,15 @@ function cm.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+(m+50*e:GetLabel()),re,r,rp,ep,ev) Duel.RaiseEvent(e:GetHandler(),EVENT_CUSTOM+(m+50*e:GetLabel()),re,r,rp,ep,ev)
e:Reset() e:Reset()
end end
function cm.filter(c,e) function cm.filter(c,e,tp)
local ct,se,p=e:GetLabel() local ct,se,p=e:GetLabel()
local seq=c:GetSequence() local seq=c:GetSequence()
if c:IsLocation(LOCATION_MZONE) then seq=aux.MZoneSequence(c:GetSequence()) end if c:IsLocation(LOCATION_MZONE) then seq=aux.MZoneSequence(c:GetSequence()) end
return seq<5 and math.abs(se-math.abs(seq-4))==1 and c:IsAbleToHand() if c:GetControler()~=tp then seq=math.abs(seq-4) end
return seq<5 and math.abs(se-seq)==1 and c:IsAbleToHand()
end end
function cm.actg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.actg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return cm.filter(chkc,e) and chkc:IsOnField() end if chkc then return cm.filter(chkc,e,tp) and chkc:IsOnField() end
local c=e:GetHandler() local c=e:GetHandler()
local ct,se,p=e:GetLabel() local ct,se,p=e:GetLabel()
if chk==0 then if chk==0 then
...@@ -159,10 +160,10 @@ function cm.actg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -159,10 +160,10 @@ function cm.actg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
break break
end end
end end
return res and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,e) and c:IsLocation(LOCATION_REMOVED) and c:GetType()&0x20004==0x20004 and c:GetControler()==p return res and Duel.IsExistingTarget(cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler(),e,tp) and c:IsLocation(LOCATION_REMOVED) and c:GetType()&0x20004==0x20004 and c:GetControler()==p
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,e) local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler(),e,tp)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
local le={Duel.IsPlayerAffectedByEffect(tp,m)} local le={Duel.IsPlayerAffectedByEffect(tp,m)}
...@@ -306,6 +307,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -306,6 +307,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
for _,te3 in pairs(re3) do for _,te3 in pairs(re3) do
if not te3:GetLabelObject() then
local cost=te3:GetCost() local cost=te3:GetCost()
if cost and not cost(te3,te,tp) then if cost and not cost(te3,te,tp) then
local tg=te3:GetTarget() local tg=te3:GetTarget()
...@@ -315,6 +317,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -315,6 +317,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
end
local dc=Duel.CreateToken(tp,m+50) local dc=Duel.CreateToken(tp,m+50)
local de=dc:GetActivateEffect() local de=dc:GetActivateEffect()
de:SetCategory(CATEGORY_RECOVER) de:SetCategory(CATEGORY_RECOVER)
...@@ -329,6 +332,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -329,6 +332,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
for _,te3 in pairs(ae3) do for _,te3 in pairs(ae3) do
if not te3:GetLabelObject() then
local cost=te3:GetCost() local cost=te3:GetCost()
if cost and not cost(te3,de,tp) then if cost and not cost(te3,de,tp) then
local tg=te3:GetTarget() local tg=te3:GetTarget()
...@@ -338,6 +342,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -338,6 +342,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
end
local ret1,ret2={},{} local ret1,ret2={},{}
for k,v1 in pairs(t1) do for k,v1 in pairs(t1) do
local equal=false local equal=false
...@@ -393,6 +398,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -393,6 +398,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
if ret2[k]==5 then if ret2[k]==5 then
if not v:GetLabelObject() then
local cost=v:GetCost() local cost=v:GetCost()
if cost and not cost(v,te,tp) then if cost and not cost(v,te,tp) then
local tg=v:GetTarget() local tg=v:GetTarget()
...@@ -404,6 +410,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -404,6 +410,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
end
for k,v in pairs(ret3) do for k,v in pairs(ret3) do
if ret4[k]==4 then if ret4[k]==4 then
local val=v:GetValue() local val=v:GetValue()
...@@ -413,6 +420,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -413,6 +420,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
if ret4[k]==5 then if ret4[k]==5 then
if not v:GetLabelObject() then
local cost=v:GetCost() local cost=v:GetCost()
if cost and not cost(v,de,tp) then if cost and not cost(v,de,tp) then
local tg=v:GetTarget() local tg=v:GetTarget()
...@@ -424,6 +432,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -424,6 +432,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
end
end end
function cm.chcon(_con,res) function cm.chcon(_con,res)
return function(e,...) return function(e,...)
...@@ -447,12 +456,12 @@ function cm.chtg(_tg,res) ...@@ -447,12 +456,12 @@ function cm.chtg(_tg,res)
end end
function cm.chval(_val,res) function cm.chval(_val,res)
return function(e,re,...) return function(e,re,...)
local x=re local x=nil
if aux.GetValueType(re)=="Effect" then x=re:GetHandler() else if aux.GetValueType(re)=="Effect" then x=re:GetHandler() elseif aux.GetValueType(re)=="Card" then
local rc=Duel.CreateToken(tp,m+50) local rc=Duel.CreateToken(tp,m+50)
re=rc:GetActivateEffect() re=rc:GetActivateEffect()
end else return res end
if x:IsHasEffect(m) then return res end if x and x:IsHasEffect(m) then return res end
return _val(e,re,...) return _val(e,re,...)
end end
end end
......
...@@ -55,7 +55,7 @@ function cm.chainfilter(re,tp,cid) ...@@ -55,7 +55,7 @@ function cm.chainfilter(re,tp,cid)
return not re:IsActiveType(TYPE_MONSTER) return not re:IsActiveType(TYPE_MONSTER)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local cost=Duel.GetMatchingGroup(function(c)return c:IsSetCard(0x353b) and c:IsReleasable()end,tp,LOCATION_ONFIELD,0,nil) local cost=Duel.GetMatchingGroup(function(c)return c:IsSetCard(0x353b) and c:IsReleasable()end,tp,LOCATION_ONFIELD,0,e:GetHandler())
if chk==0 then return #cost>1 and not e:GetHandler():IsForbidden() and e:GetHandler():CheckUniqueOnField(tp) and Duel.GetCustomActivityCount(m,tp,ACTIVITY_CHAIN)==0 end if chk==0 then return #cost>1 and not e:GetHandler():IsForbidden() and e:GetHandler():CheckUniqueOnField(tp) and Duel.GetCustomActivityCount(m,tp,ACTIVITY_CHAIN)==0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=cost:Select(tp,2,2,e:GetHandler()) local g=cost:Select(tp,2,2,e:GetHandler())
...@@ -169,6 +169,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -169,6 +169,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
for _,te3 in pairs(re3) do for _,te3 in pairs(re3) do
if not te3:GetLabelObject() then
local cost=te3:GetCost() local cost=te3:GetCost()
if cost and not cost(te3,te,tp) then if cost and not cost(te3,te,tp) then
local tg=te3:GetTarget() local tg=te3:GetTarget()
...@@ -178,6 +179,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -178,6 +179,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
end
local dc=Duel.CreateToken(tp,m+50) local dc=Duel.CreateToken(tp,m+50)
local de=dc:GetActivateEffect() local de=dc:GetActivateEffect()
local ae2={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_ACTIVATE)} local ae2={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_ACTIVATE)}
...@@ -191,6 +193,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -191,6 +193,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
for _,te3 in pairs(ae3) do for _,te3 in pairs(ae3) do
if not te3:GetLabelObject() then
local cost=te3:GetCost() local cost=te3:GetCost()
if cost and not cost(te3,de,tp) then if cost and not cost(te3,de,tp) then
local tg=te3:GetTarget() local tg=te3:GetTarget()
...@@ -200,6 +203,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -200,6 +203,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
end
local ret1,ret2={},{} local ret1,ret2={},{}
for k,v1 in pairs(t1) do for k,v1 in pairs(t1) do
local equal=false local equal=false
...@@ -255,6 +259,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -255,6 +259,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
if ret2[k]==5 then if ret2[k]==5 then
if not v:GetLabelObject() then
local cost=v:GetCost() local cost=v:GetCost()
if cost and not cost(v,te,tp) then if cost and not cost(v,te,tp) then
local tg=v:GetTarget() local tg=v:GetTarget()
...@@ -266,6 +271,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -266,6 +271,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
end
for k,v in pairs(ret3) do for k,v in pairs(ret3) do
if ret4[k]==4 then if ret4[k]==4 then
local val=v:GetValue() local val=v:GetValue()
...@@ -275,6 +281,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -275,6 +281,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
if ret4[k]==5 then if ret4[k]==5 then
if not v:GetLabelObject() then
local cost=v:GetCost() local cost=v:GetCost()
if cost and not cost(v,de,tp) then if cost and not cost(v,de,tp) then
local tg=v:GetTarget() local tg=v:GetTarget()
...@@ -286,6 +293,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -286,6 +293,7 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
end
end end
function cm.chcon(_con,res) function cm.chcon(_con,res)
return function(e,...) return function(e,...)
...@@ -309,12 +317,12 @@ function cm.chtg(_tg,res) ...@@ -309,12 +317,12 @@ function cm.chtg(_tg,res)
end end
function cm.chval(_val,res) function cm.chval(_val,res)
return function(e,re,...) return function(e,re,...)
local x=re local x=nil
if aux.GetValueType(re)=="Effect" then x=re:GetHandler() else if aux.GetValueType(re)=="Effect" then x=re:GetHandler() elseif aux.GetValueType(re)=="Card" then
local rc=Duel.CreateToken(tp,m+50) local rc=Duel.CreateToken(tp,m+50)
re=rc:GetActivateEffect() re=rc:GetActivateEffect()
end else return res end
if x:IsHasEffect(m) then return res end if x and x:IsHasEffect(m) then return res end
return _val(e,re,...) return _val(e,re,...)
end end
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