DM999
  • DM999
  • Member Topic Starter
2021-10-18T06:44:15Z
Synchro Summon 1 Level 8 Dragon-type Synchro monster from your extra deck, by using monsters from your hand or deck as Synchro materials. You cannot summon other monsters the turn you activate this card.

...I tried this for the script, but it won't activate. Did I miss something important?

function c17698486.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c17698486.sccost)
e1:SetTarget(c17698486.sctg)
e1:SetOperation(c17698486.scop)
c:RegisterEffect(e1)
end
function c17698486.sccost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_SUMMON)==0
and Duel.GetActivityCount(tp,ACTIVITY_FLIPSUMMON)==0 and Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetLabelObject(e)
e1:SetTarget(c17698486.sumlimit)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e2:SetCode(EFFECT_CANNOT_SUMMON)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetTargetRange(1,0)
Duel.RegisterEffect(e2,tp)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_FLIP_SUMMON)
Duel.RegisterEffect(e3,tp)
end
function c17698486.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return e:GetLabelObject()~=se
end
function c17698486.scfilter(c)
return c:GetLevel()==8 and c:IsRace(RACE_DRAGON) and c:IsSynchroSummonable(nil)
end
function c17698486.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsCanBeSynchroMaterial,tp,LOCATION_HAND+LOCATION_DECK,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(c17698486.scfilter,tp,LOCATION_EXTRA,0,1,nil,nil,g) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c17698486.scop(e,tp,eg,ep,ev,re,r,rp)
local hg=Duel.GetMatchingGroup(Card.IsCanBeSynchroMaterial,tp,LOCATION_HAND+LOCATION_DECK,0,nil)
local g=Duel.GetMatchingGroup(c17698486.scfilter,tp,LOCATION_EXTRA,0,nil,nil,hg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=g:Select(tp,1,1,nil):GetFirst()
Duel.SynchroSummon(tp,sc,nil,hg)
end
end