Commit e88383de authored by nanahira's avatar nanahira Committed by mercury233

update Creature Swap (#906)

parent dd6783d6
...@@ -9,21 +9,24 @@ function c31036355.initial_effect(c) ...@@ -9,21 +9,24 @@ function c31036355.initial_effect(c)
e1:SetOperation(c31036355.activate) e1:SetOperation(c31036355.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c31036355.filter(c)
return c:IsAbleToChangeControler() and (c:GetSequence()<5 or Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0)
end
function c31036355.target(e,tp,eg,ep,ev,re,r,rp,chk) function c31036355.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) if chk==0 then return Duel.IsExistingMatchingCard(c31036355.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsAbleToChangeControler,tp,0,LOCATION_MZONE,1,nil) end and Duel.IsExistingMatchingCard(c31036355.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_CONTROL,nil,0,0,0) Duel.SetOperationInfo(0,CATEGORY_CONTROL,nil,0,0,0)
end end
function c31036355.activate(e,tp,eg,ep,ev,re,r,rp) function c31036355.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not Duel.IsExistingMatchingCard(Card.IsAbleToChangeControler,tp,LOCATION_MZONE,0,1,nil) if not Duel.IsExistingMatchingCard(c31036355.filter,tp,LOCATION_MZONE,0,1,nil)
or not Duel.IsExistingMatchingCard(Card.IsAbleToChangeControler,tp,0,LOCATION_MZONE,1,nil) or not Duel.IsExistingMatchingCard(c31036355.filter,tp,0,LOCATION_MZONE,1,nil)
then return end then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) 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,c31036355.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.HintSelection(g1) Duel.HintSelection(g1)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_CONTROL) 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,c31036355.filter,1-tp,LOCATION_MZONE,0,1,1,nil)
Duel.HintSelection(g2) Duel.HintSelection(g2)
local c1=g1:GetFirst() local c1=g1:GetFirst()
local c2=g2: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