]> git.lizzy.rs Git - Crafter.git/blob - mods/mob/init.lua
Add in damage color texture modifier to mob api
[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 = "slime",
201          physical = true,
202          collide_with_objects = false,
203          collisionbox = {-0.37, -0.4, -0.37, 0.37, 0.5, 0.37},
204          visual = "mesh",
205          visual_size = {x = 3, y = 3},
206          mesh = "slime.x",
207          textures = {
208                 "slimecore.png","slimeeye.png","slimeeye.png","slimeeye.png","slimeoutside.png"
209          },
210          is_visible = true,
211          pointable = true,
212          automatic_face_movement_dir = 180,
213          automatic_face_movement_max_rotation_per_sec = 300,
214          makes_footstep_sound = false,
215          hp = 10,
216          gravity = {x = 0, y = -9.81, z = 0},
217          movement_type = "jump",
218          max_speed = 5,
219          hostile = true,
220          state = 0,
221          view_distance = 20,
222          item_drop = "mob:slimeball",
223         
224          standing_frame = {x=0,y=0},
225          moving_frame = {x=0,y=0},
226          animation_multiplier = 5,
227          ----
228          has_head = false, --remove this when mesh based head rotation is implemented
229          
230          death_rotation = "x",
231          
232          hurt_sound = "slime_die",
233          die_sound = "slime_die",
234          
235          attack_type = "punch",
236          die_in_light = true,
237          die_in_light_level = 12,
238         }
239 )
240
241
242 mobs.register_mob(
243         {
244          mobname = "flying_pig",
245          physical = true,
246          collide_with_objects = false,
247          collisionbox = {-0.37, -0.4, -0.37, 0.37, 0.5, 0.37},
248          visual = "mesh",
249          visual_size = {x = 3, y = 3},
250          mesh = "pig.x",
251          textures = {
252                 "flying_pig_body.png","flying_pig_leg.png","flying_pig_leg.png","flying_pig_leg.png","flying_pig_leg.png"
253         },
254          is_visible = true,
255          pointable = true,
256          automatic_face_movement_dir = -90.0,
257          automatic_face_movement_max_rotation_per_sec = 300,
258          makes_footstep_sound = false,
259          hp = 10,
260          gravity = {x = 0, y = -1, z = 0},
261          movement_type = "jump",
262          max_speed = 5,
263          hostile = true,
264          state = 0,
265          view_distance = 50,
266          item_drop = "main:gold",
267          item_minimum = 4,
268          item_amount = 5,
269           
270          standing_frame = {x=0,y=0},
271          moving_frame = {x=5,y=15},
272          animation_multiplier = 5,
273          ----
274           
275          has_head = true, --remove this when mesh based head rotation is implemented
276          head_visual = "mesh",
277          head_visual_size = {x = 1.1, y = 1.1},
278          head_mesh = "pig_head.x",
279          head_textures ={"flying_pig_head.png","flying_pig_nose.png"},
280          head_mount = vector.new(0,1.2,1.9),
281          
282          death_rotation = "z",
283          
284          hurt_sound = "pig",
285          die_sound = "pig_die",
286          
287          attack_type = "projectile",
288          projectile_timer_cooldown = 5,
289          projectile_type = "tnt:tnt",
290          
291          --explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
292          --explosion_power = 7, -- how big the explosion has to be
293          --explosion_time = 3, -- how long it takes for a mob to explode
294         }
295 )
296
297
298
299 mobs.register_mob(
300         {
301          mobname = "creepig",
302          physical = true,
303          collide_with_objects = false,
304          collisionbox = {-0.37, -0.4, -0.37, 0.37, 0.5, 0.37},
305          visual = "mesh",
306          visual_size = {x = 3, y = 3},
307          mesh = "pig.x",
308          textures = {
309                 "creepig_body.png","creepig_leg.png","creepig_leg.png","creepig_leg.png","creepig_leg.png"
310         },
311          is_visible = true,
312          pointable = true,
313          automatic_face_movement_dir = -90.0,
314          automatic_face_movement_max_rotation_per_sec = 300,
315          makes_footstep_sound = false,
316          hp = 10,
317          gravity = {x = 0, y = -9.81, z = 0},
318          movement_type = "walk",
319          max_speed = 4,
320          hostile = true,
321          state = 0,
322          view_distance = 20,
323          item_drop = "mob:cooked_porkchop",
324           
325          standing_frame = {x=0,y=0},
326          moving_frame = {x=5,y=15},
327          animation_multiplier = 5,
328          ----
329           
330          has_head = true, --remove this when mesh based head rotation is implemented
331          head_visual = "mesh",
332          head_visual_size = {x = 1.1, y = 1.1},
333          head_mesh = "pig_head.x",
334          head_textures ={"creepig_head.png","creepig_nose.png"},
335          head_mount = vector.new(0,1.2,1.9),
336          
337          death_rotation = "z",
338          
339          hurt_sound = "pig",
340          die_sound = "pig_die",
341          
342          attack_type = "explode",
343          --projectile_timer_cooldown = 5,
344          --projectile_type = "tnt:tnt",
345          
346          explosion_radius = 2, -- how far away the mob has to be to initialize the explosion
347          explosion_power = 7, -- how big the explosion has to be
348          explosion_time = 5, -- how long it takes for a mob to explode
349          
350          die_in_light = true,
351          die_in_light_level = 12,
352         }
353 )
354
355 ]]--
356
357 mobs.register_mob(
358         {
359          mobname = "creeper",
360          physical = true,
361          collide_with_objects = false,
362          collisionbox = {-0.37,0, -0.37, 0.37, 1.5, 0.37},
363          visual = "mesh",
364          visual_size = {x = 3.2, y = 3.2},
365          mesh = "creeper.b3d",
366          textures = {
367                 "creeper.png"
368         },
369          is_visible = true,
370          pointable = true,
371          automatic_face_movement_max_rotation_per_sec = 300,
372          makes_footstep_sound = false,
373          hp = 10,
374          gravity = {x = 0, y = -9.81, z = 0},
375          movement_type = "walk",
376          max_speed = 4,
377          hostile = true,
378          hostile_cooldown = false,
379          state = 0,
380          view_distance = 20,
381          item_drop = "mob:cooked_porkchop",
382           
383          standing_frame = {x=0,y=0},
384          moving_frame = {x=0,y=40},
385          animation_multiplier = 20,
386          ----
387          pathfinds = true,
388          
389          --these are used to anchor a point to the head position
390          -----
391          automatic_face_movement_dir = 0,
392          head_bone = "head",
393          debug_head_pos = false,
394          --this always has to be slightly positive
395          head_directional_offset = 0.01,
396          head_height_offset = 1.45, --added to the base y position
397          --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
398          head_position_correction = vector.new(0,2.4,0),
399          head_coord = "vertical",
400          -----
401           
402          
403          death_rotation = "x",
404          
405          hurt_sound = "creeper_hurt",
406          die_sound = "creeper_hurt",
407          
408          attack_type = "explode",
409          --projectile_timer_cooldown = 5,
410          --projectile_type = "tnt:tnt",
411          
412          explosion_radius = 3, -- how far away the mob has to be to initialize the explosion
413          explosion_power = 7, -- how big the explosion has to be
414          explosion_time = 3, -- how long it takes for a mob to explode
415          
416          die_in_light = false,
417          --die_in_light_level = 12,
418         }
419 )
420
421
422
423 mobs.register_mob(
424         {
425          mobname = "nitro_creeper",
426          physical = true,
427          collide_with_objects = false,
428          collisionbox = {-0.37,0, -0.37, 0.37, 1.5, 0.37},
429          visual = "mesh",
430          visual_size = {x = 3.2, y = 3.2},
431          mesh = "creeper.b3d",
432          textures = {
433                 "nitro_creeper.png"
434         },
435          is_visible = true,
436          pointable = true,
437          automatic_face_movement_max_rotation_per_sec = 300,
438          makes_footstep_sound = false,
439          hp = 10,
440          gravity = {x = 0, y = -9.81, z = 0},
441          movement_type = "walk",
442          max_speed = 4,
443          hostile = true,
444          hostile_cooldown = false,
445          state = 0,
446          view_distance = 20,
447          item_drop = "mob:cooked_porkchop",
448
449          damage_color = "blue",
450           
451          standing_frame = {x=0,y=0},
452          moving_frame = {x=0,y=40},
453          animation_multiplier = 20,
454          ----
455          pathfinds = true,
456          
457          --these are used to anchor a point to the head position
458          -----
459          automatic_face_movement_dir = 0,
460          head_bone = "head",
461          debug_head_pos = false,
462          --this always has to be slightly positive
463          head_directional_offset = 0.01,
464          head_height_offset = 1.45, --added to the base y position
465          --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
466          head_position_correction = vector.new(0,2.4,0),
467          head_coord = "vertical",
468          -----
469           
470          
471          death_rotation = "x",
472          
473          hurt_sound = "creeper_hurt",
474          die_sound = "creeper_hurt",
475          
476          attack_type = "explode",
477          --projectile_timer_cooldown = 5,
478          --projectile_type = "tnt:tnt",
479          
480          explosion_radius = 6, -- how far away the mob has to be to initialize the explosion
481          explosion_power = 14, -- how big the explosion is (radius)
482          explosion_time = 3, -- how long it takes for a mob to explode
483          
484          die_in_light = false,
485          --die_in_light_level = 12,
486         }
487 )