Commit 1c579788 authored by DailyShana's avatar DailyShana

update get column zone

Fluorohydride/ygopro-core@6260033
parent a8dd6069
......@@ -26,8 +26,9 @@ function c16849715.initial_effect(c)
c:RegisterEffect(e3)
end
function c16849715.eftg(e,c)
local g=e:GetHandler():GetColumnGroup(1,1)
return c:IsType(TYPE_EFFECT) and c:IsSetCard(0x109) and c:GetSequence()<5 and g:IsContains(c)
local seq=c:GetSequence()
return c:IsType(TYPE_EFFECT) and c:IsSetCard(0x109)
and seq<5 and math.abs(e:GetHandler():GetSequence()-seq)<=1
end
function c16849715.retcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -35,7 +35,7 @@ function c19636995.hspzone(tp)
local zone=0
local lg=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tp))
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,tp))
end
return bit.bnot(zone)
end
......
......@@ -35,7 +35,7 @@ function c20537097.hspcon(e,c)
local zone=0
local lg=Duel.GetMatchingGroup(c20537097.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tp))
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,tp))
end
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
......@@ -44,7 +44,7 @@ function c20537097.hspval(e,c)
local zone=0
local lg=Duel.GetMatchingGroup(c20537097.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tp))
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,tp))
end
return 0,zone
end
......
......@@ -26,8 +26,9 @@ function c27561302.initial_effect(c)
c:RegisterEffect(e3)
end
function c27561302.eftg(e,c)
local g=e:GetHandler():GetColumnGroup(1,1)
return c:IsType(TYPE_EFFECT) and c:IsSetCard(0x109) and c:GetSequence()<5 and g:IsContains(c)
local seq=c:GetSequence()
return c:IsType(TYPE_EFFECT) and c:IsSetCard(0x109)
and seq<5 and math.abs(e:GetHandler():GetSequence()-seq)<=1
end
function c27561302.thfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
......
......@@ -33,7 +33,7 @@ function c28692962.hspcon(e,c)
local zone=0
local lg=Duel.GetMatchingGroup(c28692962.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tp))
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,tp))
end
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
......@@ -42,7 +42,7 @@ function c28692962.hspval(e,c)
local zone=0
local lg=Duel.GetMatchingGroup(c28692962.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tp))
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,tp))
end
return 0,zone
end
......
......@@ -31,7 +31,7 @@ function c29415459.hspcon(e,c)
local zone=0
local lg=Duel.GetMatchingGroup(c29415459.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tp))
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,tp))
end
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
......@@ -40,7 +40,7 @@ function c29415459.hspval(e,c)
local zone=0
local lg=Duel.GetMatchingGroup(c29415459.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tp))
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,tp))
end
return 0,zone
end
......
......@@ -75,9 +75,5 @@ function c46247282.desop(e,tp,eg,ep,ev,re,r,rp)
end
function c46247282.disop(e,tp)
local c=e:GetHandler()
local flag1=bit.band(c:GetColumnZone(LOCATION_MZONE),0xffffff00)
local flag2=bit.band(bit.lshift(c:GetColumnZone(LOCATION_SZONE),8),0xffff00ff)
local flag3=bit.band(c:GetColumnZone(LOCATION_MZONE),0xff00ffff)
local flag4=bit.band(bit.lshift(c:GetColumnZone(LOCATION_SZONE),8),0xffff)
return flag1+flag2+flag3+flag4
return c:GetColumnZone(LOCATION_ONFIELD)
end
......@@ -26,8 +26,9 @@ function c52834429.initial_effect(c)
c:RegisterEffect(e3)
end
function c52834429.eftg(e,c)
local g=e:GetHandler():GetColumnGroup(1,1)
return c:IsType(TYPE_EFFECT) and c:IsSetCard(0x109) and c:GetSequence()<5 and g:IsContains(c)
local seq=c:GetSequence()
return c:IsType(TYPE_EFFECT) and c:IsSetCard(0x109)
and seq<5 and math.abs(e:GetHandler():GetSequence()-seq)<=1
end
function c52834429.rmcon(e,tp,eg,ep,ev,re,r,rp)
return eg:GetCount()==1
......
......@@ -26,8 +26,9 @@ function c53956001.initial_effect(c)
c:RegisterEffect(e3)
end
function c53956001.eftg(e,c)
local g=e:GetHandler():GetColumnGroup(1,1)
return c:IsType(TYPE_EFFECT) and c:IsSetCard(0x109) and c:GetSequence()<5 and g:IsContains(c)
local seq=c:GetSequence()
return c:IsType(TYPE_EFFECT) and c:IsSetCard(0x109)
and seq<5 and math.abs(e:GetHandler():GetSequence()-seq)<=1
end
function c53956001.datg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
......
......@@ -31,7 +31,7 @@ function c56809158.hspcon(e,c)
local zone=0
local lg=Duel.GetMatchingGroup(c56809158.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tp))
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,tp))
end
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
......@@ -40,7 +40,7 @@ function c56809158.hspval(e,c)
local zone=0
local lg=Duel.GetMatchingGroup(c56809158.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tp))
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,tp))
end
return 0,zone
end
......
......@@ -32,7 +32,7 @@ function c66022706.hspcon(e,c)
local zone=0
local lg=Duel.GetMatchingGroup(c66022706.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tp))
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,tp))
end
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
......@@ -41,7 +41,7 @@ function c66022706.hspval(e,c)
local zone=0
local lg=Duel.GetMatchingGroup(c66022706.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tp))
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,tp))
end
return 0,zone
end
......
......@@ -25,8 +25,9 @@ function c80577258.initial_effect(c)
c:RegisterEffect(e3)
end
function c80577258.eftg(e,c)
local g=e:GetHandler():GetColumnGroup(1,1)
return c:IsType(TYPE_EFFECT) and c:IsSetCard(0x109) and c:GetSequence()<5 and g:IsContains(c)
local seq=c:GetSequence()
return c:IsType(TYPE_EFFECT) and c:IsSetCard(0x109)
and seq<5 and math.abs(e:GetHandler():GetSequence()-seq)<=1
end
function c80577258.thfilter(c)
return c:IsSetCard(0x109) and c:IsAbleToHand()
......
......@@ -26,8 +26,9 @@ function c89355716.initial_effect(c)
c:RegisterEffect(e3)
end
function c89355716.eftg(e,c)
local g=e:GetHandler():GetColumnGroup(1,1)
return c:IsType(TYPE_EFFECT) and c:IsSetCard(0x109) and c:GetSequence()<5 and g:IsContains(c)
local seq=c:GetSequence()
return c:IsType(TYPE_EFFECT) and c:IsSetCard(0x109)
and seq<5 and math.abs(e:GetHandler():GetSequence()-seq)<=1
end
function c89355716.spcfilter(c,e,tp,ft)
return c:IsReleasableByEffect() and (ft>0 or c:GetSequence()<5)
......
......@@ -31,7 +31,7 @@ function c92204263.hspcon(e,c)
local zone=0
local lg=Duel.GetMatchingGroup(c92204263.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tp))
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,tp))
end
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
......@@ -40,7 +40,7 @@ function c92204263.hspval(e,c)
local zone=0
local lg=Duel.GetMatchingGroup(c92204263.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tp))
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,tp))
end
return 0,zone
end
......
......@@ -32,7 +32,7 @@ function c93020401.hspcon(e,c)
local zone=0
local lg=Duel.GetMatchingGroup(c93020401.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tp))
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,tp))
end
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
......@@ -41,16 +41,15 @@ function c93020401.hspval(e,c)
local zone=0
local lg=Duel.GetMatchingGroup(c93020401.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tp))
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,tp))
end
return 0,zone
end
function c93020401.spcfilter(c,tp,mc)
if c:GetPreviousControler()==tp then return false end
local loc=LOCATION_MZONE
if c:IsPreviousLocation(LOCATION_SZONE) then loc=LOCATION_SZONE end
local zone=mc:GetColumnZone(loc)
local zone=mc:GetColumnZone(LOCATION_ONFIELD)
local seq=c:GetPreviousSequence()+16
if c:IsPreviousLocation(LOCATION_SZONE) then seq=seq+8 end
return zone and bit.extract(zone,seq)~=0
end
function c93020401.spcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -43,7 +43,7 @@ function c97729135.mvtg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local zone=0
local lg=eg:Filter(c97729135.cfilter,nil,tp)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,1-tp))
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,1-tp))
end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c97729135.mvfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c97729135.mvfilter,tp,0,LOCATION_MZONE,1,nil)
......@@ -55,7 +55,7 @@ function c97729135.mvop1(e,tp,eg,ep,ev,re,r,rp)
local zone=0
local lg=eg:Filter(c97729135.cfilter,nil,tp)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,1-tp))
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,1-tp))
end
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsControler(tp)
......@@ -73,7 +73,7 @@ function c97729135.mvtg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local zone=0
local lg=eg:Filter(c97729135.cfilter,nil,1-tp)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tp))
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,tp))
end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c97729135.mvfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c97729135.mvfilter,tp,LOCATION_MZONE,0,1,nil)
......@@ -85,7 +85,7 @@ function c97729135.mvop2(e,tp,eg,ep,ev,re,r,rp)
local zone=0
local lg=eg:Filter(c97729135.cfilter,nil,1-tp)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tp))
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,tp))
end
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsControler(1-tp)
......
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