Commit 8af94f87 authored by wind2009's avatar wind2009

Fix

parent d0c15b5f
No preview for this file type
...@@ -13,19 +13,19 @@ function s.initial_effect(c) ...@@ -13,19 +13,19 @@ function s.initial_effect(c)
e1:SetValue(aux.indoval) e1:SetValue(aux.indoval)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--remove --remove
local e1=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1)) e2:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_REMOVE) e2:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id) e2:SetCountLimit(1,id)
e1:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCondition(s.descon) e2:SetCondition(s.descon)
e1:SetTarget(s.destg) e2:SetTarget(s.destg)
e1:SetOperation(s.desop) e2:SetOperation(s.desop)
c:RegisterEffect(e1) c:RegisterEffect(e2)
end end
function s.matfilter(c) function s.matfilter(c)
return c:IsRace(RACE_INSECT) and c:IsLevelAbove(5) return c:IsRace(RACE_INSECT) and c:IsLevelAbove(5)
......
...@@ -22,8 +22,8 @@ function s.initial_effect(c) ...@@ -22,8 +22,8 @@ function s.initial_effect(c)
e3:SetCategory(CATEGORY_TOHAND) e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DESTROYING) e3:SetCode(EVENT_BATTLE_DESTROYING)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,id+o) e3:SetCountLimit(1,id+o)
e3:SetCondition(s.thcon) e3:SetCondition(s.thcon)
e3:SetTarget(s.thtg) e3:SetTarget(s.thtg)
...@@ -49,13 +49,13 @@ end ...@@ -49,13 +49,13 @@ end
function s.thcon(e,tp,eg,ep,ev,re,r,rp) function s.thcon(e,tp,eg,ep,ev,re,r,rp)
local rc=eg:GetFirst() local rc=eg:GetFirst()
return rc:IsRelateToBattle() and rc:IsStatus(STATUS_OPPO_BATTLE) and rc:IsControler(tp) return rc:IsRelateToBattle() and rc:IsStatus(STATUS_OPPO_BATTLE) and rc:IsControler(tp)
and rc:IsFaceup() and rc:IsSetCard(0x1bc,0x1b1) and rc:IsLocation(LOCATION_MZONE) and rc:IsFaceup() and rc:IsSetCard(0x1bc,0x1b1)
end end
function s.thfilter(c) function s.thfilter(c)
return c:IsCode(0x19e) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand() return c:IsSetCard(0x19e) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) end if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
...@@ -63,7 +63,7 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -63,7 +63,7 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function s.thop(e,tp,eg,ep,ev,re,r,rp) function s.thop(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.SendtoHand(tc,nil,REASON_EFFECT) Duel.SendtoHand(tc,nil,REASON_EFFECT)
end end
end end
\ No newline at end of file
...@@ -31,21 +31,24 @@ end ...@@ -31,21 +31,24 @@ end
function s.mfilter2(c) function s.mfilter2(c)
return c:IsRace(RACE_ILLUSION) return c:IsRace(RACE_ILLUSION)
end end
function s.sprfilter(c,tp,sc) function s.sprfilter(c)
return bit.band(c:GetOriginalType(),TYPE_MONSTER)==TYPE_MONSTER return bit.band(c:GetOriginalType(),TYPE_MONSTER)==TYPE_MONSTER
and c:IsFaceup() and c:IsFaceup() and c:IsAbleToGraveAsCost()
end
function s.sgchk(g,tp,sc)
return Duel.GetLocationCountFromEx(tp,tp,g,sc)>0
end end
function s.hspcon(e,c) function s.hspcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local g=Duel.GetMatchingGroup(s.sprfilter,tp,LOCATION_SZONE,0,e:GetHandler()) local g=Duel.GetMatchingGroup(s.sprfilter,tp,LOCATION_SZONE,0,e:GetHandler())
return g:CheckSubGroup(function(g,tp,sc) return Duel.GetLocationCountFromEx(tp,tp,g,sc)>0 end ,2,2,tp,c) return g:CheckSubGroup(s.sgchk,2,2,tp,c)
end end
function s.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,c) function s.hsptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local tp=c:GetControler() local cp=c:GetControler()
local g=Duel.GetMatchingGroup(s.sprfilter,tp,LOCATION_SZONE,0,nil) local g=Duel.GetMatchingGroup(s.sprfilter,cp,LOCATION_SZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,cp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroup(tp,function(g,tp,sc) return Duel.GetLocationCountFromEx(tp,tp,g,sc)>0 end ,true,2,2,tp,c) local sg=g:SelectSubGroup(cp,s.sgchk,true,2,2,cp,c)
if sg then if sg then
sg:KeepAlive() sg:KeepAlive()
e:SetLabelObject(sg) e:SetLabelObject(sg)
...@@ -59,19 +62,22 @@ function s.hspop(e,tp,eg,ep,ev,re,r,rp,c) ...@@ -59,19 +62,22 @@ function s.hspop(e,tp,eg,ep,ev,re,r,rp,c)
end end
function s.mvfilter(c,tp) function s.mvfilter(c,tp)
local r=LOCATION_REASON_TOFIELD local r=LOCATION_REASON_TOFIELD
if not c:IsControler(c:GetOwner()) then r=LOCATION_REASON_CONTROL end if not c:IsControler(c:GetOwner()) then
if not c:IsAbleToChangeControler() then return false end
r=LOCATION_REASON_CONTROL
end
return c:IsFaceup() return c:IsFaceup()
and Duel.GetLocationCount(c:GetOwner(),LOCATION_SZONE,tp,r)>0 and Duel.GetLocationCount(c:GetOwner(),LOCATION_SZONE,tp,r)>0
end end
function s.mvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.mvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.mvfilter(chkc,tp) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.mvfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(s.mvfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end if chk==0 then return Duel.IsExistingTarget(s.mvfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=aux.SelectTargetFromFieldFirst(tp,s.mvfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp) Duel.SelectTarget(tp,s.mvfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp)
end end
function s.mvop(e,tp,eg,ep,ev,re,r,rp) function s.mvop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) if tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) and not tc:IsImmuneToEffect(e)
and Duel.MoveToField(tc,tp,tc:GetOwner(),LOCATION_SZONE,POS_FACEUP,true) then and Duel.MoveToField(tc,tp,tc:GetOwner(),LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetCode(EFFECT_CHANGE_TYPE)
......
...@@ -27,6 +27,7 @@ function s.initial_effect(c) ...@@ -27,6 +27,7 @@ function s.initial_effect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN) e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,id) e3:SetCountLimit(1,id)
e3:SetCondition(s.spcon) e3:SetCondition(s.spcon)
...@@ -64,7 +65,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -64,7 +65,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,e,tp)
if #g>0 then if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end end
......
...@@ -36,7 +36,7 @@ function s.cfilter(c) ...@@ -36,7 +36,7 @@ function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xac) return c:IsFaceup() and c:IsSetCard(0xac)
end end
function s.mttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.mttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ct=Duel.GetMatchingGroupCount(s.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil) local ct=Duel.GetMatchingGroupCount(s.cfilter,tp,LOCATION_MZONE,0,nil)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and s.mtfilter(chkc) end if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and s.mtfilter(chkc) end
if chk==0 then return ct>0 and e:GetHandler():IsType(TYPE_XYZ) if chk==0 then return ct>0 and e:GetHandler():IsType(TYPE_XYZ)
and Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_EFFECT) and Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_EFFECT)
...@@ -44,12 +44,15 @@ function s.mttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -44,12 +44,15 @@ function s.mttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
Duel.SelectTarget(tp,s.mtfilter,tp,0,LOCATION_MZONE,1,ct,e:GetHandler()) Duel.SelectTarget(tp,s.mtfilter,tp,0,LOCATION_MZONE,1,ct,e:GetHandler())
end end
function s.mtopfilter(c,e)
return c:IsType(TYPE_MONSTER) and c:IsRelateToEffect(e) and not c:IsImmuneToEffect(e)
end
function s.mtop(e,tp,eg,ep,ev,re,r,rp) function s.mtop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_EFFECT)==0 then return end if Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_EFFECT)==0 then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(aux.AND(Card.IsRelateToEffect,aux.NOT(Card.IsImmuneToEffect)),nil,e)
if c:IsRelateToEffect(e) then if c:IsRelateToEffect(e) then
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(s.mtopfilter,nil,e)
for tc in aux.Next(tg) do for tc in aux.Next(tg) do
local og=tc:GetOverlayGroup() local og=tc:GetOverlayGroup()
if og:GetCount()>0 then if og:GetCount()>0 then
...@@ -62,11 +65,11 @@ end ...@@ -62,11 +65,11 @@ end
function s.tgcon(e,tp,eg,ep,ev,re,r,rp) function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp return Duel.GetTurnPlayer()==1-tp
end end
function s.cfilter(c) function s.cfilter2(c)
return c:IsFaceup() and c:IsSetCard(0xac) and c:IsType((TYPE_XYZ)) return c:IsFaceup() and c:IsSetCard(0xac) and c:IsType(TYPE_XYZ)
end end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ct=Duel.GetMatchingGroupCount(s.cfilter2,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil) local ct=Duel.GetMatchingGroupCount(s.cfilter2,tp,LOCATION_MZONE,0,nil)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() end if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() end
if chk==0 then return ct>0 and Duel.CheckRemoveOverlayCard(tp,1,0,3,REASON_EFFECT) if chk==0 then return ct>0 and Duel.CheckRemoveOverlayCard(tp,1,0,3,REASON_EFFECT)
and Duel.IsExistingTarget(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,nil) end and Duel.IsExistingTarget(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,nil) 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