Commit 610b542a authored by DailyShana's avatar DailyShana Committed by GitHub

Zone moving cards update (#1303)

* Zone moving cards update

* fix & update
Co-authored-by: default avatarEdoardo Lolletti <edoardo762@gmail.com>
parent 72dee3ec
...@@ -28,8 +28,8 @@ end ...@@ -28,8 +28,8 @@ end
function c22198672.filter(c) function c22198672.filter(c)
if not c:IsType(TYPE_LINK) then return false end if not c:IsType(TYPE_LINK) then return false end
local p=c:GetControler() local p=c:GetControler()
local zone=bit.band(c:GetLinkedZone(),0x1f) local zone=c:GetLinkedZone()&0x1f
return Duel.GetLocationCount(p,LOCATION_MZONE,p,LOCATION_REASON_CONTROL,zone)>0 return Duel.GetLocationCount(p,LOCATION_MZONE,PLAYER_NONE,0,zone)>0
end end
function c22198672.seqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c22198672.seqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c22198672.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and c22198672.filter(chkc) end
...@@ -42,24 +42,13 @@ function c22198672.seqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -42,24 +42,13 @@ function c22198672.seqop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end if not tc:IsRelateToEffect(e) then return end
local p=tc:GetControler() local p=tc:GetControler()
local zone=bit.band(tc:GetLinkedZone(),0x1f) local zone=tc:GetLinkedZone()&0x1f
if Duel.GetLocationCount(p,LOCATION_MZONE,p,LOCATION_REASON_CONTROL,zone)>0 then if Duel.GetLocationCount(p,LOCATION_MZONE,PLAYER_NONE,0,zone)>0 then
local s=0 local i=0
if tc:IsControler(tp) then if p~=tp then i=16 end
local flag=bit.bxor(zone,0xff) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE) local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,LOCATION_MZONE,~(zone<<i))
s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,flag) local nseq=math.log(s,2)-i
else
local flag=bit.bxor(zone,0xff)*0x10000
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
s=Duel.SelectDisableField(tp,1,0,LOCATION_MZONE,flag)/0x10000
end
local nseq=0
if s==1 then nseq=0
elseif s==2 then nseq=1
elseif s==4 then nseq=2
elseif s==8 then nseq=3
else nseq=4 end
Duel.MoveSequence(tc,nseq) Duel.MoveSequence(tc,nseq)
end end
end end
......
...@@ -30,22 +30,14 @@ function c3784434.seqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -30,22 +30,14 @@ function c3784434.seqop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) or c:IsControler(1-tp) then return end if not c:IsRelateToEffect(e) or c:IsControler(1-tp) then return end
local seq=c:GetSequence() local seq=c:GetSequence()
if seq>4 then return end if seq>4 then return end
if (seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1)) local flag=0
or (seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1)) then if seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1) then flag=flag|(1<<(seq-1)) end
local flag=0 if seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1) then flag=flag|(1<<(seq+1)) end
if seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1) then flag=bit.replace(flag,0x1,seq-1) end if flag==0 then return end
if seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1) then flag=bit.replace(flag,0x1,seq+1) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
flag=bit.bxor(flag,0xff) local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,~flag)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE) local nseq=math.log(s,2)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,flag) Duel.MoveSequence(c,nseq)
local nseq=0
if s==1 then nseq=0
elseif s==2 then nseq=1
elseif s==4 then nseq=2
elseif s==8 then nseq=3
else nseq=4 end
Duel.MoveSequence(c,nseq)
end
end end
function c3784434.atkcon(e) function c3784434.atkcon(e)
local ph=Duel.GetCurrentPhase() local ph=Duel.GetCurrentPhase()
......
...@@ -38,22 +38,14 @@ function c39188539.seqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -38,22 +38,14 @@ function c39188539.seqop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) or c:IsControler(1-tp) then return end if not c:IsRelateToEffect(e) or c:IsControler(1-tp) then return end
local seq=c:GetSequence() local seq=c:GetSequence()
if seq>4 then return end if seq>4 then return end
if (seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1)) local flag=0
or (seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1)) then if seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1) then flag=flag|(1<<(seq-1)) end
local flag=0 if seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1) then flag=flag|(1<<(seq+1)) end
if seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1) then flag=bit.replace(flag,0x1,seq-1) end if flag==0 then return end
if seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1) then flag=bit.replace(flag,0x1,seq+1) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
flag=bit.bxor(flag,0xff) local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,~flag)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE) local nseq=math.log(s,2)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,flag) Duel.MoveSequence(c,nseq)
local nseq=0
if s==1 then nseq=0
elseif s==2 then nseq=1
elseif s==4 then nseq=2
elseif s==8 then nseq=3
else nseq=4 end
Duel.MoveSequence(c,nseq)
end
end end
function c39188539.filter(c,g) function c39188539.filter(c,g)
return g:IsContains(c) and c:IsAbleToHand() return g:IsContains(c) and c:IsAbleToHand()
......
...@@ -34,20 +34,12 @@ function c63394872.seqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -34,20 +34,12 @@ function c63394872.seqop(e,tp,eg,ep,ev,re,r,rp)
if not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) then return end if not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) then return end
local seq=tc:GetSequence() local seq=tc:GetSequence()
if seq>4 then return end if seq>4 then return end
if (seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1)) local flag=0
or (seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1)) then if seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1) then flag=flag|(1<<(seq-1)) end
local flag=0 if seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1) then flag=flag|(1<<(seq+1)) end
if seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1) then flag=bit.replace(flag,0x1,seq-1) end if flag==0 then return end
if seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1) then flag=bit.replace(flag,0x1,seq+1) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
flag=bit.bxor(flag,0xff) local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,~flag)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE) local nseq=math.log(s,2)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,flag) Duel.MoveSequence(tc,nseq)
local nseq=0
if s==1 then nseq=0
elseif s==2 then nseq=1
elseif s==4 then nseq=2
elseif s==8 then nseq=3
else nseq=4 end
Duel.MoveSequence(tc,nseq)
end
end end
...@@ -27,22 +27,14 @@ function c76573247.seqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -27,22 +27,14 @@ function c76573247.seqop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) or c:IsControler(1-tp) then return end if not c:IsRelateToEffect(e) or c:IsControler(1-tp) then return end
local seq=c:GetSequence() local seq=c:GetSequence()
if seq>4 then return end if seq>4 then return end
if (seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1)) local flag=0
or (seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1)) then if seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1) then flag=flag|(1<<(seq-1)) end
local flag=0 if seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1) then flag=flag|(1<<(seq+1)) end
if seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1) then flag=bit.replace(flag,0x1,seq-1) end if flag==0 then return end
if seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1) then flag=bit.replace(flag,0x1,seq+1) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
flag=bit.bxor(flag,0xff) local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,~flag)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE) local nseq=math.log(s,2)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,flag) Duel.MoveSequence(c,nseq)
local nseq=0
if s==1 then nseq=0
elseif s==2 then nseq=1
elseif s==4 then nseq=2
elseif s==8 then nseq=3
else nseq=4 end
Duel.MoveSequence(c,nseq)
end
end end
function c76573247.dircon(e) function c76573247.dircon(e)
return e:GetHandler():GetColumnGroup():FilterCount(Card.IsControler,nil,1-e:GetHandlerPlayer())==0 return e:GetHandler():GetColumnGroup():FilterCount(Card.IsControler,nil,1-e:GetHandlerPlayer())==0
......
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