mob_register.custom_on_activate = def.custom_on_activate
+mob_register.custom_on_punch = def.custom_on_punch
+
+mob_register.c_mob_data = def.c_mob_data
+
if def.pathfinds then
--mob_register.path = {}
mob_register.pathfinding_timer = 0
self.custom_function_begin(self,dtime)
end
- self.collision_detection(self)
+ --self.collision_detection(self)
if self.fall_damage then
self.fall_damage(self)
end
self.custom_function(self,dtime,moveresult)
end
- self.move(self,dtime,moveresult)
+ --self.move(self,dtime,moveresult)
--self.debug_nametag(self,dtime)
projectile_timer = self.projectile_timer,
scared = self.scared,
scared_timer = self.scared_timer,
+ c_mob_data = self.c_mob_data,
})
end
self.punch_timer = data.punch_timer
self.projectile_timer = data.projectile_timer
self.scared = data.scared
- self.scared_timer = data.scared_timer
+ self.scared_timer = data.scared_timer
+ self.c_mob_data = data.c_mob_data
end
end
end
self.is_mob = true
self.object:set_armor_groups({immortal = 1})
+
if self.custom_on_activate then
self.custom_on_activate(self)
end
visual_size = {x = 3, y = 3},
mesh = "sheep.b3d",
textures = {
- --blank out the first two to create adult pig
- "nothing.png","sheep.png"
+ "sheep_head_wool.png","sheep_wool.png","sheep.png"
+ --"sheep_head_shaved.png","nothing.png","sheep.png"
},
--these are used to anchor a point to the head position
-----
head_bone = "head",
debug_head_pos = false,
- head_directional_offset = 0.5, --used in vector.multiply(minetest.yaw_to_dir(body_yaw),head_offset)
- head_height_offset = 0.8, --added to the base y position
+ head_directional_offset = 0.571, --used in vector.multiply(minetest.yaw_to_dir(body_yaw),head_offset)
+ head_height_offset = 1.15, --added to the base y position
--use this to correct the head position initially because it becomes severly offset - look at your blender model to get this perfect
- head_position_correction = vector.new(0,3,-0.5),
+ head_position_correction = vector.new(0,4.1,-0.86),
--this is used to tell the game the orientation of the bone (swaps x to and y, then z and y)
head_coord = "horizontal",
-----
----
death_rotation = "x",
- hurt_sound = "pig",
- die_sound = "pig_die",
+ hurt_sound = "sheep",
+ die_sound = "sheep",
hostile = false,
attacked_hostile = false,
attack_type = "punch",
group_attack = true,
- --explosion_radius = 4, -- how far away the mob has to be to initialize the explosion
- --explosion_power = 7, -- how big the explosion has to be
- --explosion_time = 3, -- how long it takes for a mob to explode
+
+ c_mob_data = {sheared = false},
+
+ custom_on_activate = function(self)
+ --print(dump(self.c_mob_data))
+ if self.c_mob_data.sheared == true then
+ self.object:set_properties({textures = {"sheep_head_shaved.png","nothing.png","sheep.png"}})
+ end
+ end,
+
+ custom_on_punch = function(self)
+ if self.c_mob_data.sheared == false then
+ self.object:set_properties({textures = {"sheep_head_shaved.png","nothing.png","sheep.png"}})
+ self.c_mob_data = {sheared=true}
+ local pos = self.object:get_pos()
+ pos.y = pos.y + 0.5
+ minetest.throw_item(pos,{name="weather:snow_block"})
+ end
+ end
}
)
critical https://freesound.org/people/FunWithSound/sounds/361482/
creeper hurt - https://freesound.org/people/adcbicycle/sounds/14199/
spider - https://freesound.org/people/columbia23/sounds/395395/ Attribution 3.0 Unported (CC BY 3.0)
-chicken - https://freesound.org/people/Breviceps/sounds/456803/ cc0
\ No newline at end of file
+chicken - https://freesound.org/people/Breviceps/sounds/456803/ cc0
+sheep - https://freesound.org/people/acclivity/sounds/39947/ Attribution-NonCommercial 3.0 Unported (CC BY-NC 3.0)
\ No newline at end of file