--Medivatale Scorpionboi local cid,id=GetID() function cid.initial_effect(c) --spsummon limit local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_FIELD) e0:SetRange(LOCATION_MZONE) e0:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e0:SetTargetRange(1,0) e0:SetTarget(cid.sumlimit) c:RegisterEffect(e0) --summon success local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_HAND) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SUMMON_SUCCESS+EFFECT_FLAG_DELAY) e2:SetCountLimit(1,id) e2:SetTarget(cid.sptg) e2:SetOperation(cid.spop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS) c:RegisterEffect(e3) local e4=e2:Clone() e4:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e4) --become material local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e5:SetCode(EVENT_BE_MATERIAL) e5:SetCondition(cid.condition2) e5:SetOperation(cid.operation2) c:RegisterEffect(e5) end function cid.sumlimit(e,c,sump,sumtype,sumpos,targetp,se) return c:IsLocation(LOCATION_EXTRA) and not c:IsSetCard(0xab5) end function cid.filter(c,e,tp) return c:IsSetCard(0xab5) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() end function cid.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) end function cid.spop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,cid.filter,tp,LOCATION_GRAVE,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end function cid.ffilter(c) return c:IsSetCard(0xab5) end function cid.condition2(e,tp,eg,ep,ev,re,r,rp) local ec=e:GetHandler():GetReasonCard() return ec:GetMaterial():IsExists(cid.ffilter,1,nil) and r==REASON_EVOLUTE end function cid.operation2(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local rc=c:GetReasonCard() if Duel.GetFlagEffect(tp,id)~=0 then return end --pierce local e1=Effect.CreateEffect(e:GetHandler()) e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_PIERCE) e1:SetCondition(cid.con) e1:SetReset(RESET_EVENT+RESETS_STANDARD) rc:RegisterEffect(e1,true) local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_PRE_BATTLE_DAMAGE) e2:SetCondition(cid.damcon) e2:SetOperation(cid.damop) e2:SetReset(RESET_EVENT+RESETS_STANDARD) rc:RegisterEffect(e2,true) rc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+0x47e0000,0,1) rc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,0)) Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1) end function cid.con(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetECounter(tp)>=4 end function cid.damcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return ep~=tp and e:GetHandler():GetECounter(tp)>=4 and c==Duel.GetAttacker() and Duel.GetAttackTarget() and Duel.GetAttackTarget():IsDefensePos() end function cid.damop(e,tp,eg,ep,ev,re,r,rp) Duel.ChangeBattleDamage(ep,ev*2) end