name: Fist
card_text: This card's activation and effect cannot be negated. If you control a monster whose original name is "Obelisk the Tormentor": Negate the effects of 1 Effect Monster your opponent controls, and if you do, destroy it, and if you do that, for the rest of this turn, the effects of that monster are negated, as well as the activated effects and effects on the field of monsters with the same original name, then, if you activated this card during your Main Phase, you can apply this effect.
  ● Destroy all Spells and Traps your opponent controls.
  You can only activate 1 "Fist of Fate" per turn.
external_ids: local CARD_ID_0 = 10000000 --Obelisk the Tormentor
  
lua: local CARD_ID_0 = 10000000 --Obelisk the Tormentor
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DESTROY + CATEGORY_DISABLE)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_CAN_FORBIDDEN)
  	e1:SetHintTiming(0, TIMINGS_CHECK_MONSTER)
  	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.actfilter(c)
  	return c:IsFaceup() and c:IsOriginalCodeRule(10000000)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.actfilter, e:GetHandlerPlayer(), LOCATION_MZONE, 0, 1, nil)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(aux.NegateEffectMonsterFilter, tp, 0, LOCATION_MZONE, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DISABLE, nil, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, nil, 1, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DISABLE)
  	local g = Duel.SelectMatchingCard(tp, aux.NegateEffectMonsterFilter, tp, 0, LOCATION_MZONE, 1, 1, nil)
  	if g:GetCount() > 0 then
  		local tc = g:GetFirst()
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetCode(EFFECT_DISABLE)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e1)
  		local e2 = Effect.CreateEffect(e:GetHandler())
  		e2:SetType(EFFECT_TYPE_SINGLE)
  		e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e2:SetCode(EFFECT_DISABLE_EFFECT)
  		e2:SetValue(RESET_TURN_SET)
  		e2:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e2)
  		Duel.AdjustInstantly()
  		Duel.NegateRelatedChain(tc, RESET_TURN_SET)
  		if Duel.Destroy(tc, REASON_EFFECT) ~= 0 then
  			local e3 = Effect.CreateEffect(e:GetHandler())
  			e3:SetType(EFFECT_TYPE_FIELD)
  			e3:SetCode(EFFECT_DISABLE)
  			e3:SetTargetRange(LOCATION_MZONE, LOCATION_MZONE)
  			e3:SetTarget(s.distg)
  			e3:SetLabelObject(tc)
  			e3:SetReset(RESET_PHASE + PHASE_END)
  			Duel.RegisterEffect(e3, tp)
  			local e4 = Effect.CreateEffect(e:GetHandler())
  			e4:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  			e4:SetCode(EVENT_CHAIN_SOLVING)
  			e4:SetCondition(s.discon)
  			e4:SetOperation(s.disop)
  			e4:SetLabelObject(tc)
  			e4:SetReset(RESET_PHASE + PHASE_END)
  			Duel.RegisterEffect(e4, tp)
  			local sg = Duel.GetMatchingGroup(s.desfilter, tp, 0, LOCATION_ONFIELD, nil)
  			if #sg > 0 and Duel.GetTurnPlayer() == tp and (Duel.GetCurrentPhase() == PHASE_MAIN1 or Duel.GetCurrentPhase() == PHASE_MAIN2) and Duel.SelectYesNo(tp, aux.Stringid(id, 0)) then
  				Duel.BreakEffect()
  				Duel.Destroy(sg, REASON_EFFECT)
  			end
  		end
  	end
  end
  function s.desfilter(c)
  	return c:IsType(TYPE_SPELL + TYPE_TRAP)
  end
  function s.distg(e, c)
  	local tc = e:GetLabelObject()
  	return c:IsOriginalCodeRule(tc:GetOriginalCodeRule())
  end
  function s.discon(e, tp, eg, ep, ev, re, r, rp)
  	local tc = e:GetLabelObject()
  	return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsOriginalCodeRule(tc:GetOriginalCodeRule())
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.NegateEffect(ev)
  end
  
  
