Commit 5910339b authored by Vury Leo's avatar Vury Leo

fix 救世竜 セイヴァー・ドラゴン

parent 6f34e2a9
--アクセルシンクロ・スターダスト・ドラゴン
function c30983281.initial_effect(c)
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,44508094)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
......@@ -7,66 +8,66 @@ function c30983281.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(30983281,0))
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,30983281)
e1:SetCondition(c30983281.spcon)
e1:SetTarget(c30983281.sptg)
e1:SetOperation(c30983281.spop)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--synchro effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(30983281,1))
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,30983282)
e2:SetCondition(c30983281.sccon)
e2:SetCost(c30983281.sccost)
e2:SetTarget(c30983281.sctg)
e2:SetOperation(c30983281.scop)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.sccon)
e2:SetCost(s.sccost)
e2:SetTarget(s.sctg)
e2:SetOperation(s.scop)
c:RegisterEffect(e2)
end
function c30983281.spcon(e,tp,eg,ep,ev,re,r,rp)
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c30983281.spfilter(c,e,tp)
function s.spfilter(c,e,tp)
return c:IsLevelBelow(2) and c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c30983281.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c30983281.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c30983281.spop(e,tp,eg,ep,ev,re,r,rp)
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c30983281.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
function c30983281.sccon(e,tp,eg,ep,ev,re,r,rp)
function s.sccon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function c30983281.excostfilter(c,tp)
function s.excostfilter(c,tp)
return c:IsAbleToRemoveAsCost() and c:IsHasEffect(84012625,tp)
end
function c30983281.synfilter(c,tp,g)
function s.synfilter(c,tp,g)
return c:IsSynchroSummonable(nil,g,#g-1,#g-1) and aux.SynMixHandCheck(g,tp,c)
end
function c30983281.syncheck(g,tp,exc)
return Duel.IsExistingMatchingCard(c30983281.synfilter,tp,LOCATION_EXTRA,0,1,exc,tp,g)
function s.syncheck(g,tp,exc)
return Duel.IsExistingMatchingCard(s.synfilter,tp,LOCATION_EXTRA,0,1,exc,tp,g)
end
function c30983281.spcheck(c,tp,rc,mg,opchk)
function s.spcheck(c,tp,rc,mg,opchk)
return Duel.GetLocationCountFromEx(tp,tp,rc,c)>0
and (opchk or mg:CheckSubGroup(c30983281.syncheck,2,#mg,tp,c))
and (opchk or mg:CheckSubGroup(s.syncheck,2,#mg,tp,c))
end
function c30983281.scfilter(c,e,tp,rc,chkrel,chknotrel,tgchk,opchk)
function s.scfilter(c,e,tp,rc,chkrel,chknotrel,tgchk,opchk)
if not (c:IsCode(44508094) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false)) then return false end
local mg=Duel.GetSynchroMaterial(tp)
if mg:IsExists(Card.GetHandSynchro,1,nil) then
......@@ -75,21 +76,21 @@ function c30983281.scfilter(c,e,tp,rc,chkrel,chknotrel,tgchk,opchk)
end
mg:AddCard(c)
if tgchk then
return c30983281.spcheck(c,tp,nil,mg,opchk)
return s.spcheck(c,tp,nil,mg,opchk)
else
return (chkrel and c30983281.spcheck(c,tp,rc,mg-rc)) or (chknotrel and c30983281.spcheck(c,tp,nil,mg))
return (chkrel and s.spcheck(c,tp,rc,mg-rc)) or (chknotrel and s.spcheck(c,tp,nil,mg))
end
end
function c30983281.sccost(e,tp,eg,ep,ev,re,r,rp,chk)
function s.sccost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ect1=c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp]
local ect2=aux.ExtraDeckSummonCountLimit and Duel.IsPlayerAffectedByEffect(tp,92345028)
and aux.ExtraDeckSummonCountLimit[tp]
local g=Duel.GetMatchingGroup(c30983281.excostfilter,tp,LOCATION_GRAVE,0,nil,tp)
local g=Duel.GetMatchingGroup(s.excostfilter,tp,LOCATION_GRAVE,0,nil,tp)
local chkrel=c:IsReleasable()
local chknotrel=g:GetCount()>0
local b1=chkrel and Duel.IsExistingMatchingCard(c30983281.scfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,chkrel,nil)
local b2=chknotrel and Duel.IsExistingMatchingCard(c30983281.scfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,nil,chknotrel)
local b1=chkrel and Duel.IsExistingMatchingCard(s.scfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,chkrel,nil)
local b2=chknotrel and Duel.IsExistingMatchingCard(s.scfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,nil,chknotrel)
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2)
and (not ect1 or ect1>1) and (not ect2 or ect2>1) and (b1 or b2)
and aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL) end
......@@ -110,7 +111,7 @@ function c30983281.sccost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(rc,REASON_COST)
end
end
function c30983281.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
function s.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:IsCostChecked() then return true end
local c=e:GetHandler()
......@@ -120,26 +121,26 @@ function c30983281.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
return Duel.IsPlayerCanSpecialSummonCount(tp,2)
and (not ect1 or ect1>1) and (not ect2 or ect2>1)
and aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL)
and Duel.IsExistingMatchingCard(c30983281.scfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,nil,nil,true)
and Duel.IsExistingMatchingCard(s.scfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,nil,nil,true)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c30983281.scop(e,tp,eg,ep,ev,re,r,rp)
function s.scop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c30983281.scfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c,nil,nil,true,true)
local g=Duel.SelectMatchingCard(tp,s.scfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c,nil,nil,true,true)
local tc=g:GetFirst()
local res=false
if tc then
tc:SetMaterial(nil)
if Duel.SpecialSummonStep(tc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(30983281,2))
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c30983281.immval)
e1:SetValue(s.immval)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetOwnerPlayer(tp)
tc:RegisterEffect(e1,true)
......@@ -152,21 +153,40 @@ function c30983281.scop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,nil)
if res and tg:GetCount()>0 then
Duel.BreakEffect()
local opt=Duel.SelectOption(tp,1164,1379)
if opt==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=tg:Select(tp,1,1,nil)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(30983281,2))
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c30983281.immval)
e1:SetValue(s.immval)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD+RESET_PHASE+PHASE_END)
e1:SetOwnerPlayer(tp)
sg:GetFirst():RegisterEffect(e1,true)
Duel.SynchroSummon(tp,sg:GetFirst(),nil)
else
local synchro_effect=AccelSynchro.CreateSummonEffect(c,{
stage_x_operation=function(e,tc)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(s.immval)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD+RESET_PHASE+PHASE_END)
e1:SetOwnerPlayer(tp)
tc:GetFirst():RegisterEffect(e1,true)
end
})
synchro_effect:GetOperation()(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function c30983281.immval(e,te)
function s.immval(e,te)
return te:GetOwnerPlayer()~=e:GetOwnerPlayer() and te:IsActivated()
end
......@@ -3394,8 +3394,10 @@ function Synchro.GetSynchroMaterial(tp,tc,level_mapper)
local effs={mc:IsHasEffect(EFFECT_EXTRA_SYNCHRO_MATERIAL)}
for _,eff in ipairs(effs) do
local v=eff:GetValue()
if type(v)=='function' and v(eff,tc) then
if type(v)=='function' then
if v(eff,tc) then
return true
end
elseif v then
return true
end
......@@ -3410,8 +3412,10 @@ function Synchro.GetSynchroMaterial(tp,tc,level_mapper)
local effs={mc:IsHasEffect(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)}
for _,eff in ipairs(effs) do
local v=eff:GetValue()
if type(v)=='function' and v(eff,tc)==true then
if type(v)=='function' then
if v(eff,tc)==true then
return false
end
elseif v then
return false
end
......@@ -3445,6 +3449,7 @@ function Synchro.AddSynchroProcedure(c,params)
local level_mapper=params.level_mapper or Synchro.DefaultLevelMapper
local scheck=params.scheck or aux.TRUE
local hand_count_mapper=params.hand_count_mapper or Synchro.DefaultHandCountMapper
local sgoalcheck=params.sgoalcheck or aux.TRUE
local drop_default_tuner_filter=params.drop_default_tuner_filter or false
local drop_default_non_tuner_filter=params.drop_default_non_tuner_filter or false
......@@ -3464,8 +3469,8 @@ function Synchro.AddSynchroProcedure(c,params)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(Synchro.SynCondition(tuner_race,tuner_filter,non_tuner_race,non_tuner_filter,tuner_min,tuner_max,non_tuner_min,non_tuner_max,level_mapper,hand_count_mapper,scheck))
e1:SetTarget(Synchro.SynTarget(tuner_race,tuner_filter,non_tuner_race,non_tuner_filter,tuner_min,tuner_max,non_tuner_min,non_tuner_max,level_mapper,hand_count_mapper,scheck))
e1:SetCondition(Synchro.SynCondition(tuner_race,tuner_filter,non_tuner_race,non_tuner_filter,tuner_min,tuner_max,non_tuner_min,non_tuner_max,level_mapper,hand_count_mapper,scheck,sgoalcheck))
e1:SetTarget(Synchro.SynTarget(tuner_race,tuner_filter,non_tuner_race,non_tuner_filter,tuner_min,tuner_max,non_tuner_min,non_tuner_max,level_mapper,hand_count_mapper,scheck,sgoalcheck))
e1:SetOperation(Synchro.SynOperation())
e1:SetValue(SUMMON_TYPE_SYNCHRO)
c:RegisterEffect(e1)
......@@ -3478,8 +3483,8 @@ function Synchro.AddSynchroProcedure(c,params)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(Synchro.SynCondition(tuner_race,tuner_filter,non_tuner_race,non_tuner_filter,tuner_min,tuner_max,non_tuner_min,non_tuner_max,level_mapper,hand_count_mapper,scheck))
e2:SetTarget(Synchro.SynTarget(tuner_race,tuner_filter,non_tuner_race,non_tuner_filter,tuner_min,tuner_max,non_tuner_min,non_tuner_max,level_mapper,hand_count_mapper,scheck))
e2:SetCondition(Synchro.SynCondition(tuner_race,tuner_filter,non_tuner_race,non_tuner_filter,tuner_min,tuner_max,non_tuner_min,non_tuner_max,level_mapper,hand_count_mapper,scheck,sgoalcheck))
e2:SetTarget(Synchro.SynTarget(tuner_race,tuner_filter,non_tuner_race,non_tuner_filter,tuner_min,tuner_max,non_tuner_min,non_tuner_max,level_mapper,hand_count_mapper,scheck,sgoalcheck))
e2:SetOperation(Synchro.SynOperation())
e2:SetValue(SUMMON_TYPE_SYNCHRO)
c:RegisterEffect(e2)
......@@ -3492,7 +3497,8 @@ function Synchro.FindValidSelection(candidates,target_level,
non_tuner_race,non_tuner_filter,tc,
tuner_min,tuner_max,
non_tuner_min,non_tuner_max,
level_mapper,hand_count_mapper,scheck,
level_mapper,hand_count_mapper,
scheck,sgoalcheck,
pre_select,state)
Synchro.SortMaterials(candidates,tc,tuner_filter)
......@@ -3528,7 +3534,8 @@ function Synchro.FindValidSelection(candidates,target_level,
non_tuner_race,non_tuner_filter,tc,
tuner_min,tuner_max,
non_tuner_min,non_tuner_max,
level_mapper,hand_count_mapper,scheck,
level_mapper,hand_count_mapper,
scheck,sgoalcheck,
pre_select or {},
1,
state,
......@@ -3557,6 +3564,7 @@ end
--- @param non_tuner_max integer|table -- Maximum number of non-Tuners.
--- @param level_mapper fun(mc:Card,tc:Card):integer[] -- Returns possible levels for mc.
--- @param scheck fun(selected:Card[]):boolean -- Optional card-group check (e.g. Judgment’s same-Attribute).
--- @param sgoalcheck fun(selected:Card[]):boolean -- Optional final card-group check (e.g. Majestic Star Dragon).
--- @param selected Card[] -- Materials chosen so far.
--- @param index integer -- Next candidate index (1-based).
--- @param state table -- DFS state:
......@@ -3576,7 +3584,7 @@ end
--- race_prune_index integer
--- @return boolean True if a valid selection exists, false otherwise.
function Synchro.CanCompleteSelection(candidates,target_level,tuner_race,tuner_filter,non_tuner_race,non_tuner_filter,tc,
tuner_min,tuner_max,non_tuner_min,non_tuner_max,level_mapper,hand_count_mapper,scheck,selected,index,state,prune_indexes)
tuner_min,tuner_max,non_tuner_min,non_tuner_max,level_mapper,hand_count_mapper,scheck,sgoalcheck,selected,index,state,prune_indexes)
if state.tuner_count>tuner_max then return false end
if state.non_tuner_count>non_tuner_max then return false end
......@@ -3626,6 +3634,9 @@ function Synchro.CanCompleteSelection(candidates,target_level,tuner_race,tuner_f
if index>#candidates then
-- check if target_level achievable exactly
if not sgoalcheck(Group.FromCards(table.unpack(selected))) then
return false
end
if state.possible_sums[target_level] and
state.tuner_count>=tuner_min and
state.non_tuner_count>=non_tuner_min then
......@@ -3658,7 +3669,7 @@ function Synchro.CanCompleteSelection(candidates,target_level,tuner_race,tuner_f
tuner_race,tuner_filter,
non_tuner_race,non_tuner_filter,tc,
tuner_min,tuner_max,non_tuner_min,non_tuner_max,
level_mapper,hand_count_mapper,scheck,
level_mapper,hand_count_mapper,scheck,sgoalcheck,
selected,index+1,branch_state,prune_indexes
) then
table.remove(selected)
......@@ -3670,15 +3681,30 @@ function Synchro.CanCompleteSelection(candidates,target_level,tuner_race,tuner_f
-- exclude branch
if Synchro.CanCompleteSelection(candidates,target_level,tuner_race,tuner_filter,non_tuner_race,non_tuner_filter,tc,
tuner_min,tuner_max,non_tuner_min,non_tuner_max,level_mapper,hand_count_mapper,scheck,selected,index+1,state,prune_indexes) then
tuner_min,tuner_max,non_tuner_min,non_tuner_max,level_mapper,hand_count_mapper,scheck,sgoalcheck,selected,index+1,state,prune_indexes) then
return true
end
return false
end
--- Synchro condition generator using tuner/non-tuner min/max counts and filters
function Synchro.SynCondition(tuner_race,tuner_filter,non_tuner_race,non_tuner_filter,tuner_min,tuner_max,non_tuner_min,non_tuner_max,level_mapper,hand_count_mapper,scheck)
--- Dynamically generates a Synchro Summon condition by combining tuner/non-tuner
--- minimum and maximum counts, filters, and mapper functions.
---
--- @param tuner_race number The race ID that qualifies as a tuner. `nil` means no race restriction.
--- @param tuner_filter fun(mc:Card,tc:Card):boolean A predicate function to further filter tuner candidates.
--- Receives a card object and returns true if it’s valid.
--- @param non_tuner_race number The race ID that qualifies as a non-tuner. `nil` means no race restriction.
--- @param non_tuner_filter fun(mc:Card,tc:Card):boolean A predicate function to further filter non-tuner candidates.
--- @param tuner_min number The minimum number of tuners required as materials.
--- @param tuner_max number The maximum number of tuners allowed as materials.
--- @param non_tuner_min number The minimum number of non-tuners required as materials.
--- @param non_tuner_max number The maximum number of non-tuners allowed as materials.
--- @param level_mapper fun(mc,tc):integer[] returns a list of possible “level values” for that card.
--- @param hand_count_mapper fun(mc,tc):integer
--- @param scheck fun(mg:Group):boolean Called during selection to prune branches when it’s impossible to meet the conditions.
--- @param sgoalcheck fun(mg:Group):boolean Called after full selection to verify the final Synchro Summon condition.
function Synchro.SynCondition(tuner_race,tuner_filter,non_tuner_race,non_tuner_filter,tuner_min,tuner_max,non_tuner_min,non_tuner_max,level_mapper,hand_count_mapper,scheck,sgoalcheck)
--- @param mg Group
return function(e,c,smat,mg,min,max,accel_synchro_opts)
if c==nil then return true end
......@@ -3732,14 +3758,14 @@ function Synchro.SynCondition(tuner_race,tuner_filter,non_tuner_race,non_tuner_f
local pre_selected_states=Synchro.BuildStatesFromSelection(pre_selected_arr,tuner_race,tuner_filter,non_tuner_race,non_tuner_filter,level_mapper,hand_count_mapper,c,math.huge,skip_hand_count_check)
for _,state in ipairs(pre_selected_states) do
if Synchro.FindValidSelection(candidates,target_level,tuner_race,tuner_filter,non_tuner_race,non_tuner_filter,c,tuner_min,tuner_max,non_tuner_min,non_tuner_max,level_mapper,hand_count_mapper,scheck,pre_selected_arr,state) then
if Synchro.FindValidSelection(candidates,target_level,tuner_race,tuner_filter,non_tuner_race,non_tuner_filter,c,tuner_min,tuner_max,non_tuner_min,non_tuner_max,level_mapper,hand_count_mapper,scheck,sgoalcheck,pre_selected_arr,state) then
return true
end
end
end
end
function Synchro.SynTarget(tuner_race,tuner_filter,non_tuner_race,non_tuner_filter,tuner_min,tuner_max,non_tuner_min,non_tuner_max,level_mapper,hand_count_mapper,scheck)
function Synchro.SynTarget(tuner_race,tuner_filter,non_tuner_race,non_tuner_filter,tuner_min,tuner_max,non_tuner_min,non_tuner_max,level_mapper,hand_count_mapper,scheck,sgoalcheck)
return function(e,tp,eg,ep,ev,re,r,rp,chk,tc,smat,mg,min,max,accel_synchro_opts)
--- accel synchro has already selected their materials, skip material selection step
if mg~=nil and #mg==min then
......@@ -3846,7 +3872,7 @@ function Synchro.SynTarget(tuner_race,tuner_filter,non_tuner_race,non_tuner_filt
tuner_race,tuner_filter,
non_tuner_race,non_tuner_filter,tc,
tuner_min,tuner_max,non_tuner_min,non_tuner_max,
level_mapper,hand_count_mapper,scheck,test_selection,init_state)
level_mapper,hand_count_mapper,scheck,sgoalcheck,test_selection,init_state)
then
addable:AddCard(candidate)
break
......@@ -3863,7 +3889,7 @@ function Synchro.SynTarget(tuner_race,tuner_filter,non_tuner_race,non_tuner_filt
break
end
local finishable=Synchro.IsSelectionValid(sg_arr,target_level,tuner_race,tuner_filter,non_tuner_race,non_tuner_filter,tc,tuner_min,tuner_max,non_tuner_min,non_tuner_max,level_mapper,hand_count_mapper)
local finishable=Synchro.IsSelectionValid(sg_arr,target_level,tuner_race,tuner_filter,non_tuner_race,non_tuner_filter,tc,tuner_min,tuner_max,non_tuner_min,non_tuner_max,level_mapper,hand_count_mapper,sgoalcheck)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local picked=Group.SelectUnselect(addable,sg,tp,finishable,true,selected_level_min,target_level)
......@@ -3958,7 +3984,10 @@ function Synchro.SynOperation()
end
end
function Synchro.IsSelectionValid(selection,target_level,tuner_race,tuner_filter,non_tuner_race,non_tuner_filter,tc,tuner_min,tuner_max,non_tuner_min,non_tuner_max,level_mapper,hand_count_mapper)
function Synchro.IsSelectionValid(selection,target_level,tuner_race,tuner_filter,non_tuner_race,non_tuner_filter,tc,tuner_min,tuner_max,non_tuner_min,non_tuner_max,level_mapper,hand_count_mapper,sgoalcheck)
if not sgoalcheck(Group.FromCards(table.unpack(selection))) then
return false
end
local states=Synchro.BuildStatesFromSelection(
selection,
tuner_race,tuner_filter,
......@@ -4463,6 +4492,7 @@ function AccelSynchro.CreateSummonEffect(c,opts)
local skip_hand_count_check=opts.skip_hand_count_check or false
local additional_scheck=opts.additional_scheck
local material_operation=opts.material_operation
local stage_x_operation=opts.stage_x_operation or aux.TRUE
local e=Effect.CreateEffect(c)
-- e:SetDescription(1164)
e:SetDescription(1379) --- 启用扩展卡包调试模式
......@@ -4471,7 +4501,7 @@ function AccelSynchro.CreateSummonEffect(c,opts)
e:SetCode(EVENT_FREE_CHAIN)
e:SetRange(LOCATION_MZONE)
e:SetTarget(AccelSynchro.GetSummonTarget(synfilter,mg,gc,skip_hand_count_check,additional_scheck))
e:SetOperation(AccelSynchro.GetSummonOperation(synfilter,mg,gc,skip_hand_count_check,additional_scheck,material_operation))
e:SetOperation(AccelSynchro.GetSummonOperation(synfilter,mg,gc,skip_hand_count_check,additional_scheck,material_operation,stage_x_operation))
return e
end
......@@ -4486,7 +4516,7 @@ function AccelSynchro.GetSummonTarget(synfilter,mg,gc,skip_hand_count_check,addi
end
end
function AccelSynchro.GetSummonOperation(synfilter,mg,gc,skip_hand_count_check,additional_scheck,material_operation)
function AccelSynchro.GetSummonOperation(synfilter,mg,gc,skip_hand_count_check,additional_scheck,material_operation,stage_x_operation)
return function(e,tp,eg,ep,ev,re,r,rp)
mg=mg or Duel.GetSynchroMaterial(tp)
local g=Duel.GetMatchingGroup(function(tc) return synfilter(tc) end,tp,LOCATION_EXTRA,0,nil)
......@@ -4529,6 +4559,7 @@ function AccelSynchro.GetSummonOperation(synfilter,mg,gc,skip_hand_count_check,a
assert(tc~=nil)
assert(selected_proc~=nil)
AccelSynchro.OverwriteMaterialOperationCode=material_operation
stage_x_operation(e,tc)
Duel.SynchroSummon(tp,tc,nil,mat,#mat,#mat)
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