--E.V.A Abomination function c212115.initial_effect(c) --atk/def local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(212115,0)) e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE+CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) e1:SetRange(LOCATION_HAND) e1:SetHintTiming(TIMING_DAMAGE_STEP) e1:SetCountLimit(1,212115) e1:SetCondition(c212115.atkcon) e1:SetCost(c212115.atkcost) e1:SetTarget(c212115.atktg) e1:SetOperation(c212115.atkop) c:RegisterEffect(e1) --special summon local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(212115,1)) e5:SetCategory(CATEGORY_SPECIAL_SUMMON) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e5:SetProperty(EFFECT_FLAG_DELAY) e5:SetCountLimit(1,212116) e5:SetCode(EVENT_DESTROYED) e5:SetCondition(c212115.spcon2) e5:SetTarget(c212115.sptg2) e5:SetOperation(c212115.spop2) c:RegisterEffect(e5) end c212115.lvupcount=1 c212115.lvup={212105} function c212115.atkcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated() end function c212115.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsDiscardable() end Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD) end function c212115.atkfilter(c,e,tp) return c:IsFaceup() and c:IsSetCard(0x258) and Duel.IsExistingMatchingCard(c212115.desfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,1,Group.FromCards(c,e:GetHandler())) end function c212115.desfilter(c) return c:IsSetCard(0x258) and (c:GetBaseAttack()>0 or c:GetBaseDefense()>0) end function c212115.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c212115.atkfilter(chkc,e,tp) end if chk==0 then return Duel.IsExistingTarget(c212115.atkfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,c212115.atkfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_MZONE+LOCATION_HAND) end function c212115.atkop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local dc=Duel.SelectMatchingCard(tp,c212115.desfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,1,1,tc):GetFirst() if dc and Duel.Destroy(dc,REASON_EFFECT)~=0 then if tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end local atk=dc:GetBaseAttack() local def=dc:GetBaseDefense() if atk<0 then atk=0 end if def<0 then def=0 end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(atk) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) e2:SetValue(def) tc:RegisterEffect(e2) end end function c212115.spcon2(e,tp,eg,ep,ev,re,r,rp) return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0 end function c212115.spfilter(c,e,tp) return c:IsCode(212105) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c212115.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c212115.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE) end function c212115.spop2(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c212115.spfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end