Commit ab02792f authored by Vury Leo's avatar Vury Leo

Add all accelsynchro

parent db901fb8
......@@ -91,7 +91,17 @@ end
function s.sop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetSynchroMaterial(tp):Filter(Card.IsSetCard,nil,0x192)
if #g==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,1,nil,nil,g):GetFirst()
if sc then Duel.SynchroSummon(tp,sc,nil,g) end
local opt=Duel.SelectOption(tp,1164,1379)
if opt==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,1,nil,nil,g):GetFirst()
if sc then Duel.SynchroSummon(tp,sc,nil,g) end
else
local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(function(mc) return mc:IsSetCard(0x192) end,tp,LOCATION_MZONE,0,nil)
local synchro_effect=AccelSynchro.CreateSummonEffect(c,{
mg=mg,
})
synchro_effect:GetOperation()(e,tp,eg,ep,ev,re,r,rp)
end
end
......@@ -97,11 +97,22 @@ function s.scop(e,tp,eg,ep,ev,re,r,rp)
end
local g=Duel.GetMatchingGroup(s.scfilter,tp,LOCATION_EXTRA,0,nil,tp,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
local sc=sg:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local tg=mg:SelectSubGroup(tp,s.syncheck,false,2,#mg,tp,sc)
Duel.SynchroSummon(tp,sc,nil,tg,#tg-1,#tg-1)
local opt=Duel.SelectOption(tp,1164,1379)
if opt==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
local sc=sg:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local tg=mg:SelectSubGroup(tp,s.syncheck,false,2,#mg,tp,sc)
Duel.SynchroSummon(tp,sc,nil,tg,#tg-1,#tg-1)
else
local c=e:GetHandler()
local synchro_effect=AccelSynchro.CreateSummonEffect(c,{
additional_scheck=function(sg)
return sg:IsExists(function(mc) return mc:IsSetCard(0x1ca) end,1,nil)
end,
})
synchro_effect:GetOperation()(e,tp,eg,ep,ev,re,r,rp)
end
end
end
......@@ -54,9 +54,17 @@ end
function s.sop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsControler(1-tp) or c:IsFacedown() then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,1,nil,c):GetFirst()
if tc then Duel.SynchroSummon(tp,tc,c) end
local opt=Duel.SelectOption(tp,1164,1379)
if opt==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,1,nil,c):GetFirst()
if tc then Duel.SynchroSummon(tp,tc,c) end
else
local synchro_effect=AccelSynchro.CreateSummonEffect(c,{
gc=function() return c end,
})
synchro_effect:GetOperation()(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
......
--メルフィー・ラッシィ
function c34800281.initial_effect(c)
local s,id,o=GetID()
function s.initial_effect(c)
--synchro summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(34800281,0))
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,34800281)
e1:SetCountLimit(1,id)
e1:SetHintTiming(0,TIMING_CHAIN_END+TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCondition(c34800281.syncon)
e1:SetTarget(c34800281.syntg)
e1:SetOperation(c34800281.synop)
e1:SetCondition(s.syncon)
e1:SetTarget(s.syntg)
e1:SetOperation(s.synop)
c:RegisterEffect(e1)
--be material
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(34800281,1))
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,34800282)
e2:SetCondition(c34800281.xyzcon)
e2:SetTarget(c34800281.xyztg)
e2:SetOperation(c34800281.xyzop)
e2:SetCondition(s.xyzcon)
e2:SetTarget(s.xyztg)
e2:SetOperation(s.xyzop)
c:RegisterEffect(e2)
--
if not c34800281.global_check then
c34800281.global_check=true
if not s.global_check then
s.global_check=true
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_TO_HAND)
e0:SetOperation(c34800281.regop)
e0:SetOperation(s.regop)
Duel.RegisterEffect(e0,0)
end
end
function c34800281.cfilter(c,tp)
function s.cfilter(c,tp)
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE)
and (c:GetPreviousRaceOnField()&RACE_BEAST)>0
and c:IsPreviousPosition(POS_FACEUP) and not c:IsCode(34800281)
and c:IsPreviousPosition(POS_FACEUP) and not c:IsCode(id)
end
function c34800281.regop(e,tp,eg,ep,ev,re,r,rp)
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for p=0,1 do
if eg:IsExists(c34800281.cfilter,1,nil,p) then
Duel.RegisterFlagEffect(p,34800281,RESET_PHASE+PHASE_END,0,1)
if eg:IsExists(s.cfilter,1,nil,p) then
Duel.RegisterFlagEffect(p,id,RESET_PHASE+PHASE_END,0,1)
end
end
end
function c34800281.syncon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,34800281)>0
function s.syncon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,id)>0
end
function c34800281.syntg(e,tp,eg,ep,ev,re,r,rp,chk)
function s.syntg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c34800281.synhfilter(c,sc,tuner)
function s.synhfilter(c,sc,tuner)
return c:IsCanBeSynchroMaterial(sc,tuner) and c:IsSetCard(0x146)
end
function c34800281.synfilter(c,mc,tp)
local mg=Duel.GetMatchingGroup(c34800281.synhfilter,tp,LOCATION_HAND,0,nil,c,mc)
function s.synfilter(c,mc,tp)
local mg=Duel.GetMatchingGroup(s.synhfilter,tp,LOCATION_HAND,0,nil,c,mc)
mg:AddCard(mc)
return c:IsSynchroSummonable(mc,mg) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function c34800281.synop(e,tp,eg,ep,ev,re,r,rp)
function s.synop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 then return end
if Duel.IsExistingMatchingCard(c34800281.synfilter,tp,LOCATION_EXTRA,0,1,nil,c,tp)
and Duel.SelectYesNo(tp,aux.Stringid(34800281,2)) then
if Duel.IsExistingMatchingCard(s.synfilter,tp,LOCATION_EXTRA,0,1,nil,c,tp)
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local fc=Duel.SelectMatchingCard(tp,c34800281.synfilter,tp,LOCATION_EXTRA,0,1,1,nil,c,tp):GetFirst()
local mg=Duel.GetMatchingGroup(c34800281.synhfilter,tp,LOCATION_HAND,0,nil,fc,c)
mg:AddCard(c)
Duel.SynchroSummon(tp,fc,c,mg)
local opt=Duel.SelectOption(tp,1164,1379)
if opt==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local fc=Duel.SelectMatchingCard(tp,s.synfilter,tp,LOCATION_EXTRA,0,1,1,nil,c,tp):GetFirst()
local mg=Duel.GetMatchingGroup(s.synhfilter,tp,LOCATION_HAND,0,nil,fc,c)
mg:AddCard(c)
Duel.SynchroSummon(tp,fc,c,mg)
else
local mg=Duel.GetMatchingGroup(function(mc) return mc:IsSetCard(0x146) end,tp,LOCATION_HAND,0,nil)
mg:AddCard(c)
local synchro_effect=AccelSynchro.CreateSummonEffect(c,{
gc=function() return c end,
mg=mg,
skip_hand_count_check=true,
})
synchro_effect:GetOperation()(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function c34800281.xyzcon(e,tp,eg,ep,ev,re,r,rp)
function s.xyzcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c34800281.xyzfilter(c)
function s.xyzfilter(c)
return c:IsType(TYPE_XYZ) and c:IsRace(RACE_BEAST) and c:IsFaceup()
end
function c34800281.xyztg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function s.xyztg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c34800281.xyzfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c34800281.xyzfilter,tp,LOCATION_MZONE,0,1,nil) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.xyzfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.xyzfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c34800281.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SelectTarget(tp,s.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,0,0)
end
function c34800281.xyzop(e,tp,eg,ep,ev,re,r,rp)
function s.xyzop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
......
......@@ -100,11 +100,22 @@ function s.scop(e,tp,eg,ep,ev,re,r,rp)
end
local g=Duel.GetMatchingGroup(s.scfilter,tp,LOCATION_EXTRA,0,nil,tp,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
local sc=sg:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local tg=mg:SelectSubGroup(tp,s.syncheck,false,2,#mg,tp,sc)
Duel.SynchroSummon(tp,sc,nil,tg,#tg-1,#tg-1)
local opt=Duel.SelectOption(tp,1164,1379)
if opt==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
local sc=sg:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local tg=mg:SelectSubGroup(tp,s.syncheck,false,2,#mg,tp,sc)
Duel.SynchroSummon(tp,sc,nil,tg,#tg-1,#tg-1)
else
local c=e:GetHandler()
local synchro_effect=AccelSynchro.CreateSummonEffect(c,{
additional_scheck=function(sg)
return sg:IsExists(function(mc) return mc:IsRace(RACE_WARRIOR) end,1,nil)
end,
})
synchro_effect:GetOperation()(e,tp,eg,ep,ev,re,r,rp)
end
end
end
--アクセル・シンクロン
function c37675907.initial_effect(c)
local s,id,o=GetID()
function s.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
......@@ -8,70 +9,70 @@ function c37675907.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c37675907.regcon)
e1:SetOperation(c37675907.regop)
e1:SetCondition(s.regcon)
e1:SetOperation(s.regop)
c:RegisterEffect(e1)
--lv
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(37675907,0))
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCost(c37675907.tgcost)
e2:SetTarget(c37675907.tgtg)
e2:SetOperation(c37675907.tgop)
e2:SetCost(s.tgcost)
e2:SetTarget(s.tgtg)
e2:SetOperation(s.tgop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(37675907,1))
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c37675907.spcon)
e3:SetTarget(c37675907.sptg)
e3:SetOperation(c37675907.spop)
e3:SetCondition(s.spcon)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
end
function c37675907.regcon(e,tp,eg,ep,ev,re,r,rp)
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c37675907.regop(e,tp,eg,ep,ev,re,r,rp)
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(c37675907.splimit)
e1:SetTarget(s.splimit)
Duel.RegisterEffect(e1,tp)
end
function c37675907.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsCode(37675907) and bit.band(sumtype,SUMMON_TYPE_SYNCHRO)==SUMMON_TYPE_SYNCHRO
function s.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsCode(id) and bit.band(sumtype,SUMMON_TYPE_SYNCHRO)==SUMMON_TYPE_SYNCHRO
end
function c37675907.filter(c)
function s.filter(c)
return c:GetLevel()>0 and c:IsSetCard(0x1017) and c:IsAbleToGraveAsCost()
end
function c37675907.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c37675907.filter,tp,LOCATION_DECK,0,1,nil) end
function s.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c37675907.filter,tp,LOCATION_DECK,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
e:SetLabelObject(g:GetFirst())
end
function c37675907.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local lv=e:GetHandler():GetLevel()
if chk==0 then return lv>0 end
local opt
if e:GetLabelObject():GetLevel()<lv then
opt=Duel.SelectOption(tp,aux.Stringid(37675907,2),aux.Stringid(37675907,3))
opt=Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3))
else
opt=Duel.SelectOption(tp,aux.Stringid(37675907,2))
opt=Duel.SelectOption(tp,aux.Stringid(id,2))
end
e:SetLabel(opt)
end
function c37675907.tgop(e,tp,eg,ep,ev,re,r,rp)
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local lv=e:GetLabelObject():GetLevel()
if c:IsRelateToEffect(e) and c:IsFaceup() then
......@@ -87,22 +88,30 @@ function c37675907.tgop(e,tp,eg,ep,ev,re,r,rp)
c:RegisterEffect(e1)
end
end
function c37675907.spcon(e,tp,eg,ep,ev,re,r,rp)
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return Duel.GetTurnPlayer()~=tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function c37675907.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 not e:GetHandler():IsStatus(STATUS_CHAINING)
and Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c37675907.spop(e,tp,eg,ep,ev,re,r,rp)
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsControler(1-tp) or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,c)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
local opt=Duel.SelectOption(tp,1164,1379)
if opt==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
else
local synchro_effect=AccelSynchro.CreateSummonEffect(c,{
gc=function() return c end,
})
synchro_effect:GetOperation()(e,tp,eg,ep,ev,re,r,rp)
end
end
end
--天盃龍パイドラ
local s,id,o=GetID()
function c39931513.initial_effect(c)
function s.initial_effect(c)
--to hand or set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
......@@ -77,8 +77,16 @@ function s.scop(e,tp,eg,ep,ev,re,r,rp)
if c:IsControler(1-tp) or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,c)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
local opt=Duel.SelectOption(tp,1164,1379)
if opt==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
else
local synchro_effect=AccelSynchro.CreateSummonEffect(c,{
gc=function() return c end,
})
synchro_effect:GetOperation()(e,tp,eg,ep,ev,re,r,rp)
end
end
end
......@@ -118,11 +118,22 @@ function s.scop(e,tp,eg,ep,ev,re,r,rp)
end
local g=Duel.GetMatchingGroup(s.scfilter,tp,LOCATION_EXTRA,0,nil,tp,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
local sc=sg:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local tg=mg:SelectSubGroup(tp,s.syncheck,false,2,#mg,tp,sc)
Duel.SynchroSummon(tp,sc,nil,tg,#tg-1,#tg-1)
local opt=Duel.SelectOption(tp,1164,1379)
if opt==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
local sc=sg:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local tg=mg:SelectSubGroup(tp,s.syncheck,false,2,#mg,tp,sc)
Duel.SynchroSummon(tp,sc,nil,tg,#tg-1,#tg-1)
else
local c=e:GetHandler()
local synchro_effect=AccelSynchro.CreateSummonEffect(c,{
additional_scheck=function(sg)
return sg:IsExists(function(mc) return mc:IsSetCard(0x1a2) end,1,nil)
end,
})
synchro_effect:GetOperation()(e,tp,eg,ep,ev,re,r,rp)
end
end
end
--烙印の即凶劇
function c45675980.initial_effect(c)
local s,id,o=GetID()
function s.initial_effect(c)
--activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
......@@ -7,15 +8,15 @@ function c45675980.initial_effect(c)
c:RegisterEffect(e0)
--Effect 1
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(45675980,0))
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_SZONE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,45675980)
e1:SetTarget(c45675980.sctg)
e1:SetOperation(c45675980.scop)
e1:SetCountLimit(1,id)
e1:SetTarget(s.sctg)
e1:SetOperation(s.scop)
c:RegisterEffect(e1)
--macro cosmos
local e2=Effect.CreateEffect(c)
......@@ -24,48 +25,59 @@ function c45675980.initial_effect(c)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e2:SetValue(LOCATION_REMOVED)
e2:SetCondition(c45675980.rmcon)
e2:SetTarget(c45675980.rmtg)
e2:SetCondition(s.rmcon)
e2:SetTarget(s.rmtg)
c:RegisterEffect(e2)
end
function c45675980.syncheck(g,tp,syncard)
function s.syncheck(g,tp,syncard)
return g:IsExists(Card.IsRace,1,nil,RACE_DRAGON) and syncard:IsSynchroSummonable(nil,g,#g-1,#g-1) and aux.SynMixHandCheck(g,tp,syncard)
end
function c45675980.spfilter(c,tp,mg)
return mg:CheckSubGroup(c45675980.syncheck,2,#mg,tp,c)
function s.spfilter(c,tp,mg)
return mg:CheckSubGroup(s.syncheck,2,#mg,tp,c)
end
function c45675980.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
local mg=Duel.GetSynchroMaterial(tp)
if mg:IsExists(Card.GetHandSynchro,1,nil) then
local mg2=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND,0,nil)
if mg2:GetCount()>0 then mg:Merge(mg2) end
end
return Duel.IsExistingMatchingCard(c45675980.spfilter,tp,LOCATION_EXTRA,0,1,nil,tp,mg)
return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,tp,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c45675980.scop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetSynchroMaterial(tp)
if mg:IsExists(Card.GetHandSynchro,1,nil) then
local mg2=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND,0,nil)
if mg2:GetCount()>0 then mg:Merge(mg2) end
end
local g=Duel.GetMatchingGroup(c45675980.spfilter,tp,LOCATION_EXTRA,0,nil,tp,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
local sc=sg:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local tg=mg:SelectSubGroup(tp,c45675980.syncheck,false,2,#mg,tp,sc)
Duel.SynchroSummon(tp,sc,nil,tg,#tg-1,#tg-1)
function s.scop(e,tp,eg,ep,ev,re,r,rp)
local opt=Duel.SelectOption(tp,1164,1379)
if opt==0 then
local mg=Duel.GetSynchroMaterial(tp)
if mg:IsExists(Card.GetHandSynchro,1,nil) then
local mg2=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND,0,nil)
if mg2:GetCount()>0 then mg:Merge(mg2) end
end
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_EXTRA,0,nil,tp,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
local sc=sg:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local tg=mg:SelectSubGroup(tp,s.syncheck,false,2,#mg,tp,sc)
Duel.SynchroSummon(tp,sc,nil,tg,#tg-1,#tg-1)
end
else
local c=e:GetHandler()
local synchro_effect=AccelSynchro.CreateSummonEffect(c,{
additional_scheck=function(sg)
return sg:IsExists(function(mc) return mc:IsRace(RACE_DRAGON) end,1,nil)
end,
})
synchro_effect:GetOperation()(e,tp,eg,ep,ev,re,r,rp)
end
end
function c45675980.rmcon(e)
function s.rmcon(e)
local tp=e:GetHandlerPlayer()
return Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsSetCard),tp,LOCATION_MZONE,0,1,nil,0x188)
end
function c45675980.rmtg(e,c)
function s.rmtg(e,c)
local tp=e:GetHandlerPlayer()
local b1=c:IsReason(REASON_RITUAL) and c:IsReason(REASON_RELEASE)
local b2=c:IsReason(REASON_FUSION+REASON_SYNCHRO+REASON_LINK)
......
......@@ -63,43 +63,10 @@ function s.scop(e,tp,eg,ep,ev,re,r,rp)
local tc=g:Select(tp,1,1,nil):GetFirst()
Duel.SynchroSummon(tp,tc,c)
else
local mg=Duel.GetSynchroMaterial(tp)
local mat=Group.CreateGroup()
local tc=nil
local selected_proc=nil
while #mat==0 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
tc=g:Select(tp,1,1,nil):GetFirst()
local procs={tc:IsHasEffect(EFFECT_SPSUMMON_PROC,tp)}
local avaliable_procs={}
for _,proc in ipairs(procs) do
local con=proc:GetCondition()
if con(e,tc,c,mg,1,math.huge) then
table.insert(avaliable_procs,proc)
end
end
if #avaliable_procs==0 then
--- fallback
Duel.SynchroSummon(tp,tc,c)
end
assert(#avaliable_procs>0,"target card does not support new synchro yet")
selected_proc=avaliable_procs[1]
if #avaliable_procs>1 then
local opts={}
for _,avaliable_proc in ipairs(avaliable_procs) do
table.insert(opts,avaliable_proc:GetDescription())
end
local proc_index=Duel.SelectOption(tp,table.unpack(opts))+1
selected_proc=avaliable_procs[proc_index]
end
local target=selected_proc:GetTarget()
if target(selected_proc,tp,eg,ep,ev,re,r,rp,1,tc,c,mg,1,math.huge) then
mat=selected_proc:GetLabelObject()
end
end
assert(tc~=nil)
assert(selected_proc~=nil)
Duel.SynchroSummon(tp,tc,nil,mat,#mat,#mat)
local synchro_effect=AccelSynchro.CreateSummonEffect(c,{
gc=function() return c end,
})
synchro_effect:GetOperation()(e,tp,eg,ep,ev,re,r,rp)
end
end
end
......@@ -78,8 +78,16 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
if c:IsControler(1-tp) or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,c)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
local opt=Duel.SelectOption(tp,1164,1379)
if opt==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
else
local synchro_effect=AccelSynchro.CreateSummonEffect(c,{
gc=function() return c end,
})
synchro_effect:GetOperation()(e,tp,eg,ep,ev,re,r,rp)
end
end
end
--天盃龍ファドラ
function c65326118.initial_effect(c)
local s,id,o=GetID()
function s.initial_effect(c)
--Special summon from grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(65326118,0))
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,65326118)
e1:SetTarget(c65326118.sptg)
e1:SetOperation(c65326118.spop)
e1:SetCountLimit(1,id)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
......@@ -25,62 +26,70 @@ function c65326118.initial_effect(c)
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetTarget(c65326118.indtg)
e4:SetTarget(s.indtg)
e4:SetValue(1)
c:RegisterEffect(e4)
--synchro summon
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(65326118,2))
e5:SetDescription(aux.Stringid(id,2))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetHintTiming(0,TIMING_BATTLE_START+TIMING_BATTLE_STEP_END+TIMING_BATTLE_END)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetCondition(c65326118.sccon)
e5:SetTarget(c65326118.sctg)
e5:SetOperation(c65326118.scop)
e5:SetCondition(s.sccon)
e5:SetTarget(s.sctg)
e5:SetOperation(s.scop)
c:RegisterEffect(e5)
end
function c65326118.filter(c,e,tp)
function s.filter(c,e,tp)
return c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsLevelBelow(4)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c65326118.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c65326118.filter(chkc,e,tp) end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c65326118.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(65326118,0))
and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,0))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c65326118.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c65326118.spop(e,tp,eg,ep,ev,re,r,rp)
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c65326118.indtg(e,c)
function s.indtg(e,c)
return c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_FIRE)
end
function c65326118.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_BATTLE_START and ph<=PHASE_BATTLE
end
function c65326118.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 return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(65326118,2))
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,2))
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c65326118.scop(e,tp,eg,ep,ev,re,r,rp)
function s.scop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsControler(1-tp) or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,c)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
local opt=Duel.SelectOption(tp,1164,1379)
if opt==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
else
local synchro_effect=AccelSynchro.CreateSummonEffect(c,{
gc=function() return c end,
})
synchro_effect:GetOperation()(e,tp,eg,ep,ev,re,r,rp)
end
end
end
......@@ -88,9 +88,17 @@ function s.scop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 then
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,c)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
local opt=Duel.SelectOption(tp,1164,1379)
if opt==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
else
local synchro_effect=AccelSynchro.CreateSummonEffect(c,{
gc=function() return c end,
})
synchro_effect:GetOperation()(e,tp,eg,ep,ev,re,r,rp)
end
end
else
local mg=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
......
--シューティング・ライザー・ドラゴン
function c68431965.initial_effect(c)
local s,id,o=GetID()
function s.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--lv
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(68431965,0))
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,68431965)
e1:SetCondition(c68431965.lvlcon)
e1:SetTarget(c68431965.lvtg1)
e1:SetOperation(c68431965.lvop1)
e1:SetCountLimit(1,id)
e1:SetCondition(s.lvlcon)
e1:SetTarget(s.lvtg1)
e1:SetOperation(s.lvop1)
c:RegisterEffect(e1)
--synchro effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(68431965,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,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c68431965.sccon)
e2:SetTarget(c68431965.sctarg)
e2:SetOperation(c68431965.scop)
e2:SetCondition(s.sccon)
e2:SetTarget(s.sctarg)
e2:SetOperation(s.scop)
c:RegisterEffect(e2)
end
function c68431965.lvlcon(e,tp,eg,ep,ev,re,r,rp)
function s.lvlcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c68431965.lvtg1(e,tp,eg,ep,ev,re,r,rp,chk)
function s.lvtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e)
and Duel.IsExistingMatchingCard(c68431965.tgfilter,tp,LOCATION_DECK,0,1,nil,e:GetHandler():GetLevel()) end
and Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil,e:GetHandler():GetLevel()) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c68431965.tgfilter(c,lv)
function s.tgfilter(c,lv)
return c:IsLevelBelow(lv-1) and c:IsAbleToGrave()
end
function c68431965.lvop1(e,tp,eg,ep,ev,re,r,rp)
function s.lvop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() or c:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c68431965.tgfilter,tp,LOCATION_DECK,0,1,1,nil,c:GetLevel())
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil,c:GetLevel())
if g:GetCount()>0 and Duel.SendtoGrave(g,REASON_EFFECT)~=0 and g:GetFirst():IsLocation(LOCATION_GRAVE)
and c:IsFaceup() then
local lv=g:GetFirst():GetLevel()
......@@ -59,31 +60,39 @@ function c68431965.lvop1(e,tp,eg,ep,ev,re,r,rp)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetTargetRange(1,0)
e2:SetValue(c68431965.aclimit)
e2:SetValue(s.aclimit)
e2:SetLabel(g:GetFirst():GetCode())
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
end
function c68431965.aclimit(e,re,tp)
function s.aclimit(e,re,tp)
return re:GetHandler():IsCode(e:GetLabel()) and re:IsActiveType(TYPE_MONSTER)
end
function c68431965.sccon(e,tp,eg,ep,ev,re,r,rp)
function s.sccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c68431965.sctarg(e,tp,eg,ep,ev,re,r,rp,chk)
function s.sctarg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c68431965.scop(e,tp,eg,ep,ev,re,r,rp)
function s.scop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsControler(1-tp) or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,c)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
local opt=Duel.SelectOption(tp,1164,1379)
if opt==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
else
local synchro_effect=AccelSynchro.CreateSummonEffect(c,{
gc=function() return c end,
})
synchro_effect:GetOperation()(e,tp,eg,ep,ev,re,r,rp)
end
end
end
--天盃龍チュンドラ
function c91810826.initial_effect(c)
local s,id,o=GetID()
function s.initial_effect(c)
--Self special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(91810826,0))
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,91810826)
e1:SetCondition(c91810826.spcon)
e1:SetTarget(c91810826.sptg)
e1:SetOperation(c91810826.spop)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--Special summon from deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(91810826,1))
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_BATTLE_START)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,91810827)
e2:SetTarget(c91810826.sptg2)
e2:SetOperation(c91810826.spop2)
e2:SetCountLimit(1,id+o)
e2:SetTarget(s.sptg2)
e2:SetOperation(s.spop2)
c:RegisterEffect(e2)
--Synchro summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(91810826,2))
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMING_BATTLE_START+TIMING_BATTLE_STEP_END+TIMING_BATTLE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c91810826.sccon)
e3:SetTarget(c91810826.sctg)
e3:SetOperation(c91810826.scop)
e3:SetCondition(s.sccon)
e3:SetTarget(s.sctg)
e3:SetOperation(s.scop)
c:RegisterEffect(e3)
end
function c91810826.cfilter(c)
function s.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_FIRE)
end
function c91810826.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c91810826.cfilter,tp,LOCATION_MZONE,0,1,nil)
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c91810826.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 e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c91810826.spop(e,tp,eg,ep,ev,re,r,rp)
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function c91810826.filter(c,e,tp)
return c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsLevelBelow(4) and not c:IsCode(91810826)
function s.filter(c,e,tp)
return c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsLevelBelow(4) and not c:IsCode(id)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c91810826.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c91810826.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(91810826,1))
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,1))
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c91810826.spop2(e,tp,eg,ep,ev,re,r,rp)
function s.spop2(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,c91810826.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c91810826.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_BATTLE_START and ph<=PHASE_BATTLE
end
function c91810826.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 return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(91810826,2))
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(id,2))
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c91810826.scop(e,tp,eg,ep,ev,re,r,rp)
function s.scop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsControler(1-tp) or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,c)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
local opt=Duel.SelectOption(tp,1164,1379)
if opt==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
else
local synchro_effect=AccelSynchro.CreateSummonEffect(c,{
gc=function() return c end,
})
synchro_effect:GetOperation()(e,tp,eg,ep,ev,re,r,rp)
end
end
end
......@@ -65,8 +65,16 @@ function s.scop(e,tp,eg,ep,ev,re,r,rp)
if c:IsControler(1-tp) or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,c)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
local opt=Duel.SelectOption(tp,1164,1379)
if opt==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
else
local synchro_effect=AccelSynchro.CreateSummonEffect(c,{
gc=function() return c end,
})
synchro_effect:GetOperation()(e,tp,eg,ep,ev,re,r,rp)
end
end
end
--TG ワンダー・マジシャン
function c98558751.initial_effect(c)
local s,id,o=GetID()
function s.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsSetCard,0x27),1)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(98558751,0))
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c98558751.descon)
e1:SetTarget(c98558751.destg)
e1:SetOperation(c98558751.desop)
e1:SetCondition(s.descon)
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(98558751,1))
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCondition(c98558751.drcon)
e2:SetTarget(c98558751.drtg)
e2:SetOperation(c98558751.drop)
e2:SetCondition(s.drcon)
e2:SetTarget(s.drtg)
e2:SetOperation(s.drop)
c:RegisterEffect(e2)
--synchro effect
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(98558751,2))
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(c98558751.sccon)
e3:SetTarget(c98558751.sctg)
e3:SetOperation(c98558751.scop)
e3:SetCondition(s.sccon)
e3:SetTarget(s.sctg)
e3:SetOperation(s.scop)
c:RegisterEffect(e3)
end
function c98558751.descon(e,tp,eg,ep,ev,re,r,rp)
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c98558751.filter(c)
function s.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c98558751.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c98558751.filter(chkc) end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and s.filter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c98558751.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c98558751.desop(e,tp,eg,ep,ev,re,r,rp)
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c98558751.drcon(e,tp,eg,ep,ev,re,r,rp)
function s.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY)
end
function c98558751.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c98558751.drop(e,tp,eg,ep,ev,re,r,rp)
function s.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function c98558751.sccon(e,tp,eg,ep,ev,re,r,rp)
function s.sccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c98558751.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 return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c98558751.scop(e,tp,eg,ep,ev,re,r,rp)
function s.scop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsControler(1-tp) or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,c)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
local opt=Duel.SelectOption(tp,1164,1379)
if opt==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
else
local synchro_effect=AccelSynchro.CreateSummonEffect(c,{
gc=function() return c end,
})
synchro_effect:GetOperation()(e,tp,eg,ep,ev,re,r,rp)
end
end
end
--TG スター・ガーディアン
function c99937842.initial_effect(c)
local s,id,o=GetID()
function s.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsSetCard,0x27),1)
c:EnableReviveLimit()
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(99937842,0))
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,99937842)
e1:SetTarget(c99937842.thtg)
e1:SetOperation(c99937842.thop)
e1:SetCountLimit(1,id)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(99937842,1))
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,99937843)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c99937842.sptg)
e2:SetOperation(c99937842.spop)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--synchro effect
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(99937842,2))
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(c99937842.sccon)
e3:SetTarget(c99937842.sctg)
e3:SetOperation(c99937842.scop)
e3:SetCondition(s.sccon)
e3:SetTarget(s.sctg)
e3:SetOperation(s.scop)
c:RegisterEffect(e3)
end
function c99937842.thfilter(c,tp)
function s.thfilter(c,tp)
return c:IsSetCard(0x27) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c99937842.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c99937842.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c99937842.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectTarget(tp,c99937842.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
local sg=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,1,0,0)
end
function c99937842.thop(e,tp,eg,ep,ev,re,r,rp)
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function c99937842.spfilter(c,e,tp)
function s.spfilter(c,e,tp)
return c:IsSetCard(0x27) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c99937842.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(c99937842.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c99937842.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,c99937842.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c99937842.sccon(e,tp,eg,ep,ev,re,r,rp)
function s.sccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c99937842.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 return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c99937842.scop(e,tp,eg,ep,ev,re,r,rp)
function s.scop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsControler(1-tp) or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,c)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
local opt=Duel.SelectOption(tp,1164,1379)
if opt==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
else
local synchro_effect=AccelSynchro.CreateSummonEffect(c,{
gc=function() return c end,
})
synchro_effect:GetOperation()(e,tp,eg,ep,ev,re,r,rp)
end
end
end
......@@ -3531,19 +3531,7 @@ function Synchro.FindValidSelection(candidates,target_level,
level_mapper,hand_count_mapper,scheck,
pre_select or {},
1,
state or { -- initial state
possible_sums={[0]=true},
tuner_count=0,
non_tuner_count=0,
level_mapper=level_mapper,
level_mapper_priority=0,
hand_count_mapper=hand_count_mapper,
hand_count_limit=0,
hand_count=0,
genomix_race=nil,
material_limit_filter=aux.TRUE,
selected_roles={}
},
state,
{
level_prune_index=level_prune_index,
hand_prune_index=hand_prune_index,
......@@ -3692,10 +3680,25 @@ 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)
--- @param mg Group
return function(e,c,smat,mg,min,max)
return function(e,c,smat,mg,min,max,accel_synchro_opts)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
--- accel synchro has already selected their materials, skip check
if mg~=nil and #mg==min then
return true
end
accel_synchro_opts=accel_synchro_opts or {}
local skip_hand_count_check=accel_synchro_opts.skip_hand_count_check or false
local additional_scheck=accel_synchro_opts.additional_scheck
--- add additional_scheck
if additional_scheck~=nil then
local old_scheck=scheck
scheck=aux.AND(additional_scheck,old_scheck)
end
-- add リペア・ジェネクス・コントローラー to scheck
if Duel.IsPlayerAffectedByEffect(c:GetOwner(),8173184) then
local old_scheck=scheck
......@@ -3712,9 +3715,6 @@ function Synchro.SynCondition(tuner_race,tuner_filter,non_tuner_race,non_tuner_f
local target_level=c:GetLevel()
mg=mg or Synchro.GetSynchroMaterial(c:GetControler(),c,level_mapper)
local smat_states=nil
local smat_arr=nil
local candidates={}
for mc in aux.Next(mg) do
if mc~=smat then
......@@ -3722,35 +3722,43 @@ function Synchro.SynCondition(tuner_race,tuner_filter,non_tuner_race,non_tuner_f
end
end
local pre_selected_arr={}
if smat~=nil then
if not mg:IsContains(smat) then
return false
end
smat_arr={}
table.insert(smat_arr,smat)
smat_states=Synchro.BuildStatesFromSelection(smat_arr,tuner_race,tuner_filter,non_tuner_race,non_tuner_filter,level_mapper,hand_count_mapper,c,math.huge)
table.insert(pre_selected_arr,smat)
end
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(smat_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,smat_arr,state) then
return true
end
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
return true
end
return false
else
return 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)
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)
return function(e,tp,eg,ep,ev,re,r,rp,chk,tc,smat,mg,min,max)
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
e:SetLabelObject(mg)
return true
end
accel_synchro_opts=accel_synchro_opts or {}
local skip_hand_count_check=accel_synchro_opts.skip_hand_count_check or false
local additional_scheck=accel_synchro_opts.additional_scheck
mg=mg or Synchro.GetSynchroMaterial(tp,tc,level_mapper)
--- add additional_scheck
if additional_scheck~=nil then
local old_scheck=scheck
scheck=aux.AND(additional_scheck,old_scheck)
end
-- add リペア・ジェネクス・コントローラー to scheck
if Duel.IsPlayerAffectedByEffect(tp,8173184) then
local old_scheck=scheck
......@@ -3791,7 +3799,7 @@ function Synchro.SynTarget(tuner_race,tuner_filter,non_tuner_race,non_tuner_filt
tuner_race,tuner_filter,
non_tuner_race,non_tuner_filter,
level_mapper,hand_count_mapper,
tc,math.huge
tc,math.huge,skip_hand_count_check
)
--- use the min select level as hint
for _,state in ipairs(selected_states) do
......@@ -3829,7 +3837,7 @@ function Synchro.SynTarget(tuner_race,tuner_filter,non_tuner_race,non_tuner_filt
tuner_race,tuner_filter,
non_tuner_race,non_tuner_filter,
level_mapper,hand_count_mapper,
tc,math.huge
tc,math.huge,skip_hand_count_check
)
for _,init_state in ipairs(base_states) do
......@@ -4064,7 +4072,7 @@ function Synchro.UpdatepossibleSums(possible_sums,card_levels,prune_level)
return new_sums
end
function Synchro.BuildStatesFromSelection(selection,tuner_race,tuner_filter,non_tuner_race,non_tuner_filter,level_mapper,hand_count_mapper,tc,prune_level)
function Synchro.BuildStatesFromSelection(selection,tuner_race,tuner_filter,non_tuner_race,non_tuner_filter,level_mapper,hand_count_mapper,tc,prune_level,skip_hand_count_check)
local states={
{
possible_sums={[0]=true},
......@@ -4081,6 +4089,10 @@ function Synchro.BuildStatesFromSelection(selection,tuner_race,tuner_filter,non_
}
}
if skip_hand_count_check==true then
states[1].hand_count_limit=math.huge
end
Synchro.SortMaterials(selection,tc,tuner_filter)
local selected={}
......@@ -4200,8 +4212,8 @@ function Synchro.IsMandatory(c)
return Synchro.IsMono(c) or Synchro.IsGenomix(c)
end
function Synchro.IsNoHarm(c)
return Synchro.IsTatsunoko(c) or Synchro.IsTatsunecro(c)
function Synchro.IsNoHarm(c,tc)
return Synchro.IsTatsunoko(c) or Synchro.IsTatsunecro(c) or Synchro.IsTGCyberMagician(c,tc)
end
-- Helper to generate only the variant-specific diffs for a card
......@@ -4235,7 +4247,7 @@ function Synchro.GenerateVariantForCard(st,card,selected,tc,tuner_race,tuner_fil
end
-- Normal branch
if not (Synchro.IsMandatory(card) or Synchro.IsNoHarm(card)) then
if not (Synchro.IsMandatory(card) or Synchro.IsNoHarm(card,tc)) then
table.insert(base_variants,{})
end
......@@ -4250,15 +4262,17 @@ function Synchro.GenerateVariantForCard(st,card,selected,tc,tuner_race,tuner_fil
-- Tatsunoko effect
if Synchro.IsTatsunoko(card) then
local limit=math.max(st.hand_count_limit,1)
table.insert(base_variants,{
hand_count_limit=1,
hand_count_limit=limit,
})
end
-- Tatsunecro effect
if Synchro.IsTatsunecro(card) then
local limit=math.max(st.hand_count_limit,1)
table.insert(base_variants,{
hand_count_limit=1,
hand_count_limit=limit,
})
end
......@@ -4427,3 +4441,80 @@ function Synchro.CanIncludeMaterial(mc,state,selected,tc,
return true,append_material_limit_filter
end
--- Accel Synchro
AccelSynchro={}
function AccelSynchro.CreateSummonEffect(c,opts)
local mg=opts.mg or nil
local gc=opts.gc or function() return nil end
local skip_hand_count_check=opts.skip_hand_count_check or false
local additional_scheck=opts.additional_scheck
local e=Effect.CreateEffect(c)
-- e:SetDescription(1164)
e:SetDescription(1379) --- 启用扩展卡包调试模式
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetType(EFFECT_TYPE_QUICK_O)
e:SetCode(EVENT_FREE_CHAIN)
e:SetRange(LOCATION_MZONE)
e:SetTarget(AccelSynchro.GetSummonTarget(mg,gc,skip_hand_count_check,additional_scheck))
e:SetOperation(AccelSynchro.GetSummonOperation(mg,gc,skip_hand_count_check,additional_scheck))
return e
end
function AccelSynchro.GetSummonTarget(mg,gc,skip_hand_count_check,additional_scheck)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
mg=mg or Duel.GetSynchroMaterial(tp)
if chk==0 then
--- @param tc Card
return Duel.IsExistingMatchingCard(function(tc) return tc:IsSynchroSummonable(gc(e),mg) end,tp,LOCATION_EXTRA,0,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
end
function AccelSynchro.GetSummonOperation(mg,gc,skip_hand_count_check,additional_scheck)
return function(e,tp,eg,ep,ev,re,r,rp)
mg=mg or Duel.GetSynchroMaterial(tp)
local g=Duel.GetMatchingGroup(function(tc) return tc:IsSynchroSummonable(gc(e),mg) end,tp,LOCATION_EXTRA,0,nil)
local mat=Group.CreateGroup()
local tc=nil
local selected_proc=nil
while #mat==0 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
tc=g:Select(tp,1,1,nil):GetFirst()
local procs={tc:IsHasEffect(EFFECT_SPSUMMON_PROC,tp)}
local avaliable_procs={}
for _,proc in ipairs(procs) do
local con=proc:GetCondition()
if con(proc,tc,gc(e),mg,-1,math.huge,{
skip_hand_count_check=skip_hand_count_check,
additional_scheck=additional_scheck,
}) then
table.insert(avaliable_procs,proc)
end
end
assert(#avaliable_procs>0,"target card does not support new synchro yet")
selected_proc=avaliable_procs[1]
if #avaliable_procs>1 then
local opts={}
for _,avaliable_proc in ipairs(avaliable_procs) do
table.insert(opts,avaliable_proc:GetDescription())
end
local proc_index=Duel.SelectOption(tp,table.unpack(opts))+1
selected_proc=avaliable_procs[proc_index]
end
local target=selected_proc:GetTarget()
if target(selected_proc,tp,eg,ep,ev,re,r,rp,1,tc,gc(e),mg,-1,math.huge,{
skip_hand_count_check=skip_hand_count_check,
additional_scheck=additional_scheck,
}) then
mat=selected_proc:GetLabelObject()
end
end
assert(tc~=nil)
assert(selected_proc~=nil)
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