name: Frightfur
card_text: Add 1 "Edge Imp" monster and 1 "Polymerization" from your Deck to your hand. You can only activate 1 "Frightfur Patchwork" per turn.
external_ids: local CARD_ID_0 = 24094653 --Polymerization
  local SETCARD_ID_0 = 0xc3 --Edge
  
lua: local CARD_ID_0 = 24094653 --Polymerization
  local SETCARD_ID_0 = 0xc3 --Edge
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.filter1(c)
  	return c:IsCode(CARD_ID_0) and c:IsAbleToHand()
  end
  function s.filter2(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter1, tp, LOCATION_DECK, 0, 1, nil) and Duel.IsExistingMatchingCard(s.filter2, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 2, tp, LOCATION_DECK)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local g1 = Duel.GetMatchingGroup(s.filter1, tp, LOCATION_DECK, 0, nil)
  	local g2 = Duel.GetMatchingGroup(s.filter2, tp, LOCATION_DECK, 0, nil)
  	if g1:GetCount() > 0 and g2:GetCount() > 0 then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  		local sg1 = g1:Select(tp, 1, 1, nil)
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  		local sg2 = g2:Select(tp, 1, 1, nil)
  		sg1:Merge(sg2)
  		Duel.SendtoHand(sg1, nil, REASON_EFFECT)
  		Duel.ConfirmCards(1 - tp, sg1)
  	end
  end
  
  
source_text: Frightfur
  Add 1 "Edge Imp" monster and 1 "Polymerization" from your Deck to your hand. You can only activate 1 "Frightfur Patchwork" per turn.
target_text: -- Frightfur
  local CARD_ID_0 = 24094653 --Polymerization
  local SETCARD_ID_0 = 0xc3 --Edge
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.filter1(c)
  	return c:IsCode(CARD_ID_0) and c:IsAbleToHand()
  end
  function s.filter2(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter1, tp, LOCATION_DECK, 0, 1, nil) and Duel.IsExistingMatchingCard(s.filter2, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 2, tp, LOCATION_DECK)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local g1 = Duel.GetMatchingGroup(s.filter1, tp, LOCATION_DECK, 0, nil)
  	local g2 = Duel.GetMatchingGroup(s.filter2, tp, LOCATION_DECK, 0, nil)
  	if g1:GetCount() > 0 and g2:GetCount() > 0 then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  		local sg1 = g1:Select(tp, 1, 1, nil)
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  		local sg2 = g2:Select(tp, 1, 1, nil)
  		sg1:Merge(sg2)
  		Duel.SendtoHand(sg1, nil, REASON_EFFECT)
  		Duel.ConfirmCards(1 - tp, sg1)
  	end
  end
  
  