--Number P257: Booster Rooster function c249001090.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetRange(LOCATION_HAND) e1:SetCondition(c249001090.spcon) c:RegisterEffect(e1) --draw local e2=Effect.CreateEffect(c) e2:SetDescription(1108) e2:SetCategory(CATEGORY_DRAW) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCountLimit(1,2490010901) e2:SetCondition(c249001090.condition) e2:SetTarget(c249001090.target) e2:SetOperation(c249001090.operation) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) local e4=e2:Clone() e4:SetCode(EVENT_FLIP_SUMMON_SUCCESS) c:RegisterEffect(e4) --special summon local e5=Effect.CreateEffect(c) e5:SetDescription(2) e5:SetCategory(CATEGORY_SPECIAL_SUMMON) e5:SetType(EFFECT_TYPE_QUICK_O) e5:SetCode(EVENT_FREE_CHAIN) e5:SetProperty(EFFECT_FLAG_CARD_TARGET) e5:SetCountLimit(1,2490010902) e5:SetRange(LOCATION_HAND) e5:SetTarget(c249001090.sptg2) e5:SetOperation(c249001090.spop2) c:RegisterEffect(e5) end function c249001090.spcon(e,c) if c==nil then return true end return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_MZONE,nil)-Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0,nil)>=2 end function c249001090.filter(c) return not c:IsStatus(STATUS_LEAVE_CONFIRMED) end function c249001090.condition(e,tp,eg,ep,ev,re,r,rp) return not Duel.IsExistingMatchingCard(c249001090.filter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end function c249001090.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function c249001090.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.IsExistingMatchingCard(c249001090.filter,tp,LOCATION_MZONE,0,1,e:GetHandler()) then return end local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) end function c249001090.spfilter(c,e) return c:IsFaceup() and c:IsSetCard(0xC048) and not c:IsImmuneToEffect(e) end function c249001090.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c249001090.spfilter(chkc,e) end if chk==0 then return Duel.IsExistingTarget(c249001090.spfilter,tp,LOCATION_ONFIELD,0,1,nil,e) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,c249001090.spfilter,tp,LOCATION_ONFIELD,0,1,1,nil,e) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function c249001090.spop2(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end if Duel.SendtoHand(tc,nil,REASON_EFFECT) == 0 then return end Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP_DEFENSE) end