mirror of
https://gitlab.com/echoes91/spears.git
synced 2025-07-25 01:20:17 +02:00
Compare commits
13 Commits
3.1
...
6bc97332e6
Author | SHA1 | Date | |
---|---|---|---|
6bc97332e6 | |||
32d0ee567a | |||
5c7ef471ca | |||
dd5c92c0bc | |||
4514a8d0a1 | |||
2100c74a21 | |||
b888cda310 | |||
e2182ca004 | |||
a5b33a6e9a | |||
8770387fbc | |||
66c69c5265 | |||
662e637595 | |||
63d339a686 |
@ -1,3 +1,6 @@
|
||||
Update 3.1.1
|
||||
- Fix all initial settings values and completely deprecate defaults.lua
|
||||
|
||||
Version 3.1:
|
||||
- Initial l18n translations support
|
||||
- Replace stereo sounds with mono
|
||||
|
@ -3,9 +3,9 @@
|
||||
-- minetest.settings:set("spears_throw_speed", 13)
|
||||
--end
|
||||
|
||||
if minetest.settings:get("spears_drag_coeff") == nil then
|
||||
--[[ if minetest.settings:get("spears_drag_coeff") == nil then
|
||||
minetest.settings:set("spears_drag_coeff", 0.1)
|
||||
end
|
||||
end ]]
|
||||
|
||||
-- if minetest.settings:get("spears_node_cracky_limit") == nil then
|
||||
-- minetest.settings:set("spears_node_cracky_limit", 3)
|
||||
|
@ -51,6 +51,7 @@ function spears_set_entity(spear_type, base_damage, toughness)
|
||||
visual_size = {x = 0.3, y = 0.3, z = 0.3},
|
||||
wield_item = "spears:spear_" .. spear_type,
|
||||
collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.3, 0.3},
|
||||
lastpos={},
|
||||
},
|
||||
|
||||
on_activate = function (self, staticdata, dtime_s)
|
||||
@ -131,7 +132,7 @@ function spears_set_entity(spear_type, base_damage, toughness)
|
||||
end
|
||||
else -- Get drag
|
||||
local viscosity = minetest.registered_nodes[node.name].liquid_viscosity
|
||||
local drag_coeff = tonumber(minetest.settings:get("spears_drag_coeff"))
|
||||
local drag_coeff = tonumber(minetest.settings:get("spears_drag_coeff") or 0.1)
|
||||
local drag = math.max(viscosity, drag_coeff)
|
||||
local acceleration = vector.multiply(velocity, -drag)
|
||||
acceleration.y = acceleration.y - 10 * ((7 - drag) / 7)
|
||||
|
2
init.lua
2
init.lua
@ -1,4 +1,4 @@
|
||||
dofile(minetest.get_modpath("spears").."/defaults.lua")
|
||||
-- dofile(minetest.get_modpath("spears").."/defaults.lua")
|
||||
|
||||
-- local input = io.open(minetest.get_modpath("spears").."/spears.conf", "r")
|
||||
-- if input then
|
||||
|
9
locale/spears.fr.tr
Normal file
9
locale/spears.fr.tr
Normal file
@ -0,0 +1,9 @@
|
||||
# textdomain: spears
|
||||
|
||||
Stone spear=Lance en pierre
|
||||
Steel spear=Lance en acier
|
||||
Copper spear=Lance en cuivre
|
||||
Bronze spear=Lance en bronze
|
||||
Obsidian spear=Lance en obsidienne
|
||||
Diamond spear=Lance en diamant
|
||||
Golden spear=Lance en or
|
1
mod.conf
1
mod.conf
@ -5,4 +5,3 @@ description = Add spears to Minetest, versatile weapons that can be thrown
|
||||
author = Echoes91
|
||||
title = Spears
|
||||
min_minetest_version = 5.4
|
||||
|
||||
|
@ -15,6 +15,13 @@ function spears_register_spear(spear_type, desc, base_damage, toughness, materia
|
||||
return itemstack
|
||||
end,
|
||||
on_place = function(itemstack, user, pointed_thing)
|
||||
if pointed_thing.type == "node" then
|
||||
local node = minetest.get_node(pointed_thing.under)
|
||||
if minetest.registered_nodes[node.name] and (node.name == "itemframes:pedestal" or node.name == "itemframes:frame") then
|
||||
minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, user, itemstack)
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
spears_throw(itemstack, user, pointed_thing)
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
|
Reference in New Issue
Block a user