name: Deskbot
card_text: Pendulum Scale = 1
  [ Pendulum Effect ]
  You cannot Pendulum Summon monsters, except "Deskbot" monsters. This effect cannot be negated.
  ----------------------------------------
  [ Monster Effect ]
  This card gains 500 ATK for each "Deskbot" card in your Graveyard. Your opponent cannot target face-up "Deskbot" cards with card effects, except this one. This card can make up to 2 attacks on monsters during each Battle Phase.
external_ids: local SETCARD_ID_0 = 0xab --Deskbot
  
lua: local SETCARD_ID_0 = 0xab --Deskbot
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--pendulum summon
  	aux.EnablePendulumAttribute(c)
  	--splimit
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetRange(LOCATION_PZONE)
  	e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CANNOT_DISABLE)
  	e2:SetTargetRange(1, 0)
  	e2:SetCondition(s.splimcon)
  	e2:SetTarget(s.splimit)
  	c:RegisterEffect(e2)
  	--atk
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE)
  	e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCode(EFFECT_UPDATE_ATTACK)
  	e3:SetValue(s.value)
  	c:RegisterEffect(e3)
  	--attack twice
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_SINGLE)
  	e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e4:SetRange(LOCATION_MZONE)
  	e4:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
  	e4:SetValue(1)
  	c:RegisterEffect(e4)
  	--cannot be target
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_FIELD)
  	e5:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
  	e5:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
  	e5:SetRange(LOCATION_MZONE)
  	e5:SetTargetRange(LOCATION_ONFIELD, LOCATION_ONFIELD)
  	e5:SetTarget(s.tglimit)
  	e5:SetValue(aux.tgoval)
  	c:RegisterEffect(e5)
  end
  function s.splimcon(e)
  	return not e:GetHandler():IsForbidden()
  end
  function s.splimit(e, c, tp, sumtp, sumpos)
  	return not c:IsSetCard(SETCARD_ID_0) and bit.band(sumtp, SUMMON_TYPE_PENDULUM) == SUMMON_TYPE_PENDULUM
  end
  function s.value(e, c)
  	return Duel.GetMatchingGroupCount(Card.IsSetCard, c:GetControler(), LOCATION_GRAVE, 0, nil, 0xab) * 500
  end
  function s.tglimit(e, c)
  	return c:IsSetCard(SETCARD_ID_0) and c ~= e:GetHandler()
  end
  
  
source_text: Deskbot
  Pendulum Scale = 1
  [ Pendulum Effect ]
  You cannot Pendulum Summon monsters, except "Deskbot" monsters. This effect cannot be negated.
  ----------------------------------------
  [ Monster Effect ]
  This card gains 500 ATK for each "Deskbot" card in your Graveyard. Your opponent cannot target face-up "Deskbot" cards with card effects, except this one. This card can make up to 2 attacks on monsters during each Battle Phase.
target_text: -- Deskbot
  local SETCARD_ID_0 = 0xab --Deskbot
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--pendulum summon
  	aux.EnablePendulumAttribute(c)
  	--splimit
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetRange(LOCATION_PZONE)
  	e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CANNOT_DISABLE)
  	e2:SetTargetRange(1, 0)
  	e2:SetCondition(s.splimcon)
  	e2:SetTarget(s.splimit)
  	c:RegisterEffect(e2)
  	--atk
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE)
  	e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCode(EFFECT_UPDATE_ATTACK)
  	e3:SetValue(s.value)
  	c:RegisterEffect(e3)
  	--attack twice
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_SINGLE)
  	e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e4:SetRange(LOCATION_MZONE)
  	e4:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
  	e4:SetValue(1)
  	c:RegisterEffect(e4)
  	--cannot be target
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_FIELD)
  	e5:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
  	e5:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
  	e5:SetRange(LOCATION_MZONE)
  	e5:SetTargetRange(LOCATION_ONFIELD, LOCATION_ONFIELD)
  	e5:SetTarget(s.tglimit)
  	e5:SetValue(aux.tgoval)
  	c:RegisterEffect(e5)
  end
  function s.splimcon(e)
  	return not e:GetHandler():IsForbidden()
  end
  function s.splimit(e, c, tp, sumtp, sumpos)
  	return not c:IsSetCard(SETCARD_ID_0) and bit.band(sumtp, SUMMON_TYPE_PENDULUM) == SUMMON_TYPE_PENDULUM
  end
  function s.value(e, c)
  	return Duel.GetMatchingGroupCount(Card.IsSetCard, c:GetControler(), LOCATION_GRAVE, 0, nil, 0xab) * 500
  end
  function s.tglimit(e, c)
  	return c:IsSetCard(SETCARD_ID_0) and c ~= e:GetHandler()
  end
  
  