--VIATRIX: Piattaforma di Caricamento --Script by XGlitchy30 function c1020100.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(1020100,0)) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,1020100+EFFECT_COUNT_CODE_OATH) e1:SetCost(c1020100.cost) e1:SetTarget(c1020100.target) e1:SetOperation(c1020100.activate) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(1020100,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetCountLimit(1) e2:SetRange(LOCATION_SZONE) e2:SetTarget(c1020100.sptg) e2:SetOperation(c1020100.spop) c:RegisterEffect(e2) end --filters function c1020100.costfilter(c) return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x39c) end function c1020100.thfilter(c) return c:IsSetCard(0x39c) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand() end function c1020100.spfilter(c,e,tp) return c:IsSetCard(0x39c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end --Activate function c1020100.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroup(tp,c1020100.costfilter,1,nil) end local cg=Duel.SelectReleaseGroup(tp,c1020100.costfilter,1,1,nil) Duel.Release(cg,REASON_COST) end function c1020100.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local g=Duel.GetMatchingGroup(c1020100.thfilter,tp,LOCATION_DECK,0,nil) return g:GetClassCount(Card.GetCode)>=2 end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK) end function c1020100.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(c1020100.thfilter,tp,LOCATION_DECK,0,nil) if g:GetClassCount(Card.GetCode)>=2 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g1=g:Select(tp,1,1,nil) g:Remove(Card.IsCode,nil,g1:GetFirst():GetCode()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g2=g:Select(tp,1,1,nil) g1:Merge(g2) Duel.SendtoHand(g1,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g1) end end --spsummon function c1020100.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c1020100.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function c1020100.spop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c1020100.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