]> git.lizzy.rs Git - Crafter.git/blob - mods/mob/init.lua
afe0f9a5d5e15005446757b9d71c113f4bbf45dd
[Crafter.git] / mods / mob / init.lua
1 --this is where mobs are defined
2
3 --this is going to be used to set an active mob limit
4 global_mob_amount = 0
5 mob_limit = 100
6
7 local path = minetest.get_modpath(minetest.get_current_modname())
8
9 dofile(path.."/spawning.lua")
10 dofile(path.."/api/api_hook.lua")
11 dofile(path.."/items.lua")
12 dofile(path.."/chatcommands.lua")
13
14
15 mobs.register_mob(
16         {
17          mobname = "pig",
18          physical = true,
19          collide_with_objects = false,
20          collisionbox = {-0.37, 0, -0.37, 0.37, 0.5, 0.37},
21          visual = "mesh",
22          visual_size = {x = 3, y = 3},
23          mesh = "pig.b3d",
24          textures = {
25                  --blank out the first two to create adult pig
26                 "pig.png"
27          },
28          
29          --these are used to anchor a point to the head position
30
31
32          -----
33          head_bone = "head",
34          debug_head_pos = false,
35          head_directional_offset = 0.5, --used in vector.multiply(minetest.yaw_to_dir(body_yaw),head_offset)
36          head_height_offset = 0.8, --added to the base y position
37          --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
38          head_position_correction = vector.new(0,3,-0.5),
39          --this is used to tell the game the orientation of the bone (swaps x to and y, then z and y)
40          head_coord = "horizontal",
41          -----
42          
43          is_visible = true,
44          pointable = true,
45          automatic_face_movement_dir = 0,
46          automatic_face_movement_max_rotation_per_sec = 300,
47          makes_footstep_sound = false,
48          hp = 10,
49          gravity = {x = 0, y = -9.81, z = 0},
50          movement_type = "walk",
51          max_speed = 5,
52          state = 0,
53          view_distance = 15,
54          
55          item_drop = "mob:raw_porkchop", 
56          standing_frame = {x=0,y=0},
57          moving_frame = {x=0,y=40},
58          animation_multiplier = 20,
59          ----
60          ----
61          death_rotation = "x",
62          
63          hurt_sound = "pig",
64          die_sound = "pig_die",
65          
66          
67          hostile = false,
68          attacked_hostile = false,
69          attack_type = "punch",
70          group_attack = true,
71          --explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
72          --explosion_power = 7, -- how big the explosion has to be
73          --explosion_time = 3, -- how long it takes for a mob to explode
74         }
75 )
76
77 mobs.register_mob(
78         {
79          mobname = "phyg",
80          physical = true,
81          collide_with_objects = false,
82          collisionbox = {-0.37, 0, -0.37, 0.37, 0.5, 0.37},
83          visual = "mesh",
84          visual_size = {x = 3, y = 3},
85          mesh = "phyg.b3d",
86          textures = {
87                  --blank out the first two to create adult pig
88                 "phyg.png","wings.png"
89          },
90          
91          --these are used to anchor a point to the head position
92
93
94          -----
95          head_bone = "head",
96          debug_head_pos = false,
97          head_directional_offset = 0.5, --used in vector.multiply(minetest.yaw_to_dir(body_yaw),head_offset)
98          head_height_offset = 0.8, --added to the base y position
99          --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
100          head_position_correction = vector.new(0,3,-0.5),
101          --this is used to tell the game the orientation of the bone (swaps x to and y, then z and y)
102          head_coord = "horizontal",
103          -----
104          
105          is_visible = true,
106          pointable = true,
107          automatic_face_movement_dir = 0,
108          automatic_face_movement_max_rotation_per_sec = 300,
109          makes_footstep_sound = false,
110          hp = 10,
111          gravity = {x = 0, y = -9.81, z = 0},
112          movement_type = "walk",
113          max_speed = 5,
114          state = 0,
115          view_distance = 15,
116          
117          item_drop = "mob:raw_porkchop", 
118          standing_frame = {x=0,y=0},
119          moving_frame = {x=0,y=40},
120          animation_multiplier = 20,
121          ----
122          ----
123          death_rotation = "x",
124          
125          hurt_sound = "pig",
126          die_sound = "pig_die",
127          
128          
129          hostile = false,
130          attacked_hostile = false,
131          attack_type = "punch",
132          group_attack = true,
133          --explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
134          --explosion_power = 7, -- how big the explosion has to be
135          --explosion_time = 3, -- how long it takes for a mob to explode
136         }
137 )
138
139
140 --[[
141 mobs.register_mob(
142         {
143          mobname = "chicken",
144          physical = true,
145          collide_with_objects = false,
146          collisionbox = {-0.37, -0.4, -0.37, 0.37, 0.5, 0.37},
147          visual = "mesh",
148          visual_size = {x = 3, y = 3},
149          mesh = "chicken.b3d",
150          textures = {
151                  --if you're wondering what mob this is, it's a chicken
152                 "chicken.png","chicken.png","chicken.png","chicken.png","chicken.png","chicken.png","chicken.png","chicken.png","chicken.png","chicken.png","chicken.png","chicken.png","chicken.png","chicken.png"
153          },
154          is_visible = true,
155          pointable = true,
156          automatic_face_movement_dir = -90.0,
157          automatic_face_movement_max_rotation_per_sec = 300,
158          makes_footstep_sound = false,
159          hp = 10,
160          gravity = {x = 0, y = -9.81, z = 0},
161          movement_type = "walk",
162          max_speed = 5,
163          hostile = false,
164          state = 0,
165          view_distance = 15,
166          
167          item_drop = "mob:raw_porkchop", 
168          standing_frame = {x=0,y=0},
169          moving_frame = {x=5,y=15},
170          animation_multiplier = 5,
171          ----
172           
173          has_head = true, --remove this when mesh based head rotation is implemented
174          head_visual = "mesh",
175          head_visual_size = {x = 1.1, y = 1.1},
176          head_mesh = "pig_head.x",
177          head_textures ={"head.png","nose.png"},
178          head_mount = vector.new(0,1.2,1.9),
179          
180          death_rotation = "z",
181          
182          hurt_sound = "pig",
183          die_sound = "pig_die",
184          
185          attack_type = "punch",
186          --explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
187          --explosion_power = 7, -- how big the explosion has to be
188          --explosion_time = 3, -- how long it takes for a mob to explode
189         }
190 )
191
192
193 mobs.register_mob(
194         {
195          mobname = "slime",
196          physical = true,
197          collide_with_objects = false,
198          collisionbox = {-0.37, -0.4, -0.37, 0.37, 0.5, 0.37},
199          visual = "mesh",
200          visual_size = {x = 3, y = 3},
201          mesh = "slime.x",
202          textures = {
203                 "slimecore.png","slimeeye.png","slimeeye.png","slimeeye.png","slimeoutside.png"
204          },
205          is_visible = true,
206          pointable = true,
207          automatic_face_movement_dir = 180,
208          automatic_face_movement_max_rotation_per_sec = 300,
209          makes_footstep_sound = false,
210          hp = 10,
211          gravity = {x = 0, y = -9.81, z = 0},
212          movement_type = "jump",
213          max_speed = 5,
214          hostile = true,
215          state = 0,
216          view_distance = 20,
217          item_drop = "mob:slimeball",
218         
219          standing_frame = {x=0,y=0},
220          moving_frame = {x=0,y=0},
221          animation_multiplier = 5,
222          ----
223          has_head = false, --remove this when mesh based head rotation is implemented
224          
225          death_rotation = "x",
226          
227          hurt_sound = "slime_die",
228          die_sound = "slime_die",
229          
230          attack_type = "punch",
231          die_in_light = true,
232          die_in_light_level = 12,
233         }
234 )
235
236
237 mobs.register_mob(
238         {
239          mobname = "flying_pig",
240          physical = true,
241          collide_with_objects = false,
242          collisionbox = {-0.37, -0.4, -0.37, 0.37, 0.5, 0.37},
243          visual = "mesh",
244          visual_size = {x = 3, y = 3},
245          mesh = "pig.x",
246          textures = {
247                 "flying_pig_body.png","flying_pig_leg.png","flying_pig_leg.png","flying_pig_leg.png","flying_pig_leg.png"
248         },
249          is_visible = true,
250          pointable = true,
251          automatic_face_movement_dir = -90.0,
252          automatic_face_movement_max_rotation_per_sec = 300,
253          makes_footstep_sound = false,
254          hp = 10,
255          gravity = {x = 0, y = -1, z = 0},
256          movement_type = "jump",
257          max_speed = 5,
258          hostile = true,
259          state = 0,
260          view_distance = 50,
261          item_drop = "main:gold",
262          item_minimum = 4,
263          item_amount = 5,
264           
265          standing_frame = {x=0,y=0},
266          moving_frame = {x=5,y=15},
267          animation_multiplier = 5,
268          ----
269           
270          has_head = true, --remove this when mesh based head rotation is implemented
271          head_visual = "mesh",
272          head_visual_size = {x = 1.1, y = 1.1},
273          head_mesh = "pig_head.x",
274          head_textures ={"flying_pig_head.png","flying_pig_nose.png"},
275          head_mount = vector.new(0,1.2,1.9),
276          
277          death_rotation = "z",
278          
279          hurt_sound = "pig",
280          die_sound = "pig_die",
281          
282          attack_type = "projectile",
283          projectile_timer_cooldown = 5,
284          projectile_type = "tnt:tnt",
285          
286          --explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
287          --explosion_power = 7, -- how big the explosion has to be
288          --explosion_time = 3, -- how long it takes for a mob to explode
289         }
290 )
291
292
293
294 mobs.register_mob(
295         {
296          mobname = "creepig",
297          physical = true,
298          collide_with_objects = false,
299          collisionbox = {-0.37, -0.4, -0.37, 0.37, 0.5, 0.37},
300          visual = "mesh",
301          visual_size = {x = 3, y = 3},
302          mesh = "pig.x",
303          textures = {
304                 "creepig_body.png","creepig_leg.png","creepig_leg.png","creepig_leg.png","creepig_leg.png"
305         },
306          is_visible = true,
307          pointable = true,
308          automatic_face_movement_dir = -90.0,
309          automatic_face_movement_max_rotation_per_sec = 300,
310          makes_footstep_sound = false,
311          hp = 10,
312          gravity = {x = 0, y = -9.81, z = 0},
313          movement_type = "walk",
314          max_speed = 4,
315          hostile = true,
316          state = 0,
317          view_distance = 20,
318          item_drop = "mob:cooked_porkchop",
319           
320          standing_frame = {x=0,y=0},
321          moving_frame = {x=5,y=15},
322          animation_multiplier = 5,
323          ----
324           
325          has_head = true, --remove this when mesh based head rotation is implemented
326          head_visual = "mesh",
327          head_visual_size = {x = 1.1, y = 1.1},
328          head_mesh = "pig_head.x",
329          head_textures ={"creepig_head.png","creepig_nose.png"},
330          head_mount = vector.new(0,1.2,1.9),
331          
332          death_rotation = "z",
333          
334          hurt_sound = "pig",
335          die_sound = "pig_die",
336          
337          attack_type = "explode",
338          --projectile_timer_cooldown = 5,
339          --projectile_type = "tnt:tnt",
340          
341          explosion_radius = 2, -- how far away the mob has to be to initialize the explosion
342          explosion_power = 7, -- how big the explosion has to be
343          explosion_time = 5, -- how long it takes for a mob to explode
344          
345          die_in_light = true,
346          die_in_light_level = 12,
347         }
348 )
349
350 ]]--
351
352 mobs.register_mob(
353         {
354          mobname = "creeper",
355          physical = true,
356          collide_with_objects = false,
357          collisionbox = {-0.37,0, -0.37, 0.37, 0.5, 0.37},
358          visual = "mesh",
359          visual_size = {x = 3.2, y = 3.2},
360          mesh = "creeper.b3d",
361          textures = {
362                 "creeper.png"
363         },
364          is_visible = true,
365          pointable = true,
366          automatic_face_movement_max_rotation_per_sec = 300,
367          makes_footstep_sound = false,
368          hp = 10,
369          gravity = {x = 0, y = -9.81, z = 0},
370          movement_type = "walk",
371          max_speed = 6,
372          hostile = false,
373          state = 0,
374          view_distance = 20,
375          item_drop = "mob:cooked_porkchop",
376           
377          standing_frame = {x=0,y=0},
378          moving_frame = {x=0,y=40},
379          animation_multiplier = 20,
380          ----
381          
382          
383          --these are used to anchor a point to the head position
384          -----
385          automatic_face_movement_dir = 0,
386          head_bone = "head",
387          debug_head_pos = false,
388          --this always has to be slightly positive
389          head_directional_offset = 0.01,
390          head_height_offset = 1.45, --added to the base y position
391          --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
392          head_position_correction = vector.new(0,2.4,0),
393          head_coord = "vertical",
394          -----
395           
396          
397          death_rotation = "x",
398          
399          hurt_sound = "creeper_hurt",
400          die_sound = "creeper_hurt",
401          
402          attack_type = "explode",
403          --projectile_timer_cooldown = 5,
404          --projectile_type = "tnt:tnt",
405          
406          explosion_radius = 2, -- how far away the mob has to be to initialize the explosion
407          explosion_power = 7, -- how big the explosion has to be
408          explosion_time = 5, -- how long it takes for a mob to explode
409          
410          die_in_light = false,
411          --die_in_light_level = 12,
412         }
413 )
414