name: Therion
card_text: When your opponent activates a monster effect, while you control a "Therion" monster: You can activate 1 of these effects;
  ● Negate that effect.
  ● Banish that monster.
  If you have "Endless Engine Argyro System" in your GY at activation, you can activate both effects (at resolution, negate, then banish). You can only activate 1 "Therion Cross" per turn.
external_ids: local CARD_ID_0 = 21887075 --Endless Engine Argyro System
  local SETCARD_ID_0 = 0x179 --Therion
  
lua: local CARD_ID_0 = 21887075 --Endless Engine Argyro System
  local SETCARD_ID_0 = 0x179 --Therion
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.confilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return ep == 1 - tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsExistingMatchingCard(s.confilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local rc = re:GetHandler()
  	local b1 = Duel.IsChainDisablable(ev)
  	local b2 = rc:IsRelateToEffect(re) and rc:IsAbleToRemove() and not rc:IsLocation(LOCATION_REMOVED)
  	if chk == 0 then
  		return b1 or b2
  	end
  	local op = 0
  	if b1 and b2 then
  		if Duel.IsExistingMatchingCard(Card.IsCode, tp, LOCATION_GRAVE, 0, 1, nil, CARD_ID_0) then
  			op = Duel.SelectOption(tp, aux.Stringid(id, 1), aux.Stringid(id, 2), aux.Stringid(id, 3))
  		else
  			op = Duel.SelectOption(tp, aux.Stringid(id, 1), aux.Stringid(id, 2))
  		end
  	elseif b1 then
  		op = Duel.SelectOption(tp, aux.Stringid(id, 1))
  	else
  		op = Duel.SelectOption(tp, aux.Stringid(id, 2)) + 1
  	end
  	e:SetLabel(op)
  	if op ~= 0 then
  		if op == 1 then
  			e:SetCategory(CATEGORY_REMOVE)
  		else
  			e:SetCategory(CATEGORY_REMOVE + CATEGORY_DISABLE)
  		end
  		if rc:IsRelateToEffect(re) then
  			Duel.SetOperationInfo(0, CATEGORY_REMOVE, eg, 1, 0, 0)
  		end
  	else
  		e:SetCategory(CATEGORY_DISABLE)
  	end
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local op = e:GetLabel()
  	local res = 0
  	if op ~= 1 then
  		Duel.NegateEffect(ev)
  	end
  	if op ~= 0 then
  		local rc = re:GetHandler()
  		if rc:IsRelateToEffect(re) then
  			Duel.Remove(rc, POS_FACEUP, REASON_EFFECT)
  		end
  	end
  end
  
  
source_text: Therion
  When your opponent activates a monster effect, while you control a "Therion" monster: You can activate 1 of these effects;
  ● Negate that effect.
  ● Banish that monster.
  If you have "Endless Engine Argyro System" in your GY at activation, you can activate both effects (at resolution, negate, then banish). You can only activate 1 "Therion Cross" per turn.
target_text: -- Therion
  local CARD_ID_0 = 21887075 --Endless Engine Argyro System
  local SETCARD_ID_0 = 0x179 --Therion
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.confilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return ep == 1 - tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsExistingMatchingCard(s.confilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local rc = re:GetHandler()
  	local b1 = Duel.IsChainDisablable(ev)
  	local b2 = rc:IsRelateToEffect(re) and rc:IsAbleToRemove() and not rc:IsLocation(LOCATION_REMOVED)
  	if chk == 0 then
  		return b1 or b2
  	end
  	local op = 0
  	if b1 and b2 then
  		if Duel.IsExistingMatchingCard(Card.IsCode, tp, LOCATION_GRAVE, 0, 1, nil, CARD_ID_0) then
  			op = Duel.SelectOption(tp, aux.Stringid(id, 1), aux.Stringid(id, 2), aux.Stringid(id, 3))
  		else
  			op = Duel.SelectOption(tp, aux.Stringid(id, 1), aux.Stringid(id, 2))
  		end
  	elseif b1 then
  		op = Duel.SelectOption(tp, aux.Stringid(id, 1))
  	else
  		op = Duel.SelectOption(tp, aux.Stringid(id, 2)) + 1
  	end
  	e:SetLabel(op)
  	if op ~= 0 then
  		if op == 1 then
  			e:SetCategory(CATEGORY_REMOVE)
  		else
  			e:SetCategory(CATEGORY_REMOVE + CATEGORY_DISABLE)
  		end
  		if rc:IsRelateToEffect(re) then
  			Duel.SetOperationInfo(0, CATEGORY_REMOVE, eg, 1, 0, 0)
  		end
  	else
  		e:SetCategory(CATEGORY_DISABLE)
  	end
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local op = e:GetLabel()
  	local res = 0
  	if op ~= 1 then
  		Duel.NegateEffect(ev)
  	end
  	if op ~= 0 then
  		local rc = re:GetHandler()
  		if rc:IsRelateToEffect(re) then
  			Duel.Remove(rc, POS_FACEUP, REASON_EFFECT)
  		end
  	end
  end
  
  