Commit fd1127c6 authored by wind2009's avatar wind2009

Fix 繋がり-Ai-

parent 46bd3895
Pipeline #31140 passed with stages
in 1 minute
...@@ -17,21 +17,21 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -17,21 +17,21 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1) e:SetLabel(1)
if chk==0 then return true end if chk==0 then return true end
end end
function s.thfilter(c,res,att) function s.thdfilter(c)
if res then return c:IsAbleToHand() and not c:IsAttribute(ATTRIBUTE_DARK)
if c:IsLevelAbove(5) or not c:IsRace(RACE_CYBERSE) then return false end and c:IsLevelBelow(4) and c:IsRace(RACE_CYBERS)
else end
if not c:IsSetCard(0x135) then return false end function s.thndfilter(c,att)
end return c:IsAbleToHand() and not c:IsAttribute(att) and c:IsSetCard(0x135)
return not c:IsAttribute(att) and c:IsAbleToHand()
end end
---@param c Card
function s.cfilter(c,e,tp) function s.cfilter(c,e,tp)
return c:IsRace(RACE_CYBERSE) and not c:IsPublic() return c:IsRace(RACE_CYBERSE) and not c:IsPublic()
and (c:IsAttribute(ATTRIBUTE_DARK) and (c:IsAttribute(ATTRIBUTE_DARK)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,true,ATTRIBUTE_DARK) and Duel.IsExistingMatchingCard(s.thdfilter,tp,LOCATION_DECK,0,1,nil)
or not c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToDeck() or not c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToDeck()
and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,false,c:GetAttribute())) and Duel.IsExistingMatchingCard(s.thndfilter,tp,LOCATION_DECK,0,1,nil,c:GetAttribute()))
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
...@@ -44,34 +44,43 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -44,34 +44,43 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
local gc=g:GetFirst()
if gc:IsAttribute(ATTRIBUTE_DARK) then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,gc,1,0,0)
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_SEARCH+CATEGORY_TOHAND)
else
Duel.SetOperationInfo(0,CATEGORY_TODECK,gc,1,0,0)
e:SetCategory(CATEGORY_TODECK+CATEGORY_SEARCH+CATEGORY_TOHAND)
end
Duel.SetTargetCard(g) Duel.SetTargetCard(g)
end end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(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 not tc:IsRelateToEffect(e) then return false end if tc:IsRelateToEffect(e) then
if tc:IsAttribute(ATTRIBUTE_DARK) then if tc:IsAttribute(ATTRIBUTE_DARK) then
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0
and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,true,ATTRIBUTE_DARK) then and Duel.IsExistingMatchingCard(s.thdfilter,tp,LOCATION_DECK,0,1,nil) then
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,true,ATTRIBUTE_DARK) local g=Duel.SelectMatchingCard(tp,s.thdfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.BreakEffect()
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
else else
if Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_DECK) local att=tc:GetAttribute()
and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,false,c:GetAttribute()) then if Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_DECK)
and Duel.IsExistingMatchingCard(s.thndfilter,tp,LOCATION_DECK,0,1,nil,att) then
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,false,c:GetAttribute()) local g=Duel.SelectMatchingCard(tp,s.thndfilter,tp,LOCATION_DECK,0,1,1,nil,att)
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)
end end
end end
end end
end
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
......
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