Commit f0a4967f authored by Chen Bill's avatar Chen Bill

fix 次元障壁

parent 866312c4
--次元障壁 --次元障壁
local s,id,o=GetID()
function c83326048.initial_effect(c) function c83326048.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -15,45 +16,36 @@ function c83326048.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -15,45 +16,36 @@ function c83326048.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE)
local types={1057,1056,1063,1073,1074} local types={1057,1056,1063,1073,1074}
local alist=Duel.GetFlagEffectLabel(tp,83326048) local alist=Duel.GetFlagEffectLabel(tp,id)
if not alist then if not alist then
Duel.SetTargetParam(types[Duel.SelectOption(tp,table.unpack(types))+1]) Duel.SetTargetParam(types[Duel.SelectOption(tp,table.unpack(types))+1])
return
else else
local delp={} local options={}
local comp,p=16,5 for i = 1, 5, 1 do
while comp>0 do if bit.extract(alist,i)==0 then
if alist&comp~=0 then table.insert(options,types[i])
table.insert(delp,p)
end end
comp=comp>>1
p=p-1
end
for k,v in ipairs(delp) do
table.remove(types,v)
end end
Duel.SetTargetParam(options[Duel.SelectOption(tp,table.unpack(options))+1])
end end
Duel.SetTargetParam(types[Duel.SelectOption(tp,table.unpack(types))+1])
end end
function c83326048.operation(e,tp,eg,ep,ev,re,r,rp) function c83326048.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local opt=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM) local opt=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local ct,p=0,0 local ct,p=0,0
if opt==1057 then ct=TYPE_RITUAL p=0 end if opt==1057 then ct=TYPE_RITUAL p=1 end
if opt==1056 then ct=TYPE_FUSION p=1 end if opt==1056 then ct=TYPE_FUSION p=2 end
if opt==1063 then ct=TYPE_SYNCHRO p=2 end if opt==1063 then ct=TYPE_SYNCHRO p=3 end
if opt==1073 then ct=TYPE_XYZ p=3 end if opt==1073 then ct=TYPE_XYZ p=4 end
if opt==1074 then ct=TYPE_PENDULUM p=4 end if opt==1074 then ct=TYPE_PENDULUM p=5 end
p=1<<p local alist=Duel.GetFlagEffectLabel(tp,id)
local alist=Duel.GetFlagEffectLabel(tp,83326048) if not alist then
if alist then alist=1<<p
if alist&p~=0 then return end Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1,alist)
alist=alist+p
else else
alist=p alist=alist|(1<<p)
Duel.SetFlagEffectLabel(tp,id,alist)
end end
Duel.ResetFlagEffect(tp,83326048)
Duel.RegisterFlagEffect(tp,83326048,RESET_PHASE+PHASE_END,0,1,alist)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
......
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