Commit 8f069866 authored by POLYMER's avatar POLYMER

fix

parent 43ad0e31
--汐击龙的汐叹 --汐击龙的汐叹
local cm,m=GetID() local cm,m=GetID()
function cm.initial_effect(c) function cm.initial_effect(c)
--check
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_REMOVE)
e0:SetCondition(aux.ThisCardInGraveAlreadyCheckReg)
c:RegisterEffect(e0)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE) e1:SetCategory(CATEGORY_REMOVE)
...@@ -37,6 +43,7 @@ function cm.initial_effect(c) ...@@ -37,6 +43,7 @@ function cm.initial_effect(c)
e5:SetCode(EVENT_SPSUMMON_SUCCESS) e5:SetCode(EVENT_SPSUMMON_SUCCESS)
e5:SetProperty(EFFECT_FLAG_DELAY) e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetRange(LOCATION_REMOVED) e5:SetRange(LOCATION_REMOVED)
e5:SetLabelObject(e0)
e5:SetCondition(cm.spcon) e5:SetCondition(cm.spcon)
e5:SetTarget(cm.sptg) e5:SetTarget(cm.sptg)
e5:SetOperation(cm.spop) e5:SetOperation(cm.spop)
...@@ -125,11 +132,13 @@ end ...@@ -125,11 +132,13 @@ end
function cm.spfilter(c) function cm.spfilter(c)
return c:IsFaceup() and c:IsSetCard(0x9977) return c:IsFaceup() and c:IsSetCard(0x9977)
end end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp) function cm.spfilter(c,se)
return eg:IsExists(cm.spfilter,1,nil) if not (se==nil or c:GetReasonEffect()~=se) then return false end
return c:IsFaceup() and c:IsSetCard(0x9977)
end end
function cm.refilter(c) function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return c:IsAbleToRemove() and c:IsSetCard(0x9977) local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(cm.spfilter,1,nil,se)
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -156,12 +156,13 @@ end ...@@ -156,12 +156,13 @@ end
function cm.disop(e,tp,eg,ep,ev,re,r,rp) function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
if not tc:IsOnField() then if not tc:IsOnField() then
if 1==1 then return tc:IsImmuneToEffect(e) end --if 1==1 then return tc:IsImmuneToEffect(e) end
local seq=tc:GetSequence()
local tg=Duel.GetMatchingGroup(nil,tc:GetControler(),tc:GetLocation(),0,nil) local tg=Duel.GetMatchingGroup(nil,tc:GetControler(),tc:GetLocation(),0,nil)
local b1=tc:GetSequence()~=0 local b1=seq~=0
local b2=tc:GetSequence()~=#tg-1 local b2=seq~=#tg-1
local op=0 local op=0
if b1 and b2 then if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(m,3),aux.Stringid(m,4)) op=Duel.SelectOption(tp,aux.Stringid(m,3),aux.Stringid(m,4))
...@@ -172,24 +173,43 @@ function cm.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -172,24 +173,43 @@ function cm.disop(e,tp,eg,ep,ev,re,r,rp)
else else
return return
end end
if op==0 then Duel.MoveSequence(tc,tc:GetSequence()+1) end if op==0 then
if op==1 then Duel.MoveSequence(tc,tc:GetSequence()-1) end local sg=tg:Filter(function(c) return c:GetSequence()>seq+1 end,nil)
Duel.MoveSequence(tc,0)
e:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_IGNORE_IMMUNE)
while #sg>0 do
local sc=sg:GetMinGroup(Card.GetSequence):GetFirst()
Duel.MoveSequence(sc,0)
sg:RemoveCard(sc)
end
end
if op==1 then
local sg=tg:Filter(function(c) return c:GetSequence()>seq-2 end,tc)
e:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_IGNORE_IMMUNE)
while #sg>0 do
local sc=sg:GetMinGroup(Card.GetSequence):GetFirst()
Duel.MoveSequence(sc,0)
sg:RemoveCard(sc)
end
end
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
else
local seq=tc:GetSequence()
local p=tc:GetControler()
local b1=0
if p~=tp then b1=1 end
local loc=tc:GetLocation()
local b2=0
if loc==LOCATION_SZONE then b2=1 end
if seq>4 then return end
local flag=0
if seq>0 and Duel.CheckLocation(p,loc,seq-1) then flag=flag|(1<<(seq-1+16*b1+8*b2)) end
if seq<4 and Duel.CheckLocation(p,loc,seq+1) then flag=flag|(1<<(seq+1+16*b1+8*b2)) end
if flag==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,LOCATION_ONFIELD,LOCATION_ONFIELD,~flag)
local nseq=math.log(s,2)-16*b1-8*b2
Duel.MoveSequence(tc,nseq)
end end
local seq=tc:GetSequence()
local p=tc:GetControler()
local b1=0
if p~=tp then b1=1 end
local loc=tc:GetLocation()
local b2=0
if loc==LOCATION_SZONE then b2=1 end
if seq>4 then return end
local flag=0
if seq>0 and Duel.CheckLocation(p,loc,seq-1) then flag=flag|(1<<(seq-1+16*b1+8*b2)) end
if seq<4 and Duel.CheckLocation(p,loc,seq+1) then flag=flag|(1<<(seq+1+16*b1+8*b2)) end
if flag==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,LOCATION_ONFIELD,LOCATION_ONFIELD,~flag)
local nseq=math.log(s,2)-16*b1-8*b2
Duel.MoveSequence(tc,nseq)
end end
end end
\ No newline at end of file
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