Commit 1b4d4cdb authored by Nemo Ma's avatar Nemo Ma

fix

parent ca17ba4c
...@@ -78,14 +78,16 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -78,14 +78,16 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then if chk==0 then
local res=true local res=true
if KOISHI_CHECK then if KOISHI_CHECK and cm[tp] then
Duel.DisableActionCheck(true) --[[Duel.DisableActionCheck(true)
local dc=Duel.CreateToken(tp,m) if not cm[tp] then
Duel.DisableActionCheck(false) cm[tp]=Duel.CreateToken(tp,m)
dc:SetCardData(CARDDATA_TYPE,TYPE_TRAP) end
res=dc:GetActivateEffect():IsActivatable(tp,true) local dc=cm[tp]
dc:SetCardData(CARDDATA_TYPE,TYPE_MONSTER+TYPE_PENDULUM+TYPE_EFFECT) Duel.DisableActionCheck(false)--]]
res=cm[tp]:GetActivateEffect():IsActivatable(tp,true)
else else
Debug.Message("11")
res=(c:CheckActivateEffect(false,false,false)~=nil) res=(c:CheckActivateEffect(false,false,false)~=nil)
end end
return res and ((Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsLocation(LOCATION_HAND)) or (Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsLocation(LOCATION_EXTRA))) return res and ((Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsLocation(LOCATION_HAND)) or (Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsLocation(LOCATION_EXTRA)))
...@@ -279,4 +281,10 @@ function cm.descon(e,tp,eg,ep,ev,re,r,rp) ...@@ -279,4 +281,10 @@ function cm.descon(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.desop(e,tp,eg,ep,ev,re,r,rp) function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT) Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end end
\ No newline at end of file Duel.DisableActionCheck(true)
cm[0]=Duel.CreateToken(0,m)
cm[1]=Duel.CreateToken(1,m)
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
Duel.DisableActionCheck(false)
\ No newline at end of file
...@@ -23,6 +23,7 @@ function cm.initial_effect(c) ...@@ -23,6 +23,7 @@ function cm.initial_effect(c)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetLabelObject(e1) e3:SetLabelObject(e1)
e3:SetTargetRange(1,0) e3:SetTargetRange(1,0)
--e3:SetCost(cm.chkac)
e3:SetTarget(cm.actarget) e3:SetTarget(cm.actarget)
e3:SetOperation(cm.costop) e3:SetOperation(cm.costop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
...@@ -87,13 +88,8 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -87,13 +88,8 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then if chk==0 then
local res=true local res=true
if KOISHI_CHECK then if KOISHI_CHECK and cm[tp] then
Duel.DisableActionCheck(true) res=cm[tp]:GetActivateEffect():IsActivatable(tp,true)
local dc=Duel.CreateToken(tp,m)
Duel.DisableActionCheck(false)
dc:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
res=dc:GetActivateEffect():IsActivatable(tp,true)
dc:SetCardData(CARDDATA_TYPE,TYPE_MONSTER+TYPE_PENDULUM+TYPE_EFFECT)
else else
res=(c:CheckActivateEffect(false,false,false)~=nil) res=(c:CheckActivateEffect(false,false,false)~=nil)
end end
...@@ -172,6 +168,20 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp) ...@@ -172,6 +168,20 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
Duel.SendtoHand(tc,1-tp,REASON_EFFECT) Duel.SendtoHand(tc,1-tp,REASON_EFFECT)
end end
function cm.chkac(e,c,tp)
local res=true
if KOISHI_CHECK then
Duel.DisableActionCheck(true)
local dc=Duel.CreateToken(tp,m)
Duel.DisableActionCheck(false)
dc:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
res=dc:GetActivateEffect():IsActivatable(tp,true)
dc:SetCardData(CARDDATA_TYPE,TYPE_MONSTER+TYPE_PENDULUM+TYPE_EFFECT)
else
res=(c:CheckActivateEffect(false,false,false)~=nil)
end
return res
end
function cm.actarget(e,te,tp) function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te==e:GetLabelObject() return te:GetHandler()==e:GetHandler() and te==e:GetLabelObject()
end end
...@@ -268,4 +278,10 @@ function cm.descon(e,tp,eg,ep,ev,re,r,rp) ...@@ -268,4 +278,10 @@ function cm.descon(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.desop(e,tp,eg,ep,ev,re,r,rp) function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT) Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end end
\ No newline at end of file Duel.DisableActionCheck(true)
cm[0]=Duel.CreateToken(0,m)
cm[1]=Duel.CreateToken(1,m)
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
Duel.DisableActionCheck(false)
\ No newline at end of file
...@@ -77,13 +77,8 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -77,13 +77,8 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then if chk==0 then
local res=true local res=true
if KOISHI_CHECK then if KOISHI_CHECK and cm[tp] then
Duel.DisableActionCheck(true) res=cm[tp]:GetActivateEffect():IsActivatable(tp,true)
local dc=Duel.CreateToken(tp,m)
Duel.DisableActionCheck(false)
dc:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
res=dc:GetActivateEffect():IsActivatable(tp,true)
dc:SetCardData(CARDDATA_TYPE,TYPE_MONSTER+TYPE_PENDULUM+TYPE_EFFECT)
else else
res=(c:CheckActivateEffect(false,false,false)~=nil) res=(c:CheckActivateEffect(false,false,false)~=nil)
end end
...@@ -221,4 +216,10 @@ function cm.descon(e,tp,eg,ep,ev,re,r,rp) ...@@ -221,4 +216,10 @@ function cm.descon(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.desop(e,tp,eg,ep,ev,re,r,rp) function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT) Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end end
\ No newline at end of file Duel.DisableActionCheck(true)
cm[0]=Duel.CreateToken(0,m)
cm[1]=Duel.CreateToken(1,m)
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
Duel.DisableActionCheck(false)
\ No newline at end of file
...@@ -79,13 +79,8 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -79,13 +79,8 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then if chk==0 then
local res=true local res=true
if KOISHI_CHECK then if KOISHI_CHECK and cm[tp] then
Duel.DisableActionCheck(true) res=cm[tp]:GetActivateEffect():IsActivatable(tp,true)
local dc=Duel.CreateToken(tp,m)
Duel.DisableActionCheck(false)
dc:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
res=dc:GetActivateEffect():IsActivatable(tp,true)
dc:SetCardData(CARDDATA_TYPE,TYPE_MONSTER+TYPE_PENDULUM+TYPE_EFFECT)
else else
res=(c:CheckActivateEffect(false,false,false)~=nil) res=(c:CheckActivateEffect(false,false,false)~=nil)
end end
...@@ -239,4 +234,10 @@ function cm.descon(e,tp,eg,ep,ev,re,r,rp) ...@@ -239,4 +234,10 @@ function cm.descon(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.desop(e,tp,eg,ep,ev,re,r,rp) function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT) Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end end
\ No newline at end of file Duel.DisableActionCheck(true)
cm[0]=Duel.CreateToken(0,m)
cm[1]=Duel.CreateToken(1,m)
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
Duel.DisableActionCheck(false)
\ No newline at end of file
...@@ -106,13 +106,8 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -106,13 +106,8 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then if chk==0 then
local res=true local res=true
if KOISHI_CHECK then if KOISHI_CHECK and cm[tp] then
Duel.DisableActionCheck(true) res=cm[tp]:GetActivateEffect():IsActivatable(tp,true)
local dc=Duel.CreateToken(tp,m)
Duel.DisableActionCheck(false)
dc:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
res=dc:GetActivateEffect():IsActivatable(tp,true)
dc:SetCardData(CARDDATA_TYPE,TYPE_MONSTER+TYPE_LINK+TYPE_EFFECT)
else else
res=(c:CheckActivateEffect(false,false,false)~=nil) res=(c:CheckActivateEffect(false,false,false)~=nil)
end end
...@@ -209,4 +204,10 @@ end ...@@ -209,4 +204,10 @@ end
function cm.drop(e,tp,eg,ep,ev,re,r,rp) function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT) Duel.Draw(p,d,REASON_EFFECT)
end end
\ No newline at end of file Duel.DisableActionCheck(true)
cm[0]=Duel.CreateToken(0,m)
cm[1]=Duel.CreateToken(1,m)
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
Duel.DisableActionCheck(false)
\ No newline at end of file
...@@ -62,13 +62,8 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -62,13 +62,8 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then if chk==0 then
local res=true local res=true
if KOISHI_CHECK then if KOISHI_CHECK and cm[tp] then
Duel.DisableActionCheck(true) res=cm[tp]:GetActivateEffect():IsActivatable(tp,true)
local dc=Duel.CreateToken(tp,m)
Duel.DisableActionCheck(false)
dc:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
res=dc:GetActivateEffect():IsActivatable(tp,true)
dc:SetCardData(CARDDATA_TYPE,TYPE_MONSTER+TYPE_EFFECT)
else else
res=(c:CheckActivateEffect(false,false,false)~=nil) res=(c:CheckActivateEffect(false,false,false)~=nil)
end end
...@@ -190,4 +185,10 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -190,4 +185,10 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.ShuffleHand(1-tp) Duel.ShuffleHand(1-tp)
end end
end end
end end
\ No newline at end of file Duel.DisableActionCheck(true)
cm[0]=Duel.CreateToken(0,m)
cm[1]=Duel.CreateToken(1,m)
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
Duel.DisableActionCheck(false)
\ No newline at end of file
...@@ -91,13 +91,8 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -91,13 +91,8 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then if chk==0 then
local res=true local res=true
if Card.SetCardData then if KOISHI_CHECK and cm[tp] then
Duel.DisableActionCheck(true) res=cm[tp]:GetActivateEffect():IsActivatable(tp,true)
local dc=Duel.CreateToken(tp,m)
Duel.DisableActionCheck(false)
dc:SetCardData(CARDDATA_TYPE,TYPE_QUICKPLAY+TYPE_SPELL)
res=dc:GetActivateEffect():IsActivatable(tp)
dc:SetCardData(CARDDATA_TYPE,TYPE_SPELL)
else else
res=(c:CheckActivateEffect(false,false,false)~=nil) res=(c:CheckActivateEffect(false,false,false)~=nil)
end end
...@@ -147,4 +142,10 @@ function cm.drop(e,tp,eg,ep,ev,re,r,rp) ...@@ -147,4 +142,10 @@ function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetOperatedGroup() local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK+LOCATION_EXTRA) then Duel.Draw(tp,1,REASON_EFFECT) end if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK+LOCATION_EXTRA) then Duel.Draw(tp,1,REASON_EFFECT) end
end end
\ No newline at end of file Duel.DisableActionCheck(true)
cm[0]=Duel.CreateToken(0,m)
cm[1]=Duel.CreateToken(1,m)
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_QUICKPLAY+TYPE_SPELL)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_QUICKPLAY+TYPE_SPELL)
Duel.DisableActionCheck(false)
\ No newline at end of file
...@@ -121,7 +121,7 @@ function cm.initial_effect(c) ...@@ -121,7 +121,7 @@ function cm.initial_effect(c)
rpz:RegisterEffect(e4)--]] rpz:RegisterEffect(e4)--]]
return sg return sg
end end
end end
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -177,7 +177,7 @@ function cm.tdop(e,tp,eg,ep,ev,re,r,rp) ...@@ -177,7 +177,7 @@ function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.repfilter(c,tp) function cm.repfilter(c,tp)
return cm.tdfilter(c,tp) and c:IsOnField() and c:IsFaceup() return cm.tdfilter(c,tp) and c:IsOnField() and c:IsFaceup() and c:GetFlagEffect(m)==0
end end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(cm.repfilter,1,nil,tp) and rp~=tp end if chk==0 then return eg:IsExists(cm.repfilter,1,nil,tp) and rp~=tp end
......
This diff is collapsed.
...@@ -48,7 +48,7 @@ function cm.SynOperation(f1,f2,minct,maxc) ...@@ -48,7 +48,7 @@ function cm.SynOperation(f1,f2,minct,maxc)
return function(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max) return function(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max)
local g=e:GetLabelObject() local g=e:GetLabelObject()
c:SetMaterial(g) c:SetMaterial(g)
Duel.Destroy(g,REASON_MATERIAL+REASON_SYNCHRO+REASON_REPLACE+REASON_EFFECT) Duel.Destroy(g,REASON_MATERIAL+REASON_SYNCHRO+REASON_REPLACE+REASON_EFFECT+REASON_RULE)
--Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO) --Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO)
g:DeleteGroup() g:DeleteGroup()
end end
......
...@@ -51,7 +51,7 @@ function cm.SynOperation(f1,f2,minct,maxc) ...@@ -51,7 +51,7 @@ function cm.SynOperation(f1,f2,minct,maxc)
return function(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max) return function(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max)
local g=e:GetLabelObject() local g=e:GetLabelObject()
c:SetMaterial(g) c:SetMaterial(g)
Duel.Destroy(g,REASON_MATERIAL+REASON_SYNCHRO+REASON_REPLACE+REASON_EFFECT) Duel.Destroy(g,REASON_MATERIAL+REASON_SYNCHRO+REASON_REPLACE+REASON_EFFECT+REASON_RULE)
--Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO) --Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO)
g:DeleteGroup() g:DeleteGroup()
end end
......
...@@ -43,7 +43,7 @@ function cm.SynOperation(f1,f2,minct,maxc) ...@@ -43,7 +43,7 @@ function cm.SynOperation(f1,f2,minct,maxc)
return function(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max) return function(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max)
local g=e:GetLabelObject() local g=e:GetLabelObject()
c:SetMaterial(g) c:SetMaterial(g)
Duel.Destroy(g,REASON_MATERIAL+REASON_SYNCHRO+REASON_REPLACE+REASON_EFFECT) Duel.Destroy(g,REASON_MATERIAL+REASON_SYNCHRO+REASON_REPLACE+REASON_EFFECT+REASON_RULE)
--Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO) --Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO)
g:DeleteGroup() g:DeleteGroup()
end end
......
...@@ -72,7 +72,7 @@ function cm.SynOperation(f1,f2,minct,maxc) ...@@ -72,7 +72,7 @@ function cm.SynOperation(f1,f2,minct,maxc)
return function(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max) return function(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max)
local g=e:GetLabelObject() local g=e:GetLabelObject()
c:SetMaterial(g) c:SetMaterial(g)
Duel.Destroy(g,REASON_MATERIAL+REASON_SYNCHRO+REASON_REPLACE+REASON_EFFECT) Duel.Destroy(g,REASON_MATERIAL+REASON_SYNCHRO+REASON_REPLACE+REASON_EFFECT+REASON_RULE)
--Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO) --Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO)
g:DeleteGroup() g:DeleteGroup()
end end
......
...@@ -3,7 +3,6 @@ local s,id,o=GetID() ...@@ -3,7 +3,6 @@ local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--activate --activate
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e0:SetType(EFFECT_TYPE_ACTIVATE) e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN) e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0) c:RegisterEffect(e0)
......
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