mirror of
https://github.com/FaceDeer/dfcaverns.git
synced 2025-07-16 15:30:26 +02:00
create built-in substitutes for fireflies and bones mods for when those aren't available
This commit is contained in:
@ -4,6 +4,53 @@ local dungeon_loot_path = minetest.get_modpath("dungeon_loot")
|
||||
|
||||
bones_loot = {}
|
||||
|
||||
local bones_formspec =
|
||||
"size[8,9]" ..
|
||||
"list[current_name;main;0,0.3;8,4;]" ..
|
||||
"list[current_player;main;0,4.85;8,1;]" ..
|
||||
"list[current_player;main;0,6.08;8,3;8]" ..
|
||||
"listring[current_name;main]" ..
|
||||
"listring[current_player;main]"
|
||||
if minetest.get_modpath("default") then
|
||||
bones_formspec = bones_formspec .. default.get_hotbar_bg(0,4.85)
|
||||
end
|
||||
|
||||
if minetest.get_modpath("bones") then
|
||||
df_dependencies.node_name_bones = "bones:bones"
|
||||
else
|
||||
minetest.register_node("bones_loot:bones", {
|
||||
description = S("Bones"),
|
||||
tiles = {
|
||||
"bones_top.png^[transform2",
|
||||
"bones_bottom.png",
|
||||
"bones_side.png",
|
||||
"bones_side.png",
|
||||
"bones_rear.png",
|
||||
"bones_front.png"
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
groups = {oddly_diggable_by_hand=1},
|
||||
sounds = df_dependencies.sound_gravel(),
|
||||
|
||||
can_dig = function(pos, player)
|
||||
local inv = minetest.get_meta(pos):get_inventory()
|
||||
return inv:is_empty("main")
|
||||
end,
|
||||
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", bones_formspec)
|
||||
end,
|
||||
|
||||
on_blast = function(pos)
|
||||
end,
|
||||
})
|
||||
|
||||
df_dependencies.node_name_bones = "bones_loot:bones"
|
||||
end
|
||||
|
||||
local bones_node = df_dependencies.node_name_bones
|
||||
|
||||
local local_loot = {}
|
||||
local local_loot_register = function(t)
|
||||
if t.name ~= nil then
|
||||
@ -104,19 +151,8 @@ bones_loot.get_loot = function(pos, loot_type, max_stacks, exclusive_loot_type)
|
||||
return items
|
||||
end
|
||||
|
||||
local bones_formspec =
|
||||
"size[8,9]" ..
|
||||
"list[current_name;main;0,0.3;8,4;]" ..
|
||||
"list[current_player;main;0,4.85;8,1;]" ..
|
||||
"list[current_player;main;0,6.08;8,3;8]" ..
|
||||
"listring[current_name;main]" ..
|
||||
"listring[current_player;main]"
|
||||
if minetest.get_modpath("default") then
|
||||
bones_formspec = bones_formspec .. default.get_hotbar_bg(0,4.85)
|
||||
end
|
||||
|
||||
bones_loot.place_bones = function(pos, loot_type, max_stacks, infotext, exclusive_loot_type)
|
||||
minetest.set_node(pos, {name="bones:bones", param2 = math.random(1,4)-1})
|
||||
minetest.set_node(pos, {name=bones_node, param2 = math.random(1,4)-1})
|
||||
local meta = minetest.get_meta(pos)
|
||||
if infotext == nil then
|
||||
infotext = S("Someone's old bones")
|
||||
@ -137,7 +173,7 @@ end
|
||||
minetest.register_lbm({
|
||||
label = "Repair underworld bones formspec",
|
||||
name = "bones_loot:repair_underworld_bones_formspec",
|
||||
nodenames = {"bones:bones"},
|
||||
nodenames = {bones_node},
|
||||
action = function(pos, node)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not meta:get("formspec") then
|
||||
|
@ -1,4 +1,4 @@
|
||||
name = bones_loot
|
||||
description = An API that allows bones to be placed procedurally with randomly generated loot
|
||||
depends = bones
|
||||
optional_depends = dungeon_loot, default
|
||||
depends = df_dependencies
|
||||
optional_depends = dungeon_loot, bones
|
BIN
bones_loot/textures/bones_bottom.png
Normal file
BIN
bones_loot/textures/bones_bottom.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 349 B |
BIN
bones_loot/textures/bones_front.png
Normal file
BIN
bones_loot/textures/bones_front.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 339 B |
58
bones_loot/textures/bones_license.txt
Normal file
58
bones_loot/textures/bones_license.txt
Normal file
@ -0,0 +1,58 @@
|
||||
License of source code
|
||||
----------------------
|
||||
|
||||
The MIT License (MIT)
|
||||
Copyright (C) 2012-2016 PilzAdam
|
||||
Copyright (C) 2012-2016 Various Minetest developers and contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
software and associated documentation files (the "Software"), to deal in the Software
|
||||
without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or
|
||||
substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more details:
|
||||
https://opensource.org/licenses/MIT
|
||||
|
||||
|
||||
Licenses of media (textures)
|
||||
----------------------------
|
||||
|
||||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||
Copyright (C) 2016 paramat
|
||||
|
||||
You are free to:
|
||||
Share — copy and redistribute the material in any medium or format.
|
||||
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
|
||||
The licensor cannot revoke these freedoms as long as you follow the license terms.
|
||||
|
||||
Under the following terms:
|
||||
|
||||
Attribution — You must give appropriate credit, provide a link to the license, and
|
||||
indicate if changes were made. You may do so in any reasonable manner, but not in any way
|
||||
that suggests the licensor endorses you or your use.
|
||||
|
||||
ShareAlike — If you remix, transform, or build upon the material, you must distribute
|
||||
your contributions under the same license as the original.
|
||||
|
||||
No additional restrictions — You may not apply legal terms or technological measures that
|
||||
legally restrict others from doing anything the license permits.
|
||||
|
||||
Notices:
|
||||
|
||||
You do not have to comply with the license for elements of the material in the public
|
||||
domain or where your use is permitted by an applicable exception or limitation.
|
||||
No warranties are given. The license may not give you all of the permissions necessary
|
||||
for your intended use. For example, other rights such as publicity, privacy, or moral
|
||||
rights may limit how you use the material.
|
||||
|
BIN
bones_loot/textures/bones_rear.png
Normal file
BIN
bones_loot/textures/bones_rear.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 341 B |
BIN
bones_loot/textures/bones_side.png
Normal file
BIN
bones_loot/textures/bones_side.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 338 B |
BIN
bones_loot/textures/bones_top.png
Normal file
BIN
bones_loot/textures/bones_top.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 333 B |
Reference in New Issue
Block a user