Commit 0575c246 authored by wind2009's avatar wind2009

Fix RUM-マジカル・フォース

parent df3f2cb8
--RUM-マジカル・フォース --RUM-マジカル・フォース
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(TIMING_DESTROY) e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
...@@ -16,14 +17,14 @@ function s.filter1(c,e,tp) ...@@ -16,14 +17,14 @@ function s.filter1(c,e,tp)
return c:IsRank(4) and c:IsRace(RACE_SPELLCASTER) and c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsRank(4) and c:IsRace(RACE_SPELLCASTER) and c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
end end
function s.filter2(c,e,tp,mc,rk) function s.filter2(c,e,tp,mc)
if c:GetOriginalCode()==6165656 and not mc:IsCode(48995978) then return false end if c:GetOriginalCode()==6165656 and not mc:IsCode(48995978) then return false end
return c:IsRank(5) and c:IsRace(RACE_SPELLCASTER) and c:IsType(TYPE_XYZ) and mc:IsCanBeXyzMaterial(c) return c:IsRank(5) and c:IsRace(RACE_SPELLCASTER) 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 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.filter1(chkc,e,tp) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.filter1(chkc,e,tp) end
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2) if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_XMATERIAL) and aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingTarget(s.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end and Duel.IsExistingTarget(s.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
...@@ -36,7 +37,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -36,7 +37,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsImmuneToEffect(e) then return end if not tc:IsRelateToEffect(e) or tc:IsImmuneToEffect(e) then return end
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE) e1:SetCode(EFFECT_DISABLE)
...@@ -48,21 +49,21 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -48,21 +49,21 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
e2:SetValue(RESET_TURN_SET) e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD) e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
Duel.SpecialSummonComplete() if aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
if not aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) 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 g=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc)
local sc=g:GetFirst() local sc=g:GetFirst()
if sc then if sc then
Duel.BreakEffect()
sc:SetMaterial(Group.FromCards(tc)) sc:SetMaterial(Group.FromCards(tc))
Duel.Overlay(sc,Group.FromCards(tc)) Duel.Overlay(sc,Group.FromCards(tc))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummonStep(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure() sc:CompleteProcedure()
if c:IsRelateToEffect(e) then if c:IsRelateToEffect(e) and c:IsCanBeXyzMaterial(sc) and c:IsCanOverlay() then
c:CancelToGrave() c:CancelToGrave()
Duel.Overlay(sc,Group.FromCards(c)) Duel.Overlay(sc,Group.FromCards(c))
end end
end end
end end
Duel.SpecialSummonComplete()
end
end end
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