Commit cdc5d2df authored by POLYMER's avatar POLYMER

fix

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