Commit d7cd037b authored by POLYMER's avatar POLYMER

fix

parent 306cfab1
...@@ -70,19 +70,19 @@ function cm.spcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -70,19 +70,19 @@ function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local se=e:GetLabelObject():GetLabelObject() local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(cm.spfilter,1,nil,se) return eg:IsExists(cm.spfilter,1,nil,se)
end end
function cm.refilter(c) function cm.refilter(c,tp)
return c:IsAbleToRemove() and c:IsSetCard(0x9977) and c:IsFaceup() return c:IsAbleToRemove() and c:IsSetCard(0x9977) and c:IsFaceup() and (Duel.GetLocationCount(tp,LOCATION_SZONE)>0 or c:IsLocation(LOCATION_SZONE))
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.refilter,tp,LOCATION_ONFIELD,0,1,nil) and c:IsSSetable() and c:GetFlagEffect(m-10)==0 end if chk==0 then return Duel.IsExistingMatchingCard(cm.refilter,tp,LOCATION_ONFIELD,0,1,nil,tp) and c:IsSSetable(true) and c:GetFlagEffect(m-10)==0 end
c:RegisterFlagEffect(m-10,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1) c:RegisterFlagEffect(m-10,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_ONFIELD) Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_ONFIELD)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.refilter,tp,LOCATION_ONFIELD,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.refilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp)
if Duel.Remove(g,POS_FACEUP,REASON_EFFECT)>0 and c:IsRelateToEffect(e) then if Duel.Remove(g,POS_FACEUP,REASON_EFFECT)>0 and c:IsRelateToEffect(e) then
Duel.SSet(tp,c) Duel.SSet(tp,c)
end end
......
...@@ -93,6 +93,20 @@ function cm.GetHandEffect(c,tc) ...@@ -93,6 +93,20 @@ function cm.GetHandEffect(c,tc)
if cm.urara_cache[code] then return cm.urara_cache[code] end if cm.urara_cache[code] then return cm.urara_cache[code] end
local eset={} local eset={}
local temp=Card.RegisterEffect local temp=Card.RegisterEffect
local _SetRange=Effect.SetRange
function Effect.SetRange(e,r,...)
table_range=table_range or {}
table_range[e]=r
return _SetRange(e,r,...)
end
if not Effect.GetRange then
function Effect.GetRange(e)
if table_range and table_range[e] then
return table_range[e]
end
return 0
end
end
Card.RegisterEffect=function(tc,e,f) Card.RegisterEffect=function(tc,e,f)
if (e:GetRange()&LOCATION_HAND)>0 and e:IsHasType(EFFECT_TYPE_IGNITION+EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O) then if (e:GetRange()&LOCATION_HAND)>0 and e:IsHasType(EFFECT_TYPE_IGNITION+EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O) then
local found=false local found=false
......
...@@ -26,14 +26,14 @@ function cm.initial_effect(c) ...@@ -26,14 +26,14 @@ function cm.initial_effect(c)
e11:SetCode(EVENT_PHASE+PHASE_DRAW) e11:SetCode(EVENT_PHASE+PHASE_DRAW)
e11:SetCountLimit(1) e11:SetCountLimit(1)
e11:SetOperation(cm.thop) e11:SetOperation(cm.thop)
-- Duel.RegisterEffect(e11,0) -- Duel.RegisterEffect(e11,0)
end end
end end
function cm.thop(e,tp,eg,ep,ev,re,r,rp) function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local s=math.random(0,9) local s=math.random(0,9)
local s1=s*1000000 local s1=s*1000000
local s2=s1+999999 local s2=s1+999999
for i=1,9999999 do for i=1,9999999 do
local mt1=cm.load_metatable(i) local mt1=cm.load_metatable(i)
if mt1 then if mt1 then
...@@ -58,55 +58,55 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -58,55 +58,55 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
e:SetLabel(0) e:SetLabel(0)
local c=e:GetHandler() local c=e:GetHandler()
--[[ --[[
local codelist={} local codelist={}
local s=math.random(0,9) local s=math.random(0,9)
local s1=s*1000000 local s1=s*1000000
local s2=s1+999999 local s2=s1+999999
math.randomseed(tostring(os.time()):reverse():sub(1, 6)) math.randomseed(tostring(os.time()):reverse():sub(1, 6))
]]-- ]]--
local codelist2=0 local codelist2=0
for i=1,9999999 do for i=1,9999999 do
if codelist2~=0 then if codelist2~=0 then
break break
end end
local l=Duel.GetRandomNumber(1,9999999)--math.random(1,9999999) local l=Duel.GetRandomNumber(1,99999999)--math.random(1,9999999)
--local l=math.random(1,#cm.loaded_metatable_list2) --local l=math.random(1,#cm.loaded_metatable_list2)
--local mt=cm.load_metatable(l) --local mt=cm.load_metatable(l)
local mt=cm.load_metatable_load(l) local mt=cm.load_metatable_load(l)
if mt then if mt then
local token=Duel.CreateToken(tp,l) local token=Duel.CreateToken(tp,l)
if token and (token:IsType(TYPE_SPELL) or token:IsType(TYPE_TRAP)) and not token:IsType(TYPE_EQUIP) if token and (token:IsType(TYPE_SPELL) or token:IsType(TYPE_TRAP)) and not token:IsType(TYPE_EQUIP)
and-- not token:IsType(TYPE_CONTINUOUS) and and-- not token:IsType(TYPE_CONTINUOUS) and
not token:IsType(TYPE_FIELD) not token:IsType(TYPE_FIELD)
-- and not token:IsType(TYPE_FIELD) and not token:IsType(TYPE_CONTINUOUS) -- and not token:IsType(TYPE_FIELD) and not token:IsType(TYPE_CONTINUOUS)
and token:CheckActivateEffect(false,true,false)~=nil and token:CheckActivateEffect(false,true,false)~=nil
and token:CheckActivateEffect(false,true,false):GetOperation()~=nil then and token:CheckActivateEffect(false,true,false):GetOperation()~=nil then
-- table.insert(codelist,i) -- table.insert(codelist,i)
--[[local ab=codelist--cm.get_announce(codelist) --[[local ab=codelist--cm.get_announce(codelist)
for i=1,5 do for i=1,5 do
local p=math.random(1,#ab) local p=math.random(1,#ab)
table.insert(codelist2,1,ab[p]) table.insert(codelist2,1,ab[p])
end end
local ac=codelist2[1] ]]-- local ac=codelist2[1] ]]--
--if token:CheckActivateEffect(true,true,false)==nil then --if token:CheckActivateEffect(true,true,false)==nil then
-- e:SetLabelObject(nil) -- e:SetLabelObject(nil)
-- else -- else
-- c:SetHint(CHINT_CARD,l) -- c:SetHint(CHINT_CARD,l)
Duel.Hint(HINT_CARD,tp,l) Duel.Hint(HINT_CARD,tp,l)
Duel.Hint(HINT_CODE,1-tp,l) Duel.Hint(HINT_CODE,1-tp,l)
Duel.Hint(HINT_CODE,tp,l) Duel.Hint(HINT_CODE,tp,l)
local te,ceg,cep,cev,cre,cr,crp=token:CheckActivateEffect(true,true,true) local te,ceg,cep,cev,cre,cr,crp=token:CheckActivateEffect(true,true,true)
e:SetProperty(te:GetProperty()) e:SetProperty(te:GetProperty())
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET,0,1,0,0) c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET,0,1,0,0)
local tg=te:GetTarget() local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject()) te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te) e:SetLabelObject(te)
Duel.ClearOperationInfo(0) Duel.ClearOperationInfo(0)
--end --end
codelist2=codelist2+1 codelist2=codelist2+1
end end
end end
end end
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
...@@ -128,7 +128,7 @@ end ...@@ -128,7 +128,7 @@ end
function cm.get_announce(t) function cm.get_announce(t)
local rt={t[1],OPCODE_ISCODE} local rt={t[1],OPCODE_ISCODE}
for i=2,#t do for i=2,#t do
if not t[i] then break end if not t[i] then break end
table.insert(rt,t[i]) table.insert(rt,t[i])
table.insert(rt,OPCODE_ISCODE) table.insert(rt,OPCODE_ISCODE)
table.insert(rt,OPCODE_OR) table.insert(rt,OPCODE_OR)
...@@ -151,7 +151,7 @@ function cm.load_metatable(code) ...@@ -151,7 +151,7 @@ function cm.load_metatable(code)
local mt=_G["c"..code] local mt=_G["c"..code]
_G["c"..code]=nil _G["c"..code]=nil
if mt then if mt then
-- cm.loaded_metatable_list[code]=mt -- cm.loaded_metatable_list[code]=mt
return mt return mt
end end
else else
......
...@@ -61,13 +61,13 @@ end ...@@ -61,13 +61,13 @@ end
function c98920350.regop(e,tp,eg,ep,ev,re,r,rp) function c98920350.regop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabelObject():GetLabel() local ct=e:GetLabelObject():GetLabel()
e:GetLabelObject():SetLabel(ct+1) e:GetLabelObject():SetLabel(ct+1)
if rp~=tp and re:GetHandler():IsType(e:GetLabel()) then if rp~=tp and re:IsActiveType(e:GetLabel()) then
e:GetHandler():RegisterFlagEffect(98920350,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,0,1) e:GetHandler():RegisterFlagEffect(98920350,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,0,1)
end end
end end
function c98920350.damcon1(e,tp,eg,ep,ev,re,r,rp) function c98920350.damcon1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return ep~=tp and c:GetFlagEffect(98920350)~=0 and re:GetHandler():IsType(e:GetLabel()) return ep~=tp and c:GetFlagEffect(98920350)~=0 and re:IsActiveType(e:GetLabel())
end end
function c98920350.damop1(e,tp,eg,ep,ev,re,r,rp) function c98920350.damop1(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabelObject():GetLabel() local ct=e:GetLabelObject():GetLabel()
......
...@@ -53,7 +53,7 @@ function c9911510.limop(e,tp,eg,ep,ev,re,r,rp) ...@@ -53,7 +53,7 @@ function c9911510.limop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentChain()==0 then if Duel.GetCurrentChain()==0 then
Duel.SetChainLimitTillChainEnd(c9911510.chainlm) Duel.SetChainLimitTillChainEnd(c9911510.chainlm)
elseif Duel.GetCurrentChain()==1 then elseif Duel.GetCurrentChain()==1 then
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1) e:GetHandler():RegisterFlagEffect(9911510,RESET_EVENT+RESETS_STANDARD,0,1)
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:SetCode(EVENT_CHAINING) e1:SetCode(EVENT_CHAINING)
...@@ -66,14 +66,14 @@ function c9911510.limop(e,tp,eg,ep,ev,re,r,rp) ...@@ -66,14 +66,14 @@ function c9911510.limop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c9911510.resetop(e,tp,eg,ep,ev,re,r,rp) function c9911510.resetop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():ResetFlagEffect(id) e:GetHandler():ResetFlagEffect(9911510)
e:Reset() e:Reset()
end end
function c9911510.limop2(e,tp,eg,ep,ev,re,r,rp) function c9911510.limop2(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(id)~=0 then if e:GetHandler():GetFlagEffect(9911510)~=0 then
Duel.SetChainLimitTillChainEnd(c9911510.chainlm) Duel.SetChainLimitTillChainEnd(c9911510.chainlm)
end end
e:GetHandler():ResetFlagEffect(id) e:GetHandler():ResetFlagEffect(9911510)
end end
function c9911510.chainlm(e,rp,tp) function c9911510.chainlm(e,rp,tp)
return tp==rp return tp==rp
......
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