Commit 21d45d9a authored by POLYMER's avatar POLYMER

fix

parent 3cc1a456
......@@ -59,6 +59,7 @@ function cm.initial_effect(c)
e01:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e01:SetCode(EVENT_CHAIN_SOLVED)
e01:SetRange(LOCATION_SZONE)
e01:SetProperty(EFFECT_FLAG_DELAY)
e01:SetCondition(cm.actcon2)
e01:SetTarget(cm.acttg)
e01:SetOperation(cm.actop)
......@@ -113,13 +114,18 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
end
end
function cm.actcon2(e,tp,eg,ep,ev,re,r,rp)
--[[if re then Debug.Message("01") end
if re and re:GetHandler()==e:GetHandler() then Debug.Message("02") end
if re:IsHasType(EFFECT_TYPE_ACTIVATE) then Debug.Message("03") end]]
return re and re:GetHandler()==e:GetHandler() and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function cm.actfilter(c,tp)
return c:IsType(TYPE_SPELL) and cm.Crooked_Cook_Soup(c) and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function cm.acttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.actfilter,tp,LOCATION_GRAVE,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
--[[if Duel.IsExistingMatchingCard(cm.actfilter,tp,LOCATION_GRAVE,0,1,nil) then Debug.Message("04") end
if Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then Debug.Message("05") end]]
if chk==0 then return Duel.IsExistingMatchingCard(cm.actfilter,tp,LOCATION_GRAVE,0,1,nil,tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function cm.actop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
......@@ -132,6 +138,7 @@ function cm.actop(e,tp,eg,ep,ev,re,r,rp)
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,7438201,te,0,tep,tep,Duel.GetCurrentChain())
Duel.RaiseEvent(tc,7438201,te,0,tp,tp,Duel.GetCurrentChain())
end
end
......
......@@ -59,6 +59,7 @@ function cm.initial_effect(c)
e01:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e01:SetCode(EVENT_CHAIN_SOLVED)
e01:SetRange(LOCATION_SZONE)
e01:SetProperty(EFFECT_FLAG_DELAY)
e01:SetCondition(cm.actcon2)
e01:SetTarget(cm.acttg)
e01:SetOperation(cm.actop)
......@@ -119,7 +120,7 @@ function cm.actfilter(c,tp)
return c:IsType(TYPE_SPELL) and cm.Crooked_Cook_Enree(c) and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function cm.acttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.actfilter,tp,LOCATION_GRAVE,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
if chk==0 then return Duel.IsExistingMatchingCard(cm.actfilter,tp,LOCATION_GRAVE,0,1,nil,tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function cm.actop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
......
......@@ -59,6 +59,7 @@ function cm.initial_effect(c)
e01:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e01:SetCode(EVENT_CHAIN_SOLVED)
e01:SetRange(LOCATION_SZONE)
e01:SetProperty(EFFECT_FLAG_DELAY)
e01:SetCondition(cm.actcon2)
e01:SetTarget(cm.acttg)
e01:SetOperation(cm.actop)
......@@ -119,7 +120,7 @@ function cm.actfilter(c,tp)
return c:IsType(TYPE_SPELL) and cm.Crooked_Cook_Main_Course(c) and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function cm.acttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.actfilter,tp,LOCATION_GRAVE,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
if chk==0 then return Duel.IsExistingMatchingCard(cm.actfilter,tp,LOCATION_GRAVE,0,1,nil,tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function cm.actop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
......
......@@ -59,6 +59,7 @@ function cm.initial_effect(c)
e01:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e01:SetCode(EVENT_CHAIN_SOLVED)
e01:SetRange(LOCATION_SZONE)
e01:SetProperty(EFFECT_FLAG_DELAY)
e01:SetCondition(cm.actcon2)
e01:SetTarget(cm.acttg)
e01:SetOperation(cm.actop)
......@@ -119,7 +120,7 @@ function cm.actfilter(c,tp)
return c:IsType(TYPE_SPELL) and cm.Crooked_Cook_Salad(c) and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function cm.acttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.actfilter,tp,LOCATION_GRAVE,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
if chk==0 then return Duel.IsExistingMatchingCard(cm.actfilter,tp,LOCATION_GRAVE,0,1,nil,tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function cm.actop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
......
......@@ -59,6 +59,7 @@ function cm.initial_effect(c)
e01:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e01:SetCode(EVENT_CHAIN_SOLVED)
e01:SetRange(LOCATION_SZONE)
e01:SetProperty(EFFECT_FLAG_DELAY)
e01:SetCondition(cm.actcon2)
e01:SetTarget(cm.acttg)
e01:SetOperation(cm.actop)
......@@ -121,7 +122,7 @@ function cm.actfilter(c,tp)
return c:IsType(TYPE_SPELL) and cm.Crooked_Cook_Dessert(c) and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function cm.acttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.actfilter,tp,LOCATION_GRAVE,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
if chk==0 then return Duel.IsExistingMatchingCard(cm.actfilter,tp,LOCATION_GRAVE,0,1,nil,tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function cm.actop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
......
......@@ -59,6 +59,7 @@ function cm.initial_effect(c)
e01:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e01:SetCode(EVENT_CHAIN_SOLVED)
e01:SetRange(LOCATION_SZONE)
e01:SetProperty(EFFECT_FLAG_DELAY)
e01:SetCondition(cm.actcon2)
e01:SetTarget(cm.acttg)
e01:SetOperation(cm.actop)
......@@ -119,7 +120,7 @@ function cm.actfilter(c,tp)
return c:IsType(TYPE_SPELL) and cm.Crooked_Cook_Drink(c) and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function cm.acttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.actfilter,tp,LOCATION_GRAVE,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
if chk==0 then return Duel.IsExistingMatchingCard(cm.actfilter,tp,LOCATION_GRAVE,0,1,nil,tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function cm.actop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
......
......@@ -59,6 +59,7 @@ function cm.initial_effect(c)
e01:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e01:SetCode(EVENT_CHAIN_SOLVED)
e01:SetRange(LOCATION_SZONE)
e01:SetProperty(EFFECT_FLAG_DELAY)
e01:SetCondition(cm.actcon2)
e01:SetTarget(cm.acttg)
e01:SetOperation(cm.actop)
......@@ -119,7 +120,7 @@ function cm.actfilter(c,tp)
return cm.Crooked_Cook(c) and c:IsType(TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function cm.acttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.actfilter,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.actfilter,tp,LOCATION_DECK,0,1,nil,tp) end
end
function cm.actop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,4))
......
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