--E.V.A Authority function c212105.initial_effect(c) --spsummon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(212105,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetRange(LOCATION_HAND) e2:SetCountLimit(1,212105) e2:SetCondition(c212105.spcon) e2:SetTarget(c212105.sptg) e2:SetOperation(c212105.spop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) --control local e4=Effect.CreateEffect(c) e4:SetCategory(CATEGORY_CONTROL) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_MZONE) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetCountLimit(1,212106) e4:SetCost(c212105.cost) e4:SetTarget(c212105.target) e4:SetOperation(c212105.operation) c:RegisterEffect(e4) --special summon local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(212105,1)) e5:SetCategory(CATEGORY_SPECIAL_SUMMON) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e5:SetProperty(EFFECT_FLAG_DELAY) e5:SetCountLimit(1,212107) e5:SetCode(EVENT_DESTROYED) e5:SetCondition(c212105.spcon2) e5:SetTarget(c212105.sptg2) e5:SetOperation(c212105.spop2) c:RegisterEffect(e5) end c212105.lvupcount=1 c212105.lvup={212110} function c212105.cfilter(c,tp) return c:IsFaceup() and c:IsSetCard(0x258) and c:GetSummonPlayer()==tp end function c212105.spcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(c212105.cfilter,1,nil,tp) end function c212105.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function c212105.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end end function c212105.cfilter1(c) return c:IsSetCard(0x258) and c:IsAbleToGraveAsCost() end function c212105.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c212105.cfilter1,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,c212105.cfilter1,1,1,REASON_COST,nil) end function c212105.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsControlerCanBeChanged() end if chk==0 then return Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) local g=Duel.SelectTarget(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0) end function c212105.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.GetControl(tc,tp,PHASE_END,1) end end function c212105.spcon2(e,tp,eg,ep,ev,re,r,rp) return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0 end function c212105.spfilter(c,e,tp) return c:IsCode(212110) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c212105.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c212105.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 c212105.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(c212105.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