Commit 8eb54eed authored by POLYMER's avatar POLYMER

fix

parent 239505b6
No preview for this file type
--背反之料理 前菜-日式猪肉角煮
local m=7438101
local cm=_G["c"..m]
cm.named_with_Crooked_Cook=1
cm.named_with_Crooked_Cook_Antipasto=1
function cm.Crooked_Cook(c)
local m=_G["c"..c:GetCode()]
return m and (m.named_with_Crooked_Cook or c:IsCode(82697249))
end
function cm.Crooked_Cook_Antipasto(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Antipasto
end
function cm.Crooked_Cook_Soup(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Soup
end
function cm.Crooked_Cook_Enree(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Enree
end
function cm.Crooked_Cook_Main_Course(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Main_Course
end
function cm.Crooked_Cook_Salad(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Salad
end
function cm.Crooked_Cook_Dessert(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Dessert
end
function cm.Crooked_Cook_Drink(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Drink
end
function cm.initial_effect(c)
--act qp in hand
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e0:SetCondition(cm.actcon)
c:RegisterEffect(e0)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_END_PHASE,TIMING_END_PHASE)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--activate
local e01=Effect.CreateEffect(c)
e01:SetDescription(aux.Stringid(m,1))
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)
c:RegisterEffect(e01)
local e02=e01:Clone()
e02:SetCode(7438201)
c:RegisterEffect(e02)
--destroyed
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(cm.descon)
e2:SetOperation(cm.desop)
c:RegisterEffect(e2)
--remain field
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_REMAIN_FIELD)
c:RegisterEffect(e3)
end
function cm.confilter(c)
return cm.Crooked_Cook(c) and c:IsFaceup()
end
function cm.actcon(e)
return Duel.IsExistingMatchingCard(cm.confilter,e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
function cm.thfilter(c)
return cm.Crooked_Cook(c) and c:IsAbleToHand()
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCountLimit(1)
e1:SetCondition(cm.thcon)
e1:SetOperation(cm.thop)
e1:SetReset(RESET_PHASE+PHASE_STANDBY,2)
Duel.RegisterEffect(e1,tp)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()==e:GetLabel()+1 and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
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 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
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,4))
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.actfilter),tp,LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
te:UseCountLimit(tp,1,true)
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
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--[[--poschange
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SET_POSITION)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(POS_FACEUP_ATTACK)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)]]
--must attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_MUST_ATTACK)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
--client
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e3:SetTargetRange(1,0)
e3:SetDescription(aux.Stringid(m,5))
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,1-tp)
end
--背反之料理 汤-什锦鸡肉茶汤
local m=7438102
local cm=_G["c"..m]
cm.named_with_Crooked_Cook=1
cm.named_with_Crooked_Cook_Soup=1
function cm.Crooked_Cook(c)
local m=_G["c"..c:GetCode()]
return m and (m.named_with_Crooked_Cook or c:IsCode(82697249))
end
function cm.Crooked_Cook_Antipasto(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Antipasto
end
function cm.Crooked_Cook_Soup(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Soup
end
function cm.Crooked_Cook_Enree(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Enree
end
function cm.Crooked_Cook_Main_Course(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Main_Course
end
function cm.Crooked_Cook_Salad(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Salad
end
function cm.Crooked_Cook_Dessert(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Dessert
end
function cm.Crooked_Cook_Drink(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Drink
end
function cm.initial_effect(c)
--act qp in hand
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e0:SetCondition(cm.actcon)
c:RegisterEffect(e0)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_END_PHASE,TIMING_END_PHASE)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--activate
local e01=Effect.CreateEffect(c)
e01:SetDescription(aux.Stringid(m,1))
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)
c:RegisterEffect(e01)
local e02=e01:Clone()
e02:SetCode(7438201)
c:RegisterEffect(e02)
--destroyed
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(cm.descon)
e2:SetOperation(cm.desop)
c:RegisterEffect(e2)
--remain field
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_REMAIN_FIELD)
c:RegisterEffect(e3)
end
function cm.confilter(c)
return cm.Crooked_Cook(c) and c:IsFaceup()
end
function cm.actcon(e)
return Duel.IsExistingMatchingCard(cm.confilter,e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
function cm.thfilter(c)
return cm.Crooked_Cook(c) and c:IsAbleToHand()
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCountLimit(1)
e1:SetCondition(cm.thcon)
e1:SetOperation(cm.thop)
e1:SetReset(RESET_PHASE+PHASE_STANDBY,2)
Duel.RegisterEffect(e1,tp)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()==e:GetLabel()+1 and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.actcon2(e,tp,eg,ep,ev,re,r,rp)
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_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,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
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,4))
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.actfilter),tp,LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
te:UseCountLimit(tp,1,true)
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,tp,tp,Duel.GetCurrentChain())
end
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--attackdown
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(-1000)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
--client
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e3:SetTargetRange(1,0)
e3:SetDescription(aux.Stringid(m,5))
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,1-tp)
end
--背反之料理 副菜-鲑鱼精切刺身
local m=7438103
local cm=_G["c"..m]
cm.named_with_Crooked_Cook=1
cm.named_with_Crooked_Cook_Enree=1
function cm.Crooked_Cook(c)
local m=_G["c"..c:GetCode()]
return m and (m.named_with_Crooked_Cook or c:IsCode(82697249))
end
function cm.Crooked_Cook_Antipasto(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Antipasto
end
function cm.Crooked_Cook_Soup(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Soup
end
function cm.Crooked_Cook_Enree(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Enree
end
function cm.Crooked_Cook_Main_Course(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Main_Course
end
function cm.Crooked_Cook_Salad(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Salad
end
function cm.Crooked_Cook_Dessert(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Dessert
end
function cm.Crooked_Cook_Drink(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Drink
end
function cm.initial_effect(c)
--act qp in hand
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e0:SetCondition(cm.actcon)
c:RegisterEffect(e0)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_END_PHASE,TIMING_END_PHASE)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--activate
local e01=Effect.CreateEffect(c)
e01:SetDescription(aux.Stringid(m,1))
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)
c:RegisterEffect(e01)
local e02=e01:Clone()
e02:SetCode(7438201)
c:RegisterEffect(e02)
--destroyed
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(cm.descon)
e2:SetOperation(cm.desop)
c:RegisterEffect(e2)
--remain field
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_REMAIN_FIELD)
c:RegisterEffect(e3)
end
function cm.confilter(c)
return cm.Crooked_Cook(c) and c:IsFaceup()
end
function cm.actcon(e)
return Duel.IsExistingMatchingCard(cm.confilter,e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
function cm.thfilter(c)
return cm.Crooked_Cook(c) and c:IsAbleToHand()
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCountLimit(1)
e1:SetCondition(cm.thcon)
e1:SetOperation(cm.thop)
e1:SetReset(RESET_PHASE+PHASE_STANDBY,2)
Duel.RegisterEffect(e1,tp)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()==e:GetLabel()+1 and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.actcon2(e,tp,eg,ep,ev,re,r,rp)
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_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,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
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,4))
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.actfilter),tp,LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
te:UseCountLimit(tp,1,true)
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,tp,tp,Duel.GetCurrentChain())
end
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--disable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetTargetRange(0,LOCATION_ONFIELD)
e2:SetTarget(cm.disable)
e2:SetCondition(cm.discon)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
--client
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e3:SetTargetRange(1,0)
e3:SetDescription(aux.Stringid(m,5))
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,1-tp)
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
end
function cm.disable(e,c)
return c:IsType(TYPE_EFFECT) or c:GetOriginalType()&TYPE_EFFECT~=0 or c:IsLocation(LOCATION_SZONE)
end
--背反之料理 主菜-半熟罗勒菲力
local m=7438104
local cm=_G["c"..m]
cm.named_with_Crooked_Cook=1
cm.named_with_Crooked_Cook_Main_Course=1
function cm.Crooked_Cook(c)
local m=_G["c"..c:GetCode()]
return m and (m.named_with_Crooked_Cook or c:IsCode(82697249))
end
function cm.Crooked_Cook_Antipasto(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Antipasto
end
function cm.Crooked_Cook_Soup(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Soup
end
function cm.Crooked_Cook_Enree(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Enree
end
function cm.Crooked_Cook_Main_Course(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Main_Course
end
function cm.Crooked_Cook_Salad(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Salad
end
function cm.Crooked_Cook_Dessert(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Dessert
end
function cm.Crooked_Cook_Drink(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Drink
end
function cm.initial_effect(c)
--act qp in hand
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e0:SetCondition(cm.actcon)
c:RegisterEffect(e0)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_END_PHASE,TIMING_END_PHASE)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--activate
local e01=Effect.CreateEffect(c)
e01:SetDescription(aux.Stringid(m,1))
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)
c:RegisterEffect(e01)
local e02=e01:Clone()
e02:SetCode(7438201)
c:RegisterEffect(e02)
--destroyed
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(cm.descon)
e2:SetOperation(cm.desop)
c:RegisterEffect(e2)
--remain field
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_REMAIN_FIELD)
c:RegisterEffect(e3)
end
function cm.confilter(c)
return cm.Crooked_Cook(c) and c:IsFaceup()
end
function cm.actcon(e)
return Duel.IsExistingMatchingCard(cm.confilter,e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
function cm.thfilter(c)
return cm.Crooked_Cook(c) and c:IsAbleToHand()
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCountLimit(1)
e1:SetCondition(cm.thcon)
e1:SetOperation(cm.thop)
e1:SetReset(RESET_PHASE+PHASE_STANDBY,2)
Duel.RegisterEffect(e1,tp)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()==e:GetLabel()+1 and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.actcon2(e,tp,eg,ep,ev,re,r,rp)
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_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,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
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,4))
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.actfilter),tp,LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
te:UseCountLimit(tp,1,true)
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,tp,tp,Duel.GetCurrentChain())
end
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and re and re:GetHandler():IsCode(82697249)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetTargetRange(0,LOCATION_MZONE)
e5:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e5:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e5:SetReset(RESET_PHASE+PHASE_END)
e5:SetCondition(cm.lockcon)
e5:SetValue(1)
Duel.RegisterEffect(e5,tp)
local e6=e5:Clone()
e6:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e6:SetValue(cm.fuslimit)
Duel.RegisterEffect(e6,tp)
local e7=e5:Clone()
e7:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
Duel.RegisterEffect(e7,tp)
local e8=e5:Clone()
e8:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
Duel.RegisterEffect(e8,tp)
local e9=e5:Clone()
e9:SetCode(EFFECT_UNRELEASABLE_SUM)
Duel.RegisterEffect(e9,tp)
local e10=e5:Clone()
e10:SetCode(EFFECT_UNRELEASABLE_NONSUM)
Duel.RegisterEffect(e10,tp)
--client
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e3:SetTargetRange(1,0)
e3:SetDescription(aux.Stringid(m,5))
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,1-tp)
end
function cm.lockcon(e)
return Duel.GetCurrentPhase()==PHASE_MAIN1
end
function cm.fuslimit(e,c,sumtype)
return sumtype==SUMMON_TYPE_FUSION
end
--背反之料理 沙拉-鳄梨培根沙拉
local m=7438105
local cm=_G["c"..m]
cm.named_with_Crooked_Cook=1
cm.named_with_Crooked_Cook_Salad=1
function cm.Crooked_Cook(c)
local m=_G["c"..c:GetCode()]
return m and (m.named_with_Crooked_Cook or c:IsCode(82697249))
end
function cm.Crooked_Cook_Antipasto(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Antipasto
end
function cm.Crooked_Cook_Soup(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Soup
end
function cm.Crooked_Cook_Enree(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Enree
end
function cm.Crooked_Cook_Main_Course(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Main_Course
end
function cm.Crooked_Cook_Salad(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Salad
end
function cm.Crooked_Cook_Dessert(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Dessert
end
function cm.Crooked_Cook_Drink(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Drink
end
function cm.initial_effect(c)
--act qp in hand
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e0:SetCondition(cm.actcon)
c:RegisterEffect(e0)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_END_PHASE,TIMING_END_PHASE)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--activate
local e01=Effect.CreateEffect(c)
e01:SetDescription(aux.Stringid(m,1))
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)
c:RegisterEffect(e01)
local e02=e01:Clone()
e02:SetCode(7438201)
c:RegisterEffect(e02)
--destroyed
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(cm.descon)
--e2:SetTarget(cm.destg)
e2:SetOperation(cm.desop)
c:RegisterEffect(e2)
--remain field
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_REMAIN_FIELD)
c:RegisterEffect(e3)
end
function cm.confilter(c)
return cm.Crooked_Cook(c) and c:IsFaceup()
end
function cm.actcon(e)
return Duel.IsExistingMatchingCard(cm.confilter,e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
function cm.thfilter(c)
return cm.Crooked_Cook(c) and c:IsAbleToHand()
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCountLimit(1)
e1:SetCondition(cm.thcon)
e1:SetOperation(cm.thop)
e1:SetReset(RESET_PHASE+PHASE_STANDBY,2)
Duel.RegisterEffect(e1,tp)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()==e:GetLabel()+1 and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.actcon2(e,tp,eg,ep,ev,re,r,rp)
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_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,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
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,4))
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.actfilter),tp,LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
te:UseCountLimit(tp,1,true)
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,tp,tp,Duel.GetCurrentChain())
end
end
function cm.cfilter0(c)
return c:IsCode(7438301) and c:IsFaceup()
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT)
end
--[[function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
end]]
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e1:SetCountLimit(1)
e1:SetOperation(cm.sop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
--client
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e3:SetTargetRange(1,0)
e3:SetDescription(aux.Stringid(m,5))
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,1-tp)
--[[local c=e:GetHandler()
if Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)<=0 or Duel.IsExistingMatchingCard(cm.cfilter0,tp,0,LOCATION_ONFIELD,1,nil) then return end
if Duel.IsPlayerCanSpecialSummonMonster(tp,7438301,0,TYPES_TOKEN_MONSTER,0,0,1,RACE_PLANT,ATTRIBUTE_WATER,POS_FACEUP_ATTACK,1-tp) then
local token=Duel.CreateToken(tp,7438301)
Duel.SpecialSummon(token,0,tp,1-tp,false,false,POS_FACEUP_ATTACK)
end]]
end
function cm.sop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local g=Duel.GetMatchingGroup(Card.IsCanBeSpecialSummoned,tp,0,LOCATION_EXTRA,nil,e,0,1-tp,false,false,POS_FACEUP_ATTACK)
if g:GetCount()>0 then
local tc=g:RandomSelect(1-tp,1):GetFirst()
Duel.SpecialSummon(tc,0,1-tp,1-tp,false,false,POS_FACEUP_ATTACK)
end
end
--背反之料理 甜品-抹茶和风圣代
local m=7438106
local cm=_G["c"..m]
cm.named_with_Crooked_Cook=1
cm.named_with_Crooked_Cook_Dessert=1
function cm.Crooked_Cook(c)
local m=_G["c"..c:GetCode()]
return m and (m.named_with_Crooked_Cook or c:IsCode(82697249))
end
function cm.Crooked_Cook_Antipasto(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Antipasto
end
function cm.Crooked_Cook_Soup(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Soup
end
function cm.Crooked_Cook_Enree(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Enree
end
function cm.Crooked_Cook_Main_Course(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Main_Course
end
function cm.Crooked_Cook_Salad(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Salad
end
function cm.Crooked_Cook_Dessert(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Dessert
end
function cm.Crooked_Cook_Drink(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Drink
end
function cm.initial_effect(c)
--act qp in hand
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e0:SetCondition(cm.actcon)
c:RegisterEffect(e0)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_END_PHASE,TIMING_END_PHASE)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--activate
local e01=Effect.CreateEffect(c)
e01:SetDescription(aux.Stringid(m,1))
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)
c:RegisterEffect(e01)
local e02=e01:Clone()
e02:SetCode(7438201)
c:RegisterEffect(e02)
--destroyed
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(cm.descon)
e2:SetOperation(cm.desop)
c:RegisterEffect(e2)
--remain field
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_REMAIN_FIELD)
c:RegisterEffect(e3)
end
function cm.confilter(c)
return cm.Crooked_Cook(c) and c:IsFaceup()
end
function cm.actcon(e)
return Duel.IsExistingMatchingCard(cm.confilter,e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
function cm.thfilter(c)
return cm.Crooked_Cook(c) and c:IsAbleToHand()
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCountLimit(1)
e1:SetCondition(cm.thcon)
e1:SetOperation(cm.thop)
e1:SetReset(RESET_PHASE+PHASE_STANDBY,2)
Duel.RegisterEffect(e1,tp)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()==e:GetLabel()+1 and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.actcon2(e,tp,eg,ep,ev,re,r,rp)
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_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,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
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,4))
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.actfilter),tp,LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
te:UseCountLimit(tp,1,true)
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,tp,tp,Duel.GetCurrentChain())
end
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(cm.indct)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_EXTRA_ATTACK)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetValue(1)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
--client
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e3:SetTargetRange(1,0)
e3:SetDescription(aux.Stringid(m,5))
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,1-tp)
end
function cm.indct(e,re,r,rp)
if bit.band(r,REASON_BATTLE)~=0 then
return 1
else return 0 end
end
--背反之料理 饮品-拉花提拉米苏
local m=7438107
local cm=_G["c"..m]
cm.named_with_Crooked_Cook=1
cm.named_with_Crooked_Cook_Drink=1
function cm.Crooked_Cook(c)
local m=_G["c"..c:GetCode()]
return m and (m.named_with_Crooked_Cook or c:IsCode(82697249))
end
function cm.Crooked_Cook_Antipasto(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Antipasto
end
function cm.Crooked_Cook_Soup(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Soup
end
function cm.Crooked_Cook_Enree(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Enree
end
function cm.Crooked_Cook_Main_Course(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Main_Course
end
function cm.Crooked_Cook_Salad(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Salad
end
function cm.Crooked_Cook_Dessert(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Dessert
end
function cm.Crooked_Cook_Drink(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Drink
end
function cm.initial_effect(c)
--act qp in hand
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e0:SetCondition(cm.actcon)
c:RegisterEffect(e0)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_END_PHASE,TIMING_END_PHASE)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--activate
local e01=Effect.CreateEffect(c)
e01:SetDescription(aux.Stringid(m,1))
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)
c:RegisterEffect(e01)
local e02=e01:Clone()
e02:SetCode(7438201)
c:RegisterEffect(e02)
--destroyed
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(cm.descon)
e2:SetOperation(cm.desop)
c:RegisterEffect(e2)
--remain field
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_REMAIN_FIELD)
c:RegisterEffect(e3)
end
function cm.confilter(c)
return cm.Crooked_Cook(c) and c:IsFaceup()
end
function cm.actcon(e)
return Duel.IsExistingMatchingCard(cm.confilter,e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
function cm.thfilter(c)
return cm.Crooked_Cook(c) and c:IsAbleToHand()
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCountLimit(1)
e1:SetCondition(cm.thcon)
e1:SetOperation(cm.thop)
e1:SetReset(RESET_PHASE+PHASE_STANDBY,2)
Duel.RegisterEffect(e1,tp)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()==e:GetLabel()+1 and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.actcon2(e,tp,eg,ep,ev,re,r,rp)
return re and re:GetHandler()==e:GetHandler() and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
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,tp) end
end
function cm.actop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,4))
local tc=Duel.SelectMatchingCard(tp,cm.actfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc then
local fc=Duel.GetFieldCard(tp,0,LOCATION_FZONE)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,1-tp,LOCATION_FZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
te:UseCountLimit(tp,1,true)
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,tp,tp,Duel.GetCurrentChain())
end
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--Recover by battle
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetCondition(cm.recon)
e1:SetTarget(cm.retg)
e1:SetOperation(cm.reop)
Duel.RegisterEffect(e1,tp)
--client
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e3:SetTargetRange(1,0)
e3:SetDescription(aux.Stringid(m,5))
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,1-tp)
end
function cm.recon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return ep~=tp and tc:IsControler(tp) and cm.Crooked_Cook(tc)
end
function cm.retg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,PLAYER_ALL,300)
end
function cm.reop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLP(tp)>0 then
Duel.Recover(tp,300,REASON_EFFECT)
end
if Duel.GetLP(1-tp)>0 then
Duel.Recover(1-tp,300,REASON_EFFECT)
end
end
--背反之料理餐厅 『Crépuscule』
local m=7438108
local cm=_G["c"..m]
cm.named_with_Crooked_Cook=1
function cm.Crooked_Cook(c)
local m=_G["c"..c:GetCode()]
return m and (m.named_with_Crooked_Cook or c:IsCode(82697249))
end
function cm.Crooked_Cook_Antipasto(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Antipasto
end
function cm.Crooked_Cook_Soup(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Soup
end
function cm.Crooked_Cook_Enree(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Enree
end
function cm.Crooked_Cook_Main_Course(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Main_Course
end
function cm.Crooked_Cook_Salad(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Salad
end
function cm.Crooked_Cook_Dessert(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Dessert
end
function cm.Crooked_Cook_Drink(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Crooked_Cook_Drink
end
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_FZONE)
e2:SetProperty(EFFECT_FLAG_BOTH_SIDE+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,m)
e2:SetTarget(cm.destg)
e2:SetOperation(cm.desop)
c:RegisterEffect(e2)
--Recover
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_RECOVER)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_DESTROYED)
e3:SetRange(LOCATION_FZONE)
e3:SetCondition(cm.reccon)
e3:SetTarget(cm.rectg)
e3:SetOperation(cm.recop)
c:RegisterEffect(e3)
end
function cm.cfilter(c)
return c:IsReason(REASON_EFFECT) and cm.Crooked_Cook(c)
end
function cm.filter(c)
return c:IsType(TYPE_QUICKPLAY) and cm.Crooked_Cook(c)
end
function cm.thfilter(c,dc)
local f=false
if cm.Crooked_Cook_Antipasto(dc) then f=cm.Crooked_Cook_Soup(c) end
if cm.Crooked_Cook_Soup(dc) then f=cm.Crooked_Cook_Enree(c) end
if cm.Crooked_Cook_Enree(dc) then f=cm.Crooked_Cook_Main_Course(c) end
if cm.Crooked_Cook_Main_Course(dc) then f=cm.Crooked_Cook_Salad(c) end
if cm.Crooked_Cook_Salad(dc) then f=cm.Crooked_Cook_Dessert(c) end
if cm.Crooked_Cook_Dessert(dc) then f=cm.Crooked_Cook_Drink(c) end
return cm.Crooked_Cook(c) and c:IsAbleToHand() and (f or cm.Crooked_Cook_Antipasto(c))
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and cm.filter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 then
local dc=Duel.GetOperatedGroup():GetFirst()
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,dc)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
end
function cm.reccon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil)
end
function cm.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,PLAYER_ALL,300)
end
function cm.recop(e,tp,eg,ep,ev,re,r,rp)
Duel.Recover(tp,300,REASON_EFFECT)
Duel.Recover(1-tp,300,REASON_EFFECT)
--attackdown
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetValue(-300)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
--背反之料理人 总厨
local m=7438201
local cm=_G["c"..m]
cm.named_with_Crooked_Cook=1
function cm.Crooked_Cook(c)
local m=_G["c"..c:GetCode()]
return m and (m.named_with_Crooked_Cook or c:IsCode(82697249))
end
function cm.initial_effect(c)
--Destroy and Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_END_PHASE,TIMING_END_PHASE+TIMINGS_CHECK_MONSTER)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--[[--get effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,3))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetCost(cm.descost)
e2:SetTarget(cm.destg)
e2:SetOperation(cm.desop)
c:RegisterEffect(e2)]]
--get effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(cm.effcon)
e2:SetOperation(cm.effop)
c:RegisterEffect(e2)
--[[if not cm.global_check then
cm.global_check=true
local ge0=Effect.CreateEffect(c)
ge0:SetType(EFFECT_TYPE_FIELD)
ge0:SetCode(EFFECT_ACTIVATE_COST)
ge0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
ge0:SetTargetRange(1,1)
ge0:SetTarget(cm.actarget)
ge0:SetOperation(cm.costop)
Duel.RegisterEffect(ge0,0)
cm.global_trigger_effect=Effect.CreateEffect(c)
end]]
end
function cm.desfilter(c,tp)
return c:IsFaceup() and cm.Crooked_Cook(c) and Duel.GetMZoneCount(tp,c)>0
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and cm.desfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.desfilter,tp,LOCATION_ONFIELD,0,1,nil,tp)
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,cm.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.thfilter(c)
return cm.Crooked_Cook(c) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER) and not c:IsCode(m)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
end
end
function cm.effcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_COST) and re:IsActivated() and re:IsActiveType(TYPE_XYZ)
and c:IsPreviousLocation(LOCATION_OVERLAY) and re:GetHandler() and re:GetHandler():IsAttribute(ATTRIBUTE_FIRE)-- and cm.global_trigger_effect:GetLabelObject()==re
end
function cm.effop(e,tp,eg,ep,ev,re,r,rp)
if re and re:GetHandler() then
local c=e:GetHandler()
local rc=re:GetHandler()
Duel.Hint(HINT_CARD,0,m)
Duel.HintSelection(Group.FromCards(rc))
--[[local esetcountlimit=Effect.SetCountLimit
cm.global_count=0
cm.global_code=0
Effect.SetCountLimit=function(effect,count,code)
Debug.Message("123")
cm.global_count=count
cm.global_code=code
return esetcountlimit(effect,count,code)
end
--effect
local e1=re:Clone()
Debug.Message(cm.global_count)
Debug.Message(cm.global_code)
Effect.SetCountLimit=esetcountlimit
e1:SetCountLimit(cm.global_count,cm.global_code)]]
--e1:SetOwner(c)
--e1:SetCountLimit(1)
--[[local e1=cm.global_copy_effect:Clone()
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1)]]
cm.COUNT_CODE_table={0}
local description=re:GetDescription()
local category=re:GetCategory()
local condition=re:GetCondition()
local cost=re:GetCost()
local target=re:GetTarget()
local operation=re:GetOperation()
local esetcountlimit=Effect.SetCountLimit
Effect.SetCountLimit=function(effect,count,code)
if code and bit.band(code,EFFECT_COUNT_CODE_SINGLE)==EFFECT_COUNT_CODE_SINGLE then
if cm.COUNT_CODE_table[1]==0 then cm.COUNT_CODE_table[1]=1 --Debug.Message("01")
end
--Debug.Message("0")
--Debug.Message("cm.COUNT_CODE_table2")
--Debug.Message(#cm.COUNT_CODE_table)
cm.COUNT_CODE_table[#cm.COUNT_CODE_table+1]=effect
return esetcountlimit(effect,count,0)
end
return esetcountlimit(effect,count,code)
end
local cregister=Card.RegisterEffect
Card.RegisterEffect=function(card,effect,flag)
if effect
and (not description or description==effect:GetDescription())
and (not category or category==effect:GetCategory())
and (not condition or condition==effect:GetCondition())
and (not cost or cost==effect:GetCost())
and (not target or target==effect:GetTarget())
and (not operation or operation==effect:GetOperation()) then
--Debug.Message("11")
if cm.COUNT_CODE_table[1]==1 then
--Debug.Message("1")
local ct=2
cm.COUNT_CODE_table[1]=59
while ct<=#cm.COUNT_CODE_table do
cregister(card,cm.COUNT_CODE_table[ct],flag)
ct=ct+1
--Debug.Message("2")
end
return
end
--Debug.Message("cm.COUNT_CODE_table")
--Debug.Message(#cm.COUNT_CODE_table)
return cregister(card,effect,flag)
end
if effect and cm.COUNT_CODE_table[1] and cm.COUNT_CODE_table[1]==59 then
--Debug.Message("3")
return cregister(card,effect,flag)
end
return
end
local cid=rc:CopyEffect(rc:GetOriginalCodeRule(),RESET_EVENT+RESETS_STANDARD)
Card.RegisterEffect=cregister
Effect.SetCountLimit=esetcountlimit
if cm.COUNT_CODE_table[1] and cm.COUNT_CODE_table[1]==59 then
cm.COUNT_CODE_table[1]=rc
--Debug.Message("cm.COUNT_CODE_table")
--Debug.Message(#cm.COUNT_CODE_table)
rc:RegisterFlagEffect(m+rc:GetFieldID(),RESET_EVENT+RESETS_STANDARD,0,0,1)
local ct=2
while ct<=#cm.COUNT_CODE_table do
rc:RegisterFlagEffect(m+rc:GetFieldID()+cm.COUNT_CODE_table[ct]:GetFieldID(),RESET_EVENT+RESETS_STANDARD,0,0,1)
ct=ct+1
end
local ge0=Effect.CreateEffect(c)
ge0:SetType(EFFECT_TYPE_FIELD)
ge0:SetCode(EFFECT_ACTIVATE_COST)
ge0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
ge0:SetLabelObject(table.unpack(cm.COUNT_CODE_table))
ge0:SetTargetRange(1,1)
ge0:SetTarget(cm.actarget)
ge0:SetCost(cm.costchk)
ge0:SetOperation(cm.costop)
Duel.RegisterEffect(ge0,0)
end
end
end
function cm.actarget(e,te,tp)
local tc=te:GetHandler()
if tc:GetFlagEffect(m+tc:GetFieldID())<=0 then return false end
--[[local COUNT_CODE_table={e:GetLabelObject()}
Debug.Message("COUNT_CODE_table")
Debug.Message(#COUNT_CODE_table)
local boolean=false
local ct=2
while ct<=#COUNT_CODE_table do
Debug.Message("COUNT_CODE_table")
Debug.Message(#COUNT_CODE_table)
Debug.Message(ct)
if te==COUNT_CODE_table[ct] then boolean=true end
ct=ct+1
end
Debug.Message("0")]]
return tc:GetFlagEffect(m+tc:GetFieldID()+te:GetFieldID())>0
end
function cm.costchk(e,te_or_c,tp)
--Debug.Message("1")
local COUNT_CODE_table={e:GetLabelObject()}
local tc=COUNT_CODE_table[1]
--Debug.Message("2")
return Duel.GetFlagEffect(tp,m+tc:GetFieldID())<=0
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local COUNT_CODE_table={e:GetLabelObject()}
local tc=COUNT_CODE_table[1]
return Duel.RegisterFlagEffect(tp,m+tc:GetFieldID(),RESET_PHASE+PHASE_END,0,0,1)
end
--[[function cm.actarget(e,te,tp)
e:SetLabelObject(te)
return te:IsActivated() and te:IsActiveType(TYPE_XYZ) and te:GetHandler() and te:GetHandler():IsAttribute(ATTRIBUTE_FIRE)
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
Debug.Message("123")
local te=e:GetLabelObject()
local tc=te:GetHandler()
cm.global_trigger_effect:SetLabelObject(te)
cm.global_copy_effect=te:Clone()
end]]
--[[function cm.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,0,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,0,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
end]]
--背反之料理人 厨师长
local m=7438202
local cm=_G["c"..m]
cm.named_with_Crooked_Cook=1
function cm.Crooked_Cook(c)
local m=_G["c"..c:GetCode()]
return m and (m.named_with_Crooked_Cook or c:IsCode(82697249))
end
function cm.initial_effect(c)
--Destroy and Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_END_PHASE,TIMING_END_PHASE+TIMINGS_CHECK_MONSTER)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--get effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(cm.effcon)
e2:SetOperation(cm.effop)
c:RegisterEffect(e2)
end
function cm.desfilter(c,tp)
return c:IsFaceup() and cm.Crooked_Cook(c) and Duel.GetMZoneCount(tp,c)>0
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and cm.desfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.desfilter,tp,LOCATION_ONFIELD,0,1,nil,tp)
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,cm.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.cfilter(c,code)
return c:IsCode(code) and (c:IsFaceup() or not c:IsOnField())
end
function cm.thfilter(c,tp)
return cm.Crooked_Cook(c) and c:IsType(TYPE_QUICKPLAY) and c:IsAbleToHand()
--and not Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,nil,c:GetCode())
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
end
end
function cm.effcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_COST) and re:IsActivated() and re:IsActiveType(TYPE_XYZ)
and c:IsPreviousLocation(LOCATION_OVERLAY) and re:GetHandler() and re:GetHandler():IsAttribute(ATTRIBUTE_FIRE)
end
function cm.effop(e,tp,eg,ep,ev,re,r,rp)
if re and re:GetHandler() then
local c=e:GetHandler()
local rc=re:GetHandler()
Duel.Hint(HINT_CARD,0,m)
Duel.HintSelection(Group.FromCards(rc))
cm.COUNT_CODE_table={0}
local description=re:GetDescription()
local category=re:GetCategory()
local condition=re:GetCondition()
local cost=re:GetCost()
local target=re:GetTarget()
local operation=re:GetOperation()
local esetcountlimit=Effect.SetCountLimit
Effect.SetCountLimit=function(effect,count,code)
if code and bit.band(code,EFFECT_COUNT_CODE_SINGLE)==EFFECT_COUNT_CODE_SINGLE then
if cm.COUNT_CODE_table[1]==0 then cm.COUNT_CODE_table[1]=1
end
cm.COUNT_CODE_table[#cm.COUNT_CODE_table+1]=effect
return esetcountlimit(effect,count,0)
end
return esetcountlimit(effect,count,code)
end
local cregister=Card.RegisterEffect
Card.RegisterEffect=function(card,effect,flag)
if effect
and (not description or description==effect:GetDescription())
and (not category or category==effect:GetCategory())
and (not condition or condition==effect:GetCondition())
and (not cost or cost==effect:GetCost())
and (not target or target==effect:GetTarget())
and (not operation or operation==effect:GetOperation()) then
if cm.COUNT_CODE_table[1]==1 then
local ct=2
cm.COUNT_CODE_table[1]=59
while ct<=#cm.COUNT_CODE_table do
cregister(card,cm.COUNT_CODE_table[ct],flag)
ct=ct+1
end
return
end
return cregister(card,effect,flag)
end
if effect and cm.COUNT_CODE_table[1] and cm.COUNT_CODE_table[1]==59 then
return cregister(card,effect,flag)
end
return
end
local cid=rc:CopyEffect(rc:GetOriginalCodeRule(),RESET_EVENT+RESETS_STANDARD)
Card.RegisterEffect=cregister
Effect.SetCountLimit=esetcountlimit
if cm.COUNT_CODE_table[1] and cm.COUNT_CODE_table[1]==59 then
cm.COUNT_CODE_table[1]=rc
rc:RegisterFlagEffect(m+rc:GetFieldID(),RESET_EVENT+RESETS_STANDARD,0,0,1)
local ct=2
while ct<=#cm.COUNT_CODE_table do
rc:RegisterFlagEffect(m+rc:GetFieldID()+cm.COUNT_CODE_table[ct]:GetFieldID(),RESET_EVENT+RESETS_STANDARD,0,0,1)
ct=ct+1
end
local ge0=Effect.CreateEffect(c)
ge0:SetType(EFFECT_TYPE_FIELD)
ge0:SetCode(EFFECT_ACTIVATE_COST)
ge0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
ge0:SetLabelObject(table.unpack(cm.COUNT_CODE_table))
ge0:SetTargetRange(1,1)
ge0:SetTarget(cm.actarget)
ge0:SetCost(cm.costchk)
ge0:SetOperation(cm.costop)
Duel.RegisterEffect(ge0,0)
end
end
end
function cm.actarget(e,te,tp)
local tc=te:GetHandler()
if tc:GetFlagEffect(m+tc:GetFieldID())<=0 then return false end
return tc:GetFlagEffect(m+tc:GetFieldID()+te:GetFieldID())>0
end
function cm.costchk(e,te_or_c,tp)
local COUNT_CODE_table={e:GetLabelObject()}
local tc=COUNT_CODE_table[1]
return Duel.GetFlagEffect(tp,m+tc:GetFieldID())<=0
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local COUNT_CODE_table={e:GetLabelObject()}
local tc=COUNT_CODE_table[1]
return Duel.RegisterFlagEffect(tp,m+tc:GetFieldID(),RESET_PHASE+PHASE_END,0,0,1)
end
--背反之料理人 厨师长
local m=7438203
local cm=_G["c"..m]
cm.named_with_Crooked_Cook=1
function cm.Crooked_Cook(c)
local m=_G["c"..c:GetCode()]
return m and (m.named_with_Crooked_Cook or c:IsCode(82697249))
end
function cm.initial_effect(c)
--Destroy and Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_END_PHASE,TIMING_END_PHASE+TIMINGS_CHECK_MONSTER)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--get effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(cm.effcon)
e2:SetOperation(cm.effop)
c:RegisterEffect(e2)
end
function cm.desfilter(c,tp)
return c:IsFaceup() and cm.Crooked_Cook(c) and Duel.GetMZoneCount(tp,c)>0
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and cm.desfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.desfilter,tp,LOCATION_ONFIELD,0,1,nil,tp)
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,cm.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.xyzfilter(c)
return cm.Crooked_Cook(c) and c:IsXyzSummonable(nil)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local g=Duel.GetMatchingGroup(cm.xyzfilter,tp,LOCATION_EXTRA,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=g:Select(tp,1,1,nil)
Duel.XyzSummon(tp,tg:GetFirst(),nil)
end
end
end
end
function cm.effcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_COST) and re:IsActivated() and re:IsActiveType(TYPE_XYZ)
and c:IsPreviousLocation(LOCATION_OVERLAY) and re:GetHandler() and re:GetHandler():IsAttribute(ATTRIBUTE_FIRE)
end
function cm.effop(e,tp,eg,ep,ev,re,r,rp)
if re and re:GetHandler() then
local c=e:GetHandler()
local rc=re:GetHandler()
Duel.Hint(HINT_CARD,0,m)
Duel.HintSelection(Group.FromCards(rc))
cm.COUNT_CODE_table={0}
local description=re:GetDescription()
local category=re:GetCategory()
local condition=re:GetCondition()
local cost=re:GetCost()
local target=re:GetTarget()
local operation=re:GetOperation()
local esetcountlimit=Effect.SetCountLimit
Effect.SetCountLimit=function(effect,count,code)
if code and bit.band(code,EFFECT_COUNT_CODE_SINGLE)==EFFECT_COUNT_CODE_SINGLE then
if cm.COUNT_CODE_table[1]==0 then cm.COUNT_CODE_table[1]=1
end
cm.COUNT_CODE_table[#cm.COUNT_CODE_table+1]=effect
return esetcountlimit(effect,count,0)
end
return esetcountlimit(effect,count,code)
end
local cregister=Card.RegisterEffect
Card.RegisterEffect=function(card,effect,flag)
if effect
and (not description or description==effect:GetDescription())
and (not category or category==effect:GetCategory())
and (not condition or condition==effect:GetCondition())
and (not cost or cost==effect:GetCost())
and (not target or target==effect:GetTarget())
and (not operation or operation==effect:GetOperation()) then
if cm.COUNT_CODE_table[1]==1 then
local ct=2
cm.COUNT_CODE_table[1]=59
while ct<=#cm.COUNT_CODE_table do
cregister(card,cm.COUNT_CODE_table[ct],flag)
ct=ct+1
end
return
end
return cregister(card,effect,flag)
end
if effect and cm.COUNT_CODE_table[1] and cm.COUNT_CODE_table[1]==59 then
return cregister(card,effect,flag)
end
return
end
local cid=rc:CopyEffect(rc:GetOriginalCodeRule(),RESET_EVENT+RESETS_STANDARD)
Card.RegisterEffect=cregister
Effect.SetCountLimit=esetcountlimit
if cm.COUNT_CODE_table[1] and cm.COUNT_CODE_table[1]==59 then
cm.COUNT_CODE_table[1]=rc
rc:RegisterFlagEffect(m+rc:GetFieldID(),RESET_EVENT+RESETS_STANDARD,0,0,1)
local ct=2
while ct<=#cm.COUNT_CODE_table do
rc:RegisterFlagEffect(m+rc:GetFieldID()+cm.COUNT_CODE_table[ct]:GetFieldID(),RESET_EVENT+RESETS_STANDARD,0,0,1)
ct=ct+1
end
local ge0=Effect.CreateEffect(c)
ge0:SetType(EFFECT_TYPE_FIELD)
ge0:SetCode(EFFECT_ACTIVATE_COST)
ge0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
ge0:SetLabelObject(table.unpack(cm.COUNT_CODE_table))
ge0:SetTargetRange(1,1)
ge0:SetTarget(cm.actarget)
ge0:SetCost(cm.costchk)
ge0:SetOperation(cm.costop)
Duel.RegisterEffect(ge0,0)
end
end
end
function cm.actarget(e,te,tp)
local tc=te:GetHandler()
if tc:GetFlagEffect(m+tc:GetFieldID())<=0 then return false end
return tc:GetFlagEffect(m+tc:GetFieldID()+te:GetFieldID())>0
end
function cm.costchk(e,te_or_c,tp)
local COUNT_CODE_table={e:GetLabelObject()}
local tc=COUNT_CODE_table[1]
return Duel.GetFlagEffect(tp,m+tc:GetFieldID())<=0
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local COUNT_CODE_table={e:GetLabelObject()}
local tc=COUNT_CODE_table[1]
return Duel.RegisterFlagEffect(tp,m+tc:GetFieldID(),RESET_PHASE+PHASE_END,0,0,1)
end
--背反之料理人 帮厨
local m=7438204
local cm=_G["c"..m]
cm.named_with_Crooked_Cook=1
function cm.Crooked_Cook(c)
local m=_G["c"..c:GetCode()]
return m and (m.named_with_Crooked_Cook or c:IsCode(82697249))
end
function cm.initial_effect(c)
--Destroy and Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_END_PHASE,TIMING_END_PHASE+TIMINGS_CHECK_MONSTER)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--get effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(cm.effcon)
e2:SetOperation(cm.effop)
c:RegisterEffect(e2)
end
function cm.desfilter(c,tp)
return c:IsFaceup() and cm.Crooked_Cook(c) and Duel.GetMZoneCount(tp,c)>0
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and cm.desfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.desfilter,tp,LOCATION_ONFIELD,0,1,nil,tp)
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,cm.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.xyzfilter(c,tp)
return cm.Crooked_Cook(c) and c:IsType(TYPE_XYZ) and c:IsFaceup()
and Duel.IsExistingMatchingCard(cm.matfilter,tp,LOCATION_MZONE,0,1,c)
end
function cm.matfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsCanOverlay()
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local g=Duel.GetMatchingGroup(cm.xyzfilter,tp,LOCATION_MZONE,0,nil,tp)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local tc=g:Select(tp,1,1,nil):GetFirst()
local xg=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_MZONE,0,tc)
if xg:GetCount()>0 then
for oc in aux.Next(xg) do
local og=oc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
end
Duel.Overlay(tc,xg)
end
end
end
end
end
function cm.effcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_COST) and re:IsActivated() and re:IsActiveType(TYPE_XYZ)
and c:IsPreviousLocation(LOCATION_OVERLAY) and re:GetHandler() and re:GetHandler():IsAttribute(ATTRIBUTE_FIRE)
end
function cm.effop(e,tp,eg,ep,ev,re,r,rp)
if re and re:GetHandler() then
local c=e:GetHandler()
local rc=re:GetHandler()
Duel.Hint(HINT_CARD,0,m)
Duel.HintSelection(Group.FromCards(rc))
cm.COUNT_CODE_table={0}
local description=re:GetDescription()
local category=re:GetCategory()
local condition=re:GetCondition()
local cost=re:GetCost()
local target=re:GetTarget()
local operation=re:GetOperation()
local esetcountlimit=Effect.SetCountLimit
Effect.SetCountLimit=function(effect,count,code)
if code and bit.band(code,EFFECT_COUNT_CODE_SINGLE)==EFFECT_COUNT_CODE_SINGLE then
if cm.COUNT_CODE_table[1]==0 then cm.COUNT_CODE_table[1]=1
end
cm.COUNT_CODE_table[#cm.COUNT_CODE_table+1]=effect
return esetcountlimit(effect,count,0)
end
return esetcountlimit(effect,count,code)
end
local cregister=Card.RegisterEffect
Card.RegisterEffect=function(card,effect,flag)
if effect
and (not description or description==effect:GetDescription())
and (not category or category==effect:GetCategory())
and (not condition or condition==effect:GetCondition())
and (not cost or cost==effect:GetCost())
and (not target or target==effect:GetTarget())
and (not operation or operation==effect:GetOperation()) then
if cm.COUNT_CODE_table[1]==1 then
local ct=2
cm.COUNT_CODE_table[1]=59
while ct<=#cm.COUNT_CODE_table do
cregister(card,cm.COUNT_CODE_table[ct],flag)
ct=ct+1
end
return
end
return cregister(card,effect,flag)
end
if effect and cm.COUNT_CODE_table[1] and cm.COUNT_CODE_table[1]==59 then
return cregister(card,effect,flag)
end
return
end
local cid=rc:CopyEffect(rc:GetOriginalCodeRule(),RESET_EVENT+RESETS_STANDARD)
Card.RegisterEffect=cregister
Effect.SetCountLimit=esetcountlimit
if cm.COUNT_CODE_table[1] and cm.COUNT_CODE_table[1]==59 then
cm.COUNT_CODE_table[1]=rc
rc:RegisterFlagEffect(m+rc:GetFieldID(),RESET_EVENT+RESETS_STANDARD,0,0,1)
local ct=2
while ct<=#cm.COUNT_CODE_table do
rc:RegisterFlagEffect(m+rc:GetFieldID()+cm.COUNT_CODE_table[ct]:GetFieldID(),RESET_EVENT+RESETS_STANDARD,0,0,1)
ct=ct+1
end
local ge0=Effect.CreateEffect(c)
ge0:SetType(EFFECT_TYPE_FIELD)
ge0:SetCode(EFFECT_ACTIVATE_COST)
ge0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
ge0:SetLabelObject(table.unpack(cm.COUNT_CODE_table))
ge0:SetTargetRange(1,1)
ge0:SetTarget(cm.actarget)
ge0:SetCost(cm.costchk)
ge0:SetOperation(cm.costop)
Duel.RegisterEffect(ge0,0)
end
end
end
function cm.actarget(e,te,tp)
local tc=te:GetHandler()
if tc:GetFlagEffect(m+tc:GetFieldID())<=0 then return false end
return tc:GetFlagEffect(m+tc:GetFieldID()+te:GetFieldID())>0
end
function cm.costchk(e,te_or_c,tp)
local COUNT_CODE_table={e:GetLabelObject()}
local tc=COUNT_CODE_table[1]
return Duel.GetFlagEffect(tp,m+tc:GetFieldID())<=0
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local COUNT_CODE_table={e:GetLabelObject()}
local tc=COUNT_CODE_table[1]
return Duel.RegisterFlagEffect(tp,m+tc:GetFieldID(),RESET_PHASE+PHASE_END,0,0,1)
end
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