--created by LionHeartKIng, coded by Lyris --フェイトヒーロー・アンドロウツォン local s,id,o=GetID() function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCountLimit(1,id) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e1:SetCondition(s.fscon) e1:SetTarget(s.fstg) e1:SetOperation(s.fsop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetCategory(CATEGORY_SUMMON) e3:SetTarget(s.nstg) e3:SetOperation(s.nsop) c:RegisterEffect(e3) end function s.fscon(e,tp,eg,ep,ev,re,r,rp) local ph=Duel.GetCurrentPhase() return ph~=PHASE_DAMAGE and ph~=PHASE_DAMAGE_CAL end function s.mfilter(c,e) return not c:IsImmuneToEffect(e) end function s.sfilter(c,e,tp,m,f,chkf) return c:IsType(TYPE_FUSION) and c:IsSetCard(0xa5f) and (not f or f(c)) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,e:GetHandler(),chkf) end function s.fstg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local chkf=tp local mg1=Duel.GetFusionMaterial(tp):Filter(s.mfilter,nil,e) local res=Duel.IsExistingMatchingCard(s.sfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf) if not res then local ce=Duel.GetChainMaterial(tp) if ce~=nil then local fgroup=ce:GetTarget() local mg2=fgroup(ce,e,tp) local mf=ce:GetValue() res=Duel.IsExistingMatchingCard(s.sfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf) end end return res end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function s.fsop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) or c:IsControler(1-tp) then return end local chkf=tp local mg1=Duel.GetFusionMaterial(tp):Filter(s.mfilter,nil,e) local sg1=Duel.GetMatchingGroup(s.sfilter,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf) local mg2=nil local sg2=nil local ce=Duel.GetChainMaterial(tp) if ce~=nil then local fgroup=ce:GetTarget() mg2=fgroup(ce,e,tp) local mf=ce:GetValue() sg2=Duel.GetMatchingGroup(s.sfilter,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf) end if #sg1>0 or (sg2~=nil and #sg2>0) then local sg=sg1:Clone() if sg2 then sg:Merge(sg2) end ::cancel:: Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tc=sg:Select(tp,1,1,nil):GetFirst() if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,c,chkf) if #mat1<2 then goto cancel end tc:SetMaterial(mat1) Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) Duel.BreakEffect() Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP) else local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,c,chkf) if #mat2<2 then goto cancel end local fop=ce:GetOperation() fop(ce,e,tp,tc,mat2) end tc:CompleteProcedure() end end function s.filter(c) return c:IsSetCard(0xa5f) and c:IsSummonable(true,nil) end function s.nstg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsLevelBelow(3) or Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0) end function s.nsop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) or c:IsFacedown() then return end local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_LEVEL) e1:SetValue(1) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE) c:RegisterEffect(e1) Duel.AdjustInstantly() if c:IsLevelBelow(4) then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON) local tc=Duel.SelectMatchingCard(tp,1,nil):GetFirst() if tc then Duel.Summon(tp,tc,true,nil) end end