Adopting rarity group for items part 2

This commit is contained in:
JoseDouglas26 2024-12-18 18:39:48 -03:00 committed by cora
parent 3d1e41ee70
commit 09ee1052b0
No known key found for this signature in database
13 changed files with 37 additions and 28 deletions

View File

@ -168,13 +168,14 @@ minetest.register_tool("doc_identifier:identifier_solid", {
on_use = doc_identifier.identify,
on_place = doc_identifier.liquid_mode,
on_secondary_use = doc_identifier.liquid_mode,
groups = {rarity = 3}
})
minetest.register_tool("doc_identifier:identifier_liquid", {
description = S("Lookup Tool"),
_doc_items_create_entry = false,
tool_capabilities = {},
range = 10,
groups = { not_in_creative_inventory = 1, not_in_craft_guide = 1, disable_repair = 1 },
groups = { not_in_creative_inventory = 1, not_in_craft_guide = 1, disable_repair = 1, rarity = 3 },
wield_image = "doc_identifier_identifier_liquid.png",
inventory_image = "doc_identifier_identifier_liquid.png",
liquids_pointable = true,

View File

@ -54,6 +54,7 @@ end
minetest.register_craftitem("mcl_experience:bottle", {
description = S("Bottle o' Enchanting"),
groups = {rarity = 1},
inventory_image = "mcl_experience_bottle.png",
wield_image = "mcl_experience_bottle.png",
on_use = function(itemstack, placer, _)

View File

@ -224,7 +224,7 @@ mcl_compass.register_compass("recovery_compass", {
_doc_items_usagehelp = S("Recovery Compasses always point to the location of your last death, in case you haven't died yet, it will just randomly spin around"),
inventory_image = "mcl_compass_recovery_compass_01.png",
wield_image = "mcl_compass_recovery_compass_01.png",
groups = { compass = 3 },
groups = { compass = 3, rarity = 1 },
_mcl_compass_update = update_recovery_compass,
_mcl_compass_img_fmt = "mcl_compass_recovery_compass_%02d.png",
}

View File

@ -141,7 +141,7 @@ minetest.register_chatcommand("forceenchant", {
minetest.register_craftitem("mcl_enchanting:book_enchanted", {
description = S("Enchanted Book"),
inventory_image = "mcl_enchanting_book_enchanted.png" .. mcl_enchanting.overlay,
groups = {enchanted = 1, not_in_creative_inventory = 1, enchantability = 1},
groups = {enchanted = 1, not_in_creative_inventory = 1, enchantability = 1, rarity = 1},
_mcl_enchanting_enchanted_tool = "mcl_enchanting:book_enchanted",
stack_max = 1,
_get_all_virtual_items = function()

View File

@ -1,6 +1,5 @@
-- Building blocks and decorative nodes
local S = minetest.get_translator(minetest.get_current_modname())
local C = minetest.colorize
local mod_screwdriver = minetest.get_modpath("screwdriver")
@ -133,7 +132,7 @@ minetest.register_node("mcl_end:end_rod", {
})
minetest.register_node("mcl_end:dragon_egg", {
description = ""..C(mcl_colors.DARK_PURPLE, S("Dragon Egg")),
description = S("Dragon Egg"),
_doc_items_longdesc = S("A dragon egg is a decorative item which can be placed."),
tiles = {
"mcl_end_dragon_egg.png",
@ -164,7 +163,7 @@ minetest.register_node("mcl_end:dragon_egg", {
selection_box = {
type = "regular",
},
groups = {handy = 1, falling_node = 1, deco_block = 1, dig_by_piston = 1, unsticky =1},
groups = {handy = 1, falling_node = 1, deco_block = 1, dig_by_piston = 1, unsticky =1, rarity = 3},
sounds = mcl_sounds.node_sound_stone_defaults(),
_mcl_blast_resistance = 9,
_mcl_hardness = 3,

View File

@ -1,2 +1,2 @@
name = mcl_end
depends = screwdriver, mcl_sounds, mcl_util, doc_items, mcl_worlds, mcl_structures, mcl_stairs, mcl_colors
depends = screwdriver, mcl_sounds, mcl_util, doc_items, mcl_worlds, mcl_structures, mcl_stairs

View File

@ -1,5 +1,4 @@
local S = minetest.get_translator(minetest.get_current_modname())
local C = minetest.colorize
local equip_armor
if minetest.get_modpath("mcl_armor") then
@ -132,7 +131,11 @@ end
--- @param head_def HeadDef head node definition
function mcl_heads.register_head(head_def)
local name = "mcl_heads:" ..head_def.name
if head_def.groups then
for k, v in pairs(head_def.groups) do
mcl_heads.deftemplate.groups[k] = v
end
end
-- register the floor head node
minetest.register_node(":"..name, table.update(table.copy(mcl_heads.deftemplate), {
description = head_def.description,
@ -209,43 +212,48 @@ end
mcl_heads.register_head{
name = "zombie",
texture = "mcl_heads_zombie.png",
description = ""..C(mcl_colors.YELLOW, S("Zombie Head")),
description = S("Zombie Head"),
longdesc = S("A zombie head is a small decorative block which resembles the head of a zombie. It can also be worn as a helmet, which reduces the detection range of zombies by 50%."),
range_mob = "mobs_mc:zombie",
range_factor = 0.5,
groups = {rarity = 1}
}
mcl_heads.register_head{
name = "creeper",
texture = "mcl_heads_creeper.png",
description = ""..C(mcl_colors.YELLOW, S("Creeper Head")),
description = S("Creeper Head"),
longdesc = S("A creeper head is a small decorative block which resembles the head of a creeper. It can also be worn as a helmet, which reduces the detection range of creepers by 50%."),
range_mob = "mobs_mc:creeper",
range_factor = 0.5,
groups = {rarity = 1}
}
-- Original Minecraft name: “Head”
mcl_heads.register_head{
name = "steve",
texture = "mcl_heads_steve.png",
description = ""..C(mcl_colors.YELLOW, S("Human Head")),
description = S("Human Head"),
longdesc = S("A human head is a small decorative block which resembles the head of a human (i.e. a player character). It can also be worn as a helmet for fun, but does not offer any protection."),
groups = {rarity = 1}
}
mcl_heads.register_head{
name = "skeleton",
texture = "mcl_heads_skeleton.png",
description = ""..C(mcl_colors.YELLOW, S("Skeleton Skull")),
description = S("Skeleton Skull"),
longdesc = S("A skeleton skull is a small decorative block which resembles the skull of a skeleton. It can also be worn as a helmet, which reduces the detection range of skeletons by 50%."),
range_mob = "mobs_mc:skeleton",
range_factor = 0.5,
groups = {rarity = 1}
}
mcl_heads.register_head{
name = "wither_skeleton",
texture = "mcl_heads_wither_skeleton.png",
description = ""..C(mcl_colors.AQUA, S("Wither Skeleton Skull")),
description = S("Wither Skeleton Skull"),
longdesc = S("A wither skeleton skull is a small decorative block which resembles the skull of a wither skeleton. It can also be worn as a helmet for fun, but does not offer any protection."),
groups = {rarity = 2}
}
-- convert old placed heads

View File

@ -1,4 +1,4 @@
name = mcl_heads
description = Small decorative head blocks.
depends = mcl_sounds, mcl_colors
depends = mcl_sounds
optional_depends = mcl_armor, screwdriver, doc

View File

@ -1,2 +1,2 @@
name = mcl_potions
depends = mcl_core, mcl_farming, mcl_flowers, mcl_mobitems, mcl_mobs, mcl_fishing, mcl_bows, mcl_end, mcl_weather, playerphysics, mcl_wip, mcl_colors
depends = mcl_core, mcl_farming, mcl_flowers, mcl_mobitems, mcl_mobs, mcl_fishing, mcl_bows, mcl_end, mcl_weather, playerphysics, mcl_wip

View File

@ -1,5 +1,4 @@
local S = minetest.get_translator(minetest.get_current_modname())
local C = minetest.colorize
mcl_potions.registered_potions = {}
-- shorthand
@ -355,7 +354,7 @@ minetest.register_craftitem("mcl_potions:dragon_breath", {
description = S("Dragon's Breath"),
_longdesc = S("This item is used in brewing and can be combined with splash potions to create lingering potions."),
image = "mcl_potions_dragon_breath.png",
groups = { brewitem = 1, bottle = 1 },
groups = { brewitem = 1, bottle = 1, rarity = 1 },
stack_max = 64,
})
@ -619,7 +618,9 @@ mcl_potions.register_potion({
mcl_potions.register_potion({
name = "ominous",
desc_whole = ""..C(mcl_colors.YELLOW, S("Ominous Bottle")),
desc_whole = S("Ominous Bottle"),
groups = {brewitem=1, food=3, can_eat_when_full=1,
_mcl_potion=1, potion = 1, rarity = 1},
_tt = nil,
_longdesc = S("Attracts danger."),
image = "mcl_potions_ominous_potion.png",
@ -631,7 +632,6 @@ mcl_potions.register_potion({
vanishing = true,
})
-- COMPAT CODE
local function replace_legacy_potion(itemstack)
local name = itemstack:get_name()

View File

@ -7,11 +7,11 @@ local heavy_core_longdesc = S("Solid Blocks of Steel. These are only forged if t
local mace_longdesc = S("The mace is a slow melee weapon that deals incredible damage. “dig” key to use it. This weapon has a cooldown of 1.6 seconds, but if you fall the mace will deal more damage than if you are on the ground. The further you fall the more damage done. If you hit a mob or player then you will receive no fall damage, but beware. If you miss you will die. ")
minetest.register_node("mcl_tools:heavy_core", {
description = "" ..minetest.colorize(mcl_colors.DARK_PURPLE, S("Heavy Core")),
description = S("Heavy Core"),
_doc_long_desc = heavy_core_longdesc,
tiles = {"mcl_tools_heavy_core_top.png", "mcl_tools_heavy_core_bottom.png", "mcl_tools_heavy_core_side.png"},
is_ground_content = false,
groups = {pickaxey = 1, deco_block = 1 },
groups = {pickaxey = 1, deco_block = 1, rarity = 3},
sounds = mcl_sounds.node_sound_stone_defaults(),
paramtype2 = "facedir",
drawtype = "nodebox",
@ -28,10 +28,10 @@ minetest.register_node("mcl_tools:heavy_core", {
--Mace
minetest.register_tool("mcl_tools:mace", {
description = "" ..minetest.colorize(mcl_colors.DARK_PURPLE, S("Mace")),--S("Mace"),
description = S("Mace"),
_doc_items_longdesc = mace_longdesc,
inventory_image = "mcl_tools_mace.png",
groups = { weapon=1, mace=1, dig_speed_class=1, enchantability=10, sword=1 },
groups = { weapon=1, mace=1, dig_speed_class=1, enchantability=10, sword=1, rarity = 3 },
tool_capabilities = {
full_punch_interval = 1.6,
max_drop_level = 1,

View File

@ -1,5 +1,5 @@
local S = minetest.get_translator(minetest.get_current_modname())
local C = minetest.colorize
-- TODO: when < minetest 5.9 isn't supported anymore, remove this variable check and replace all occurences of [hud_elem_type_field] with type
local hud_elem_type_field = "type"
if not minetest.features.hud_def_type_field then
@ -13,14 +13,14 @@ minetest.register_on_leaveplayer(function(player)
end)
minetest.register_craftitem("mcl_totems:totem", {
description = ""..C(mcl_colors.YELLOW, S("Totem of Undying")),
description = S("Totem of Undying"),
_tt_help = minetest.colorize(mcl_colors.GREEN, S("Protects you from death while wielding it")),
_doc_items_longdesc = S("A totem of undying is a rare artifact which may safe you from certain death."),
_doc_items_usagehelp = S("The totem only works while you hold it in your hand. If you receive fatal damage, you are saved from death and you get a second chance with 1 HP. The totem is destroyed in the process, however."),
inventory_image = "mcl_totems_totem.png",
wield_image = "mcl_totems_totem.png",
stack_max = 1,
groups = {combat_item = 1, offhand_item = 1},
groups = {combat_item = 1, offhand_item = 1, rarity = 1},
_mcl_wieldview_item = "mcl_totems:totem_wielded",
})
minetest.register_alias("mobs_mc:totem", "mcl_totems:totem")

View File

@ -1,2 +1,2 @@
name = mcl_totems
depends = mobs_mc, mcl_damage, mcl_potions, mcl_colors
depends = mobs_mc, mcl_damage, mcl_potions