--created & coded by Lyris, art from Yu-Gi-Oh! Duel Monsters Episode 174 --インライトメント・アルティマ エルマ local s,id,o=GetID() function s.initial_effect(c) c:EnableReviveLimit() aux.AddCodeList(c,id-9) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) e2:SetRange(LOCATION_HAND) e2:SetCondition(s.spcon) e2:SetOperation(s.spop) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetCode(EVENT_BATTLED) e3:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DESTROY) e3:SetDescription(1113) e3:SetTarget(s.destg) e3:SetOperation(s.desop) c:RegisterEffect(e3) c:SetUniqueOnField(1,0,aux.FilterBoolFunction(Card.IsSetCard,0x1da6),LOCATION_MZONE) end function s.spfilter(c) return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xda6) and c:IsAbleToGraveAsCost() end function s.cfilter(c,tp) return c:IsCode(id-9) and Duel.GetMZoneCount(tp,c)>0 end function s.spcon(e,c) if c==nil then return true end local tp=c:GetControler() return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,c) and Duel.CheckReleaseGroup(tp,s.cfilter,1,nil,tp) end function s.spop(e,tp,eg,ep,ev,re,r,rp,c) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,c) local rg=Duel.SelectReleaseGroup(tp,s.cfilter,1,1,nil) Duel.SendtoGrave(g,REASON_COST) Duel.Release(rg,REASON_COST) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) local dir=Duel.GetAttackTarget()==nil if chk==0 then return true end if dir then local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,#sg,0,0) end end function s.desop(e,tp,eg,ep,ev,re,r,rp) local dir=Duel.GetAttackTarget()==nil local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetProperty(EFFECT_FLAG_COPY_INHERIT) e1:SetValue(1000) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE) c:RegisterEffect(e1) end if dir then Duel.SendtoGrave(Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil),REASON_EFFECT) end end