name: Amazoness
card_text: 1 "Amazoness" Fusion Monster + 1 "Amazoness" monster
  Your opponent cannot target other "Amazoness" cards you control with card effects, also those cards cannot be destroyed by your opponent's card effects. If this card was Fusion Summoned using "Amazoness Empress" or "Amazoness Queen" as material, it can make a second attack during each Battle Phase. If this card is Fusion Summoned: You can Special Summon 1 "Amazoness" monster from your Deck. You can only use this effect of "Amazoness Augusta" once per turn.
external_ids: local CARD_ID_0 = 15951532 --Amazoness Queen
  local CARD_ID_1 = 4591250 --Amazoness Empress
  local SETCARD_ID_0 = 0x4 --Amazoness
  
lua: local CARD_ID_0 = 15951532 --Amazoness Queen
  local CARD_ID_1 = 4591250 --Amazoness Empress
  local SETCARD_ID_0 = 0x4 --Amazoness
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcFun2(c, s.matfilter, aux.FilterBoolFunction(Card.IsFusionSetCard, SETCARD_ID_0), true)
  	--spsummon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetCountLimit(1, id)
  	e1:SetProperty(EFFECT_FLAG_DELAY)
  	e1:SetCondition(s.spcon)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--indes
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTargetRange(LOCATION_ONFIELD, 0)
  	e2:SetTarget(s.indtg)
  	e2:SetValue(aux.indoval)
  	c:RegisterEffect(e2)
  	--cannot be target
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
  	e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetTargetRange(LOCATION_ONFIELD, 0)
  	e3:SetTarget(s.indtg)
  	e3:SetValue(aux.tgoval)
  	c:RegisterEffect(e3)
  	--multi attack
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
  	e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e4:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e4:SetCondition(s.condition)
  	e4:SetOperation(s.operation)
  	c:RegisterEffect(e4)
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_SINGLE)
  	e5:SetCode(EFFECT_MATERIAL_CHECK)
  	e5:SetValue(s.valcheck)
  	e5:SetLabelObject(e4)
  	c:RegisterEffect(e5)
  end
  function s.matfilter(c)
  	return c:IsFusionType(TYPE_FUSION) and c:IsFusionSetCard(SETCARD_ID_0)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
  end
  function s.spfilter(c, e, tp)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_DECK, 0, 1, nil, e, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_DECK)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_DECK, 0, 1, 1, nil, e, tp)
  	if g:GetCount() > 0 then
  		Duel.SpecialSummon(g, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  function s.indtg(e, c)
  	return c:IsSetCard(SETCARD_ID_0) and c ~= e:GetHandler()
  end
  function s.valcheck(e, c)
  	e:GetLabelObject():SetLabel(c:GetMaterial():FilterCount(Card.IsCode, nil, CARD_ID_1, CARD_ID_0))
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local ct = e:GetLabel()
  	if ct >= 1 then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetDescription(aux.Stringid(id, 1))
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_EXTRA_ATTACK)
  		e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
  		e1:SetValue(1)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		c:RegisterEffect(e1)
  	end
  end
  
  
source_text: Amazoness
  1 "Amazoness" Fusion Monster + 1 "Amazoness" monster
  Your opponent cannot target other "Amazoness" cards you control with card effects, also those cards cannot be destroyed by your opponent's card effects. If this card was Fusion Summoned using "Amazoness Empress" or "Amazoness Queen" as material, it can make a second attack during each Battle Phase. If this card is Fusion Summoned: You can Special Summon 1 "Amazoness" monster from your Deck. You can only use this effect of "Amazoness Augusta" once per turn.
target_text: -- Amazoness
  local CARD_ID_0 = 15951532 --Amazoness Queen
  local CARD_ID_1 = 4591250 --Amazoness Empress
  local SETCARD_ID_0 = 0x4 --Amazoness
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcFun2(c, s.matfilter, aux.FilterBoolFunction(Card.IsFusionSetCard, SETCARD_ID_0), true)
  	--spsummon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetCountLimit(1, id)
  	e1:SetProperty(EFFECT_FLAG_DELAY)
  	e1:SetCondition(s.spcon)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--indes
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTargetRange(LOCATION_ONFIELD, 0)
  	e2:SetTarget(s.indtg)
  	e2:SetValue(aux.indoval)
  	c:RegisterEffect(e2)
  	--cannot be target
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
  	e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetTargetRange(LOCATION_ONFIELD, 0)
  	e3:SetTarget(s.indtg)
  	e3:SetValue(aux.tgoval)
  	c:RegisterEffect(e3)
  	--multi attack
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
  	e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e4:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e4:SetCondition(s.condition)
  	e4:SetOperation(s.operation)
  	c:RegisterEffect(e4)
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_SINGLE)
  	e5:SetCode(EFFECT_MATERIAL_CHECK)
  	e5:SetValue(s.valcheck)
  	e5:SetLabelObject(e4)
  	c:RegisterEffect(e5)
  end
  function s.matfilter(c)
  	return c:IsFusionType(TYPE_FUSION) and c:IsFusionSetCard(SETCARD_ID_0)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
  end
  function s.spfilter(c, e, tp)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_DECK, 0, 1, nil, e, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_DECK)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_DECK, 0, 1, 1, nil, e, tp)
  	if g:GetCount() > 0 then
  		Duel.SpecialSummon(g, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  function s.indtg(e, c)
  	return c:IsSetCard(SETCARD_ID_0) and c ~= e:GetHandler()
  end
  function s.valcheck(e, c)
  	e:GetLabelObject():SetLabel(c:GetMaterial():FilterCount(Card.IsCode, nil, CARD_ID_1, CARD_ID_0))
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local ct = e:GetLabel()
  	if ct >= 1 then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetDescription(aux.Stringid(id, 1))
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_EXTRA_ATTACK)
  		e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
  		e1:SetValue(1)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		c:RegisterEffect(e1)
  	end
  end
  
  