--created & coded by Lyris, art generated by Dall-E2 AI --半物質のピクシ local s,id,o=GetID() function s.initial_effect(c) c:EnableReviveLimit() aux.AddOrigSpatialType(c) aux.AddSpatialProc(c,nil,aux.FilterBoolFunction(Card.IsSetCard,0xf87),2,2) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) e1:SetCode(EVENT_REMOVE) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCondition(s.con) e1:SetTarget(s.tg) e1:SetOperation(s.op) c:RegisterEffect(e1) end function s.con(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local rc=c:GetReasonCard() if not rc then if re then rc=re:GetHandler() else rc=c:GetReasonEffect():GetHandler() end end return c:IsReason(REASON_BATTLE) or rp==1-tp or rp==tp and rc and rc:IsSetCard(0xf87) end function s.filter(c,e,tp) return c:IsFaceup() and c:IsSetCard(0xf87) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(id) end function s.tg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_REMOVED,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,tp,LOCATION_REMOVED) end function s.op(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) Duel.SpecialSummon(Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp),0,tp,tp,false,false,POS_FACEUP) end