Commit d321160c authored by Nemo Ma's avatar Nemo Ma

fix

parent 9b75c7d9
...@@ -49,22 +49,22 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -49,22 +49,22 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_DECK,0,ac/800,ac/800,nil) local rg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_DECK,0,ac/800,ac/800,nil)
Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT) Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)
end end
function cm.remfilter(c) function cm.remfilter(c,tp)
return c:GetFlagEffect(m)<1 return c:GetFlagEffect(m)<1 and c:IsControler(tp)
end end
function cm.discon(e,tp,eg,ep,ev,re,r,rp) function cm.discon(e,tp,eg,ep,ev,re,r,rp)
local sg=eg:Filter(cm.remfilter,nil) local sg=eg:Filter(cm.remfilter,nil,tp)
return sg:GetCount()>0 return sg:GetCount()>0
end end
function cm.disop(e,tp,eg,ep,ev,re,r,rp) function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
local num=Duel.Remove(eg:Filter(cm.remfilter,nil),POS_FACEDOWN,REASON_RULE) local num=Duel.Remove(eg:Filter(cm.remfilter,nil,tp),POS_FACEDOWN,REASON_RULE)
if num<1 then return end if num<1 then return end
local tg=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil) local tg=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
local sg=tg:Filter(Card.IsAbleToHand,nil) local sg=tg:Filter(Card.IsAbleToHand,nil)
if sg:GetCount()>0 then if sg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=sg:RandomSelect(tp,1) local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst() local tc=tg:GetFirst()
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD-RESET_TOHAND,0,0) tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD-RESET_TOHAND,0,0)
Duel.SendtoHand(tc,tp,REASON_EFFECT) Duel.SendtoHand(tc,tp,REASON_EFFECT)
......
...@@ -87,7 +87,9 @@ function c53701010.efilter(e,re,rp) ...@@ -87,7 +87,9 @@ function c53701010.efilter(e,re,rp)
return not g:IsContains(e:GetHandler()) return not g:IsContains(e:GetHandler())
end end
function c53701010.costchk(e,te_or_c,tp) function c53701010.costchk(e,te_or_c,tp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>0 if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return false end
local tc=Duel.GetDecktopGroup(tp,1):GetFirst()
return tc:IsAbleToGrave() and tc:IsDestructable()
end end
function c53701010.costop(e,tp,eg,ep,ev,re,r,rp) function c53701010.costop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(tp,1) local g=Duel.GetDecktopGroup(tp,1)
......
...@@ -61,6 +61,9 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp) ...@@ -61,6 +61,9 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
e1:SetTarget(cm.tg) e1:SetTarget(cm.tg)
e1:SetValue(cm.val) e1:SetValue(cm.val)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
Duel.RegisterEffect(e2,tp)
end end
function cm.tg(e,c) function cm.tg(e,c)
local z=1<<c:GetSequence() local z=1<<c:GetSequence()
......
...@@ -38,6 +38,7 @@ function c72413150.initial_effect(c) ...@@ -38,6 +38,7 @@ function c72413150.initial_effect(c)
end end
-- --
function c72413150.regcon(e,tp,eg,ep,ev,re,r,rp) function c72413150.regcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandler():GetOwner()
return ep==tp and bit.band(r,REASON_BATTLE)~=0 return ep==tp and bit.band(r,REASON_BATTLE)~=0
end end
function c72413150.regop(e,tp,eg,ep,ev,re,r,rp) function c72413150.regop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -34,14 +34,15 @@ function c72413160.initial_effect(c) ...@@ -34,14 +34,15 @@ function c72413160.initial_effect(c)
end end
end end
-- --
function c72413160.defilter(c,tp) function c72413160.defilter(c,e)
local tp=e:GetHandler():GetOwner()
return c:IsReason(REASON_BATTLE) and c:IsLocation(LOCATION_GRAVE) and c:GetPreviousControler()==tp return c:IsReason(REASON_BATTLE) and c:IsLocation(LOCATION_GRAVE) and c:GetPreviousControler()==tp
end end
function c72413160.regcon(e,tp,eg,ep,ev,re,r,rp) function c72413160.regcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c72413160.defilter,1,nil,tp) return eg:IsExists(c72413160.defilter,1,nil,e)
end end
function c72413160.regop(e,tp,eg,ep,ev,re,r,rp) function c72413160.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
Duel.RegisterFlagEffect(c:GetControler(),72413161,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(c:GetControler(),72413161,RESET_PHASE+PHASE_END,0,1)
end end
-- --
......
...@@ -44,6 +44,7 @@ function c72413170.regop(e,tp,eg,ep,ev,re,r,rp) ...@@ -44,6 +44,7 @@ function c72413170.regop(e,tp,eg,ep,ev,re,r,rp)
end end
-- --
function c72413170.condition(e,tp,eg,ep,ev,re,r,rp) function c72413170.condition(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandler():GetOwner()
return tp~=Duel.GetTurnPlayer() return tp~=Duel.GetTurnPlayer()
end end
function c72413170.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c72413170.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
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