Commit 40c6d922 authored by POLYMER's avatar POLYMER

fix

parent c5114391
......@@ -2,7 +2,6 @@
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,13020040)
c:EnableReviveLimit()
--SearchCard
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_RELEASE)
......@@ -14,7 +13,7 @@ function s.initial_effect(c)
c:RegisterEffect(e1)
--negate
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY+CATEGORY_RELEASE)
e3:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE+CATEGORY_RELEASE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
......@@ -66,6 +65,7 @@ end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
and Duel.IsChainNegatable(ev) and rp==1-tp
and Duel.GetTurnPlayer()==tp
end
function s.htgcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -81,7 +81,7 @@ function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
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)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,1,0,0)
end
end
function s.ckfi1ter(c)
......@@ -91,11 +91,23 @@ function s.rfilter(c)
return c:IsType(TYPE_RITUAL)
and (c:IsType(TYPE_MONSTER) or c:IsType(TYPE_SPELL))
end
function s.sfi1ter(c,e)
return s.rfilter(c) and (c:IsReleasableByEffect() or c:IsDestructable(e))
function s.CheckRel(c,tp)
if c:IsReleasableByEffect(c) then return true end
if Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_RELEASE) and c:IsType(TYPE_TRAP+TYPE_SPELL) then
local re={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_RELEASE)}
for i,v in ipairs(re) do
if val(v,c) then
return false
end
end
end
return true
end
function s.sfi1ter(c,e,tp)
return s.rfilter(c) and (s.CheckRel(c,tp) or c:IsDestructable(e))
end
function s.sfi2ter(c)
return c:IsReleasableByEffect() and s.rfilter(c)
function s.sfi2ter(c,tp)
return s.CheckRel(c,tp) and s.rfilter(c)
end
function s.sfi3ter(c,e)
return c:IsDestructable(e) and s.rfilter(c)
......@@ -111,7 +123,7 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp)
local hg=Duel.GetFieldGroup(tp,0x02,0)
local dg=Duel.GetDecktopGroup(tp,2)
dg:Merge(hg)
local cg=dg:Filter(s.sfi1ter,nil,e)
local cg=dg:Filter(s.sfi1ter,nil,e,tp)
local rcg=dg:Filter(s.sfi2ter,nil)
local dcg=dg:Filter(s.sfi3ter,nil,e)
local erg=Group.CreateGroup()
......@@ -136,13 +148,13 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp)
end
if #edg+#erg==3 then
Duel.DisableShuffleCheck()
local dv=Duel.Release(erg,0x40)
local dv=Duel.SendtoGrave(erg,0x42)
Duel.DisableShuffleCheck()
local dr=Duel.Destroy(edg,0x40)
if dv+dr==3 then NgCheck=true end
end
end
if NgCheck and Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
end
end
\ No newline at end of file
This diff is collapsed.
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