Commit 26147527 authored by GuGu's avatar GuGu

Update c25351.lua 换位区域检测

parent 2c3f74ad
Pipeline #21791 passed with stage
in 52 seconds
......@@ -28,21 +28,25 @@ end
function c25351.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c25351.filter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c25351.swapfilter(c)
local tp=c:GetControler()
return c:IsAbleToChangeControler() and Duel.GetMZoneCount(tp,c,tp,LOCATION_REASON_CONTROL)>0
end
function c25351.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToChangeControler,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsAbleToChangeControler,tp,0,LOCATION_MZONE,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c25351.swapfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c25351.swapfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_CONTROL,nil,0,0,0)
end
function c25351.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not Duel.IsExistingMatchingCard(Card.IsAbleToChangeControler,tp,LOCATION_MZONE,0,1,nil)
or not Duel.IsExistingMatchingCard(Card.IsAbleToChangeControler,tp,0,LOCATION_MZONE,1,nil)
if not Duel.IsExistingMatchingCard(c25351.swapfilter,tp,LOCATION_MZONE,0,1,nil)
or not Duel.IsExistingMatchingCard(c25351.swapfilter,tp,0,LOCATION_MZONE,1,nil)
then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g1=Duel.SelectMatchingCard(tp,Card.IsAbleToChangeControler,tp,LOCATION_MZONE,0,1,1,nil)
local g1=Duel.SelectMatchingCard(tp,c25351.swapfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.HintSelection(g1)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_CONTROL)
local g2=Duel.SelectMatchingCard(1-tp,Card.IsAbleToChangeControler,1-tp,LOCATION_MZONE,0,1,1,nil)
local g2=Duel.SelectMatchingCard(1-tp,c25351.swapfilter,1-tp,LOCATION_MZONE,0,1,1,nil)
Duel.HintSelection(g2)
local c1=g1:GetFirst()
local c2=g2:GetFirst()
......
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