Commit 10f3aa6d authored by POLYMER's avatar POLYMER

fix

parent d00f4a93
No preview for this file type
--缩小药水
local m=10419801
local cm=_G["c"..m]
cm.named_with_Potion=1
function cm.Kabal(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Kabal
end
function cm.Potion(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Potion
end
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(TIMING_END_PHASE,TIMING_END_PHASE+TIMINGS_CHECK_MONSTER)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e2:SetCondition(cm.actcon)
c:RegisterEffect(e2)
--spsummon
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,1))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_LEAVE_FIELD)
e5:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e5:SetRange(LOCATION_GRAVE)
e5:SetCondition(cm.spcon)
e5:SetCost(aux.bfgcost)
e5:SetTarget(cm.sptg)
e5:SetOperation(cm.spop)
c:RegisterEffect(e5)
end
function cm.cfilter(c,tp)
return cm.Kabal(c) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(tp) and c:GetReasonPlayer()==1-tp
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function cm.spfilter(c,e,tp)
return cm.Kabal(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) and c:IsLevelBelow(Duel.GetTurnCount())
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local rg=Duel.GetReleaseGroup(tp)
rg:RemoveCard(g:GetFirst())
if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 and rg:GetCount()~=0 then
Duel.BreakEffect()
Duel.Release(g,REASON_EFFECT)
end
end
end
function cm.actfilter(c)
return c:IsFaceup() and cm.Kabal(c)
end
function cm.actcon(e)
local tp=e:GetHandler():GetControler()
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==1
and Duel.IsExistingMatchingCard(cm.actfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.filter(c)
return c:IsPosition(POS_FACEUP) and c:IsControlerCanBeChanged() and c:IsAttackBelow(1000)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_MZONE and chkc:GetControler()~=tp and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,0,LOCATION_MZONE,1,nil) and cm.TargetReflect1(e,tp,eg,ep,ev,re,r,rp,0)
and cm.TargetReflect2(e,tp,eg,ep,ev,re,r,rp,0)
and cm.TargetReflect3(e,tp,eg,ep,ev,re,r,rp,0)
and cm.TargetReflect4(e,tp,eg,ep,ev,re,r,rp,0)
and cm.TargetReflect5(e,tp,eg,ep,ev,re,r,rp,0) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,cm.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
cm.TargetReflect1(e,tp,eg,ep,ev,re,r,rp,chk)
cm.TargetReflect2(e,tp,eg,ep,ev,re,r,rp,chk)
cm.TargetReflect3(e,tp,eg,ep,ev,re,r,rp,chk)
cm.TargetReflect4(e,tp,eg,ep,ev,re,r,rp,chk)
cm.TargetReflect5(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.GetControl(tc,tp,PHASE_END,1)
end
cm.ActivateReflect1(e,tp,eg,ep,ev,re,r,rp)
cm.ActivateReflect2(e,tp,eg,ep,ev,re,r,rp)
cm.ActivateReflect3(e,tp,eg,ep,ev,re,r,rp)
cm.ActivateReflect4(e,tp,eg,ep,ev,re,r,rp)
cm.ActivateReflect5(e,tp,eg,ep,ev,re,r,rp)
end
-------------------Extra Effect---------------------
--Pot
function cm.TargetReflect1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:GetFlagEffect(10419701)~=0 then return cm.target1(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return true end
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function cm.ActivateReflect1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(10419701)~=0 then return cm.activate1(e,tp,eg,ep,ev,re,r,rp)end
end
function cm.activate1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,10419701)
Duel.BreakEffect()
Duel.Draw(tp,2,REASON_EFFECT)
end
--Thunder
function cm.TargetReflect2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:GetFlagEffect(10419702)~=0 then return cm.target2(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return true end
end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function cm.ActivateReflect2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(10419702)~=0 then return cm.activate2(e,tp,eg,ep,ev,re,r,rp)end
end
function cm.activate2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,10419702)
Duel.BreakEffect()
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(sg,REASON_EFFECT)
end
--Feather sweep
function cm.TargetReflect3(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:GetFlagEffect(10419703)~=0 then return cm.target3(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return true end
end
function cm.filter3(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.target3(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter3,tp,0,LOCATION_ONFIELD,1,c) end
local sg=Duel.GetMatchingGroup(cm.filter3,tp,0,LOCATION_ONFIELD,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function cm.ActivateReflect3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(10419703)~=0 then return cm.activate3(e,tp,eg,ep,ev,re,r,rp)end
end
function cm.activate3(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,10419703)
Duel.BreakEffect()
local sg=Duel.GetMatchingGroup(cm.filter3,tp,0,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(sg,REASON_EFFECT)
end
--Handes
function cm.TargetReflect4(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:GetFlagEffect(10419704)~=0 then return cm.target4(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return true end
end
function cm.target4(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,1-tp,1)
end
function cm.ActivateReflect4(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(10419704)~=0 then return cm.activate4(e,tp,eg,ep,ev,re,r,rp)end
end
function cm.activate4(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,10419704)
Duel.BreakEffect()
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if g:GetCount()>0 then
local sg=g:RandomSelect(1-tp,1,nil)
Duel.SendtoGrave(sg,REASON_EFFECT+REASON_DISCARD)
end
end
--Heal
function cm.TargetReflect5(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:GetFlagEffect(10419705)~=0 then return cm.target5(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return true end
end
function cm.target5(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(5000)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,0,0,tp,5000)
end
function cm.ActivateReflect5(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(10419705)~=0 then return cm.activate5(e,tp,eg,ep,ev,re,r,rp)end
end
function cm.activate5(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,10419705)
Duel.BreakEffect()
Duel.Recover(tp,5000,REASON_EFFECT)
end
--缩小药水
local m=10419802
local cm=_G["c"..m]
cm.named_with_Potion=1
function cm.Kabal(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Kabal
end
function cm.Potion(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Potion
end
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP,TIMING_DAMAGE_STEP+TIMING_END_PHASE)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e2:SetCondition(cm.actcon)
c:RegisterEffect(e2)
--spsummon
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,1))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_LEAVE_FIELD)
e5:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e5:SetRange(LOCATION_GRAVE)
e5:SetCondition(cm.spcon)
e5:SetCost(aux.bfgcost)
e5:SetTarget(cm.sptg)
e5:SetOperation(cm.spop)
c:RegisterEffect(e5)
end
function cm.cfilter(c,tp)
return cm.Kabal(c) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(tp) and c:GetReasonPlayer()==1-tp
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function cm.spfilter(c,e,tp)
return cm.Kabal(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) and c:IsLevelBelow(Duel.GetTurnCount())
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local rg=Duel.GetReleaseGroup(tp)
rg:RemoveCard(g:GetFirst())
if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 and rg:GetCount()~=0 then
Duel.BreakEffect()
Duel.Release(g,REASON_EFFECT)
end
end
end
function cm.actfilter(c)
return c:IsFaceup() and cm.Kabal(c)
end
function cm.actcon(e)
local tp=e:GetHandler():GetControler()
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==1
and Duel.IsExistingMatchingCard(cm.actfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.filter(c)
return c:IsPosition(POS_FACEUP)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) and cm.TargetReflect1(e,tp,eg,ep,ev,re,r,rp,0)
and cm.TargetReflect2(e,tp,eg,ep,ev,re,r,rp,0)
and cm.TargetReflect3(e,tp,eg,ep,ev,re,r,rp,0)
and cm.TargetReflect4(e,tp,eg,ep,ev,re,r,rp,0)
and cm.TargetReflect5(e,tp,eg,ep,ev,re,r,rp,0)
end
cm.TargetReflect1(e,tp,eg,ep,ev,re,r,rp,chk)
cm.TargetReflect2(e,tp,eg,ep,ev,re,r,rp,chk)
cm.TargetReflect3(e,tp,eg,ep,ev,re,r,rp,chk)
cm.TargetReflect4(e,tp,eg,ep,ev,re,r,rp,chk)
cm.TargetReflect5(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
if g:GetCount()==0 then return end
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-1500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
cm.ActivateReflect1(e,tp,eg,ep,ev,re,r,rp)
cm.ActivateReflect2(e,tp,eg,ep,ev,re,r,rp)
cm.ActivateReflect3(e,tp,eg,ep,ev,re,r,rp)
cm.ActivateReflect4(e,tp,eg,ep,ev,re,r,rp)
cm.ActivateReflect5(e,tp,eg,ep,ev,re,r,rp)
end
-------------------Extra Effect---------------------
--Pot
function cm.TargetReflect1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:GetFlagEffect(10419701)~=0 then return cm.target1(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return true end
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function cm.ActivateReflect1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(10419701)~=0 then return cm.activate1(e,tp,eg,ep,ev,re,r,rp)end
end
function cm.activate1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,10419701)
Duel.BreakEffect()
Duel.Draw(tp,2,REASON_EFFECT)
end
--Thunder
function cm.TargetReflect2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:GetFlagEffect(10419702)~=0 then return cm.target2(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return true end
end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function cm.ActivateReflect2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(10419702)~=0 then return cm.activate2(e,tp,eg,ep,ev,re,r,rp)end
end
function cm.activate2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,10419702)
Duel.BreakEffect()
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(sg,REASON_EFFECT)
end
--Feather sweep
function cm.TargetReflect3(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:GetFlagEffect(10419703)~=0 then return cm.target3(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return true end
end
function cm.filter3(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.target3(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter3,tp,0,LOCATION_ONFIELD,1,c) end
local sg=Duel.GetMatchingGroup(cm.filter3,tp,0,LOCATION_ONFIELD,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function cm.ActivateReflect3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(10419703)~=0 then return cm.activate3(e,tp,eg,ep,ev,re,r,rp)end
end
function cm.activate3(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,10419703)
Duel.BreakEffect()
local sg=Duel.GetMatchingGroup(cm.filter3,tp,0,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(sg,REASON_EFFECT)
end
--Handes
function cm.TargetReflect4(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:GetFlagEffect(10419704)~=0 then return cm.target4(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return true end
end
function cm.target4(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,1-tp,1)
end
function cm.ActivateReflect4(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(10419704)~=0 then return cm.activate4(e,tp,eg,ep,ev,re,r,rp)end
end
function cm.activate4(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,10419704)
Duel.BreakEffect()
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if g:GetCount()>0 then
local sg=g:RandomSelect(1-tp,1,nil)
Duel.SendtoGrave(sg,REASON_EFFECT+REASON_DISCARD)
end
end
--Heal
function cm.TargetReflect5(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:GetFlagEffect(10419705)~=0 then return cm.target5(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return true end
end
function cm.target5(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(5000)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,0,0,tp,5000)
end
function cm.ActivateReflect5(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(10419705)~=0 then return cm.activate5(e,tp,eg,ep,ev,re,r,rp)end
end
function cm.activate5(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,10419705)
Duel.BreakEffect()
Duel.Recover(tp,5000,REASON_EFFECT)
end
--缩小药水
local m=10419803
local cm=_G["c"..m]
cm.named_with_Potion=1
function cm.Kabal(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Kabal
end
function cm.Potion(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Potion
end
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(TIMING_END_PHASE+TIMING_BATTLE_PHASE,TIMING_END_PHASE+TIMINGS_CHECK_MONSTER+TIMING_BATTLE_PHASE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e2:SetCondition(cm.actcon)
c:RegisterEffect(e2)
--spsummon
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,1))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_LEAVE_FIELD)
e5:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e5:SetRange(LOCATION_GRAVE)
e5:SetCondition(cm.spcon)
e5:SetCost(aux.bfgcost)
e5:SetTarget(cm.sptg)
e5:SetOperation(cm.spop)
c:RegisterEffect(e5)
end
function cm.cfilter(c,tp)
return cm.Kabal(c) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(tp) and c:GetReasonPlayer()==1-tp
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function cm.spfilter(c,e,tp)
return cm.Kabal(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) and c:IsLevelBelow(Duel.GetTurnCount())
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local rg=Duel.GetReleaseGroup(tp)
rg:RemoveCard(g:GetFirst())
if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 and rg:GetCount()~=0 then
Duel.BreakEffect()
Duel.Release(g,REASON_EFFECT)
end
end
end
function cm.actfilter(c)
return c:IsFaceup() and cm.Kabal(c)
end
function cm.actcon(e)
local tp=e:GetHandler():GetControler()
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==1
and Duel.IsExistingMatchingCard(cm.actfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.filter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_MZONE and chkc:GetControler()~=tp and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,0,LOCATION_MZONE,1,nil) and cm.TargetReflect1(e,tp,eg,ep,ev,re,r,rp,0)
and cm.TargetReflect2(e,tp,eg,ep,ev,re,r,rp,0)
and cm.TargetReflect3(e,tp,eg,ep,ev,re,r,rp,0)
and cm.TargetReflect4(e,tp,eg,ep,ev,re,r,rp,0)
and cm.TargetReflect5(e,tp,eg,ep,ev,re,r,rp,0) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,cm.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
cm.TargetReflect1(e,tp,eg,ep,ev,re,r,rp,chk)
cm.TargetReflect2(e,tp,eg,ep,ev,re,r,rp,chk)
cm.TargetReflect3(e,tp,eg,ep,ev,re,r,rp,chk)
cm.TargetReflect4(e,tp,eg,ep,ev,re,r,rp,chk)
cm.TargetReflect5(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsLocation(LOCATION_MZONE) and tc:IsFaceup() then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
cm.ActivateReflect1(e,tp,eg,ep,ev,re,r,rp)
cm.ActivateReflect2(e,tp,eg,ep,ev,re,r,rp)
cm.ActivateReflect3(e,tp,eg,ep,ev,re,r,rp)
cm.ActivateReflect4(e,tp,eg,ep,ev,re,r,rp)
cm.ActivateReflect5(e,tp,eg,ep,ev,re,r,rp)
end
-------------------Extra Effect---------------------
--Pot
function cm.TargetReflect1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:GetFlagEffect(10419701)~=0 then return cm.target1(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return true end
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function cm.ActivateReflect1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(10419701)~=0 then return cm.activate1(e,tp,eg,ep,ev,re,r,rp)end
end
function cm.activate1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,10419701)
Duel.BreakEffect()
Duel.Draw(tp,2,REASON_EFFECT)
end
--Thunder
function cm.TargetReflect2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:GetFlagEffect(10419702)~=0 then return cm.target2(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return true end
end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function cm.ActivateReflect2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(10419702)~=0 then return cm.activate2(e,tp,eg,ep,ev,re,r,rp)end
end
function cm.activate2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,10419702)
Duel.BreakEffect()
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(sg,REASON_EFFECT)
end
--Feather sweep
function cm.TargetReflect3(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:GetFlagEffect(10419703)~=0 then return cm.target3(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return true end
end
function cm.filter3(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.target3(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter3,tp,0,LOCATION_ONFIELD,1,c) end
local sg=Duel.GetMatchingGroup(cm.filter3,tp,0,LOCATION_ONFIELD,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function cm.ActivateReflect3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(10419703)~=0 then return cm.activate3(e,tp,eg,ep,ev,re,r,rp)end
end
function cm.activate3(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,10419703)
Duel.BreakEffect()
local sg=Duel.GetMatchingGroup(cm.filter3,tp,0,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(sg,REASON_EFFECT)
end
--Handes
function cm.TargetReflect4(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:GetFlagEffect(10419704)~=0 then return cm.target4(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return true end
end
function cm.target4(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,1-tp,1)
end
function cm.ActivateReflect4(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(10419704)~=0 then return cm.activate4(e,tp,eg,ep,ev,re,r,rp)end
end
function cm.activate4(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,10419704)
Duel.BreakEffect()
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if g:GetCount()>0 then
local sg=g:RandomSelect(1-tp,1,nil)
Duel.SendtoGrave(sg,REASON_EFFECT+REASON_DISCARD)
end
end
--Heal
function cm.TargetReflect5(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:GetFlagEffect(10419705)~=0 then return cm.target5(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return true end
end
function cm.target5(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(5000)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,0,0,tp,5000)
end
function cm.ActivateReflect5(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(10419705)~=0 then return cm.activate5(e,tp,eg,ep,ev,re,r,rp)end
end
function cm.activate5(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,10419705)
Duel.BreakEffect()
Duel.Recover(tp,5000,REASON_EFFECT)
end
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
--变形药水
local m=10419810
local cm=_G["c"..m]
cm.named_with_Potion=1
function cm.Kabal(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Kabal
end
function cm.Potion(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Potion
end
function cm.initial_effect(c)
--Activate(summon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e3)
--act in hand
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e4:SetCondition(cm.actcon)
c:RegisterEffect(e4)
end
function cm.actfilter(c)
return c:IsFaceup() and cm.Kabal(c)
end
function cm.actcon(e)
local tp=e:GetHandler():GetControler()
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==1
and Duel.IsExistingMatchingCard(cm.actfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.cfilter(c)
return c:IsFaceup() and cm.Kabal(c)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0 and Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return cm.TargetReflect1(e,tp,eg,ep,ev,re,r,rp,0)
and cm.TargetReflect2(e,tp,eg,ep,ev,re,r,rp,0)
and cm.TargetReflect3(e,tp,eg,ep,ev,re,r,rp,0)
and cm.TargetReflect4(e,tp,eg,ep,ev,re,r,rp,0)
and cm.TargetReflect5(e,tp,eg,ep,ev,re,r,rp,0) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
cm.TargetReflect1(e,tp,eg,ep,ev,re,r,rp,chk)
cm.TargetReflect2(e,tp,eg,ep,ev,re,r,rp,chk)
cm.TargetReflect3(e,tp,eg,ep,ev,re,r,rp,chk)
cm.TargetReflect4(e,tp,eg,ep,ev,re,r,rp,chk)
cm.TargetReflect5(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
if Duel.Destroy(eg,REASON_EFFECT)>0 then
if Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,10419706,0,TYPES_TOKEN_MONSTER,500,500,1,RACE_BEAST,ATTRIBUTE_EARTH,POS_FACEUP,1-tp) then
local token=Duel.CreateToken(tp,10419706)
Duel.SpecialSummon(token,0,tp,1-tp,false,false,POS_FACEUP)
end
end
cm.ActivateReflect1(e,tp,eg,ep,ev,re,r,rp)
cm.ActivateReflect2(e,tp,eg,ep,ev,re,r,rp)
cm.ActivateReflect3(e,tp,eg,ep,ev,re,r,rp)
cm.ActivateReflect4(e,tp,eg,ep,ev,re,r,rp)
cm.ActivateReflect5(e,tp,eg,ep,ev,re,r,rp)
end
-------------------Extra Effect---------------------
--Pot
function cm.TargetReflect1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:GetFlagEffect(10419701)~=0 then return cm.target1(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return true end
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function cm.ActivateReflect1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(10419701)~=0 then return cm.activate1(e,tp,eg,ep,ev,re,r,rp)end
end
function cm.activate1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,10419701)
Duel.BreakEffect()
Duel.Draw(tp,2,REASON_EFFECT)
end
--Thunder
function cm.TargetReflect2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:GetFlagEffect(10419702)~=0 then return cm.target2(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return true end
end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function cm.ActivateReflect2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(10419702)~=0 then return cm.activate2(e,tp,eg,ep,ev,re,r,rp)end
end
function cm.activate2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,10419702)
Duel.BreakEffect()
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(sg,REASON_EFFECT)
end
--Feather sweep
function cm.TargetReflect3(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:GetFlagEffect(10419703)~=0 then return cm.target3(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return true end
end
function cm.filter3(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.target3(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter3,tp,0,LOCATION_ONFIELD,1,c) end
local sg=Duel.GetMatchingGroup(cm.filter3,tp,0,LOCATION_ONFIELD,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function cm.ActivateReflect3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(10419703)~=0 then return cm.activate3(e,tp,eg,ep,ev,re,r,rp)end
end
function cm.activate3(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,10419703)
Duel.BreakEffect()
local sg=Duel.GetMatchingGroup(cm.filter3,tp,0,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(sg,REASON_EFFECT)
end
--Handes
function cm.TargetReflect4(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:GetFlagEffect(10419704)~=0 then return cm.target4(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return true end
end
function cm.target4(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,1-tp,1)
end
function cm.ActivateReflect4(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(10419704)~=0 then return cm.activate4(e,tp,eg,ep,ev,re,r,rp)end
end
function cm.activate4(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,10419704)
Duel.BreakEffect()
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if g:GetCount()>0 then
local sg=g:RandomSelect(1-tp,1,nil)
Duel.SendtoGrave(sg,REASON_EFFECT+REASON_DISCARD)
end
end
--Heal
function cm.TargetReflect5(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:GetFlagEffect(10419705)~=0 then return cm.target5(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return true end
end
function cm.target5(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(5000)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,0,0,tp,5000)
end
function cm.ActivateReflect5(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(10419705)~=0 then return cm.activate5(e,tp,eg,ep,ev,re,r,rp)end
end
function cm.activate5(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,10419705)
Duel.BreakEffect()
Duel.Recover(tp,5000,REASON_EFFECT)
end
--暗金教
local m=10419901
local cm=_G["c"..m]
cm.named_with_Kabal=1
function cm.Kabal(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Kabal
end
function cm.Potion(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Potion
end
function cm.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function cm.thfilter(c)
return cm.Potion(c) and c:IsAbleToHand() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
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 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then
local tc=g:GetFirst()
--Public
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(m,9))
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
--ActivateLimit
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetTargetRange(1,0)
e2:SetValue(cm.aclimit)
e2:SetLabel(tc:GetCode())
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
local sel=0
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,2))
sel=Duel.SelectOption(tp,aux.Stringid(m,3),aux.Stringid(m,4),aux.Stringid(m,5),aux.Stringid(m,6),aux.Stringid(m,7))+1
if sel==1 then
tc:RegisterFlagEffect(10419701,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,0,1)
--Public
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(m,3))
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PUBLIC)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
elseif sel==2 then
tc:RegisterFlagEffect(10419702,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,0,1)
--Public
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(m,4))
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PUBLIC)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
elseif sel==3 then
tc:RegisterFlagEffect(10419703,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,0,1)
--Public
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(m,5))
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PUBLIC)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
elseif sel==4 then
tc:RegisterFlagEffect(10419704,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,0,1)
--Public
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(m,6))
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PUBLIC)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
elseif sel==5 then
tc:RegisterFlagEffect(10419705,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,0,1)
--Public
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(m,7))
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PUBLIC)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
end
end
function cm.aclimit(e,re,tp)
return re:GetHandler():IsCode(e:GetLabel())
end
--暗金教
local m=10419903
local cm=_G["c"..m]
cm.named_with_Kabal=1
function cm.Kabal(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Kabal
end
function cm.Potion(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Potion
end
function cm.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(10419902)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(1,0)
c:RegisterEffect(e1)
--to hand
--local e2=Effect.CreateEffect(c)
--e2:SetDescription(aux.Stringid(m,0))
--e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DECKDES)
--e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
--e2:SetRange(LOCATION_MZONE)
--e2:SetCode(EVENT_PHASE+PHASE_END)
--e2:SetCountLimit(1)
--e2:SetTarget(cm.thtg)
--e2:SetOperation(cm.thop)
--c:RegisterEffect(e2)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function cm.thfilter(c)
return cm.Potion(c) and c:IsAbleToHand() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local dg=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil)
return dg:GetClassCount(Card.GetCode)>=3
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetClassCount(Card.GetCode)>=3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg1=g:SelectSubGroup(tp,aux.dncheck,false,3,3)
Duel.ConfirmCards(1-tp,sg1)
Duel.ShuffleDeck(tp)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND)
local cg=sg1:Select(1-tp,1,1,nil)
local tc=cg:GetFirst()
tc:SetStatus(STATUS_TO_HAND_WITHOUT_CONFIRM,true)
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--暗金教
local m=10419905
local cm=_G["c"..m]
cm.named_with_Kabal=1
function cm.Kabal(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Kabal
end
function cm.Potion(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Potion
end
function cm.initial_effect(c)
--special summon
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(m,3))
e0:SetCategory(CATEGORY_SPECIAL_SUMMON)
e0:SetType(EFFECT_TYPE_QUICK_O)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetHintTiming(TIMING_MAIN_END,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e0:SetRange(LOCATION_HAND)
e0:SetCountLimit(1,m)
e0:SetCondition(cm.spcon)
e0:SetTarget(cm.sptg)
e0:SetOperation(cm.spop)
c:RegisterEffect(e0)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(10419902)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(1,0)
c:RegisterEffect(e1)
--summon
--local e2=Effect.CreateEffect(c)
--e2:SetDescription(aux.Stringid(m,2))
--e2:SetType(EFFECT_TYPE_SINGLE)
--e2:SetCode(EFFECT_SUMMON_PROC)
--e2:SetCondition(cm.ntcon)
--c:RegisterEffect(e2)
--to hand instead of send to grave
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(cm.rthcon)
e3:SetOperation(cm.rthop)
c:RegisterEffect(e3)
end
function cm.ntfilter(c)
return c:IsFaceup() and cm.Potion(c)
end
function cm.ntcon(e,c,minc)
if c==nil then return true end
return minc==0 and c:IsLevelAbove(5)
and Duel.IsExistingMatchingCard(cm.ntfilter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
or Duel.IsExistingMatchingCard(cm.ntfilter,tp,LOCATION_GRAVE,0,1,nil)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.GetReleaseGroup(tp)
g:RemoveCard(c)
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 and g:GetCount()~=0 then
Duel.BreakEffect()
Duel.Release(g,REASON_EFFECT)
end
end
function cm.rthcon(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
return Duel.GetFlagEffect(tp,m)==0 and rp==tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL|TYPE_TRAP)
and rc:IsType(TYPE_SPELL|TYPE_TRAP) and rc:IsRelateToEffect(re) and rc:IsStatus(STATUS_LEAVE_CONFIRMED) and cm.Potion(rc)
end
function cm.rthop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if Duel.SelectEffectYesNo(tp,rc,aux.Stringid(m,1)) then
rc:CancelToGrave()
Duel.SendtoHand(rc,nil,REASON_EFFECT)
Duel.RaiseEvent(rc,EVENT_TO_HAND,e,REASON_EFFECT,tp,tp,0)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,0)
end
end
--暗金教
local m=10419907
local cm=_G["c"..m]
cm.named_with_Kabal=1
function cm.Kabal(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Kabal
end
function cm.Potion(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Potion
end
function cm.initial_effect(c)
--actable
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(m,0))
e0:SetType(EFFECT_TYPE_QUICK_O)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetRange(LOCATION_HAND)
e0:SetCost(cm.actcost)
e0:SetTarget(cm.acttg)
e0:SetOperation(cm.actop)
c:RegisterEffect(e0)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_DUEL)
e1:SetCondition(cm.thcon)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function cm.chainlm(e,ep,tp)
return tp==ep
end
function cm.actcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function cm.acttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function cm.actop(e,tp,eg,ep,ev,re,r,rp)
--
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(10419902)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_GRAVE,0,nil)
return g:GetClassCount(Card.GetCode)==g:GetCount() and Duel.GetTurnCount()>=7
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,0,tp,LOCATION_REMOVED)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetCondition(cm.thcon2)
e1:SetOperation(cm.thop2)
Duel.RegisterEffect(e1,tp)
end
function cm.thfilter(c)
return c:IsAbleToHand() and cm.Potion(c) and c:IsFaceup()
end
function cm.thcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_REMOVED,0,1,nil)
end
function cm.thop2(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_REMOVED,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
This diff is collapsed.
--暗金教
local m=10419911
local cm=_G["c"..m]
cm.named_with_Kabal=1
function cm.Kabal(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Kabal
end
function cm.Potion(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Potion
end
function cm.initial_effect(c)
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(cm.splimit)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RELEASE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(TIMING_END_PHASE,TIMING_END_PHASE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(cm.spcon)
e2:SetCost(cm.spcost)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--to hand
--local e3=Effect.CreateEffect(c)
--e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
--e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
--e3:SetRange(LOCATION_MZONE)
--e3:SetCode(EVENT_PHASE+PHASE_END)
--e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
--e3:SetCost(cm.thcost)
--e3:SetTarget(cm.thtg)
--e3:SetOperation(cm.thop)
--c:RegisterEffect(e3)
--to hand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,2))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e4:SetCost(cm.thcost2)
e4:SetTarget(cm.thtg2)
e4:SetOperation(cm.thop2)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e5)
end
function cm.splimit(e,se,sp,st)
return se:IsHasType(EFFECT_TYPE_ACTIONS)
end
--function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
-- local g=Duel.GetReleaseGroup(tp)
-- if chk==0 then return g:GetCount()>0 end
-- Duel.Release(g,REASON_COST)
--end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsPublic() and c:GetFlagEffect(m)==0 end
c:RegisterFlagEffect(m,RESET_CHAIN,0,1)
end
function cm.ntfilter(c)
return c:IsFaceup() and cm.Potion(c)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.ntfilter,tp,LOCATION_GRAVE,0,1,nil)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)and Duel.CheckReleaseGroup(tp,nil,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetReleaseGroup(tp)
if g:GetCount()==0 or not c:IsRelateToEffect(e) then return end
if Duel.Release(g,REASON_EFFECT)~=0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.cfilter(c,tp)
return cm.Kabal(c) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,c)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
Duel.SendtoGrave(g,REASON_COST)
end
function cm.filter(c)
return cm.Potion(c) and c:IsAbleToHand() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,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.cfilter2(c,tp)
return cm.Potion(c) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_DECK,0,1,c)
end
function cm.thcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter2,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.cfilter2,tp,LOCATION_DECK,0,1,1,nil,tp)
Duel.SendtoGrave(g,REASON_COST)
end
function cm.filter2(c)
return c:IsAbleToHand() and cm.Kabal(c) and c:IsType(TYPE_MONSTER)
end
function cm.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter2,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
--暗金教
local m=10419913
local cm=_G["c"..m]
cm.named_with_Kabal=1
function cm.Kabal(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Kabal
end
function cm.Potion(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Potion
end
function cm.initial_effect(c)
--spsummon (self)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_RELEASE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(TIMING_END_PHASE,TIMING_END_PHASE)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCountLimit(1,m)
--e2:SetCost(cm.cost)
e2:SetCondition(cm.condition1)
e2:SetTarget(cm.target1)
e2:SetOperation(cm.operation1)
c:RegisterEffect(e2)
--draw
--local e5=Effect.CreateEffect(c)
--e5:SetCategory(CATEGORY_DRAW)
--e5:SetDescription(aux.Stringid(m,1))
--e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
--e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
--e5:SetCode(EVENT_PHASE+PHASE_END)
--e5:SetRange(LOCATION_MZONE)
--e5:SetCountLimit(1,m+1)
--e5:SetCondition(cm.drcon)
--e5:SetTarget(cm.drtg)
--e5:SetOperation(cm.drop)
--c:RegisterEffect(e5)
Duel.AddCustomActivityCounter(m,ACTIVITY_CHAIN,cm.chainfilter)
end
function cm.chainfilter(re,tp,cid)
local ph=Duel.GetCurrentPhase()
return not cm.Potion(re:GetHandler())
end
function cm.condition1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCustomActivityCount(m,tp,ACTIVITY_CHAIN)~=0
end
--function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
-- if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsRace,1,nil,RACE_SPELLCASTER) end
-- local sg=Duel.SelectReleaseGroup(tp,Card.IsRace,1,1,nil,RACE_SPELLCASTER)
-- Duel.Release(sg,REASON_COST)
--end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.CheckReleaseGroup(tp,Card.IsRace,1,nil,RACE_SPELLCASTER) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,0,0)
end
function cm.thfilter(c)
return cm.Potion(c) and c:IsAbleToHand()
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return false end
local sg=Duel.SelectReleaseGroup(tp,Card.IsRace,1,1,nil,RACE_SPELLCASTER)
if sg:GetCount()~=0 and Duel.Release(sg,REASON_EFFECT)>0 and
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local sg=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,nil)
if sg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
sg=sg:Select(tp,1,1,nil)
Duel.BreakEffect()
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
end
function cm.drcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local d=cm[tp]
if chk==0 then return d>0 and Duel.IsPlayerCanDraw(tp,d) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(d)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,d)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if d>0 then
Duel.Draw(p,d,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,3,3,nil)
if #sg>0 then
Duel.BreakEffect()
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
end
--暗金教
local m=10419915
local cm=_G["c"..m]
cm.named_with_Kabal=1
function cm.Kabal(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Kabal
end
function cm.Potion(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Potion
end
function cm.initial_effect(c)
--spsummon (self)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(TIMING_END_PHASE,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCountLimit(1,m+1)
--e2:SetCost(cm.cost)
e2:SetCondition(cm.condition1)
e2:SetTarget(cm.target1)
e2:SetOperation(cm.operation1)
c:RegisterEffect(e2)
--draw
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_DRAW)
e5:SetDescription(aux.Stringid(m,1))
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetCode(EVENT_PHASE+PHASE_END)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1,m)
e5:SetCondition(cm.drcon)
e5:SetTarget(cm.drtg)
e5:SetOperation(cm.drop)
c:RegisterEffect(e5)
Duel.AddCustomActivityCounter(m,ACTIVITY_CHAIN,cm.chainfilter)
end
function cm.chainfilter(re,tp,cid)
local ph=Duel.GetCurrentPhase()
return not cm.Potion(re:GetHandler())
end
function cm.condition1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCustomActivityCount(m,tp,ACTIVITY_CHAIN)~=0
end
--function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
-- local g=Duel.GetReleaseGroup(tp)
-- if chk==0 then return g:GetCount()>0 end
-- Duel.Release(g,REASON_COST)
--end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,nil)
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,0,0)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetReleaseGroup(tp)
if g:GetCount()==0 or not c:IsRelateToEffect(e) then return end
if Duel.Release(g,REASON_EFFECT)~=0 and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 and Duel.IsExistingMatchingCard(aux.NegateMonsterFilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectMatchingCard(tp,aux.NegateMonsterFilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c)
Duel.HintSelection(g)
local tc=g:GetFirst()
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
end
function cm.resetcount(e,tp,eg,ep,ev,re,r,rp)
cm[0]=0
cm[1]=0
end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
return cm.Potion(re:GetHandler()) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function cm.regop1(e,tp,eg,ep,ev,re,r,rp)
cm[re:GetOwnerPlayer()]=cm[re:GetOwnerPlayer()]+1
end
function cm.regop2(e,tp,eg,ep,ev,re,r,rp)
if cm[re:GetOwnerPlayer()]==0 then cm[re:GetOwnerPlayer()]=1 end
cm[re:GetOwnerPlayer()]=cm[re:GetOwnerPlayer()]-1
end
function cm.drcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local d=cm[tp]
if chk==0 then return d>0 and Duel.IsPlayerCanDraw(tp,d) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(d)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,d)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if d>0 then
Duel.Draw(p,d,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,3,3,nil)
if #sg>0 then
Duel.BreakEffect()
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
end
--暗金教
local m=10419917
local cm=_G["c"..m]
cm.named_with_Kabal=1
function cm.Kabal(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Kabal
end
function cm.Potion(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Potion
end
function cm.initial_effect(c)
--to hand
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(m,0))
e0:SetCategory(CATEGORY_TOHAND)
e0:SetType(EFFECT_TYPE_QUICK_O)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetRange(LOCATION_HAND)
e0:SetCost(cm.thcost)
e0:SetTarget(cm.thtg)
e0:SetOperation(cm.thop)
c:RegisterEffect(e0)
--damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_DUEL)
e1:SetCondition(cm.damcon)
e1:SetTarget(cm.damtg)
e1:SetOperation(cm.damop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function cm.chainlm(e,ep,tp)
return tp==ep
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function cm.thfilter(c)
return cm.Potion(c) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
function cm.damcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_GRAVE,0,nil)
return g:GetClassCount(Card.GetCode)==g:GetCount() and Duel.GetTurnCount()>=5
end
function cm.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,0,tp,LOCATION_REMOVED)
Duel.SetChainLimit(cm.chainlm)
end
function cm.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local c=e:GetHandler()
--recover
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetOperation(cm.chainreg)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetCondition(cm.damcon2)
e3:SetOperation(cm.damop2)
Duel.RegisterEffect(e3,tp)
end
--flag effect for spell counter
function cm.chainreg(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,m)==0 then
Duel.RegisterFlagEffect(tp,m,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,0,1)
end
end
function cm.damcon2(e,tp,eg,ep,ev,re,r,rp)
return re and cm.Potion(re:GetHandler()) and rp==tp and Duel.GetFlagEffect(tp,m)>0
end
function cm.damfilter(c)
return c:IsFaceup() and c:IsDefenseAbove(0)
end
function cm.damop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetOwner()
Duel.Hint(HINT_CARD,0,m)
if Duel.IsExistingMatchingCard(cm.damfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,cm.damfilter,tp,LOCATION_MZONE,LOCATION_MZONE,0,1,nil)
if g and g:GetCount()~=0 then
Duel.HintSelection(g)
local tc=g:GetFirst()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetValue(-1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
if tc:IsDefense(0) then Duel.Destroy(tc,REASON_EFFECT) end
else
Duel.Damage(1-tp,500,REASON_EFFECT)
end
else
Duel.Damage(1-tp,500,REASON_EFFECT)
end
end
--暗金教
local m=10419919
local cm=_G["c"..m]
cm.named_with_Kabal=1
function cm.Kabal(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Kabal
end
function cm.Potion(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Potion
end
function cm.initial_effect(c)
--spsummon
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(m,0))
e0:SetCategory(CATEGORY_SPECIAL_SUMMON)
e0:SetType(EFFECT_TYPE_QUICK_O)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetRange(LOCATION_HAND)
e0:SetCost(cm.spcost)
e0:SetTarget(cm.sptg)
e0:SetOperation(cm.spop)
c:RegisterEffect(e0)
--spsummon2
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_DUEL)
e1:SetCondition(cm.thcon)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function cm.chainlm(e,ep,tp)
return tp==ep
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function cm.spfilter(c,e,tp)
return cm.Kabal(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsLevelBelow(Duel.GetTurnCount())
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,e:GetHandler(),e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_GRAVE,0,nil)
return g:GetClassCount(Card.GetCode)==g:GetCount() and Duel.GetTurnCount()>=7
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,0,tp,LOCATION_GRAVE)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetCondition(cm.thcon2)
e1:SetOperation(cm.thop2)
Duel.RegisterEffect(e1,tp)
end
function cm.thfilter(c)
return c:IsAbleToHand() and cm.Kabal(c) and c:IsFaceup()
end
function cm.thcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil)
end
function cm.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.thop2(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_GRAVE,0,1,1,nil)
if #g>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_HAND,0,nil,e,tp)
if ft<=0 or g:GetCount()==0 then return end
if Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,ft)
if sg and #sg>0 then
local ct=Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
--暗金教
local m=10419921
local cm=_G["c"..m]
cm.named_with_Kabal=1
function cm.Kabal(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Kabal
end
function cm.Potion(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_Potion
end
function cm.initial_effect(c)
--special summon self
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.sspcon)
c:RegisterEffect(e1)
--special summon other monsters
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.spcon)
e2:SetCost(cm.spcost)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--grave to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetCountLimit(1,m+2)
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(cm.thcon)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(m,ACTIVITY_CHAIN,cm.chainfilter)
end
function cm.chainfilter(re,tp,cid)
local ph=Duel.GetCurrentPhase()
return not cm.Potion(re:GetHandler())
end
function cm.sspcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0,nil)<Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_MZONE,nil)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function cm.spfilter(c,e,tp)
return cm.Kabal(c) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsLevelBelow(Duel.GetTurnCount())
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and Duel.GetCustomActivityCount(m,tp,ACTIVITY_CHAIN)~=0
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
...@@ -2,21 +2,21 @@ ...@@ -2,21 +2,21 @@
local m = 12895012 local m = 12895012
local cm=_G["c"..m] local cm=_G["c"..m]
function c12895012.initial_effect(c) function c12895012.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
c:SetSPSummonOnce(12895012) c:SetSPSummonOnce(12895012)
aux.AddLinkProcedure(c,cm.matfilter,1,1) aux.AddLinkProcedure(c,cm.matfilter,1,1)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_GRAVE) e1:SetRange(LOCATION_GRAVE)
e1:SetCondition(cm.spcon) e1:SetCondition(cm.spcon)
e1:SetCost(aux.bfgcost) e1:SetCost(aux.bfgcost)
e1:SetTarget(cm.sptg) e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop) e1:SetOperation(cm.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOEXTRA+CATEGORY_TOGRAVE) e4:SetCategory(CATEGORY_TOEXTRA+CATEGORY_TOGRAVE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
...@@ -36,11 +36,36 @@ function c12895012.initial_effect(c) ...@@ -36,11 +36,36 @@ function c12895012.initial_effect(c)
ge1:SetOperation(aux.sumreg) ge1:SetOperation(aux.sumreg)
Duel.RegisterEffect(ge1,0) Duel.RegisterEffect(ge1,0)
end end
local e9=Effect.CreateEffect(c) local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e9:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e9:SetCode(EVENT_SPSUMMON_SUCCESS) e9:SetCode(EVENT_SPSUMMON_SUCCESS)
e9:SetOperation(cm.rcop) e9:SetOperation(cm.rcop)
c:RegisterEffect(e9) c:RegisterEffect(e9)
--special summon cost
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCode(EFFECT_SPSUMMON_COST)
e4:SetCost(cm.spcost)
e4:SetOperation(cm.spop2)
c:RegisterEffect(e4)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
end
function cm.counterfilter(c)
return c:IsSetCard(0xa74)
end
function cm.spcost(e,c,tp)
return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0
end
function cm.spop2(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end end
function cm.matfilter(c) function cm.matfilter(c)
return c:IsSummonType(SUMMON_TYPE_SPECIAL) and c:IsType(TYPE_MONSTER) return c:IsSummonType(SUMMON_TYPE_SPECIAL) and c:IsType(TYPE_MONSTER)
...@@ -71,8 +96,8 @@ end ...@@ -71,8 +96,8 @@ end
function cm.retop(e,tp,eg,ep,ev,re,r,rp) function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then if c:IsRelateToEffect(e) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.SendtoGrave(c,REASON_EFFECT) Duel.SendtoGrave(c,REASON_EFFECT)
else else
Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end end
end end
......
...@@ -28,6 +28,7 @@ function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -28,6 +28,7 @@ function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
e:SetCategory(CATEGORY_TODECK+CATEGORY_REMOVE) e:SetCategory(CATEGORY_TODECK+CATEGORY_REMOVE)
Duel.SetOperationInfo(0,CATEGORY_TODECK,tc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,tc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil),1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil),1,0,0)
e:SetLabelObject(tc)
elseif opt==2 then elseif opt==2 then
Duel.SetOperationInfo(0,CATEGORY_TODECK,tc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,tc,1,0,0)
Duel.ClearTargetCard() Duel.ClearTargetCard()
......
...@@ -47,9 +47,9 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -47,9 +47,9 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
elseif opt==2 then elseif opt==2 then
if not res or (Duel.IsExistingMatchingCard(cm.thfilter2,tp,LOCATION_GRAVE,0,1,nil,true) and Duel.SelectYesNo(tp,aux.Stringid(m,2))) then if not res or (Duel.IsExistingMatchingCard(cm.thfilter2,tp,LOCATION_GRAVE,0,1,nil,true) and Duel.SelectYesNo(tp,aux.Stringid(m,2))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter2),tp,LOCATION_GRAVE,0,1,1,nil) local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter2),tp,LOCATION_GRAVE,0,1,1,nil,res)
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,sg)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local tc=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil):GetFirst() local tc=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
......
...@@ -32,7 +32,7 @@ function s.initial_effect(c) ...@@ -32,7 +32,7 @@ function s.initial_effect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_CUSTOM+id) e5:SetCode(EVENT_CUSTOM+id)
e5:SetRange(LOCATION_GRAVE) e5:SetRange(LOCATION_GRAVE)
e5:SetProperty(EFFECT_FLAG_DELAY) e5:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e5:SetCondition(s.con) e5:SetCondition(s.con)
e5:SetCost(aux.bfgcost) e5:SetCost(aux.bfgcost)
e5:SetTarget(s.tg) e5:SetTarget(s.tg)
......
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