Commit 86d96c50 authored by wind2009's avatar wind2009

Fix Hrimnir the Divine Follower

parent 77aa9dc2
...@@ -28,12 +28,12 @@ function s.filter(c) ...@@ -28,12 +28,12 @@ function s.filter(c)
return c:IsReleasable() and c:IsRace(RACE_FAIRY) return c:IsReleasable() and c:IsRace(RACE_FAIRY)
end end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE+LOCATION_HAND,0,3,nil) end if chk==0 then return Duel.CheckReleaseGroup(tp,s.filter,3,nil) end
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_MZONE+LOCATION_HAND,0,3,3,nil) local g=Duel.SelectReleaseGroup(tp,s.filter,3,3,nil)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function s.stfilter(c) function s.stfilter(c)
return c:IsType(TYPE_SPELL) and c:IsType(TYPE_CONTINUOUS) and c:IsSSetable() return c:IsAllTypes(TYPE_CONTINUOUS+TYPE_SPELL) and c:IsSSetable()
end end
function s.sttg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(s.stfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(s.stfilter,tp,LOCATION_DECK,0,1,nil) end
...@@ -47,13 +47,12 @@ function s.stop(e,tp,eg,ep,ev,re,r,rp) ...@@ -47,13 +47,12 @@ function s.stop(e,tp,eg,ep,ev,re,r,rp)
if ct~=0 then if ct~=0 then
local tc=g:GetFirst() local tc=g:GetFirst()
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1) tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1)
local e1=Effect.CreateEffect(tc) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabelObject(tc) e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,1)
e1:SetCondition(s.tgcon) e1:SetCondition(s.tgcon)
e1:SetOperation(s.tgop) e1:SetOperation(s.tgop)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
...@@ -61,8 +60,14 @@ function s.stop(e,tp,eg,ep,ev,re,r,rp) ...@@ -61,8 +60,14 @@ function s.stop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function s.tgcon(e,tp,eg,ep,ev,re,r,rp) function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()~=1-tp then return false end
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
return tc:GetFlagEffect(id)~=0 and Duel.GetTurnPlayer()==1-tp if tc:GetFlagEffectLabel(id)==e:GetLabel() then
return true
else
e:Reset()
return false
end
end end
function s.tgop(e,tp,eg,ep,ev,re,r,rp) function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
...@@ -78,7 +83,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -78,7 +83,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)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and aux.NecroValleyFilter(c) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then if c:IsRelateToChain() and aux.NecroValleyFilter(c) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
......
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