Commit af7ea629 authored by POLYMER's avatar POLYMER

fix

parent 3a23306b
......@@ -132,7 +132,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
if KOISHI_CHECK then
Duel.Exile(c,0)
else
Duel.SendtoGrave(c,REASON_RULE)
Duel.Remove(c,POS_FACEDOWN,REASON_RULE)
end
elseif c:IsLocation(LOCATION_HAND) then
if not cm.r then
......@@ -150,7 +150,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.DisableShuffleCheck()
Duel.Exile(tc,0)
else
Duel.SendtoGrave(c,REASON_RULE)
Duel.Remove(c,POS_FACEDOWN,REASON_RULE)
Duel.DisableShuffleCheck()
Duel.SendtoHand(tc,nil,REASON_RULE)
end
......
......@@ -36,7 +36,7 @@ function cm.fselect(g)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
return Duel.GetTurnPlayer()==tp and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetCurrentChain()==0 and (e:GetHandler():IsAbleToHand() or (e:GetHandler():IsLocation(LOCATION_HAND) and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_DECK,0,1,nil))) and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil)
return Duel.GetTurnPlayer()==tp and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetCurrentChain()==0 and (e:GetHandler():IsAbleToHand() or (e:GetHandler():IsLocation(LOCATION_HAND) and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_DECK,0,1,nil))) and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,2,nil)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
......
......@@ -9,7 +9,6 @@ function cm.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE+TIMINGS_CHECK_MONSTER)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
--tohand
......@@ -37,14 +36,11 @@ end
function cm.filter(c)
return c:IsSetCard(0x9212) and c:IsType(TYPE_MONSTER) and c:IsReleasableByEffect()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupEx(tp,cm.filter,2,nil) end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanDraw(tp) then return end
local g=Duel.SelectReleaseGroupEx(tp,cm.filter,2,2,nil)
Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,2,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,2,2,nil,tp)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Release(g,REASON_EFFECT)
end
end
......
......@@ -9,7 +9,6 @@ function cm.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
--tohand
......@@ -27,14 +26,12 @@ end
function cm.filter(c)
return c:IsSetCard(0x9212) and c:IsType(TYPE_MONSTER) and c:IsReleasableByEffect()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupEx(tp,cm.filter,2,nil) end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanDraw(tp) then return end
local g=Duel.SelectReleaseGroupEx(tp,cm.filter,2,2,nil)
Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,2,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,2,2,nil,tp)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Release(g,REASON_EFFECT)
end
end
......
......@@ -21,12 +21,13 @@ function cm.initial_effect(c)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
end
function cm.cfilter(c,e,tp)
return c:IsType(TYPE_MONSTER)
function cm.rfilter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsReleasable()
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupEx(tp,cm.cfilter,2,nil) end
local g=Duel.SelectReleaseGroupEx(tp,cm.cfilter,2,2,nil)
if chk==0 then return Duel.IsExistingMatchingCard(cm.rfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,2,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,cm.rfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,2,2,nil,tp)
Duel.Release(g,REASON_COST)
end
function cm.spfilter(c,e,tp)
......
......@@ -21,12 +21,13 @@ function cm.initial_effect(c)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
end
function cm.cfilter(c,e,tp)
return c:IsType(TYPE_MONSTER)
function cm.rfilter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsReleasable()
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupEx(tp,cm.cfilter,2,nil) end
local g=Duel.SelectReleaseGroupEx(tp,cm.cfilter,2,2,nil)
if chk==0 then return Duel.IsExistingMatchingCard(cm.rfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,2,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,cm.rfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,2,2,nil,tp)
Duel.Release(g,REASON_COST)
end
function cm.spfilter(c,e,tp)
......
......@@ -27,7 +27,7 @@ function cm.filter(c,e,tp)
return c:IsSetCard(0x9212) or c:IsType(TYPE_RITUAL)
end
function cm.RitualUltimateFilter(c,filter,e,tp,m1,m2,level_function,greater_or_equal,chk)
if (filter and not filter(c,e,tp,chk)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true,POS_FACEUP) then return false end
if (filter and not filter(c,e,tp,chk)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true,POS_FACEUP) then return false end
local mg=m1:Filter(Card.IsCanBeRitualMaterial,c,c)
if m2 then
mg:Merge(m2)
......@@ -38,22 +38,23 @@ function cm.RitualUltimateFilter(c,filter,e,tp,m1,m2,level_function,greater_or_e
mg:RemoveCard(c)
end
local lv=level_function(c)
Auxiliary.GCheckAdditional=Auxiliary.RitualCheckAdditional(c,lv,greater_or_equal)
local res=mg:CheckSubGroup(Auxiliary.RitualCheck,1,lv,tp,c,lv,greater_or_equal)
Auxiliary.GCheckAdditional=nil
aux.GCheckAdditional=aux.RitualCheckAdditional(c,lv,greater_or_equal)
local res=mg:CheckSubGroup(aux.RitualCheck,1,lv,tp,c,lv,greater_or_equal)
aux.GCheckAdditional=nil
return res
end
function cm.rstg(e,tp,eg,ep,ev,re,r,rp,chk)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg1=Duel.GetRitualMaterial(tp)
return Duel.IsExistingMatchingCard(cm.RitualUltimateFilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil,cm.filter,e,tp,mg1,nil,Card.GetLevel,"Greater")
return Duel.IsExistingMatchingCard(cm.RitualUltimateFilter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,nil,cm.filter,e,tp,mg1,nil,Card.GetLevel,"Greater")
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA+LOCATION_GRAVE)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
::cancel::
local mg1=Duel.GetRitualMaterial(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.RitualUltimateFilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,1,nil,cm.filter,e,tp,mg1,nil,Card.GetLevel,"Greater")
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.RitualUltimateFilter),tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,nil,cm.filter,e,tp,mg1,nil,Card.GetLevel,"Greater")
local tc=g:GetFirst()
if tc then
local mg=mg1:Filter(Card.IsCanBeRitualMaterial,tc,tc)
......@@ -64,9 +65,9 @@ function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,true,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end
if not mat then goto cancel end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
......@@ -78,12 +79,13 @@ function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
end
end
-----2
function cm.cfilter(c,tp)
return c:IsType(TYPE_MONSTER)
function cm.rfilter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsReleasable()
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupEx(tp,cm.cfilter,1,nil)end
local g=Duel.SelectReleaseGroupEx(tp,cm.cfilter,1,1,nil,tp)
if chk==0 then return Duel.IsExistingMatchingCard(cm.rfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,cm.rfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -8,16 +8,17 @@ function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.rstg)
e1:SetOperation(cm.rsop)
c:RegisterEffect(e1)
end
--e1
function cm.filter(c,e,tp)
return c:IsSetCard(0x9212)
return c:IsSetCard(0x9212)
end
function cm.RitualUltimateFilter(c,filter,e,tp,m1,m2,level_function,greater_or_equal,chk)
if (filter and not filter(c,e,tp,chk)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true,POS_FACEUP) then return false end
if (filter and not filter(c,e,tp,chk)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true,POS_FACEUP) then return false end
local mg=m1:Filter(Card.IsCanBeRitualMaterial,c,c)
if m2 then
mg:Merge(m2)
......@@ -28,22 +29,23 @@ function cm.RitualUltimateFilter(c,filter,e,tp,m1,m2,level_function,greater_or_e
mg:RemoveCard(c)
end
local lv=level_function(c)
Auxiliary.GCheckAdditional=Auxiliary.RitualCheckAdditional(c,lv,greater_or_equal)
local res=mg:CheckSubGroup(Auxiliary.RitualCheck,1,lv,tp,c,lv,greater_or_equal)
Auxiliary.GCheckAdditional=nil
aux.GCheckAdditional=aux.RitualCheckAdditional(c,lv,greater_or_equal)
local res=mg:CheckSubGroup(aux.RitualCheck,1,lv,tp,c,lv,greater_or_equal)
aux.GCheckAdditional=nil
return res
end
function cm.rstg(e,tp,eg,ep,ev,re,r,rp,chk)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg1=Duel.GetRitualMaterial(tp)
return Duel.IsExistingMatchingCard(cm.RitualUltimateFilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil,cm.filter,e,tp,mg1,nil,Card.GetLevel,"Greater")
return Duel.IsExistingMatchingCard(cm.RitualUltimateFilter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,nil,cm.filter,e,tp,mg1,nil,Card.GetLevel,"Greater")
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA+LOCATION_GRAVE)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
::cancel::
local mg1=Duel.GetRitualMaterial(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.RitualUltimateFilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,1,nil,cm.filter,e,tp,mg1,nil,Card.GetLevel,"Greater")
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.RitualUltimateFilter),tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,nil,cm.filter,e,tp,mg1,nil,Card.GetLevel,"Greater")
local tc=g:GetFirst()
if tc then
local mg=mg1:Filter(Card.IsCanBeRitualMaterial,tc,tc)
......@@ -54,9 +56,9 @@ function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,true,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end
if not mat then goto cancel end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
......@@ -66,5 +68,4 @@ function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
end
tc:CompleteProcedure()
end
end
end
\ No newline at end of file
......@@ -39,6 +39,7 @@ function cm.initial_effect(c)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
SNNM.ActivatedAsSpellorTrapCheck(c)
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(eg) do
......
......@@ -52,12 +52,13 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
e2:SetOperation(cm.sp)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
tc:CreateEffectRelation(e2)
end
function cm.sp(e,tp,eg,ep,ev,re,r,rp)
local re=e:GetLabelObject()
if not re then return end
local tc=re:GetLabelObject()
if not tc or Duel.GetMZoneCount(tp)==0 or tc:GetLevel()~=Duel.GetFlagEffect(0,m) then return end
if not tc or not tc:IsRelateToEffect(e) or Duel.GetMZoneCount(tp)==0 or tc:GetLevel()~=Duel.GetFlagEffect(0,m) then return end
Duel.Hint(HINT_CARD,0,m)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
e:Reset()
......
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