Commit cdc5d2df authored by POLYMER's avatar POLYMER

fix

parent c383015c
--终烬圣界
-- 终烬圣界
local s,id=GetID()
function s.initial_effect(c)
......@@ -8,14 +8,15 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetHintTiming(0,TIMING_SUMMON+TIMING_SPSUMMON+TIMING_END_PHASE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
......@@ -24,21 +25,20 @@ function s.initial_effect(c)
c:RegisterEffect(e2)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function s.lvfilter(c)
return c:IsFaceup() and c:IsSetCard(0x5f51) and c:IsLevelAbove(1)
end
function s.desfilter(c)
return c:IsSetCard(0x5f51) and c:IsDestructable()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.lvfilter(chkc) end
local ph=Duel.GetCurrentPhase()
local is_main = (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
if chk==0 then
return is_main
and Duel.IsExistingTarget(s.lvfilter,tp,LOCATION_MZONE,0,1,nil)
return Duel.IsExistingTarget(s.lvfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,e:GetHandler())
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
......@@ -46,12 +46,10 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,#g,tp,LOCATION_HAND+LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e):Filter(Card.IsFaceup,nil)
if #tg==0 then return end
for tc in aux.Next(tg) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -59,44 +57,44 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(12)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
Duel.AdjustInstantly()
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,s.desfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,#tg,#tg,c)
local dg=Duel.SelectMatchingCard(tp,s.desfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,#tg,c)
if #dg>0 then
local conf=dg:Filter(Card.IsFacedown,nil)
if #conf>0 then Duel.ConfirmCards(1-tp,conf) end
if #conf>0 then Duel.ConfirmCards(1-tp,conf) end
local count = Duel.Destroy(dg,REASON_EFFECT)
if count == #tg then
local mg=Duel.GetMatchingGroup(function(mc)
return mc:IsFaceup() and mc:IsLevel(12) and mc:IsSetCard(0x5f51)
end,tp,LOCATION_MZONE,0,nil)
if count > 0 then
local sc=Duel.GetMatchingGroup(function(xyzc)
return xyzc:IsSetCard(0x5f51) and xyzc:IsType(TYPE_XYZ)
and xyzc:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end,tp,LOCATION_EXTRA,0,nil)
if #sc>0 and #mg>=2 and Duel.SelectEffectYesNo(tp,e:GetHandler(),aux.Stringid(id,2)) then
if #sc>0 and Duel.SelectEffectYesNo(tp,c,aux.Stringid(id,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local xyz=sc:Select(tp,1,1,nil):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local mat=mg:Select(tp,2,64,nil)
xyz:SetMaterial(mat)
Duel.Overlay(xyz,mat)
if Duel.SpecialSummon(xyz,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)~=0 then
xyz:CompleteProcedure()
local mg=Duel.GetMatchingGroup(function(mc)
return mc:IsFaceup() and mc:IsType(TYPE_MONSTER) and mc:IsCanBeXyzMaterial(xyz)
end,tp,LOCATION_MZONE,0,nil)
if #mg>=2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local mat=mg:FilterSelect(tp,function(mc) return mc:IsLevel(12) end,2,64,nil)
if #mat>=2 then
xyz:SetMaterial(mat)
Duel.Overlay(xyz,mat)
if Duel.SpecialSummon(xyz,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)~=0 then
xyz:CompleteProcedure()
end
end
end
end
end
end
end
function s.immop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetTargetRange(LOCATION_MZONE,0)
......@@ -106,5 +104,7 @@ function s.immop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
function s.efilter(e,te)
return te:GetOwner():IsSetCard(0x5f51) and te:GetOwner():IsControler(1-e:GetHandlerPlayer())
local owner=te:GetOwner()
return owner:IsSetCard(0x5f51) and owner:IsType(TYPE_MONSTER)
and owner:IsControler(1-e:GetHandlerPlayer()) and owner:IsLocation(LOCATION_MZONE)
end
\ No newline at end of file
......@@ -35,7 +35,7 @@ function c28318606.initial_effect(c)
end
end
function c28318606.checkop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(Duel.GetTurnPlayer(),28318606,RESET_PHASE+PHASE_END,0,1)
Duel.RegisterFlagEffect(Duel.GetTurnPlayer(),28318606,0,0,1)
end
function c28318606.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,28318606)==0
......
......@@ -38,7 +38,7 @@ function c28333723.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.DiscardDeck(tp,ct,REASON_COST)
end
function c28333723.chkfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(tp)-- and c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousLevelOnField()==3
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE)-- and c:IsPreviousControler(tp) and c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousLevelOnField()==3
end
function c28333723.efcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c28333723.chkfilter,1,nil,tp)
......
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