source_text: Fist
  This card's activation and effect cannot be negated. If you control a monster whose original name is "Obelisk the Tormentor": Negate the effects of 1 Effect Monster your opponent controls, and if you do, destroy it, and if you do that, for the rest of this turn, the effects of that monster are negated, as well as the activated effects and effects on the field of monsters with the same original name, then, if you activated this card during your Main Phase, you can apply this effect.
  ● Destroy all Spells and Traps your opponent controls.
  You can only activate 1 "Fist of Fate" per turn.
target_text: -- Fist
  local CARD_ID_0 = 10000000 --Obelisk the Tormentor
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DESTROY + CATEGORY_DISABLE)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_CAN_FORBIDDEN)
  	e1:SetHintTiming(0, TIMINGS_CHECK_MONSTER)
  	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.actfilter(c)
  	return c:IsFaceup() and c:IsOriginalCodeRule(10000000)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.actfilter, e:GetHandlerPlayer(), LOCATION_MZONE, 0, 1, nil)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(aux.NegateEffectMonsterFilter, tp, 0, LOCATION_MZONE, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DISABLE, nil, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, nil, 1, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DISABLE)
  	local g = Duel.SelectMatchingCard(tp, aux.NegateEffectMonsterFilter, tp, 0, LOCATION_MZONE, 1, 1, nil)
  	if g:GetCount() > 0 then
  		local tc = g:GetFirst()
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetCode(EFFECT_DISABLE)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e1)
  		local e2 = Effect.CreateEffect(e:GetHandler())
  		e2:SetType(EFFECT_TYPE_SINGLE)
  		e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e2:SetCode(EFFECT_DISABLE_EFFECT)
  		e2:SetValue(RESET_TURN_SET)
  		e2:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e2)
  		Duel.AdjustInstantly()
  		Duel.NegateRelatedChain(tc, RESET_TURN_SET)
  		if Duel.Destroy(tc, REASON_EFFECT) ~= 0 then
  			local e3 = Effect.CreateEffect(e:GetHandler())
  			e3:SetType(EFFECT_TYPE_FIELD)
  			e3:SetCode(EFFECT_DISABLE)
  			e3:SetTargetRange(LOCATION_MZONE, LOCATION_MZONE)
  			e3:SetTarget(s.distg)
  			e3:SetLabelObject(tc)
  			e3:SetReset(RESET_PHASE + PHASE_END)
  			Duel.RegisterEffect(e3, tp)
  			local e4 = Effect.CreateEffect(e:GetHandler())
  			e4:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  			e4:SetCode(EVENT_CHAIN_SOLVING)
  			e4:SetCondition(s.discon)
  			e4:SetOperation(s.disop)
  			e4:SetLabelObject(tc)
  			e4:SetReset(RESET_PHASE + PHASE_END)
  			Duel.RegisterEffect(e4, tp)
  			local sg = Duel.GetMatchingGroup(s.desfilter, tp, 0, LOCATION_ONFIELD, nil)
  			if #sg > 0 and Duel.GetTurnPlayer() == tp and (Duel.GetCurrentPhase() == PHASE_MAIN1 or Duel.GetCurrentPhase() == PHASE_MAIN2) and Duel.SelectYesNo(tp, aux.Stringid(id, 0)) then
  				Duel.BreakEffect()
  				Duel.Destroy(sg, REASON_EFFECT)
  			end
  		end
  	end
  end
  function s.desfilter(c)
  	return c:IsType(TYPE_SPELL + TYPE_TRAP)
  end
  function s.distg(e, c)
  	local tc = e:GetLabelObject()
  	return c:IsOriginalCodeRule(tc:GetOriginalCodeRule())
  end
  function s.discon(e, tp, eg, ep, ev, re, r, rp)
  	local tc = e:GetLabelObject()
  	return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsOriginalCodeRule(tc:GetOriginalCodeRule())
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.NegateEffect(ev)
  end
  
  