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)
local c=e:GetHandler()
if chk==0 then
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)
if KOISHI_CHECK and cm[tp] then
--[[Duel.DisableActionCheck(true)
if not cm[tp] then
cm[tp]=Duel.CreateToken(tp,m)
end
local dc=cm[tp]
Duel.DisableActionCheck(false)--]]
res=cm[tp]:GetActivateEffect():IsActivatable(tp,true)
else
Debug.Message("11")
res=(c:CheckActivateEffect(false,false,false)~=nil)
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)))
......@@ -279,4 +281,10 @@ function cm.descon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
\ No newline at end of file
end
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)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetLabelObject(e1)
e3:SetTargetRange(1,0)
--e3:SetCost(cm.chkac)
e3:SetTarget(cm.actarget)
e3:SetOperation(cm.costop)
c:RegisterEffect(e3)
......@@ -87,13 +88,8 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
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)
if KOISHI_CHECK and cm[tp] then
res=cm[tp]:GetActivateEffect():IsActivatable(tp,true)
else
res=(c:CheckActivateEffect(false,false,false)~=nil)
end
......@@ -172,6 +168,20 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.SendtoHand(tc,1-tp,REASON_EFFECT)
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)
return te:GetHandler()==e:GetHandler() and te==e:GetLabelObject()
end
......@@ -268,4 +278,10 @@ function cm.descon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
\ No newline at end of file
end
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)
local c=e:GetHandler()
if chk==0 then
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)
if KOISHI_CHECK and cm[tp] then
res=cm[tp]:GetActivateEffect():IsActivatable(tp,true)
else
res=(c:CheckActivateEffect(false,false,false)~=nil)
end
......@@ -221,4 +216,10 @@ function cm.descon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
\ No newline at end of file
end
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)
local c=e:GetHandler()
if chk==0 then
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)
if KOISHI_CHECK and cm[tp] then
res=cm[tp]:GetActivateEffect():IsActivatable(tp,true)
else
res=(c:CheckActivateEffect(false,false,false)~=nil)
end
......@@ -239,4 +234,10 @@ function cm.descon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
\ No newline at end of file
end
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)
local c=e:GetHandler()
if chk==0 then
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_LINK+TYPE_EFFECT)
if KOISHI_CHECK and cm[tp] then
res=cm[tp]:GetActivateEffect():IsActivatable(tp,true)
else
res=(c:CheckActivateEffect(false,false,false)~=nil)
end
......@@ -209,4 +204,10 @@ end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
\ No newline at end of file
end
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)
local c=e:GetHandler()
if chk==0 then
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_EFFECT)
if KOISHI_CHECK and cm[tp] then
res=cm[tp]:GetActivateEffect():IsActivatable(tp,true)
else
res=(c:CheckActivateEffect(false,false,false)~=nil)
end
......@@ -190,4 +185,10 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.ShuffleHand(1-tp)
end
end
end
\ No newline at end of file
end
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)
local c=e:GetHandler()
if chk==0 then
local res=true
if Card.SetCardData then
Duel.DisableActionCheck(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)
if KOISHI_CHECK and cm[tp] then
res=cm[tp]:GetActivateEffect():IsActivatable(tp,true)
else
res=(c:CheckActivateEffect(false,false,false)~=nil)
end
......@@ -147,4 +142,10 @@ function cm.drop(e,tp,eg,ep,ev,re,r,rp)
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+LOCATION_EXTRA) then Duel.Draw(tp,1,REASON_EFFECT) end
end
\ No newline at end of file
end
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)
rpz:RegisterEffect(e4)--]]
return sg
end
end
end
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -177,7 +177,7 @@ function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
end
end
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
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
......
This diff is collapsed.
......@@ -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)
local g=e:GetLabelObject()
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)
g:DeleteGroup()
end
......
......@@ -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)
local g=e:GetLabelObject()
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)
g:DeleteGroup()
end
......
......@@ -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)
local g=e:GetLabelObject()
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)
g:DeleteGroup()
end
......
......@@ -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)
local g=e:GetLabelObject()
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)
g:DeleteGroup()
end
......
......@@ -3,7 +3,6 @@ local s,id,o=GetID()
function s.initial_effect(c)
--activate
local e0=Effect.CreateEffect(c)
e0:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
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