--ParaDrakO function c50031607.initial_effect(c) --battle destroyed local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(50031607,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_DESTROYED) e1:SetTarget(c50031607.target) e1:SetOperation(c50031607.operation) c:RegisterEffect(e1) --become material local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EVENT_BE_MATERIAL) e2:SetCondition(c50031607.condition2) e2:SetOperation(c50031607.operation2) c:RegisterEffect(e2) end function c50031607.filter(c,e,tp) return c:IsCode(50031607) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c50031607.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c50031607.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function c50031607.operation(e,tp,eg,ep,ev,re,r,rp) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if ft<=0 then return end if ft>=2 then ft=2 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c50031607.filter,tp,LOCATION_DECK,0,1,ft,nil,e,tp) if g:GetCount()>0 then local t1=g:GetFirst() local t2=g:GetNext() Duel.SpecialSummonStep(t1,0,tp,tp,false,false,POS_FACEUP) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_ATTACK) e1:SetValue(0) e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) t1:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_SET_DEFENSE) t1:RegisterEffect(e2) if t2 then Duel.SpecialSummonStep(t2,0,tp,tp,false,false,POS_FACEUP) local e3=e1:Clone() t2:RegisterEffect(e3) local e4=e2:Clone() t2:RegisterEffect(e4) end Duel.SpecialSummonComplete() end end function c50031607.condition(e,tp,eg,ep,ev,re,r,rp) return r== REASON_EVOLUTE ~=0 end function c50031607.operation2(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local rc=c:GetReasonCard() --draw local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(aux.Stringid(50031607,2)) e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_BATTLE_DESTROYING) e1:SetCountLimit(1;50031607) e1:SetOperation(c50031607.drawop) e1:SetReset(RESET_EVENT+0x1fe0000) rc:RegisterEffect(e1,true) rc:RegisterFlagEffect(50031607,RESET_EVENT+0x1fe0000,0,1) end function c50031607.drawop(e,tp,eg,ep,ev,re,r,rp) Duel.Draw(tp,1,REASON_EFFECT) end