if data.raw.unit["small-biter"] then
  if data.raw.unit["small-biter"].loot == nil then 
    data.raw.unit["small-biter"].loot = {}
  end
  if data.raw.item["small-alien-artifact"] then
    table.insert(data.raw.unit["small-biter"].loot, {  item = "small-alien-artifact",  count_min = 1,  count_max = 1,  probability = 0.5 } )
  end
end

if data.raw.unit["small-spitter"] then
  if data.raw.unit["small-spitter"].loot == nil then 
    data.raw.unit["small-spitter"].loot = {}
  end
  if data.raw.item["small-alien-artifact"] then
    table.insert(data.raw.unit["small-spitter"].loot, {  item = "small-alien-artifact",  count_min = 1,  count_max = 1,  probability = 0.5 } )
  end
end

if data.raw.unit["medium-biter"] then
  if data.raw.unit["medium-biter"].loot == nil then 
    data.raw.unit["medium-biter"].loot = {}
  end
  if data.raw.item["small-alien-artifact"] then
    table.insert(data.raw.unit["medium-biter"].loot, {  item = "small-alien-artifact",  count_min = 1,  count_max = 3,  probability = 0.75 } )
  end
end

if data.raw.unit["medium-spitter"] then
  if data.raw.unit["medium-spitter"].loot == nil then 
    data.raw.unit["medium-spitter"].loot = {}
  end
  if data.raw.item["small-alien-artifact"] then
    table.insert(data.raw.unit["medium-spitter"].loot, {  item = "small-alien-artifact",  count_min = 1,  count_max = 3,  probability = 0.75 } )
  end
end

if data.raw.unit["big-biter"]~=nil then
  if data.raw.unit["big-biter"].loot == nil then 
    data.raw.unit["big-biter"].loot = {}
  end
  if data.raw.item["small-alien-artifact"] then
    table.insert(data.raw.unit["big-biter"].loot, {  item = "small-alien-artifact",  count_min = 1,  count_max = 4,  probability = 1 } )
  end
end

if data.raw.unit["big-spitter"]~=nil then
  if data.raw.unit["big-spitter"].loot == nil then 
    data.raw.unit["big-spitter"].loot = {}
  end
  if data.raw.item["small-alien-artifact"] then
    table.insert(data.raw.unit["big-spitter"].loot, {  item = "small-alien-artifact",  count_min = 1,  count_max = 4,  probability = 1 } )
  end
end


if data.raw.unit["bob-big-piercing-biter"]~=nil then
  if data.raw.unit["bob-big-piercing-biter"].loot == nil then 
    data.raw.unit["bob-big-piercing-biter"].loot = {}
  end
  if data.raw.item["small-alien-artifact-blue"] then
    table.insert(data.raw.unit["bob-big-piercing-biter"].loot, {  item = "small-alien-artifact-blue",  count_min = 1,  count_max = 3,  probability = 1 } )
  else
    if data.raw.item["small-alien-artifact"] then
      table.insert(data.raw.unit["bob-big-piercing-biter"].loot, {  item = "small-alien-artifact",  count_min = 1,  count_max = 5,  probability = 1 } )
    end
  end
end

if data.raw.unit["bob-big-electric-spitter"]~=nil then
  if data.raw.unit["bob-big-electric-spitter"].loot == nil then 
    data.raw.unit["bob-big-electric-spitter"].loot = {}
  end
  if data.raw.item["small-alien-artifact-orange"] then
    table.insert(data.raw.unit["bob-big-electric-spitter"].loot, {  item = "small-alien-artifact-orange",  count_min = 1,  count_max = 3,  probability = 1 } )
  else
    if data.raw.item["small-alien-artifact"] then
      table.insert(data.raw.unit["bob-big-electric-spitter"].loot, {  item = "small-alien-artifact",  count_min = 1,  count_max = 5,  probability = 1 } )
    end
  end
end


