--Medivatale Alice local cid,id=GetID() local ref=_G['c'..id] function cid.initial_effect(c) aux.AddOrigPandemoniumType(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) --Activate by targeting 3 of your Banished cards; Shuffle them into the Deck. When a "Medivatale" Evolute Monster(s) is Special Summoned: You can inflict Damage to your opponent equal to their E-C x100, then destroy this card. You can only use each effect of "Medivatale Alice" once per turn. --Activate local p1=Effect.CreateEffect(c) p1:SetType(EFFECT_TYPE_ACTIVATE+EFFECT_TYPE_QUICK_O) p1:SetCode(EVENT_FREE_CHAIN) p1:SetCondition(aux.PandActCheck) p1:SetTarget(cid.target) p1:SetOperation(cid.activate) c:RegisterEffect(p1) --reduce local p3=Effect.CreateEffect(c) p3:SetDescription(aux.Stringid(id,0)) p3:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DAMAGE) p3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) p3:SetCode(EVENT_SPSUMMON_SUCCESS) p3:SetRange(LOCATION_SZONE) p3:SetCountLimit(1,id+100) p3:SetCondition(cid.condition2) p3:SetTarget(cid.target2) p3:SetOperation(cid.operation2) c:RegisterEffect(p3) aux.EnablePandemoniumAttribute(c,p2) --MONSTER EFFECTO --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCountLimit(1,id+200) e1:SetCost(cid.spcost) e1:SetTarget(cid.sptg) e1:SetOperation(cid.spop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) local e3=e1:Clone() e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS) c:RegisterEffect(e3) Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,cid.counterfilter) --gain local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e4:SetCode(EVENT_BE_MATERIAL) e4:SetCondition(cid.mtcon) e4:SetOperation(cid.mtop) c:RegisterEffect(e4) end function cid.sumlimit(e,c,sump,sumtype,sumpos,targetp,se) return c:IsLocation(LOCATION_EXTRA) and not c:IsSetCard(0xab5) end function cid.counterfilter(c) return c:GetSummonLocation()~=LOCATION_EXTRA or c:IsSetCard(0xab5) end function cid.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,LOCATION_REMOVED,0,3,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_REMOVED,0,3,3,nil) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0) end function cid.activate(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=3 then return end Duel.SendtoDeck(tg,nil,0,REASON_EFFECT) local g=Duel.GetOperatedGroup() if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end end function cid.gfilter(c,tp) return c:IsSetCard(0xab5) and c:GetStage()>0 and c:GetSummonPlayer()==tp end function cid.condition2(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(cid.gfilter,1,nil,tp) end function cid.target2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0) end function cid.operation2(e,tp,eg,ep,ev,re,r,rp) local tc=eg:GetFirst() if tc:IsFaceup() and tc:IsLocation(LOCATION_MZONE) and not tc:IsImmuneToEffect(e) then Duel.Damage(1-tp,tc:GetStage()*100,REASON_EFFECT) end end function cid.spfilter(c,e,tp) return c:IsSetCard(0xab5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function cid.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetTargetRange(1,0) e1:SetTarget(cid.splimit) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) end function cid.splimit(e,c,sump,sumtype,sumpos,targetp) return c:IsLocation(LOCATION_EXTRA) and not c:IsSetCard(0xab5) end function cid.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133) and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and Duel.IsExistingMatchingCard(cid.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,2,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_GRAVE) end function cid.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=1 then return end local g=Duel.GetMatchingGroup(cid.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp) if g:GetCount()<2 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:Select(tp,2,2,nil) Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) end function cid.ffilter(c) return c:IsSetCard(0xab5) end function cid.mtcon(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.mtop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetFlagEffect(tp,id)~=0 then return end Duel.Hint(HINT_CARD,0,id) local c=e:GetHandler() local rc=c:GetReasonCard() --gain ATK local e2=Effect.CreateEffect(e:GetHandler()) e2:SetProperty(EFFECT_FLAG_CLIENT_HINT) e2:SetDescription(aux.Stringid(id,3)) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetRange(LOCATION_MZONE) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetValue(cid.atkval) rc:RegisterEffect(e2,true) if not rc:IsType(TYPE_EFFECT) then local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_ADD_TYPE) e2:SetValue(TYPE_EFFECT) e2:SetReset(RESET_EVENT+RESETS_STANDARD) rc:RegisterEffect(e2,true) rc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+0x47e0000,0,1) end 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.atkval(e,c) return Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_MZONE)*500 end