Commit c24f7efb authored by POLYMER's avatar POLYMER

fix

parent 5bc0ad4d
...@@ -48,6 +48,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -48,6 +48,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
if chk==0 then return e:IsCostChecked() and Duel.IsExistingTarget(cm.filter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,e:GetHandler()) end if chk==0 then return e:IsCostChecked() and Duel.IsExistingTarget(cm.filter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,e:GetHandler()) end
e:SetProperty(EFFECT_FLAG_CARD_TARGET) e:SetProperty(EFFECT_FLAG_CARD_TARGET)
if e:GetCode()==EVENT_CHAINING then
local _GetCurrentChain=Duel.GetCurrentChain local _GetCurrentChain=Duel.GetCurrentChain
Duel.GetCurrentChain=function() return _GetCurrentChain()-1 end Duel.GetCurrentChain=function() return _GetCurrentChain()-1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
...@@ -66,6 +67,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -66,6 +67,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
e:SetLabelObject(te) e:SetLabelObject(te)
Duel.ClearOperationInfo(0) Duel.ClearOperationInfo(0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
...@@ -87,11 +89,12 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -87,11 +89,12 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
e:SetLabelObject(te:GetLabelObject()) e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation() local op=te:GetOperation()
if op then if op then
if e:GetCode()==EVENT_CHAINING then op(e,tp,eg,ep,ev,re,r,rp)
--[[if e:GetCode()==EVENT_CHAINING then
op(e,tp,eg,ep,ev,re,r,rp) op(e,tp,eg,ep,ev,re,r,rp)
else else
op(e,tp,Group.FromCards(te:GetHandler()),PLAYER_NONE,ev,te,r,PLAYER_NONE) op(e,tp,Group.FromCards(te:GetHandler()),PLAYER_NONE,ev,te,r,PLAYER_NONE)
end end--]]
end end
end end
end end
...@@ -285,15 +288,22 @@ function cm.chop(e,tp,eg,ep,ev,re,r,rp) ...@@ -285,15 +288,22 @@ function cm.chop(e,tp,eg,ep,ev,re,r,rp)
if re:GetLabel()&0x49249~=0 then re:SetLabel(re:GetLabel()+0x8) return end if re:GetLabel()&0x49249~=0 then re:SetLabel(re:GetLabel()+0x8) return end
re:SetLabel(re:GetLabel()+0x8) re:SetLabel(re:GetLabel()+0x8)
local op=re:GetOperation() local op=re:GetOperation()
local repop=function(e,tp,eg,ep,ev,re,r,rp) if re:GetHandler():GetOriginalCode()==11451510 then
op(e,tp,eg,ep,ev,re,r,rp) repop=function(e,tp,eg,ep,ev,re,r,rp)
cm.addition(e,tp,eg,ep,ev,re,r,rp) cm.addition(e,tp,eg,ep,ev,re,r,rp)
op(e,tp,eg,ep,ev,re,r,rp)
end end
if re:GetHandler():GetOriginalCode()==11451510 or (aux.GetValueType(re:GetLabelObject())=="Effect" and re:GetLabelObject():GetHandler():GetOriginalCode()==11451510) then elseif (aux.GetValueType(re:GetLabelObject())=="Effect" and re:GetLabelObject():GetHandler():GetOriginalCode()==11451510) then
local op=re:GetLabelObject():GetOperation()
repop=function(e,tp,eg,ep,ev,re,r,rp) repop=function(e,tp,eg,ep,ev,re,r,rp)
cm.addition(e,tp,eg,ep,ev,re,r,rp) cm.addition(e,tp,eg,ep,ev,re,r,rp)
op(e,tp,eg,ep,ev,re,r,rp) op(e,tp,eg,ep,ev,re,r,rp)
end end
else
repop=function(e,tp,eg,ep,ev,re,r,rp)
op(e,tp,eg,ep,ev,re,r,rp)
cm.addition(e,tp,eg,ep,ev,re,r,rp)
end
end end
re:SetOperation(repop) re:SetOperation(repop)
end end
\ No newline at end of file
...@@ -100,7 +100,10 @@ function cm.initial_effect(c) ...@@ -100,7 +100,10 @@ function cm.initial_effect(c)
end end
function cm.filter(c,event) function cm.filter(c,event)
if not (c:IsCanOverlay(tp) and c:GetType()&0x100004==0x100004) then return false end if not (c:IsCanOverlay(tp) and c:GetType()&0x100004==0x100004) then return false end
local _IsCostChecked=Effect.IsCostChecked
Effect.IsCostChecked=function(e) return true end
local te=c:CheckActivateEffect(false,true,false) local te=c:CheckActivateEffect(false,true,false)
Effect.IsCostChecked=_IsCostChecked
return te --and te:GetCode()==event return te --and te:GetCode()==event
end end
function cm.adtg(event) function cm.adtg(event)
......
...@@ -116,7 +116,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -116,7 +116,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,aux.ExceptThisCard(e)) local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,aux.ExceptThisCard(e))
if #rg==0 or Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)*2+#g<#rg then return end if #rg==0 or Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)*2+#g<#rg then return end
local t={} local t={}
for ac=math.min(#rg,Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)),math.max(0,math.ceil((#rg-#g)/2)),-1 do for ac=math.max(0,math.ceil((#rg-#g)/2)),math.min(#rg,Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)),1 do
table.insert(t,ac) table.insert(t,ac)
end end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,3)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,3))
......
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