name: Dinowrestler
card_text: You can discard 1 other Dinosaur monster; Special Summon this card from your hand. You can Tribute 1 Dinosaur monster, then target 1 "Dinowrestler" monster in your GY with a different original name from the Tributed monster; Special Summon it in Defense Position. You can only use each effect of "Dinowrestler Iguanodraka" once per turn.
external_ids: local SETCARD_ID_0 = 0x11a --Dinowrestler
  
lua: local SETCARD_ID_0 = 0x11a --Dinowrestler
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id)
  	e1:SetCost(s.spcost1)
  	e1:SetTarget(s.sptg1)
  	e1:SetOperation(s.spop1)
  	c:RegisterEffect(e1)
  	--special summon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1, id + 1)
  	e2:SetCost(s.spcost2)
  	e2:SetTarget(s.sptg2)
  	e2:SetOperation(s.spop2)
  	c:RegisterEffect(e2)
  end
  function s.costfilter1(c)
  	return c:IsRace(RACE_DINOSAUR) and c:IsDiscardable()
  end
  function s.spcost1(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.costfilter1, tp, LOCATION_HAND, 0, 1, e:GetHandler())
  	end
  	Duel.DiscardHand(tp, s.costfilter1, 1, 1, REASON_COST + REASON_DISCARD, e:GetHandler())
  end
  function s.sptg1(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.spop1(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) then
  		Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  function s.costfilter2(c, e, tp)
  	return c:IsRace(RACE_DINOSAUR) and Duel.GetMZoneCount(tp, c) > 0 and Duel.IsExistingTarget(s.spfilter, tp, LOCATION_GRAVE, 0, 1, nil, e, tp, c)
  end
  function s.spfilter(c, e, tp, mc)
  	return c:IsSetCard(SETCARD_ID_0) and not c:IsOriginalCodeRule(mc:GetOriginalCodeRule()) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEUP_DEFENSE)
  end
  function s.spcost2(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckReleaseGroup(tp, s.costfilter2, 1, nil, e, tp)
  	end
  	local g = Duel.SelectReleaseGroup(tp, s.costfilter2, 1, 1, nil, e, tp)
  	e:SetLabelObject(g:GetFirst())
  	Duel.Release(g, REASON_COST)
  end
  function s.sptg2(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	local mc = e:GetLabelObject()
  	if chkc then
  		return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.spfilter(chkc, e, tp, mc)
  	end
  	if chk == 0 then
  		return true
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectTarget(tp, s.spfilter, tp, LOCATION_GRAVE, 0, 1, 1, nil, e, tp, mc)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, g, 1, 0, 0)
  end
  function s.spop2(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		Duel.SpecialSummon(tc, 0, tp, tp, false, false, POS_FACEUP_DEFENSE)
  	end
  end
  
  
source_text: Dinowrestler
  You can discard 1 other Dinosaur monster; Special Summon this card from your hand. You can Tribute 1 Dinosaur monster, then target 1 "Dinowrestler" monster in your GY with a different original name from the Tributed monster; Special Summon it in Defense Position. You can only use each effect of "Dinowrestler Iguanodraka" once per turn.
target_text: -- Dinowrestler
  local SETCARD_ID_0 = 0x11a --Dinowrestler
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id)
  	e1:SetCost(s.spcost1)
  	e1:SetTarget(s.sptg1)
  	e1:SetOperation(s.spop1)
  	c:RegisterEffect(e1)
  	--special summon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1, id + 1)
  	e2:SetCost(s.spcost2)
  	e2:SetTarget(s.sptg2)
  	e2:SetOperation(s.spop2)
  	c:RegisterEffect(e2)
  end
  function s.costfilter1(c)
  	return c:IsRace(RACE_DINOSAUR) and c:IsDiscardable()
  end
  function s.spcost1(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.costfilter1, tp, LOCATION_HAND, 0, 1, e:GetHandler())
  	end
  	Duel.DiscardHand(tp, s.costfilter1, 1, 1, REASON_COST + REASON_DISCARD, e:GetHandler())
  end
  function s.sptg1(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.spop1(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) then
  		Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  function s.costfilter2(c, e, tp)
  	return c:IsRace(RACE_DINOSAUR) and Duel.GetMZoneCount(tp, c) > 0 and Duel.IsExistingTarget(s.spfilter, tp, LOCATION_GRAVE, 0, 1, nil, e, tp, c)
  end
  function s.spfilter(c, e, tp, mc)
  	return c:IsSetCard(SETCARD_ID_0) and not c:IsOriginalCodeRule(mc:GetOriginalCodeRule()) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEUP_DEFENSE)
  end
  function s.spcost2(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckReleaseGroup(tp, s.costfilter2, 1, nil, e, tp)
  	end
  	local g = Duel.SelectReleaseGroup(tp, s.costfilter2, 1, 1, nil, e, tp)
  	e:SetLabelObject(g:GetFirst())
  	Duel.Release(g, REASON_COST)
  end
  function s.sptg2(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	local mc = e:GetLabelObject()
  	if chkc then
  		return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.spfilter(chkc, e, tp, mc)
  	end
  	if chk == 0 then
  		return true
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectTarget(tp, s.spfilter, tp, LOCATION_GRAVE, 0, 1, 1, nil, e, tp, mc)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, g, 1, 0, 0)
  end
  function s.spop2(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		Duel.SpecialSummon(tc, 0, tp, tp, false, false, POS_FACEUP_DEFENSE)
  	end
  end
  
  