Commit 93601950 authored by salix5's avatar salix5

cards in the same column

parent b349a17d
...@@ -71,15 +71,13 @@ function c10045474.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -71,15 +71,13 @@ function c10045474.activate(e,tp,eg,ep,ev,re,r,rp)
end end
function c10045474.distg(e,c) function c10045474.distg(e,c)
local seq=e:GetLabel() local seq=e:GetLabel()
local p=c:GetControler()
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
return c:IsType(TYPE_SPELL+TYPE_TRAP) return c:IsType(TYPE_SPELL+TYPE_TRAP) and aux.GetColumn(c,tp)==seq
and ((p==tp and c:GetSequence()==seq) or (p==1-tp and c:GetSequence()==4-seq))
end end
function c10045474.disop(e,tp,eg,ep,ev,re,r,rp) function c10045474.disop(e,tp,eg,ep,ev,re,r,rp)
local tseq=e:GetLabel() local tseq=e:GetLabel()
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE) local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
if bit.band(loc,LOCATION_SZONE)~=0 and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) if loc&LOCATION_SZONE~=0 and seq<=4 and re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
and ((rp==tp and seq==tseq) or (rp==1-tp and seq==4-tseq)) then and ((rp==tp and seq==tseq) or (rp==1-tp and seq==4-tseq)) then
Duel.NegateEffect(ev) Duel.NegateEffect(ev)
end end
......
...@@ -63,7 +63,7 @@ function c62530723.cfilter(c,seq2) ...@@ -63,7 +63,7 @@ function c62530723.cfilter(c,seq2)
end end
function c62530723.discon(e,tp,eg,ep,ev,re,r,rp) function c62530723.discon(e,tp,eg,ep,ev,re,r,rp)
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE) local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
return rp==1-tp and re:IsActiveType(TYPE_SPELL) and loc&LOCATION_SZONE==LOCATION_SZONE return rp==1-tp and re:IsActiveType(TYPE_SPELL) and loc&LOCATION_SZONE==LOCATION_SZONE and seq<=4
and Duel.IsExistingMatchingCard(c62530723.cfilter,tp,LOCATION_MZONE,0,1,nil,seq) and Duel.IsExistingMatchingCard(c62530723.cfilter,tp,LOCATION_MZONE,0,1,nil,seq)
end end
function c62530723.disop(e,tp,eg,ep,ev,re,r,rp) function c62530723.disop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -13,14 +13,18 @@ end ...@@ -13,14 +13,18 @@ end
function c88086137.condition(e,tp,eg,ep,ev,re,r,rp) function c88086137.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local loc,seq,p=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE,CHAININFO_TRIGGERING_CONTROLER) local loc,seq,p=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE,CHAININFO_TRIGGERING_CONTROLER)
if loc&LOCATION_ONFIELD==0 then return false end local col=0
if loc==LOCATION_SZONE then if loc&LOCATION_MZONE~=0 then
col=aux.MZoneSequence(seq)
elseif loc&LOCATION_SZONE~=0 then
if seq>4 then return false end if seq>4 then return false end
seq=seq+8 col=aux.SZoneSequence(seq)
else
return false
end end
if p==1-tp then seq=seq+16 end if p==1-tp then col=4-col end
return bit.extract(c:GetColumnZone(LOCATION_ONFIELD),seq)~=0 return aux.GetColumn(c,tp)==col and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE))
and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev) and Duel.IsChainNegatable(ev)
end end
function c88086137.target(e,tp,eg,ep,ev,re,r,rp,chk) function c88086137.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
...@@ -6,16 +6,16 @@ MAX_COUNTER =65535 --max number for adding/removing counters, by card::add_coun ...@@ -6,16 +6,16 @@ MAX_COUNTER =65535 --max number for adding/removing counters, by card::add_coun
LOCATION_DECK =0x01 --卡组 LOCATION_DECK =0x01 --卡组
LOCATION_HAND =0x02 --手牌 LOCATION_HAND =0x02 --手牌
LOCATION_MZONE =0x04 --怪兽区 LOCATION_MZONE =0x04 --怪兽区
LOCATION_SZONE =0x08 --魔陷区 LOCATION_SZONE =0x08 --魔陷区(0~4)+场地区(5)
LOCATION_GRAVE =0x10 --墓地 LOCATION_GRAVE =0x10 --墓地
LOCATION_REMOVED =0x20 --除外区 LOCATION_REMOVED =0x20 --除外区
LOCATION_EXTRA =0x40 --额外 LOCATION_EXTRA =0x40 --额外
LOCATION_OVERLAY =0x80 --超量素材 LOCATION_OVERLAY =0x80 --超量素材
LOCATION_ONFIELD =0x0c --场上(怪兽+魔陷 LOCATION_ONFIELD =0x0c --场上(LOCATION_MZONE+LOCATION_SZONE
--Locations (for redirect) 若在重定向类效果中指定LOCATION_DECK则为弹回卡组顶部 --Locations (for redirect) 若在重定向类效果中指定LOCATION_DECK则为弹回卡组顶部
LOCATION_DECKBOT =0x10001 --弹回卡组底部 LOCATION_DECKBOT =0x10001 --弹回卡组底部
LOCATION_DECKSHF =0x20001 --弹回卡组并洗牌 LOCATION_DECKSHF =0x20001 --弹回卡组并洗牌
--Locations (for SetRange) --Locations of spell cards
LOCATION_FZONE =0x100 --场地区 LOCATION_FZONE =0x100 --场地区
LOCATION_PZONE =0x200 --灵摆区 LOCATION_PZONE =0x200 --灵摆区
--Positions 表示形式 --Positions 表示形式
......
...@@ -1886,6 +1886,7 @@ function Auxiliary.IsCounterAdded(c,counter) ...@@ -1886,6 +1886,7 @@ function Auxiliary.IsCounterAdded(c,counter)
end end
return false return false
end end
--return the column of card c (from the viewpoint of p)
function Auxiliary.GetColumn(c,p) function Auxiliary.GetColumn(c,p)
local seq=c:GetSequence() local seq=c:GetSequence()
if c:IsLocation(LOCATION_MZONE) then if c:IsLocation(LOCATION_MZONE) then
...@@ -1895,12 +1896,17 @@ function Auxiliary.GetColumn(c,p) ...@@ -1895,12 +1896,17 @@ function Auxiliary.GetColumn(c,p)
else return nil end else return nil end
if c:IsControler(p or 0) then return seq else return 4-seq end if c:IsControler(p or 0) then return seq else return 4-seq end
end end
--return the column of seq --return the column of monster zone seq (from the viewpoint of controller)
function Auxiliary.MZoneSequence(seq) function Auxiliary.MZoneSequence(seq)
if seq==5 then return 1 end if seq==5 then return 1 end
if seq==6 then return 3 end if seq==6 then return 3 end
return seq return seq
end end
--return the column of spell/trap zone seq (from the viewpoint of controller)
function Auxiliary.SZoneSequence(seq)
if seq>4 then return nil end
return seq
end
--card effect disable filter(target) --card effect disable filter(target)
function Auxiliary.disfilter1(c) function Auxiliary.disfilter1(c)
return c:IsFaceup() and not c:IsDisabled() and (not c:IsType(TYPE_NORMAL) or c:GetOriginalType()&TYPE_EFFECT~=0) return c:IsFaceup() and not c:IsDisabled() and (not c:IsType(TYPE_NORMAL) or c:GetOriginalType()&TYPE_EFFECT~=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