Commit 167309ac authored by Chrono-Genex's avatar Chrono-Genex Committed by GitHub

fix Extra Gate (#1622)

parent b7e0addc
...@@ -9,7 +9,7 @@ function c7405310.initial_effect(c) ...@@ -9,7 +9,7 @@ function c7405310.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c7405310.target(e,tp,eg,ep,ev,re,r,rp,chk) function c7405310.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)~=0 if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_HAND,0,1,e:GetHandler())
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_EXTRA,1,nil) end and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_EXTRA,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINGMSG_LVRANK) Duel.Hint(HINT_SELECTMSG,tp,HINGMSG_LVRANK)
local lv=Duel.AnnounceLevel(tp) local lv=Duel.AnnounceLevel(tp)
...@@ -19,15 +19,13 @@ function c7405310.filter(c,lv) ...@@ -19,15 +19,13 @@ function c7405310.filter(c,lv)
return c:IsLevel(lv) return c:IsLevel(lv)
end end
function c7405310.operation(e,tp,eg,ep,ev,re,r,rp) function c7405310.operation(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanRemove(tp) then return end
local g=Duel.GetMatchingGroup(c7405310.filter,1-tp,LOCATION_EXTRA,0,nil,e:GetLabel()) local g=Duel.GetMatchingGroup(c7405310.filter,1-tp,LOCATION_EXTRA,0,nil,e:GetLabel())
if g:GetCount()~=0 then if g:GetCount()~=0 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_REMOVE)
local rg=g:FilterSelect(1-tp,Card.IsAbleToRemove,1,1,nil) local rg=g:FilterSelect(1-tp,Card.IsAbleToRemove,1,1,nil)
if rg:GetCount()~=0 then if rg:GetCount()~=0 then
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT) Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
else
local cg=Duel.GetFieldGroup(1-tp,LOCATION_EXTRA,0)
Duel.ConfirmCards(tp,cg)
end end
else else
Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD) Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)
......
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