--Hybrid Platinum function c11000226.initial_effect(c) --spsummon local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,11000226) e1:SetTarget(c11000226.target) e1:SetOperation(c11000226.operation) c:RegisterEffect(e1) --negate local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(11000226,0)) e2:SetCategory(CATEGORY_NEGATE) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e2:SetCode(EVENT_CHAINING) e2:SetRange(LOCATION_HAND) e2:SetCondition(c11000226.negcon) e2:SetCost(c11000226.negcost) e2:SetTarget(c11000226.negtg) e2:SetOperation(c11000226.negop) c:RegisterEffect(e2) end function c11000226.filter1(c,e) return c:IsLocation(LOCATION_HAND) and not c:IsImmuneToEffect(e) end function c11000226.filter2(c,e,tp,m,f,gc) return c:IsType(TYPE_FUSION) and c:IsSetCard(0x1FA) and (not f or f(c)) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,gc) end function c11000226.target(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then local chkf=tp local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsLocation,nil,LOCATION_HAND) local res=Duel.IsExistingMatchingCard(c11000226.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c,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(c11000226.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,c,chkf) end end return res end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function c11000226.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local chkf=tp if not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) then return end local mg1=Duel.GetFusionMaterial(tp):Filter(c11000226.filter1,nil,e) local sg1=Duel.GetMatchingGroup(c11000226.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c,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(c11000226.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,c,chkf) end if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then local sg=sg1:Clone() if sg2 then sg:Merge(sg2) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tg=sg:Select(tp,1,1,nil) local tc=tg: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) 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) local fop=ce:GetOperation() fop(ce,e,tp,tc,mat2) end tc:CompleteProcedure() end end function c11000226.tgcon(e,tp,eg,ep,ev,re,r,rp) if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) if not g or g:GetCount()~=1 then return false end local tc=g:GetFirst() local c=e:GetHandler() if tc==c or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsLocation(LOCATION_MZONE) or not tc:IsSetCard(0x1FA) then return false end local tf=re:GetTarget() local res,ceg,cep,cev,cre,cr,crp=Duel.CheckEvent(re:GetCode(),true) return tf(re,rp,ceg,cep,cev,cre,cr,crp,0,c) end function c11000226.tgop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() then local g=Group.CreateGroup() g:AddCard(c) Duel.ChangeTargetCard(ev,g) end end function c11000226.tfilter(c,tp) return c:IsFaceup() and c:IsSetCard(0x1FA) and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) end function c11000226.negcon(e,tp,eg,ep,ev,re,r,rp) if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) return g and g:IsExists(c11000226.tfilter,1,nil,tp) and Duel.IsChainNegatable(ev) end function c11000226.negcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsDiscardable() end Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD) end function c11000226.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 c11000226.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