Adopting rarity group for items

This commit is contained in:
JoseDouglas26 2024-12-18 18:02:17 -03:00 committed by cora
parent 796cf0291f
commit 3d1e41ee70
No known key found for this signature in database
10 changed files with 34 additions and 44 deletions

View File

@ -68,13 +68,13 @@ mcl_armor.trims = {
["coast"] = { dupe_item="mcl_core:cobble" },
["wild"] = { dupe_item="mcl_core:mossycobble" },
["tide"] = { dupe_item="mcl_ocean:prismarine" },
["ward"] = { dupe_item="mcl_deepslate:deepslate_cobbled", rarity_color="AQUA" },
["vex"] = { dupe_item="mcl_core:cobble", rarity_color="AQUA" },
["ward"] = { dupe_item="mcl_deepslate:deepslate_cobbled", rarity=2 },
["vex"] = { dupe_item="mcl_core:cobble", rarity=2},
["rib"] = { dupe_item="mcl_nether:netherrack" },
["snout"] = { dupe_item="mcl_blackstone:blackstone" },
["eye"] = { dupe_item="mcl_end:end_stone", rarity_color="AQUA" },
["spire"] = { dupe_item="mcl_end:purpur_block", rarity_color="AQUA" },
["silence"] = { dupe_item="mcl_deepslate:deepslate_cobbled", rarity_color="DARK_PURPLE" },
["eye"] = { dupe_item="mcl_end:end_stone", rarity=2 },
["spire"] = { dupe_item="mcl_end:purpur_block", rarity=2 },
["silence"] = { dupe_item="mcl_deepslate:deepslate_cobbled", rarity=3 },
["wayfinder"] = { dupe_item="mcl_colorblocks:hardened_clay" },
["bolt"] = { dupe_item="mcl_copper:block" },
["flow"] = { dupe_item="mcl_mobitems:breeze_rod" }

View File

@ -33,6 +33,7 @@ mcl_armor.register_set({
legs = S("Chainmail Leggings"),
feet = S("Chainmail Boots"),
},
groups = {rarity = 1},
durability = 240,
enchantability = 12,
points = {
@ -226,7 +227,7 @@ minetest.register_tool("mcl_armor:elytra", {
_doc_items_longdesc = mcl_armor.longdesc,
_doc_items_usagehelp = mcl_armor.usage,
inventory_image = "mcl_armor_inv_elytra.png",
groups = {armor = 1, armor_torso = 1, non_combat_torso = 1, mcl_armor_uses = 10, elytra = 1, enchantability = 9},
groups = {armor = 1, armor_torso = 1, non_combat_torso = 1, mcl_armor_uses = 10, elytra = 1, enchantability = 9, rarity = 3},
sounds = {
_mcl_armor_equip = "mcl_armor_equip_leather",
_mcl_armor_unequip = "mcl_armor_unequip_leather",

View File

@ -9,15 +9,13 @@ local function readable_name(str)
end
for template_name, template_defs in pairs(mcl_armor.trims.overlays) do
local color = mcl_colors[template_defs.rarity_color]
if not color then color = mcl_colors.YELLOW end
minetest.register_craftitem(mod_registername .. template_name, {
description = ""..C(color, S("@1 Armor Trim", readable_name(template_name))),
description = S("@1 Armor Trim", readable_name(template_name)),
_tt_help = S("Smithing Template").."\n\n"..
minetest.colorize(mcl_colors.GRAY, S("Applies to:")).."\n"..minetest.colorize(mcl_colors.BLUE, " "..S("Armor")).."\n"..
minetest.colorize(mcl_colors.GRAY, S("Ingredients:")).."\n"..minetest.colorize(mcl_colors.BLUE, " "..S("Ingot & Crystals")),
C(mcl_colors.GRAY, S("Applies to:")).."\n"..C(mcl_colors.BLUE, " "..S("Armor")).."\n"..
C(mcl_colors.GRAY, S("Ingredients:")).."\n"..C(mcl_colors.BLUE, " "..S("Ingot & Crystals")),
inventory_image = template_name .. "_armor_trim_smithing_template.png",
groups = { smithing_template = 1 },
groups = { smithing_template = 1, rarity = template_defs.rarity or 1 },
})
if template_defs.dupe_item then

View File

@ -8,27 +8,26 @@ local function readable_name(str)
end
mcl_banners.patterns = {
["thing"] = { craft_item="mcl_core:apple_gold_enchanted", rarity_color="AQUA" },
["skull"] = { craft_item="mcl_heads:wither_skeleton", rarity_color="AQUA" },
["creeper"] = { craft_item="mcl_heads:creeper", rarity_color="YELLOW" },
["thing"] = { craft_item="mcl_core:apple_gold_enchanted", rarity=2 },
["skull"] = { craft_item="mcl_heads:wither_skeleton", rarity=2 },
["creeper"] = { craft_item="mcl_heads:creeper", rarity=1 },
["flower"] = { craft_item="mcl_flowers:oxeye_daisy" },
["bricks"] = { craft_item="mcl_core:brick_block" },
["curly_border"] = { craft_item="mcl_core:vine" },
["globe"] = {},
["piglin"] = { rarity_color="YELLOW" },
["guster"] = { rarity_color="AQUA" },
["flow"] = { rarity_color="AQUA" }
["piglin"] = { rarity=1 },
["guster"] = { rarity=2 },
["flow"] = { rarity=2 }
}
for pattern, defs in pairs(mcl_banners.patterns) do
local color = mcl_colors[defs.rarity_color or "WHITE"]
minetest.register_craftitem("mcl_banners:pattern_"..pattern,{
description = C(color, S(readable_name(pattern).." Banner Pattern")),
description = S(readable_name(pattern).." Banner Pattern"),
_tt_help = C(mcl_colors.GRAY, S("Can be used to craft special banner designs on the loom")),
_doc_items_longdesc = S("Special Banner Pattern"),
inventory_image = "mcl_banners_pattern_"..pattern..".png",
wield_image = "mcl_banners_pattern_"..pattern..".png",
groups = { banner_pattern = 1 },
groups = { banner_pattern = 1, rarity = defs.rarity or 0 },
_pattern = pattern,
})

View File

@ -291,7 +291,7 @@ minetest.register_node("mcl_beacons:beacon", {
allow_metadata_inventory_move = allow_metadata_inventory_move,
allow_metadata_inventory_take = allow_metadata_inventory_take,
light_source = minetest.LIGHT_MAX,
groups = {handy=1, deco_block=1},
groups = {handy=1, deco_block=1, rarity=2},
drop = "mcl_beacons:beacon",
sounds = mcl_sounds.node_sound_glass_defaults(),
_mcl_hardness = 3,

View File

@ -1,11 +1,5 @@
-- mods/default/craftitems.lua
local S = minetest.get_translator(minetest.get_current_modname())
--
-- Crafting items
--
minetest.register_craftitem("mcl_core:stick", {
description = S("Stick"),
_doc_items_longdesc = S("Sticks are a very versatile crafting material; used in countless crafting recipes."),
@ -179,6 +173,6 @@ minetest.register_craftitem("mcl_core:apple_gold_enchanted", {
inventory_image = "mcl_core_apple_golden.png" .. mcl_enchanting.overlay,
on_place = eat_gapple,
on_secondary_use = eat_gapple,
groups = { food = 2, eatable = 4, can_eat_when_full = 1 },
groups = { food = 2, eatable = 4, can_eat_when_full = 1, rarity = 2 },
_mcl_saturation = 9.6,
})

View File

@ -135,7 +135,7 @@ minetest.register_node("mcl_core:barrier", {
tiles = {"blank.png"},
sunlight_propagates = true,
is_ground_content = false,
groups = {creative_breakable = 1, not_in_creative_inventory = 1, not_solid = 1, unmovable_by_piston = 1},
groups = {creative_breakable = 1, not_in_creative_inventory = 1, not_solid = 1, unmovable_by_piston = 1, rarity = 3},
on_blast = function() end,
drop = "",
_mcl_blast_resistance = 36000008,
@ -192,7 +192,7 @@ minetest.register_node("mcl_core:realm_barrier", {
sunlight_propagates = true,
is_ground_content = false,
pointable = false,
groups = {not_in_creative_inventory = 1, not_solid = 1, unmovable_by_piston = 1},
groups = {not_in_creative_inventory = 1, not_solid = 1, unmovable_by_piston = 1, rarity = 3},
on_blast = function() end,
drop = "",
_mcl_blast_resistance = 36000008,
@ -230,7 +230,7 @@ for i = 0, 14 do --minetest.LIGHT_MAX
wield_image = "mcl_core_light_" .. i .. ".png",
sunlight_propagates = true,
is_ground_content = false,
groups = {creative_breakable = 1, not_solid = 1, light_block = i + 1},
groups = {creative_breakable = 1, not_solid = 1, light_block = i + 1, rarity = 3},
on_blast = function() end,
on_use = function(itemstack, user, pointed_thing)
-- user:get_player_control() returns {} for non players, so we don't need user:is_player()

View File

@ -38,16 +38,15 @@ function mcl_jukebox.register_record_definition(def)
local longdesc = S("A music disc holds a single music track which can be used in a jukebox to play music.")
local usagehelp = S("Place a music disc into an empty jukebox to play the music. Use the jukebox again to retrieve the music disc. The music can only be heard by you, not by other players.")
minetest.register_craftitem(":"..itemstring, {
description =
C(mcl_colors[def.rarity_color or "YELLOW"], S("Music Disc")) .. "\n" ..
C(mcl_colors.GRAY, S("@1—@2", def.author, def.title)),
description = S("Music Disc"),
_tt_help = C(mcl_colors.GRAY, S("@1—@2", def.author, def.title)),
_doc_items_create_entry = true,
_doc_items_entry_name = entryname,
_doc_items_longdesc = longdesc,
_doc_items_usagehelp = usagehelp,
inventory_image = def.texture,
stack_max = 1,
groups = { music_record = 1 },
groups = { music_record = 1, rarity = def.rarity or 1 },
})
end

View File

@ -235,7 +235,7 @@ minetest.register_craftitem("mcl_mobitems:nether_star", {
wield_image = "mcl_mobitems_nether_star.png",
inventory_image = "mcl_mobitems_nether_star.png",
-- TODO: Reveal item when it's useful
groups = { craftitem = 1, not_in_creative_inventory = 1 },
groups = { craftitem = 1, not_in_creative_inventory = 1, rarity = 2 },
})
minetest.register_craftitem("mcl_mobitems:leather", {
@ -337,19 +337,19 @@ minetest.register_tool("mcl_mobitems:warped_fungus_on_a_stick", {
})
minetest.register_craftitem("mcl_mobitems:nautilus_shell", {
description = ""..C(mcl_colors.YELLOW, S("Nautilus Shell")),
description = S("Nautilus Shell"),
_tt_help = S("Used to craft a conduit"),
_doc_items_longdesc = S("The Nautilus Shell is used to craft a conduit. They can be obtained by fishing or killing a drowned that is wielding a shell."),
inventory_image = "mcl_mobitems_nautilus_shell.png",
groups = { craftitem=1 },
groups = { craftitem=1, rarity = 1 },
})
minetest.register_craftitem("mcl_mobitems:heart_of_the_sea", {
description = ""..C(mcl_colors.YELLOW, S("Heart of the Sea")),
description = S("Heart of the Sea"),
_tt_help = S("Used to craft a conduit"),
_doc_items_longdesc = S("The Heart of the Sea is used to craft a conduit. They can be obtained by finding them in a buried treasure chest."),
inventory_image = "mcl_mobitems_heart_of_the_sea.png",
groups = { craftitem=1 },
groups = { craftitem=1, rarity = 1 },
})
local horse_armor_use = S("Place it on a horse to put on the horse armor. Donkeys and mules can't wear horse armor.")

View File

@ -1,7 +1,6 @@
mcl_pottery_sherds = {}
local modname = minetest.get_current_modname()
local S = minetest.get_translator(modname)
local C = minetest.colorize
mcl_pottery_sherds.defs = {
["angler"] = { description = S("Angler") },
@ -45,12 +44,12 @@ local pot_face_rotations = {
for name, def in pairs(mcl_pottery_sherds.defs) do
minetest.register_craftitem("mcl_pottery_sherds:"..name, {
description = ""..C(mcl_colors.YELLOW, S("@1 Pottery Sherd", def.description)),
description = S("@1 Pottery Sherd", def.description),
_tt_help = S("Used for crafting decorated pots"),
_doc_items_create_entry = false,
inventory_image = "mcl_pottery_sherds_"..name..".png",
wield_image = "mcl_pottery_sherds_"..name..".png",
groups = { pottery_sherd = 1, decorated_pot_recipe = 1 },
groups = { pottery_sherd = 1, decorated_pot_recipe = 1, rarity = 1 },
_mcl_pottery_sherd_name = name,
})
end