Commit 8ae69026 authored by wind2009's avatar wind2009

Fix

parent abf9fbe7
No preview for this file type
...@@ -31,11 +31,13 @@ function s.initial_effect(c) ...@@ -31,11 +31,13 @@ function s.initial_effect(c)
end end
end end
function s.checkop(e,tp,eg,ep,ev,re,r,rp) function s.checkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetAttackTarget() then local at=Duel.GetAttackTarget()
if Duel.GetAttackTarget():IsSetCard(0x2cb) then local ar=Duel.GetAttacker()
Duel.RegisterFlagEffect(Duel.GetAttackTarget():GetControler(),id,RESET_PHASE+PHASE_END,0,1) if at then
elseif Duel.GetAttacker:IsSetCard(0x2cb) then if at:IsSetCard(0x2cb) then
Duel.RegisterFlagEffect(Duel.GetAttacker():GetControler(),id,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(at:GetControler(),id,RESET_PHASE+PHASE_END,0,1)
elseif ar and ar:IsSetCard(0x2cb) then
Duel.RegisterFlagEffect(ar:GetControler(),id,RESET_PHASE+PHASE_END,0,1)
end end
end end
end end
...@@ -52,13 +54,13 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -52,13 +54,13 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.filter1(chkc,e,tp) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.filter1(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(s.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp)end if chk==0 then return Duel.IsExistingTarget(s.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp)end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp) Duel.SelectTarget(tp,s.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if not aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) if not aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL)
or tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) then return end or tc:IsFacedown() or not tc:IsRelateToChain() or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetCode()) local g=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetCode())
local sc=g:GetFirst() local sc=g:GetFirst()
...@@ -74,7 +76,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -74,7 +76,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function s.setcon(e,tp,eg,ep,ev,re,r,rp) function s.setcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,id)==0 return Duel.GetFlagEffect(tp,id)>0
end end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() end if chk==0 then return e:GetHandler():IsSSetable() end
...@@ -82,7 +84,7 @@ function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -82,7 +84,7 @@ function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function s.setop(e,tp,eg,ep,ev,re,r,rp) function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) then if c:IsRelateToChain() and aux.NecroValleyFilter()(c) then
Duel.SSet(tp,c) Duel.SSet(tp,c)
end end
end end
\ No newline at end of file
...@@ -7,6 +7,7 @@ function s.initial_effect(c) ...@@ -7,6 +7,7 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCountLimit(1,id) e1:SetCountLimit(1,id)
e1:SetCondition(s.condition) e1:SetCondition(s.condition)
e1:SetTarget(s.target) e1:SetTarget(s.target)
...@@ -32,16 +33,18 @@ function s.initial_effect(c) ...@@ -32,16 +33,18 @@ function s.initial_effect(c)
end end
end end
function s.checkop(e,tp,eg,ep,ev,re,r,rp) function s.checkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetAttackTarget() then local at=Duel.GetAttackTarget()
if Duel.GetAttackTarget():IsSetCard(0x2cb) then local ar=Duel.GetAttacker()
Duel.RegisterFlagEffect(Duel.GetAttackTarget():GetControler(),id,RESET_PHASE+PHASE_END,0,1) if at then
elseif Duel.GetAttacker:IsSetCard(0x2cb) then if at:IsSetCard(0x2cb) then
Duel.RegisterFlagEffect(Duel.GetAttacker():GetControler(),id,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(at:GetControler(),id,RESET_PHASE+PHASE_END,0,1)
elseif ar and ar:IsSetCard(0x2cb) then
Duel.RegisterFlagEffect(ar:GetControler(),id,RESET_PHASE+PHASE_END,0,1)
end end
end end
end end
function s.condition(e,tp,eg,ep,ev,re,r,rp) function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2 return Duel.IsMainPhase()
end end
function s.filter1(c,e,tp) function s.filter1(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0x2cb) return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0x2cb)
...@@ -62,7 +65,7 @@ end ...@@ -62,7 +65,7 @@ end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if not aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) if not aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL)
or tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) then return end or tc:IsFacedown() or not tc:IsRelateToChain() or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetCode()) local g=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetCode())
local sc=g:GetFirst() local sc=g:GetFirst()
...@@ -86,7 +89,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -86,7 +89,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function s.setcon(e,tp,eg,ep,ev,re,r,rp) function s.setcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,id)==0 return Duel.GetFlagEffect(tp,id)>0
end end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() end if chk==0 then return e:GetHandler():IsSSetable() end
...@@ -94,7 +97,7 @@ function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -94,7 +97,7 @@ function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function s.setop(e,tp,eg,ep,ev,re,r,rp) function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) then if c:IsRelateToChain() and aux.NecroValleyFilter()(c) then
Duel.SSet(tp,c) Duel.SSet(tp,c)
end end
end end
\ No newline at end of file
...@@ -6,6 +6,7 @@ function s.initial_effect(c) ...@@ -6,6 +6,7 @@ function s.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END+TIMING_END_PHASE)
e1:SetCountLimit(1,id) e1:SetCountLimit(1,id)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
...@@ -17,7 +18,9 @@ function s.initial_effect(c) ...@@ -17,7 +18,9 @@ function s.initial_effect(c)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
e2:SetHintTiming(TIMING_END_PHASE)
e2:SetCountLimit(1,id+o) e2:SetCountLimit(1,id+o)
e2:SetCondition(s.setcon)
e2:SetCost(aux.bfgcost) e2:SetCost(aux.bfgcost)
e2:SetTarget(s.settg) e2:SetTarget(s.settg)
e2:SetOperation(s.setop) e2:SetOperation(s.setop)
...@@ -38,7 +41,7 @@ end ...@@ -38,7 +41,7 @@ end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.AdjustAll() Duel.AdjustAll()
...@@ -75,7 +78,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -75,7 +78,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
end end
function s.descon(e,tp,eg,ep,ev,re,r,rp) function s.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
return Duel.GetTurnCount()~=e:GetLabel() and tc:GetFlagEffect(id)~=0 return Duel.GetTurnCount()~=e:GetLabel() and tc:GetFlagEffect(id)>0
end end
function s.desop(e,tp,eg,ep,ev,re,r,rp) function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
...@@ -84,16 +87,20 @@ end ...@@ -84,16 +87,20 @@ end
function s.setfilter(c) function s.setfilter(c)
return c:IsSetCard(0x2cb) and c:IsType(TYPE_QUICKPLAY) and c:IsSSetable() return c:IsSetCard(0x2cb) and c:IsType(TYPE_QUICKPLAY) and c:IsSSetable()
end end
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_END
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.setfilter(chkc) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.setfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.setfilter,tp,LOCATION_GRAVE,0,1,nil) end if chk==0 then return Duel.IsExistingTarget(s.setfilter,tp,LOCATION_GRAVE,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectTarget(tp,s.setfilter,tp,LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectTarget(tp,s.setfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end end
function s.setop(e,tp,eg,ep,ev,re,r,rp) function s.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) and aux.NecroValleyFilter()(tc) then
Duel.SSet(tp,tc) Duel.SSet(tp,tc)
end end
end end
\ No newline at end of file
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