name: Bubble
card_text: You can only activate this card while there is a face-up "Elemental Hero Bubbleman" on your side of the field. During this turn, you can activate 1 Trap Card from your hand.
external_ids: local CARD_ID_0 = 79979666 --Elemental HERO Bubbleman
  local SETCARD_ID_0 = 0x3008 --Elemental
  
lua: local CARD_ID_0 = 79979666 --Elemental HERO Bubbleman
  local SETCARD_ID_0 = 0x3008 --Elemental
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddSetNameMonsterList(c, SETCARD_ID_0)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCondition(s.condition)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsCode(CARD_ID_0)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_TRAP_ACT_IN_HAND)
  	e1:SetTargetRange(LOCATION_HAND, 0)
  	e1:SetCountLimit(1, id)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  end
  
  
source_text: Bubble
  You can only activate this card while there is a face-up "Elemental Hero Bubbleman" on your side of the field. During this turn, you can activate 1 Trap Card from your hand.
target_text: -- Bubble
  local CARD_ID_0 = 79979666 --Elemental HERO Bubbleman
  local SETCARD_ID_0 = 0x3008 --Elemental
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddSetNameMonsterList(c, SETCARD_ID_0)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCondition(s.condition)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsCode(CARD_ID_0)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_TRAP_ACT_IN_HAND)
  	e1:SetTargetRange(LOCATION_HAND, 0)
  	e1:SetCountLimit(1, id)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  end
  
  