]> git.lizzy.rs Git - Crafter.git/blob - mods/mob/init.lua
Add in fishing
[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.85, 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.85, 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          takes_fall_damage = false,
111          make_jump_noise = false,
112          hp = 10,
113          gravity = {x = 0, y = -1, z = 0},
114          movement_type = "walk",
115          max_speed = 5,
116          state = 0,
117          view_distance = 15,
118          
119          item_drop = "main:gold", 
120          item_minimum = 4,
121          item_max = 5,
122
123          standing_frame = {x=0,y=0},
124          moving_frame = {x=0,y=40},
125          animation_multiplier = 20,
126          ----
127          ----
128          death_rotation = "x",
129          
130          hurt_sound = "pig",
131          die_sound = "pig_die",
132          
133          
134          hostile = false,
135          attacked_hostile = false,
136          attack_type = "punch",
137          group_attack = true,
138          --explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
139          --explosion_power = 7, -- how big the explosion has to be
140          --explosion_time = 3, -- how long it takes for a mob to explode
141         }
142 )
143
144
145 --[[
146 mobs.register_mob(
147         {
148          mobname = "chicken",
149          physical = true,
150          collide_with_objects = false,
151          collisionbox = {-0.37, -0.4, -0.37, 0.37, 0.5, 0.37},
152          visual = "mesh",
153          visual_size = {x = 3, y = 3},
154          mesh = "chicken.b3d",
155          textures = {
156                  --if you're wondering what mob this is, it's a chicken
157                 "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"
158          },
159          is_visible = true,
160          pointable = true,
161          automatic_face_movement_dir = -90.0,
162          automatic_face_movement_max_rotation_per_sec = 300,
163          makes_footstep_sound = false,
164          hp = 10,
165          gravity = {x = 0, y = -9.81, z = 0},
166          movement_type = "walk",
167          max_speed = 5,
168          hostile = false,
169          state = 0,
170          view_distance = 15,
171          
172          item_drop = "mob:raw_porkchop", 
173          standing_frame = {x=0,y=0},
174          moving_frame = {x=5,y=15},
175          animation_multiplier = 5,
176          ----
177           
178          has_head = true, --remove this when mesh based head rotation is implemented
179          head_visual = "mesh",
180          head_visual_size = {x = 1.1, y = 1.1},
181          head_mesh = "pig_head.x",
182          head_textures ={"head.png","nose.png"},
183          head_mount = vector.new(0,1.2,1.9),
184          
185          death_rotation = "z",
186          
187          hurt_sound = "pig",
188          die_sound = "pig_die",
189          
190          attack_type = "punch",
191          --explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
192          --explosion_power = 7, -- how big the explosion has to be
193          --explosion_time = 3, -- how long it takes for a mob to explode
194         }
195 )
196 ]]--
197
198 mobs.register_mob(
199         {
200         mobname = "big_slime",
201         physical = true,
202         collide_with_objects = false,
203         collisionbox = {-1.25, 0, -1.25, 1.25, 2.5, 1.25},
204         visual = "mesh",
205         visual_size = {x = 15, y = 15},
206         mesh = "slime.b3d",
207         textures = {
208                 "slime.png"
209         },
210         is_visible = true,
211         pointable = true,
212         automatic_face_movement_dir = 90,
213         automatic_face_movement_max_rotation_per_sec = 300,
214         makes_footstep_sound = false,
215         hp = 40,
216         gravity = {x = 0, y = -9.81, z = 0},
217         movement_type = "jump",
218         make_jump_noise = true,
219         max_speed = 5,
220         hostile = true,
221         state = 0,
222         view_distance = 20,
223         death_rotation = "z",
224         hurt_sound = "slime_die",
225         die_sound = "slime_die",
226         attack_type = "punch",
227         custom_on_death = function(self)
228                 local pos = self.object:get_pos()
229                 for i = 1,4 do
230                         minetest.add_entity(pos,"mob:medium_slime")
231                 end
232         end,
233         }
234 )
235
236 mobs.register_mob(
237         {
238         mobname = "medium_slime",
239         physical = true,
240         collide_with_objects = false,
241         collisionbox = {-0.625, 0, -0.625, 0.625, 1.25, 0.625},
242         visual = "mesh",
243         visual_size = {x = 7.5, y = 7.5},
244         mesh = "slime.b3d",
245         textures = {
246                 "slime.png"
247         },
248         is_visible = true,
249         pointable = true,
250         automatic_face_movement_dir = 90,
251         automatic_face_movement_max_rotation_per_sec = 300,
252         makes_footstep_sound = false,
253         hp = 20,
254         gravity = {x = 0, y = -9.81, z = 0},
255         movement_type = "jump",
256         make_jump_noise = true,
257         max_speed = 5,
258         hostile = true,
259         state = 0,
260         view_distance = 20,
261         death_rotation = "z",
262         hurt_sound = "slime_die",
263         die_sound = "slime_die",
264         attack_type = "punch",
265         custom_on_death = function(self)
266                 local pos = self.object:get_pos()
267                 pos.y = pos.y + 0.2
268                 for i = 1,4 do
269                         minetest.add_entity(pos,"mob:small_slime")
270                 end
271         end,
272         }
273 )
274
275 mobs.register_mob(
276         {
277         mobname = "small_slime",
278         physical = true,
279         collide_with_objects = false,
280         collisionbox = {-0.3, 0, -0.3, 0.3, 0.6, 0.3},
281         visual = "mesh",
282         visual_size = {x = 3.7, y = 3.7},
283         mesh = "slime.b3d",
284         textures = {
285                 "slime.png"
286         },
287         is_visible = true,
288         pointable = true,
289         automatic_face_movement_dir = 90,
290         automatic_face_movement_max_rotation_per_sec = 300,
291         makes_footstep_sound = false,
292         hp = 5,
293         gravity = {x = 0, y = -9.81, z = 0},
294         movement_type = "jump",
295         make_jump_noise = true,
296         max_speed = 5,
297         hostile = true,
298         state = 0,
299         view_distance = 20,
300         death_rotation = "z",
301         hurt_sound = "slime_die",
302         die_sound = "slime_die",
303         attack_type = "punch",
304         item_drop = "mob:slimeball"
305         }
306 )
307
308 --[[
309 mobs.register_mob(
310         {
311          mobname = "flying_pig",
312          physical = true,
313          collide_with_objects = false,
314          collisionbox = {-0.37, -0.4, -0.37, 0.37, 0.5, 0.37},
315          visual = "mesh",
316          visual_size = {x = 3, y = 3},
317          mesh = "pig.x",
318          textures = {
319                 "flying_pig_body.png","flying_pig_leg.png","flying_pig_leg.png","flying_pig_leg.png","flying_pig_leg.png"
320         },
321          is_visible = true,
322          pointable = true,
323          automatic_face_movement_dir = -90.0,
324          automatic_face_movement_max_rotation_per_sec = 300,
325          makes_footstep_sound = false,
326          hp = 10,
327          gravity = {x = 0, y = -1, z = 0},
328          movement_type = "jump",
329          max_speed = 5,
330          hostile = true,
331          state = 0,
332          view_distance = 50,
333          item_drop = "main:gold",
334          item_minimum = 4,
335          item_amount = 5,
336           
337          standing_frame = {x=0,y=0},
338          moving_frame = {x=5,y=15},
339          animation_multiplier = 5,
340          ----
341           
342          has_head = true, --remove this when mesh based head rotation is implemented
343          head_visual = "mesh",
344          head_visual_size = {x = 1.1, y = 1.1},
345          head_mesh = "pig_head.x",
346          head_textures ={"flying_pig_head.png","flying_pig_nose.png"},
347          head_mount = vector.new(0,1.2,1.9),
348          
349          death_rotation = "z",
350          
351          hurt_sound = "pig",
352          die_sound = "pig_die",
353          
354          attack_type = "projectile",
355          projectile_timer_cooldown = 5,
356          projectile_type = "tnt:tnt",
357          
358          --explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
359          --explosion_power = 7, -- how big the explosion has to be
360          --explosion_time = 3, -- how long it takes for a mob to explode
361         }
362 )
363
364
365
366 mobs.register_mob(
367         {
368          mobname = "creepig",
369          physical = true,
370          collide_with_objects = false,
371          collisionbox = {-0.37, -0.4, -0.37, 0.37, 0.5, 0.37},
372          visual = "mesh",
373          visual_size = {x = 3, y = 3},
374          mesh = "pig.x",
375          textures = {
376                 "creepig_body.png","creepig_leg.png","creepig_leg.png","creepig_leg.png","creepig_leg.png"
377         },
378          is_visible = true,
379          pointable = true,
380          automatic_face_movement_dir = -90.0,
381          automatic_face_movement_max_rotation_per_sec = 300,
382          makes_footstep_sound = false,
383          hp = 10,
384          gravity = {x = 0, y = -9.81, z = 0},
385          movement_type = "walk",
386          max_speed = 4,
387          hostile = true,
388          state = 0,
389          view_distance = 20,
390          item_drop = "mob:cooked_porkchop",
391           
392          standing_frame = {x=0,y=0},
393          moving_frame = {x=5,y=15},
394          animation_multiplier = 5,
395          ----
396           
397          has_head = true, --remove this when mesh based head rotation is implemented
398          head_visual = "mesh",
399          head_visual_size = {x = 1.1, y = 1.1},
400          head_mesh = "pig_head.x",
401          head_textures ={"creepig_head.png","creepig_nose.png"},
402          head_mount = vector.new(0,1.2,1.9),
403          
404          death_rotation = "z",
405          
406          hurt_sound = "pig",
407          die_sound = "pig_die",
408          
409          attack_type = "explode",
410          --projectile_timer_cooldown = 5,
411          --projectile_type = "tnt:tnt",
412          
413          explosion_radius = 2, -- how far away the mob has to be to initialize the explosion
414          explosion_power = 7, -- how big the explosion has to be
415          explosion_time = 5, -- how long it takes for a mob to explode
416          
417          die_in_light = true,
418          die_in_light_level = 12,
419         }
420 )
421
422 ]]--
423
424 mobs.register_mob(
425         {
426          mobname = "creeper",
427          physical = true,
428          collide_with_objects = false,
429          collisionbox = {-0.37,0, -0.37, 0.37, 1.5, 0.37},
430          visual = "mesh",
431          visual_size = {x = 3.2, y = 3.2},
432          mesh = "creeper.b3d",
433          textures = {
434                 "creeper.png"
435         },
436          is_visible = true,
437          pointable = true,
438          automatic_face_movement_max_rotation_per_sec = 300,
439          makes_footstep_sound = false,
440          hp = 40,
441          gravity = {x = 0, y = -9.81, z = 0},
442          movement_type = "walk",
443          max_speed = 4,
444          hostile = true,
445          hostile_cooldown = false,
446          state = 0,
447          view_distance = 20,
448          item_drop = "mob:gunpowder",
449           
450          standing_frame = {x=0,y=0},
451          moving_frame = {x=0,y=40},
452          animation_multiplier = 20,
453          ----
454          pathfinds = true,
455          
456          --these are used to anchor a point to the head position
457          -----
458          automatic_face_movement_dir = 0,
459          head_bone = "head",
460          debug_head_pos = false,
461          --this always has to be slightly positive
462          head_directional_offset = 0.01,
463          head_height_offset = 1.45, --added to the base y position
464          --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
465          head_position_correction = vector.new(0,2.4,0),
466          head_coord = "vertical",
467          -----
468           
469          
470          death_rotation = "x",
471          
472          hurt_sound = "creeper_hurt",
473          die_sound = "creeper_hurt",
474          
475          attack_type = "explode",
476          --projectile_timer_cooldown = 5,
477          --projectile_type = "tnt:tnt",
478          
479          explosion_radius = 3, -- how far away the mob has to be to initialize the explosion
480          explosion_power = 7, -- how big the explosion has to be
481          explosion_time = 3, -- how long it takes for a mob to explode
482          
483          die_in_light = false,
484          --die_in_light_level = 12,
485         }
486 )
487
488
489
490 mobs.register_mob(
491         {
492          mobname = "nitro_creeper",
493          physical = true,
494          collide_with_objects = false,
495          collisionbox = {-0.37,0, -0.37, 0.37, 1.5, 0.37},
496          visual = "mesh",
497          visual_size = {x = 3.2, y = 3.2},
498          mesh = "creeper.b3d",
499          textures = {
500                 "nitro_creeper.png"
501         },
502          is_visible = true,
503          pointable = true,
504          automatic_face_movement_max_rotation_per_sec = 300,
505          makes_footstep_sound = false,
506          hp = 70,
507          gravity = {x = 0, y = -9.81, z = 0},
508          movement_type = "walk",
509          max_speed = 9,
510          hostile = true,
511          hostile_cooldown = false,
512          state = 0,
513          view_distance = 20,
514          item_drop = "mob:gunpowder",
515
516          damage_color = "blue",
517           
518          standing_frame = {x=0,y=0},
519          moving_frame = {x=0,y=40},
520          animation_multiplier = 20,
521          ----
522          pathfinds = true,
523          
524          --these are used to anchor a point to the head position
525          -----
526          automatic_face_movement_dir = 0,
527          head_bone = "head",
528          debug_head_pos = false,
529          --this always has to be slightly positive
530          head_directional_offset = 0.01,
531          head_height_offset = 1.45, --added to the base y position
532          --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
533          head_position_correction = vector.new(0,2.4,0),
534          head_coord = "vertical",
535          -----
536           
537          
538          death_rotation = "x",
539          
540          hurt_sound = "creeper_hurt",
541          die_sound = "creeper_hurt",
542          
543          attack_type = "explode",
544          --projectile_timer_cooldown = 5,
545          --projectile_type = "tnt:tnt",
546          
547          explosion_radius = 6, -- how far away the mob has to be to initialize the explosion
548          explosion_power = 14, -- how big the explosion is (radius)
549          explosion_time = 3, -- how long it takes for a mob to explode
550          explosion_blink_timer = 0.1, -- how fast the blinking happens
551          
552          die_in_light = false,
553          --die_in_light_level = 12,
554         }
555 )
556
557
558 mobs.register_mob(
559         {
560          mobname = "spider",
561          physical = true,
562          collide_with_objects = false,
563          collisionbox = {-0.37, 0, -0.37, 0.37, 0.85, 0.37},
564          visual = "mesh",
565          visual_size = {x = 3, y = 3},
566          mesh = "spider.b3d",
567          textures = {
568                 "spider.png"
569          },
570          
571          --these are used to anchor a point to the head position
572
573
574          -----
575          head_bone = "body.head",
576          debug_head_pos = false,
577          rotational_correction = -math.pi/2,
578          head_directional_offset = 0.3, --used in vector.multiply(minetest.yaw_to_dir(body_yaw),head_offset)
579          head_height_offset = 0.63, --added to the base y position
580          --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
581          head_position_correction = vector.new(0,1.24,0),
582          --this is used to tell the game the orientation of the bone (swaps x to and y, then z and y)
583          head_coord = "horizontal",
584          -----
585          
586          is_visible = true,
587          pointable = true,
588          automatic_face_movement_dir = 90,
589          automatic_face_movement_max_rotation_per_sec = 300,
590          makes_footstep_sound = false,
591          hp = 10,
592          gravity = {x = 0, y = -9.81, z = 0},
593          movement_type = "walk",
594          max_speed = 5,
595          state = 0,
596          view_distance = 15,
597          
598          item_drop = "mob:string", 
599          standing_frame = {x=21,y=21},
600          moving_frame = {x=0,y=20},
601          animation_multiplier = 20,
602          ----
603          ----
604          death_rotation = "z",
605          
606          hurt_sound = "pig",
607          die_sound = "pig_die",
608          
609          
610          hostile = true,
611          attacked_hostile = false,
612          attack_type = "punch",
613          group_attack = true,
614          --explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
615          --explosion_power = 7, -- how big the explosion has to be
616          --explosion_time = 3, -- how long it takes for a mob to explode
617         }
618 )