Commit 0357e59e authored by mercury233's avatar mercury233

fix

parent 8ef0f3b4
...@@ -97,72 +97,48 @@ end ...@@ -97,72 +97,48 @@ end
function c100416033.rfilter(c,tp) function c100416033.rfilter(c,tp)
return c:IsLevelAbove(7) and (c:IsControler(tp) or c:IsFaceup()) return c:IsLevelAbove(7) and (c:IsControler(tp) or c:IsFaceup())
end end
function c100416033.rfilter2(c,e,tp)
return Duel.IsExistingMatchingCard(c100416033.cfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,c)
end
function c100416033.cfilter(c,e,tp,mc)
if not (c:IsSetCard(0x261) and c:IsType(TYPE_MONSTER)) then return false end
local b1=c:IsAbleToHand()
local b2=c:IsCanBeSpecialSummoned(e,0,tp,false,false)
if not b1 and b2 then
return Duel.GetMZoneCount(tp,mc)>0
else
return b1 or b2
end
end
function c100416033.excostfilter(c,tp) function c100416033.excostfilter(c,tp)
return c:IsAbleToRemove() and c:IsHasEffect(100416038,tp) return c:IsAbleToRemove() and c:IsHasEffect(100416038,tp)
end end
function c100416033.cfilter2(c,e,tp,ft) function c100416033.costfilter(c,e,tp)
return Duel.IsExistingMatchingCard(c100416033.thfilter,tp,LOCATION_GRAVE,0,1,c,e,tp,ft) local check=Duel.GetMZoneCount(tp,c)>0
return Duel.IsExistingMatchingCard(c100416033.tgfilter,tp,LOCATION_GRAVE,0,1,c,e,tp,check)
end
function c100416033.tgfilter(c,e,tp,check)
return c:IsSetCard(0x261) and c:IsType(TYPE_MONSTER)
and (c:IsAbleToHand() or check and c:IsCanBeSpecialSummoned(e,0,tp,false,false))
end end
function c100416033.thcost(e,tp,eg,ep,ev,re,r,rp,chk) function c100416033.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetReleaseGroup(tp):Filter(c100416033.rfilter,nil,tp) local g1=Duel.GetReleaseGroup(tp):Filter(c100416033.rfilter,e:GetHandler(),tp)
local g2=Duel.GetMatchingGroup(c100416033.excostfilter,tp,LOCATION_GRAVE,0,nil,tp) local g2=Duel.GetMatchingGroup(c100416033.excostfilter,tp,LOCATION_GRAVE,0,nil,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) g1:Merge(g2)
local b1=g1:IsExists(c100416033.rfilter2,1,nil,e,tp) if chk==0 then return g1:IsExists(c100416033.costfilter,1,nil,e,tp) end
local b2=g2:IsExists(c100416033.cfilter2,1,nil,e,tp,ft) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
if chk==0 then return b1 or b2 end tc=g1:FilterSelect(tp,c100416033.costfilter,1,1,nil,e,tp):GetFirst()
local s=0 if tc:IsLocation(LOCATION_GRAVE) then
if b1 and not b2 then
s=0
elseif not b1 and b2 then
s=1
elseif b1 and b2 then
s=Duel.SelectOption(tp,aux.Stringid(100416033,2),aux.Stringid(100416033,3))
end
local tc
if s==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
tc=g1:FilterSelect(tp,c100416033.rfilter2,1,1,nil,e,tp):GetFirst()
Duel.Release(tc,REASON_COST)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
tc=g2:FilterSelect(tp,c100416033.cfilter2,1,1,nil,e,tp,ft):GetFirst()
local te=tc:IsHasEffect(100416038,tp) local te=tc:IsHasEffect(100416038,tp)
if te then if te then
te:UseCountLimit(tp) te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE) Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
end end
else
Duel.Release(tc,REASON_COST)
end end
end end
function c100416033.thfilter(c,e,tp,ft)
return c:IsSetCard(0x261) and c:IsType(TYPE_MONSTER) and (c:IsAbleToHand() or c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (not ft or ft>0))
end
function c100416033.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function c100416033.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100416033.thfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end if chk==0 then return Duel.IsExistingMatchingCard(c100416033.tgfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,true) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,0,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,0,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_GRAVE)
end end
function c100416033.thop(e,tp,eg,ep,ev,re,r,rp) function c100416033.thop(e,tp,eg,ep,ev,re,r,rp)
local check=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100416033.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100416033.tgfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp,check)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then if tc then
if tc:IsAbleToHand() and (not tc:IsCanBeSpecialSummoned(e,0,tp,false,false) or ft<=0 or Duel.SelectOption(tp,1190,1152)==0) then if tc:IsAbleToHand() and (not tc:IsCanBeSpecialSummoned(e,0,tp,false,false) or not check
or Duel.SelectOption(tp,1190,1152)==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else else
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end end
......
...@@ -31,7 +31,7 @@ function c100416035.initial_effect(c) ...@@ -31,7 +31,7 @@ function c100416035.initial_effect(c)
--negate --negate
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100416035,1)) e4:SetDescription(aux.Stringid(100416035,1))
e4:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e4:SetCategory(CATEGORY_NEGATE)
e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING) e4:SetCode(EVENT_CHAINING)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
...@@ -50,7 +50,7 @@ function c100416035.tgrfilter1(c) ...@@ -50,7 +50,7 @@ function c100416035.tgrfilter1(c)
return c:IsType(TYPE_TUNER) and c:IsLevelAbove(8) return c:IsType(TYPE_TUNER) and c:IsLevelAbove(8)
end end
function c100416035.tgrfilter2(c) function c100416035.tgrfilter2(c)
return not c:IsType(TYPE_TUNER) return not c:IsType(TYPE_TUNER) and c:IsType(TYPE_SYNCHRO)
end end
function c100416035.mnfilter(c,g) function c100416035.mnfilter(c,g)
return g:IsExists(c100416035.mnfilter2,1,c,c) return g:IsExists(c100416035.mnfilter2,1,c,c)
...@@ -86,20 +86,20 @@ function c100416035.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -86,20 +86,20 @@ function c100416035.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(dg,REASON_EFFECT) Duel.Destroy(dg,REASON_EFFECT)
end end
end end
function c100416035.negfilter(c) function c100416035.negfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x261) and c:IsOnField() and c:IsControler(tp) return c:IsFaceup() and c:IsSetCard(0x261) and c:IsOnField() and c:IsControler(tp)
end end
function c100416035.negcon(e,tp,eg,ep,ev,re,r,rp) function c100416035.negcon(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return tg and tg:IsExists(c100416035.negfilter,1,nil) and Duel.IsChainNegatable(ev) return tg and tg:IsExists(c100416035.negfilter,1,nil,tp) and Duel.IsChainNegatable(ev)
end end
function c100416035.costfilter(c,tp) function c100416035.costfilter(c,tp)
if c:IsLocation(LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE) then if c:IsLocation(LOCATION_HAND+LOCATION_MZONE) then
return c:IsType(TYPE_MONSTER) and c:IsReleasable() return c:IsType(TYPE_MONSTER) and c:IsReleasable()
else else
return c:IsLevelAbove(7) and c:IsSetCard(0x261) and c:IsAbleToRemove() and c:IsHasEffect(100416038,tp) return c:IsAbleToRemove() and c:IsHasEffect(100416038,tp)
end end
end end
function c100416035.negcost(e,tp,eg,ep,ev,re,r,rp,chk) function c100416035.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
...@@ -118,12 +118,7 @@ end ...@@ -118,12 +118,7 @@ end
function c100416035.negtg(e,tp,eg,ep,ev,re,r,rp,chk) function c100416035.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end end
function c100416035.negop(e,tp,eg,ep,ev,re,r,rp) function c100416035.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.NegateActivation(ev)
Duel.Destroy(eg,REASON_EFFECT)
end
end end
...@@ -56,8 +56,7 @@ function c100416039.spfilter2(c,e,tp,lv) ...@@ -56,8 +56,7 @@ function c100416039.spfilter2(c,e,tp,lv)
return c100416039.spfilter(c,e,tp,nil) and c:IsLevel(lv) return c100416039.spfilter(c,e,tp,nil) and c:IsLevel(lv)
end end
function c100416039.fselect(g,e,tp) function c100416039.fselect(g,e,tp)
return g:GetCount()==2 and g:IsExists(Card.IsType,1,nil,TYPE_TUNER) and g:IsExists(aux.NOT(Card.IsType),1,nil,TYPE_TUNER) return g:GetCount()==2 and Duel.IsExistingMatchingCard(c100416039.spfilter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,g)
and Duel.IsExistingMatchingCard(c100416039.spfilter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,g)
end end
function c100416039.target(e,tp,eg,ep,ev,re,r,rp,chk) function c100416039.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(c100416039.thfilter,tp,LOCATION_GRAVE,0,1,nil) local b1=Duel.IsExistingMatchingCard(c100416039.thfilter,tp,LOCATION_GRAVE,0,1,nil)
...@@ -98,9 +97,9 @@ function c100416039.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -98,9 +97,9 @@ function c100416039.activate(e,tp,eg,ep,ev,re,r,rp)
if rg and rg:GetCount()==2 then if rg and rg:GetCount()==2 then
local c1=rg:GetFirst() local c1=rg:GetFirst()
local c2=rg:GetNext() local c2=rg:GetNext()
local lv=c1:GetLevel()-c2:GetLevel()
if lv<0 then lv=-lv end
if Duel.Release(rg,REASON_EFFECT)==2 then if Duel.Release(rg,REASON_EFFECT)==2 then
local lv=c1:GetLevel()-c2:GetLevel()
if lv<0 then lv=-lv end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c100416039.spfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,lv) local sg=Duel.SelectMatchingCard(tp,c100416039.spfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,lv)
if sg:GetCount()>0 then if sg:GetCount()>0 then
......
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