if data.raw.unit["bob-huge-acid-biter"]~=nil then
  if data.raw.unit["bob-huge-acid-biter"].loot == nil then 
    data.raw.unit["bob-huge-acid-biter"].loot = {}
  end
  if data.raw.item["small-alien-artifact-blue"] then
    table.insert(data.raw.unit["bob-huge-acid-biter"].loot, {  item = "small-alien-artifact-blue",  count_min = 1,  count_max = 3,  probability = 0.25 } )
  end
  if data.raw.item["small-alien-artifact-purple"] then
    table.insert(data.raw.unit["bob-huge-acid-biter"].loot, {  item = "small-alien-artifact-purple",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["small-alien-artifact"] and data.raw.item["small-alien-artifact-blue"]==nil and data.raw.item["small-alien-artifact-purple"]==nil then
    table.insert(data.raw.unit["bob-huge-acid-biter"].loot, {  item = "small-alien-artifact",  count_min = 2,  count_max = 5,  probability = 1 } )
  end
end

if data.raw.unit["bob-huge-explosive-biter"]~=nil then
  if data.raw.unit["bob-huge-explosive-biter"].loot == nil then 
    data.raw.unit["bob-huge-explosive-biter"].loot = {}
  end
  if data.raw.item["small-alien-artifact-blue"] then
    table.insert(data.raw.unit["bob-huge-explosive-biter"].loot, {  item = "small-alien-artifact-blue",  count_min = 1,  count_max = 3,  probability = 0.25 } )
  end
  if data.raw.item["small-alien-artifact-yellow"] then
    table.insert(data.raw.unit["bob-huge-explosive-biter"].loot, {  item = "small-alien-artifact-yellow",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["small-alien-artifact"] and data.raw.item["small-alien-artifact-blue"]==nil and data.raw.item["small-alien-artifact-yellow"]==nil then
    table.insert(data.raw.unit["bob-huge-explosive-biter"].loot, {  item = "small-alien-artifact",  count_min = 2,  count_max = 5,  probability = 1 } )
  end
end


if data.raw.unit["bob-huge-explosive-spitter"]~=nil then
  if data.raw.unit["bob-huge-explosive-spitter"].loot == nil then 
    data.raw.unit["bob-huge-explosive-spitter"].loot = {}
  end
  if data.raw.item["small-alien-artifact-orange"] then
    table.insert(data.raw.unit["bob-huge-explosive-spitter"].loot, {  item = "small-alien-artifact-orange",  count_min = 1,  count_max = 3,  probability = 0.25 } )
  end
  if data.raw.item["small-alien-artifact-yellow"] then
    table.insert(data.raw.unit["bob-huge-explosive-spitter"].loot, {  item = "small-alien-artifact-yellow",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["small-alien-artifact"] and data.raw.item["small-alien-artifact-orange"]==nil and data.raw.item["small-alien-artifact-yellow"]==nil then
    table.insert(data.raw.unit["bob-huge-explosive-spitter"].loot, {  item = "small-alien-artifact",  count_min = 2,  count_max = 5,  probability = 1 } )
  end
end

if data.raw.unit["bob-huge-acid-spitter"]~=nil then
  if data.raw.unit["bob-huge-acid-spitter"].loot == nil then 
    data.raw.unit["bob-huge-acid-spitter"].loot = {}
  end
  if data.raw.item["small-alien-artifact-orange"] then
    table.insert(data.raw.unit["bob-huge-acid-spitter"].loot, {  item = "small-alien-artifact-orange",  count_min = 1,  count_max = 3,  probability = 0.25 } )
  end
  if data.raw.item["small-alien-artifact-purple"] then
    table.insert(data.raw.unit["bob-huge-acid-spitter"].loot, {  item = "small-alien-artifact-purple",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["small-alien-artifact"] and data.raw.item["small-alien-artifact-orange"]==nil and data.raw.item["small-alien-artifact-purple"]==nil then
    table.insert(data.raw.unit["bob-huge-acid-spitter"].loot, {  item = "small-alien-artifact",  count_min = 2,  count_max = 5,  probability = 1 } )
  end
end


if data.raw.unit["bob-giant-poison-biter"]~=nil then
  if data.raw.unit["bob-giant-poison-biter"].loot == nil then 
    data.raw.unit["bob-giant-poison-biter"].loot = {}
  end
  if data.raw.item["small-alien-artifact-blue"] then
    table.insert(data.raw.unit["bob-giant-poison-biter"].loot, {  item = "small-alien-artifact-blue",  count_min = 1,  count_max = 3,  probability = 0.5 } )
  end
  if data.raw.item["small-alien-artifact-green"] then
    table.insert(data.raw.unit["bob-giant-poison-biter"].loot, {  item = "small-alien-artifact-green",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["small-alien-artifact"] and data.raw.item["small-alien-artifact-blue"]==nil and data.raw.item["small-alien-artifact-green"]==nil then
    table.insert(data.raw.unit["bob-giant-poison-biter"].loot, {  item = "small-alien-artifact",  count_min = 3,  count_max = 6,  probability = 1 } )
  end
end

if data.raw.unit["bob-giant-fire-biter"]~=nil then
  if data.raw.unit["bob-giant-fire-biter"].loot == nil then 
    data.raw.unit["bob-giant-fire-biter"].loot = {}
  end
  if data.raw.item["small-alien-artifact-blue"] then
    table.insert(data.raw.unit["bob-giant-fire-biter"].loot, {  item = "small-alien-artifact-blue",  count_min = 1,  count_max = 3,  probability = 0.5 } )
  end
  if data.raw.item["small-alien-artifact-red"] then
    table.insert(data.raw.unit["bob-giant-fire-biter"].loot, {  item = "small-alien-artifact-red",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["small-alien-artifact"] and data.raw.item["small-alien-artifact-blue"]==nil and data.raw.item["small-alien-artifact-red"]==nil then
    table.insert(data.raw.unit["bob-giant-fire-biter"].loot, {  item = "small-alien-artifact",  count_min = 3,  count_max = 6,  probability = 1 } )
  end
end


if data.raw.unit["bob-giant-fire-spitter"]~=nil then
  if data.raw.unit["bob-giant-fire-spitter"].loot == nil then 
    data.raw.unit["bob-giant-fire-spitter"].loot = {}
  end
  if data.raw.item["small-alien-artifact-orange"] then
    table.insert(data.raw.unit["bob-giant-fire-spitter"].loot, {  item = "small-alien-artifact-orange",  count_min = 1,  count_max = 3,  probability = 0.5 } )
  end
  if data.raw.item["small-alien-artifact-red"] then
    table.insert(data.raw.unit["bob-giant-fire-spitter"].loot, {  item = "small-alien-artifact-red",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["small-alien-artifact"] and data.raw.item["small-alien-artifact-orange"]==nil and data.raw.item["small-alien-artifact-red"]==nil then
    table.insert(data.raw.unit["bob-giant-fire-spitter"].loot, {  item = "small-alien-artifact",  count_min = 3,  count_max = 6,  probability = 1 } )
  end
end

if data.raw.unit["bob-giant-poison-spitter"]~=nil then
  if data.raw.unit["bob-giant-poison-spitter"].loot == nil then 
    data.raw.unit["bob-giant-poison-spitter"].loot = {}
  end
  if data.raw.item["small-alien-artifact-orange"] then
    table.insert(data.raw.unit["bob-giant-poison-spitter"].loot, {  item = "small-alien-artifact-orange",  count_min = 1,  count_max = 3,  probability = 0.5 } )
  end
  if data.raw.item["small-alien-artifact-green"] then
    table.insert(data.raw.unit["bob-giant-poison-spitter"].loot, {  item = "small-alien-artifact-green",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["small-alien-artifact"] and data.raw.item["small-alien-artifact-orange"]==nil and data.raw.item["small-alien-artifact-green"]==nil then
    table.insert(data.raw.unit["bob-giant-poison-spitter"].loot, {  item = "small-alien-artifact",  count_min = 3,  count_max = 6,  probability = 1 } )
  end
end


if data.raw.unit["bob-titan-biter"]~=nil then
  if data.raw.unit["bob-titan-biter"].loot == nil then 
    data.raw.unit["bob-titan-biter"].loot = {}
  end
  if data.raw.item["small-alien-artifact-blue"] then
    table.insert(data.raw.unit["bob-titan-biter"].loot, {  item = "small-alien-artifact-blue",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["small-alien-artifact-purple"] then
    table.insert(data.raw.unit["bob-titan-biter"].loot, { item = "small-alien-artifact-purple",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["small-alien-artifact-green"] then
    table.insert(data.raw.unit["bob-titan-biter"].loot, {  item = "small-alien-artifact-green",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["small-alien-artifact-blue"]==nil and data.raw.item["small-alien-artifact-purple"]==nil and data.raw.item["small-alien-artifact-green"]==nil then
    if data.raw.item["small-alien-artifact"] then
      table.insert(data.raw.unit["bob-titan-biter"].loot, {  item = "small-alien-artifact",  count_min = 4,  count_max = 12,  probability = 1 } )
    else
      table.insert(data.raw.unit["bob-titan-biter"].loot, {  item = "alien-artifact",  count_min = 1,  count_max = 2,  probability = 0.5 } )
    end
  end
end

if data.raw.unit["bob-titan-spitter"]~=nil then
  if data.raw.unit["bob-titan-spitter"].loot == nil then 
    data.raw.unit["bob-titan-spitter"].loot = {}
  end
  if data.raw.item["small-alien-artifact-orange"] then
    table.insert(data.raw.unit["bob-titan-spitter"].loot, {  item = "small-alien-artifact-orange",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["small-alien-artifact-yellow"] then
    table.insert(data.raw.unit["bob-titan-spitter"].loot, { item = "small-alien-artifact-yellow",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["small-alien-artifact-red"] then
    table.insert(data.raw.unit["bob-titan-spitter"].loot, {  item = "small-alien-artifact-red",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["small-alien-artifact-orange"]==nil and data.raw.item["small-alien-artifact-yellow"]==nil and data.raw.item["small-alien-artifact-red"]==nil then
    if data.raw.item["small-alien-artifact"] then
      table.insert(data.raw.unit["bob-titan-spitter"].loot, {  item = "small-alien-artifact",  count_min = 4,  count_max = 12,  probability = 1 } )
    else
      table.insert(data.raw.unit["bob-titan-spitter"].loot, {  item = "alien-artifact",  count_min = 1,  count_max = 2,  probability = 0.5 } )
    end
  end
end


if data.raw.unit["behemoth-biter"]~=nil then
  data.raw.unit["behemoth-biter"].attack_parameters.animation = biterattackanimation(bob_behemoth_scale, behemoth_biter_tint1, behemoth_biter_tint2)
  data.raw.unit["behemoth-biter"].run_animation = biterrunanimation(bob_behemoth_scale, behemoth_biter_tint1, behemoth_biter_tint2)
  data.raw.unit["behemoth-biter"].collision_box = {{-0.8, -0.8}, {0.8, 0.8}}
  data.raw.unit["behemoth-biter"].selection_box = {{-1.5, -3}, {1.5, 0.6}}

  data.raw.corpse["behemoth-biter-corpse"].animation = biterdieanimation(bob_behemoth_scale, behemoth_biter_tint1, behemoth_biter_tint2)
  data.raw.corpse["behemoth-biter-corpse"].selection_box = {{-2, -2}, {2, 2}}

  if data.raw.unit["behemoth-biter"].loot == nil then 
    data.raw.unit["behemoth-biter"].loot = {}
  end
  if data.raw.item["small-alien-artifact"] then
    table.insert(data.raw.unit["behemoth-biter"].loot, {  item = "small-alien-artifact",  count_min = 4,  count_max = 12,  probability = 1 } )
  else
    table.insert(data.raw.unit["behemoth-biter"].loot, {  item = "alien-artifact",  count_min = 1,  count_max = 2,  probability = 0.5 } )
  end
end


if data.raw.unit["behemoth-spitter"]~=nil then
  data.raw.unit["behemoth-spitter"].attack_parameters = spitterattackparameters({range=15, cooldown=100, damage_modifier=5, scale=bob_behemoth_scale, tint=behemothspittertint})
  data.raw.unit["behemoth-spitter"].run_animation = spitterrunanimation(bob_behemoth_scale, behemothspittertint)
  data.raw.unit["behemoth-spitter"].collision_box = {{-1, -1}, {1, 1}}
  data.raw.unit["behemoth-spitter"].selection_box = {{-1.5, -2}, {1.5, 2}}

  data.raw.corpse["behemoth-spitter-corpse"].animation = spitterdyinganimation(bob_behemoth_scale, behemothspittertint)
  data.raw.corpse["behemoth-spitter-corpse"].collision_box = {{-1.5, -1.5}, {1.5, 1.5}}
  data.raw.corpse["behemoth-spitter-corpse"].selection_box = {{-1.5, -2}, {1.5, 2}}

  if data.raw.unit["behemoth-spitter"].loot == nil then 
    data.raw.unit["behemoth-spitter"].loot = {}
  end
  if data.raw.item["small-alien-artifact"] then
    table.insert(data.raw.unit["behemoth-spitter"].loot, {  item = "small-alien-artifact",  count_min = 4,  count_max = 12,  probability = 1 } )
  else
    table.insert(data.raw.unit["behemoth-spitter"].loot, {  item = "alien-artifact",  count_min = 1,  count_max = 2,  probability = 0.5 } )
  end
end



if data.raw.unit["bob-behemoth-biter"]~=nil then
  if data.raw.unit["bob-behemoth-biter"].loot == nil then 
    data.raw.unit["bob-behemoth-biter"].loot = {}
  end
  if data.raw.item["small-alien-artifact-blue"] then
    table.insert(data.raw.unit["bob-behemoth-biter"].loot, {  item = "small-alien-artifact-blue",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["small-alien-artifact-purple"] then
    table.insert(data.raw.unit["bob-behemoth-biter"].loot, { item = "small-alien-artifact-purple",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["small-alien-artifact-green"] then
    table.insert(data.raw.unit["bob-behemoth-biter"].loot, {  item = "small-alien-artifact-green",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["small-alien-artifact-red"] then
    table.insert(data.raw.unit["bob-behemoth-biter"].loot, {  item = "small-alien-artifact-red",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["small-alien-artifact-blue"]==nil and data.raw.item["small-alien-artifact-purple"]==nil and data.raw.item["small-alien-artifact-green"]==nil and data.raw.item["small-alien-artifact-red"]==nil then
    if data.raw.item["small-alien-artifact"] then
      table.insert(data.raw.unit["bob-behemoth-biter"].loot, {  item = "small-alien-artifact",  count_min = 5,  count_max = 15,  probability = 1 } )
    else
      table.insert(data.raw.unit["bob-behemoth-biter"].loot, {  item = "alien-artifact",  count_min = 1,  count_max = 3,  probability = 0.5 } )
    end
  end
end

if data.raw.unit["bob-behemoth-spitter"]~=nil then
  if data.raw.unit["bob-behemoth-spitter"].loot == nil then 
    data.raw.unit["bob-behemoth-spitter"].loot = {}
  end
  if data.raw.item["small-alien-artifact-orange"] then
    table.insert(data.raw.unit["bob-behemoth-spitter"].loot, {  item = "small-alien-artifact-orange",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["small-alien-artifact-yellow"] then
    table.insert(data.raw.unit["bob-behemoth-spitter"].loot, { item = "small-alien-artifact-yellow",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["small-alien-artifact-green"] then
    table.insert(data.raw.unit["bob-behemoth-spitter"].loot, {  item = "small-alien-artifact-green",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["small-alien-artifact-red"] then
    table.insert(data.raw.unit["bob-behemoth-spitter"].loot, {  item = "small-alien-artifact-red",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["small-alien-artifact-red"]==nil and data.raw.item["small-alien-artifact-orange"]==nil and data.raw.item["small-alien-artifact-yellow"]==nil and data.raw.item["small-alien-artifact-green"]==nil then
    if data.raw.item["small-alien-artifact"] then
      table.insert(data.raw.unit["bob-behemoth-spitter"].loot, {  item = "small-alien-artifact",  count_min = 5,  count_max = 15,  probability = 1 } )
    else
      table.insert(data.raw.unit["bob-behemoth-spitter"].loot, {  item = "alien-artifact",  count_min = 1,  count_max = 3,  probability = 0.5 } )
    end
  end
end


if data.raw.unit["bob-leviathan-biter"]~=nil then
  if data.raw.unit["bob-leviathan-biter"].loot == nil then 
    data.raw.unit["bob-leviathan-biter"].loot = {}
  end
  if data.raw.item["alien-artifact-blue"] then
    table.insert(data.raw.unit["bob-leviathan-biter"].loot, {  item = "alien-artifact-blue",  count_min = 1,  count_max = 2,  probability = 1 } )
  end
  if data.raw.item["alien-artifact-purple"] then
    table.insert(data.raw.unit["bob-leviathan-biter"].loot, { item = "alien-artifact-purple",  count_min = 1,  count_max = 2,  probability = 1 } )
  end
  if data.raw.item["alien-artifact-orange"] then
    table.insert(data.raw.unit["bob-leviathan-biter"].loot, {  item = "alien-artifact-orange",  count_min = 1,  count_max = 2,  probability = 0.5 } )
  end
  if data.raw.item["alien-artifact-yellow"] then
    table.insert(data.raw.unit["bob-leviathan-biter"].loot, { item = "alien-artifact-yellow",  count_min = 1,  count_max = 2,  probability = 0.5 } )
  end
  if data.raw.item["alien-artifact-green"] then
    table.insert(data.raw.unit["bob-leviathan-biter"].loot, {  item = "alien-artifact-green",  count_min = 1,  count_max = 2,  probability = 1 } )
  end
  if data.raw.item["alien-artifact-red"] then
    table.insert(data.raw.unit["bob-leviathan-biter"].loot, {  item = "alien-artifact-red",  count_min = 1,  count_max = 2,  probability = 0.5 } )
  end
  if data.raw.item["alien-artifact-blue"]==nil and data.raw.item["alien-artifact-purple"]==nil and data.raw.item["alien-artifact-red"]==nil and data.raw.item["alien-artifact-orange"]==nil and data.raw.item["alien-artifact-yellow"]==nil and data.raw.item["alien-artifact-green"]==nil then
    table.insert(data.raw.unit["bob-leviathan-biter"].loot, {  item = "alien-artifact",  count_min = 4,  count_max = 8,  probability = 1 } )
  end
end

if data.raw.unit["bob-leviathan-spitter"]~=nil then
  if data.raw.unit["bob-leviathan-spitter"].loot == nil then 
    data.raw.unit["bob-leviathan-spitter"].loot = {}
  end
  if data.raw.item["alien-artifact-blue"] then
    table.insert(data.raw.unit["bob-leviathan-spitter"].loot, {  item = "alien-artifact-blue",  count_min = 1,  count_max = 2,  probability = 0.5 } )
  end
  if data.raw.item["alien-artifact-purple"] then
    table.insert(data.raw.unit["bob-leviathan-spitter"].loot, { item = "alien-artifact-purple",  count_min = 1,  count_max = 2,  probability = 0.5 } )
  end
  if data.raw.item["alien-artifact-orange"] then
    table.insert(data.raw.unit["bob-leviathan-spitter"].loot, {  item = "alien-artifact-orange",  count_min = 1,  count_max = 2,  probability = 1 } )
  end
  if data.raw.item["alien-artifact-yellow"] then
    table.insert(data.raw.unit["bob-leviathan-spitter"].loot, { item = "alien-artifact-yellow",  count_min = 1,  count_max = 2,  probability = 1 } )
  end
  if data.raw.item["alien-artifact-green"] then
    table.insert(data.raw.unit["bob-leviathan-spitter"].loot, {  item = "alien-artifact-green",  count_min = 1,  count_max = 2,  probability = 0.5 } )
  end
  if data.raw.item["alien-artifact-red"] then
    table.insert(data.raw.unit["bob-leviathan-spitter"].loot, {  item = "alien-artifact-red",  count_min = 1,  count_max = 2,  probability = 1 } )
  end
  if data.raw.item["alien-artifact-blue"]==nil and data.raw.item["alien-artifact-purple"]==nil and data.raw.item["alien-artifact-red"]==nil and data.raw.item["alien-artifact-orange"]==nil and data.raw.item["alien-artifact-yellow"]==nil and data.raw.item["alien-artifact-green"]==nil then
    table.insert(data.raw.unit["bob-leviathan-spitter"].loot, {  item = "alien-artifact",  count_min = 4,  count_max = 8,  probability = 1 } )
  end
end



if data.raw["unit-spawner"]["bob-biter-spawner"] then
  if data.raw["unit-spawner"]["bob-biter-spawner"].loot == nil then 
    data.raw["unit-spawner"]["bob-biter-spawner"].loot = {}
  end
  if data.raw.item["alien-artifact-blue"] then
    table.insert(data.raw["unit-spawner"]["bob-biter-spawner"].loot, {  item = "alien-artifact-blue",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["alien-artifact-purple"] then
    table.insert(data.raw["unit-spawner"]["bob-biter-spawner"].loot, {  item = "alien-artifact-purple",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["alien-artifact-blue"] then
    table.insert(data.raw["unit-spawner"]["bob-biter-spawner"].loot, {  item = "alien-artifact-green",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
end

if data.raw["unit-spawner"]["bob-spitter-spawner"] then
  if data.raw["unit-spawner"]["bob-spitter-spawner"].loot == nil then 
    data.raw["unit-spawner"]["bob-spitter-spawner"].loot = {}
  end
  if data.raw.item["alien-artifact-orange"] then
    table.insert(data.raw["unit-spawner"]["bob-spitter-spawner"].loot, {  item = "alien-artifact-orange",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["alien-artifact-red"] then
    table.insert(data.raw["unit-spawner"]["bob-spitter-spawner"].loot, {  item = "alien-artifact-red",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
  if data.raw.item["alien-artifact-yellow"] then
    table.insert(data.raw["unit-spawner"]["bob-spitter-spawner"].loot, {  item = "alien-artifact-yellow",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
end


if data.raw.turret["small-worm-turret"] then
  if data.raw.turret["small-worm-turret"].loot == nil then 
    data.raw.turret["small-worm-turret"].loot = {}
  end
  if data.raw.item["alien-artifact"] then
    table.insert(data.raw.turret["small-worm-turret"].loot, { item = "alien-artifact",  count_min = 1,  count_max = 3,  probability = 1 } )
  end
end

if data.raw.turret["medium-worm-turret"] then
  if data.raw.turret["medium-worm-turret"].loot == nil then 
    data.raw.turret["medium-worm-turret"].loot = {}
  end
  if data.raw.item["alien-artifact"] then
    table.insert(data.raw.turret["medium-worm-turret"].loot, { item = "alien-artifact",  count_min = 2,  count_max = 4,  probability = 1 } )
  end
end

if data.raw.turret["big-worm-turret"] then
  if data.raw.turret["big-worm-turret"].loot == nil then 
    data.raw.turret["big-worm-turret"].loot = {}
  end
  if data.raw.item["alien-artifact-blue"] then
    table.insert(data.raw.turret["big-worm-turret"].loot, { item = "alien-artifact-blue",  count_min = 1,  count_max = 2,  probability = 0.5 } )
  end
  if data.raw.item["alien-artifact-purple"] then
    table.insert(data.raw.turret["big-worm-turret"].loot, { item = "alien-artifact-purple",  count_min = 1,  count_max = 2,  probability = 1 } )
  end
  if data.raw.item["alien-artifact"] and data.raw.item["alien-artifact-blue"]==nil and data.raw.item["alien-artifact-purple"]==nil then
    table.insert(data.raw.turret["big-worm-turret"].loot, { item = "alien-artifact",  count_min = 3,  count_max = 6,  probability = 1 } )
  else
    table.insert(data.raw.turret["big-worm-turret"].loot, { item = "alien-artifact",  count_min = 2,  count_max = 4,  probability = 1 } )
  end
end

if data.raw.turret["bob-big-explosive-worm-turret"] then
  if data.raw.turret["bob-big-explosive-worm-turret"].loot == nil then 
    data.raw.turret["bob-big-explosive-worm-turret"].loot = {}
  end
  if data.raw.item["alien-artifact-orange"] then
    table.insert(data.raw.turret["bob-big-explosive-worm-turret"].loot, { item = "alien-artifact-orange",  count_min = 1,  count_max = 2,  probability = 0.5 } )
  end
  if data.raw.item["alien-artifact-yellow"] then
    table.insert(data.raw.turret["bob-big-explosive-worm-turret"].loot, { item = "alien-artifact-yellow",  count_min = 1,  count_max = 2,  probability = 1 } )
  end
  if data.raw.item["alien-artifact"] and data.raw.item["alien-artifact-orange"]==nil and data.raw.item["alien-artifact-yellow"]==nil then
    table.insert(data.raw.turret["bob-big-explosive-worm-turret"].loot, { item = "alien-artifact",  count_min = 3,  count_max = 6,  probability = 1 } )
  else
    table.insert(data.raw.turret["bob-big-explosive-worm-turret"].loot, { item = "alien-artifact",  count_min = 2,  count_max = 4,  probability = 1 } )
  end
end

if data.raw.turret["bob-big-poison-worm-turret"] then
  if data.raw.turret["bob-big-poison-worm-turret"].loot == nil then 
    data.raw.turret["bob-big-poison-worm-turret"].loot = {}
  end
  if data.raw.item["alien-artifact-blue"] then
    table.insert(data.raw.turret["bob-big-poison-worm-turret"].loot, { item = "alien-artifact-blue",  count_min = 1,  count_max = 2,  probability = 0.5 } )
  end
  if data.raw.item["alien-artifact-green"] then
    table.insert(data.raw.turret["bob-big-poison-worm-turret"].loot, { item = "alien-artifact-green",  count_min = 1,  count_max = 2,  probability = 1 } )
  end
  if data.raw.item["alien-artifact"] and data.raw.item["alien-artifact-blue"]==nil and data.raw.item["alien-artifact-green"]==nil then
    table.insert(data.raw.turret["bob-big-poison-worm-turret"].loot, { item = "alien-artifact",  count_min = 3,  count_max = 6,  probability = 1 } )
  else
    table.insert(data.raw.turret["bob-big-poison-worm-turret"].loot, { item = "alien-artifact",  count_min = 2,  count_max = 4,  probability = 1 } )
  end
end

if data.raw.turret["bob-big-fire-worm-turret"] then
  if data.raw.turret["bob-big-fire-worm-turret"].loot == nil then 
    data.raw.turret["bob-big-fire-worm-turret"].loot = {}
  end
  if data.raw.item["alien-artifact-orange"] then
    table.insert(data.raw.turret["bob-big-fire-worm-turret"].loot, { item = "alien-artifact-orange",  count_min = 1,  count_max = 2,  probability = 0.5 } )
  end
  if data.raw.item["alien-artifact-red"] then
    table.insert(data.raw.turret["bob-big-fire-worm-turret"].loot, { item = "alien-artifact-red",  count_min = 1,  count_max = 2,  probability = 1 } )
  end
  if data.raw.item["alien-artifact"] and data.raw.item["alien-artifact-orange"]==nil and data.raw.item["alien-artifact-red"]==nil then
    table.insert(data.raw.turret["bob-big-fire-worm-turret"].loot, { item = "alien-artifact",  count_min = 3,  count_max = 6,  probability = 1 } )
  else
    table.insert(data.raw.turret["bob-big-fire-worm-turret"].loot, { item = "alien-artifact",  count_min = 2,  count_max = 4,  probability = 1 } )
  end
end


