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

fix

parent 0a729313
......@@ -197,12 +197,14 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end
end
for _,te3 in pairs(re3) do
local cost=te3:GetCost()
if cost and not cost(te3,te,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,e,tp) then
table.insert(t1,te3)
table.insert(t2,5)
if not te3:GetLabelObject() then
local cost=te3:GetCost()
if cost and not cost(te3,te,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,e,tp) then
table.insert(t1,te3)
table.insert(t2,5)
end
end
end
end
......@@ -219,12 +221,14 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end
end
for _,te3 in pairs(ae3) do
local cost=te3:GetCost()
if cost and not cost(te3,de,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,de,tp) then
table.insert(t3,te3)
table.insert(t4,5)
if not te3:GetLabelObject() then
local cost=te3:GetCost()
if cost and not cost(te3,de,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,de,tp) then
table.insert(t3,te3)
table.insert(t4,5)
end
end
end
end
......@@ -283,13 +287,15 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end
end
if ret2[k]==5 then
local cost=v:GetCost()
if cost and not cost(v,te,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,false))
elseif tg(v,te,tp) then
v:SetTarget(cm.chtg2(tg,false))
if not v:GetLabelObject() then
local cost=v:GetCost()
if cost and not cost(v,te,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,false))
elseif tg(v,te,tp) then
v:SetTarget(cm.chtg2(tg,false))
end
end
end
end
......@@ -303,13 +309,15 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end
end
if ret4[k]==5 then
local cost=v:GetCost()
if cost and not cost(v,de,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,true))
elseif tg(v,de,tp) then
v:SetTarget(cm.chtg2(tg,true))
if not v:GetLabelObject() then
local cost=v:GetCost()
if cost and not cost(v,de,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,true))
elseif tg(v,de,tp) then
v:SetTarget(cm.chtg2(tg,true))
end
end
end
end
......@@ -337,12 +345,12 @@ function cm.chtg(_tg,res)
end
function cm.chval(_val,res)
return function(e,re,...)
local x=re
if aux.GetValueType(re)=="Effect" then x=re:GetHandler() else
local x=nil
if aux.GetValueType(re)=="Effect" then x=re:GetHandler() elseif aux.GetValueType(re)=="Card" then
local rc=Duel.CreateToken(tp,m+50)
re=rc:GetActivateEffect()
end
if x:IsHasEffect(m) then return res end
else return res end
if x and x:IsHasEffect(m) then return res end
return _val(e,re,...)
end
end
......
......@@ -60,7 +60,7 @@ function cm.chainfilter(re,tp,cid)
return not re:IsActiveType(TYPE_MONSTER)
end
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
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=cost:Select(tp,1,1,e:GetHandler())
......@@ -202,12 +202,14 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end
end
for _,te3 in pairs(re3) do
local cost=te3:GetCost()
if cost and not cost(te3,te,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,e,tp) then
table.insert(t1,te3)
table.insert(t2,5)
if not te3:GetLabelObject() then
local cost=te3:GetCost()
if cost and not cost(te3,te,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,e,tp) then
table.insert(t1,te3)
table.insert(t2,5)
end
end
end
end
......@@ -224,12 +226,14 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end
end
for _,te3 in pairs(ae3) do
local cost=te3:GetCost()
if cost and not cost(te3,de,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,de,tp) then
table.insert(t3,te3)
table.insert(t4,5)
if not te3:GetLabelObject() then
local cost=te3:GetCost()
if cost and not cost(te3,de,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,de,tp) then
table.insert(t3,te3)
table.insert(t4,5)
end
end
end
end
......@@ -288,13 +292,15 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end
end
if ret2[k]==5 then
local cost=v:GetCost()
if cost and not cost(v,te,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,false))
elseif tg(v,te,tp) then
v:SetTarget(cm.chtg2(tg,false))
if not v:GetLabelObject() then
local cost=v:GetCost()
if cost and not cost(v,te,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,false))
elseif tg(v,te,tp) then
v:SetTarget(cm.chtg2(tg,false))
end
end
end
end
......@@ -308,13 +314,15 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end
end
if ret4[k]==5 then
local cost=v:GetCost()
if cost and not cost(v,de,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,true))
elseif tg(v,de,tp) then
v:SetTarget(cm.chtg2(tg,true))
if not v:GetLabelObject() then
local cost=v:GetCost()
if cost and not cost(v,de,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,true))
elseif tg(v,de,tp) then
v:SetTarget(cm.chtg2(tg,true))
end
end
end
end
......@@ -342,12 +350,12 @@ function cm.chtg(_tg,res)
end
function cm.chval(_val,res)
return function(e,re,...)
local x=re
if aux.GetValueType(re)=="Effect" then x=re:GetHandler() else
local x=nil
if aux.GetValueType(re)=="Effect" then x=re:GetHandler() elseif aux.GetValueType(re)=="Card" then
local rc=Duel.CreateToken(tp,m+50)
re=rc:GetActivateEffect()
end
if x:IsHasEffect(m) then return res end
else return res end
if x and x:IsHasEffect(m) then return res end
return _val(e,re,...)
end
end
......
......@@ -56,7 +56,7 @@ function cm.chainfilter(re,tp,cid)
return not re:IsActiveType(TYPE_MONSTER)
end
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
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=cost:Select(tp,3,3,e:GetHandler())
......@@ -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)
e:Reset()
end
function cm.filter(c,e)
function cm.filter(c,e,tp)
local ct,se,p=e:GetLabel()
local seq=c:GetSequence()
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
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 ct,se,p=e:GetLabel()
if chk==0 then
......@@ -162,10 +163,10 @@ function cm.actg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
break
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
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.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
local le={Duel.IsPlayerAffectedByEffect(tp,m)}
......@@ -313,12 +314,14 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end
end
for _,te3 in pairs(re3) do
local cost=te3:GetCost()
if cost and not cost(te3,te,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,e,tp) then
table.insert(t1,te3)
table.insert(t2,5)
if not te3:GetLabelObject() then
local cost=te3:GetCost()
if cost and not cost(te3,te,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,e,tp) then
table.insert(t1,te3)
table.insert(t2,5)
end
end
end
end
......@@ -336,12 +339,14 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end
end
for _,te3 in pairs(ae3) do
local cost=te3:GetCost()
if cost and not cost(te3,de,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,de,tp) then
table.insert(t3,te3)
table.insert(t4,5)
if not te3:GetLabelObject() then
local cost=te3:GetCost()
if cost and not cost(te3,de,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,de,tp) then
table.insert(t3,te3)
table.insert(t4,5)
end
end
end
end
......@@ -400,13 +405,15 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end
end
if ret2[k]==5 then
local cost=v:GetCost()
if cost and not cost(v,te,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,false))
elseif tg(v,te,tp) then
v:SetTarget(cm.chtg2(tg,false))
if not v:GetLabelObject() then
local cost=v:GetCost()
if cost and not cost(v,te,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,false))
elseif tg(v,te,tp) then
v:SetTarget(cm.chtg2(tg,false))
end
end
end
end
......@@ -420,13 +427,15 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end
end
if ret4[k]==5 then
local cost=v:GetCost()
if cost and not cost(v,de,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,true))
elseif tg(v,de,tp) then
v:SetTarget(cm.chtg2(tg,true))
if not v:GetLabelObject() then
local cost=v:GetCost()
if cost and not cost(v,de,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,true))
elseif tg(v,de,tp) then
v:SetTarget(cm.chtg2(tg,true))
end
end
end
end
......@@ -454,12 +463,12 @@ function cm.chtg(_tg,res)
end
function cm.chval(_val,res)
return function(e,re,...)
local x=re
if aux.GetValueType(re)=="Effect" then x=re:GetHandler() else
local x=nil
if aux.GetValueType(re)=="Effect" then x=re:GetHandler() elseif aux.GetValueType(re)=="Card" then
local rc=Duel.CreateToken(tp,m+50)
re=rc:GetActivateEffect()
end
if x:IsHasEffect(m) then return res end
else return res end
if x and x:IsHasEffect(m) then return res end
return _val(e,re,...)
end
end
......
......@@ -56,7 +56,7 @@ function cm.chainfilter(re,tp,cid)
return not re:IsActiveType(TYPE_MONSTER)
end
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
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=cost:Select(tp,3,3,e:GetHandler())
......@@ -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)
e:Reset()
end
function cm.filter(c,e)
function cm.filter(c,e,tp)
local ct,se,p=e:GetLabel()
local seq=c:GetSequence()
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
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 ct,se,p=e:GetLabel()
if chk==0 then
......@@ -159,10 +160,10 @@ function cm.actg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
break
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
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.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
local le={Duel.IsPlayerAffectedByEffect(tp,m)}
......@@ -306,12 +307,14 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end
end
for _,te3 in pairs(re3) do
local cost=te3:GetCost()
if cost and not cost(te3,te,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,e,tp) then
table.insert(t1,te3)
table.insert(t2,5)
if not te3:GetLabelObject() then
local cost=te3:GetCost()
if cost and not cost(te3,te,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,e,tp) then
table.insert(t1,te3)
table.insert(t2,5)
end
end
end
end
......@@ -329,12 +332,14 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end
end
for _,te3 in pairs(ae3) do
local cost=te3:GetCost()
if cost and not cost(te3,de,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,de,tp) then
table.insert(t3,te3)
table.insert(t4,5)
if not te3:GetLabelObject() then
local cost=te3:GetCost()
if cost and not cost(te3,de,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,de,tp) then
table.insert(t3,te3)
table.insert(t4,5)
end
end
end
end
......@@ -393,13 +398,15 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end
end
if ret2[k]==5 then
local cost=v:GetCost()
if cost and not cost(v,te,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,false))
elseif tg(v,te,tp) then
v:SetTarget(cm.chtg2(tg,false))
if not v:GetLabelObject() then
local cost=v:GetCost()
if cost and not cost(v,te,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,false))
elseif tg(v,te,tp) then
v:SetTarget(cm.chtg2(tg,false))
end
end
end
end
......@@ -413,13 +420,15 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end
end
if ret4[k]==5 then
local cost=v:GetCost()
if cost and not cost(v,de,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,true))
elseif tg(v,de,tp) then
v:SetTarget(cm.chtg2(tg,true))
if not v:GetLabelObject() then
local cost=v:GetCost()
if cost and not cost(v,de,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,true))
elseif tg(v,de,tp) then
v:SetTarget(cm.chtg2(tg,true))
end
end
end
end
......@@ -447,12 +456,12 @@ function cm.chtg(_tg,res)
end
function cm.chval(_val,res)
return function(e,re,...)
local x=re
if aux.GetValueType(re)=="Effect" then x=re:GetHandler() else
local x=nil
if aux.GetValueType(re)=="Effect" then x=re:GetHandler() elseif aux.GetValueType(re)=="Card" then
local rc=Duel.CreateToken(tp,m+50)
re=rc:GetActivateEffect()
end
if x:IsHasEffect(m) then return res end
else return res end
if x and x:IsHasEffect(m) then return res end
return _val(e,re,...)
end
end
......
......@@ -55,7 +55,7 @@ function cm.chainfilter(re,tp,cid)
return not re:IsActiveType(TYPE_MONSTER)
end
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
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=cost:Select(tp,2,2,e:GetHandler())
......@@ -169,12 +169,14 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end
end
for _,te3 in pairs(re3) do
local cost=te3:GetCost()
if cost and not cost(te3,te,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,e,tp) then
table.insert(t1,te3)
table.insert(t2,5)
if not te3:GetLabelObject() then
local cost=te3:GetCost()
if cost and not cost(te3,te,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,e,tp) then
table.insert(t1,te3)
table.insert(t2,5)
end
end
end
end
......@@ -191,12 +193,14 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end
end
for _,te3 in pairs(ae3) do
local cost=te3:GetCost()
if cost and not cost(te3,de,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,de,tp) then
table.insert(t3,te3)
table.insert(t4,5)
if not te3:GetLabelObject() then
local cost=te3:GetCost()
if cost and not cost(te3,de,tp) then
local tg=te3:GetTarget()
if not tg or tg(te3,de,tp) then
table.insert(t3,te3)
table.insert(t4,5)
end
end
end
end
......@@ -255,13 +259,15 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end
end
if ret2[k]==5 then
local cost=v:GetCost()
if cost and not cost(v,te,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,false))
elseif tg(v,te,tp) then
v:SetTarget(cm.chtg2(tg,false))
if not v:GetLabelObject() then
local cost=v:GetCost()
if cost and not cost(v,te,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,false))
elseif tg(v,te,tp) then
v:SetTarget(cm.chtg2(tg,false))
end
end
end
end
......@@ -275,13 +281,15 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
end
end
if ret4[k]==5 then
local cost=v:GetCost()
if cost and not cost(v,de,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,true))
elseif tg(v,de,tp) then
v:SetTarget(cm.chtg2(tg,true))
if not v:GetLabelObject() then
local cost=v:GetCost()
if cost and not cost(v,de,tp) then
local tg=v:GetTarget()
if not tg then
v:SetTarget(cm.chtg2(aux.TRUE,true))
elseif tg(v,de,tp) then
v:SetTarget(cm.chtg2(tg,true))
end
end
end
end
......@@ -309,12 +317,12 @@ function cm.chtg(_tg,res)
end
function cm.chval(_val,res)
return function(e,re,...)
local x=re
if aux.GetValueType(re)=="Effect" then x=re:GetHandler() else
local x=nil
if aux.GetValueType(re)=="Effect" then x=re:GetHandler() elseif aux.GetValueType(re)=="Card" then
local rc=Duel.CreateToken(tp,m+50)
re=rc:GetActivateEffect()
end
if x:IsHasEffect(m) then return res end
else return res end
if x and x:IsHasEffect(m) then return res end
return _val(e,re,...)
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