--Void Baron function c11000123.initial_effect(c) c:EnableReviveLimit() --cannot special summon local e0=Effect.CreateEffect(c) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e0:SetType(EFFECT_TYPE_SINGLE) e0:SetCode(EFFECT_SPSUMMON_CONDITION) e0:SetValue(aux.synlimit) c:RegisterEffect(e0) --synchro summon local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE) e1:SetRange(LOCATION_EXTRA) e1:SetCondition(c11000123.syncon) e1:SetOperation(c11000123.synop) e1:SetValue(SUMMON_TYPE_SYNCHRO) c:RegisterEffect(e1) --banish local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(11000123,0)) e2:SetCategory(CATEGORY_REMOVE) e2:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCondition(c11000123.rmcon) e2:SetTarget(c11000123.rmtg) e2:SetOperation(c11000123.rmop) c:RegisterEffect(e2) --negate local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(11000123,1)) e3:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_CHAINING) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetCondition(c11000123.negcon) e3:SetCost(c11000123.negcost) e3:SetTarget(c11000123.negtg) e3:SetOperation(c11000123.negop) c:RegisterEffect(e3) --Special Summon local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(11000123,2)) e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_LEAVE_FIELD) e4:SetCondition(c11000123.spcon) e4:SetTarget(c11000123.sptg) e4:SetOperation(c11000123.spop) c:RegisterEffect(e4) end function c11000123.matfilter1(c,syncard) return c:IsType(TYPE_TUNER) and c:IsSetCard(0x1F4) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsCanBeSynchroMaterial(syncard) end function c11000123.matfilter2(c,syncard) return c:IsFaceup() and c:IsNotTuner() and c:IsType(TYPE_MONSTER) and c:IsCanBeSynchroMaterial(syncard) end function c11000123.synfilter1(c,syncard,lv,g1,g2,g3,g4) local tlv=c:GetSynchroLevel(syncard) if lv-tlv<=0 then return false end local f1=c.tuner_filter if c:IsHasEffect(EFFECT_HAND_SYNCHRO) then return g3:IsExists(c11000123.synfilter2,1,c,syncard,lv-tlv,g2,g4,f1,c) else return g1:IsExists(c11000123.synfilter2,1,c,syncard,lv-tlv,g2,g4,f1,c) end end function c11000123.synfilter2(c,syncard,lv,g2,g4,f1,tuner1) local tlv=c:GetSynchroLevel(syncard) if lv-tlv<=0 then return false end local f2=c.tuner_filter if f1 and not f1(c) then return false end if f2 and not f2(tuner1) then return false end if (tuner1:IsHasEffect(EFFECT_HAND_SYNCHRO) and not c:IsLocation(LOCATION_HAND)) or c:IsHasEffect(EFFECT_HAND_SYNCHRO) then return g4:IsExists(c11000123.synfilter3,1,nil,syncard,lv-tlv,f1,f2,g2) else return g2:CheckWithSumEqual(Card.GetSynchroLevel,lv-tlv,1,62,syncard) end end function c11000123.synfilter3(c,syncard,lv,f1,f2,g2) if not (not f1 or f1(c)) and not (not f2 or f2(c)) then return false end local mlv=c:GetSynchroLevel(syncard) local slv=lv-mlv if slv<0 then return false end if slv==0 then return true else return g2:CheckWithSumEqual(Card.GetSynchroLevel,slv,1,61,syncard) end end function c11000123.syncon(e,c,tuner,mg) if c==nil then return true end local tp=c:GetControler() if Duel.GetLocationCount(tp,LOCATION_MZONE)<-2 then return false end local g1=nil local g2=nil local g3=nil local g4=nil if mg then g1=mg:Filter(c11000123.matfilter1,nil,c) g2=mg:Filter(c11000123.matfilter2,nil,c) g3=mg:Filter(c11000123.matfilter1,nil,c) g4=mg:Filter(c11000123.matfilter2,nil,c) else g1=Duel.GetMatchingGroup(c11000123.matfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,nil,c) g2=Duel.GetMatchingGroup(c11000123.matfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,nil,c) g3=Duel.GetMatchingGroup(c11000123.matfilter1,tp,LOCATION_MZONE+LOCATION_HAND,LOCATION_MZONE,nil,c) g4=Duel.GetMatchingGroup(c11000123.matfilter2,tp,LOCATION_MZONE+LOCATION_HAND,LOCATION_MZONE,nil,c) end local pe=Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_SMATERIAL) local lv=c:GetLevel() if tuner then local tlv=tuner:GetSynchroLevel(c) if lv-tlv<=0 then return false end local f1=tuner.tuner_filter if not pe then return g1:IsExists(c11000123.synfilter2,1,tuner,c,lv-tlv,g2,g4,f1,tuner) else return c11000123.synfilter2(pe:GetOwner(),c,lv-tlv,g2,nil,f1,tuner) end end if not pe then return g1:IsExists(c11000123.synfilter1,1,nil,c,lv,g1,g2,g3,g4) else return c11000123.synfilter1(pe:GetOwner(),c,lv,g1,g2,g3,g4) end end function c11000123.synop(e,tp,eg,ep,ev,re,r,rp,c,tuner,mg) local g=Group.CreateGroup() local g1=nil local g2=nil local g3=nil local g4=nil if mg then g1=mg:Filter(c11000123.matfilter1,nil,c) g2=mg:Filter(c11000123.matfilter2,nil,c) g3=mg:Filter(c11000123.matfilter1,nil,c) g4=mg:Filter(c11000123.matfilter2,nil,c) else g1=Duel.GetMatchingGroup(c11000123.matfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,nil,c) g2=Duel.GetMatchingGroup(c11000123.matfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,nil,c) g3=Duel.GetMatchingGroup(c11000123.matfilter1,tp,LOCATION_MZONE+LOCATION_HAND,LOCATION_MZONE,nil,c) g4=Duel.GetMatchingGroup(c11000123.matfilter2,tp,LOCATION_MZONE+LOCATION_HAND,LOCATION_MZONE,nil,c) end local pe=Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_SMATERIAL) local lv=c:GetLevel() if tuner then g:AddCard(tuner) local lv1=tuner:GetSynchroLevel(c) local f1=tuner.tuner_filter Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL) local tuner2=nil if not pe then local t2=g1:FilterSelect(tp,c11000123.synfilter2,1,1,tuner,c,lv-lv1,g2,g4,f1,tuner) tuner2=t2:GetFirst() else tuner2=pe:GetOwner() Group.FromCards(tuner2):Select(tp,1,1,nil) end g:AddCard(tuner2) local lv2=tuner2:GetSynchroLevel(c) local f2=tuner2.tuner_filter local m3=nil Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL) if tuner2:IsHasEffect(EFFECT_HAND_SYNCHRO) then m3=g4:FilterSelect(tp,c11000123.synfilter3,1,1,nil,c,lv-lv1-lv2,f1,f2,g2) local lv3=m3:GetFirst():GetSynchroLevel(c) if lv-lv1-lv2-lv3>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL) local m4=g2:SelectWithSumEqual(tp,Card.GetSynchroLevel,lv-lv1-lv2-lv3,1,61,c) g:Merge(m4) end else m3=g2:SelectWithSumEqual(tp,Card.GetSynchroLevel,lv-lv1-lv2,1,62,c) end g:Merge(m3) else Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL) local tuner1=nil local hand=nil if not pe then local t1=g1:FilterSelect(tp,c11000123.synfilter1,1,1,nil,c,lv,g1,g2,g3,g4) tuner1=t1:GetFirst() else tuner1=pe:GetOwner() Group.FromCards(tuner1):Select(tp,1,1,nil) end g:AddCard(tuner1) local lv1=tuner1:GetSynchroLevel(c) local f1=tuner1.tuner_filter local tuner2=nil Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL) if tuner1:IsHasEffect(EFFECT_HAND_SYNCHRO) then local t2=g3:FilterSelect(tp,c11000123.synfilter2,1,1,tuner1,c,lv-lv1,g2,g4,f1,tuner1) tuner2=t2:GetFirst() else local t2=g1:FilterSelect(tp,c11000123.synfilter2,1,1,tuner1,c,lv-lv1,g2,g4,f1,tuner1) tuner2=t2:GetFirst() end g:AddCard(tuner2) local lv2=tuner2:GetSynchroLevel(c) local f2=tuner2.tuner_filter local m3=nil Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL) if (tuner1:IsHasEffect(EFFECT_HAND_SYNCHRO) and not tuner2:IsLocation(LOCATION_HAND)) or tuner2:IsHasEffect(EFFECT_HAND_SYNCHRO) then m3=g4:FilterSelect(tp,c11000123.synfilter3,1,1,nil,c,lv-lv1-lv2,f1,f2,g2) local lv3=m3:GetFirst():GetSynchroLevel(c) if lv-lv1-lv2-lv3>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL) local m4=g2:SelectWithSumEqual(tp,Card.GetSynchroLevel,lv-lv1-lv2-lv3,1,61,c) g:Merge(m4) end else m3=g2:SelectWithSumEqual(tp,Card.GetSynchroLevel,lv-lv1-lv2,1,63,c) end g:Merge(m3) end c:SetMaterial(g) Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO) end function c11000123.rmcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetSummonType()==SUMMON_TYPE_SYNCHRO end function c11000123.rmfilter(c) return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x1F4) and c:IsAbleToRemove() end function c11000123.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c11000123.rmfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,3,nil) end Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,3,tp,LOCATION_DECK+LOCATION_GRAVE) end function c11000123.rmop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint (HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,c11000123.rmfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,3,3,nil) if g:GetCount()<3 then return end Duel.Remove(g,POS_FACEUP,REASON_EFFECT) end function c11000123.negcon(e,tp,eg,ep,ev,re,r,rp) if ep==tp or e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end return not re:GetHandler():IsCode(11000123) and Duel.IsChainNegatable(ev) end function c11000123.negfilter(c) return c:IsSetCard(0x1F4) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() end function c11000123.negcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c11000123.negfilter,tp,LOCATION_HAND,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,c11000123.negfilter,tp,LOCATION_HAND,0,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) end function c11000123.negtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) end end function c11000123.negop(e,tp,eg,ep,ev,re,r,rp) Duel.NegateActivation(ev) if re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end end function c11000123.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousPosition(POS_FACEUP) and not c:IsLocation(LOCATION_DECK) end function c11000123.spfilter(c,e,tp) return c:IsSetCard(0x1F4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c11000123.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c11000123.spfilter,tp,LOCATION_REMOVED,0,2,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_REMOVED) end function c11000123.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,c11000123.spfilter,tp,LOCATION_REMOVED,0,2,2,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end