name: Chaos
card_text: 4 "Ancient Gear" monsters
  Must be Fusion Summoned. Unaffected by Spell/Trap effects. Your opponent cannot activate monster effects during the Battle Phase. Can attack all monsters your opponent controls, once each. If this card attacks a Defense Position monster, inflict piercing battle damage to your opponent.
external_ids: local SETCARD_ID_0 = 0x7 --Ancient
  
lua: local SETCARD_ID_0 = 0x7 --Ancient
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcFunRep(c, aux.FilterBoolFunction(Card.IsFusionSetCard, SETCARD_ID_0), 4, true)
  	--special summon condition
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetCode(EFFECT_SPSUMMON_CONDITION)
  	e1:SetValue(aux.fuslimit)
  	c:RegisterEffect(e1)
  	--immune
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e2:SetCode(EFFECT_IMMUNE_EFFECT)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetValue(s.efilter)
  	c:RegisterEffect(e2)
  	--activate limit
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e3:SetCode(EFFECT_CANNOT_ACTIVATE)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetTargetRange(0, 1)
  	e3:SetCondition(s.actcon)
  	e3:SetValue(s.actlimit)
  	c:RegisterEffect(e3)
  	--attack all
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_SINGLE)
  	e4:SetCode(EFFECT_ATTACK_ALL)
  	e4:SetValue(1)
  	c:RegisterEffect(e4)
  	--pierce
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_SINGLE)
  	e5:SetCode(EFFECT_PIERCE)
  	c:RegisterEffect(e5)
  end
  function s.efilter(e, te)
  	return te:IsActiveType(TYPE_SPELL + TYPE_TRAP)
  end
  function s.actcon(e)
  	local ph = Duel.GetCurrentPhase()
  	return ph >= PHASE_BATTLE_START and ph <= PHASE_BATTLE
  end
  function s.actlimit(e, re, tp)
  	return re:IsActiveType(TYPE_MONSTER)
  end
  
  
source_text: Chaos
  4 "Ancient Gear" monsters
  Must be Fusion Summoned. Unaffected by Spell/Trap effects. Your opponent cannot activate monster effects during the Battle Phase. Can attack all monsters your opponent controls, once each. If this card attacks a Defense Position monster, inflict piercing battle damage to your opponent.
target_text: -- Chaos
  local SETCARD_ID_0 = 0x7 --Ancient
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcFunRep(c, aux.FilterBoolFunction(Card.IsFusionSetCard, SETCARD_ID_0), 4, true)
  	--special summon condition
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetCode(EFFECT_SPSUMMON_CONDITION)
  	e1:SetValue(aux.fuslimit)
  	c:RegisterEffect(e1)
  	--immune
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e2:SetCode(EFFECT_IMMUNE_EFFECT)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetValue(s.efilter)
  	c:RegisterEffect(e2)
  	--activate limit
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e3:SetCode(EFFECT_CANNOT_ACTIVATE)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetTargetRange(0, 1)
  	e3:SetCondition(s.actcon)
  	e3:SetValue(s.actlimit)
  	c:RegisterEffect(e3)
  	--attack all
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_SINGLE)
  	e4:SetCode(EFFECT_ATTACK_ALL)
  	e4:SetValue(1)
  	c:RegisterEffect(e4)
  	--pierce
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_SINGLE)
  	e5:SetCode(EFFECT_PIERCE)
  	c:RegisterEffect(e5)
  end
  function s.efilter(e, te)
  	return te:IsActiveType(TYPE_SPELL + TYPE_TRAP)
  end
  function s.actcon(e)
  	local ph = Duel.GetCurrentPhase()
  	return ph >= PHASE_BATTLE_START and ph <= PHASE_BATTLE
  end
  function s.actlimit(e, re, tp)
  	return re:IsActiveType(TYPE_MONSTER)
  end
  
  