--Pharaohnic Trap Hole local id,cod=23251015,c23251015 function cod.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetTarget(cod.target) e1:SetOperation(cod.activate) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_ACTIVATE) e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS) e2:SetTarget(cod.target) e2:SetOperation(cod.activate) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_ACTIVATE) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetTarget(cod.target2) e3:SetOperation(cod.activate2) c:RegisterEffect(e3) --Act in Hand local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE) e4:SetCode(EFFECT_TRAP_ACT_IN_HAND) e4:SetCondition(cod.handcon) c:RegisterEffect(e4) end function cod.mfilter(c) return c:IsSetCard(0xd3e) and c:IsType(TYPE_MONSTER) end function cod.handcon(e) return Duel.GetMatchingGroup(cod.mfilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil):GetClassCount(Card.GetCode)>=5 end function cod.filter(c,tp,ep) return c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:GetAttack()>=1000 and ep~=tp and c:IsDestructable() end function cod.target(e,tp,eg,ep,ev,re,r,rp,chk) local tc=eg:GetFirst() if chk==0 then return cod.filter(tc,tp,ep) end Duel.SetTargetCard(eg) Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0) end function cod.activate(e,tp,eg,ep,ev,re,r,rp) local tc=eg:GetFirst() if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetAttack()>=1000 then Duel.Destroy(tc,REASON_EFFECT) if Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_GRAVE,0,1,nil,0xd3e) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT+0x17a0000) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT+0x17a0000) tc:RegisterEffect(e2) end end end function cod.filter2(c,tp) return c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:GetAttack()>=1000 and c:GetSummonPlayer()~=tp end function cod.target2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return eg:IsExists(cod.filter2,1,nil,tp) end local g=eg:Filter(cod.filter2,nil,tp) Duel.SetTargetCard(eg) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0) end function cod.filter3(c,e,tp) return c:IsFaceup() and c:GetAttack()>=1000 and c:GetSummonPlayer()~=tp and c:IsRelateToEffect(e) and c:IsLocation(LOCATION_MZONE) end function cod.activate2(e,tp,eg,ep,ev,re,r,rp) local g=eg:Filter(cod.filter3,nil,e,tp) if g:GetCount()>0 then Duel.Destroy(g,REASON_EFFECT) if Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_GRAVE,0,1,nil,0xd3e) then local tc=g:GetFirst() while tc do local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT+0x17a0000) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT+0x17a0000) tc:RegisterEffect(e2) tc=g:GetNext() end end end end