mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-01-12 02:50:25 +01:00
Added linear damage for arrows
This commit is contained in:
parent
cc9e7d5b69
commit
1cd5c6875a
@ -52,11 +52,9 @@ function throwing_register_arrow_standard (kind, desc, eq, toughness, craft)
|
|||||||
for k, obj in pairs(objs) do
|
for k, obj in pairs(objs) do
|
||||||
if obj:get_luaentity() ~= nil then
|
if obj:get_luaentity() ~= nil then
|
||||||
if obj:get_luaentity().name ~= "throwing:arrow_" .. kind .. "_entity" and obj:get_luaentity().name ~= "__builtin:item" then
|
if obj:get_luaentity().name ~= "throwing:arrow_" .. kind .. "_entity" and obj:get_luaentity().name ~= "__builtin:item" then
|
||||||
local speed = vector.length(self.object:getvelocity())
|
|
||||||
local damage = ((speed + eq)^1.2)/10 -- Modif MFF, damage tweakable here
|
|
||||||
obj:punch(self.object, 1.0, {
|
obj:punch(self.object, 1.0, {
|
||||||
full_punch_interval=1.0,
|
full_punch_interval=1.0,
|
||||||
damage_groups={fleshy=damage},
|
damage_groups={fleshy=eq},
|
||||||
}, nil)
|
}, nil)
|
||||||
if math.random() < toughness then
|
if math.random() < toughness then
|
||||||
if math.random(0,100) % 2 == 0 then
|
if math.random(0,100) % 2 == 0 then
|
||||||
@ -105,21 +103,21 @@ function throwing_register_arrow_standard (kind, desc, eq, toughness, craft)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if not DISABLE_STONE_ARROW then
|
if not DISABLE_STONE_ARROW then
|
||||||
throwing_register_arrow_standard ('stone', 'Stone', 0, 0.25, 'group:stone')
|
throwing_register_arrow_standard ('stone', 'Stone', 1, 0.25, 'group:stone')
|
||||||
end
|
end
|
||||||
|
|
||||||
if not DISABLE_STEEL_ARROW then
|
if not DISABLE_STEEL_ARROW then
|
||||||
throwing_register_arrow_standard ('steel', 'Steel', 4, 0.33, 'default:steel_ingot')
|
throwing_register_arrow_standard ('steel', 'Steel', 2, 0.33, 'default:steel_ingot')
|
||||||
end
|
end
|
||||||
|
|
||||||
if not DISABLE_OBSIDIAN_ARROW then
|
if not DISABLE_OBSIDIAN_ARROW then
|
||||||
throwing_register_arrow_standard ('obsidian', 'Obsidian', 8, 0.50, 'default:obsidian')
|
throwing_register_arrow_standard ('obsidian', 'Obsidian', 3, 0.50, 'default:obsidian')
|
||||||
end
|
end
|
||||||
|
|
||||||
if not DISABLE_DIAMOND_ARROW then
|
if not DISABLE_DIAMOND_ARROW then
|
||||||
throwing_register_arrow_standard ('diamond', 'Diamond', 12, 0.57, 'default:diamond')
|
throwing_register_arrow_standard ('diamond', 'Diamond', 4, 0.57, 'default:diamond')
|
||||||
end
|
end
|
||||||
|
|
||||||
if not DISABLE_MITHRIL_ARROW then
|
if not DISABLE_MITHRIL_ARROW then
|
||||||
throwing_register_arrow_standard ('mithril', 'Mithril (Hunter)', 15, 0.66, 'moreores:mithril_ingot')
|
throwing_register_arrow_standard ('mithril', 'Mithril (Hunter)', 5, 0.66, 'moreores:mithril_ingot')
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user