name: Soul
card_text: Select 1 monster equipped with a "Bamboo Sword" Equip Spell Card. If it inflicts Battle Damage to your opponent while equipped with a "Bamboo Sword" card, they skip their next Draw Phase. Destroy this card during your second Standby Phase after activation.
lua: 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)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	--skip draw
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCode(EVENT_DAMAGE)
  	e2:SetCondition(s.skipcon)
  	e2:SetOperation(s.skipop)
  	c:RegisterEffect(e2)
  	--destroy
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e3:SetCode(EVENT_PHASE + PHASE_STANDBY)
  	e3:SetCountLimit(1)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetCondition(s.descon)
  	e3:SetOperation(s.desop)
  	c:RegisterEffect(e3)
  end
  function s.filter(c)
  	return c:GetEquipCount() ~= 0 and c:GetEquipGroup():IsExists(Card.IsSetCard, 1, nil, 0x60)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil)
  	end
  	e:GetHandler():SetTurnCounter(0)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TARGET)
  	Duel.SelectTarget(tp, s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if tc:IsFaceup() and tc:IsRelateToEffect(e) then
  		c:SetCardTarget(tc)
  	end
  end
  function s.skipcon(e, tp, eg, ep, ev, re, r, rp)
  	local tc = e:GetHandler():GetFirstCardTarget()
  	return tc and ep ~= tp and r == REASON_BATTLE and (Duel.GetAttacker() == tc or Duel.GetAttackTarget() == tc)
  end
  function s.skipop(e, tp, eg, ep, ev, re, r, rp)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetTargetRange(0, 1)
  	e1:SetCode(EFFECT_SKIP_DP)
  	if Duel.GetTurnPlayer() == tp then
  		e1:SetReset(RESET_PHASE + PHASE_END + RESET_OPPO_TURN, 1)
  	else
  		e1:SetReset(RESET_PHASE + PHASE_END + RESET_OPPO_TURN, 2)
  	end
  	Duel.RegisterEffect(e1, tp)
  end
  function s.descon(e, tp, eg, ep, ev, re, r, rp)
  	return tp == Duel.GetTurnPlayer()
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local ct = c:GetTurnCounter()
  	ct = ct + 1
  	c:SetTurnCounter(ct)
  	if ct == 2 then
  		Duel.Destroy(c, REASON_RULE)
  	end
  end
  
  
source_text: Soul
  Select 1 monster equipped with a "Bamboo Sword" Equip Spell Card. If it inflicts Battle Damage to your opponent while equipped with a "Bamboo Sword" card, they skip their next Draw Phase. Destroy this card during your second Standby Phase after activation.
target_text: -- Soul
  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)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	--skip draw
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCode(EVENT_DAMAGE)
  	e2:SetCondition(s.skipcon)
  	e2:SetOperation(s.skipop)
  	c:RegisterEffect(e2)
  	--destroy
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e3:SetCode(EVENT_PHASE + PHASE_STANDBY)
  	e3:SetCountLimit(1)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetCondition(s.descon)
  	e3:SetOperation(s.desop)
  	c:RegisterEffect(e3)
  end
  function s.filter(c)
  	return c:GetEquipCount() ~= 0 and c:GetEquipGroup():IsExists(Card.IsSetCard, 1, nil, 0x60)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil)
  	end
  	e:GetHandler():SetTurnCounter(0)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TARGET)
  	Duel.SelectTarget(tp, s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if tc:IsFaceup() and tc:IsRelateToEffect(e) then
  		c:SetCardTarget(tc)
  	end
  end
  function s.skipcon(e, tp, eg, ep, ev, re, r, rp)
  	local tc = e:GetHandler():GetFirstCardTarget()
  	return tc and ep ~= tp and r == REASON_BATTLE and (Duel.GetAttacker() == tc or Duel.GetAttackTarget() == tc)
  end
  function s.skipop(e, tp, eg, ep, ev, re, r, rp)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetTargetRange(0, 1)
  	e1:SetCode(EFFECT_SKIP_DP)
  	if Duel.GetTurnPlayer() == tp then
  		e1:SetReset(RESET_PHASE + PHASE_END + RESET_OPPO_TURN, 1)
  	else
  		e1:SetReset(RESET_PHASE + PHASE_END + RESET_OPPO_TURN, 2)
  	end
  	Duel.RegisterEffect(e1, tp)
  end
  function s.descon(e, tp, eg, ep, ev, re, r, rp)
  	return tp == Duel.GetTurnPlayer()
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local ct = c:GetTurnCounter()
  	ct = ct + 1
  	c:SetTurnCounter(ct)
  	if ct == 2 then
  		Duel.Destroy(c, REASON_RULE)
  	end
  end
  
  