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