Commit 65961b87 authored by wind2009's avatar wind2009

Fix ズバババナイト

parent 83261c22
Pipeline #33195 passed with stages
in 1 minute and 32 seconds
No preview for this file type
...@@ -4,6 +4,7 @@ function s.initial_effect(c) ...@@ -4,6 +4,7 @@ function s.initial_effect(c)
--tohand --tohand
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DESTROY)
e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,id) e1:SetCountLimit(1,id)
...@@ -18,8 +19,8 @@ function s.initial_effect(c) ...@@ -18,8 +19,8 @@ function s.initial_effect(c)
e3:SetDescription(aux.Stringid(id,1)) e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_MOVE)
e3:SetCountLimit(1,id+o) e3:SetCountLimit(1,id+o)
e3:SetCondition(s.thcon2) e3:SetCondition(s.thcon2)
e3:SetTarget(s.thtg2) e3:SetTarget(s.thtg2)
...@@ -33,41 +34,33 @@ function s.thfilter(c) ...@@ -33,41 +34,33 @@ function s.thfilter(c)
return not c:IsCode(id) and c:IsSetCard(0x8f) and c:IsAbleToHand() return not c:IsCode(id) and c:IsSetCard(0x8f) and c:IsAbleToHand()
end end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local b1=Duel.IsExistingMatchingCard(s.desfilter,tp,0,LOCATION_MZONE,1,e:GetHandler()) local b1=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) local b2=Duel.IsExistingMatchingCard(s.desfilter,tp,0,LOCATION_MZONE,1,e:GetHandler())
if chk==0 then return b1 or b2 end if chk==0 then return b1 or b2 end
local op=0 local op=aux.SelectFromOptions(tp,
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3)) {b1,aux.Stringid(id,2),1},
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(id,2)) {b2,aux.Stringid(id,3),2})
else op=Duel.SelectOption(tp,aux.Stringid(id,3))+1 end
e:SetLabel(op) e:SetLabel(op)
if op==0 then if op==1 then
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
elseif op==2 then
e:SetCategory(CATEGORY_DESTROY) e:SetCategory(CATEGORY_DESTROY)
local g=Duel.GetMatchingGroup(s.desfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(s.desfilter,tp,0,LOCATION_MZONE,nil)
if chk==0 then return #g>0 end if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
else
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
end end
function s.thop(e,tp,eg,ep,ev,re,r,rp) function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if e:GetLabel()==0 then if e:GetLabel()==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,s.desfilter,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
local lv=g:GetFirst():GetLevel() local lv=g:GetFirst():GetLevel()
if c:IsRelateToEffect(e) and c:IsFaceup() then if c:IsRelateToEffect(e) and c:IsFaceup() and not c:IsLevel(lv) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL) e1:SetCode(EFFECT_CHANGE_LEVEL)
...@@ -76,6 +69,13 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -76,6 +69,13 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
end end
elseif e:GetLabel()==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,s.desfilter,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end end
end end
function s.thcon2(e,tp,eg,ep,ev,re,r,rp) function s.thcon2(e,tp,eg,ep,ev,re,r,rp)
......
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