name: Ash
card_text: When a card or effect is activated that includes any of these effects (Quick Effect): You can discard this card; negate that effect.
  ● Add a card from the Deck to the hand.
  ● Special Summon from the Deck.
  ● Send a card from the Deck to the GY.
  You can only use this effect of "Ash Blossom & Joyous Spring" once per turn.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--negate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DISABLE)
  	e1:SetType(EFFECT_TYPE_QUICK_O)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.discon)
  	e1:SetCost(s.discost)
  	e1:SetTarget(s.distg)
  	e1:SetOperation(s.disop)
  	c:RegisterEffect(e1)
  end
  function s.discon(e, tp, eg, ep, ev, re, r, rp)
  	local ex2, g2, gc2, dp2, dv2 = Duel.GetOperationInfo(ev, CATEGORY_SPECIAL_SUMMON)
  	local ex3, g3, gc3, dp3, dv3 = Duel.GetOperationInfo(ev, CATEGORY_TOGRAVE)
  	local ex4 = re:IsHasCategory(CATEGORY_DRAW)
  	local ex5 = re:IsHasCategory(CATEGORY_SEARCH)
  	local ex6 = re:IsHasCategory(CATEGORY_DECKDES)
  	return ((ex2 and bit.band(dv2, LOCATION_DECK) == LOCATION_DECK) or (ex3 and bit.band(dv3, LOCATION_DECK) == LOCATION_DECK) or ex4 or ex5 or ex6) and Duel.IsChainDisablable(ev)
  end
  function s.discost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return c:IsDiscardable()
  	end
  	Duel.SendtoGrave(c, REASON_COST + REASON_DISCARD)
  end
  function s.distg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DISABLE, eg, 1, 0, 0)
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.NegateEffect(ev)
  end
  
  
source_text: Ash
  When a card or effect is activated that includes any of these effects (Quick Effect): You can discard this card; negate that effect.
  ● Add a card from the Deck to the hand.
  ● Special Summon from the Deck.
  ● Send a card from the Deck to the GY.
  You can only use this effect of "Ash Blossom & Joyous Spring" once per turn.
target_text: -- Ash
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--negate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DISABLE)
  	e1:SetType(EFFECT_TYPE_QUICK_O)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.discon)
  	e1:SetCost(s.discost)
  	e1:SetTarget(s.distg)
  	e1:SetOperation(s.disop)
  	c:RegisterEffect(e1)
  end
  function s.discon(e, tp, eg, ep, ev, re, r, rp)
  	local ex2, g2, gc2, dp2, dv2 = Duel.GetOperationInfo(ev, CATEGORY_SPECIAL_SUMMON)
  	local ex3, g3, gc3, dp3, dv3 = Duel.GetOperationInfo(ev, CATEGORY_TOGRAVE)
  	local ex4 = re:IsHasCategory(CATEGORY_DRAW)
  	local ex5 = re:IsHasCategory(CATEGORY_SEARCH)
  	local ex6 = re:IsHasCategory(CATEGORY_DECKDES)
  	return ((ex2 and bit.band(dv2, LOCATION_DECK) == LOCATION_DECK) or (ex3 and bit.band(dv3, LOCATION_DECK) == LOCATION_DECK) or ex4 or ex5 or ex6) and Duel.IsChainDisablable(ev)
  end
  function s.discost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return c:IsDiscardable()
  	end
  	Duel.SendtoGrave(c, REASON_COST + REASON_DISCARD)
  end
  function s.distg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DISABLE, eg, 1, 0, 0)
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.NegateEffect(ev)
  end
  
  