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)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DESTROY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,id)
......@@ -18,8 +19,8 @@ function s.initial_effect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_MOVE)
e3:SetCountLimit(1,id+o)
e3:SetCondition(s.thcon2)
e3:SetTarget(s.thtg2)
......@@ -33,41 +34,33 @@ function s.thfilter(c)
return not c:IsCode(id) and c:IsSetCard(0x8f) and c:IsAbleToHand()
end
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 b2=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil)
local b1=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
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(id,2))
else op=Duel.SelectOption(tp,aux.Stringid(id,3))+1 end
local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(id,2),1},
{b2,aux.Stringid(id,3),2})
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)
local g=Duel.GetMatchingGroup(s.desfilter,tp,0,LOCATION_MZONE,nil)
if chk==0 then return #g>0 end
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
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetLabel()==0 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
if e:GetLabel()==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
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)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
......@@ -76,6 +69,13 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
c:RegisterEffect(e1)
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
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