name: Thermal
card_text: "Genex Controller" + 1 or more non-Tuner FIRE monsters
  This card gains 200 ATK for each FIRE monster in your Graveyard. If this card destroys an opponent's monster by battle, inflict 200 damage to your opponent for each "Genex" monster in your Graveyard.
external_ids: local CARD_ID_0 = 68505803 --Genex Controller
  
lua: local CARD_ID_0 = 68505803 --Genex Controller
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddMaterialCodeList(c, CARD_ID_0)
  	--synchro summon
  	aux.AddSynchroProcedure(c, aux.FilterBoolFunction(Card.IsCode, CARD_ID_0), aux.NonTuner(Card.IsAttribute, ATTRIBUTE_FIRE), 1)
  	c:EnableReviveLimit()
  	--atkup
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCode(EFFECT_UPDATE_ATTACK)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetValue(s.val)
  	c:RegisterEffect(e1)
  	--damage
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_DAMAGE)
  	e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e2:SetCode(EVENT_BATTLE_DESTROYING)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCondition(s.damcon)
  	e2:SetTarget(s.damtg)
  	e2:SetOperation(s.damop)
  	c:RegisterEffect(e2)
  end
  function s.val(e, c)
  	return Duel.GetMatchingGroupCount(Card.IsAttribute, c:GetControler(), LOCATION_GRAVE, 0, nil, ATTRIBUTE_FIRE) * 200
  end
  function s.damcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	return c:IsRelateToBattle() and c:GetBattleTarget():IsType(TYPE_MONSTER)
  end
  function s.damtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetTargetPlayer(1 - tp)
  	Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, 1 - tp, 0)
  end
  function s.damop(e, tp, eg, ep, ev, re, r, rp)
  	local p = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER)
  	local d = Duel.GetMatchingGroupCount(Card.IsSetCard, tp, LOCATION_GRAVE, 0, nil, 0x2) * 200
  	Duel.Damage(p, d, REASON_EFFECT)
  end
  
  
source_text: Thermal
  "Genex Controller" + 1 or more non-Tuner FIRE monsters
  This card gains 200 ATK for each FIRE monster in your Graveyard. If this card destroys an opponent's monster by battle, inflict 200 damage to your opponent for each "Genex" monster in your Graveyard.
target_text: -- Thermal
  local CARD_ID_0 = 68505803 --Genex Controller
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddMaterialCodeList(c, CARD_ID_0)
  	--synchro summon
  	aux.AddSynchroProcedure(c, aux.FilterBoolFunction(Card.IsCode, CARD_ID_0), aux.NonTuner(Card.IsAttribute, ATTRIBUTE_FIRE), 1)
  	c:EnableReviveLimit()
  	--atkup
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCode(EFFECT_UPDATE_ATTACK)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetValue(s.val)
  	c:RegisterEffect(e1)
  	--damage
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_DAMAGE)
  	e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e2:SetCode(EVENT_BATTLE_DESTROYING)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCondition(s.damcon)
  	e2:SetTarget(s.damtg)
  	e2:SetOperation(s.damop)
  	c:RegisterEffect(e2)
  end
  function s.val(e, c)
  	return Duel.GetMatchingGroupCount(Card.IsAttribute, c:GetControler(), LOCATION_GRAVE, 0, nil, ATTRIBUTE_FIRE) * 200
  end
  function s.damcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	return c:IsRelateToBattle() and c:GetBattleTarget():IsType(TYPE_MONSTER)
  end
  function s.damtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetTargetPlayer(1 - tp)
  	Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, 1 - tp, 0)
  end
  function s.damop(e, tp, eg, ep, ev, re, r, rp)
  	local p = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER)
  	local d = Duel.GetMatchingGroupCount(Card.IsSetCard, tp, LOCATION_GRAVE, 0, nil, 0x2) * 200
  	Duel.Damage(p, d, REASON_EFFECT)
  end
  
  