]> git.lizzy.rs Git - Crafter.git/blob - mods/mob/init.lua
Add 22i's mobs. Make mobs with head use bone based manipulation
[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          head_bone = "head",
29          --these are used to anchor a point to the head position
30          debug_head_pos = true,
31          head_directional_offset = 0.5, --used in vector.multiply(minetest.yaw_to_dir(body_yaw),head_offset)
32          head_height_offset = 0.8, --added to the base y position
33          head_rotation_offset = math.pi,
34          --use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
35          head_position_correction = vector.new(0,3,-0.5), 
36          -----
37          
38          is_visible = true,
39          pointable = true,
40          automatic_face_movement_dir = 90,
41          automatic_face_movement_max_rotation_per_sec = 300,
42          makes_footstep_sound = false,
43          hp = 10,
44          gravity = {x = 0, y = -9.81, z = 0},
45          movement_type = "walk",
46          max_speed = 5,
47          hostile = false,
48          state = 0,
49          view_distance = 15,
50          
51          item_drop = "mob:raw_porkchop", 
52          standing_frame = {x=0,y=0},
53          moving_frame = {x=0,y=40},
54          animation_multiplier = 20,
55          ----
56          ----
57          death_rotation = "z",
58          
59          hurt_sound = "pig",
60          die_sound = "pig_die",
61          
62          attack_type = "punch",
63          --explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
64          --explosion_power = 7, -- how big the explosion has to be
65          --explosion_time = 3, -- how long it takes for a mob to explode
66         }
67 )
68
69
70
71 --[[
72 mobs.register_mob(
73         {
74          mobname = "chicken",
75          physical = true,
76          collide_with_objects = false,
77          collisionbox = {-0.37, -0.4, -0.37, 0.37, 0.5, 0.37},
78          visual = "mesh",
79          visual_size = {x = 3, y = 3},
80          mesh = "chicken.b3d",
81          textures = {
82                  --if you're wondering what mob this is, it's a chicken
83                 "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"
84          },
85          is_visible = true,
86          pointable = true,
87          automatic_face_movement_dir = -90.0,
88          automatic_face_movement_max_rotation_per_sec = 300,
89          makes_footstep_sound = false,
90          hp = 10,
91          gravity = {x = 0, y = -9.81, z = 0},
92          movement_type = "walk",
93          max_speed = 5,
94          hostile = false,
95          state = 0,
96          view_distance = 15,
97          
98          item_drop = "mob:raw_porkchop", 
99          standing_frame = {x=0,y=0},
100          moving_frame = {x=5,y=15},
101          animation_multiplier = 5,
102          ----
103           
104          has_head = true, --remove this when mesh based head rotation is implemented
105          head_visual = "mesh",
106          head_visual_size = {x = 1.1, y = 1.1},
107          head_mesh = "pig_head.x",
108          head_textures ={"head.png","nose.png"},
109          head_mount = vector.new(0,1.2,1.9),
110          
111          death_rotation = "z",
112          
113          hurt_sound = "pig",
114          die_sound = "pig_die",
115          
116          attack_type = "punch",
117          --explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
118          --explosion_power = 7, -- how big the explosion has to be
119          --explosion_time = 3, -- how long it takes for a mob to explode
120         }
121 )
122
123
124 mobs.register_mob(
125         {
126          mobname = "slime",
127          physical = true,
128          collide_with_objects = false,
129          collisionbox = {-0.37, -0.4, -0.37, 0.37, 0.5, 0.37},
130          visual = "mesh",
131          visual_size = {x = 3, y = 3},
132          mesh = "slime.x",
133          textures = {
134                 "slimecore.png","slimeeye.png","slimeeye.png","slimeeye.png","slimeoutside.png"
135          },
136          is_visible = true,
137          pointable = true,
138          automatic_face_movement_dir = 180,
139          automatic_face_movement_max_rotation_per_sec = 300,
140          makes_footstep_sound = false,
141          hp = 10,
142          gravity = {x = 0, y = -9.81, z = 0},
143          movement_type = "jump",
144          max_speed = 5,
145          hostile = true,
146          state = 0,
147          view_distance = 20,
148          item_drop = "mob:slimeball",
149         
150          standing_frame = {x=0,y=0},
151          moving_frame = {x=0,y=0},
152          animation_multiplier = 5,
153          ----
154          has_head = false, --remove this when mesh based head rotation is implemented
155          
156          death_rotation = "x",
157          
158          hurt_sound = "slime_die",
159          die_sound = "slime_die",
160          
161          attack_type = "punch",
162          die_in_light = true,
163          die_in_light_level = 12,
164         }
165 )
166
167
168 mobs.register_mob(
169         {
170          mobname = "flying_pig",
171          physical = true,
172          collide_with_objects = false,
173          collisionbox = {-0.37, -0.4, -0.37, 0.37, 0.5, 0.37},
174          visual = "mesh",
175          visual_size = {x = 3, y = 3},
176          mesh = "pig.x",
177          textures = {
178                 "flying_pig_body.png","flying_pig_leg.png","flying_pig_leg.png","flying_pig_leg.png","flying_pig_leg.png"
179         },
180          is_visible = true,
181          pointable = true,
182          automatic_face_movement_dir = -90.0,
183          automatic_face_movement_max_rotation_per_sec = 300,
184          makes_footstep_sound = false,
185          hp = 10,
186          gravity = {x = 0, y = -1, z = 0},
187          movement_type = "jump",
188          max_speed = 5,
189          hostile = true,
190          state = 0,
191          view_distance = 50,
192          item_drop = "main:gold",
193          item_minimum = 4,
194          item_amount = 5,
195           
196          standing_frame = {x=0,y=0},
197          moving_frame = {x=5,y=15},
198          animation_multiplier = 5,
199          ----
200           
201          has_head = true, --remove this when mesh based head rotation is implemented
202          head_visual = "mesh",
203          head_visual_size = {x = 1.1, y = 1.1},
204          head_mesh = "pig_head.x",
205          head_textures ={"flying_pig_head.png","flying_pig_nose.png"},
206          head_mount = vector.new(0,1.2,1.9),
207          
208          death_rotation = "z",
209          
210          hurt_sound = "pig",
211          die_sound = "pig_die",
212          
213          attack_type = "projectile",
214          projectile_timer_cooldown = 5,
215          projectile_type = "tnt:tnt",
216          
217          --explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
218          --explosion_power = 7, -- how big the explosion has to be
219          --explosion_time = 3, -- how long it takes for a mob to explode
220         }
221 )
222
223
224
225 mobs.register_mob(
226         {
227          mobname = "creepig",
228          physical = true,
229          collide_with_objects = false,
230          collisionbox = {-0.37, -0.4, -0.37, 0.37, 0.5, 0.37},
231          visual = "mesh",
232          visual_size = {x = 3, y = 3},
233          mesh = "pig.x",
234          textures = {
235                 "creepig_body.png","creepig_leg.png","creepig_leg.png","creepig_leg.png","creepig_leg.png"
236         },
237          is_visible = true,
238          pointable = true,
239          automatic_face_movement_dir = -90.0,
240          automatic_face_movement_max_rotation_per_sec = 300,
241          makes_footstep_sound = false,
242          hp = 10,
243          gravity = {x = 0, y = -9.81, z = 0},
244          movement_type = "walk",
245          max_speed = 4,
246          hostile = true,
247          state = 0,
248          view_distance = 20,
249          item_drop = "mob:cooked_porkchop",
250           
251          standing_frame = {x=0,y=0},
252          moving_frame = {x=5,y=15},
253          animation_multiplier = 5,
254          ----
255           
256          has_head = true, --remove this when mesh based head rotation is implemented
257          head_visual = "mesh",
258          head_visual_size = {x = 1.1, y = 1.1},
259          head_mesh = "pig_head.x",
260          head_textures ={"creepig_head.png","creepig_nose.png"},
261          head_mount = vector.new(0,1.2,1.9),
262          
263          death_rotation = "z",
264          
265          hurt_sound = "pig",
266          die_sound = "pig_die",
267          
268          attack_type = "explode",
269          --projectile_timer_cooldown = 5,
270          --projectile_type = "tnt:tnt",
271          
272          explosion_radius = 2, -- how far away the mob has to be to initialize the explosion
273          explosion_power = 7, -- how big the explosion has to be
274          explosion_time = 5, -- how long it takes for a mob to explode
275          
276          die_in_light = true,
277          die_in_light_level = 12,
278         }
279 )
280
281
282
283 mobs.register_mob(
284         {
285          mobname = "exploder",
286          physical = true,
287          collide_with_objects = false,
288          collisionbox = {-0.37, -0.4, -0.37, 0.37, 0.5, 0.37},
289          visual = "mesh",
290          visual_size = {x = 3, y = 3},
291          mesh = "exploder.b3d",
292          textures = {
293                 "creepig_body.png","creepig_leg.png","creepig_leg.png","creepig_leg.png","creepig_leg.png"
294         },
295          is_visible = true,
296          pointable = true,
297          automatic_face_movement_dir = 0,
298          automatic_face_movement_max_rotation_per_sec = 300,
299          makes_footstep_sound = false,
300          hp = 10,
301          gravity = {x = 0, y = -9.81, z = 0},
302          movement_type = "walk",
303          max_speed = 4,
304          hostile = false,
305          state = 0,
306          view_distance = 20,
307          item_drop = "mob:cooked_porkchop",
308           
309          standing_frame = {x=5,y=5},
310          moving_frame = {x=0,y=20},
311          animation_multiplier = 10,
312          ----
313           
314          has_head = false, --remove this when mesh based head rotation is implemented
315          --head_visual = "mesh",
316          --head_visual_size = {x = 1, y = 1},
317          --head_mesh = "pig_head.x",
318          --head_textures ={"creepig_head.png","creepig_nose.png"},
319          --head_mount = vector.new(0,1.2,1.9),
320          
321          death_rotation = "x",
322          
323          hurt_sound = "pig",
324          die_sound = "pig_die",
325          
326          attack_type = "explode",
327          --projectile_timer_cooldown = 5,
328          --projectile_type = "tnt:tnt",
329          
330          explosion_radius = 2, -- how far away the mob has to be to initialize the explosion
331          explosion_power = 7, -- how big the explosion has to be
332          explosion_time = 5, -- how long it takes for a mob to explode
333          
334          die_in_light = false,
335          --die_in_light_level = 12,
336         }
337 )
338 ]]--