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