radiant damage, moreores, (more)mesecons, craftingguide submodules

master
Kyra Zimmer 2020-08-09 21:02:19 +02:00
parent 764f510186
commit cad35c503b
105 changed files with 29 additions and 4431 deletions

15
.gitmodules vendored
View File

@ -34,3 +34,18 @@
[submodule "mods/ethereal"]
path = mods/ethereal
url = https://notabug.org/TenPlus1/ethereal.git
[submodule "mods/radiant_damage"]
path = mods/radiant_damage
url = https://github.com/minetest-mods/radiant_damage.git
[submodule "mods/mesecons"]
path = mods/mesecons
url = https://github.com/minetest-mods/mesecons.git
[submodule "mods/MoreMesecons"]
path = mods/MoreMesecons
url = https://github.com/minetest-mods/MoreMesecons.git
[submodule "mods/craftguide"]
path = mods/craftguide
url = https://github.com/minetest-mods/craftguide.git
[submodule "mods/moreores"]
path = mods/moreores
url = https://github.com/minetest-mods/moreores.git

1
mods/MoreMesecons Submodule

@ -0,0 +1 @@
Subproject commit 4d7508ae70f0b2a144688ba56f005a58f0ab3449

1
mods/craftguide Submodule

@ -0,0 +1 @@
Subproject commit 4cc44d004efcee627fb234ad22a28d61520abe51

View File

