name: Exodia
card_text: Cannot be Normal Summoned/Set. Must be Special Summoned with "Contract with Exodia". Cannot be destroyed by battle or Spell/Trap effects. Once per turn, during your Standby Phase: This card gains 500 ATK. Destroy this card unless all 5 of these cards are in your GY, "Exodia the Forbidden One", "Right Arm of the Forbidden One", "Left Arm of the Forbidden One", "Right Leg of the Forbidden One" and "Left Leg of the Forbidden One".
external_ids: local CARD_ID_0 = 44519536 --Left Leg of the Forbidden One
  local CARD_ID_1 = 70903634 --Right Arm of the Forbidden One
  local CARD_ID_2 = 33396948 --Exodia the Forbidden One
  local CARD_ID_3 = 7902349 --Left Arm of the Forbidden One
  local CARD_ID_4 = 8124921 --Right Leg of the Forbidden One
  
lua: local CARD_ID_0 = 44519536 --Left Leg of the Forbidden One
  local CARD_ID_1 = 70903634 --Right Arm of the Forbidden One
  local CARD_ID_2 = 33396948 --Exodia the Forbidden One
  local CARD_ID_3 = 7902349 --Left Arm of the Forbidden One
  local CARD_ID_4 = 8124921 --Right Leg of the Forbidden One
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableReviveLimit()
  	--cannot destroy
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetValue(1)
  	c:RegisterEffect(e1)
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetValue(s.efdes)
  	c:RegisterEffect(e2)
  	--spsummon limit
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE)
  	e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e3:SetCode(EFFECT_SPSUMMON_CONDITION)
  	c:RegisterEffect(e3)
  	--atkup
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 0))
  	e4:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e4:SetCategory(CATEGORY_ATKCHANGE)
  	e4:SetCode(EVENT_PHASE + PHASE_STANDBY)
  	e4:SetRange(LOCATION_MZONE)
  	e4:SetCountLimit(1)
  	e4:SetCondition(s.atkcon)
  	e4:SetOperation(s.atkop)
  	c:RegisterEffect(e4)
  	--selfdes
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_SINGLE)
  	e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e5:SetRange(LOCATION_MZONE)
  	e5:SetCode(EFFECT_SELF_DESTROY)
  	e5:SetCondition(s.descon)
  	c:RegisterEffect(e5)
  end
  function s.efdes(e, re)
  	return re:IsActiveType(TYPE_SPELL + TYPE_TRAP)
  end
  function s.atkcon(e, tp, eg, ep, ev, re, r, rp)
  	return tp == Duel.GetTurnPlayer()
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if not c:IsRelateToEffect(e) or c:IsFacedown() then
  		return
  	end
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_UPDATE_ATTACK)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE)
  	e1:SetValue(500)
  	c:RegisterEffect(e1)
  end
  function s.descon(e)
  	local p = e:GetHandlerPlayer()
  	return not Duel.IsExistingMatchingCard(Card.IsCode, p, LOCATION_GRAVE, 0, 1, nil, CARD_ID_4)
  		or not Duel.IsExistingMatchingCard(Card.IsCode, p, LOCATION_GRAVE, 0, 1, nil, CARD_ID_0)
  		or not Duel.IsExistingMatchingCard(Card.IsCode, p, LOCATION_GRAVE, 0, 1, nil, CARD_ID_1)
  		or not Duel.IsExistingMatchingCard(Card.IsCode, p, LOCATION_GRAVE, 0, 1, nil, CARD_ID_3)
  		or not Duel.IsExistingMatchingCard(Card.IsCode, p, LOCATION_GRAVE, 0, 1, nil, CARD_ID_2)
  end
  
  
source_text: Exodia
  Cannot be Normal Summoned/Set. Must be Special Summoned with "Contract with Exodia". Cannot be destroyed by battle or Spell/Trap effects. Once per turn, during your Standby Phase: This card gains 500 ATK. Destroy this card unless all 5 of these cards are in your GY, "Exodia the Forbidden One", "Right Arm of the Forbidden One", "Left Arm of the Forbidden One", "Right Leg of the Forbidden One" and "Left Leg of the Forbidden One".
target_text: -- Exodia
  local CARD_ID_0 = 44519536 --Left Leg of the Forbidden One
  local CARD_ID_1 = 70903634 --Right Arm of the Forbidden One
  local CARD_ID_2 = 33396948 --Exodia the Forbidden One
  local CARD_ID_3 = 7902349 --Left Arm of the Forbidden One
  local CARD_ID_4 = 8124921 --Right Leg of the Forbidden One
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableReviveLimit()
  	--cannot destroy
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetValue(1)
  	c:RegisterEffect(e1)
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetValue(s.efdes)
  	c:RegisterEffect(e2)
  	--spsummon limit
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE)
  	e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e3:SetCode(EFFECT_SPSUMMON_CONDITION)
  	c:RegisterEffect(e3)
  	--atkup
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 0))
  	e4:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e4:SetCategory(CATEGORY_ATKCHANGE)
  	e4:SetCode(EVENT_PHASE + PHASE_STANDBY)
  	e4:SetRange(LOCATION_MZONE)
  	e4:SetCountLimit(1)
  	e4:SetCondition(s.atkcon)
  	e4:SetOperation(s.atkop)
  	c:RegisterEffect(e4)
  	--selfdes
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_SINGLE)
  	e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e5:SetRange(LOCATION_MZONE)
  	e5:SetCode(EFFECT_SELF_DESTROY)
  	e5:SetCondition(s.descon)
  	c:RegisterEffect(e5)
  end
  function s.efdes(e, re)
  	return re:IsActiveType(TYPE_SPELL + TYPE_TRAP)
  end
  function s.atkcon(e, tp, eg, ep, ev, re, r, rp)
  	return tp == Duel.GetTurnPlayer()
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if not c:IsRelateToEffect(e) or c:IsFacedown() then
  		return
  	end
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_UPDATE_ATTACK)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE)
  	e1:SetValue(500)
  	c:RegisterEffect(e1)
  end
  function s.descon(e)
  	local p = e:GetHandlerPlayer()
  	return not Duel.IsExistingMatchingCard(Card.IsCode, p, LOCATION_GRAVE, 0, 1, nil, CARD_ID_4)
  		or not Duel.IsExistingMatchingCard(Card.IsCode, p, LOCATION_GRAVE, 0, 1, nil, CARD_ID_0)
  		or not Duel.IsExistingMatchingCard(Card.IsCode, p, LOCATION_GRAVE, 0, 1, nil, CARD_ID_1)
  		or not Duel.IsExistingMatchingCard(Card.IsCode, p, LOCATION_GRAVE, 0, 1, nil, CARD_ID_3)
  		or not Duel.IsExistingMatchingCard(Card.IsCode, p, LOCATION_GRAVE, 0, 1, nil, CARD_ID_2)
  end
  
  