Commit 4116b0e7 authored by POLYMER's avatar POLYMER

fix

parent 600e3567
...@@ -57,7 +57,7 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -57,7 +57,7 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
return _SetProperty(pe,prop1,prop2) return _SetProperty(pe,prop1,prop2)
end end
Effect.Clone=function(pe) Effect.Clone=function(pe)
local ce=pe:Clone() local ce=_Clone(pe)
if cm.proeffects[pe] then if cm.proeffects[pe] then
cm.proeffects[ce]=cm.proeffects[pe] cm.proeffects[ce]=cm.proeffects[pe]
end end
......
...@@ -57,7 +57,7 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -57,7 +57,7 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
return _SetProperty(pe,prop1,prop2) return _SetProperty(pe,prop1,prop2)
end end
Effect.Clone=function(pe) Effect.Clone=function(pe)
local ce=pe:Clone() local ce=_Clone(pe)
if cm.proeffects[pe] then if cm.proeffects[pe] then
cm.proeffects[ce]=cm.proeffects[pe] cm.proeffects[ce]=cm.proeffects[pe]
end end
......
...@@ -57,7 +57,7 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -57,7 +57,7 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
return _SetProperty(pe,prop1,prop2) return _SetProperty(pe,prop1,prop2)
end end
Effect.Clone=function(pe) Effect.Clone=function(pe)
local ce=pe:Clone() local ce=_Clone(pe)
if cm.proeffects[pe] then if cm.proeffects[pe] then
cm.proeffects[ce]=cm.proeffects[pe] cm.proeffects[ce]=cm.proeffects[pe]
end end
......
...@@ -57,7 +57,7 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -57,7 +57,7 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
return _SetProperty(pe,prop1,prop2) return _SetProperty(pe,prop1,prop2)
end end
Effect.Clone=function(pe) Effect.Clone=function(pe)
local ce=pe:Clone() local ce=_Clone(pe)
if cm.proeffects[pe] then if cm.proeffects[pe] then
cm.proeffects[ce]=cm.proeffects[pe] cm.proeffects[ce]=cm.proeffects[pe]
end end
......
...@@ -154,8 +154,9 @@ function cm.reg2(c, ie, ob) ...@@ -154,8 +154,9 @@ function cm.reg2(c, ie, ob)
local b = ob or false local b = ob or false
local p = ie:GetCode() local p = ie:GetCode()
local id, ida = ie:GetCountLimit() local id, ida = ie:GetCountLimit()
if not aux.IsCodeListed(c, yr) and (not ie:IsActivated() or not id or not ida) or
bit.band(ie:GetProperty(), EFFECT_FLAG_CARD_TARGET) == 0 then if not aux.IsCodeListed(c, yr) or not ie:IsActivated() or (not id and not ida and
bit.band(ie:GetProperty(), EFFECT_FLAG_CARD_TARGET) == 0) then
return cm.reg(c, ie, b) return cm.reg(c, ie, b)
end end
-- Debug.Message(id, ida) -- Debug.Message(id, ida)
......
...@@ -40,8 +40,9 @@ end ...@@ -40,8 +40,9 @@ end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local code=e:GetLabel() if not c:IsRelateToEffect(e) or not tc:IsRelateToEffect(e) then return end
local name=e:GetLabelObject():GetOriginalCodeRule() local code=e:GetLabelObject():GetOriginalCodeRule()
if not getmetatable(tc) then code=80316585 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g1=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_DECK,0,1,1,nil,tp,c,tc) local g1=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_DECK,0,1,1,nil,tp,c,tc)
if g1:GetCount()==0 then return end if g1:GetCount()==0 then return end
...@@ -51,19 +52,63 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -51,19 +52,63 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE) e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(name) e1:SetValue(code)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1) c:RegisterEffect(e1)
c:ReplaceEffect(code,RESET_EVENT+RESETS_STANDARD) c:ReplaceEffect(code,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end end
if tc:IsRelateToEffect(e) and tc:IsPublic() then if tc:IsRelateToEffect(e) and tc:IsPublic() then
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_CODE) e2:SetCode(EFFECT_CHANGE_CODE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(g1:GetFirst():GetOriginalCode()) e2:SetValue(g1:GetFirst():GetOriginalCodeRule())
e2:SetReset(RESET_EVENT+RESETS_STANDARD) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
tc:ReplaceEffect(g1:GetFirst():GetOriginalCode(),RESET_EVENT+RESETS_STANDARD) local code2=g1:GetFirst():GetOriginalCode()
if not getmetatable(g1:GetFirst()) then code2=80316585 end
tc:ReplaceEffect(code2,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
if getmetatable(tc) then
s.proeffects=s.proeffects or {}
local _SetProperty=Effect.SetProperty
local _CRegisterEffect=Card.RegisterEffect
local _DRegisterEffect=Duel.RegisterEffect
local _Clone=Effect.Clone
Effect.SetProperty=function(pe,prop1,prop2)
if not prop2 then prop2=0 end
if prop1&EFFECT_FLAG_UNCOPYABLE~=0 then
s.proeffects[pe]={prop1,prop2}
prop1=prop1&(~EFFECT_FLAG_UNCOPYABLE)
else
s.proeffects[pe]=nil
prop1=prop1&(EFFECT_FLAG_UNCOPYABLE)
end
return _SetProperty(pe,prop1,prop2)
end
Card.RegisterEffect=function(c,pe,...)
if not pe:IsHasProperty(EFFECT_FLAG_UNCOPYABLE) and not s.proeffects[pe] and not pe:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
return _CRegisterEffect(c,pe,...)
end
Duel.RegisterEffect=function(pe,p,...)
if not pe:IsHasProperty(EFFECT_FLAG_UNCOPYABLE) and not s.proeffects[pe] then return end
return _DRegisterEffect(pe,p,...)
end
Effect.Clone=function(pe)
local ce=_Clone(pe)
if s.proeffects[pe] then
s.proeffects[ce]=s.proeffects[pe]
end
return ce
end
tc:CopyEffect(code,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
Effect.SetProperty=_SetProperty
Card.RegisterEffect=_CRegisterEffect
Duel.RegisterEffect=_DRegisterEffect
Effect.Clone=_Clone
for ke,vp in pairs(s.proeffects) do
local prop1,prop2=table.unpack(vp)
ke:SetProperty(prop1|EFFECT_FLAG_UNCOPYABLE,prop2)
end
end
end end
end 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