Commit a0808c62 authored by salix5's avatar salix5

fix

parent 63646993
...@@ -15,7 +15,6 @@ function c24919805.initial_effect(c) ...@@ -15,7 +15,6 @@ function c24919805.initial_effect(c)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_GRAVE) e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c24919805.regcon)
e2:SetOperation(c24919805.regop) e2:SetOperation(c24919805.regop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
...@@ -39,9 +38,6 @@ function c24919805.damop(e,tp,eg,ep,ev,re,r,rp) ...@@ -39,9 +38,6 @@ function c24919805.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT) Duel.Damage(p,d,REASON_EFFECT)
end end
function c24919805.regcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_RETURN)
end
function c24919805.regop(e,tp,eg,ep,ev,re,r,rp) function c24919805.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
......
...@@ -6,6 +6,7 @@ function c6733059.initial_effect(c) ...@@ -6,6 +6,7 @@ function c6733059.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1c0) e1:SetHintTiming(0,0x1c0)
e1:SetCost(c6733059.cost1) e1:SetCost(c6733059.cost1)
e1:SetOperation(c6733059.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--instant(chain) --instant(chain)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -27,48 +28,66 @@ function c6733059.tfilter(c,lv) ...@@ -27,48 +28,66 @@ function c6733059.tfilter(c,lv)
end end
function c6733059.cost1(e,tp,eg,ep,ev,re,r,rp,chk) function c6733059.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
if c6733059.cost2(e,tp,eg,ep,ev,re,r,rp,0) and Duel.SelectYesNo(tp,aux.Stringid(6733059,0)) then e:SetLabel(0)
e:SetCategory(CATEGORY_DESTROY) local cg=Duel.GetMatchingGroup(c6733059.cfilter,tp,LOCATION_GRAVE,0,nil)
e:SetOperation(c6733059.operation) local tg=Duel.GetMatchingGroup(c6733059.tfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,cg:GetCount())
c6733059.cost2(e,tp,eg,ep,ev,re,r,rp,1) if tg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(6733059,0)) then
else local lvt={}
e:SetCategory(0) local tc=tg:GetFirst()
e:SetOperation(nil) while tc do
e:SetLabel(0) local tlv=tc:GetLevel()
lvt[tlv]=tlv
tc=tg:GetNext()
end
local pc=1
for i=1,12 do
if lvt[i] then lvt[i]=nil lvt[pc]=i pc=pc+1 end
end
lvt[pc]=nil
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(6733059,2))
local lv=Duel.AnnounceNumber(tp,table.unpack(lvt))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=cg:Select(tp,lv,lv,nil)
Duel.Remove(rg,POS_FACEUP,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,1,0,0)
Duel.SetTargetParam(lv)
end end
end end
function c6733059.cost2(e,tp,eg,ep,ev,re,r,rp,chk) function c6733059.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local cg=Duel.GetMatchingGroup(c6733059.cfilter,tp,LOCATION_GRAVE,0,nil) local cg=Duel.GetMatchingGroup(c6733059.cfilter,tp,LOCATION_GRAVE,0,nil)
local tg=Duel.GetMatchingGroup(c6733059.tfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,cg:GetCount()) local tg=Duel.GetMatchingGroup(c6733059.tfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,cg:GetCount())
return tg:GetCount()>0 and Duel.GetFlagEffect(tp,6733059)==0 return tg:GetCount()>0
end end
e:SetLabel(0)
local cg=Duel.GetMatchingGroup(c6733059.cfilter,tp,LOCATION_GRAVE,0,nil) local cg=Duel.GetMatchingGroup(c6733059.cfilter,tp,LOCATION_GRAVE,0,nil)
local tg=Duel.GetMatchingGroup(c6733059.tfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,cg:GetCount()) local tg=Duel.GetMatchingGroup(c6733059.tfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,cg:GetCount())
local lvt={} local lvt={}
local tc=tg:GetFirst() local tc=tg:GetFirst()
local i=1
while tc do while tc do
local tlv=tc:GetLevel() local tlv=tc:GetLevel()
lvt[i]=tlv lvt[tlv]=tlv
tc=tg:GetNext() tc=tg:GetNext()
i=i+1
end end
local pc=1
for i=1,12 do
if lvt[i] then lvt[i]=nil lvt[pc]=i pc=pc+1 end
end
lvt[pc]=nil
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(6733059,2)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(6733059,2))
local lv=Duel.AnnounceNumber(tp,table.unpack(lvt)) local lv=Duel.AnnounceNumber(tp,table.unpack(lvt))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=cg:Select(tp,lv,lv,nil) local rg=cg:Select(tp,lv,lv,nil)
Duel.Remove(rg,POS_FACEUP,REASON_COST) Duel.Remove(rg,POS_FACEUP,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,1,0,0)
e:SetLabel(lv) Duel.SetTargetParam(lv)
Duel.RegisterFlagEffect(tp,6733059,RESET_CHAIN,0,1)
end end
function c6733059.dfilter(c,lv) function c6733059.dfilter(c,lv)
return c:IsFaceup() and c:GetLevel()==lv and c:IsDestructable() return c:IsFaceup() and c:GetLevel()==lv and c:IsDestructable()
end end
function c6733059.operation(e,tp,eg,ep,ev,re,r,rp) function c6733059.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
local lv=e:GetLabel() local lv=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
if lv==0 then return end if lv==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c6733059.dfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,lv) local g=Duel.SelectMatchingCard(tp,c6733059.dfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,lv)
......
...@@ -33,7 +33,6 @@ function c79606837.initial_effect(c) ...@@ -33,7 +33,6 @@ function c79606837.initial_effect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE) e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCondition(c79606837.thcon)
e3:SetTarget(c79606837.thtg) e3:SetTarget(c79606837.thtg)
e3:SetOperation(c79606837.thop) e3:SetOperation(c79606837.thop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
...@@ -63,9 +62,6 @@ function c79606837.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -63,9 +62,6 @@ function c79606837.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(eg,REASON_EFFECT) Duel.Destroy(eg,REASON_EFFECT)
end end
end end
function c79606837.thcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_RETURN)
end
function c79606837.filter(c) function c79606837.filter(c)
return c:IsType(TYPE_RITUAL) and c:IsAbleToHand() return c:IsType(TYPE_RITUAL) and c:IsAbleToHand()
end end
......
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