--Torii Gate Entrance to the Underworld local cid,id=GetID() function cid.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetOperation(cid.activate) c:RegisterEffect(e1) end function cid.actfilter(c,tp) return c:IsCode(41198608) and c:IsType(TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp,true,true) end function cid.activate(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cid.actfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,tp) if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) local sg=g:Select(tp,1,1,nil) local sc=sg:GetFirst() Duel.MoveToField(sc,tp,tp,LOCATION_FZONE,POS_FACEUP,true) local te=sc:GetActivateEffect() te:UseCountLimit(tp,1,true) local tep=sc:GetControler() local cost=te:GetCost() if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end Duel.RaiseEvent(sc,4179255,te,0,tp,tp,Duel.GetCurrentChain()) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e1:SetRange(LOCATION_FZONE) e1:SetTargetRange(LOCATION_FZONE,LOCATION_FZONE) e1:SetValue(1) e1:SetReset(RESET_EVENT+RESETS_STANDARD) sc:RegisterEffect(e1) end end