Commit 05e76a44 authored by yxli's avatar yxli

Fix mispatch and spirit hunter

parent 2b9e154e
...@@ -12,14 +12,9 @@ function s.initial_effect(c) ...@@ -12,14 +12,9 @@ function s.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function s.condition(e,tp,eg,ep,ev,re,r,rp) function s.condition(e,tp,eg,ep,ev,re,r,rp)
local ex2,g2,gc2,dp2,dv2=Duel.GetOperationInfo(ev,CATEGORY_SPECIAL_SUMMON)
local ex3,g3,gc3,dp3,dv3=Duel.GetOperationInfo(ev,CATEGORY_TOGRAVE)
local ex4=re:IsHasCategory(CATEGORY_DRAW) local ex4=re:IsHasCategory(CATEGORY_DRAW)
local ex5=re:IsHasCategory(CATEGORY_SEARCH) local ex5=re:IsHasCategory(CATEGORY_SEARCH)
local ex6=re:IsHasCategory(CATEGORY_DECKDES) return ep==1-tp and (ex4 or ex5)
return ep==1-tp and ((ex2 and bit.band(dv2,LOCATION_DECK)==LOCATION_DECK)
or (ex3 and bit.band(dv3,LOCATION_DECK)==LOCATION_DECK)
or ex4 or ex5 or ex6) and Duel.IsChainDisablable(ev)
end end
function s.thfilter(c) function s.thfilter(c)
return c:IsAbleToHand() return c:IsAbleToHand()
...@@ -39,7 +34,7 @@ function s.repop(e,tp,eg,ep,ev,re,r,rp) ...@@ -39,7 +34,7 @@ function s.repop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC) e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_MAIN1) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local fid=tc:GetFieldID() local fid=tc:GetFieldID()
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,fid,66) tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,fid,66)
......
...@@ -39,14 +39,13 @@ function s.pfilter(c) ...@@ -39,14 +39,13 @@ function s.pfilter(c)
return c:IsType(TYPE_MONSTER) and not c:IsForbidden() return c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end end
function s.sfilter(c,e,tp) function s.sfilter(c,e,tp)
return c:GetOriginalType()&TYPE_MONSTER>0 and c:GetType()&TYPE_CONTINUOUS+TYPE_SPELL==TYPE_CONTINUOUS+TYPE_SPELL return c:GetOriginalType()&TYPE_MONSTER>0 and c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,1-tp,false,false,POS_FACEUP,1-tp)
and c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,1-tp,false,false,POS_FACEUP,1-tp)
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)
local b1=Duel.GetLocationCount(tp,LOCATION_SZONE)>0 local b1=Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(s.pfilter,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(s.pfilter,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 local b2=Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.sfilter,tp,LOCATION_ONFIELD,0,1,nil,e,tp) and Duel.IsExistingTarget(s.sfilter,tp,LOCATION_SZONE,0,1,nil,e,tp)
if chk==0 then return b1 or b2 end if chk==0 then return b1 or b2 end
local op=0 local op=0
if b1 or b2 then if b1 or b2 then
...@@ -60,7 +59,7 @@ function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -60,7 +59,7 @@ function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
elseif op==2 then elseif op==2 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON) e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_ONFIELD) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_SZONE)
end end
end end
function s.setop(e,tp,eg,ep,ev,re,r,rp) function s.setop(e,tp,eg,ep,ev,re,r,rp)
...@@ -68,7 +67,7 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -68,7 +67,7 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,s.filter1,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,s.filter1,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then if tc then
Duel.MoveToField(tc,tp,tc:GetOwner(),LOCATION_SZONE,POS_FACEUP,true) Duel.MoveToField(tc,tp,tc:GetOwner(),LOCATION_SZONE,POS_FACEUP,true)
...@@ -83,7 +82,7 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -83,7 +82,7 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp)
elseif e:GetLabel()==2 then elseif e:GetLabel()==2 then
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(1-tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(1-tp,s.sfilter,tp,LOCATION_ONFIELD,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(1-tp,s.sfilter,tp,LOCATION_SZONE,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,0,1-tp,1-tp,false,false,POS_FACEUP)~=0 then if tc and Duel.SpecialSummon(tc,0,1-tp,1-tp,false,false,POS_FACEUP)~=0 then
Duel.BreakEffect() Duel.BreakEffect()
...@@ -102,18 +101,18 @@ function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -102,18 +101,18 @@ function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return c:IsAbleToGraveAsCost() and c:IsStatus(STATUS_EFFECT_ENABLED) end if chk==0 then return c:IsAbleToGraveAsCost() and c:IsStatus(STATUS_EFFECT_ENABLED) end
Duel.SendtoGrave(c,REASON_COST) Duel.SendtoGrave(c,REASON_COST)
end end
function s.spfilter(c,e,tp) function s.spfilter1(c,e,tp)
return c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
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)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(s.spfilter1,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(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_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,s.spfilter1,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end 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