Commit f1d48bad authored by 花桃白音's avatar 花桃白音

fix #119,124s,128s,187,537s,cdb

parent 9e4446a5
No preview for this file type
...@@ -80,6 +80,7 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -80,6 +80,7 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function s.thfi3ter(c) function s.thfi3ter(c)
return c:IsSetCard(0x409) and c:IsLevelBelow(7) and c:IsAbleToHand() return c:IsSetCard(0x409) and c:IsLevelBelow(7) and c:IsAbleToHand()
and not (c:IsFacedown() and c:IsLocation(0x20))
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfi3ter,tp,0x30,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.thfi3ter,tp,0x30,0,1,nil) end
...@@ -87,7 +88,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -87,7 +88,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function s.operation(e,tp,eg,ep,ev,re,r,rp) function s.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfi3ter,tp,0x30,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfi3ter),tp,0x30,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
if g:GetFirst():IsLocation(0x02) then Duel.ConfirmCards(1-tp,g) end if g:GetFirst():IsLocation(0x02) then Duel.ConfirmCards(1-tp,g) end
......
...@@ -141,7 +141,7 @@ function cm.w(c) ...@@ -141,7 +141,7 @@ function cm.w(c)
end end
function cm.con0(e,c) function cm.con0(e,c)
if c==nil then return true end if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.w,c:GetControler(),12,0,1,nil) and c:IsStatus(STATUS_PROC_COMPLETE) and c:IsCanBeSpecialSummoned(e,0,c:GetControler(),false,false) return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.w,c:GetControler(),12,0,1,nil) and not (not c:IsStatus(STATUS_PROC_COMPLETE) and c:IsType(TYPE_FUSION+TYPE_LINK+TYPE_RITUAL+TYPE_XYZ+TYPE_SYNCHRO)) and c:IsCanBeSpecialSummoned(e,0,c:GetControler(),true,true)
end end
function cm.mattg(e,c) function cm.mattg(e,c)
return c:IsType(TYPE_MONSTER) and (aux.IsCodeListed(c,12410000) or c:IsCode(12410000)) return c:IsType(TYPE_MONSTER) and (aux.IsCodeListed(c,12410000) or c:IsCode(12410000))
......
...@@ -7,7 +7,7 @@ function cm.initial_effect(c) ...@@ -7,7 +7,7 @@ function cm.initial_effect(c)
aux.AddFusionProcFunRep(c,cm.mat,2,true) aux.AddFusionProcFunRep(c,cm.mat,2,true)
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE) e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION) e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetRange(LOCATION_EXTRA) e0:SetRange(LOCATION_EXTRA)
e0:SetValue(aux.fuslimit) e0:SetValue(aux.fuslimit)
...@@ -30,6 +30,15 @@ function cm.initial_effect(c) ...@@ -30,6 +30,15 @@ function cm.initial_effect(c)
e2:SetTarget(cm.tg2) e2:SetTarget(cm.tg2)
e2:SetOperation(cm.op2) e2:SetOperation(cm.op2)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SPSUMMON_PROC)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetRange(LOCATION_EXTRA)
e3:SetCondition(cm.con3)
e3:SetOperation(cm.op3)
c:RegisterEffect(e3)
local e7=Effect.CreateEffect(c) local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e7:SetCode(EVENT_SPSUMMON_SUCCESS) e7:SetCode(EVENT_SPSUMMON_SUCCESS)
...@@ -79,6 +88,20 @@ function cm.op2(e,tp,eg,ep,ev,re,r,rp) ...@@ -79,6 +88,20 @@ function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end end
end end
function cm.r(c)
return c:GetOriginalRace()==RACE_MACHINE and c:IsAbleToGraveAsCost()
end
function cm.con3(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(cm.r,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil)
end
function cm.op3(e,tp,eg,ep,ev,re,r,rp,c)
DUel.Hint(3,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.r,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
g:DeleteGroup()
end
function cm.con7(e,tp,eg,ep,ev,re,r,rp) function cm.con7(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonLocation(LOCATION_EXTRA) return e:GetHandler():IsSummonLocation(LOCATION_EXTRA)
end end
......
...@@ -77,7 +77,6 @@ end ...@@ -77,7 +77,6 @@ end
function s.filter2(c,e,tp,m,f,gc,chkf) function s.filter2(c,e,tp,m,f,gc,chkf)
return c:IsType(TYPE_FUSION) and aux.IsCodeListed(c,12866755) and (not f or f(c)) return c:IsType(TYPE_FUSION) and aux.IsCodeListed(c,12866755) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,gc,chkf) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,gc,chkf)
and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -96,7 +95,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -96,7 +95,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,c,chkf) res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,c,chkf)
end end
end end
return res return res and c:IsRelateToEffect(e)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
......
...@@ -60,11 +60,11 @@ function s.eqfilter(c,tp) ...@@ -60,11 +60,11 @@ function s.eqfilter(c,tp)
end end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler() local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc~=c end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(s.eqfilter,tp,0,LOCATION_MZONE,1,nil,c,tp) end and Duel.IsExistingTarget(s.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,s.eqfilter,tp,0,LOCATION_MZONE,1,1,nil,c,tp) local g=Duel.SelectTarget(tp,s.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c,tp)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end end
function s.eqop(e,tp,eg,ep,ev,re,r,rp) function s.eqop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -42,7 +42,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -42,7 +42,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_GRAVE) then if tc and Duel.SendtoGrave(tc,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_GRAVE) then
local g1=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp) local g1=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp)
if g1:GetCount()>0 and Duel.GetMatchingGroupCount(nil,tp,0,LOCATION_ONFIELD,nil)>0 if g1:GetCount()>0 and Duel.GetMatchingGroupCount(nil,tp,0,LOCATION_ONFIELD,nil)>0
and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g1:Select(tp,1,1,nil) local sg=g1:Select(tp,1,1,nil)
......
...@@ -88,10 +88,9 @@ end ...@@ -88,10 +88,9 @@ end
function cm.desfilter(c) function cm.desfilter(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) return c:IsFaceup() and c:IsType(TYPE_MONSTER)
end end
function cm.ovfilter(c) function cm.ovfilter(c,e,tp)
local g=Duel.GetMatchingGroup(cm.desfilter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil):GetMaxGroup(Card.GetDefense)
local tg=g:GetMaxGroup(Card.GetDefense) return g and #g>0 and g:IsContains(c)
return tg:IsContains(c)
end end
-- --
......
...@@ -68,8 +68,9 @@ function cm.retcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -68,8 +68,9 @@ function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp return Duel.GetTurnPlayer()==1-tp
end end
function cm.rettg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return e:GetHandler():IsAbleToDeck() and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end end
function cm.filter(c) function cm.filter(c)
return c:IsCode(53718001,53718002) and c:IsAbleToGrave() return c:IsCode(53718001,53718002) and c:IsAbleToGrave()
......
...@@ -108,8 +108,9 @@ function cm.retcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -108,8 +108,9 @@ function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp return Duel.GetTurnPlayer()==1-tp
end end
function cm.rettg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return e:GetHandler():IsAbleToDeck() and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end end
function cm.filter(c) function cm.filter(c)
return c:IsCode(53718001,53718002) and c:IsAbleToGrave() return c:IsCode(53718001,53718002) and c:IsAbleToGrave()
......
...@@ -72,8 +72,9 @@ function cm.retcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -72,8 +72,9 @@ function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp return Duel.GetTurnPlayer()==1-tp
end end
function cm.rettg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return e:GetHandler():IsAbleToDeck() and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end end
function cm.filter(c) function cm.filter(c)
return c:IsCode(53718001,53718002) and c:IsAbleToGrave() return c:IsCode(53718001,53718002) and c:IsAbleToGrave()
......
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