name: Cyberdark
card_text: This card's name becomes "Cyber Dragon" while on the field or in the GY. If this card is in your hand or GY, and you have another Machine "Cyber" monster in your field or GY: You can send 1 "Cyber Dragon" monster from your hand or Deck to the GY; Special Summon this card, then you can add 1 "Cyber" Spell/Trap from your GY to your hand. You can only use this effect of "Cyberdark Wurm" once per Duel.
external_ids: local CARD_ID_0 = 70095154 --Cyber Dragon
  local SETCARD_ID_0 = 0x93 --Cyber
  local SETCARD_ID_1 = 0x1093 --Cyber
  
lua: local CARD_ID_0 = 70095154 --Cyber Dragon
  local SETCARD_ID_0 = 0x93 --Cyber
  local SETCARD_ID_1 = 0x1093 --Cyber
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.EnableChangeCode(c, CARD_ID_0, LOCATION_MZONE + LOCATION_GRAVE)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 1))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_GRAVE_ACTION)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_HAND + LOCATION_GRAVE)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_DUEL)
  	e1:SetCondition(s.spcon)
  	e1:SetCost(s.spcost)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c)
  	return c:IsFaceupEx() and c:IsSetCard(SETCARD_ID_1) and c:IsRace(RACE_MACHINE) and c:IsType(TYPE_MONSTER)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE + LOCATION_GRAVE, 0, 1, e:GetHandler())
  end
  function s.costfilter(c)
  	return c:IsSetCard(SETCARD_ID_1) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
  end
  function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.costfilter, tp, LOCATION_DECK + LOCATION_HAND, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, s.costfilter, tp, LOCATION_DECK + LOCATION_HAND, 0, 1, 1, nil)
  	Duel.SendtoGrave(g, REASON_COST)
  end
  function s.thfilter(c)
  	return c:IsSetCard(SETCARD_ID_1, 0x94) and c:IsType(TYPE_SPELL + TYPE_TRAP) and c:IsAbleToHand()
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and e:GetHandler():IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, e:GetHandler(), 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) and aux.NecroValleyFilter()(c) and Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP) ~= 0 then
  		local sg = Duel.GetMatchingGroup(aux.NecroValleyFilter(s.thfilter), tp, LOCATION_GRAVE, 0, nil)
  		if sg:GetCount() > 0 and Duel.SelectYesNo(tp, aux.Stringid(id, 2)) then
  			Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  			sg = sg:Select(tp, 1, 1, nil)
  			Duel.BreakEffect()
  			Duel.SendtoHand(sg, nil, REASON_EFFECT)
  			Duel.ConfirmCards(1 - tp, sg)
  		end
  	end
  end
  
  
source_text: Cyberdark
  This card's name becomes "Cyber Dragon" while on the field or in the GY. If this card is in your hand or GY, and you have another Machine "Cyber" monster in your field or GY: You can send 1 "Cyber Dragon" monster from your hand or Deck to the GY; Special Summon this card, then you can add 1 "Cyber" Spell/Trap from your GY to your hand. You can only use this effect of "Cyberdark Wurm" once per Duel.
target_text: -- Cyberdark
  local CARD_ID_0 = 70095154 --Cyber Dragon
  local SETCARD_ID_0 = 0x93 --Cyber
  local SETCARD_ID_1 = 0x1093 --Cyber
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.EnableChangeCode(c, CARD_ID_0, LOCATION_MZONE + LOCATION_GRAVE)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 1))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_GRAVE_ACTION)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_HAND + LOCATION_GRAVE)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_DUEL)
  	e1:SetCondition(s.spcon)
  	e1:SetCost(s.spcost)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c)
  	return c:IsFaceupEx() and c:IsSetCard(SETCARD_ID_1) and c:IsRace(RACE_MACHINE) and c:IsType(TYPE_MONSTER)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE + LOCATION_GRAVE, 0, 1, e:GetHandler())
  end
  function s.costfilter(c)
  	return c:IsSetCard(SETCARD_ID_1) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
  end
  function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.costfilter, tp, LOCATION_DECK + LOCATION_HAND, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, s.costfilter, tp, LOCATION_DECK + LOCATION_HAND, 0, 1, 1, nil)
  	Duel.SendtoGrave(g, REASON_COST)
  end
  function s.thfilter(c)
  	return c:IsSetCard(SETCARD_ID_1, 0x94) and c:IsType(TYPE_SPELL + TYPE_TRAP) and c:IsAbleToHand()
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and e:GetHandler():IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, e:GetHandler(), 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) and aux.NecroValleyFilter()(c) and Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP) ~= 0 then
  		local sg = Duel.GetMatchingGroup(aux.NecroValleyFilter(s.thfilter), tp, LOCATION_GRAVE, 0, nil)
  		if sg:GetCount() > 0 and Duel.SelectYesNo(tp, aux.Stringid(id, 2)) then
  			Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  			sg = sg:Select(tp, 1, 1, nil)
  			Duel.BreakEffect()
  			Duel.SendtoHand(sg, nil, REASON_EFFECT)
  			Duel.ConfirmCards(1 - tp, sg)
  		end
  	end
  end
  
  