name: 7
card_text: When there are 3 face-up "7" cards on your side of the field, draw 3 cards from your Deck. Then destroy all "7" cards. When this card is sent directly from the field to your Graveyard, increase your Life Points by 700 points.
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:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	--recover
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 1))
  	e3:SetCategory(CATEGORY_RECOVER)
  	e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e3:SetCode(EVENT_TO_GRAVE)
  	e3:SetCondition(s.reccon)
  	e3:SetTarget(s.rectg)
  	e3:SetOperation(s.recop)
  	c:RegisterEffect(e3)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsCode(id)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	if Duel.GetMatchingGroupCount(s.filter, tp, LOCATION_SZONE, 0, nil) == 3 then
  		local g = Duel.GetMatchingGroup(s.filter, tp, LOCATION_ONFIELD, 0, nil)
  		Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, 3)
  		Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, g:GetCount(), 0, 0)
  	end
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local ex = Duel.GetOperationInfo(0, CATEGORY_DRAW)
  	if ex then
  		if Duel.Draw(tp, 3, REASON_EFFECT) ~= 0 then
  			Duel.BreakEffect()
  			local g = Duel.GetMatchingGroup(s.filter, tp, LOCATION_ONFIELD, 0, nil)
  			Duel.Destroy(g, REASON_RULE)
  		end
  	end
  end
  function s.reccon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
  end
  function s.rectg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetTargetPlayer(tp)
  	Duel.SetTargetParam(700)
  	Duel.SetOperationInfo(0, CATEGORY_RECOVER, nil, 0, tp, 700)
  end
  function s.recop(e, tp, eg, ep, ev, re, r, rp)
  	local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  	Duel.Recover(p, d, REASON_EFFECT)
  end
  
  
source_text: 7
  When there are 3 face-up "7" cards on your side of the field, draw 3 cards from your Deck. Then destroy all "7" cards. When this card is sent directly from the field to your Graveyard, increase your Life Points by 700 points.
target_text: -- 7
  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:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	--recover
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 1))
  	e3:SetCategory(CATEGORY_RECOVER)
  	e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e3:SetCode(EVENT_TO_GRAVE)
  	e3:SetCondition(s.reccon)
  	e3:SetTarget(s.rectg)
  	e3:SetOperation(s.recop)
  	c:RegisterEffect(e3)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsCode(id)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	if Duel.GetMatchingGroupCount(s.filter, tp, LOCATION_SZONE, 0, nil) == 3 then
  		local g = Duel.GetMatchingGroup(s.filter, tp, LOCATION_ONFIELD, 0, nil)
  		Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, 3)
  		Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, g:GetCount(), 0, 0)
  	end
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local ex = Duel.GetOperationInfo(0, CATEGORY_DRAW)
  	if ex then
  		if Duel.Draw(tp, 3, REASON_EFFECT) ~= 0 then
  			Duel.BreakEffect()
  			local g = Duel.GetMatchingGroup(s.filter, tp, LOCATION_ONFIELD, 0, nil)
  			Duel.Destroy(g, REASON_RULE)
  		end
  	end
  end
  function s.reccon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
  end
  function s.rectg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetTargetPlayer(tp)
  	Duel.SetTargetParam(700)
  	Duel.SetOperationInfo(0, CATEGORY_RECOVER, nil, 0, tp, 700)
  end
  function s.recop(e, tp, eg, ep, ev, re, r, rp)
  	local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  	Duel.Recover(p, d, REASON_EFFECT)
  end
  
  