tigres810

unit.lua

Jun 29th, 2023
1,034
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.86 KB | Source Code | 0 0
  1. local sounds = require("__base__.prototypes.entity.sounds");
  2.  
  3. local testunit = {
  4.   type = "unit",
  5.   name = "pig",
  6.   icon = "__TestMod__/graphics/icons/testunit.png",
  7.   icon_size = 64,
  8.   flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air", "not-repairable"},
  9.   max_health = 50,
  10.   order = "b-b-a",
  11.   subgroup = "enemies",
  12.   healing_per_tick = 0.01,
  13.   collision_box = {{-0.3, -0.3}, {0.3, 0.3}},
  14.   selection_box = {{-0.5, -1.5}, {0.5, 0.5}},
  15.   attack_parameters =
  16.   {
  17.     type = "projectile",
  18.     ammo_category = "melee",
  19.     ammo_type = make_unit_melee_ammo_type(20),
  20.     cooldown = 35,
  21.     damage_modifier = 1,
  22.     projectile_center = {0, 1},
  23.     projectile_creation_distance = 0.6,
  24.     range = 1,
  25.     sound = sounds.biter_roars(0.4),
  26.     animation = biterattackanimation(0.5, {r = 1, g = 1, b = 1, a = 1}, {r = 1, g = 1, b = 1, a = 1})
  27.   },
  28.   vision_distance = 30,
  29.   movement_speed = 0.2,
  30.   distance_per_frame = 0.1,
  31.   pollution_to_join_attack = 200,
  32.   distraction_cooldown = 300,
  33.   min_pursue_time = 10 * 60,
  34.   max_pursue_distance = 50,
  35.   corpse = "medium-biter-corpse",
  36.   dying_explosion = "blood-explosion-small",
  37.   working_sound = sounds.biter_calls(0.4),
  38.   dying_sound = sounds.biter_dying(0.9),
  39.   run_animation =
  40.   {
  41.     layers =
  42.     {
  43.       {
  44.         filenames = {
  45.           "__TestMod__/graphics/unit/pig-01.png",
  46.           "__TestMod__/graphics/unit/pig-02.png",
  47.           "__TestMod__/graphics/unit/pig-03.png",
  48.           "__TestMod__/graphics/unit/pig-04.png",
  49.         },
  50.         slice = 4,
  51.         lines_per_file = 4,
  52.         width = 238,
  53.         height = 134,
  54.         frame_count = 4,
  55.         direction_count = 4,
  56.         line_length = 4,
  57.         animation_speed = 0.4,
  58.         scale = 0.5
  59.       }
  60.     }
  61.   },
  62.   friendly = false,
  63.   call_for_help_radius = 0
  64. }
  65.  
  66. data:extend({
  67.     testunit
  68. })
Advertisement
Add Comment
Please, Sign In to add comment