--Pharaohnic Colossus local id,cod=23251000,c23251000 function cod.initial_effect(c) c:EnableReviveLimit() --Special Summon local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetRange(LOCATION_HAND) e1:SetCondition(cod.spcon) e1:SetOperation(cod.spop) c:RegisterEffect(e1) --Destroy local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_ATTACK_ANNOUNCE) e2:SetRange(LOCATION_MZONE) e2:SetCondition(cod.descon) e2:SetCost(cod.descost) e2:SetTarget(cod.destg) e2:SetOperation(cod.desop) c:RegisterEffect(e2) --Self Destroy local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetCode(EVENT_PHASE+PHASE_END) e3:SetCondition(cod.sdescon) e3:SetOperation(cod.sdesop) c:RegisterEffect(e3) end function cod.spfilter(c) return c:IsSetCard(0xd3e) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() end function cod.spcon(e,c) if c==nil then return true end local tp=c:GetControler() return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetMatchingGroup(cod.spfilter,tp,LOCATION_GRAVE,0,nil):GetClassCount(Card.GetCode)>=5 end function cod.spop(e,tp,eg,ep,ev,re,r,rp,c) local g=Duel.GetMatchingGroup(cod.spfilter,tp,LOCATION_GRAVE,0,nil) local sg=Group.CreateGroup() for i=1,5 do Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local tc=g:Select(tp,1,1,nil):GetFirst() if tc then sg:AddCard(tc) g:Remove(Card.IsCode,nil,tc:GetCode()) end end Duel.Remove(sg,POS_FACEUP,REASON_COST) end function cod.descon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler() end function cod.descost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD) end function cod.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler()) Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,g:GetCount(),tp,LOCATION_ONFIELD) end function cod.desop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler()) Duel.Destroy(g,REASON_EFFECT) end function cod.sdescon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnPlayer()==tp end function cod.sdesop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() Duel.HintSelection(Group.FromCards(c)) if Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) then Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD) else Duel.Destroy(c,REASON_COST) Duel.Damage(tp,2000,REASON_COST) end end