Commit 2e0333b8 authored by Tachibana's avatar Tachibana

nmbd

parent 333ae5da
...@@ -18,60 +18,51 @@ function cm.initial_effect(c) ...@@ -18,60 +18,51 @@ function cm.initial_effect(c)
e2:SetTarget(cm.rmtg) e2:SetTarget(cm.rmtg)
e2:SetOperation(cm.rmop) e2:SetOperation(cm.rmop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCondition(cm.condition)
e3:SetOperation(cm.regop)
c:RegisterEffect(e3)
--activate --activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1)) e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_CUSTOM+m) e1:SetCode(EVENT_LEAVE_FIELD)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m) e1:SetCountLimit(1,m)
e1:SetLabelObject(e3) e1:SetCondition(cm.condition)
e1:SetTarget(cm.target) e1:SetTarget(cm.target)
e1:SetOperation(cm.activate) e1:SetOperation(cm.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseSingleEvent(e:GetHandler(),EVENT_CUSTOM+m,e,0,tp,0,0)
local z=e:GetHandler():GetLinkedZone()
local sg=eg:Filter(cm.cfilter,nil,tp,z)
local code=sg:GetFirst():GetOriginalCode()
e:SetLabel(code)
end end
function cm.cfilter(c,tp,zone) function cm.cfilter(c,tp,zone)
local seq=c:GetPreviousSequence() local seq=c:GetPreviousSequence()
if c:GetPreviousControler()~=tp then seq=seq+16 end if c:GetPreviousControler()~=tp then seq=seq+16 end
return c:IsPreviousLocation(LOCATION_MZONE) and bit.extract(zone,seq)~=0 return c:IsPreviousLocation(LOCATION_MZONE) and bit.extract(zone,seq)~=0
end end
function cm.spfilter(c,e,tp,code) function cm.spfilter1(c,tc)
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return tc:IsCode(c:GetOriginalCode())
end
function cm.spfilter(c,e,tp,sg)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and sg:IsExists(cm.spfilter1,1,nil,c)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,tp,e:GetHandler():GetLinkedZone()) return eg:IsExists(cm.cfilter,1,nil,tp,e:GetHandler():GetLinkedZone())
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local code=e:GetLabelObject():GetLabel() local z=e:GetHandler():GetLinkedZone()
local sg=eg:Filter(cm.cfilter,nil,tp,z)
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp,code) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp,sg)
if chk==0 then return b2 end if chk==0 then return b2 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local code=e:GetLabelObject():GetLabel() local z=e:GetHandler():GetLinkedZone()
local sg=eg:Filter(cm.cfilter,nil,tp,z)
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp,code) and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp,sg)
if b2 then if b2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil,e,tp,code) local g1=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil,e,tp,sg)
if g1:GetCount()>0 then if g1:GetCount()>0 then
Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP)
end end
...@@ -93,9 +84,9 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp) ...@@ -93,9 +84,9 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local ct=Duel.SendtoHand(g,nil,REASON_EFFECT) local ct=Duel.SendtoHand(g,nil,REASON_EFFECT)
local c=e:GetHandler() local c=e:GetHandler()
if ct>0 then if ct>0 and g:IsExists(Card.IsLocation,1,nil,LOCATION_HAND) then
local tsp=tp local tsp=tp
if Duel.IsExistingMatchingCard(cm.sumfilter,tsp,LOCATION_HAND,0,1,nil,e,tsp) if Duel.IsExistingMatchingCard(cm.sumfilter,tsp,LOCATION_HAND,0,1,nil,e,tsp) and Duel.GetLocationCount(tsp,LOCATION_MZONE)>0
and Duel.SelectYesNo(tsp,aux.Stringid(m,3)) then and Duel.SelectYesNo(tsp,aux.Stringid(m,3)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tsp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tsp,HINTMSG_SPSUMMON)
...@@ -103,7 +94,7 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp) ...@@ -103,7 +94,7 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(g1,0,tsp,tsp,false,false,POS_FACEUP) Duel.SpecialSummon(g1,0,tsp,tsp,false,false,POS_FACEUP)
end end
tsp=1-tp tsp=1-tp
if Duel.IsExistingMatchingCard(cm.sumfilter,tsp,LOCATION_HAND,0,1,nil,e,tsp) if Duel.IsExistingMatchingCard(cm.sumfilter,tsp,LOCATION_HAND,0,1,nil,e,tsp) and Duel.GetLocationCount(tsp,LOCATION_MZONE)>0
and Duel.SelectYesNo(tsp,aux.Stringid(m,3)) then and Duel.SelectYesNo(tsp,aux.Stringid(m,3)) then
Duel.Hint(HINT_SELECTMSG,tsp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tsp,HINTMSG_SPSUMMON)
local g2=Duel.SelectMatchingCard(tsp,cm.sumfilter,tsp,LOCATION_HAND,0,1,1,nil,e,tsp) local g2=Duel.SelectMatchingCard(tsp,cm.sumfilter,tsp,LOCATION_HAND,0,1,1,nil,e,tsp)
......
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