Commit 5f4bb1b5 authored by wind2009's avatar wind2009

Fix 原質の炉心貫通

parent 4b358ce1
......@@ -36,8 +36,10 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>5 end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>5 then
Duel.SortDecktop(tp,tp,6)
Duel.ConfirmDecktop(tp,6)
local g=Duel.GetDecktopGroup(tp,6)
if g:GetCount()>0 then
Duel.SortDecktop(tp,tp,g:GetCount())
end
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -45,12 +47,13 @@ function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.PayLPCost(tp,1500)
end
function s.filter1(c,e,tp)
return c:IsFaceup() and c:IsLevel(3) and c:IsType(TYPE_NORMAL)
return c:IsFaceup() and c:IsLevel(3) and c:IsAllTypes(TYPE_NORMAL+TYPE_MONSTER)
and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
end
function s.filter2(c,e,tp,mc)
return c:IsSetCard(0x160) and c:IsType(TYPE_XYZ) and mc:IsCanBeXyzMaterial(c) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
return c:IsSetCard(0x160) and c:IsType(TYPE_XYZ) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
......@@ -60,19 +63,22 @@ end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local tc=Duel.SelectMatchingCard(tp,s.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc)
local sc=g:GetFirst()
if sc then
local mg=tc:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(sc,mg)
local mg=Duel.SelectMatchingCard(tp,s.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
if #mg>0 then
local mc=mg:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,mc)
local sc=g:GetFirst()
if sc then
local og=mc:GetOverlayGroup()
if og:GetCount()~=0 then
Duel.Overlay(sc,og)
end
sc:SetMaterial(Group.FromCards(mc))
Duel.Overlay(sc,Group.FromCards(mc))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
end
sc:SetMaterial(Group.FromCards(tc))
Duel.Overlay(sc,Group.FromCards(tc))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
......@@ -101,7 +107,6 @@ function s.ovtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function s.ovop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetDecktopGroup(tp,1)
if g:GetCount()==1 then
local tc=g:GetFirst()
......@@ -109,6 +114,7 @@ function s.ovop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(s.matfilter,tp,LOCATION_MZONE,0,1,nil) and tc:IsCanOverlay() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local sg=Duel.SelectMatchingCard(tp,s.matfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.HintSelection(sg)
Duel.Overlay(sg:GetFirst(),Group.FromCards(tc))
else
Duel.SendtoGrave(g,REASON_RULE)
......
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