name: Dragonic
card_text: All "True Draco" and "True King" monsters on the field gain 300 ATK/DEF. The first time each Tribute Summoned "True Draco" or "True King" monster would be destroyed by battle each turn, it is not destroyed. Once per turn: You can destroy 1 other card you control or in your hand, and if you do, add 1 "True Draco" or "True King" card from your Deck to your hand.
external_ids: local SETCARD_ID_0 = 0xf9 --True
  
lua: local SETCARD_ID_0 = 0xf9 --True
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--atk&def
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_UPDATE_ATTACK)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetTargetRange(LOCATION_MZONE, LOCATION_MZONE)
  	e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard, SETCARD_ID_0))
  	e2:SetValue(300)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EFFECT_UPDATE_DEFENSE)
  	c:RegisterEffect(e3)
  	--indes
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_FIELD)
  	e4:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
  	e4:SetRange(LOCATION_FZONE)
  	e4:SetTargetRange(LOCATION_MZONE, LOCATION_MZONE)
  	e4:SetTarget(s.indtg)
  	e4:SetValue(s.indct)
  	c:RegisterEffect(e4)
  	--destroy
  	local e5 = Effect.CreateEffect(c)
  	e5:SetDescription(aux.Stringid(id, 0))
  	e5:SetCategory(CATEGORY_DESTROY + CATEGORY_TOHAND + CATEGORY_SEARCH)
  	e5:SetType(EFFECT_TYPE_IGNITION)
  	e5:SetRange(LOCATION_FZONE)
  	e5:SetCountLimit(1)
  	e5:SetTarget(s.destg)
  	e5:SetOperation(s.desop)
  	c:RegisterEffect(e5)
  end
  function s.indtg(e, c)
  	return c:IsSummonType(SUMMON_TYPE_ADVANCE) and c:IsSetCard(SETCARD_ID_0)
  end
  function s.indct(e, re, r, rp)
  	if bit.band(r, REASON_BATTLE) ~= 0 then
  		return 1
  	else
  		return 0
  	end
  end
  function s.thfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsAbleToHand()
  end
  function s.destg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(nil, tp, LOCATION_HAND + LOCATION_ONFIELD, 0, 1, e:GetHandler()) and Duel.IsExistingMatchingCard(s.thfilter, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	local g = Duel.GetMatchingGroup(nil, tp, LOCATION_HAND + LOCATION_ONFIELD, 0, e:GetHandler())
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  	local g = Duel.SelectMatchingCard(tp, nil, tp, LOCATION_HAND + LOCATION_ONFIELD, 0, 1, 1, aux.ExceptThisCard(e))
  	if g:GetCount() > 0 and Duel.Destroy(g, REASON_EFFECT) ~= 0 then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  		local g = Duel.SelectMatchingCard(tp, s.thfilter, tp, LOCATION_DECK, 0, 1, 1, nil)
  		if g:GetCount() > 0 then
  			Duel.SendtoHand(g, nil, REASON_EFFECT)
  			Duel.ConfirmCards(1 - tp, g)
  		end
  	end
  end
  
  
source_text: Dragonic
  All "True Draco" and "True King" monsters on the field gain 300 ATK/DEF. The first time each Tribute Summoned "True Draco" or "True King" monster would be destroyed by battle each turn, it is not destroyed. Once per turn: You can destroy 1 other card you control or in your hand, and if you do, add 1 "True Draco" or "True King" card from your Deck to your hand.
target_text: -- Dragonic
  local SETCARD_ID_0 = 0xf9 --True
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--atk&def
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_UPDATE_ATTACK)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetTargetRange(LOCATION_MZONE, LOCATION_MZONE)
  	e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard, SETCARD_ID_0))
  	e2:SetValue(300)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EFFECT_UPDATE_DEFENSE)
  	c:RegisterEffect(e3)
  	--indes
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_FIELD)
  	e4:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
  	e4:SetRange(LOCATION_FZONE)
  	e4:SetTargetRange(LOCATION_MZONE, LOCATION_MZONE)
  	e4:SetTarget(s.indtg)
  	e4:SetValue(s.indct)
  	c:RegisterEffect(e4)
  	--destroy
  	local e5 = Effect.CreateEffect(c)
  	e5:SetDescription(aux.Stringid(id, 0))
  	e5:SetCategory(CATEGORY_DESTROY + CATEGORY_TOHAND + CATEGORY_SEARCH)
  	e5:SetType(EFFECT_TYPE_IGNITION)
  	e5:SetRange(LOCATION_FZONE)
  	e5:SetCountLimit(1)
  	e5:SetTarget(s.destg)
  	e5:SetOperation(s.desop)
  	c:RegisterEffect(e5)
  end
  function s.indtg(e, c)
  	return c:IsSummonType(SUMMON_TYPE_ADVANCE) and c:IsSetCard(SETCARD_ID_0)
  end
  function s.indct(e, re, r, rp)
  	if bit.band(r, REASON_BATTLE) ~= 0 then
  		return 1
  	else
  		return 0
  	end
  end
  function s.thfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsAbleToHand()
  end
  function s.destg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(nil, tp, LOCATION_HAND + LOCATION_ONFIELD, 0, 1, e:GetHandler()) and Duel.IsExistingMatchingCard(s.thfilter, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	local g = Duel.GetMatchingGroup(nil, tp, LOCATION_HAND + LOCATION_ONFIELD, 0, e:GetHandler())
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, tp, LOCATION_DECK)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  	local g = Duel.SelectMatchingCard(tp, nil, tp, LOCATION_HAND + LOCATION_ONFIELD, 0, 1, 1, aux.ExceptThisCard(e))
  	if g:GetCount() > 0 and Duel.Destroy(g, REASON_EFFECT) ~= 0 then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  		local g = Duel.SelectMatchingCard(tp, s.thfilter, tp, LOCATION_DECK, 0, 1, 1, nil)
  		if g:GetCount() > 0 then
  			Duel.SendtoHand(g, nil, REASON_EFFECT)
  			Duel.ConfirmCards(1 - tp, g)
  		end
  	end
  end
  
  