Merge remote-tracking branch 'upstream/master' into nalc-1.2-dev

This commit is contained in:
Sys Quatre 2020-06-20 15:34:26 +02:00
commit 03127ee343
7 changed files with 118 additions and 55 deletions

110
init.lua
View File

@ -10,6 +10,14 @@ if minetest.registered_nodes["default:permafrost"] then
y_off = 10
end
-- horse shoes (speed, jump, break, overlay texture)
local shoes = {
["mobs:horseshoe_steel"] = {7, 4, 2, "mobs_horseshoe_steelo.png"},
["mobs:horseshoe_bronze"] = {7, 4, 4, "mobs_horseshoe_bronzeo.png"},
["mobs:horseshoe_mese"] = {9, 5, 8, "mobs_horseshoe_meseo.png"},
["mobs:horseshoe_diamond"] = {10, 6, 6, "mobs_horseshoe_diamondo.png"}
}
-- rideable horse
@ -39,7 +47,9 @@ mobs:register_mob("mob_horse:horse", {
fly = false,
walk_chance = 60,
view_range = 5,
follow = {"farming:wheat", "default:apple"},
follow = {
"farming:wheat", "default:apple", "farming:oat",
"farming:barley", "farming:corn"},
passive = true,
hp_min = 12,
hp_max = 16,
@ -81,9 +91,12 @@ mobs:register_mob("mob_horse:horse", {
-- drop saddle when horse is killed while riding
-- also detach from horse properly
if self.driver then
minetest.add_item(pos, "mobs:saddle")
mobs.detach(self.driver, {x = 1, y = 0, z = 1})
self.saddle = nil
self.saddle = nil
end
-- drop any horseshoes added
@ -114,6 +127,8 @@ self.saddle = nil
if self.tamed and self.owner == clicker:get_player_name() then
local inv = clicker:get_inventory()
local tool = clicker:get_wielded_item()
local item = tool:get_name()
-- detatch player already riding horse
if self.driver and clicker == self.driver then
@ -127,7 +142,7 @@ self.saddle = nil
minetest.add_item(clicker:get_pos(), "mobs:saddle")
end
self.saddle = nil
self.saddle = nil
-- attach player to horse
elseif (not self.driver and not self.child
@ -142,13 +157,50 @@ self.saddle = nil
inv:remove_item("main", "mobs:saddle")
end
self.saddle = true
self.saddle = true
end
-- apply horseshoes
if item:find("mobs:horseshoe") then
-- drop any existing shoes
if self.shoed then
minetest.add_item(self.object:get_pos(), self.shoed)
end
local speed = shoes[item][1]
local jump = shoes[item][2]
local reverse = shoes[item][3]
local overlay = shoes[item][4]
self.max_speed_forward = speed
self.jump_height = jump
self.max_speed_reverse = reverse
self.accel = speed
self.shoed = item
-- apply horseshoe overlay to current horse texture
if overlay then
self.texture_mods = "^" .. overlay
self.object:set_texture_mod(self.texture_mods)
end
-- show horse speed and jump stats with shoes fitted
minetest.chat_send_player(clicker:get_player_name(),
S("Horse shoes fitted -")
.. S(" speed: ") .. speed
.. S(" , jump height: ") .. jump
.. S(" , stop speed: ") .. reverse)
tool:take_item() ; clicker:set_wielded_item(tool)
return
end
end
-- used to capture horse with magic lasso
mobs:capture_mob(self, clicker, 0, 0, 80, false, nil)
end
end,
})
mobs:spawn({
@ -165,46 +217,10 @@ mobs:spawn({
mobs:register_egg("mob_horse:horse", S("Horse"), "wool_brown.png", 1)
-- horseshoe helper function
local apply_shoes = function(name, itemstack, obj, shoes, speed, jump, reverse)
if obj.type ~= "object" then return end
local mob = obj.ref
local ent = mob:get_luaentity()
if ent and ent.name and ent.name == "mob_horse:horse" then
if ent.shoed then
minetest.add_item(mob:get_pos(), ent.shoed)
end
ent.max_speed_forward = speed
ent.jump_height = jump
ent.max_speed_reverse = reverse
ent.accel = speed
ent.shoed = shoes
minetest.chat_send_player(name, S("Horse shoes fitted -")
.. S(" speed: ") .. speed
.. S(" , jump height: ") .. jump
.. S(" , stop speed: ") .. reverse)
itemstack:take_item() ; return itemstack
else
minetest.chat_send_player(name, S("Horse shoes only work on horses!"))
end
end
-- steel horseshoes
minetest.register_craftitem(":mobs:horseshoe_steel", {
description = S("Steel HorseShoes (use on horse to apply)"),
inventory_image = "mobs_horseshoe_steel.png",
on_use = function(itemstack, user, pointed_thing)
return apply_shoes(user:get_player_name(), itemstack, pointed_thing,
"mobs:horseshoe_steel", 7, 4, 2)
end,
})
minetest.register_craft({
@ -220,10 +236,6 @@ minetest.register_craft({
minetest.register_craftitem(":mobs:horseshoe_bronze", {
description = S("Bronze HorseShoes (use on horse to apply)"),
inventory_image = "mobs_horseshoe_bronze.png",
on_use = function(itemstack, user, pointed_thing)
return apply_shoes(user:get_player_name(), itemstack, pointed_thing,
"mobs:horseshoe_bronze", 7, 4, 4)
end,
})
minetest.register_craft({
@ -239,10 +251,6 @@ minetest.register_craft({
minetest.register_craftitem(":mobs:horseshoe_mese", {
description = S("Mese HorseShoes (use on horse to apply)"),
inventory_image = "mobs_horseshoe_mese.png",
on_use = function(itemstack, user, pointed_thing)
return apply_shoes(user:get_player_name(), itemstack, pointed_thing,
"mobs:horseshoe_mese", 9, 5, 8)
end,
})
minetest.register_craft({
@ -258,10 +266,6 @@ minetest.register_craft({
minetest.register_craftitem(":mobs:horseshoe_diamond", {
description = S("Diamond HorseShoes (use on horse to apply)"),
inventory_image = "mobs_horseshoe_diamond.png",
on_use = function(itemstack, user, pointed_thing)
return apply_shoes(user:get_player_name(), itemstack, pointed_thing,
"mobs:horseshoe_diamond", 10, 6, 6)
end,
})
minetest.register_craft({

59
locale/it_IT.po Normal file
View File

@ -0,0 +1,59 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-06 00:07+0800\n"
"PO-Revision-Date: 2020-05-11 13:43+0200\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.2.1\n"
"Last-Translator: Hamlet <hamlatgitlab@riseup.net>\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: it_IT\n"
#: init.lua
msgid "Horse"
msgstr "Cavallo"
#: init.lua
msgid "Horse shoes fitted -"
msgstr "Ferri di cavallo indossati -"
#: init.lua
msgid " speed: "
msgstr " velocità: "
#: init.lua
msgid " , jump height: "
msgstr " , altezza di salto: "
#: init.lua
msgid " , stop speed: "
msgstr " , velocità di arresto: "
#: init.lua
msgid "Horse shoes only work on horses!"
msgstr "I ferri di cavallo funzionano solo sui cavalli!"
#: init.lua
msgid "Steel HorseShoes (use on horse to apply)"
msgstr "Ferri di cavallo d'acciaio (usarli su un cavallo per applicarli)"
#: init.lua
msgid "Bronze HorseShoes (use on horse to apply)"
msgstr "Ferri di cavallo di bronzo (usarli su un cavallo per applicarli)"
#: init.lua
msgid "Mese HorseShoes (use on horse to apply)"
msgstr "Ferri di cavallo di mese (usarli su un cavallo per applicarli)"
#: init.lua
msgid "Diamond HorseShoes (use on horse to apply)"
msgstr "Ferri di cavallo di diamante (usarli su un cavallo per applicarli)"

View File

@ -5,11 +5,11 @@ There are three different horse textures (white, brown, black) which will spawn
---
### Taming
Horses can be tamed with 10x wheat or apples which then allows the player to pick up the horse using a lasso and ride by right-clicking with a saddle.
Horses can be tamed with 10x wheat, apple, barley, oats of corn which then allows the player to pick up the horse using a lasso and ride by right-clicking with a saddle.
---
### Horseshoes
Horseshoes can be crafted using steel, bronze, mese and diamond (4x ingots - 2 down either side with 1x block top middle) and placed on a horse by punching with the item. These can make horses run faster or jump higher depending on tier.
Horseshoes can be crafted using steel, bronze, mese and diamond (4x ingots - 2 down either side with 1x block top middle) and placed on a horse by right clicking with the item. These can make horses run faster or jump higher while riding depending on tier.
---
### Dead Horse

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B