Commit a080e9fd authored by POLYMER's avatar POLYMER

fix

parent fc304784
...@@ -12,6 +12,7 @@ function cm.initial_effect(c) ...@@ -12,6 +12,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--remove --remove
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(m,2))
e0:SetType(EFFECT_TYPE_IGNITION+EFFECT_TYPE_CONTINUOUS) e0:SetType(EFFECT_TYPE_IGNITION+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_FREE_CHAIN) e0:SetCode(EVENT_FREE_CHAIN)
e0:SetCountLimit(1,m) e0:SetCountLimit(1,m)
...@@ -91,7 +92,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -91,7 +92,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
local g=Duel.GetDecktopGroup(tp,1) local g=Duel.GetDecktopGroup(tp,1)
if not g or #g==0 then return end if not g or #g==0 then return end
g:GetFirst():SetStatus(STATUS_TO_HAND_WITHOUT_CONFIRM) g:GetFirst():SetStatus(STATUS_TO_HAND_WITHOUT_CONFIRM,true)
g:AddCard(c) g:AddCard(c)
if Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then if Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
......
...@@ -9,20 +9,45 @@ function s.initial_effect(c) ...@@ -9,20 +9,45 @@ function s.initial_effect(c)
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)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetDescription(aux.Stringid(id,2))
e2:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCost(s.cost)
--c:RegisterEffect(e2)
end
function s.cfilter(c)
return c:IsSetCard(0x838) and c:IsDiscardable()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,s.cfilter,1,1,REASON_DISCARD+REASON_COST,nil)
end end
function s.filter(c) function s.filter(c)
return c:IsSetCard(0x838) and c:IsType(TYPE_MONSTER) return c:IsSetCard(0x838) and c:IsType(TYPE_MONSTER)
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)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return true end if chk==0 then return true end
local afilter={
TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK,OPCODE_ISTYPE,OPCODE_NOT,
0x838,OPCODE_ISSETCARD,OPCODE_AND,
TYPE_MONSTER,OPCODE_ISTYPE,OPCODE_AND
}
getmetatable(e:GetHandler()).announce_filter=afilter
local codes={} local codes={}
while #codes<5 do while #codes<5 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
local ac=0 local ac=Duel.AnnounceCard(tp,table.unpack(afilter))
getmetatable(c).announce_filter={0x838,OPCODE_ISSETCARD,TYPE_MONSTER,OPCODE_ISTYPE,OPCODE_AND,code,OPCODE_ISCODE,OPCODE_NOT,OPCODE_AND,TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK,OPCODE_ISTYPE,OPCODE_NOT}
local ac=Duel.AnnounceCard(tp,table.unpack(getmetatable(c).announce_filter))
table.insert(codes,ac) table.insert(codes,ac)
for i=1,#codes do
table.insert(afilter,codes[i])
table.insert(afilter,OPCODE_ISCODE)
table.insert(afilter,OPCODE_NOT)
table.insert(afilter,OPCODE_AND)
end
if not Duel.SelectYesNo(tp,aux.Stringid(id,1)) then if not Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
break break
end end
...@@ -32,21 +57,26 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -32,21 +57,26 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
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 labs={e:GetLabel()} local labs={e:GetLabel()}
local count=#labs local count=#labs
if count and count>0 then if count and count>0 then
local c=e:GetHandler()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY) e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetLabel(count,table.unpack(labs)) e1:SetLabel(count,table.unpack(labs))
e1:SetLabelObject(c)
e1:SetOperation(s.spop) e1:SetOperation(s.spop)
e1:SetReset(RESET_PHASE+PHASE_STANDBY,count) e1:SetReset(RESET_PHASE+PHASE_STANDBY,count)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
end end
function s.spfilter(c,e,tp,code)
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject()
local labs={e:GetLabel()} local labs={e:GetLabel()}
local ct=labs[1] local ct=labs[1]
local codes={} local codes={}
...@@ -55,14 +85,16 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -55,14 +85,16 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
end end
ct=ct-1 ct=ct-1
e:SetLabel(ct,table.unpack(labs)) e:SetLabel(ct,table.unpack(labs))
e:GetHandler():SetTurnCounter(ct) c:SetTurnCounter(ct)
if ct==0 then if ct==0 then
Duel.Hint(HINT_CARD,0,id) Duel.Hint(HINT_CARD,0,id)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft>0 then if ft>0 then
for _,code in ipairs(codes) do for _,code in ipairs(codes) do
if ft<=0 then break end if ft<=0 then break end
local tc=Duel.GetFirstMatchingCard(function(c) return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end, tp, LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp,code)
local tc=g:GetFirst()
if g:GetCount()>1 then tc=g:Select(tp,1,1,nil):GetFirst() end
if tc then if tc then
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
ft=ft-1 ft=ft-1
...@@ -70,15 +102,11 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -70,15 +102,11 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
end end
Duel.SpecialSummonComplete() Duel.SpecialSummonComplete()
end end
local mg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local eg=Duel.GetMatchingGroup(Card.IsLinkSummonable,tp, LOCATION_EXTRA,0,nil,nil,mg) local g=Duel.SelectMatchingCard(tp,Card.IsLinkSummonable,tp,LOCATION_EXTRA,0,1,1,nil,nil)
if #eg>0 then local tc=g:GetFirst()
Duel.BreakEffect() if tc then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.LinkSummon(tp,tc,nil)
local sg=eg:Select(tp,1,1,nil)
if #sg>0 then
Duel.LinkSummon(tp,sg:GetFirst(),nil,mg)
end
end end
e:Reset() e:Reset()
end end
......
--幻叙幻现幻想传说 --幻叙幻现幻想传说
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
aux.AddCodeList(c,65133126)
--Ritual Summon --Ritual Summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
......
--幻叙新生 --幻叙新生
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
aux.AddCodeList(c,65133214,65133216)
--Activate --Activate
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE) e0:SetType(EFFECT_TYPE_ACTIVATE)
......
...@@ -606,6 +606,80 @@ function Auxiliary.PreloadUds() ...@@ -606,6 +606,80 @@ function Auxiliary.PreloadUds()
sg:RemoveCard(c) sg:RemoveCard(c)
return res return res
end end
Auxiliary.ExtraPendulumChecklist=0
local pendcon=Auxiliary.PendCondition
function Auxiliary.PendCondition(e,c,og)
if c==nil then return true end
local tp=c:GetControler()
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)}
if Auxiliary.PendulumChecklist&(0x1<<tp)~=0 and (#eset==0 or Auxiliary.ExtraPendulumChecklist&(0x1<<tp)~=0) then return false end
return pendcon(e,c,og)
end
function Auxiliary.PendOperation(e,tp,eg,ep,ev,re,r,rp,c,sg,og)
local rpz=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
local lscale=c:GetLeftScale()
local rscale=rpz:GetRightScale()
if lscale>rscale then lscale,rscale=rscale,lscale end
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)}
local tg=nil
local loc=0
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ft2=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)
local ft=Duel.GetUsableMZoneCount(tp)
local ect=c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp]
if ect and ect<ft2 then ft2=ect end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then
if ft1>0 then ft1=1 end
if ft2>0 then ft2=1 end
ft=1
end
if ft1>0 then loc=loc|LOCATION_HAND end
if ft2>0 then loc=loc|LOCATION_EXTRA end
if og then
tg=og:Filter(Card.IsLocation,nil,loc):Filter(Auxiliary.PConditionFilter,nil,e,tp,lscale,rscale,eset)
else
tg=Duel.GetMatchingGroup(Auxiliary.PConditionFilter,tp,loc,0,nil,e,tp,lscale,rscale,eset)
end
local ce=nil
local b1=Auxiliary.PendulumChecklist&(0x1<<tp)==0
local b2=#eset>0 and Auxiliary.ExtraPendulumChecklist&(0x1<<tp)==0
if b1 and b2 then
local options={1163}
for _,te in ipairs(eset) do
table.insert(options,te:GetDescription())
end
local op=Duel.SelectOption(tp,table.unpack(options))
if op>0 then
ce=eset[op]
end
elseif b2 and not b1 then
local options={}
for _,te in ipairs(eset) do
table.insert(options,te:GetDescription())
end
local op=Duel.SelectOption(tp,table.unpack(options))
ce=eset[op+1]
end
if ce then
tg=tg:Filter(Auxiliary.PConditionExtraFilterSpecific,nil,e,tp,lscale,rscale,ce)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
Auxiliary.GCheckAdditional=Auxiliary.PendOperationCheck(ft1,ft2,ft)
local g=tg:SelectSubGroup(tp,Auxiliary.TRUE,true,1,math.min(#tg,ft))
Auxiliary.GCheckAdditional=nil
if not g then return end
if ce then
Duel.Hint(HINT_CARD,0,ce:GetOwner():GetOriginalCode())
ce:UseCountLimit(tp)
Auxiliary.ExtraPendulumChecklist=Auxiliary.ExtraPendulumChecklist|(0x1<<tp)
else
Auxiliary.PendulumChecklist=Auxiliary.PendulumChecklist|(0x1<<tp)
end
sg:Merge(g)
Duel.HintSelection(Group.FromCards(c))
Duel.HintSelection(Group.FromCards(rpz))
end
--require("script/procedure.lua") --require("script/procedure.lua")
end end
\ No newline at end of file
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