Commit 4f472bba authored by POLYMER's avatar POLYMER

fix

parent 2b346adb
......@@ -103,7 +103,7 @@ function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsFaceup() or not c:IsRelateToEffect(e) or not c:IsSummonType(SUMMON_TYPE_ADVANCE) then return end
if not c:IsRelateToEffect(e) or not c:IsSummonType(SUMMON_TYPE_ADVANCE) then return end
local g1=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
local g2=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
if #g1>0 and (#g2==0 or Duel.SelectYesNo(tp,aux.Stringid(m,1))) then
......
......@@ -106,7 +106,7 @@ function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsFaceup() or not c:IsRelateToEffect(e) or not c:IsSummonType(SUMMON_TYPE_ADVANCE) then return end
if not c:IsRelateToEffect(e) or not c:IsSummonType(SUMMON_TYPE_ADVANCE) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
if #g>0 then
......
......@@ -114,7 +114,7 @@ function cm.setfilter(c)
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsFaceup() or not c:IsRelateToEffect(e) or not c:IsSummonType(SUMMON_TYPE_ADVANCE) then return end
if not c:IsRelateToEffect(e) or not c:IsSummonType(SUMMON_TYPE_ADVANCE) then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,cm.setfilter,tp,LOCATION_DECK,0,1,1,nil)
......
......@@ -140,7 +140,7 @@ function cm.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsFaceup() or not c:IsRelateToEffect(e) or not c:IsSummonType(SUMMON_TYPE_ADVANCE) then return end
if not c:IsRelateToEffect(e) or not c:IsSummonType(SUMMON_TYPE_ADVANCE) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectMatchingCard(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil)
if #g>0 then
......
......@@ -94,7 +94,7 @@ function cm.ngcon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.ngop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsFaceup() or not c:IsRelateToEffect(e) or not c:IsSummonType(SUMMON_TYPE_ADVANCE) then return end
if not c:IsRelateToEffect(e) or not c:IsSummonType(SUMMON_TYPE_ADVANCE) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
......
......@@ -95,7 +95,7 @@ function cm.dfcon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.dfop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsFaceup() or not c:IsRelateToEffect(e) or not c:IsSummonType(SUMMON_TYPE_ADVANCE) then return end
if not c:IsRelateToEffect(e) or not c:IsSummonType(SUMMON_TYPE_ADVANCE) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
......
......@@ -34,10 +34,6 @@ function cm.initial_effect(c)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
local e4=e2:Clone()
e4:SetCategory(CATEGORY_REMOVE)
e4:SetTarget(cm.sptg2)
c:RegisterEffect(e4)
end
function cm.cfilter(c,code)
return c:IsFaceup() and c:IsCode(code)
......@@ -96,7 +92,7 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local sa=c:IsLocation(LOCATION_HAND) and Duel.GetFlagEffect(tp,m+1)==0
local sb=c:IsLocation(LOCATION_REMOVED) and Duel.GetFlagEffect(tp,m+10)==0
if chk==0 then return (Duel.GetCurrentChain()>0 and (c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0)) and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND,1,nil) and (sa or sb) end
if chk==0 then return ((c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) or Duel.GetCurrentChain()==0) and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND,1,nil) and (sa or sb) end
Duel.Hint(HINT_OPSELECTED,tp,e:GetDescription())
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
if c:IsLocation(LOCATION_HAND) then
......@@ -105,21 +101,12 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RegisterFlagEffect(tp,m+10,RESET_PHASE+PHASE_END,0,1)
end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local sa=c:IsLocation(LOCATION_HAND) and Duel.GetFlagEffect(tp,m+1)==0
local sb=c:IsLocation(LOCATION_REMOVED) and Duel.GetFlagEffect(tp,m+10)==0
if chk==0 then return Duel.GetCurrentChain()==0 and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND,1,nil) and (sa or sb) end
Duel.Hint(HINT_OPSELECTED,tp,e:GetDescription())
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
if c:IsLocation(LOCATION_HAND) then
Duel.RegisterFlagEffect(tp,m+1,RESET_PHASE+PHASE_END,0,1)
elseif c:IsLocation(LOCATION_REMOVED) then
Duel.RegisterFlagEffect(tp,m+10,RESET_PHASE+PHASE_END,0,1)
if Duel.GetCurrentChain()==1 then
e:SetCategory(CATEGORY_REMOVE)
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_HAND)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -35,10 +35,6 @@ function cm.initial_effect(c)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
local e4=e2:Clone()
e4:SetCategory(CATEGORY_REMOVE)
e4:SetTarget(cm.sptg2)
c:RegisterEffect(e4)
end
function cm.thfilter(c,tp)
return Duel.GetMZoneCount(tp,c)>0 and c:IsAbleToRemove()
......@@ -88,7 +84,7 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local sa=c:IsLocation(LOCATION_HAND) and Duel.GetFlagEffect(tp,m+1)==0
local sb=c:IsLocation(LOCATION_REMOVED) and Duel.GetFlagEffect(tp,m+10)==0
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and cm.desfilter(chkc,tp) end
if chk==0 then return (Duel.GetCurrentChain()>0 and (c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0)) and Duel.IsExistingTarget(cm.refilter,tp,0,LOCATION_ONFIELD,1,nil) and (sa or sb) end
if chk==0 then return ((c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) or Duel.GetCurrentChain()==0) and Duel.IsExistingTarget(cm.refilter,tp,0,LOCATION_ONFIELD,1,nil) and (sa or sb) end
Duel.Hint(HINT_OPSELECTED,tp,e:GetDescription())
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
if c:IsLocation(LOCATION_HAND) then
......@@ -99,24 +95,12 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,cm.refilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
local sa=c:IsLocation(LOCATION_HAND) and Duel.GetFlagEffect(tp,m+1)==0
local sb=c:IsLocation(LOCATION_REMOVED) and Duel.GetFlagEffect(tp,m+10)==0
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and cm.desfilter(chkc,tp) end
if chk==0 then return Duel.GetCurrentChain()==0 and Duel.IsExistingTarget(cm.refilter,tp,0,LOCATION_ONFIELD,1,nil) and (sa or sb) end
Duel.Hint(HINT_OPSELECTED,tp,e:GetDescription())
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
if c:IsLocation(LOCATION_HAND) then
Duel.RegisterFlagEffect(tp,m+1,RESET_PHASE+PHASE_END,0,1)
elseif c:IsLocation(LOCATION_REMOVED) then
Duel.RegisterFlagEffect(tp,m+10,RESET_PHASE+PHASE_END,0,1)
if Duel.GetCurrentChain()==1 then
e:SetCategory(CATEGORY_REMOVE)
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,cm.refilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -34,10 +34,6 @@ function cm.initial_effect(c)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
local e4=e2:Clone()
e4:SetCategory(CATEGORY_REMOVE+CATEGORY_GRAVE_ACTION)
e4:SetTarget(cm.sptg2)
c:RegisterEffect(e4)
end
function cm.cfilter(c,code)
return c:IsFaceup() and c:IsCode(code)
......@@ -100,7 +96,7 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local sa=c:IsLocation(LOCATION_HAND) and Duel.GetFlagEffect(tp,m+1)==0
local sb=c:IsLocation(LOCATION_REMOVED) and Duel.GetFlagEffect(tp,m+10)==0
if chk==0 then return (Duel.GetCurrentChain()>0 and (c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0)) and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) and (sa or sb) end
if chk==0 then return ((c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) or Duel.GetCurrentChain()==0) and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) and (sa or sb) end
Duel.Hint(HINT_OPSELECTED,tp,e:GetDescription())
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
if c:IsLocation(LOCATION_HAND) then
......@@ -109,21 +105,12 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RegisterFlagEffect(tp,m+10,RESET_PHASE+PHASE_END,0,1)
end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,PLAYER_ALL,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local sa=c:IsLocation(LOCATION_HAND) and Duel.GetFlagEffect(tp,m+1)==0
local sb=c:IsLocation(LOCATION_REMOVED) and Duel.GetFlagEffect(tp,m+10)==0
if chk==0 then return Duel.GetCurrentChain()==0 and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) and (sa or sb) end
Duel.Hint(HINT_OPSELECTED,tp,e:GetDescription())
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
if c:IsLocation(LOCATION_HAND) then
Duel.RegisterFlagEffect(tp,m+1,RESET_PHASE+PHASE_END,0,1)
elseif c:IsLocation(LOCATION_REMOVED) then
Duel.RegisterFlagEffect(tp,m+10,RESET_PHASE+PHASE_END,0,1)
if Duel.GetCurrentChain()==1 then
e:SetCategory(CATEGORY_REMOVE+CATEGORY_GRAVE_ACTION)
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE+CATEGORY_GRAVE_ACTION)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,PLAYER_ALL,LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -36,10 +36,6 @@ function cm.initial_effect(c)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
local e4=e2:Clone()
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetTarget(cm.sptg2)
c:RegisterEffect(e4)
end
function cm.thfilter(c,tp)
return Duel.GetMZoneCount(tp,c)>0 and c:IsAbleToRemove()
......@@ -95,6 +91,11 @@ function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local exc=not nsp and c
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tg=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_HAND,0,1,1,exc)
if c:IsLocation(LOCATION_HAND) then
Duel.RegisterFlagEffect(tp,m+1,RESET_PHASE+PHASE_END,0,1)
elseif c:IsLocation(LOCATION_REMOVED) then
Duel.RegisterFlagEffect(tp,m+10,RESET_PHASE+PHASE_END,0,1)
end
Duel.Remove(tg,POS_FACEUP,REASON_COST)
end
function cm.thfilter2(c)
......@@ -104,30 +105,16 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local sa=c:IsLocation(LOCATION_HAND) and Duel.GetFlagEffect(tp,m+1)==0
local sb=c:IsLocation(LOCATION_REMOVED) and Duel.GetFlagEffect(tp,m+10)==0
if chk==0 then return (Duel.GetCurrentChain()>0 and (c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0)) and Duel.IsExistingMatchingCard(cm.thfilter2,tp,LOCATION_DECK,0,1,nil) and (sa or sb) end
if chk==0 then return ((c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) or Duel.GetCurrentChain()==0) and Duel.IsExistingMatchingCard(cm.thfilter2,tp,LOCATION_DECK,0,1,nil) and (sa or sb) end
Duel.Hint(HINT_OPSELECTED,tp,e:GetDescription())
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
if c:IsLocation(LOCATION_HAND) then
Duel.RegisterFlagEffect(tp,m+1,RESET_PHASE+PHASE_END,0,1)
elseif c:IsLocation(LOCATION_REMOVED) then
Duel.RegisterFlagEffect(tp,m+10,RESET_PHASE+PHASE_END,0,1)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local sa=c:IsLocation(LOCATION_HAND) and Duel.GetFlagEffect(tp,m+1)==0
local sb=c:IsLocation(LOCATION_REMOVED) and Duel.GetFlagEffect(tp,m+10)==0
if chk==0 then return Duel.GetCurrentChain()==0 and Duel.IsExistingMatchingCard(cm.thfilter2,tp,LOCATION_DECK,0,1,nil) and (sa or sb) end
Duel.Hint(HINT_OPSELECTED,tp,e:GetDescription())
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
if c:IsLocation(LOCATION_HAND) then
Duel.RegisterFlagEffect(tp,m+1,RESET_PHASE+PHASE_END,0,1)
elseif c:IsLocation(LOCATION_REMOVED) then
Duel.RegisterFlagEffect(tp,m+10,RESET_PHASE+PHASE_END,0,1)
if Duel.GetCurrentChain()==1 then
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -34,10 +34,6 @@ function cm.initial_effect(c)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
local e4=e2:Clone()
e4:SetCategory(CATEGORY_REMOVE)
e4:SetTarget(cm.sptg2)
c:RegisterEffect(e4)
end
function cm.cfilter(c,code)
return c:IsFaceup() and c:IsCode(code)
......@@ -97,7 +93,7 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local sa=c:IsLocation(LOCATION_HAND) and Duel.GetFlagEffect(tp,m+1)==0
local sb=c:IsLocation(LOCATION_REMOVED) and Duel.GetFlagEffect(tp,m+10)==0
local rg=Duel.GetDecktopGroup(tp,2)
if chk==0 then return (Duel.GetCurrentChain()>0 and (c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0)) and rg:FilterCount(Card.IsAbleToRemove,nil)==2 and (sa or sb) end
if chk==0 then return ((c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) or Duel.GetCurrentChain()==0) and rg:FilterCount(Card.IsAbleToRemove,nil)==2 and (sa or sb) end
Duel.Hint(HINT_OPSELECTED,tp,e:GetDescription())
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
if c:IsLocation(LOCATION_HAND) then
......@@ -106,22 +102,12 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RegisterFlagEffect(tp,m+10,RESET_PHASE+PHASE_END,0,1)
end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,rg,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local sa=c:IsLocation(LOCATION_HAND) and Duel.GetFlagEffect(tp,m+1)==0
local sb=c:IsLocation(LOCATION_REMOVED) and Duel.GetFlagEffect(tp,m+10)==0
local rg=Duel.GetDecktopGroup(tp,2)
if chk==0 then return Duel.GetCurrentChain()==0 and rg:FilterCount(Card.IsAbleToRemove,nil)==2 and (sa or sb) end
Duel.Hint(HINT_OPSELECTED,tp,e:GetDescription())
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
if c:IsLocation(LOCATION_HAND) then
Duel.RegisterFlagEffect(tp,m+1,RESET_PHASE+PHASE_END,0,1)
elseif c:IsLocation(LOCATION_REMOVED) then
Duel.RegisterFlagEffect(tp,m+10,RESET_PHASE+PHASE_END,0,1)
if Duel.GetCurrentChain()==1 then
e:SetCategory(CATEGORY_REMOVE)
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,rg,2,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -36,10 +36,6 @@ function cm.initial_effect(c)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
local e4=e2:Clone()
e4:SetCategory(CATEGORY_DRAW)
e4:SetTarget(cm.sptg2)
c:RegisterEffect(e4)
end
function cm.thfilter(c,tp)
return Duel.GetMZoneCount(tp,c)>0 and c:IsAbleToRemove()
......@@ -95,36 +91,27 @@ function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local exc=not nsp and c
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tg=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_HAND,0,1,1,exc)
Duel.Remove(tg,POS_FACEUP,REASON_COST)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local sa=c:IsLocation(LOCATION_HAND) and Duel.GetFlagEffect(tp,m+1)==0
local sb=c:IsLocation(LOCATION_REMOVED) and Duel.GetFlagEffect(tp,m+10)==0
if chk==0 then return (Duel.GetCurrentChain()>0 and (c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0)) and Duel.IsPlayerCanDraw(tp,1) and (sa or sb) end
Duel.Hint(HINT_OPSELECTED,tp,e:GetDescription())
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
if c:IsLocation(LOCATION_HAND) then
Duel.RegisterFlagEffect(tp,m+1,RESET_PHASE+PHASE_END,0,1)
elseif c:IsLocation(LOCATION_REMOVED) then
Duel.RegisterFlagEffect(tp,m+10,RESET_PHASE+PHASE_END,0,1)
end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.Remove(tg,POS_FACEUP,REASON_COST)
end
function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local sa=c:IsLocation(LOCATION_HAND) and Duel.GetFlagEffect(tp,m+1)==0
local sb=c:IsLocation(LOCATION_REMOVED) and Duel.GetFlagEffect(tp,m+10)==0
if chk==0 then return Duel.GetCurrentChain()==0 and Duel.IsPlayerCanDraw(tp,1) and (sa or sb) end
if chk==0 then return ((c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) or Duel.GetCurrentChain()==0) and Duel.IsPlayerCanDraw(tp,1) and (sa or sb) end
Duel.Hint(HINT_OPSELECTED,tp,e:GetDescription())
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
if c:IsLocation(LOCATION_HAND) then
Duel.RegisterFlagEffect(tp,m+1,RESET_PHASE+PHASE_END,0,1)
elseif c:IsLocation(LOCATION_REMOVED) then
Duel.RegisterFlagEffect(tp,m+10,RESET_PHASE+PHASE_END,0,1)
end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
if Duel.GetCurrentChain()==1 then
e:SetCategory(CATEGORY_DRAW)
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -34,14 +34,6 @@ function cm.initial_effect(c)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
local e4=e2:Clone()
e4:SetCategory(CATEGORY_REMOVE)
e4:SetRange(LOCATION_HAND)
e4:SetTarget(cm.sptg2)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetRange(LOCATION_REMOVED)
c:RegisterEffect(e5)
end
function cm.thfilter(c,e,tp)
return c:IsSetCard(0x9977) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......@@ -110,7 +102,7 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local nsp=Duel.GetCurrentChain()==0
local fd=nsp and 0 or 1
local exc=not nsp and c
return (Duel.GetCurrentChain()>0 and (c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0)) and Duel.IsExistingMatchingCard(cm.setfilter,tp,LOCATION_REMOVED,0,1,exc,e,tp,fd) and (sa or sb)
return ((c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) or Duel.GetCurrentChain()==0) and Duel.IsExistingMatchingCard(cm.setfilter,tp,LOCATION_REMOVED,0,1,exc,e,tp,fd) and (sa or sb)
end
Duel.Hint(HINT_OPSELECTED,tp,e:GetDescription())
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
......@@ -119,24 +111,8 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
elseif c:IsLocation(LOCATION_REMOVED) then
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local sa=c:IsLocation(LOCATION_HAND) and Duel.GetFlagEffect(tp,m-1)==0
local sb=c:IsLocation(LOCATION_REMOVED) and Duel.GetFlagEffect(tp,m)==0
if chk==0 then
local nsp=Duel.GetCurrentChain()==0
local fd=nsp and 0 or 1
local exc=not nsp and c
return Duel.GetCurrentChain()==0 and Duel.IsExistingMatchingCard(cm.setfilter,tp,LOCATION_REMOVED,0,1,exc,e,tp,fd) and (sa or sb)
end
Duel.Hint(HINT_OPSELECTED,tp,e:GetDescription())
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
if c:IsLocation(LOCATION_HAND) then
Duel.RegisterFlagEffect(tp,m-1,RESET_PHASE+PHASE_END,0,1)
elseif c:IsLocation(LOCATION_REMOVED) then
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
if Duel.GetCurrentChain()>1 then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -115,13 +115,11 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)return ev==ct end)
tc:RegisterEffect(e1)
local _,e1_1,e2,e3=SNNM.ActivatedAsSpellorTrap(tc,0x10002,LOCATION_HAND)
e1_1:SetLabelObject(e1)
local e1_1,e2,e3,e2_1=SNNM.ActivatedAsSpellorTrap(tc,0x10002,LOCATION_HAND,true,e1)
e1_1:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetLabelObject(e1)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e3:SetLabelObject(e1)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
e2_1:SetReset(RESET_EVENT+RESETS_STANDARD)
local hte1=Effect.CreateEffect(c)
hte1:SetType(EFFECT_TYPE_FIELD)
hte1:SetCode(53765050)
......
......@@ -7,9 +7,9 @@ function cm.initial_effect(c)
e11:SetDescription(aux.Stringid(m,1))
e11:SetCategory(CATEGORY_SPECIAL_SUMMON)
e11:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e11:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e11:SetCode(EVENT_SPSUMMON_SUCCESS)
e11:SetProperty(EFFECT_FLAG_DELAY)
e11:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e11:SetCountLimit(1,m+10000000)
e11:SetCondition(cm.spcon)
e11:SetTarget(cm.sptg)
......@@ -31,7 +31,7 @@ function cm.cfilter(c,tp)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return eg:IsExists(cm.cfilter,1,nil,tp)
return true
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -91,8 +91,8 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m+30000000)
e3:SetCondition(cm.con)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
e3:SetTarget(cm.sytg)
e3:SetOperation(cm.syop)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e3)
local e3=Effect.CreateEffect(c)
......@@ -110,7 +110,7 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
c:RegisterEffect(e3)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,3))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
......@@ -144,12 +144,12 @@ function cm.lkop(e,tp,eg,ep,ev,re,r,rp)
Duel.LinkSummon(tp,sg:GetFirst(),nil,c)
end
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
function cm.sytg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING)
and Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
function cm.syop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsControler(1-tp) or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,c)
......
......@@ -103,7 +103,7 @@ function s.mtop(e,tp,eg,ep,ev,re,r,rp)
rc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,4))
end
function s.thfilter(c)
return c:IsSetCard(0xbd) or c:IsSetCard(0x10cf) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
return (c:IsSetCard(0xbd) or c:IsSetCard(0x10cf)) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
......
......@@ -42,13 +42,13 @@ function c9910773.thop1(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g)
end
end
function c9910773.cfilter(c)
function c9910773.cfilter(c,tp)
return c:IsPreviousControler(tp) and c:IsSetCard(0x5951) and c:IsPreviousSetCard(0x5951)
and c:IsType(TYPE_MONSTER) and c:IsLocation(LOCATION_DECK) and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousPosition(POS_FACEUP)
end
function c9910773.thcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c9910773.cfilter,1,nil) and not eg:IsContains(e:GetHandler())
return eg:IsExists(c9910773.cfilter,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function c9910773.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() 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