mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-23 02:51:06 +01:00
Wolf: Bark when tamed, show icon when change order
This commit is contained in:
parent
376e1c32c5
commit
da7214bafa
3 changed files with 17 additions and 1 deletions
BIN
mods/ENTITIES/mobs_mc/textures/mobs_mc_wolf_icon_roam.png
Normal file
BIN
mods/ENTITIES/mobs_mc/textures/mobs_mc_wolf_icon_roam.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 259 B |
BIN
mods/ENTITIES/mobs_mc/textures/mobs_mc_wolf_icon_sit.png
Normal file
BIN
mods/ENTITIES/mobs_mc/textures/mobs_mc_wolf_icon_sit.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 241 B |
|
@ -70,6 +70,8 @@ local wolf = {
|
||||||
dog:set_yaw(yaw)
|
dog:set_yaw(yaw)
|
||||||
ent = dog:get_luaentity()
|
ent = dog:get_luaentity()
|
||||||
ent.owner = clicker:get_player_name()
|
ent.owner = clicker:get_player_name()
|
||||||
|
-- cornfirm taming
|
||||||
|
minetest.sound_play("mobs_mc_wolf_bark", {object=self.object, max_hear_distance=16})
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -195,16 +197,30 @@ dog.on_rightclick = function(self, clicker)
|
||||||
self.owner = clicker:get_player_name()
|
self.owner = clicker:get_player_name()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local pos = self.object:get_pos()
|
||||||
|
local particle
|
||||||
if not self.order or self.order == "" or self.order == "sit" then
|
if not self.order or self.order == "" or self.order == "sit" then
|
||||||
|
particle = "mobs_mc_wolf_icon_roam.png"
|
||||||
self.order = "roam"
|
self.order = "roam"
|
||||||
self.walk_chance = default_walk_chance
|
self.walk_chance = default_walk_chance
|
||||||
self.jump = true
|
self.jump = true
|
||||||
else
|
|
||||||
-- TODO: Add sitting model
|
-- TODO: Add sitting model
|
||||||
|
else
|
||||||
|
particle = "mobs_mc_wolf_icon_sit.png"
|
||||||
self.order = "sit"
|
self.order = "sit"
|
||||||
self.walk_chance = 0
|
self.walk_chance = 0
|
||||||
self.jump = false
|
self.jump = false
|
||||||
end
|
end
|
||||||
|
-- Display icon to show current order (sit or roam)
|
||||||
|
minetest.add_particle({
|
||||||
|
pos = vector.add(pos, {x=0,y=1,z=0}),
|
||||||
|
velocity = {x=0,y=0.2,z=0},
|
||||||
|
expirationtime = 1,
|
||||||
|
size = 4,
|
||||||
|
texture = particle,
|
||||||
|
playername = self.owner,
|
||||||
|
glow = minetest.LIGHT_MAX,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue