name: Dinomist
card_text: Pendulum Scale = 6
  [ Pendulum Effect ]
  Once, while this card is in your Pendulum Zone, you can negate an activated card effect that targets another "Dinomist" card(s) you control, then destroy this card.
  ----------------------------------------
  [ Monster Effect ]
  If you do not control "Dinomist Brachion" in your Monster Zone and your opponent controls a monster that has the highest ATK on the field (even if it's tied), you can Special Summon this card (from your hand).
external_ids: local SETCARD_ID_0 = 0xd8 --Dinomist
  
lua: local SETCARD_ID_0 = 0xd8 --Dinomist
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--pendulum summon
  	aux.EnablePendulumAttribute(c)
  	--disable
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_DISABLE)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetCode(EVENT_CHAIN_SOLVING)
  	e2:SetRange(LOCATION_PZONE)
  	e2:SetCondition(s.negcon)
  	e2:SetOperation(s.negop)
  	c:RegisterEffect(e2)
  	--special summon
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(EFFECT_SPSUMMON_PROC)
  	e3:SetProperty(EFFECT_FLAG_UNCOPYABLE)
  	e3:SetRange(LOCATION_HAND)
  	e3:SetCondition(s.spcon)
  	c:RegisterEffect(e3)
  end
  function s.tfilter(c, tp)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:IsControler(tp) and c:IsOnField()
  end
  function s.negcon(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetChainInfo(ev, CHAININFO_TARGET_CARDS)
  	return e:GetHandler():GetFlagEffect(id) == 0
  		and re:IsHasProperty(EFFECT_FLAG_CARD_TARGET)
  		and g
  		and g:IsExists(s.tfilter, 1, e:GetHandler(), tp)
  		and Duel.IsChainDisablable(ev)
  		and not Duel.IsChainDisabled(ev)
  end
  function s.negop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.SelectEffectYesNo(tp, e:GetHandler()) then
  		e:GetHandler():RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 1)
  		if Duel.NegateEffect(ev) then
  			Duel.BreakEffect()
  			Duel.Destroy(e:GetHandler(), REASON_EFFECT)
  		end
  	end
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsCode(id)
  end
  function s.spcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	local g = Duel.GetMatchingGroup(Card.IsFaceup, tp, LOCATION_MZONE, LOCATION_MZONE, nil)
  	if g:GetCount() == 0 then
  		return false
  	end
  	local tg = g:GetMaxGroup(Card.GetAttack)
  	return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and not Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil) and tg:IsExists(Card.IsControler, 1, nil, 1 - tp)
  end
  
  
source_text: Dinomist
  Pendulum Scale = 6
  [ Pendulum Effect ]
  Once, while this card is in your Pendulum Zone, you can negate an activated card effect that targets another "Dinomist" card(s) you control, then destroy this card.
  ----------------------------------------
  [ Monster Effect ]
  If you do not control "Dinomist Brachion" in your Monster Zone and your opponent controls a monster that has the highest ATK on the field (even if it's tied), you can Special Summon this card (from your hand).
target_text: -- Dinomist
  local SETCARD_ID_0 = 0xd8 --Dinomist
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--pendulum summon
  	aux.EnablePendulumAttribute(c)
  	--disable
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_DISABLE)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetCode(EVENT_CHAIN_SOLVING)
  	e2:SetRange(LOCATION_PZONE)
  	e2:SetCondition(s.negcon)
  	e2:SetOperation(s.negop)
  	c:RegisterEffect(e2)
  	--special summon
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(EFFECT_SPSUMMON_PROC)
  	e3:SetProperty(EFFECT_FLAG_UNCOPYABLE)
  	e3:SetRange(LOCATION_HAND)
  	e3:SetCondition(s.spcon)
  	c:RegisterEffect(e3)
  end
  function s.tfilter(c, tp)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:IsControler(tp) and c:IsOnField()
  end
  function s.negcon(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetChainInfo(ev, CHAININFO_TARGET_CARDS)
  	return e:GetHandler():GetFlagEffect(id) == 0
  		and re:IsHasProperty(EFFECT_FLAG_CARD_TARGET)
  		and g
  		and g:IsExists(s.tfilter, 1, e:GetHandler(), tp)
  		and Duel.IsChainDisablable(ev)
  		and not Duel.IsChainDisabled(ev)
  end
  function s.negop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.SelectEffectYesNo(tp, e:GetHandler()) then
  		e:GetHandler():RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 1)
  		if Duel.NegateEffect(ev) then
  			Duel.BreakEffect()
  			Duel.Destroy(e:GetHandler(), REASON_EFFECT)
  		end
  	end
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsCode(id)
  end
  function s.spcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	local g = Duel.GetMatchingGroup(Card.IsFaceup, tp, LOCATION_MZONE, LOCATION_MZONE, nil)
  	if g:GetCount() == 0 then
  		return false
  	end
  	local tg = g:GetMaxGroup(Card.GetAttack)
  	return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and not Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil) and tg:IsExists(Card.IsControler, 1, nil, 1 - tp)
  end
  
  