Commit 0d33443b authored by fallenstardust's avatar fallenstardust

fix 聖霊獣騎 レイラウタリ :https://github.com/Fluorohydride/ygopro-pre-script/pull/1232

parent f7487c7c
...@@ -32,54 +32,47 @@ function s.initial_effect(c) ...@@ -32,54 +32,47 @@ function s.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function s.bfilter(c) function s.bfilter(c)
return c:IsSetCard(0xb5) and c:IsFaceup() and c:IsAbleToHand() or c:IsAbleToExtra() return c:IsSetCard(0xb5) and c:IsFaceup() and c:IsAbleToHand()
end end
function s.sfilter(c) function s.sfilter(c)
return c:IsFaceup() and c:IsSetCard(0xb5) and c:IsSummonable(true,nil) return c:IsSetCard(0xb5) and c:IsSummonable(true,nil)
end end
function s.bstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.bstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and s.bfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and s.bfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.bfilter,tp,LOCATION_REMOVED,0,1,nil) end if chk==0 then return Duel.IsExistingTarget(s.bfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT)
local tc=Duel.SelectTarget(tp,s.bfilter,tp,LOCATION_REMOVED,0,1,1,nil):GetFirst() local tc=Duel.SelectTarget(tp,s.bfilter,tp,LOCATION_REMOVED,0,1,1,nil):GetFirst()
if tc:IsAbleToHand() then if tc:IsAbleToExtra() then
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,LOCATION_REMOVED) Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,g,1,tp,LOCATION_REMOVED)
else else
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,tp,LOCATION_REMOVED) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,LOCATION_REMOVED)
end end
end end
function s.bsop(e,tp,eg,ep,ev,re,r,rp) function s.bsop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetTargetsRelateToChain():GetFirst() local tc=Duel.GetTargetsRelateToChain():GetFirst()
if tc then if tc then
local b1,b2=0,0 if Duel.SendtoHand(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0
if tc:IsAbleToHand() then and Duel.IsExistingMatchingCard(s.sfilter,tp,LOCATION_HAND,0,1,nil)
b1=Duel.SendtoHand(tc,nil,REASON_EFFECT) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
else
b2=Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
if b1+b2>0 and Duel.IsExistingMatchingCard(s.sfilter,tp,LOCATION_HAND,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,s.sfilter,tp,LOCATION_HAND,0,1,1,nil) local sumc=Duel.SelectMatchingCard(tp,s.sfilter,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
local sumc=g:GetFirst() if sumc then Duel.Summon(tp,sumc,true,nil) end
if sumc then
Duel.Summon(tp,sumc,true,nil)
end
end end
end end
end end
function s.rmcon(e,tp,eg,ep,ev,re,r,rp) function s.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp return Duel.GetTurnPlayer()==1-tp
end end
function s.rmmfilter(c,e,tp) function s.rmfilter(c,e,tp)
return c:IsSetCard(0xb5) and c:IsAbleToRemove() return c:IsFaceup() and c:IsSetCard(0xb5) and c:IsAbleToRemove()
end end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(s.rmmfilter,tp,LOCATION_ONFIELD,0,1,nil) if chk==0 then return Duel.IsExistingTarget(s.rmfilter,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) end and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectTarget(tp,s.rmmfilter,tp,LOCATION_ONFIELD,0,1,1,nil) local g1=Duel.SelectTarget(tp,s.rmfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,1,nil) local g2=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,1,nil)
g1:Merge(g2) g1:Merge(g2)
......
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