name: Raider's
card_text: (This card is always treated as a "The Phantom Knights" and "Raidraptor" card.)
  If you Xyz Summon using a DARK Xyz Monster as material: You can target 1 card on the field; destroy it. If this face-up card in the Spell & Trap Zone is destroyed by a card effect: You can Set 1 "Rank-Up-Magic" Spell directly from your Deck or GY. You can only use each effect of "Raider's Unbreakable Mind" once per turn.
external_ids: local SETCARD_ID_0 = 0x95 --Rank-Up-Magic
  
lua: local SETCARD_ID_0 = 0x95 --Rank-Up-Magic
  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)
  	--destroy
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_DESTROY)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_DELAY)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCountLimit(1, id)
  	e2:SetCondition(s.descon)
  	e2:SetTarget(s.destg)
  	e2:SetOperation(s.desop)
  	c:RegisterEffect(e2)
  	--sset
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 1))
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e3:SetCode(EVENT_DESTROYED)
  	e3:SetProperty(EFFECT_FLAG_DELAY)
  	e3:SetCountLimit(1, id + 1)
  	e3:SetCondition(s.ssetcon)
  	e3:SetTarget(s.ssettg)
  	e3:SetOperation(s.ssetop)
  	c:RegisterEffect(e3)
  end
  function s.descfilter2(c)
  	return c:IsType(TYPE_XYZ) and c:IsAttribute(ATTRIBUTE_DARK)
  end
  function s.descfilter(c, tp)
  	return c:IsSummonType(SUMMON_TYPE_XYZ) and c:IsSummonPlayer(tp) and c:GetMaterial():IsExists(s.descfilter2, 1, nil)
  end
  function s.descon(e, tp, eg, ep, ev, re, r, rp)
  	return eg:IsExists(s.descfilter, 1, nil, tp)
  end
  function s.destg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsOnField()
  	end
  	local exg = nil
  	if not e:GetHandler():IsStatus(STATUS_EFFECT_ENABLED) then
  		exg = e:GetHandler()
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(aux.TRUE, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, exg)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  	local g = Duel.SelectTarget(tp, aux.TRUE, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, 1, exg)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, 1, 0, 0)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		Duel.Destroy(tc, REASON_EFFECT)
  	end
  end
  function s.ssetcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsPreviousPosition(POS_FACEUP) and e:GetHandler():IsPreviousLocation(LOCATION_SZONE) and e:GetHandler():IsReason(REASON_EFFECT)
  end
  function s.ssetfilter(c)
  	return c:IsType(TYPE_SPELL) and c:IsSetCard(SETCARD_ID_0) and c:IsSSetable()
  end
  function s.ssettg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.ssetfilter, tp, LOCATION_GRAVE + LOCATION_DECK, 0, 1, nil)
  	end
  end
  function s.ssetop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SET)
  	local g = Duel.SelectMatchingCard(tp, aux.NecroValleyFilter(s.ssetfilter), tp, LOCATION_GRAVE + LOCATION_DECK, 0, 1, 1, nil)
  	if g then
  		Duel.SSet(tp, g)
  	end
  end
  
  
source_text: Raider's
  (This card is always treated as a "The Phantom Knights" and "Raidraptor" card.)
  If you Xyz Summon using a DARK Xyz Monster as material: You can target 1 card on the field; destroy it. If this face-up card in the Spell & Trap Zone is destroyed by a card effect: You can Set 1 "Rank-Up-Magic" Spell directly from your Deck or GY. You can only use each effect of "Raider's Unbreakable Mind" once per turn.
target_text: -- Raider's
  local SETCARD_ID_0 = 0x95 --Rank-Up-Magic
  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)
  	--destroy
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_DESTROY)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_DELAY)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCountLimit(1, id)
  	e2:SetCondition(s.descon)
  	e2:SetTarget(s.destg)
  	e2:SetOperation(s.desop)
  	c:RegisterEffect(e2)
  	--sset
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 1))
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e3:SetCode(EVENT_DESTROYED)
  	e3:SetProperty(EFFECT_FLAG_DELAY)
  	e3:SetCountLimit(1, id + 1)
  	e3:SetCondition(s.ssetcon)
  	e3:SetTarget(s.ssettg)
  	e3:SetOperation(s.ssetop)
  	c:RegisterEffect(e3)
  end
  function s.descfilter2(c)
  	return c:IsType(TYPE_XYZ) and c:IsAttribute(ATTRIBUTE_DARK)
  end
  function s.descfilter(c, tp)
  	return c:IsSummonType(SUMMON_TYPE_XYZ) and c:IsSummonPlayer(tp) and c:GetMaterial():IsExists(s.descfilter2, 1, nil)
  end
  function s.descon(e, tp, eg, ep, ev, re, r, rp)
  	return eg:IsExists(s.descfilter, 1, nil, tp)
  end
  function s.destg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsOnField()
  	end
  	local exg = nil
  	if not e:GetHandler():IsStatus(STATUS_EFFECT_ENABLED) then
  		exg = e:GetHandler()
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(aux.TRUE, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, exg)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  	local g = Duel.SelectTarget(tp, aux.TRUE, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, 1, 1, exg)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, 1, 0, 0)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		Duel.Destroy(tc, REASON_EFFECT)
  	end
  end
  function s.ssetcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsPreviousPosition(POS_FACEUP) and e:GetHandler():IsPreviousLocation(LOCATION_SZONE) and e:GetHandler():IsReason(REASON_EFFECT)
  end
  function s.ssetfilter(c)
  	return c:IsType(TYPE_SPELL) and c:IsSetCard(SETCARD_ID_0) and c:IsSSetable()
  end
  function s.ssettg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.ssetfilter, tp, LOCATION_GRAVE + LOCATION_DECK, 0, 1, nil)
  	end
  end
  function s.ssetop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SET)
  	local g = Duel.SelectMatchingCard(tp, aux.NecroValleyFilter(s.ssetfilter), tp, LOCATION_GRAVE + LOCATION_DECK, 0, 1, 1, nil)
  	if g then
  		Duel.SSet(tp, g)
  	end
  end
  
  