1dirname = path.dirname(__file__)
2
3animations = {
4   idle = {
5      pictures = path.list_files(dirname .. "idle_??.png"),
6      hotspot = { 9, 24 },
7   },
8   planting = {
9      pictures = path.list_files(dirname .. "plant_??.png"),
10      hotspot = { 13, 32 },
11      fps = 10
12   },
13   harvesting = {
14      pictures = path.list_files(dirname .. "harvest_??.png"),
15      hotspot = { 13, 32 },
16      fps = 10
17   },
18   gathering = {
19      pictures = path.list_files(dirname .. "gather_??.png"),
20      hotspot = { 13, 32 },
21      fps = 10
22   }
23}
24add_directional_animation(animations, "walk", dirname, "walk", {13, 24}, 10)
25add_directional_animation(animations, "walkload", dirname, "walk", {13, 24}, 10)
26
27
28tribes:new_worker_type {
29   msgctxt = "atlanteans_worker",
30   name = "atlanteans_blackroot_farmer",
31   -- TRANSLATORS: This is a worker name used in lists of workers
32   descname = pgettext("atlanteans_worker", "Blackroot Farmer"),
33   helptext_script = dirname .. "helptexts.lua",
34   icon = dirname .. "menu.png",
35   vision_range = 2,
36
37   buildcost = {
38      atlanteans_carrier = 1,
39      shovel = 1
40   },
41
42   programs = {
43      plant = {
44         "findspace=size:any radius:2",
45         "walk=coords",
46         "animate=planting 9000",
47         "plant=attrib:seed_blackroot",
48         "animate=planting 9000",
49         "return"
50      },
51      harvest = {
52         "findobject=attrib:ripe_blackroot radius:2",
53         "walk=object",
54         "animate=harvesting 10000",
55         "callobject=harvest",
56         "animate=gathering 4000",
57         "createware=blackroot",
58         "return"
59      }
60   },
61
62   animations = animations,
63}
64