name: D/D
card_text: Pendulum Scale = 1
  [ Pendulum Effect ]
  You cannot Pendulum Summon monsters, except "D/D" monsters. This effect cannot be negated. Once, while this card is in your Pendulum Zone, you can negate an activated Spell effect that would inflict damage to you, then destroy this card.
  ----------------------------------------
  [ Monster Effect ]
  If this card is Normal or Special Summoned: You can send 1 "D/D" or "Dark Contract" card from your Deck to the GY, except "D/D Savant Copernicus". You can only use this effect of "D/D Savant Copernicus" once per turn.
external_ids: local SETCARD_ID_0 = 0xaf --D/D
  
lua: local SETCARD_ID_0 = 0xaf --D/D
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--pendulum summon
  	aux.EnablePendulumAttribute(c)
  	--splimit
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetRange(LOCATION_PZONE)
  	e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_CAN_FORBIDDEN)
  	e1:SetTargetRange(1, 0)
  	e1:SetTarget(s.splimit)
  	c:RegisterEffect(e1)
  	--disable
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetRange(LOCATION_PZONE)
  	e2:SetCode(EVENT_CHAIN_SOLVING)
  	e2:SetCondition(s.discon)
  	e2:SetOperation(s.disop)
  	c:RegisterEffect(e2)
  	--send to grave
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 0))
  	e3:SetCategory(CATEGORY_TOGRAVE)
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e3:SetProperty(EFFECT_FLAG_DELAY)
  	e3:SetCode(EVENT_SUMMON_SUCCESS)
  	e3:SetCountLimit(1, id)
  	e3:SetTarget(s.tgtg)
  	e3:SetOperation(s.tgop)
  	c:RegisterEffect(e3)
  	local e4 = e3:Clone()
  	e4:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e4)
  end
  function s.splimit(e, c, sump, sumtype, sumpos, targetp)
  	return not c:IsSetCard(SETCARD_ID_0) and bit.band(sumtype, SUMMON_TYPE_PENDULUM) == SUMMON_TYPE_PENDULUM
  end
  function s.discon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsChainNegatable(ev) and not Duel.IsChainDisabled(ev) and re:IsActiveType(TYPE_SPELL) and aux.damcon1(e, tp, eg, ep, ev, re, r, rp) and e:GetHandler():GetFlagEffect(id) == 0
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	if not Duel.SelectEffectYesNo(tp, e:GetHandler()) then
  		return
  	end
  	e:GetHandler():RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 1)
  	if not Duel.NegateEffect(ev) then
  		return
  	end
  	Duel.BreakEffect()
  	Duel.Destroy(e:GetHandler(), REASON_EFFECT)
  end
  function s.tgfilter(c)
  	return c:IsSetCard(SETCARD_ID_0, 0xae) and not c:IsCode(id) and c:IsAbleToGrave()
  end
  function s.tgtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.tgfilter, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, nil, 1, tp, LOCATION_DECK)
  end
  function s.tgop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, s.tgfilter, tp, LOCATION_DECK, 0, 1, 1, nil)
  	if g:GetCount() > 0 then
  		Duel.SendtoGrave(g, REASON_EFFECT)
  	end
  end
  
  
source_text: D/D
  Pendulum Scale = 1
  [ Pendulum Effect ]
  You cannot Pendulum Summon monsters, except "D/D" monsters. This effect cannot be negated. Once, while this card is in your Pendulum Zone, you can negate an activated Spell effect that would inflict damage to you, then destroy this card.
  ----------------------------------------
  [ Monster Effect ]
  If this card is Normal or Special Summoned: You can send 1 "D/D" or "Dark Contract" card from your Deck to the GY, except "D/D Savant Copernicus". You can only use this effect of "D/D Savant Copernicus" once per turn.
target_text: -- D/D
  local SETCARD_ID_0 = 0xaf --D/D
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--pendulum summon
  	aux.EnablePendulumAttribute(c)
  	--splimit
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetRange(LOCATION_PZONE)
  	e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_CAN_FORBIDDEN)
  	e1:SetTargetRange(1, 0)
  	e1:SetTarget(s.splimit)
  	c:RegisterEffect(e1)
  	--disable
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetRange(LOCATION_PZONE)
  	e2:SetCode(EVENT_CHAIN_SOLVING)
  	e2:SetCondition(s.discon)
  	e2:SetOperation(s.disop)
  	c:RegisterEffect(e2)
  	--send to grave
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 0))
  	e3:SetCategory(CATEGORY_TOGRAVE)
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e3:SetProperty(EFFECT_FLAG_DELAY)
  	e3:SetCode(EVENT_SUMMON_SUCCESS)
  	e3:SetCountLimit(1, id)
  	e3:SetTarget(s.tgtg)
  	e3:SetOperation(s.tgop)
  	c:RegisterEffect(e3)
  	local e4 = e3:Clone()
  	e4:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e4)
  end
  function s.splimit(e, c, sump, sumtype, sumpos, targetp)
  	return not c:IsSetCard(SETCARD_ID_0) and bit.band(sumtype, SUMMON_TYPE_PENDULUM) == SUMMON_TYPE_PENDULUM
  end
  function s.discon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsChainNegatable(ev) and not Duel.IsChainDisabled(ev) and re:IsActiveType(TYPE_SPELL) and aux.damcon1(e, tp, eg, ep, ev, re, r, rp) and e:GetHandler():GetFlagEffect(id) == 0
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	if not Duel.SelectEffectYesNo(tp, e:GetHandler()) then
  		return
  	end
  	e:GetHandler():RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 1)
  	if not Duel.NegateEffect(ev) then
  		return
  	end
  	Duel.BreakEffect()
  	Duel.Destroy(e:GetHandler(), REASON_EFFECT)
  end
  function s.tgfilter(c)
  	return c:IsSetCard(SETCARD_ID_0, 0xae) and not c:IsCode(id) and c:IsAbleToGrave()
  end
  function s.tgtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.tgfilter, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, nil, 1, tp, LOCATION_DECK)
  end
  function s.tgop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, s.tgfilter, tp, LOCATION_DECK, 0, 1, 1, nil)
  	if g:GetCount() > 0 then
  		Duel.SendtoGrave(g, REASON_EFFECT)
  	end
  end
  
  