name: Gold
card_text: If your LP are lower than your opponent's: You can Special Summon this card from your hand. During the Main Phase (Quick Effect): You can Fusion Summon 1 "Gold Pride" Fusion Monster from your Extra Deck, using monsters from your hand or field as material. You can only use each effect of "Gold Pride - Roller Baller" once per turn.
external_ids: local SETCARD_ID_0 = 0x192 --Gold
  
lua: local SETCARD_ID_0 = 0x192 --Gold
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--spsummon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.spcon)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--Fusion summon
  	local e2 = FusionSpell.CreateSummonEffect(c, {
  		fusfilter = s.fusfilter,
  	})
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetHintTiming(0, TIMING_MAIN_END)
  	e2:SetCountLimit(1, id + o)
  	e2:SetCondition(s.fscon)
  	c:RegisterEffect(e2)
  end
  
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetLP(tp) < Duel.GetLP(1 - tp)
  end
  
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
  end
  
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) then
  		Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  
  function s.fscon(e, tp, eg, ep, ev, re, r, rp)
  	local ph = Duel.GetCurrentPhase()
  	return ph == PHASE_MAIN1 or ph == PHASE_MAIN2
  end
  
  function s.fusfilter(c)
  	return c:IsSetCard(SETCARD_ID_0)
  end
  
  
source_text: Gold
  If your LP are lower than your opponent's: You can Special Summon this card from your hand. During the Main Phase (Quick Effect): You can Fusion Summon 1 "Gold Pride" Fusion Monster from your Extra Deck, using monsters from your hand or field as material. You can only use each effect of "Gold Pride - Roller Baller" once per turn.
target_text: -- Gold
  local SETCARD_ID_0 = 0x192 --Gold
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--spsummon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.spcon)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--Fusion summon
  	local e2 = FusionSpell.CreateSummonEffect(c, {
  		fusfilter = s.fusfilter,
  	})
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetHintTiming(0, TIMING_MAIN_END)
  	e2:SetCountLimit(1, id + o)
  	e2:SetCondition(s.fscon)
  	c:RegisterEffect(e2)
  end
  
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetLP(tp) < Duel.GetLP(1 - tp)
  end
  
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
  end
  
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) then
  		Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  
  function s.fscon(e, tp, eg, ep, ev, re, r, rp)
  	local ph = Duel.GetCurrentPhase()
  	return ph == PHASE_MAIN1 or ph == PHASE_MAIN2
  end
  
  function s.fusfilter(c)
  	return c:IsSetCard(SETCARD_ID_0)
  end
  
  