Compare commits

16 Commits

13 changed files with 118 additions and 57 deletions

View File

@ -1,12 +1,12 @@
-- intllib
-- Load support for intllib.
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP .. "/intllib.lua")
local S = minetest.get_translator and minetest.get_translator("mob_horse") or
dofile(MP .. "/intllib.lua")
-- 0.4.17 or 5.0 check
local y_off = 20
if minetest.registered_nodes["default:permafrost"] then
if minetest.features.object_independent_selectionbox then
y_off = 10
end
@ -15,12 +15,11 @@ 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"}
["mobs:horseshoe_diamond"] = {10, 6, 6, "mobs_horseshoe_diamondo.png"},
["mobs:horseshoe_crystal"] = {11, 6, 9, "mobs_horseshoe_crystalo.png"}
}
-- rideable horse
mobs:register_mob("mob_horse:horse", {
type = "animal",
visual = "mesh",
@ -31,7 +30,12 @@ mobs:register_mob("mob_horse:horse", {
speed_normal = 15,
speed_run = 30,
stand_start = 25,
stand_end = 75,
stand_end = 50, -- 75
stand2_start = 25,
stand2_end = 25,
stand3_start = 55,
stand3_end = 75,
stand3_loop = false,
walk_start = 75,
walk_end = 100,
run_start = 75,
@ -106,6 +110,14 @@ mobs:register_mob("mob_horse:horse", {
end,
do_punch = function(self, hitter)
-- don't cut the branch you're... ah, that's not about that
if hitter ~= self.driver then
return true
end
end,
on_rightclick = function(self, clicker)
-- make sure player is clicking
@ -123,8 +135,10 @@ mobs:register_mob("mob_horse:horse", {
return
end
local player_name = clicker:get_player_name()
-- make sure tamed horse is being clicked by owner only
if self.tamed and self.owner == clicker:get_player_name() then
if self.tamed and self.owner == player_name then
local inv = clicker:get_inventory()
local tool = clicker:get_wielded_item()
@ -186,13 +200,15 @@ mobs:register_mob("mob_horse:horse", {
end
-- show horse speed and jump stats with shoes fitted
minetest.chat_send_player(clicker:get_player_name(),
minetest.chat_send_player(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)
tool:take_item()
clicker:set_wielded_item(tool)
return
end
@ -277,6 +293,25 @@ minetest.register_craft({
}
})
-- crystal horseshoes
if minetest.get_modpath("ethereal") then
minetest.register_craftitem(":mobs:horseshoe_crystal", {
description = S("Crystal HorseShoes (use on horse to apply)"),
inventory_image = "mobs_horseshoe_crystal.png",
})
minetest.register_craft({
output = "mobs:horseshoe_crystal",
recipe = {
{"", "ethereal:crystal_block", ""},
{"ethereal:crystal_ingot", "", "ethereal:crystal_ingot"},
{"ethereal:crystal_ingot", "", "ethereal:crystal_ingot"},
}
})
end
-- lucky blocks
if minetest.get_modpath("lucky_block") then
@ -285,6 +320,7 @@ lucky_block:add_blocks({
{"dro", {"mobs:horseshoe_bronze"}},
{"dro", {"mobs:horseshoe_mese"}},
{"dro", {"mobs:horseshoe_diamond"}},
{"dro", {"mobs:horseshoe_crystal"}}
})
end

View File

@ -1,45 +1,3 @@
-- Support for the old multi-load method
dofile(minetest.get_modpath("intllib").."/init.lua")
-- Fallback functions for when `intllib` is not installed.
-- Code released under Unlicense <http://unlicense.org>.
-- Get the latest version of this file at:
-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
local function format(str, ...)
local args = { ... }
local function repl(escape, open, num, close)
if escape == "" then
local replacement = tostring(args[tonumber(num)])
if open == "" then
replacement = replacement..close
end
return replacement
else
return "@"..open..num..close
end
end
return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
end
local gettext, ngettext
if minetest.get_modpath("intllib") then
if intllib.make_gettext_pair then
-- New method using gettext.
gettext, ngettext = intllib.make_gettext_pair()
else
-- Old method using text files.
gettext = intllib.Getter()
end
end
-- Fill in missing functions.
gettext = gettext or function(msgid, ...)
return format(msgid, ...)
end
ngettext = ngettext or function(msgid, msgid_plural, n, ...)
return format(n==1 and msgid or msgid_plural, ...)
end
return gettext, ngettext

3
license.txt Normal file
View File

@ -0,0 +1,3 @@
Code: MIT
Textures: CC-BY-SA 3.0 by Mjollna
Model: MIT by KrupnovPavel

10
locale/mob_horse.en.tr Normal file
View File

@ -0,0 +1,10 @@
# textdomain:mob_horse
# , jump height: =
# , stop speed: =
# speed: =
#Bronze HorseShoes (use on horse to apply)=
#Diamond HorseShoes (use on horse to apply)=
#Horse=
#Horse shoes fitted -=
#Mese HorseShoes (use on horse to apply)=
#Steel HorseShoes (use on horse to apply)=

10
locale/mob_horse.fr.tr Normal file
View File

@ -0,0 +1,10 @@
# textdomain:mob_horse
, jump height: = , hauteur des sauts :
, stop speed: = , décélération :
speed: = vitesse :
Bronze HorseShoes (use on horse to apply)=Fers à cheval de bronze (clic droit pour ferrer)
Diamond HorseShoes (use on horse to apply)=Fers à cheval en diamant (clic droit pour ferrer)
Horse=Cheval
Horse shoes fitted -= Ferré -
Mese HorseShoes (use on horse to apply)=Fers à cheval en mese (clic droit pour ferrer)
Steel HorseShoes (use on horse to apply)=Fers à cheval en acier (clic droit pour ferrer)

10
locale/mob_horse.it_IT.tr Normal file
View File

@ -0,0 +1,10 @@
# textdomain:mob_horse
, jump height: = , altezza di salto:
, stop speed: = , velocità di arresto:
speed: = velocità:
Bronze HorseShoes (use on horse to apply)=Ferri di cavallo di bronzo (usarli su un cavallo per applicarli)
Diamond HorseShoes (use on horse to apply)=Ferri di cavallo di diamante (usarli su un cavallo per applicarli)
Horse=Cavallo
Horse shoes fitted -=Ferri di cavallo indossati -
Mese HorseShoes (use on horse to apply)=Ferri di cavallo di mese (usarli su un cavallo per applicarli)
Steel HorseShoes (use on horse to apply)=Ferri di cavallo d'acciaio (usarli su un cavallo per applicarli)

10
locale/mob_horse.ms.tr Normal file
View File

@ -0,0 +1,10 @@
# textdomain:mob_horse
, jump height: = , ketinggian lompat:
, stop speed: = , kelajuan berhenti:
speed: = kelajuan:
Bronze HorseShoes (use on horse to apply)=Ladam Kuda Gangsa (guna pada kuda untuk pakaikan ia)
Diamond HorseShoes (use on horse to apply)=Ladam Kuda Intan (guna pada kuda untuk pakaikan ia)
Horse=Kuda
Horse shoes fitted -=Ladam telah dipasang pada kuda -
Mese HorseShoes (use on horse to apply)=Ladam Kuda Mese (guna pada kuda untuk pakaikan ia)
Steel HorseShoes (use on horse to apply)=Ladam Kuda Keluli (guna pada kuda untuk pakaikan ia)

10
locale/mob_horse.zh_CN.tr Normal file
View File

@ -0,0 +1,10 @@
# textdomain:mob_horse
, jump height: =,跳跃高度:
, stop speed: =,停止速度:
speed: =速度:
Bronze HorseShoes (use on horse to apply)=青铜马蹄铁(用在马匹上)
Diamond HorseShoes (use on horse to apply)=钻石马蹄铁(用在马匹上)
Horse=马
Horse shoes fitted -=马蹄铁 -
Mese HorseShoes (use on horse to apply)=黄石马蹄铁(用在马匹上)
Steel HorseShoes (use on horse to apply)=钢马蹄铁(用在马匹上)

10
locale/mob_horse.zh_TW.tr Normal file
View File

@ -0,0 +1,10 @@
# textdomain:mob_horse
, jump height: =,跳躍高度:
, stop speed: =,停止速度:
speed: =速度:
Bronze HorseShoes (use on horse to apply)=青銅馬蹄鐵(用在馬匹上)
Diamond HorseShoes (use on horse to apply)=鑽石馬蹄鐵(用在馬匹上)
Horse=馬
Horse shoes fitted -=馬蹄鐵 -
Mese HorseShoes (use on horse to apply)=黃石馬蹄鐵(用在馬匹上)
Steel HorseShoes (use on horse to apply)=鋼馬蹄鐵(用在馬匹上)

4
mod.conf Normal file
View File

@ -0,0 +1,4 @@
name = mob_horse
depends = mobs
optional_depends = lucky_block, intllib
description = Adds a rideable horse into game with horse shoe upgrades.

View File

@ -9,10 +9,10 @@ Horses can be tamed with 10x wheat, apple, barley, oats of corn which then allow
---
### 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 right clicking with the item. These can make horses run faster or jump higher while riding depending on tier.
Horseshoes can be crafted using steel, bronze, mese, diamond and crystal (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
When riding a horse monsters will generally attack the horse first to get to player riding it, when horse dies the player is dismounted and it will drop any shoes or saddles in use as well as some horse meat.
#### Lucky Blocks: 4
#### Lucky Blocks: 5

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B