function c160005011.initial_effect(c) --synchro summon aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1) c:EnableReviveLimit() --synchro summon success local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(160005011,0)) e1:SetCategory(CATEGORY_DRAW) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(c160005011.drcon) e1:SetTarget(c160005011.drtarg) e1:SetOperation(c160005011.drop) c:RegisterEffect(e1) --special summon local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(160005011,3)) e4:SetCategory(CATEGORY_SPECIAL_SUMMON) --e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetCountLimit(1) e4:SetRange(LOCATION_MZONE) e4:SetTarget(c160005011.sptg2) e4:SetOperation(c160005011.spop2) c:RegisterEffect(e4) end function c160005011.drcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) end function c160005011.drtarg(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 c160005011.drop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) if Duel.Draw(p,d,REASON_EFFECT)~=0 then local tc=Duel.GetOperatedGroup():GetFirst() Duel.ConfirmCards(1-tp,tc) Duel.BreakEffect() if tc:IsType(TYPE_MONSTER) and tc:IsSetCard(0x485a) then if tc:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(160005011,2)) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end else Duel.SendtoGrave(tc,REASON_EFFECT) end Duel.ShuffleHand(tp) end end function c160005011.xfilter(c,e,tp) return c:IsRace(RACE_FIEND)and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c160005011.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return chkc:IsLocation(LOCATION_HAND) and chkc:IsControler(tp) and c160005011.xfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and not c:IsType(TYPE_TUNER) and Duel.IsExistingTarget(c160005011.xfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,c160005011.xfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function c160005011.spop2(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_ADD_TYPE) e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetValue(TYPE_TUNER) c:RegisterEffect(e1) end end