name: Alien
card_text: If this card destroys a monster with an A-Counter by battle, it can attack once again in a row.
external_ids: local COUNTER_ID_0 = 0x100e --A-Counter
  
lua: local COUNTER_ID_0 = 0x100e --A-Counter
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--chain attack
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
  	e1:SetCode(EVENT_BATTLED)
  	e1:SetOperation(s.regop)
  	c:RegisterEffect(e1)
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e2:SetCode(EVENT_BATTLE_DESTROYING)
  	e2:SetCondition(s.atcon)
  	e2:SetOperation(s.atop)
  	c:RegisterEffect(e2)
  end
  function s.regop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local bc = c:GetBattleTarget()
  	if bc and bc:GetCounter(COUNTER_ID_0) > 0 then
  		c:RegisterFlagEffect(id, RESET_PHASE + PHASE_DAMAGE, 0, 1)
  	end
  end
  function s.atcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	return aux.bdcon(e, tp, eg, ep, ev, re, r, rp) and c:IsChainAttackable() and c:GetFlagEffect(id) ~= 0
  end
  function s.atop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.ChainAttack()
  end
  
  
source_text: Alien
  If this card destroys a monster with an A-Counter by battle, it can attack once again in a row.
target_text: -- Alien
  local COUNTER_ID_0 = 0x100e --A-Counter
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--chain attack
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
  	e1:SetCode(EVENT_BATTLED)
  	e1:SetOperation(s.regop)
  	c:RegisterEffect(e1)
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e2:SetCode(EVENT_BATTLE_DESTROYING)
  	e2:SetCondition(s.atcon)
  	e2:SetOperation(s.atop)
  	c:RegisterEffect(e2)
  end
  function s.regop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local bc = c:GetBattleTarget()
  	if bc and bc:GetCounter(COUNTER_ID_0) > 0 then
  		c:RegisterFlagEffect(id, RESET_PHASE + PHASE_DAMAGE, 0, 1)
  	end
  end
  function s.atcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	return aux.bdcon(e, tp, eg, ep, ev, re, r, rp) and c:IsChainAttackable() and c:GetFlagEffect(id) ~= 0
  end
  function s.atop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.ChainAttack()
  end
  
  