]> git.lizzy.rs Git - Crafter.git/blob - mods/mob/init.lua
Fix unknown node bugs
[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_table = {}
5
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
16
17
18
19 mobs.register_mob(
20     {
21      mobname = "pig",
22          physical = true,
23          collide_with_objects = false,
24          collisionbox = {-0.37, -0.4, -0.37, 0.37, 0.5, 0.37},
25          visual = "mesh",
26          visual_size = {x = 3, y = 3},
27          mesh = "pig.x",
28          textures = {
29                 "body.png","leg.png","leg.png","leg.png","leg.png"
30          },
31          is_visible = true,
32          pointable = true,
33          automatic_face_movement_dir = -90.0,
34          automatic_face_movement_max_rotation_per_sec = 300,
35          makes_footstep_sound = false,
36      hp = 10,
37      gravity = {x = 0, y = -9.81, z = 0},
38      movement_type = "walk",
39      max_speed = 5,
40      hostile = false,
41      state = 0,
42      view_distance = 15,
43      
44      item_drop = "mob:raw_porkchop", 
45      standing_frame = {x=0,y=0},
46      moving_frame = {x=5,y=15},
47      animation_multiplier = 5,
48      ----
49       
50      has_head = true, --remove this when mesh based head rotation is implemented
51      head_visual = "mesh",
52      head_visual_size = {x = 1.1, y = 1.1},
53      head_mesh = "pig_head.x",
54      head_textures ={"head.png","nose.png"},
55      head_mount = vector.new(0,1.2,1.9),
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 mobs.register_mob(
71     {
72      mobname = "slime",
73          physical = true,
74          collide_with_objects = false,
75          collisionbox = {-0.37, -0.4, -0.37, 0.37, 0.5, 0.37},
76          visual = "mesh",
77          visual_size = {x = 3, y = 3},
78          mesh = "slime.x",
79          textures = {
80                 "slimecore.png","slimeeye.png","slimeeye.png","slimeeye.png","slimeoutside.png"
81          },
82          is_visible = true,
83          pointable = true,
84          automatic_face_movement_dir = 180,
85          automatic_face_movement_max_rotation_per_sec = 300,
86          makes_footstep_sound = false,
87      hp = 10,
88      gravity = {x = 0, y = -9.81, z = 0},
89      movement_type = "jump",
90      max_speed = 5,
91      hostile = true,
92      state = 0,
93      view_distance = 20,
94      item_drop = "mob:slimeball",
95     
96      standing_frame = {x=0,y=0},
97      moving_frame = {x=0,y=0},
98      animation_multiplier = 5,
99      ----
100      has_head = false, --remove this when mesh based head rotation is implemented
101      
102      death_rotation = "x",
103      
104      hurt_sound = "slime_die",
105      die_sound = "slime_die",
106      
107      attack_type = "punch",
108      die_in_light = true,
109      die_in_light_level = 12,
110     }
111 )
112
113
114 mobs.register_mob(
115     {
116      mobname = "flying_pig",
117          physical = true,
118          collide_with_objects = false,
119          collisionbox = {-0.37, -0.4, -0.37, 0.37, 0.5, 0.37},
120          visual = "mesh",
121          visual_size = {x = 3, y = 3},
122          mesh = "pig.x",
123          textures = {
124                 "flying_pig_body.png","flying_pig_leg.png","flying_pig_leg.png","flying_pig_leg.png","flying_pig_leg.png"
125         },
126          is_visible = true,
127          pointable = true,
128          automatic_face_movement_dir = -90.0,
129          automatic_face_movement_max_rotation_per_sec = 300,
130          makes_footstep_sound = false,
131      hp = 10,
132      gravity = {x = 0, y = -1, z = 0},
133      movement_type = "jump",
134      max_speed = 5,
135      hostile = true,
136      state = 0,
137      view_distance = 50,
138      item_drop = "main:gold",
139      item_minimum = 4,
140      item_amount = 5,
141       
142      standing_frame = {x=0,y=0},
143      moving_frame = {x=5,y=15},
144      animation_multiplier = 5,
145      ----
146       
147      has_head = true, --remove this when mesh based head rotation is implemented
148      head_visual = "mesh",
149      head_visual_size = {x = 1.1, y = 1.1},
150      head_mesh = "pig_head.x",
151      head_textures ={"flying_pig_head.png","flying_pig_nose.png"},
152      head_mount = vector.new(0,1.2,1.9),
153      
154      death_rotation = "z",
155      
156      hurt_sound = "pig",
157      die_sound = "pig_die",
158      
159      attack_type = "projectile",
160      projectile_timer_cooldown = 5,
161      projectile_type = "tnt:tnt",
162      
163      --explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
164      --explosion_power = 7, -- how big the explosion has to be
165      --explosion_time = 3, -- how long it takes for a mob to explode
166     }
167 )
168
169
170
171 mobs.register_mob(
172     {
173      mobname = "creepig",
174          physical = true,
175          collide_with_objects = false,
176          collisionbox = {-0.37, -0.4, -0.37, 0.37, 0.5, 0.37},
177          visual = "mesh",
178          visual_size = {x = 3, y = 3},
179          mesh = "pig.x",
180          textures = {
181                 "creepig_body.png","creepig_leg.png","creepig_leg.png","creepig_leg.png","creepig_leg.png"
182         },
183          is_visible = true,
184          pointable = true,
185          automatic_face_movement_dir = -90.0,
186          automatic_face_movement_max_rotation_per_sec = 300,
187          makes_footstep_sound = false,
188      hp = 10,
189      gravity = {x = 0, y = -9.81, z = 0},
190      movement_type = "walk",
191      max_speed = 4,
192      hostile = true,
193      state = 0,
194      view_distance = 20,
195      item_drop = "mob:cooked_porkchop",
196       
197      standing_frame = {x=0,y=0},
198      moving_frame = {x=5,y=15},
199      animation_multiplier = 5,
200      ----
201       
202      has_head = true, --remove this when mesh based head rotation is implemented
203      head_visual = "mesh",
204      head_visual_size = {x = 1.1, y = 1.1},
205      head_mesh = "pig_head.x",
206      head_textures ={"creepig_head.png","creepig_nose.png"},
207      head_mount = vector.new(0,1.2,1.9),
208      
209      death_rotation = "z",
210      
211      hurt_sound = "pig",
212      die_sound = "pig_die",
213      
214      attack_type = "explode",
215      --projectile_timer_cooldown = 5,
216      --projectile_type = "tnt:tnt",
217      
218      explosion_radius = 2, -- how far away the mob has to be to initialize the explosion
219      explosion_power = 7, -- how big the explosion has to be
220      explosion_time = 5, -- how long it takes for a mob to explode
221      
222      die_in_light = true,
223      die_in_light_level = 12,
224     }
225 )