name: Gilford
card_text: You can Tribute 3 monsters to Tribute Summon (but not Set) this card. If Summoned this way: Destroy all monsters your opponent controls.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--summon with 3 tribute
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_SUMMON_PROC)
  	e1:SetCondition(s.ttcon)
  	e1:SetOperation(s.ttop)
  	e1:SetValue(SUMMON_TYPE_ADVANCE + SUMMON_VALUE_SELF)
  	c:RegisterEffect(e1)
  	--destroy
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_DESTROY)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCode(EVENT_SUMMON_SUCCESS)
  	e2:SetCondition(s.descon)
  	e2:SetTarget(s.destg)
  	e2:SetOperation(s.desop)
  	c:RegisterEffect(e2)
  end
  function s.ttcon(e, c, minc)
  	if c == nil then
  		return true
  	end
  	return minc <= 3 and Duel.CheckTribute(c, 3)
  end
  function s.ttop(e, tp, eg, ep, ev, re, r, rp, c)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RELEASE)
  	local g = Duel.SelectTribute(tp, c, 3, 3)
  	c:SetMaterial(g)
  	Duel.Release(g, REASON_SUMMON + REASON_MATERIAL)
  end
  function s.descon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():GetSummonType() == SUMMON_TYPE_ADVANCE + SUMMON_VALUE_SELF
  end
  function s.destg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local g = Duel.GetMatchingGroup(aux.TRUE, tp, 0, LOCATION_MZONE, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, g:GetCount(), 0, 0)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(aux.TRUE, tp, 0, LOCATION_MZONE, nil)
  	Duel.Destroy(g, REASON_EFFECT)
  end
  
  
source_text: Gilford
  You can Tribute 3 monsters to Tribute Summon (but not Set) this card. If Summoned this way: Destroy all monsters your opponent controls.
target_text: -- Gilford
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--summon with 3 tribute
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_SUMMON_PROC)
  	e1:SetCondition(s.ttcon)
  	e1:SetOperation(s.ttop)
  	e1:SetValue(SUMMON_TYPE_ADVANCE + SUMMON_VALUE_SELF)
  	c:RegisterEffect(e1)
  	--destroy
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_DESTROY)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCode(EVENT_SUMMON_SUCCESS)
  	e2:SetCondition(s.descon)
  	e2:SetTarget(s.destg)
  	e2:SetOperation(s.desop)
  	c:RegisterEffect(e2)
  end
  function s.ttcon(e, c, minc)
  	if c == nil then
  		return true
  	end
  	return minc <= 3 and Duel.CheckTribute(c, 3)
  end
  function s.ttop(e, tp, eg, ep, ev, re, r, rp, c)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RELEASE)
  	local g = Duel.SelectTribute(tp, c, 3, 3)
  	c:SetMaterial(g)
  	Duel.Release(g, REASON_SUMMON + REASON_MATERIAL)
  end
  function s.descon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():GetSummonType() == SUMMON_TYPE_ADVANCE + SUMMON_VALUE_SELF
  end
  function s.destg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local g = Duel.GetMatchingGroup(aux.TRUE, tp, 0, LOCATION_MZONE, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, g:GetCount(), 0, 0)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(aux.TRUE, tp, 0, LOCATION_MZONE, nil)
  	Duel.Destroy(g, REASON_EFFECT)
  end
  
  