name: Dual
card_text: 2 "Dual Avatar" monsters
  If this card is Special Summoned: You can target 1 Attack Position monster your opponent controls; destroy it, also this card cannot attack directly for the rest of this turn. You can only use this effect of "Dual Avatar Fists - Armored Ah-Gyo" once per turn. While you control a "Dual Avatar" Fusion Monster that was Fusion Summoned using an Effect Monster as material, all "Dual Avatar" Fusion Monsters you control gain 300 ATK/DEF.
external_ids: local SETCARD_ID_0 = 0x14f --Dual
  
lua: local SETCARD_ID_0 = 0x14f --Dual
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcFunRep(c, aux.FilterBoolFunction(Card.IsFusionSetCard, SETCARD_ID_0), 2, true)
  	--effect monster material check
  	local e0 = Effect.CreateEffect(c)
  	e0:SetType(EFFECT_TYPE_SINGLE)
  	e0:SetCode(EFFECT_MATERIAL_CHECK)
  	e0:SetValue(s.matcheck)
  	c:RegisterEffect(e0)
  	--destroy
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetProperty(EFFECT_FLAG_DELAY + EFFECT_FLAG_CARD_TARGET)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetCountLimit(1, id)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	--atk & def
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_UPDATE_ATTACK)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTargetRange(LOCATION_MZONE, 0)
  	e2:SetCondition(s.adcon)
  	e2:SetTarget(s.ffilter)
  	e2:SetValue(300)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EFFECT_UPDATE_DEFENSE)
  	c:RegisterEffect(e3)
  end
  function s.matcheck(e, c)
  	local g = c:GetMaterial()
  	if g:IsExists(Card.IsType, 1, nil, TYPE_EFFECT) then
  		c:RegisterFlagEffect(85360035, RESET_EVENT + RESETS_STANDARD - RESET_TOFIELD, 0, 1)
  	end
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1 - tp) and chkc:IsAttackPos()
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(Card.IsAttackPos, tp, 0, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  	local g = Duel.SelectTarget(tp, Card.IsAttackPos, tp, 0, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, 1, 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local tc, c = Duel.GetFirstTarget(), e:GetHandler()
  	if tc and tc:IsRelateToEffect(e) then
  		Duel.Destroy(tc, REASON_EFFECT)
  	end
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  	c:RegisterEffect(e1)
  end
  function s.ffilter(e, c)
  	return c:IsType(TYPE_FUSION) and c:IsSetCard(SETCARD_ID_0)
  end
  function s.fmfilter(c)
  	return c:IsType(TYPE_FUSION) and c:IsSetCard(SETCARD_ID_0) and c:IsFaceup() and c:GetFlagEffect(85360035) ~= 0
  end
  function s.adcon(e)
  	local tp = e:GetHandlerPlayer()
  	return Duel.IsExistingMatchingCard(s.fmfilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  
  
source_text: Dual
  2 "Dual Avatar" monsters
  If this card is Special Summoned: You can target 1 Attack Position monster your opponent controls; destroy it, also this card cannot attack directly for the rest of this turn. You can only use this effect of "Dual Avatar Fists - Armored Ah-Gyo" once per turn. While you control a "Dual Avatar" Fusion Monster that was Fusion Summoned using an Effect Monster as material, all "Dual Avatar" Fusion Monsters you control gain 300 ATK/DEF.
target_text: -- Dual
  local SETCARD_ID_0 = 0x14f --Dual
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcFunRep(c, aux.FilterBoolFunction(Card.IsFusionSetCard, SETCARD_ID_0), 2, true)
  	--effect monster material check
  	local e0 = Effect.CreateEffect(c)
  	e0:SetType(EFFECT_TYPE_SINGLE)
  	e0:SetCode(EFFECT_MATERIAL_CHECK)
  	e0:SetValue(s.matcheck)
  	c:RegisterEffect(e0)
  	--destroy
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetProperty(EFFECT_FLAG_DELAY + EFFECT_FLAG_CARD_TARGET)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetCountLimit(1, id)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	--atk & def
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_UPDATE_ATTACK)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTargetRange(LOCATION_MZONE, 0)
  	e2:SetCondition(s.adcon)
  	e2:SetTarget(s.ffilter)
  	e2:SetValue(300)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EFFECT_UPDATE_DEFENSE)
  	c:RegisterEffect(e3)
  end
  function s.matcheck(e, c)
  	local g = c:GetMaterial()
  	if g:IsExists(Card.IsType, 1, nil, TYPE_EFFECT) then
  		c:RegisterFlagEffect(85360035, RESET_EVENT + RESETS_STANDARD - RESET_TOFIELD, 0, 1)
  	end
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1 - tp) and chkc:IsAttackPos()
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(Card.IsAttackPos, tp, 0, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  	local g = Duel.SelectTarget(tp, Card.IsAttackPos, tp, 0, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, 1, 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local tc, c = Duel.GetFirstTarget(), e:GetHandler()
  	if tc and tc:IsRelateToEffect(e) then
  		Duel.Destroy(tc, REASON_EFFECT)
  	end
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  	c:RegisterEffect(e1)
  end
  function s.ffilter(e, c)
  	return c:IsType(TYPE_FUSION) and c:IsSetCard(SETCARD_ID_0)
  end
  function s.fmfilter(c)
  	return c:IsType(TYPE_FUSION) and c:IsSetCard(SETCARD_ID_0) and c:IsFaceup() and c:GetFlagEffect(85360035) ~= 0
  end
  function s.adcon(e)
  	local tp = e:GetHandlerPlayer()
  	return Duel.IsExistingMatchingCard(s.fmfilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  
  