@ -1,22 +0,0 @@
## Files related to minetest development cycle
/*.patch
# GNU Patch reject file
*.rej
## Editors and Development environments
*~
*.swp
*.bak*
*.orig
# Vim
*.vim
# Kate
.*.kate-swp
.swp.*
# Eclipse (LDT)
.project
.settings/
.buildpath
.metadata
# Idea IDE
.idea/*

View File

@ -1,18 +0,0 @@
unused_args = false
allow_defined_top = true
read_globals = {
"minetest",
"default",
"sfinv",
"sfinv_buttons",
"vector",
"string",
"table",
"ItemStack",
}
globals = {
"craftguide",
"core",
}

View File

@ -1,214 +0,0 @@
## API
### Custom recipes
Custom recipes are nonconventional crafts outside the main crafting grid.
They can be registered in-game dynamically and have a size beyond 3x3 items.
**Note:** the registration format differs from the default registration format in everything.
The width is automatically calculated depending where you place the commas. Look at the examples attentively.
#### Registering a custom crafting type (example)
```Lua
craftguide.register_craft_type("digging", {
description = "Digging",
icon = "default_tool_steelpick.png",
})
```
#### Registering a custom crafting recipe (examples)
```Lua
craftguide.register_craft({
type = "digging",
result = "default:cobble 2",
items = {"default:stone"},
})
```
```Lua
craftguide.register_craft({
result = "default:cobble 16",
items = {
"default:stone, default:stone, default:stone",
"default:stone, , default:stone",
"default:stone, default:stone, default:stone",
}
})
```
Recipes can be registered in a Minecraft-like way:
```Lua
craftguide.register_craft({
grid = {
"X #",
" ## ",
"X#X#",
"X X",
},
key = {
['#'] = "default:wood",
['X'] = "default:glass",
},
result = "default:mese 3",
})
```
Multiples recipes can also be registered:
```Lua
craftguide.register_craft({
{
result = "default:mese",
items = {
"default:mese_crystal, default:mese_crystal",
"default:mese_crystal, default:mese_crystal",
}
},
big = {
result = "default:mese 4",
items = {
"default:mese_crystal, default:mese_crystal",
"default:mese_crystal, default:mese_crystal",
"default:mese_crystal, default:mese_crystal",
"default:mese_crystal, default:mese_crystal",
}
},
})
```
Recipes can be registered from a given URL containing a JSON file (HTTP support is required¹):
```Lua
craftguide.register_craft({
url = "https://raw.githubusercontent.com/minetest-mods/craftguide/master/test.json"
})
```
---
### Recipe filters
Recipe filters can be used to filter the recipes shown to players. Progressive
mode is implemented as a recipe filter.
#### `craftguide.add_recipe_filter(name, function(recipes, player))`
Adds a recipe filter with the given name. The filter function should return the
recipes to be displayed, given the available recipes and an `ObjectRef` to the
user. Each recipe is a table of the form returned by
`minetest.get_craft_recipe`.
Example function to hide recipes for items from a mod called "secretstuff":
```lua
craftguide.add_recipe_filter("Hide secretstuff", function(recipes)
local filtered = {}
for _, recipe in ipairs(recipes) do
if recipe.output:sub(1,12) ~= "secretstuff:" then
filtered[#filtered + 1] = recipe
end
end
return filtered
end)
```
#### `craftguide.set_recipe_filter(name, function(recipe, player))`
Removes all recipe filters and adds a new one.
#### `craftguide.remove_recipe_filter(name)`
Removes the recipe filter with the given name.
#### `craftguide.get_recipe_filters()`
Returns a map of recipe filters, indexed by name.
---
### Search filters
Search filters are used to perform specific searches inside the search field.
They can be used like so: `<optional name>+<filter name>=<value1>,<value2>,<...>`
Examples:
- `+groups=cracky,crumbly`: search for groups `cracky` and `crumbly` in all items.
- `sand+groups=falling_node`: search for group `falling_node` for items which contain `sand` in their names.
Notes:
- If `optional name` is omitted, the search filter will apply to all items, without pre-filtering.
- Filters can be combined.
- The `groups` filter is currently implemented by default.
#### `craftguide.add_search_filter(name, function(item, values))`
Adds a search filter with the given name.
The search function should return a boolean value (whether the given item should be listed or not).
Example function to show items which contain at least a recipe of given width(s):
```lua
craftguide.add_search_filter("widths", function(item, widths)
local has_width
local recipes = recipes_cache[item]
if recipes then
for i = 1, #recipes do
local recipe_width = recipes[i].width
for j = 1, #widths do
local width = tonumber(widths[j])
if width == recipe_width then
has_width = true
break
end
end
end
end
return has_width
end)
```
#### `craftguide.remove_search_filter(name)`
Removes the search filter with the given name.
#### `craftguide.get_search_filters()`
Returns a map of search filters, indexed by name.
---
### Miscellaneous
#### `craftguide.show(player_name, item, show_usages)`
Opens the Crafting Guide with the current filter applied.
* `player_name`: string param.
* `item`: optional, string param. If set, this item is pre-selected. If the item does not exist or has no recipe, use the player's previous selection. By default, player's previous selection is used
* `show_usages`: optional, boolean param. If true, show item usages.
#### `craftguide.group_stereotypes`
This is the table indexing the item groups by stereotypes.
You can add a stereotype like so:
```Lua
craftguide.group_stereotypes.radioactive = "mod:item"
```
#### `craftguide.export_url`
If set, the mod will export all the cached recipes and usages in a JSON format
to the given URL (HTTP support is required¹).
---
**¹** Add `craftguide` to the `secure.http_mods` or `secure.trusted_mods` setting in `minetest.conf`.

View File

@ -1,26 +0,0 @@
# ![Preview1](http://i.imgur.com/fIPNYkb.png) Crafting Guide
[![ContentDB](https://content.minetest.net/packages/jp/craftguide/shields/title/)](https://content.minetest.net/packages/jp/craftguide/) [![ContentDB](https://content.minetest.net/packages/jp/craftguide/shields/downloads/)](https://content.minetest.net/packages/jp/craftguide/)
#### `craftguide` is the most comprehensive crafting guide on Minetest.
#### Consult the [Minetest Wiki](http://wiki.minetest.net/Crafting_guide) for more details.
This crafting guide is a blue book named *"Crafting Guide"* or a wooden sign.
This crafting guide features a **progressive mode**.
This mode is a Terraria-like system that shows recipes you can craft
from items you ever had in your inventory. To enable it: `craftguide_progressive_mode = true` in `minetest.conf`.
`craftguide` is also integrated in `sfinv` (Minetest Game inventory). To enable it:
`craftguide_sfinv_only = true` in `minetest.conf`.
Use the command `/craft` to show the recipe(s) of the pointed node.
For developers, `craftguide` also has a [modding API](https://github.com/minetest-mods/craftguide/blob/master/API.md).
For the best visuals, it is recommended to enable `inventory_items_animations` in `minetest.conf`.
Love this mod? Donations are appreciated: https://www.paypal.me/jpg84240
![Preview2](https://i.imgur.com/TrBouDq.png)

File diff suppressed because it is too large Load Diff

View File

@ -1,58 +0,0 @@
License of source code
----------------------
The MIT License (MIT)
Copyright (c) 2015-2020 Jean-Patrick Guerrero 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.
Licenses of media (textures)
----------------------------
Copyright © Diego Martínez (kaeza): craftguide_*_icon.png (CC BY-SA 3.0)
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.
For more details:
http://creativecommons.org/licenses/by-sa/3.0/

View File

@ -1,60 +0,0 @@
# textdomain: craftguide
Craft Guide=Rezeptbuch
Crafting Guide=Rezeptbuch
Crafting Guide Sign=Rezepttafel
Bookmarks=Lesezeichen
Usage @1 of @2=Verwendung @1 von @2
Recipe @1 of @2=Rezept @1 von @2
No recipes=Keine Rezepte
No usages=Keine Verwendungen
Burning time: @1=Brennzeit: @1
Cooking time: @1=Kochzeit: @1
Replaced by @1 on smelting=Ersetzt durch @1 beim Schmelzen
Replaced by @1 on burning=Ersetzt durch @1 beim Brennen
Replaced by @1 on crafting=Ersetzt durch @1 beim Fertigen
Repairable by step of @1=Reparierbar um @1
Any item belonging to the group(s): @1=Beliebiger Gegenstand aus Gruppe(n): @1
Any black dye=Beliebiger schwarzer Farbstoff
Any black flower=Beliebige schwarze Blume
Any blue dye=Beliebiger blauer Farbstoff
Any blue flower=Beliebige blaue Blume
Any brown dye=Beliebiger brauner Farbstoff
Any coal=Beliebige Kohle
Any cyan dye=Beliebiger türkiser Farbstoff
Any dark green dye=Beliebiger dunkelgrüner Farbstoff
Any dark grey dye=Beliebiger dunkelgrauer Farbstoff
Any green dye=Beliebiger grüner Farbstoff
Any green flower=Beliebige grüne Blume
Any grey dye=Beliebiger grauer Farbstoff
Any kind of stone block=Beliebiger Steinblock
Any magenta dye=Beliebiger magenta Farbstoff
Any orange dye=Beliebiger orange Farbstoff
Any orange flower=Beliebige orange Blume
Any pink dye=Beliebiger rosa Farbstoff
Any red dye=Beliebiger roter Farbstoff
Any red flower=Beliebige rote Blume
Any sand=Beliebiger Sand
Any stick=Beliebiger Stock
Any tree=Beliebiger Baum
Any vessel=Beliebiger Behälter
Any violet dye=Beliebiger violetter Farbstoff
Any violet flower=Beliebige violette Blume
Any white dye=Beliebiger weißer Farbstoff
Any white flower=Beliebige weiße Blume
Any wood planks=Beliebige Holzplanken
Any wool=Beliebige Wolle
Any yellow dye=Beliebiger gelber Farbstoff
Any yellow flower=Beliebige gelbe Blume
Recipe's too big to be displayed (@1x@2)=Rezept ist zu groß für die Anzeige (@1×@2)
Shapeless=Formlos
Cooking=Kochen
No item to show=Nichts anzuzeigen
Collect items to reveal more recipes=Gegenstände aufsammeln, um mehr Rezepte aufzudecken
Show recipe(s) of the pointed node=Rezept(e) des gezeigten Blocks anzeigen
No node pointed=Auf keinem Block gezeigt
You don't know a recipe or usage for this item=Sie kennen kein Rezept und keine Verwendung für diesen Gegenstand
No recipe or usage for this item=Kein Rezept und keine Verwendung für diesen Gegenstand
Digging=Graben
Digging Chance=Grabechance
@1 of chance to drop=@1 Abwurfwahrscheinlichkeit

View File

@ -1,65 +0,0 @@
# textdomain: craftguide
Craft Guide=Guide de recettes
Crafting Guide=Guide de recettes
Crafting Guide Sign=Guide de recettes
Bookmarks=Favoris
Usage @1 of @2=Usage @1 sur @2
Recipe @1 of @2=Recette @1 sur @2
No recipes=Pas de recettes
No usages=Pas d'usages
Burning time: @1=Temps de combustion : @1
Cooking time: @1=Temps de cuisson : @1
Replaced by @1 on smelting=Remplacé par @1 lors de la cuisson
Replaced by @1 on burning=Remplacé par @1 lors de la combustion
Replaced by @1 on crafting=Remplacé par @1 lors de la fabrication
Repairable by step of @1=Réparable par étape de @1
Any item belonging to the group(s): @1=Tout item appartenant au(x) groupe(s) : @1
Any black dye=Quelconque colorant noir
Any black flower=Quelconque fleur noire
Any blue dye=Quelconque colorant bleu
Any blue flower=Quelconque fleur bleue
Any brown dye=Quelconque colorant marron
Any coal=Quelconque charbon
Any cyan dye=Quelconque colorant bleu ciel
Any dark green dye=Quelconque colorant vert foncé
Any dark grey dye=Quelconque colorant gris foncé
Any green dye=Quelconque colorant vert
Any green flower=Quelconque fleur verte
Any grey dye=Quelconque colorant gris
Any kind of stone block=Quelconque roche
Any magenta dye=Quelconque colorant magenta
Any orange dye=Quelconque colorant orange
Any orange flower=Quelconque fleur orange
Any pink dye=Quelconque colorant rose
Any red dye=Quelconque colorant rouge
Any red flower=Quelconque fleur rouge
Any sand=Quelconque sable
Any stick=Quelconque bâton
Any tree=Quelconque tronc d'arbre
Any vessel=Quelconque couvert
Any violet dye=Quelconque colorant violet
Any violet flower=Quelconque fleur violette
Any white dye=Quelconque colorant blanc
Any white flower=Quelconque fleur blanche
Any wood planks=Quelconques planches de bois
Any wool=Quelconque laine
Any yellow dye=Quelconque colorant jaune
Any yellow flower=Quelconque fleur jaune
Recipe's too big to be displayed (@1x@2)=La recette est trop grande pour être affichée (@1x@2)
Shapeless=Sans forme
Cooking=Cuisson
No item to show=Aucun item à afficher
Collect items to reveal more recipes=Collecte des items pour révéler plus de recettes
Show recipe(s) of the pointed node=Affiche les recettes du bloc visé
No node pointed=Aucun bloc visé
You don't know a recipe or usage for this item=Vous ne connaissez aucune recette pour ce bloc
No recipe or usage for this item=Aucune recette pour ce bloc
Digging=Destruction
Digging (by chance)=Destruction (par chance)
@1 of chance to drop=@1 de chance de tomber
Mark this item=Mettre en favori.
Unmark this item=Enlever des favoris.
Cannot mark this item. Limit of bookmarks reached.=Impossible de mettre cet item en favori. Limite des favoris atteinte.
Only drop if using one of these tools: @1=Tombe seulement si détruit avec un de ces outils : @1
Only drop if using this tool: @1=Tombe seulement si détruit avec cet outil : @1

View File

@ -1,60 +0,0 @@
# textdomain: craftguide
Craft Guide=Guida di assemblaggio
Crafting Guide=Guida d'assemblaggio
Crafting Guide Sign=Cartello della guida di assemblaggio
Bookmarks=Segnalibri
Usage @1 of @2=Utilizzo @1 di @2
Recipe @1 of @2=Ricetta @1 di @2
No recipes=Nessuna ricetta
No usages=Nessun utilizzo
Burning time: @1=Tempo di combustione: @1
Cooking time: @1=Tempo di cottura: @1
Replaced by @1 on smelting=Sostituito da @1 alla fusione
Replaced by @1 on burning=Sostituito da @1 alla combustione
Replaced by @1 on crafting=Sostituito da @1 all'assemblaggio
Repairable by step of @1=Riparabile per passo di @1
Any item belonging to the group(s): @1=Qualunque oggetto appartenente al/ai gruppo/i: @1
Any black dye=Qualunque tintura nera
Any black flower=Qualunque fiore nero
Any blue dye=Qualunque tintura blu
Any blue flower=Qualunque fiore blu
Any brown dye=Qualunque tintura marrone
Any coal=Qualunque carbone
Any cyan dye=Qualunque tintura ciano
Any dark green dye=Qualunque tintura verde scura
Any dark grey dye=Qualunque tintura grigio scura
Any green dye=Qualunque tintura verde
Any green flower=Qualunque fiore verde
Any grey dye=Qualunque tintura grigia
Any kind of stone block=Qualunque tipo di blocco di pietra
Any magenta dye=Qualunque tintura magenta
Any orange dye=Qualunque tintura arancione
Any orange flower=Qualunque fiore arancione
Any pink dye=Qualunque tintura rosa
Any red dye=Qualunque tintura rossa
Any red flower=Qualunque fiore rosso
Any sand=Qualunque sabbia
Any stick=Qualunque bastone
Any tree=Qualunque albero
Any vessel=Qualunque contenitore
Any violet dye=Qualunque tintura viola
Any violet flower=Qualunque fiore viola
Any white dye=Qualunque tintura bianca
Any white flower=Qualunque fiore bianco
Any wood planks=Qualunque asse di legno
Any wool=Qualunque lana
Any yellow dye=Qualunque tintura gialla
Any yellow flower=Qualunque fiore giallo
Recipe's too big to be displayed (@1x@2)=La ricetta è troppo grande per essere mostrata (@1x@2)
Shapeless=Senza forma
Cooking=Cottura
No item to show=Nessun oggetto da mostrare
Collect items to reveal more recipes=Raccogli oggetti per svelare più ricette
Show recipe(s) of the pointed node=Mostra la/le ricetta/e del nodo puntato
No node pointed=Nessun nodo puntato
You don't know a recipe or usage for this item=Non conosci una ricetta o un utilizzo per questo oggetto
No recipe or usage for this item=Nessuna ricetta o utilizzo per questo oggetto
Digging=Scavando
Digging Chance=Probabilità di scavare
@1 of chance to drop=@1 di probabilità di rilascio

View File

@ -1,19 +0,0 @@
# textdomain: craftguide
Craft Guide=книга рецептов крафта
Crafting Guide=книга рецептов крафта
Crafting Guide Sign=Знак с книгой рецептов
Usage @1 of @2=использование @1 из @2
Recipe @1 of @2=Рецепт @1 из @2
Burning time: @1=Время горения: @1
Cooking time: @1=Время преготовления: @1
Any item belonging to the group(s): @1=Любой элемент из группы: @1
Recipe's too big to be displayed (@1x@2)=Рецепт слишком большой для показа (@1x@2)
Shapeless=Бесформенный
Cooking=Приготовление
No item to show=Нет элемента для показа
Collect items to reveal more recipes=Собирайте предметы, чтобы раскрыть больше рецептов
Show recipe(s) of the pointed node=Показать рецепт(ы) выбранной ноды
No node pointed=Не указана нода
You don't know a recipe for this node=Вы не знаете рецепт для этой ноды
No recipe for this node=Нет рецептов для этой ноды

View File

@ -1,65 +0,0 @@
# textdomain: craftguide
Craft Guide=
Crafting Guide=
Crafting Guide Sign=
Bookmarks=
Usage @1 of @2=
Recipe @1 of @2=
No recipes=
No usages=
Burning time: @1=
Cooking time: @1=
Replaced by @1 on smelting=
Replaced by @1 on burning=
Replaced by @1 on crafting=
Repairable by step of @1=
Any item belonging to the group(s): @1=
Any black dye=
Any black flower=
Any blue dye=
Any blue flower=
Any brown dye=
Any coal=
Any cyan dye=
Any dark green dye=
Any dark grey dye=
Any green dye=
Any green flower=
Any grey dye=
Any stone=
Any magenta dye=
Any orange dye=
Any orange flower=
Any pink dye=
Any red dye=
Any red flower=
Any sand=
Any stick=
Any tree=
Any vessel=
Any violet dye=
Any violet flower=
Any white dye=
Any white flower=
Any wood planks=
Any wool=
Any yellow dye=
Any yellow flower=
Recipe's too big to be displayed (@1x@2)=
Shapeless=
Cooking=
No item to show=
Collect items to reveal more recipes=
Show recipe(s) of the pointed node=
No node pointed=
You don't know a recipe or usage for this item=
No recipe or usage for this item=
Digging=
Digging (by chance)=
@1 of chance to drop=
Mark this item=
Unmark this item=
Cannot mark this item. Limit of bookmarks reached.=
Only drop if using one of these tools: @1=
Only drop if using this tool: @1=

View File

@ -1,3 +0,0 @@
name = craftguide
optional_depends = sfinv, sfinv_buttons
description = The most comprehensive Crafting Guide on Minetest

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

View File

@ -1,5 +0,0 @@
# The progressive mode shows recipes you can craft from items you ever had in your inventory.
craftguide_progressive_mode (Learn crafting recipes progressively) bool false
# Integration in the default Minetest Game inventory.
craftguide_sfinv_only (Crafting Guide in inventory only) bool false

View File

@ -1,8 +0,0 @@
{
"items": [
"default:stone, default:stone, default:stone",
"default:stone, , default:stone",
"default:stone, default:stone, default:stone"
],
"result": "default:cobble 16"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

1
mods/mesecons Submodule

@ -0,0 +1 @@
Subproject commit 16836b16d690e2d337575afe9fde286f32ec5d5f

1
mods/moreores Submodule

@ -0,0 +1 @@
Subproject commit 734f927f37de30c99d1f3060d1528f8f0639bf10

View File

@ -1,13 +0,0 @@
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.{lua,luacheckrc}]
indent_style = tab
indent_size = 4

View File

@ -1,3 +0,0 @@
## Generic ignorable patterns and files
*~
debug.txt

View File

@ -1,33 +0,0 @@
std = "lua51+minetest"
unused_args = false
allow_defined_top = true
max_line_length = 90
stds.minetest = {
read_globals = {
"DIR_DELIM",
"minetest",
"core",
"dump",
"vector",
"nodeupdate",
"VoxelManip",
"VoxelArea",
"PseudoRandom",
"ItemStack",
"default",
table = {
fields = {
"copy",
},
},
}
}
read_globals = {
"carts",
"farming",
"frame",
"intllib",
"mg",
}

View File

@ -1,14 +0,0 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
args: [--fix=lf]
- repo: https://github.com/Calinou/pre-commit-luacheck
rev: v1.0.0
hooks:
- id: luacheck

View File

@ -1,16 +0,0 @@
dist: bionic
language: python
python:
- 3.7.1
install:
- sudo apt-get update -qq
- sudo apt-get install -qqq luarocks
- pip3 install pre-commit
- luarocks install --local luacheck
script:
# All linters are run with pre-commit hooks
- export PATH="$HOME/.luarocks/bin:$PATH"
- pre-commit run --all-files

View File

@ -1,56 +0,0 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [2.0.0] - 2019-11-25
### Added
- More Ores nodes/items/tools can now be placed in item frames
from the [`frame`](https://github.com/minetest-mods/frame) mod.
- Polish translation.
### Changed
- The minimum supported Minetest version is now 5.0.0.
- Copper rails are now registered using functions from the `carts` mod,
making them interoperate seamlessly with default rails.
- Copper rails can no longer be placed in the air.
## [1.1.0] - 2019-03-23
### Added
- Brazilian and Dutch translations.
### Changed
- Ores are now slower to mine and cannot be mined using wooden tools anymore.
- Updated intllib support to avoid using deprecated functions.
### Deprecated
- Deprecated hoes to follow Minetest Game's deprecation of hoes
made of "rare" materials.
- Hoes are still available in existing worlds, but they
cannot be crafted anymore.
### Fixed
- Hoes now use the `farming` mod's handling function and can no longer
turn desert sand into dirt.
- Handle tin which is now included in [Minetest Game](https://github.com/minetest/minetest_game).
If it is detected, then the tin nodes and items from More Ores won't be registered.
## 1.0.0 - 2017-02-19
- Initial versioned release.
[Unreleased]: https://github.com/minetest-mods/moreores/compare/v2.0.0...HEAD
[2.0.0]: https://github.com/minetest-mods/moreores/compare/v1.1.0...v2.0.0
[1.1.0]: https://github.com/minetest-mods/moreores/compare/v1.0.0...v1.1.0

View File

@ -1,10 +0,0 @@
# Contributing to More Ores
Thank you for your interest in More Ores! Before contributing,
be sure to know about these few guidelines:
- Contributions have to be licensed under the zlib license (or compatible)
for code, and CC BY-SA 3.0 (or compatible) for assets.
- Make sure to update the changelog, keeping the
[changelog format](http://keepachangelog.com/en/1.0.0/) we use.
- Don't bump the version yourself. Maintainers will do this when necessary.

View File

@ -1,13 +0,0 @@
# zlib license
Copyright © 2011-2019 Hugo Locurcio and contributors
**This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.**
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

View File

@ -1,74 +0,0 @@
# More Ores
More Ores for [Minetest](https://www.minetest.net/), a free and open source infinite
world block sandbox game.
[**Forum topic**](https://forum.minetest.net/viewtopic.php?f=11&t=549)
## Installation
### Download the mod
To install More Ores, clone this Git repository into your Minetest's `mods/`
directory:
```bash
git clone https://github.com/minetest-mods/moreores.git
```
You can also
[download a ZIP archive](https://github.com/minetest-mods/moreores/archive/master.zip)
of More Ores. If you do so, you will need to extract the archive then rename
the resulting folder from `moreores-master` to `moreores` this is
**absolutely** required, as the mod won't work otherwise.
### Enable the mod
Once you have installed More Ores, you need to enable it in Minetest.
The procedure is as follows:
#### Using the client's main menu
This is the easiest way to enable More Ores when playing in singleplayer
(or on a server hosted from a client).
1. Start Minetest and switch to the **Local Game** tab.
2. Select the world you want to enable More Ores in.
3. Click **Configure**, then enable `moreores` by double-clicking it
(or ticking the **Enabled** checkbox).
4. Save the changes, then start a game on the world you enabled More Ores on.
5. More Ores should now be running on your world.
#### Using a text editor
This is the recommended way to enable the mod on a server without using a GUI.
1. Make sure Minetest is not currently running (otherwise, it will overwrite
the changes when exiting).
2. Open the world's `world.mt` file using a text editor.
3. Add the following line at the end of the file:
```text
load_mod_moreores = true
```
If the line is already present in the file, then replace `false` with `true`
on that line.
4. Save the file, then start a game on the world you enabled More Ores on.
5. More Ores should now be running on your world.
## Version compatibility
More Ores is currently primarily tested with Minetest 5.1.0.
It may or may not work with newer or older versions. Issues arising in older
versions than 5.0.0 will generally not be fixed.
## License
Copyright © 2011-2019 Hugo Locurcio and contributors
- More Ores code is licensed under the zlib license, see
[`LICENSE.md`](LICENSE.md) for details.
- Unless otherwise specified, More Ores textures are licensed under
[CC BY-SA 3.0 Unported](https://creativecommons.org/licenses/by-sa/3.0/).

View File

@ -1,27 +0,0 @@
------------------------------------------------------------------------------
------------------------------ CONFIGURATION ---------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-------- Change settings by changing the values after the "=". ---------------
------------------------------------------------------------------------------
-- Chunk sizes for ore generation (bigger = ore deposits are more scattered around)
moreores.tin_chunk_size = 7
moreores.silver_chunk_size = 11
moreores.mithril_chunk_size = 11
-- Amount of ore per chunk (higher = bigger ore deposits)
moreores.tin_ore_per_chunk = 3
moreores.silver_ore_per_chunk = 4
moreores.mithril_ore_per_chunk = 1
-- Minimal depths of ore generation (Y coordinate, 0 being sea level by default)
moreores.tin_min_depth = -31000
moreores.silver_min_depth = -31000
moreores.mithril_min_depth = -31000
-- Maximal depths of ore generation (Y coordinate, 0 being sea level by default)
moreores.tin_max_depth = 8
moreores.silver_max_depth = -2
moreores.mithril_max_depth = -512

View File

@ -1,378 +0,0 @@
--[[
=====================================================================
** More Ores **
By Calinou, with the help of Nore.
Copyright © 2011-2019 Hugo Locurcio and contributors.
Licensed under the zlib license. See LICENSE.md for more information.
=====================================================================
--]]
moreores = {}
local modpath = minetest.get_modpath("moreores")
local S, NS = dofile(modpath .. "/intllib.lua")
moreores.S = S
moreores.NS = NS
dofile(modpath .. "/_config.txt")
-- `mg` mapgen support
if minetest.get_modpath("mg") then
dofile(modpath .. "/mg.lua")
end
-- `frame` support
local use_frame = minetest.get_modpath("frame")
local default_stone_sounds = default.node_sound_stone_defaults()
local default_metal_sounds = default.node_sound_metal_defaults()
-- Returns the crafting recipe table for a given material and item.
local function get_recipe(material, item)
if item == "sword" then
return {
{material},
{material},
{"group:stick"},
}
end
if item == "shovel" then
return {
{material},
{"group:stick"},
{"group:stick"},
}
end
if item == "axe" then
return {
{material, material},
{material, "group:stick"},
{"", "group:stick"},
}
end
if item == "pick" then
return {
{material, material, material},
{"", "group:stick", ""},
{"", "group:stick", ""},
}
end
if item == "block" then
return {
{material, material, material},
{material, material, material},
{material, material, material},
}
end
if item == "lockedchest" then
return {
{"group:wood", "group:wood", "group:wood"},
{"group:wood", material, "group:wood"},
{"group:wood", "group:wood", "group:wood"},
}
end
end
local function add_ore(modname, description, mineral_name, oredef)
local img_base = modname .. "_" .. mineral_name
local toolimg_base = modname .. "_tool_"..mineral_name
local tool_base = modname .. ":"
local tool_post = "_" .. mineral_name
local item_base = tool_base .. mineral_name
local ingot = item_base .. "_ingot"
local lump_item = item_base .. "_lump"
if oredef.makes.ore then
minetest.register_node(modname .. ":mineral_" .. mineral_name, {
description = S("%s Ore"):format(S(description)),
tiles = {"default_stone.png^" .. modname .. "_mineral_" .. mineral_name .. ".png"},
groups = {cracky = 2},
sounds = default_stone_sounds,
drop = lump_item,
})
if use_frame then
frame.register(modname .. ":mineral_" .. mineral_name)
end
end
if oredef.makes.block then
local block_item = item_base .. "_block"
minetest.register_node(block_item, {
description = S("%s Block"):format(S(description)),
tiles = {img_base .. "_block.png"},
groups = {snappy = 1, bendy = 2, cracky = 1, melty = 2, level = 2},
sounds = default_metal_sounds,
})
minetest.register_alias(mineral_name.."_block", block_item)
if oredef.makes.ingot then
minetest.register_craft( {
output = block_item,
recipe = get_recipe(ingot, "block")
})
minetest.register_craft( {
output = ingot .. " 9",
recipe = {
{block_item},
}
})
end
if use_frame then
frame.register(block_item)
end
end
if oredef.makes.lump then
minetest.register_craftitem(lump_item, {
description = S("%s Lump"):format(S(description)),
inventory_image = img_base .. "_lump.png",
})
minetest.register_alias(mineral_name .. "_lump", lump_item)
if oredef.makes.ingot then
minetest.register_craft({
type = "cooking",
output = ingot,
recipe = lump_item,
})
end
if use_frame then
frame.register(lump_item)
end
end
if oredef.makes.ingot then
minetest.register_craftitem(ingot, {
description = S("%s Ingot"):format(S(description)),
inventory_image = img_base .. "_ingot.png",
})
minetest.register_alias(mineral_name .. "_ingot", ingot)
if use_frame then
frame.register(ingot)
end
end
if oredef.makes.chest then
minetest.register_craft( {
output = "default:chest_locked",
recipe = {
{ingot},
{"default:chest"},
}
})
minetest.register_craft( {
output = "default:chest_locked",
recipe = get_recipe(ingot, "lockedchest")
})
end
oredef.oredef.ore_type = "scatter"
oredef.oredef.ore = modname .. ":mineral_" .. mineral_name
oredef.oredef.wherein = "default:stone"
minetest.register_ore(oredef.oredef)
for tool_name, tooldef in pairs(oredef.tools) do
local tdef = {
description = "",
inventory_image = toolimg_base .. tool_name .. ".png",
tool_capabilities = {
max_drop_level = 3,
groupcaps = tooldef,
},
sound = {breaks = "default_tool_breaks"},
}
if tool_name == "sword" then
tdef.tool_capabilities.full_punch_interval = oredef.full_punch_interval
tdef.tool_capabilities.damage_groups = oredef.damage_groups
tdef.description = S("%s Sword"):format(S(description))
end
if tool_name == "pick" then
tdef.tool_capabilities.full_punch_interval = oredef.full_punch_interval
tdef.tool_capabilities.damage_groups = oredef.damage_groups
tdef.description = S("%s Pickaxe"):format(S(description))
end
if tool_name == "axe" then
tdef.tool_capabilities.full_punch_interval = oredef.full_punch_interval
tdef.tool_capabilities.damage_groups = oredef.damage_groups
tdef.description = S("%s Axe"):format(S(description))
end
if tool_name == "shovel" then
tdef.full_punch_interval = oredef.full_punch_interval
tdef.tool_capabilities.damage_groups = oredef.damage_groups
tdef.description = S("%s Shovel"):format(S(description))
tdef.wield_image = toolimg_base .. tool_name .. ".png^[transformR90"
end
local fulltool_name = tool_base .. tool_name .. tool_post
if tool_name == "hoe" and minetest.get_modpath("farming") then
tdef.max_uses = tooldef.uses
tdef.description = S("%s Hoe"):format(S(description))
farming.register_hoe(fulltool_name, tdef)
end
-- Hoe registration is handled above.
-- There are no crafting recipes for hoes, as they have been
-- deprecated from Minetest Game:
-- https://github.com/minetest/minetest_game/commit/9c459e77a
if tool_name ~= "hoe" then
minetest.register_tool(fulltool_name, tdef)
if oredef.makes.ingot then
minetest.register_craft({
output = fulltool_name,
recipe = get_recipe(ingot, tool_name)
})
end
end
minetest.register_alias(tool_name .. tool_post, fulltool_name)
if use_frame then
frame.register(fulltool_name)
end
end
end
local oredefs = {
silver = {
description = "Silver",
makes = {ore = true, block = true, lump = true, ingot = true, chest = true},
oredef = {
clust_scarcity = moreores.silver_chunk_size ^ 3,
clust_num_ores = moreores.silver_ore_per_chunk,
clust_size = moreores.silver_chunk_size,
y_min = moreores.silver_min_depth,
y_max = moreores.silver_max_depth,
},
tools = {
pick = {
cracky = {times = {[1] = 2.60, [2] = 1.00, [3] = 0.60}, uses = 100, maxlevel = 1},
},
hoe = {
uses = 300,
},
shovel = {
crumbly = {times = {[1] = 1.10, [2] = 0.40, [3] = 0.25}, uses = 100, maxlevel = 1},
},
axe = {
choppy = {times = {[1] = 2.50, [2] = 0.80, [3] = 0.50}, uses = 100, maxlevel = 1},
fleshy = {times = {[2] = 1.10, [3] = 0.60}, uses = 100, maxlevel = 1}
},
sword = {
fleshy = {times = {[2] = 0.70, [3] = 0.30}, uses = 100, maxlevel = 1},
snappy = {times = {[2] = 0.70, [3] = 0.30}, uses = 100, maxlevel = 1},
choppy = {times = {[3] = 0.80}, uses = 100, maxlevel = 0},
},
},
full_punch_interval = 1.0,
damage_groups = {fleshy = 6},
},
mithril = {
description = "Mithril",
makes = {ore = true, block = true, lump = true, ingot = true, chest = false},
oredef = {
clust_scarcity = moreores.mithril_chunk_size ^ 3,
clust_num_ores = moreores.mithril_ore_per_chunk,
clust_size = moreores.mithril_chunk_size,
y_min = moreores.mithril_min_depth,
y_max = moreores.mithril_max_depth,
},
tools = {
pick = {
cracky = {times = {[1] = 2.25, [2] = 0.55, [3] = 0.35}, uses = 200, maxlevel = 2}
},
hoe = {
uses = 1000,
},
shovel = {
crumbly = {times = {[1] = 0.70, [2] = 0.35, [3] = 0.20}, uses = 200, maxlevel = 2},
},
axe = {
choppy = {times = {[1] = 1.75, [2] = 0.45, [3] = 0.45}, uses = 200, maxlevel = 2},
fleshy = {times = {[2] = 0.95, [3] = 0.30}, uses = 200, maxlevel = 1}
},
sword = {
fleshy = {times = {[2] = 0.65, [3] = 0.25}, uses = 200, maxlevel = 2},
snappy = {times = {[2] = 0.70, [3] = 0.25}, uses = 200, maxlevel = 2},
choppy = {times = {[3] = 0.65}, uses = 200, maxlevel = 0},
},
},
full_punch_interval = 0.45,
damage_groups = {fleshy = 9},
}
}
-- If tin is available in the `default` mod, don't register More Ores' variant of tin
local default_tin
if minetest.registered_items["default:tin_ingot"] then
default_tin = true
else
default_tin = false
end
if default_tin then
minetest.register_alias("moreores:mineral_tin", "default:stone_with_tin")
minetest.register_alias("moreores:tin_lump", "default:tin_lump")
minetest.register_alias("moreores:tin_ingot", "default:tin_ingot")
minetest.register_alias("moreores:tin_block", "default:tinblock")
else
oredefs.tin = {
description = "Tin",
makes = {ore = true, block = true, lump = true, ingot = true, chest = false},
oredef = {
clust_scarcity = moreores.tin_chunk_size ^ 3,
clust_num_ores = moreores.tin_ore_per_chunk,
clust_size = moreores.tin_chunk_size,
y_min = moreores.tin_min_depth,
y_max = moreores.tin_max_depth,
},
tools = {},
}
-- Bronze has some special cases, because it is made from copper and tin
minetest.register_craft({
type = "shapeless",
output = "default:bronze_ingot 3",
recipe = {
"moreores:tin_ingot",
"default:copper_ingot",
"default:copper_ingot",
},
})
end
-- Copper rail (unique node)
if minetest.get_modpath("carts") then
carts:register_rail("moreores:copper_rail", {
description = S("Copper Rail"),
tiles = {
"moreores_copper_rail.png",
"moreores_copper_rail_curved.png",
"moreores_copper_rail_t_junction.png",
"moreores_copper_rail_crossing.png",
},
inventory_image = "moreores_copper_rail.png",
wield_image = "moreores_copper_rail.png",
groups = carts:get_rail_groups(),
}, {})
end
minetest.register_craft({
output = "moreores:copper_rail 24",
recipe = {
{"default:copper_ingot", "", "default:copper_ingot"},
{"default:copper_ingot", "group:stick", "default:copper_ingot"},
{"default:copper_ingot", "", "default:copper_ingot"},
},
})
for orename, def in pairs(oredefs) do
-- Register everything
add_ore("moreores", def.description, orename, def)
end

View File

@ -1,44 +0,0 @@
-- 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

View File

@ -1,21 +0,0 @@
# Translation by Xanthin
[moreores] loaded. = [moreores] geladen.
%s Ore = %serz
%s Lump = %sklumpen
%s Ingot = %sbarren
%s Block = %sblock
%s Pickaxe = %sspitzhacke
%s Shovel = %sschaufel
%s Axe = %saxt
%s Sword = %sschwert
Copper = Kupfer
Tin = Zinn
Bronze = Bronze
Silver = Silber
Gold = Gold
Mithril = Mithril
Copper Rail = Kupferschiene

View File

@ -1,21 +0,0 @@
# Translation by kaeza
[moreores] loaded. = [moreores] cargado.
%s Ore = Mineral de %s
%s Lump = Pepita de %s
%s Ingot = Lingote de %s
%s Block = Bloque de %s
%s Pickaxe = Pico de %s
%s Shovel = Pala de %s
%s Axe = Hacha de %s
%s Sword = Espada de %s
Copper = cobre
Tin = estaño
Bronze = bronce
Silver = plata
Gold = oro
Mithril = mitrilo
Copper Rail = Riel de Cobre

View File

@ -1,21 +0,0 @@
# Translation by Calinou
[moreores] loaded. = [moreores] a été chargé.
%s Ore = Minerai en %s
%s Lump = Roche en %s
%s Ingot = Lingot en %s
%s Block = Bloc en %s
%s Pickaxe = Pioche en %s
%s Shovel = Pelle en %s
%s Axe = Hache en %s
%s Sword = Épée en %s
Copper = cuivre
Tin = étain
Bronze = bronze
Silver = argent
Gold = or
Mithril = mithril
Copper Rail = Rail en cuivre

View File

@ -1,21 +0,0 @@
# Translation by Pagliaccio
[moreores] loaded. = [moreores] caricato.
%s Ore = Minerale di %s
%s Lump = %s grezzo
%s Ingot = Lingotto di %s
%s Block = Blocco di %s
%s Pickaxe = Piccone di %s
%s Shovel = Badile di %s
%s Axe = Ascia di %s
%s Sword = Spada di %s
Copper = Rame
Tin = Stagno
Bronze = Bronzo
Silver = Argento
Gold = Oro
Mithril = Mithril
Copper Rail = Binario di rame

View File

@ -1,19 +0,0 @@
[moreores] loaded. = [moreores] geladen.
%s Ore = %s Erts
%s Lump = %s Klomp
%s Ingot = %s Staaf
%s Block = %s Blok
%s Pickaxe = %s Pikhouweel
%s Shovel = %s Schep
%s Axe = %s Bijl
%s Sword = %s Zwaard
Copper = Koper
Tin = Tin
Bronze = Brons
Silver = Silver
Gold = Goud
Mithril = Mithril
Copper Rail = Koperen Spoor

View File

@ -1,21 +0,0 @@
# Translation by mat9117
[moreores] loaded. = [moreores] załadowano.
%s Ore = %s Ruda
%s Lump = %s Bryłka
%s Ingot = %s Sztabka
%s Block = %s Blok
%s Pickaxe = %s Kilof
%s Shovel = %s Łopatka
%s Axe = %s Siekiera
%s Sword = %s Miecz
Copper = Miedź
Tin = Cyna
Bronze = Brąz
Silver = Srebro
Gold = Złoto
Mithril = Mithril
Copper Rail = Miedziany tor

View File

@ -1,21 +0,0 @@
# Translation by github.com/caiorrs
[moreores] loaded. = [moreores] carregado.
%s Ore = Minério de %s
%s Lump = Pepita de %s
%s Ingot = Lingote de %s
%s Block = Bloco de %s
%s Pickaxe = Picareta de %s
%s Shovel = Pá de %s
%s Axe = Machado de %s
%s Sword = Espada de %s
Copper = Cobre
Tin = Estanho
Bronze = Bronze
Silver = Prata
Gold = Ouro
Mithril = Mitrilo
Copper Rail = Trilho de Cobre

View File

@ -1,25 +0,0 @@
# Translation by Mahmutelmas06
# mahmutelmas06@hotmail.com
# Türkçe Çeviri
# Turkish translation
# Language 2 letter iso code is "tr"
[moreores] loaded. = [moreores] yüklendi.
%s Ore = %s madeni
%s Lump = %s yığını
%s Ingot = %s külçesi
%s Block = %s blok
%s Pickaxe = %s kazma
%s Shovel = %s kürek
%s Axe = %s balta
%s Sword = %s kılıç
Copper = Bakır
Tin = Kalay
Bronze = Bronz
Silver = Gümüş
Gold = Altın
Mithril = Mithril
Copper Rail = Bakır ray

View File

@ -1,55 +0,0 @@
--[[
More Ores: `mg` mod support
Copyright © 2011-2019 Hugo Locurcio and contributors.
Licensed under the zlib license. See LICENSE.md for more information.
--]]
if not minetest.registered_items["default:tin_ingot"] then
mg.register_ore({
name = "moreores:mineral_tin",
wherein = "default:stone",
seeddiff = 8,
maxvdistance = 10.5,
maxheight = 8,
seglenghtn = 15,
seglenghtdev = 6,
segincln = 0,
segincldev = 0.6,
turnangle = 57,
forkturnangle = 57,
numperblock = 2
})
end
mg.register_ore({
name = "moreores:mineral_silver",
wherein = "default:stone",
seeddiff = 9,
maxvdistance = 10.5,
maxheight = -2,
seglenghtn = 15,
seglenghtdev = 6,
sizen = 60,
sizedev = 30,
segincln = 0,
segincldev = 0.6,
turnangle = 57,
forkturnangle = 57,
numperblock = 2
})
mg.register_ore({
name = "moreores:mineral_mithril",
wherein = "default:stone",
seeddiff = 10,
maxvdistance = 10.5,
maxheight = -512,
seglenghtn = 2,
seglenghtdev = 4,
sizen = 12,
sizedev = 5,
segincln = 0,
segincldev = 0.6,
turnangle = 57,
})

View File

@ -1,4 +0,0 @@
name = moreores
description = Adds new ore types.
depends = default
optional_depends = carts,farming,frame,intllib,mg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 B

1
mods/radiant_damage Submodule

@ -0,0 +1 @@
Subproject commit feb21874180a22d61b68d93c2831e26fe305d2c5

View File

@ -1,17 +0,0 @@
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

View File

@ -1,68 +0,0 @@
# Compiled Lua sources
luac.out
# luarocks build files
*.src.rock
*.zip
*.tar.gz
# Object files
*.o
*.os
*.ko
*.obj
*.elf
# Precompiled Headers
*.gch
*.pch
# Libraries
*.lib
*.a
*.la
*.lo
*.def
*.exp
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
# =========================
# Operating System Files
# =========================
# Windows
# =========================
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk

View File

@ -1,108 +0,0 @@
# radiant_damage
This mod allows registered nodes to damage a player if the player is simply near them, rather than having to be immersed in them directly. For example, in real life simply being close to lava would burn you. Or perhaps being near a highly radioactive material would be damaging.
This mod comes with a set of predefined radiant damage types, all of which can be enabled and disabled independently, and allows other mods to make use of its system to register their own.
## Configurable Presets
**Important note:** none of these predefined radiant damage types are enabled by default. This is because one of this mod's intended uses is as a library for other mods to use to enable their own radiant damage types. There is no way to de-register a globalstep callback (the mechanism used by this mod to deliver damage) once it has been registered, so to keep the mod maximally flexible nothing is registered by default.
Set one or more of the following types to enabled if you want this mod to have an effect out-of-the-box.
The following settings exist for predefined radiant damage types:
radiant_damage_enable_heat_damage (Enable radiant heat damage) bool false
radiant_damage_lava_damage (Damage dealt per second when standing directly adjacent to one lava node) int 8
radiant_damage_fire_damage (Damage dealt per second when standing directly adjacent to one fire node) int 2
radiant_damage_enable_mese_damage (Enable mese ore radiation damage) bool false
radiant_damage_mese_interval (Number of seconds between mese radiation damage checks) int 5
radiant_damage_mese_damage (Damage dealt per second when standing directly adjacent to one mese ore node) int 2
Mese radiation is attenuated by a factor of 0.9 when passing through most materials, by 0.5 when passing through anything with group:stone, by 0.1 when passing through anything with group:mese_radiation_shield (all default metal blocks are given this group), and is _amplified_ by a factor of 4 when passing through nodes with group:mese_radiation_amplifier (default coal and diamond blocks). Note that these fine-grained attenuation factors only work in Minetest 0.5 and higher, for 0.4.16 any non-air node will block all damage.
## API
### Registering a damage type
Call:
```
radiant_damage.register_radiant_damage(damage_name, damage_def)
```
where damage_name is a string used to identify this damage type and damage_def is a table such as:
```
{
interval = 1, -- number of seconds between each damage check. Defaults to 1 when undefined.
range = 3, -- range of the damage. Can be omitted if inverse_square_falloff is true,
-- in that case it defaults to the range at which 0.125 points of damage is done
-- by the most damaging emitter node type.
emitted_by = {}, -- nodes that emit this damage. At least one emission node type
-- and damage value pair is required.
attenuated_by = {} -- This allows certain intervening node types to modify the damage
-- that radiates through it. This parameter is optional.
-- Note: Only works in Minetest version 0.5 and above.
default_attenuation = 1, -- the amount the damage is multiplied by when passing
-- through any other non-air nodes. Defaults to 0 when undefined. Note that
-- in versions before Minetest 0.5 any value other than 1 will result in total
-- occlusion (ie, any non-air node will block all damage)
inverse_square_falloff = true, -- if true, damage falls off with the inverse square
-- of the distance. If false, damage is constant within the range. Defaults to
-- true when undefined.
above_only = false, -- if true, damage only propagates directly upward. Useful for
-- when you want to damage players only when they stand on the node.
-- Defaults to false when undefined.
on_damage = function(player_object, damage_value, pos), -- An optional callback to allow mods
-- to do custom behaviour. If this is set to non-nil then the default damage will
-- *not* be done to the player, it's up to the callback to handle that. If it's left
-- undefined then damage_value is dealt to the player.
}
```
emitted_by has the following format:
```
{["default:stone_with_mese"] = 2, ["default:mese"] = 9}
```
where the value associated with each entry is the amount of damage dealt. Groups are permitted. Note that negative damage represents "healing" radiation.
attenuated_by has the following similar format:
```
{["group:stone"] = 0.25, ["default:steelblock"] = 0}
```
where the value is a multiplier that is applied to the damage passing through it. Groups are permitted. Note that you can use values greater than one to make a node type magnify damage instead of attenuating it.
### Updating/overriding a registered damage type
To modify or add new parameters to an existing already-registered damage type use the following function:
```
radiant_damage.override_radiant_damage(damage_name, damage_def)
```
Where damage_def is a table as above but which only includes the new information. For example, a mod could add a new type of mese radiation emitter with the following:
```
radiant_damage.override_radiant_damage("mese", {
emitted_by = {
["dfcaverns:glow_mese"] = radiant_damage.config.mese_damage * 12,
},
})
```
To remove an emission source set its emitted damage to 0.
To remove an attenuation node type, set its attenuation factor to equal the default attenuation factor.
If you wish to "disable" a registered damage type, use this override function to set its range to 1 and its interval to an enormous value (millions of seconds) to neutralize the damage type's global callback most efficiently.
## Further reading
These wiki pages may be of interest regarding the principles behind some of this mods' functions:
* [Inverse-square law](https://en.wikipedia.org/wiki/Inverse-square_law)
* [Half-value layer](https://en.wikipedia.org/wiki/Half-value_layer)

View File

@ -1,32 +0,0 @@
local CONFIG_FILE_PREFIX = "radiant_damage_"
radiant_damage.config = {}
local print_settingtypes = false
local function setting(stype, name, default, description)
local value
if stype == "bool" then
value = minetest.settings:get_bool(CONFIG_FILE_PREFIX..name, default)
elseif stype == "string" then
value = minetest.settings:get(CONFIG_FILE_PREFIX..name)
elseif stype == "int" or stype == "float" then
value = tonumber(minetest.settings:get(CONFIG_FILE_PREFIX..name))
end
if value == nil then
value = default
end
radiant_damage.config[name] = value
if print_settingtypes then
minetest.debug(CONFIG_FILE_PREFIX..name.." ("..description..") "..stype.." "..tostring(default))
end
end
setting("bool", "enable_heat_damage", false, "Enable radiant lava damage")
setting("int", "lava_damage", 8, "Damage dealt per second when standing directly adjacent to one lava node")
setting("int", "fire_damage", 2, "Damage dealt per second when standing directly adjacent to one fire node")
setting("bool", "enable_mese_damage", false, "Enable mese ore radiation damage")
setting("int", "mese_interval", 5, "Number of seconds between mese radiation damage checks")
setting("int", "mese_damage", 2, "Damage dealt per interval when standing directly adjacent to one mese ore node")

View File

@ -1,3 +0,0 @@
default?
fire?
3d_armor?

View File

@ -1 +0,0 @@
A mod that allows nodes to damage players at a distance

View File

@ -1,440 +0,0 @@
radiant_damage = {} --create a container for functions and constants
local modpath = minetest.get_modpath(minetest.get_current_modname())
dofile(modpath.."/config.lua")
-- damage_def:
--{
-- interval = 1, -- number of seconds between each damage check
-- range = 3, -- range of the damage. Can be omitted if inverse_square_falloff is true, in that case it defaults to the range at which 1 point of damage is done by the most damaging emitter node type.
-- emitted_by = {}, -- nodes that emit this damage. At least one is required.
-- attenuated_by = {} -- This allows certain intervening node types to modify the damage that radiates through it. Note: Only works in Minetest version 0.5 and above.
-- default_attenuation = 1, -- the amount the damage is multiplied by when passing through any other non-air nodes. Note that in versions before Minetest 0.5 any value other than 1 will result in total occlusion (ie, any non-air node will block all damage)
-- inverse_square_falloff = true, -- if true, damage falls off with the inverse square of the distance. If false, damage is constant within the range.
-- above_only = false, -- if true, damage only propagates directly upward. Useful for when you want to damage players that stand on the node.
-- on_damage = function(player_object, damage_value, pos) -- An optional callback to allow mods to do custom behaviour. If this is set to non-nil then the default damage will *not* be done to the player, it's up to the callback to handle that.
--}
-- emitted_by has the following format:
-- {["default:stone_with_mese"] = 2, ["default:mese"] = 9}
-- where the value associated with each entry is the amount of damage dealt. Groups are permitted. Note that negative damage represents "healing" radiation.
-- attenuated_by has the following similar format:
-- {["group:stone"] = 0.25, ["default:steelblock"] = 0}
-- where the value is a multiplier that is applied to the damage passing through it. Groups are permitted. Note that you can use values greater than one to make a node type magnify damage instead of attenuating it.
-- Commmon function for looking up an emitted_by or attenuated_by value for a node
local get_val = function(node_name, target_names, target_groups)
if target_names then
local name_val = target_names[node_name]
if name_val ~= nil then return name_val end
end
if target_groups then
local node_def = minetest.registered_nodes[node_name]
local node_groups = node_def.groups
if node_groups then
for group, _ in pairs(node_groups) do
local group_val = target_groups[group]
if group_val ~= nil then return group_val end -- returns the first group value it finds, if multiple apply it's undefined which will be selected
end
end
end
return nil
end
local attenuation_check
if Raycast ~= nil then -- version 0.5 of Minetest adds the Raycast class, use that.
-- Gets three raycasts from the faces of the nodes facing the player.
local get_raycasts = function(node_pos, player_pos)
local results = {}
if player_pos.x > node_pos.x then
table.insert(results, Raycast({x=node_pos.x+0.51, y=node_pos.y, z=node_pos.z}, player_pos, false, true))
else
table.insert(results, Raycast({x=node_pos.x-0.51, y=node_pos.y, z=node_pos.z}, player_pos, false, true))
end
if player_pos.y > node_pos.y then
table.insert(results, Raycast({y=node_pos.y+0.51, x=node_pos.x, z=node_pos.z}, player_pos, false, true))
else
table.insert(results, Raycast({y=node_pos.y-0.51, x=node_pos.x, z=node_pos.z}, player_pos, false, true))
end
if player_pos.z > node_pos.z then
table.insert(results, Raycast({z=node_pos.z+0.51, x=node_pos.x, y=node_pos.y}, player_pos, false, true))
else
table.insert(results, Raycast({z=node_pos.z-0.51, x=node_pos.x, y=node_pos.y}, player_pos, false, true))
end
return results
end
attenuation_check = function(node_pos, player_pos, default_attenuation, attenuation_nodes, attenuation_groups)
-- First check a simple degenerate case; if there are no special modifier nodes and the default attenuation
-- is 1 then we don't need to bother with any detailed checking, the damage goes through unmodified.
if default_attenuation == 1 and attenuation_nodes == nil and attenuation_groups == nil then return 1 end
local raycasts = get_raycasts(node_pos, player_pos)
local farthest_from_zero = 0
for _, raycast in pairs(raycasts) do
local current_attenuation = 1
for ray_node in raycast do
local ray_node_name = minetest.get_node(ray_node.under).name
local ray_node_val = get_val(ray_node_name, attenuation_nodes, attenuation_groups)
if ray_node_val == nil then ray_node_val = default_attenuation end
current_attenuation = current_attenuation * ray_node_val
if current_attenuation == 0 then break end -- once we hit zero no further checks are needed, it will never change.
end
-- By always selecting the farthest value from zero we accomodate both "healing" and "harmful" radiation
-- and always let the most impactful value of either type through.
-- If you've got both positive and negative modifiers (for example, if you've got a magical node that turns
-- harmful radiation into healing radiation when it passes through) this could result in somewhat erratic effects.
-- But that's part of the fun, eh? Players will just need to design and use their healing ray carefully.
if math.abs(current_attenuation) > math.abs(farthest_from_zero) then
farthest_from_zero = current_attenuation
end
end
return farthest_from_zero
end
else
-- Pre-Minetest 0.5 version. Attenuation_nodes and attenuation_groups are ignored
attenuation_check = function(node_pos, player_pos, default_attenuation, attenuation_nodes, attenuation_groups)
if default_attenuation == 1 then return 1 end -- if default_attenuation is 1, don't attenuate.
-- otherwise, it's all-or-nothing:
if player_pos.y > node_pos.y then
if minetest.line_of_sight({y=node_pos.y+0.51, x=node_pos.x, z=node_pos.z}, player_pos) then return 1 end
else
if minetest.line_of_sight({y=node_pos.y-0.51, x=node_pos.x, z=node_pos.z}, player_pos) then return 1 end
end
if player_pos.x > node_pos.x then
if minetest.line_of_sight({x=node_pos.x+0.51, y=node_pos.y, z=node_pos.z}, player_pos) then return 1 end
else
if minetest.line_of_sight({x=node_pos.x-0.51, y=node_pos.y, z=node_pos.z}, player_pos) then return 1 end
end
if player_pos.z > node_pos.z then
if minetest.line_of_sight({z=node_pos.z+0.51, x=node_pos.x, y=node_pos.y}, player_pos) then return 1 end
else
if minetest.line_of_sight({z=node_pos.z-0.51, x=node_pos.x, y=node_pos.y}, player_pos) then return 1 end
end
return 0
end
end
radiant_damage.registered_damage_types = {}
-- This method will update the registered_damage_types table with new values, keeping all the parameters
-- consistent and in proper relation to each other.
local update_damage_type = function(damage_name, new_def)
if radiant_damage.registered_damage_types[damage_name] == nil then
radiant_damage.registered_damage_types[damage_name] = {}
end
local damage_def = radiant_damage.registered_damage_types[damage_name]
-- Interval
if new_def.interval ~= nil then
damage_def.interval = new_def.interval
elseif damage_def.interval == nil then
damage_def.interval = 1
end
-- Inverse square falloff
if new_def.inverse_square_falloff ~= nil then
damage_def.inverse_square_falloff = new_def.inverse_square_falloff
elseif damage_def.inverse_square_falloff == nil then
damage_def.inverse_square_falloff = true
end
-- Default attenuation value
if new_def.default_attenuation ~= nil then
damage_def.default_attenuation = new_def.default_attenuation
elseif damage_def.default_attenuation == nil then
damage_def.default_attenuation = 0
end
-- Above Only
damage_def.above_only = new_def.above_only -- default to false
-- on_damage callback
damage_def.on_damage = new_def.on_damage
-- it is efficient to split the emission and attenuation data into separate node and group maps.
-- Emitted by
damage_def.emission_nodes = damage_def.emission_nodes or {}
damage_def.emission_groups = damage_def.emission_groups or {}
for nodename, damage in pairs(new_def.emitted_by) do
if damage == 0 then damage = nil end -- causes removal of damage-0 node types
if string.sub(nodename, 1, 6) == "group:" then
damage_def.emission_groups[string.sub(nodename, 7)] = damage -- omit the "group:" prefix
else
damage_def.emission_nodes[nodename] = damage
end
end
damage_def.nodenames = damage_def.nodenames or {} -- for use with minetest.find_nodes_in_area
for nodename, damage in pairs(new_def.emitted_by) do
local handled = false
for i, v in ipairs(damage_def.nodenames) do
if v == nodename then
if damage == 0 then
table.remove(damage_def.nodenames, i)
end
handled = true
break
end
end
if not handled then
table.insert(damage_def.nodenames, nodename)
end
end
-- These remain nil unless some valid data is provided.
if new_def.attenuated_by and Raycast then
for nodename, attenuation in pairs(new_def.attenuated_by) do
damage_def.attenuation_nodes = damage_def.attenuation_nodes or {}
damage_def.attenuation_groups = damage_def.attenuation_groups or {}
if string.sub(nodename, 1, 6) == "group:" then
damage_def.attenuation_groups[string.sub(nodename, 7)] = attenuation -- omit the "group:" prefix
else
damage_def.attenuation_nodes[nodename] = attenuation
end
end
end
-- remove any attenuation nodes or groups that match the default attenuation, they're pointless.
if damage_def.attenuation_groups then
for node, attenuation in pairs(damage_def.attenuation_groups) do
if attenuation == damage_def.default_attenuation then
damage_def.attenuation_groups[node] = nil
end
end
end
if damage_def.attenuation_nodes then
for node, attenuation in pairs(damage_def.attenuation_nodes) do
if attenuation == damage_def.default_attenuation then
damage_def.attenuation_nodes[node] = nil
end
end
end
-- Range
if new_def.range ~= nil then
damage_def.absolute_range = true
damage_def.range = new_def.range
elseif damage_def.inverse_square_falloff and not damage_def.absolute_range then
damage_def.range = 0
for _, damage in pairs(damage_def.emission_nodes) do
damage_def.range = math.max(math.sqrt(math.abs(damage*8)), damage_def.range) -- use the maximum damage-dealer to determine range.
end
for _, damage in pairs(damage_def.emission_groups) do
damage_def.range = math.max(math.sqrt(math.abs(damage*8)), damage_def.range) -- use the maximum damage-dealer to determine range.
end
end
return damage_def
end
radiant_damage.override_radiant_damage = function(damage_name, damage_def)
if radiant_damage.registered_damage_types[damage_name] then
update_damage_type(damage_name, damage_def)
elseif minetest.settings:get_bool("enable_damage") then
minetest.log("error", "Attempt was made to override unregistered radiant_damage type " .. damage_name)
end
end
radiant_damage.register_radiant_damage = function(damage_name, damage_def)
if not minetest.settings:get_bool("enable_damage") then return end -- don't bother if enable_damage isn't set.
if radiant_damage.registered_damage_types[damage_name] then
minetest.log("error", "Attempt was made to register the already-registered radiant_damage type " .. damage_name)
return
end
local damage_def = update_damage_type(damage_name, damage_def)
local range = damage_def.range
local above_only = damage_def.above_only
local nodenames = damage_def.nodenames
local default_attenuation = damage_def.default_attenuation
local attenuation_nodes = damage_def.attenuation_nodes
local attenuation_groups = damage_def.attenuation_groups
local emission_nodes = damage_def.emission_nodes
local emission_groups = damage_def.emission_groups
local inverse_square_falloff = damage_def.inverse_square_falloff
local on_damage = damage_def.on_damage
local interval = damage_def.interval
local timer = 0
minetest.register_globalstep(function(dtime)
timer = timer + dtime
if timer >= interval then
timer = timer - interval
for _, player in pairs(minetest.get_connected_players()) do
local player_pos = player:get_pos() -- node player's feet are in this location. Add 1 to y to get chest height, more intuitive that way
player_pos.y = player_pos.y + 1
local rounded_pos = vector.round(player_pos)
local nearby_nodes
if above_only then
nearby_nodes = minetest.find_nodes_in_area(vector.add(rounded_pos, {x=0, y= -range, z=0}), rounded_pos, nodenames)
else
nearby_nodes = minetest.find_nodes_in_area(vector.add(rounded_pos, -range), vector.add(rounded_pos, range), nodenames)
end
local total_damage = 0
for _, node_pos in ipairs(nearby_nodes) do
local distance
if above_only then
distance = math.max(player_pos.y - node_pos.y, 1)
else
distance = math.max(vector.distance(player_pos, node_pos), 1) -- clamp to 1 to avoid inverse falloff causing crazy huge damage when standing inside a node
end
if distance <= range then
local attenuation = attenuation_check(node_pos, player_pos, default_attenuation, attenuation_nodes, attenuation_groups)
if attenuation ~= 0 then
local damage = get_val(minetest.get_node(node_pos).name, emission_nodes, emission_groups)
if inverse_square_falloff then
total_damage = total_damage + (damage / (distance * distance)) * attenuation
else
total_damage = total_damage + damage * attenuation
end
end
end
end
if on_damage == nil then
total_damage = math.floor(total_damage)
if total_damage ~= 0 then
minetest.log("action", player:get_player_name() .. " takes " .. tostring(total_damage) .. " damage from " .. damage_name .. " radiant damage at " .. minetest.pos_to_string(rounded_pos))
player:set_hp(player:get_hp() - total_damage)
end
else
on_damage(player, total_damage, rounded_pos)
end
end
end
end)
end
if radiant_damage.config.enable_heat_damage then
local on_fire_damage
if minetest.get_modpath("3d_armor") and armor ~= nil then
-- 3d_armor uses a strange fire protection system different from all the rest, wherein
-- its armor protects wholly against some heat sources and not at all against others
-- based on how "hot" they are and how strong against fire the armor is.
-- Level 1 protects against a wall torch, level 3 protects against a basic fire, and level 5 protects against lava.
-- Converting this into a standard armor type is going to require some arbitrary decisions.
-- My decision is: level 5 protection should reduce the default damage from lava immersion from 8 to 0.5 hp (0.0625 multiplier).
-- Level 3 protection reduces the default damage from basic flame from 4 to 0.5 hp (0.125 multiplier)
-- Torches don't do damage in default so I will ignore that.
-- Level 0 has a damage multiplier of 1.
-- That gives us three data points: (0,1), (3,0.125), (5,0.0625). Fitting that to an exponential curve gives us:
-- y = 0.0481417 + 0.9518583*e^(-0.8388176*x)
-- Which looks about right on a graph, and "looks about right on a graph" is good enough for me.
on_fire_damage = function(player, damage, pos)
local fire_protection = armor.def[player:get_player_name()].fire
local fire_multiplier = 1
if fire_protection then
fire_multiplier = math.min(1, 0.0481417 + 0.9518583 * math.exp(-0.8388176*fire_protection))
end
-- If the player also has conventional fire armor, use whatever's better.
local fire_armor = player:get_armor_groups().fire
if fire_armor then
fire_multiplier = math.min(fire_multiplier, fire_armor/100)
end
damage = math.floor(damage * fire_multiplier)
if damage > 0 then
minetest.log("action", player:get_player_name() .. " takes " .. tostring(damage) .. " damage from heat radiant damage at " .. minetest.pos_to_string(pos))
player:set_hp(player:get_hp() - damage)
minetest.sound_play("radiant_damage_sizzle", {gain = math.min(1, damage/10), pos=pos})
end
end
else
on_fire_damage = function(player, damage, pos)
local fire_armor = player:get_armor_groups().fire
if fire_armor then
damage = damage * fire_armor / 100
end
damage = math.floor(damage)
if damage > 0 then
minetest.log("action", player:get_player_name() .. " takes " .. tostring(damage) .. " damage from heat radiant damage at " .. minetest.pos_to_string(pos))
player:set_hp(player:get_hp() - damage)
minetest.sound_play("radiant_damage_sizzle", {gain = math.min(1, damage/10), pos=pos})
end
end
end
radiant_damage.register_radiant_damage("heat", {
interval = 1,
emitted_by = {["group:lava"] = radiant_damage.config.lava_damage, ["fire:basic_flame"] = radiant_damage.config.fire_damage, ["fire:permanent_flame"] = radiant_damage.config.fire_damage},
inverse_square_falloff = true,
default_attenuation = 0, -- heat is blocked by anything.
on_damage = on_fire_damage,
})
end
if radiant_damage.config.enable_mese_damage then
local shields = {"default:steelblock", "default:copperblock", "default:tinblock", "default:bronzeblock", "default:goldblock"}
local amplifiers = {"default:diamondblock", "default:coalblock"}
for _, shielding_node in ipairs(shields) do
local node_def = minetest.registered_nodes[shielding_node]
if node_def then
local new_groups = node_def.groups or {}
new_groups.mese_radiation_shield = 1
minetest.override_item(shielding_node, {groups=new_groups})
end
end
for _, amp_node in ipairs(amplifiers) do
local node_def = minetest.registered_nodes[amp_node]
if node_def then
local new_groups = node_def.groups or {}
new_groups.mese_radiation_amplifier = 1
minetest.override_item(amp_node, {groups=new_groups})
end
end
local on_radiation_damage = function(player, damage, pos)
local radiation_multiplier = player:get_armor_groups().radiation
if radiation_multiplier then
damage = damage * radiation_multiplier / 100
end
damage = math.floor(damage)
if damage > 0 then
minetest.log("action", player:get_player_name() .. " takes " .. tostring(damage) .. " damage from mese radiation damage at " .. minetest.pos_to_string(pos))
player:set_hp(player:get_hp() - damage)
minetest.sound_play({name = "radiant_damage_geiger", gain = math.min(1, damage/10)}, {to_player=player:get_player_name()})
end
end
radiant_damage.register_radiant_damage("mese", {
interval = radiant_damage.config.mese_interval,
inverse_square_falloff = true,
emitted_by = {["default:stone_with_mese"] = radiant_damage.config.mese_damage, ["default:mese"] = radiant_damage.config.mese_damage * 9},
attenuated_by = {["group:stone"] = 0.5, ["group:mese_radiation_shield"] = 0.1, ["group:mese_radiation_amplifier"] = 4},
default_attenuation = 0.9,
on_damage = on_radiation_damage,
})
end

View File

@ -1,19 +0,0 @@
Copyright 2018 by FaceDeer
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.

View File

@ -1 +0,0 @@
name = radiant_damage

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Some files were not shown because too many files have changed in this diff Show More