diff --git a/mods/_lott/lottachievements/init.lua b/mods/_lott/lottachievements/init.lua index 41e46edd8..80b12a588 100644 --- a/mods/_lott/lottachievements/init.lua +++ b/mods/_lott/lottachievements/init.lua @@ -181,7 +181,7 @@ lottachievements.register_achievement("marksman_of_lorien", { lottachievements.register_achievement("merry_shire", { title = SL("Merry Shire"), description = SL("Visit Shire and get his soil"), - icon = "default_dirt.png^lottmapgen_shire_grass_side.png", + icon = "default_dirt.png^(default_grass_side.png^[colorize:#86ad06:105)", -- lottmapgen:shire_grass side id = 11, trigger = { type = "dig", @@ -193,7 +193,7 @@ lottachievements.register_achievement("merry_shire", { lottachievements.register_achievement("the_golden_lorien", { title = SL("The Golden Lorien"), description = SL("Visit the forests of Lorien and get their soil"), - icon = "default_dirt.png^lottmapgen_lorien_grass_side.png", + icon = "default_dirt.png^(default_grass_side.png^[colorize:#5bf7ea:75)", -- lottmapgen:lorien_grass side id = 12, trigger = { type = "dig", @@ -205,7 +205,8 @@ lottachievements.register_achievement("the_golden_lorien", { lottachievements.register_achievement("damaged_greenwood", { title = SL("Damaged Greenwood"), description = SL("Visit the forests of Liholsye and get their soil"), - icon = "default_dirt.png^lottmapgen_mirkwood_grass_side.png", + -- lottmapgen:mirkwood_grass side: + icon = "default_dirt.png^(default_grass_side.png^[colorize:#331507:120)", id = 13, trigger = { type = "dig", @@ -217,7 +218,8 @@ lottachievements.register_achievement("damaged_greenwood", { lottachievements.register_achievement("iron_hills", { title = SL("Iron Hills"), description = SL("Visit the Iron Hills and get his soil"), - icon = "default_dirt.png^lottmapgen_dunland_grass_side.png", + -- lottmapgen:ironhill_grass side: + icon = "default_dirt.png^(default_grass_side.png^[colorize:#1cbca7:60)", id = 14, trigger = { type = "dig", @@ -241,7 +243,7 @@ lottachievements.register_achievement("frozen_angmar", { lottachievements.register_achievement("lands_of_rohan", { title = SL("Lands of Rohan"), description = SL("Visit Rohan and get his soil"), - icon = "default_dirt.png^lottmapgen_rohan_grass_side.png", + icon = "default_dirt.png^(default_grass_side.png^[colorize:#af5301:95)", -- lottmapgen:rohan_grass side id = 16, trigger = { type = "dig", @@ -277,7 +279,8 @@ lottachievements.register_achievement("live_fangorn", { lottachievements.register_achievement("anxious_dunland", { title = SL("Anxious Dunland"), description = SL("Visit Dunland and get its soil"), - icon = "default_dirt.png^lottmapgen_dunland_grass_side.png", + -- lottmapgen:dunland_grass side: + icon = "default_dirt.png^(default_grass_side.png^[colorize:#35ba3c:50)", id = 19, trigger = { type = "dig", diff --git a/mods/_lott/lottmapgen/chests.lua b/mods/_lott/lottmapgen/chests.lua index a9571a0ac..51a066b22 100644 --- a/mods/_lott/lottmapgen/chests.lua +++ b/mods/_lott/lottmapgen/chests.lua @@ -1,189 +1,291 @@ -minetest.register_node("lottmapgen:hobbit_chest_spawner", { - description = "HCS", - tiles = {"lottblocks_door_birch_b.png"}, - is_ground_content = false, - groups = {oddly_breakable_by_hand = 1, not_in_creative_inventory=1}, -}) +-- Регистрация спавнера сундуков +-- Аргументы: +-- - chest_name - название ноды целевого сундука; +-- - possible_items - массив c массивами, описывающими лут в сундуках и его возможное кол-во, следующего вида: +-- { +-- { "some_mod:item_name", [постоянное число предметов] } -- по умолчанию 1 +-- -- ИЛИ +-- { "some_mod:item_name2", [нижняя граница числа предметов], [верхняя] } -- случайная выборка из данных границ +-- -- Примеры: +-- { "lottfarming:barley0" }, -- всегда 1 предмет в стаке +-- { "lottfarming:barley_cooked", 3 }, -- всегда 3 предмета в стаке +-- { "lottfarming:berries_seed", 2, 6 }, -- от 2 до 6 предметов в стаке +-- ... +-- } +local function register_chest_spawner(chest_name, possible_items) -minetest.register_node("lottmapgen:gondor_chest_spawner", { - description = "GCS", - tiles = {"lottblocks_door_birch_b.png"}, - is_ground_content = false, - groups = {oddly_breakable_by_hand = 1, not_in_creative_inventory=1}, -}) + -- Конструирование имени и описания ноды спавнера из имени ноды целевого сундука: + local chest_basename = chest_name:sub(string.find(chest_name, ":")+1) + local chest_spawner_basename = chest_basename .. "_spawner" -- используется в качестве описания ноды + local chest_spawner_name = "lottmapgen:" .. chest_spawner_basename -minetest.register_node("lottmapgen:rohan_chest_spawner", { - description = "RCS", - tiles = {"lottblocks_door_birch_b.png"}, - is_ground_content = false, - groups = {oddly_breakable_by_hand = 1, not_in_creative_inventory=1}, -}) + minetest.register_node(chest_spawner_name, { + description = chest_spawner_basename, + tiles = {"lottblocks_door_birch_b.png"}, + is_ground_content = false, + groups = { oddly_breakable_by_hand = 1, not_in_creative_inventory=1 }, + }) -minetest.register_node("lottmapgen:elfloth_chest_spawner", { - description = "ELCS", - tiles = {"lottblocks_door_birch_b.png"}, - is_ground_content = false, - groups = {oddly_breakable_by_hand = 1, not_in_creative_inventory=1}, -}) + -- Вспомогательная функция для регистрации ABM + -- Преобразует possible_items (см. выше) в массив со stackstring'ами (см. lua_api.txt). + local function get_items_available_from_possible_items(potential_items) + local items_available = {} + for _, item_table in ipairs(potential_items) do + if #item_table == 1 then + table.insert(items_available, item_table[1]) + elseif #item_table == 2 then + table.insert(items_available, item_table[1] .. " " .. item_table[2]) + elseif #item_table == 3 then + table.insert(items_available, item_table[1] .. " " .. math.random(item_table[2], item_table[3])) + end + end + return items_available + end -minetest.register_node("lottmapgen:elfmirk_chest_spawner", { - description = "EMCS", - tiles = {"lottblocks_door_birch_b.png"}, - is_ground_content = false, - groups = {oddly_breakable_by_hand = 1, not_in_creative_inventory=1}, -}) + minetest.register_abm({ + nodenames = {chest_spawner_name}, + interval = 9, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + minetest.set_node(pos, { name = chest_name, param2 = node.param2 }) + local number_of_items = math.random(3, 12) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local items_set = get_items_available_from_possible_items(possible_items) + for i = 1, number_of_items do + local inv_size = inv:get_size("main") + local stack_idx = math.random(inv_size) + while not inv:get_stack("main", stack_idx):is_empty() do -- пока не выпадет свободный стак + stack_idx = math.random(inv_size) + end + local item_idx = math.random(#items_set) + inv:set_stack("main", stack_idx, items_set[item_idx]) + end + end, + }) +end -minetest.register_node("lottmapgen:mordor_chest_spawner", { - description = "MCS", - tiles = {"lottblocks_door_birch_b.png"}, - is_ground_content = false, - groups = {oddly_breakable_by_hand = 1, not_in_creative_inventory=1}, -}) -minetest.register_node("lottmapgen:angmar_chest_spawner", { - description = "ACS", - tiles = {"lottblocks_door_birch_b.png"}, - is_ground_content = false, - groups = {oddly_breakable_by_hand = 1, not_in_creative_inventory=1}, -}) -minetest.register_abm({ - nodenames = {"lottmapgen:hobbit_chest_spawner"}, - interval = 9, - chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) - local x = pos.x - local y = pos.y - local z = pos.z - local here = {x=x,y=y,z=z} - minetest.set_node(here, {name="lottblocks:hobbit_chest"}) - local item_count = math.random(2,13) - local items_available = { [0] = "lottfarming:barley0 2", [1] = "lottfarming:barley_cooked", [2]="lottfarming:berries_seed",[3]="lottfarming:berries 3",[4]="lottfarming:brown_mushroom_spore 3",[5]="lottfarming:brown_mushroom 6",[6]="lottfarming:corn0 4",[7]="lottfarming:ear_of_corn 4",[8]="lottfarming:pipeweed_seed 2",[9]="lottfarming:pipeweed 5",[10]="lottfarming:pipeweed_cooked 5",[11]="lottfarming:pipe",[12]="lottfarming:half_of_potatoe 2",[13]="lottfarming:potato",[14]="lottfarming:potato_cooked 7",[15]="lottfarming:turnips_seed 3",[16]="lottfarming:turnips",[17]="lottfarming:turnips_cooked 7",[18]="lottplants:plum",[19]="lottweapons:bronze_dagger",[20]="lottweapons:steel_dagger",[21]="lottweapons:copper_spear",[22]="lottweapons:tin_battleaxe",[23]="vessels:glass_bottle 3",[24]="farming:hoe_steel"} - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - for i = 0, item_count do - local item_idx = math.random(0,36) - inv:add_item("main",items_available[item_idx]) - end - end, +register_chest_spawner("lottblocks:hobbit_chest", { + { "lottfarming:barley_seed", 2 }, + { "lottfarming:barley_cooked", }, + { "lottfarming:berries_seed", }, + { "lottfarming:berries", 3 }, + { "lottfarming:brown_mushroom_spore", 3 }, + { "lottfarming:brown_mushroom", 6 }, + { "lottfarming:corn_seed", 4 }, + { "lottfarming:corn", 4 }, + { "lottfarming:pipeweed_seed", 2 }, + { "lottfarming:pipeweed", 5 }, + { "lottfarming:pipeweed_cooked", 5 }, + { "lottfarming:pipe", }, + { "lottfarming:potato_seed", 2 }, + { "lottfarming:potato", }, + { "lottfarming:potato_cooked", 7 }, + { "lottfarming:turnips_seed", 3 }, + { "lottfarming:turnips", }, + { "lottfarming:turnips_cooked", 7 }, + { "lottplants:plum", }, + { "lottweapons:bronze_dagger", }, + { "lottweapons:steel_dagger", }, + { "lottweapons:copper_spear", }, + { "lottweapons:tin_battleaxe", }, + { "vessels:glass_bottle", 3 }, + { "farming:hoe_steel", }, }) -minetest.register_abm({ - nodenames = {"lottmapgen:gondor_chest_spawner"}, - interval = 9, - chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) - local x = pos.x - local y = pos.y - local z = pos.z - local here = {x=x,y=y,z=z} - minetest.set_node(here, {name="lottblocks:gondor_chest"}) - local item_count = math.random(2,13) - local items_available = { [0] = "lottores:marble 6", [1] = "lottblocks:marble_brick 10", [2]="lottarmor:helmet_silver",[3]="lottarmor:chestplate_steel",[4]="lottarmor:leggings_tin",[5]="lottarmor:boots_bronze",[10]="lottarmor:shield_copper",[11]="lottores:goldsword",[12]="default:sword_bronze",[13]="farming:bread 5",[14]="lottmobs:meat 2",[15]="lottfarming:potato_cooked 4",[16]="lottfarming:melon 3",[17]="lottfarming:tomatoes_cooked 2",[18]="lottfarming:ear_of_corn 6",[19]="lottfarming:turnips_cooked 3",[20]="lottweapons:bronze_warhammer",[21]="lottweapons:gold_spear",[22]="lottweapons:copper_battleaxe",[23]="lottweapons:galvorn_dagger",[24]="lottpotion:beer 10",[25]="lottpotion:cider 10",[26]="lottpotion:wine 5",[27]="lottpotion:wine 2",[29]="lottthrowing:bow_wood_alder" } - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - for i = 0, item_count do - local item_idx = math.random(0,42) - inv:add_item("main",items_available[item_idx]) - end - end, + +register_chest_spawner("lottblocks:gondor_chest", { + { "lottores:marble", 6 }, + { "lottblocks:marble_brick", 10 }, + { "lottarmor:helmet_silver", }, + { "lottarmor:chestplate_steel", }, + { "lottarmor:leggings_tin", }, + { "lottarmor:boots_bronze", }, + { "lottarmor:shield_copper", }, + { "lottores:goldsword", }, + { "default:sword_bronze", }, + { "farming:bread", 5 }, + { "lottmobs:meat", 2 }, + { "lottfarming:potato_cooked", 4 }, + { "lottfarming:melon", 3 }, + { "lottfarming:tomatoes_cooked", 2 }, + { "lottfarming:ear_of_corn", 6 }, + { "lottfarming:turnips_cooked", 3 }, + { "lottweapons:bronze_warhammer", }, + { "lottweapons:gold_spear", }, + { "lottweapons:copper_battleaxe", }, + { "lottweapons:galvorn_dagger", }, + { "lottpotion:beer", 10 }, + { "lottpotion:cider", 10 }, + { "lottpotion:wine", 5 }, + { "lottpotion:wine", 2 }, + { "lottthrowing:bow_wood_alder" }, }) -minetest.register_abm({ - nodenames = {"lottmapgen:rohan_chest_spawner"}, - interval = 9, - chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) - local x = pos.x - local y = pos.y - local z = pos.z - local here = {x=x,y=y,z=z} - minetest.set_node(here, {name="lottblocks:rohan_chest"}) - local item_count = math.random(2,13) - local items_available = { [0] = "lottores:lead_block", [1] = "lottores:pearl 3", [2]="lottarmor:helmet_tin",[3]="lottarmor:chestplate_copper",[4]="lottarmor:leggings_bronze",[5]="lottarmor:boots_steel",[10]="lottarmor:shield_silver",[11]="lottores:silversword",[12]="lottweapons:bronze_spear",[13]="farming:bread 4",[14]="lottmobs:meat 6",[15]="lottfarming:potato_cooked 2",[16]="lottfarming:brown_mushroom 4",[17]="lottfarming:red_mushroom 3",[18]="lottfarming:ear_of_corn 7",[19]="lottweapons:gold_spear",[20]="lottweapons:bronze_battleaxe",[21]="lottweapons:tin_spear",[22]="lottweapons:steel_spear",[23]="lottweapons:tin_dagger",[24]="lottpotion:ale 7",[25]="lottpotion:mead 7",[26]="lottpotion:wine 5",[27]="lottpotion:cider 2",[29]="lottmobs:horseh1",[30]="lottmobs:horsepegh1",[31]="lottmobs:horsepegh1",[32]="lottthrowing:crossbow_tin",[33]="lottthrowing:bolt 5" } - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - for i = 0, item_count do - local item_idx = math.random(0,45) - inv:add_item("main",items_available[item_idx]) - end - end, + +register_chest_spawner("lottblocks:rohan_chest", { + { "lottores:lead_block", }, + { "lottores:pearl", 3 }, + { "lottarmor:helmet_tin", }, + { "lottarmor:chestplate_copper", }, + { "lottarmor:leggings_bronze", }, + { "lottarmor:boots_steel", }, + { "lottarmor:shield_silver", }, + { "lottores:silversword", }, + { "lottweapons:bronze_spear", }, + { "farming:bread", 4 }, + { "lottmobs:meat", 6 }, + { "lottfarming:potato_cooked", 2 }, + { "lottfarming:brown_mushroom", 4 }, + { "lottfarming:red_mushroom", 3 }, + { "lottfarming:ear_of_corn", 7 }, + { "lottweapons:gold_spear", }, + { "lottweapons:bronze_battleaxe", }, + { "lottweapons:tin_spear", }, + { "lottweapons:steel_spear", }, + { "lottweapons:tin_dagger", }, + { "lottpotion:ale", 7 }, + { "lottpotion:mead", 7 }, + { "lottpotion:wine", 5 }, + { "lottpotion:cider", 2 }, + { "lottmobs:horseh1", }, + { "lottmobs:horsepegh1", }, + { "lottmobs:horsepegh1", }, + { "lottthrowing:crossbow_tin", }, + { "lottthrowing:bolt", 5 }, }) -minetest.register_abm({ - nodenames = {"lottmapgen:elfloth_chest_spawner"}, - interval = 9, - chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) - local x = pos.x - local y = pos.y - local z = pos.z - local here = {x=x,y=y,z=z} - minetest.set_node(here, {name="lottblocks:elfloth_chest"}) - local item_count = math.random(2,13) - local items_available = { [0] = "lottores:mithril_ingot", [1] = "default:gold_ingot 3", [2]="lottweapons:elven_sword",[3]="lottblocks:door_mallorn",[4]="beds:bed",[5]="lottblocks:fence_mallorn 3",[6]="lottblocks:mallorn_table",[9]="lottarmor:helmet_gold",[10]="lottblocks:mallorn_chair",[11]="lottores:silversword",[12]="lottweapons:silver_spear",[13]="lottweapons:silver_dagger",[14]="lottweapons:silver_warhammer",[15]="lottweapons:silver_battleaxe",[16]="lottores:silveraxe",[17]="lottores:silverpick",[18]="lottores:silvershovel",[19]="lottfarming:tomato_soup",[20]="lottfarming:mushroom_soup",[21]="lottfarming:salad",[22]="lottfarming:athelas_seed",[23]="lottfarming:athelas",[24]="lottplants:mallornsapling",[25]="lottpotion:mead 6",[26]="lottplants:honey 5",[27]="lottpotion:athelasbrew_power1",[29]="lottmobs:horsepegh1",[30]="lottpotion:athelasbrew_power1",[31]="lottthrowing:bow_wood_mallorn",[32]="lottthrowing:arrow 20",[34]="lottpotion:miruvor_power2_arrow",[35]="lottpotion:athelasbrew_power1_arrow 3",[36]="lottother:blue_torch 10",[37]="lottores:white_gem", } - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - for i = 0, item_count do - local item_idx = math.random(0,50) - inv:add_item("main",items_available[item_idx]) - end - end, + +register_chest_spawner("lottblocks:elfloth_chest", { + { "lottores:mithril_ingot", }, + { "default:gold_ingot", 3 }, + { "lottweapons:elven_sword", }, + { "lottblocks:door_mallorn", }, + { "beds:bed", }, + { "lottblocks:fence_mallorn", 3 }, + { "lottblocks:mallorn_table", }, + { "lottarmor:helmet_gold", }, + { "lottblocks:mallorn_chair", }, + { "lottores:silversword", }, + { "lottweapons:silver_spear", }, + { "lottweapons:silver_dagger", }, + { "lottweapons:silver_warhammer", }, + { "lottweapons:silver_battleaxe", }, + { "lottores:silveraxe", }, + { "lottores:silverpick", }, + { "lottores:silvershovel", }, + { "lottfarming:tomato_soup", }, + { "lottfarming:mushroom_soup", }, + { "lottfarming:salad", }, + { "lottfarming:athelas_seed", }, + { "lottfarming:athelas", }, + { "lottplants:mallornsapling", }, + { "lottpotion:mead", 6 }, + { "lottplants:honey", 5 }, + { "lottpotion:athelasbrew_power1", }, + { "lottmobs:horsepegh1", }, + { "lottpotion:athelasbrew_power1", }, + { "lottthrowing:bow_wood_mallorn", }, + { "lottthrowing:arrow", 20 }, + { "lottpotion:miruvor_power2_arrow", }, + { "lottpotion:athelasbrew_power1_arrow", 3 }, + { "lottother:blue_torch", 10 }, + { "lottores:white_gem", }, }) -minetest.register_abm({ - nodenames = {"lottmapgen:elfmirk_chest_spawner"}, - interval = 9, - chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) - local x = pos.x - local y = pos.y - local z = pos.z - local here = {x=x,y=y,z=z} - minetest.set_node(here, {name="lottblocks:elfmirk_chest"}) - local item_count = math.random(2,13) - local items_available = { [0] = "lottores:galvorn_ingot 3", [1] = "lottores:tin_ingot 5", [2]="lottweapons:elven_sword",[3]="lottblocks:door_alder",[4]="beds:bed",[5]="lottblocks:fence_alder 5",[6]="lottblocks:lebethron_table",[7]="lottarmor:helmet_gold",[8]="lottblocks:lebethron_chair",[9]="lottores:galvornsword",[10]="lottweapons:galvorn_spear",[11]="lottweapons:galvorn_dagger",[12]="bucket:bucket_water",[14]="lottfarming:tomatoes_seed 3",[15]="lottfarming:barley0 2",[16]="lottfarming:berries_seed 6",[17]="lottfarming:cabbage_seed 4",[18]="lottfarming:mushroom_soup",[19]="lottfarming:salad",[20]="lottfarming:corn0",[21]="lottfarming:melon_seed 2",[22]="lottfarming:half_of_potatoe 4",[23]="lottfarming:turnips_seed 2",[24]="lottfarming:blue_mushroom_spore 5",[27]="lottfarming:brown_mushroom_spore 5",[29]="lottmobs:horseh1",[30]="lottfarming:green_mushroom_spore",[31]="lottfarming:red_mushroom_spore",[32]="lottthrowing:arrow 7",[34]="lottpotion:miruvor_power2_arrow",[35]="lottpotion:athelasbrew_power1_arrow 3",[36]="lottthrowing:bow_wood_lebethron",[37]="lottores:blue_gem",[38]="farming:hoe_bronze" } - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - for i = 0, item_count do - local item_idx = math.random(0,50) - inv:add_item("main",items_available[item_idx]) - end - end, + +register_chest_spawner("lottblocks:elfmirk_chest", { + { "lottores:galvorn_ingot", 3 }, + { "lottores:tin_ingot", 5 }, + { "lottweapons:elven_sword", }, + { "lottblocks:door_alder", }, + { "beds:bed", }, + { "lottblocks:fence_alder", 5 }, + { "lottblocks:lebethron_table", }, + { "lottarmor:helmet_gold", }, + { "lottblocks:lebethron_chair", }, + { "lottores:galvornsword", }, + { "lottweapons:galvorn_spear", }, + { "lottweapons:galvorn_dagger", }, + { "bucket:bucket_water", }, + { "lottfarming:tomatoes_seed", 3 }, + { "lottfarming:barley0", 2 }, + { "lottfarming:berries_seed", 6 }, + { "lottfarming:cabbage_seed", 4 }, + { "lottfarming:mushroom_soup", }, + { "lottfarming:salad", }, + { "lottfarming:corn0", }, + { "lottfarming:melon_seed", 2 }, + { "lottfarming:half_of_potatoe", 4 }, + { "lottfarming:turnips_seed", 2 }, + { "lottfarming:blue_mushroom_spore", 5 }, + { "lottfarming:brown_mushroom_spore", 5 }, + { "lottmobs:horseh1", }, + { "lottfarming:green_mushroom_spore", }, + { "lottfarming:red_mushroom_spore", }, + { "lottthrowing:arrow", 7 }, + { "lottpotion:miruvor_power2_arrow", }, + { "lottpotion:athelasbrew_power1_arrow", 3 }, + { "lottthrowing:bow_wood_lebethron", }, + { "lottores:blue_gem", }, + { "farming:hoe_bronze", }, }) -minetest.register_abm({ - nodenames = {"lottmapgen:mordor_chest_spawner"}, - interval = 9, - chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) - local x = pos.x - local y = pos.y - local z = pos.z - local here = {x=x,y=y,z=z} - minetest.set_node(here, {name="lottblocks:mordor_chest"}) - local item_count = math.random(2,13) - local items_available = { [0] = "lottmapgen:mordor_stone 6", [1] = "lottblocks:orc_brick 7", [2]="lottother:orc_torch 4",[3]="lottmobs:meat 5",[4]="lottfarming:blue_mushroom",[5]="lottfarming:green_mushroom",[6]="lottthrowing:crossbow_steel",[7]="lottthrowing:bolt 15",[8]="lottthrowing:bolt 2",[11]="lottpotion:wine",[12]="lottpotion:orcdraught_power1 2",[13]="lottpotion:orcdraught_power2",[14]="lottweapons:orc_sword",[15]="bones:bone 3",[16]="lottarmor:helmet_bronze",[17]="lottarmor:chestplate_bronze",[18]="lottarmor:leggings_bronze",[19]="lottarmor:boots_bronze",[20]="lottpotion:beer",[21]="lottmobs:meat_raw", [22]="bones:skeleton_body", [23]= "lottweapons:steel_warhammer",[24]= "lottfarming:blue_mushroom_spore 2",[25]="lottmobs:horsearah1",[26]="lottores:red_gem", [27]="lottfarming:orc_food 4", [28]="lottfarming:orc_medicine 2"} - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - for i = 0, item_count do - local item_idx = math.random(0,38) - inv:add_item("main",items_available[item_idx]) - end - end, + +register_chest_spawner("lottblocks:mordor_chest", { + { "lottmapgen:mordor_stone", 6 }, + { "lottblocks:orc_brick", 7 }, + { "lottother:orc_torch", 4 }, + { "lottmobs:meat", 5 }, + { "lottfarming:blue_mushroom", }, + { "lottfarming:green_mushroom", }, + { "lottthrowing:crossbow_steel", }, + { "lottthrowing:bolt", 15 }, + { "lottthrowing:bolt", 2 }, + { "lottpotion:wine", }, + { "lottpotion:orcdraught_power1", 2 }, + { "lottpotion:orcdraught_power2", }, + { "lottweapons:orc_sword", }, + { "bones:bone", 3 }, + { "lottarmor:helmet_bronze", }, + { "lottarmor:chestplate_bronze", }, + { "lottarmor:leggings_bronze", }, + { "lottarmor:boots_bronze", }, + { "lottpotion:beer", }, + { "lottmobs:meat_raw", }, + { "bones:skeleton_body", }, + { "lottweapons:steel_warhammer", }, + { "lottfarming:blue_mushroom_spore", 2 }, + { "lottmobs:horsearah1", }, + { "lottores:red_gem", }, + { "lottfarming:orc_food", 4 }, + { "lottfarming:orc_medicine", 2 }, }) -minetest.register_abm({ - nodenames = {"lottmapgen:angmar_chest_spawner"}, - interval = 9, - chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) - local x = pos.x - local y = pos.y - local z = pos.z - local here = {x=x,y=y,z=z} - minetest.set_node(here, {name="lottblocks:angmar_chest"}) - local item_count = math.random(2,13) - local items_available = { [0] = "lottmapgen:angsnowblock 3", [1] = "lottblocks:orc_brick 7", [2]="lottother:orc_torch 4",[3]="lottmobs:meat 5",[4]="lottfarming:blue_mushroom",[5]="lottfarming:green_mushroom",[6]="lottthrowing:bow_wood_birch",[7]="lottthrowing:arrow 15",[8]="lottpotion:athelasbrew_power1_arrow 2",[10]="lottweapons:steel_battleaxe",[11]="lottpotion:wine",[12]="lottpotion:orcdraught_power1 2",[13]="lottweapons:steel_battleaxe",[14]="lottweapons:orc_sword",[15]="bones:bone 3",[16]="lottarmor:helmet_steel",[17]="lottarmor:chestplate_steel",[18]="lottarmor:leggings_steel",[19]="lottarmor:boots_steel",[20]="lottpotion:beer",[21]="lottmobs:meat_raw", [22]="bones:skeleton_body", [23]= "lottweapons:steel_warhammer",[24]= "default:sword_steel",[25]="lottmobs:horsepegh1",[26]="bones:bones", [27]="lottfarming:orc_food 4", [28]="lottfarming:orc_medicine 2"} - local meta = minetest.get_meta(pos) - local inv = meta:get_inventory() - for i = 0, item_count do - local item_idx = math.random(0,38) - inv:add_item("main",items_available[item_idx]) - end - end, + +register_chest_spawner("lottblocks:angmar_chest", { + { "lottmapgen:angsnowblock", 3 }, + { "lottblocks:orc_brick", 7 }, + { "lottother:orc_torch", 4 }, + { "lottmobs:meat", 5 }, + { "lottfarming:blue_mushroom", }, + { "lottfarming:green_mushroom", }, + { "lottthrowing:bow_wood_birch", }, + { "lottthrowing:arrow", 15 }, + { "lottpotion:athelasbrew_power1_arrow", 2 }, + { "lottweapons:steel_battleaxe", }, + { "lottpotion:wine", }, + { "lottpotion:orcdraught_power1", 2 }, + { "lottweapons:steel_battleaxe", }, + { "lottweapons:orc_sword", }, + { "bones:bone", 3 }, + { "lottarmor:helmet_steel", }, + { "lottarmor:chestplate_steel", }, + { "lottarmor:leggings_steel", }, + { "lottarmor:boots_steel", }, + { "lottpotion:beer", }, + { "lottmobs:meat_raw", }, + { "bones:skeleton_body", }, + { "lottweapons:steel_warhammer", }, + { "default:sword_steel", }, + { "lottmobs:horsepegh1", }, + { "bones:bones", }, + { "lottfarming:orc_food", 4 }, + { "lottfarming:orc_medicine", 2 }, }) diff --git a/mods/_lott/lottmapgen/deco.lua b/mods/_lott/lottmapgen/deco.lua deleted file mode 100644 index 67462fd8d..000000000 --- a/mods/_lott/lottmapgen/deco.lua +++ /dev/null @@ -1,101 +0,0 @@ -local water_level = minetest.get_mapgen_setting("water_level") - -minetest.register_on_generated(function(minp, maxp, seed) - if minp.y < (water_level-1000) or minp.y > 5000 then - return - end - - local t1 = os.clock() - local x1 = maxp.x - local y1 = maxp.y - local z1 = maxp.z - local x0 = minp.x - local y0 = minp.y - local z0 = minp.z - - --print ("[lottmapgen_checking] chunk minp ("..x0.." "..y0.." "..z0..")") - - local vm, emin, emax = minetest.get_mapgen_object("voxelmanip") - local area = VoxelArea:new{MinEdge=emin, MaxEdge=emax} - local data = vm:get_data() - - local c_air = minetest.get_content_id("air") - local c_mossycobble = minetest.get_content_id("default:mossycobble") - --local c_tomb_1 = minetest.get_content_id("lottblocks:dwarf_bottom") - --local c_tomb_2 = minetest.get_content_id("lottblocks:dwarf_head") - local c_gold = minetest.get_content_id("default:goldblock") - - local nixz = 1 - for z = z0, z1 do - for x = x0, x1 do - for y = y1, y0, -1 do -- working down each column for each node do - local fimadep = math.floor(6 - y / 512) + math.random(0, 1) - local vi = area:index(x, y, z) - local nodid = data[vi] - - if y < (water_level-500) and nodid == c_mossycobble then - local vi = area:index(x, y+1, z) - if data[vi] == c_air and data[area:index(x, y+1, z+1)] == c_air then - if math.random(1,500) == 10 then - data[vi] = c_tomb_1 - local vi = area:index(x, y+1, z+1) - data[vi] = c_tomb_2 - local vi = area:index(x, y, z+1) - data[vi] = c_mossycobble - if math.random(1,75) == 7 then - if math.random(1,2) == 1 then - for a = -1, 2 do - local vi = area:index(x+1, y, z+a) - data[vi] = c_gold - local vi = area:index(x-1, y, z+a) - data[vi] = c_gold - end - local vi = area:index(x, y, z+2) - data[vi] = c_gold - local vi = area:index(x, y, z-1) - data[vi] = c_gold - else - for a = 0, 1 do - local vi = area:index(x+1, y, z+a) - data[vi] = c_gold - local vi = area:index(x-1, y, z+a) - data[vi] = c_gold - end - local vi = area:index(x, y, z+2) - data[vi] = c_gold - local vi = area:index(x, y, z-1) - data[vi] = c_gold - end - end - end - end - end - end - nixz = nixz + 1 - end - end - vm:set_data(data) - vm:set_lighting({day=0, night=0}) - vm:calc_lighting() - vm:write_to_map(data) -end) - --- Buildings -minetest.register_decoration({ - deco_type = "schematic", - place_on = "default:snowblock", - sidelen = 16, - fill_ratio = 0.004, - schematic = minetest.get_modpath("lottmapgen").."/schems/abandoned_fort.mts", - flags = "place_center_x, place_center_z", -}) - -minetest.register_decoration({ - deco_type = "schematic", - place_on = "default:snowblock", - sidelen = 16, - fill_ratio = 0.0045, - schematic = minetest.get_modpath("lottmapgen").."/schems/abandoned_tower.mts", - flags = "place_center_x, place_center_z", -}) - diff --git a/mods/_lott/lottmapgen/functions.lua b/mods/_lott/lottmapgen/functions.lua index e7525c7e1..f48c9a76b 100644 --- a/mods/_lott/lottmapgen/functions.lua +++ b/mods/_lott/lottmapgen/functions.lua @@ -1,103 +1,58 @@ --Plants function lottmapgen_grass(data, vi) - local c_grass1 = minetest.get_content_id("default:grass_1") - local c_grass2 = minetest.get_content_id("default:grass_2") - local c_grass3 = minetest.get_content_id("default:grass_3") - local c_grass4 = minetest.get_content_id("default:grass_4") - local c_grass5 = minetest.get_content_id("default:grass_5") - local rand = math.random(5) - if rand == 1 then - data[vi] = c_grass1 - elseif rand == 2 then - data[vi] = c_grass2 - elseif rand == 3 then - data[vi] = c_grass3 - elseif rand == 4 then - data[vi] = c_grass4 - else - data[vi] = c_grass5 - end + local c_grasses = { + minetest.get_content_id("default:grass_1"), + minetest.get_content_id("default:grass_2"), + minetest.get_content_id("default:grass_3"), + minetest.get_content_id("default:grass_4"), + minetest.get_content_id("default:grass_5"), + } + data[vi] = c_grasses[math.random(#c_grasses)] end function lottmapgen_lorien_grass(data, vi) - local c_lorgrass1 = minetest.get_content_id("lottplants:lorien_grass_1") - local c_lorgrass2 = minetest.get_content_id("lottplants:lorien_grass_2") - local c_lorgrass3 = minetest.get_content_id("lottplants:lorien_grass_3") - local c_lorgrass4 = minetest.get_content_id("lottplants:lorien_grass_4") - local rand = math.random(4) - if rand == 1 then - data[vi] = c_lorgrass1 - elseif rand == 2 then - data[vi] = c_lorgrass2 - elseif rand == 3 then - data[vi] = c_lorgrass3 - else - data[vi] = c_lorgrass4 - end + local c_lorgrasses = { + minetest.get_content_id("lottplants:lorien_grass_1"), + minetest.get_content_id("lottplants:lorien_grass_2"), + minetest.get_content_id("lottplants:lorien_grass_3"), + minetest.get_content_id("lottplants:lorien_grass_4"), + } + data[vi] = c_lorgrasses[math.random(#c_lorgrasses)] end function lottmapgen_farmingplants(data, vi) - local c_plant1 = minetest.get_content_id("lottplants:pipeweed_wild") - local c_plant2 = minetest.get_content_id("lottplants:barley_wild") - local c_plant3 = minetest.get_content_id("lottplants:corn_wild") - local c_plant4 = minetest.get_content_id("lottplants:potato_wild") - local c_plant5 = minetest.get_content_id("lottplants:mushroom_wild") - local c_plant6 = minetest.get_content_id("lottplants:berries_wild") - local c_plant7 = minetest.get_content_id("lottplants:turnips_wild") - local c_plant8 = minetest.get_content_id("lottplants:tomatoes_wild") - local c_plant9 = minetest.get_content_id("lottplants:cabbage_wild") - local rand = math.random(9) - if rand == 1 then - data[vi] = c_plant1 - elseif rand == 2 then - data[vi] = c_plant2 - elseif rand == 3 then - data[vi] = c_plant3 - elseif rand == 4 then - data[vi] = c_plant4 - elseif rand == 5 then - data[vi] = c_plant5 - elseif rand == 6 then - data[vi] = c_plant6 - elseif rand == 7 then - data[vi] = c_plant7 - elseif rand == 8 then - data[vi] = c_plant8 - else - data[vi] = c_plant9 - end + local c_plants = { + minetest.get_content_id("lottplants:pipeweed_wild"), + minetest.get_content_id("lottplants:barley_wild"), + minetest.get_content_id("lottplants:corn_wild"), + minetest.get_content_id("lottplants:potato_wild"), + minetest.get_content_id("lottplants:mushroom_wild"), + minetest.get_content_id("lottplants:berries_wild"), + minetest.get_content_id("lottplants:turnips_wild"), + minetest.get_content_id("lottplants:tomatoes_wild"), + minetest.get_content_id("lottplants:cabbage_wild"), + } + data[vi] = c_plants[math.random(#c_plants)] end function lottmapgen_ithildinplants(data, vi) - local c_iplant1 = minetest.get_content_id("lottplants:asphodel") - local c_iplant2 = minetest.get_content_id("lottplants:anemones") - local c_iplant3 = minetest.get_content_id("lottplants:eglantive") - local c_iplant4 = minetest.get_content_id("lottplants:iris") - local rand = math.random(4) - if rand == 1 then - data[vi] = c_iplant1 - elseif rand == 2 then - data[vi] = c_iplant2 - elseif rand == 3 then - data[vi] = c_iplant3 - else - data[vi] = c_iplant4 - end + local c_iplants = { + minetest.get_content_id("lottplants:asphodel"), + minetest.get_content_id("lottplants:anemones"), + minetest.get_content_id("lottplants:eglantive"), + minetest.get_content_id("lottplants:iris"), + } + data[vi] = c_iplants[math.random(#c_iplants)] end function lottmapgen_lorienplants(data, vi) - local c_lplant1 = minetest.get_content_id("lottplants:elanor") - local c_lplant2 = minetest.get_content_id("lottplants:lissuin") - local c_lplant3 = minetest.get_content_id("lottplants:niphredil") - local rand = math.random(3) - if rand == 1 then - data[vi] = c_lplant1 - elseif rand == 2 then - data[vi] = c_lplant2 - else - data[vi] = c_lplant3 - end + local c_lplants = { + minetest.get_content_id("lottplants:elanor"), + minetest.get_content_id("lottplants:lissuin"), + minetest.get_content_id("lottplants:niphredil"), + } + data[vi] = c_lplants[math.random(#c_lplants)] end @@ -111,14 +66,11 @@ function lottmapgen_papyrus(x, y, z, area, data) end function lottmapgen_farmingrareplants(data, vi) - local c_rplant1 = minetest.get_content_id("lottplants:athelas") - local c_rplant2 = minetest.get_content_id("lottplants:melon_wild") - local rand = math.random(2) - if rand == 1 then - data[vi] = c_rplant1 - else - data[vi] = c_rplant2 - end + local c_rplants = { + minetest.get_content_id("lottplants:athelas"), + minetest.get_content_id("lottplants:melon_wild"), + } + data[vi] = c_rplants[math.random(#c_rplants)] end function lottmapgen_burnedtree(x, y, z, area, data) @@ -407,25 +359,6 @@ function lottmapgen_young_mallorn(x, y, z, area, data) end function lottmapgen_jungletree(x, y, z, area, data) - local c_tree = minetest.get_content_id("default:tree") - local c_leaves = minetest.get_content_id("default:leaves") - for j = -2, 5 do - if j == 4 then - for i = -2, 2 do - for k = -2, 2 do - local vil = area:index(x + i, y + j + math.random(0, 1), z + k) - if math.random(5) ~= 2 then - data[vil] = c_leaves - end - end - end - end - local vit = area:index(x, y + j, z) - data[vit] = c_tree - end -end - -function lottmapgen_jungletree2(x, y, z, area, data) local c_tree = minetest.get_content_id("default:jungletree") local c_leaves = minetest.get_content_id("lottplants:mirkleaf") for j = -3, 7 do @@ -438,14 +371,14 @@ function lottmapgen_jungletree2(x, y, z, area, data) end end end - for i = -1, 1 do + for i = -1, 1 do for k = -1, 1 do - if math.abs(i) + math.abs(k) == 2 then - local vit = area:index(x + i, y + j, z + k) - data[vit] = c_tree - end - end - end + if math.abs(i) + math.abs(k) == 2 then + local vit = area:index(x + i, y + j, z + k) + data[vit] = c_tree + end + end + end elseif j == 7 then for i = -2, 2, 4 do for k = -2, 2, 4 do @@ -586,29 +519,8 @@ end -- Trees Big ---function add_tree_branch_mallorn(pos) - --minetest.add_node(pos, {name="lottplants:mallorntree"}) - --for i = math.floor(math.random(2)), -math.floor(math.random(2)), -1 do - --for k = math.floor(math.random(2)), -math.floor(math.random(2)), -1 do - --local p = {x=pos.x+i, y=pos.y, z=pos.z+k} - --local n = minetest.get_node(p) - --if (n.name=="air") then - --minetest.add_node(p, {name="lottplants:mallornleaf"}) - --end - --local chance = math.abs(i+k) - --if (chance < 1) then - --p = {x=pos.x+i, y=pos.y+1, z=pos.z+k} - --n = minetest.get_node(p) - --if (n.name=="air") then - --minetest.add_node(p, {name="lottplants:mallornleaf"}) - --end - --end - --end - --end ---end - function lottmapgen_mallorntree(pos) - local height = 25 + math.random(5) + local height = 25 + math.random(5) if height < 10 then for i = height, -2, -1 do local p = {x=pos.x, y=pos.y+i, z=pos.z} @@ -666,28 +578,6 @@ function lottmapgen_mallorntree(pos) end end ---function add_tree_branch_mirktree(pos) - --minetest.add_node(pos, {name="default:jungletree"}) - --for i = math.floor(math.random(2)), -math.floor(math.random(2)), -1 do - --for k = math.floor(math.random(2)), -math.floor(math.random(2)), -1 do - --local p = {x=pos.x+i, y=pos.y, z=pos.z+k} - --local n = minetest.get_node(p) - --if (n.name=="air") then - --minetest.add_node(p, {name="lottplants:mirkleaf"}) - --end - --local chance = math.abs(i+k) - --if (chance < 1) then - --p = {x=pos.x+i, y=pos.y+1, z=pos.z+k} - --n = minetest.get_node(p) - --if (n.name=="air") then - --minetest.add_node(p, {name="lottplants:mirkleaf"}) - --end - --end - --end - --end ---end - - -- бук function lottmapgen_beechtree(pos) local t = 10 + math.random(3) -- trunk height @@ -701,9 +591,9 @@ function lottmapgen_beechtree(pos) j = t - absk end if math.random() > (absi + absk) / 24 then - minetest.add_node({x=pos.x+i,y=pos.y+j+7,z=pos.z+k},{name="lottplants:beechleaf"}) + minetest.add_node({x=pos.x+i,y=pos.y+j+7,z=pos.z+k},{name="lottplants:beechleaf"}) minetest.add_node({x=pos.x+i,y=pos.y+j+4,z=pos.z+k},{name="lottplants:beechleaf"}) - minetest.add_node({x=pos.x+i+2,y=pos.y+j+4,z=pos.z+k},{name="lottplants:beechleaf"}) + minetest.add_node({x=pos.x+i+2,y=pos.y+j+4,z=pos.z+k},{name="lottplants:beechleaf"}) minetest.add_node({x=pos.x+i-2,y=pos.y+j+4,z=pos.z+k},{name="lottplants:beechleaf"}) minetest.add_node({x=pos.x+i,y=pos.y+j+4,z=pos.z+k+2},{name="lottplants:beechleaf"}) minetest.add_node({x=pos.x+i,y=pos.y+j+4,z=pos.z+k-2},{name="lottplants:beechleaf"}) @@ -736,7 +626,7 @@ function lottmapgen_beechtree(pos) end function lottmapgen_mirktree(pos) - local height = 5 + math.random(1) + local height = 5 + math.random(1) if height < 1 then for i = height, -2, -1 do local p = {x=pos.x, y=pos.y+i, z=pos.z} @@ -795,7 +685,9 @@ function lottmapgen_mirktree(pos) end minetest.register_node("lottmapgen:mallorngen", { - tiles = {"lottmapgen_lorien_grass.png", "default_dirt.png", "default_dirt.png^lottmapgen_lorien_grass_side.png"}, + tiles = {"default_grass.png^[colorize:#5bf7ea:75", "default_dirt.png", + {name = "default_dirt.png^(default_grass_side.png^[colorize:#5bf7ea:75)", tileable_vertical = false} + }, is_ground_content = true, groups = {cracky=3, stone=1, not_in_creative_inventory=1}, drop = '', @@ -811,7 +703,9 @@ minetest.register_node("lottmapgen:beechgen", { }) minetest.register_node("lottmapgen:mirktreegen", { - tiles = {"lottmapgen_mirkwood_grass.png", "default_dirt.png", "default_dirt.png^lottmapgen_mirkwood_grass_side.png"}, + tiles = {"default_grass.png^[colorize:#331507:120", "default_dirt.png", + {name = "default_dirt.png^(default_grass_side.png^[colorize:#331507:120)", tileable_vertical = false} + }, is_ground_content = true, groups = {cracky=3, stone=1, not_in_creative_inventory=1}, drop = '', @@ -823,8 +717,8 @@ minetest.register_abm({ interval = 1, chance = 1, action = function(pos, node) - lottmapgen_mallorntree(pos) - end, + lottmapgen_mallorntree(pos) + end, }) minetest.register_abm({ @@ -832,112 +726,15 @@ minetest.register_abm({ interval = 1, chance = 1, action = function(pos, node) - lottmapgen_mirktree(pos) - end, + lottmapgen_mirktree(pos) + end, }) minetest.register_abm({ - nodenames = {"lottmapgen:beechgen"}, - interval = 1, + nodenames = {"lottmapgen:beechgen"}, + interval = 1, chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) + action = function(pos, node, active_object_count, active_object_count_wider) lottmapgen_beechtree(pos) - end, -}) - -function add_tree_branch_mirktreetest(pos) - minetest.add_node(pos, {name="default:tree"}) - for i = math.floor(math.random(2)), -math.floor(math.random(2)), -1 do - for k = math.floor(math.random(2)), -math.floor(math.random(2)), -1 do - local p = {x=pos.x+i, y=pos.y, z=pos.z+k} - local n = minetest.get_node(p) - if (n.name=="air") then - minetest.add_node(p, {name="lottplants:mirkleaf"}) - end - local chance = math.abs(i+k) - if (chance < 1) then - p = {x=pos.x+i, y=pos.y+1, z=pos.z+k} - n = minetest.get_node(p) - if (n.name=="air") then - minetest.add_node(p, {name="lottplants:mirkleaf"}) - end - end - end - end -end - -function lottmapgen_mirktreetest(pos) - local height = 13 + math.random(1) - if height < 1 then - for i = height, -2, -1 do - local p = {x=pos.x, y=pos.y+i, z=pos.z} - minetest.add_node(p, {name="default:tree"}) - if i == height then - add_tree_branch_mirktreetest({x=pos.x, y=pos.y+height+math.random(0, 1), z=pos.z}) - add_tree_branch_mirktreetest({x=pos.x+1, y=pos.y+i-math.random(2), z=pos.z}) - add_tree_branch_mirktreetest({x=pos.x-1, y=pos.y+i-math.random(2), z=pos.z}) - add_tree_branch_mirktreetest({x=pos.x, y=pos.y+i-math.random(2), z=pos.z+1}) - add_tree_branch_mirktreetest({x=pos.x, y=pos.y+i-math.random(2), z=pos.z-1}) - end - if i < 0 then - minetest.add_node({x=pos.x+1, y=pos.y+i-math.random(2), z=pos.z}, {name="default:jungletree"}) - minetest.add_node({x=pos.x, y=pos.y+i-math.random(2), z=pos.z+1}, {name="default:jungletree"}) - minetest.add_node({x=pos.x-1, y=pos.y+i-math.random(2), z=pos.z}, {name="default:jungletree"}) - minetest.add_node({x=pos.x, y=pos.y+i-math.random(2), z=pos.z-1}, {name="default:jungletree"}) - end - if (math.sin(i/height*i) < 0.2 and i > 3 and math.random(0,2) < 1.5) then - local branch_pos = {x=pos.x+math.random(0,1), y=pos.y+i, z=pos.z-math.random(0,1)} - add_tree_branch_mirktreetest(branch_pos) - end - end - else - for i = height, -5, -1 do - if (math.sin(i/height*i) < 0.2 and i > 3 and math.random(0,2) < 1.5) then - local branch_pos = {x=pos.x+math.random(0,1), y=pos.y+i, z=pos.z-math.random(0,1)} - add_tree_branch_mirktreetest(branch_pos) - end - if i < math.random(0,1) then - minetest.add_node({x=pos.x+1, y=pos.y+i, z=pos.z+1}, {name="default:jungletree"}) - minetest.add_node({x=pos.x+2, y=pos.y+i, z=pos.z-1}, {name="default:jungletree"}) - minetest.add_node({x=pos.x, y=pos.y+i, z=pos.z-2}, {name="default:jungletree"}) - minetest.add_node({x=pos.x-1, y=pos.y+i, z=pos.z}, {name="default:jungletree"}) - end - if i == height then - add_tree_branch_mirktreetest({x=pos.x+1, y=pos.y+i, z=pos.z+1}) - add_tree_branch_mirktreetest({x=pos.x+2, y=pos.y+i, z=pos.z-1}) - add_tree_branch_mirktreetest({x=pos.x, y=pos.y+i, z=pos.z-2}) - add_tree_branch_mirktreetest({x=pos.x-1, y=pos.y+i, z=pos.z}) - add_tree_branch_mirktreetest({x=pos.x+1, y=pos.y+i, z=pos.z+2}) - add_tree_branch_mirktreetest({x=pos.x+3, y=pos.y+i, z=pos.z-1}) - add_tree_branch_mirktreetest({x=pos.x, y=pos.y+i, z=pos.z-3}) - add_tree_branch_mirktreetest({x=pos.x-2, y=pos.y+i, z=pos.z}) - add_tree_branch_mirktreetest({x=pos.x+1, y=pos.y+i, z=pos.z}) - add_tree_branch_mirktreetest({x=pos.x+1, y=pos.y+i, z=pos.z-1}) - add_tree_branch_mirktreetest({x=pos.x, y=pos.y+i, z=pos.z-1}) - add_tree_branch_mirktreetest({x=pos.x, y=pos.y+i, z=pos.z}) - else - minetest.add_node({x=pos.x+1, y=pos.y+i, z=pos.z}, {name="default:jungletree"}) - minetest.add_node({x=pos.x+1, y=pos.y+i, z=pos.z-1}, {name="default:jungletree"}) - minetest.add_node({x=pos.x, y=pos.y+i, z=pos.z-1}, {name="default:jungletree"}) - minetest.add_node({x=pos.x, y=pos.y+i, z=pos.z}, {name="default:jungletree"}) - end - end - end -end - -minetest.register_abm({ - nodenames = {"lottmapgen:mirktest"}, - interval = 1, - chance = 1, - action = function(pos, node, active_object_count, active_object_count_wider) - lottmapgen_mirktreetest(pos) - end, -}) - -minetest.register_node("lottmapgen:mirktest", { - tiles = {"default_glass.png"}, - is_ground_content = true, - groups = {cracky=3, stone=1, not_in_creative_inventory=1}, - drop = '', - sounds = default.node_sound_stone_defaults(), + end, }) diff --git a/mods/_lott/lottmapgen/init.lua b/mods/_lott/lottmapgen/init.lua index 4eb96a6c0..3b1a7b11c 100644 --- a/mods/_lott/lottmapgen/init.lua +++ b/mods/_lott/lottmapgen/init.lua @@ -9,9 +9,6 @@ -- clay at mid-temp -- 'is ground content' false for leaves only --- TODO --- fog - -- Parameters local HITET = 0.4 -- High temperature threshold @@ -439,7 +436,7 @@ minetest.register_on_generated(function(minp, maxp, seed) if math.random(TREE2) == 2 then data[vi] = c_mirktreegen elseif math.random(TREE4) == 3 then - lottmapgen_jungletree2(x, y, z, area, data) + lottmapgen_jungletree(x, y, z, area, data) elseif math.random(PLANT13) == 13 then data[vi] = c_mirktre end @@ -530,5 +527,4 @@ minetest.register_on_generated(function(minp, maxp, seed) end) dofile(minetest.get_modpath("lottmapgen").."/schematics.lua") -dofile(minetest.get_modpath("lottmapgen").."/deco.lua") dofile(minetest.get_modpath("lottmapgen").."/chests.lua") diff --git a/mods/_lott/lottmapgen/locale/en.txt b/mods/_lott/lottmapgen/locale/lottmapgen.en.tr similarity index 91% rename from mods/_lott/lottmapgen/locale/en.txt rename to mods/_lott/lottmapgen/locale/lottmapgen.en.tr index 8c6f7cb60..292763542 100644 --- a/mods/_lott/lottmapgen/locale/en.txt +++ b/mods/_lott/lottmapgen/locale/lottmapgen.en.tr @@ -1,11 +1,11 @@ -### nodes.lua ### -Fog=Fog +# textdomain: lottmapgen Snow Block=Snow Block Frozen Stone=Frozen Stone Mordor Stone=Mordor Stone Ice=Ice Black Water Source=Black Water Source Black River Source=Black River Source +Mordor Water Bucket=Mordor Water Bucket Dunland Grass=Dunland Grass Iron Hills Grass=Iron Hills Grass Gondor Grass=Gondor Grass diff --git a/mods/_lott/lottmapgen/locale/ru.txt b/mods/_lott/lottmapgen/locale/lottmapgen.ru.tr similarity index 93% rename from mods/_lott/lottmapgen/locale/ru.txt rename to mods/_lott/lottmapgen/locale/lottmapgen.ru.tr index 6a18d3570..a1ec3d4ff 100644 --- a/mods/_lott/lottmapgen/locale/ru.txt +++ b/mods/_lott/lottmapgen/locale/lottmapgen.ru.tr @@ -1,11 +1,11 @@ -### nodes.lua ### -Fog=Туман +# textdomain: lottmapgen Snow Block=Блок снега Frozen Stone=Обледеневший камень Mordor Stone=Камень Мордора Ice=Лёд Black Water Source=Чёрная вода Black River Source=Речная чёрная вода +Mordor Water Bucket=Ведро с чёрной водой Dunland Grass=Трава Дунланда Iron Hills Grass=Трава железных гор Gondor Grass=Трава Гондора diff --git a/mods/_lott/lottmapgen/nodes.lua b/mods/_lott/lottmapgen/nodes.lua index c4a442b31..0e182b7b5 100644 --- a/mods/_lott/lottmapgen/nodes.lua +++ b/mods/_lott/lottmapgen/nodes.lua @@ -1,26 +1,10 @@ -local SL = lord.require_intllib() - -minetest.register_node("lottmapgen:fog", { - description = SL("Fog"), - drawtype = "glasslike", - tiles = {"lottmapgen_fog.png"}, - paramtype = "light", - is_ground_content = false, - sunlight_propagates = true, - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - is_ground_content = false, - post_effect_color = {a=128, r=241, g=248, b=255}, - groups = {not_in_creative_inventory=1}, -}) +local S = minetest.get_translator("lottmapgen") minetest.register_node("lottmapgen:angsnowblock", { - description = SL("Snow Block"), + description = S("Snow Block"), tiles = {"default_snow.png"}, is_ground_content = true, - drop = 'default:snowblock', + drop = 'default:snowblock', freezemelt = "default:water_source", groups = {crumbly=3, melts=1}, sounds = default.node_sound_dirt_defaults({ @@ -30,7 +14,7 @@ minetest.register_node("lottmapgen:angsnowblock", { }) minetest.register_node("lottmapgen:frozen_stone", { - description = SL("Frozen Stone"), + description = S("Frozen Stone"), tiles = {"default_stone.png^lottmapgen_frozen.png"}, is_ground_content = true, groups = {cracky=3, stone=1}, @@ -39,7 +23,7 @@ minetest.register_node("lottmapgen:frozen_stone", { }) minetest.register_node("lottmapgen:mordor_stone", { - description = SL("Mordor Stone"), + description = S("Mordor Stone"), tiles = {"lottmapgen_mordor_stone.png"}, is_ground_content = true, groups = {cracky=3, stone=1}, @@ -49,16 +33,16 @@ minetest.register_node("lottmapgen:mordor_stone", { stairs.register_stair_and_slab("mordor_stone", "lottmapgen:mordor_stone", {cracky=3, stone=1}, {"lottmapgen_mordor_stone.png"}, - SL("Mordor Stone Stair"), - SL("Mordor Stone Slab"), + S("Mordor Stone Stair"), + S("Mordor Stone Slab"), default.node_sound_stone_defaults(), false, - SL("Inner Mordor Stone Stair"), - SL("Outer Mordor Stone Stair") + S("Inner Mordor Stone Stair"), + S("Outer Mordor Stone Stair") ) minetest.register_node(":default:ice", { - description = SL("Ice"), + description = S("Ice"), drawtype = "glasslike", tiles = {"lottmapgen_ice.png"}, is_ground_content = true, @@ -71,21 +55,20 @@ minetest.register_node(":default:ice", { stairs.register_stair_and_slab("ice", "default:ice", {cracky = 3, cools_lava = 1, slippery = 3}, {"lottmapgen_ice.png"}, - SL("Ice Stair"), - SL("Ice Slab"), + S("Ice Stair"), + S("Ice Slab"), default.node_sound_ice_defaults(), true, - SL("Inner Ice Stair"), - SL("Outer Ice Slab") + S("Inner Ice Stair"), + S("Outer Ice Slab") ) minetest.register_node("lottmapgen:blacksource", { - description = SL("Black Water Source"), + description = S("Black Water Source"), drawtype = "liquid", inventory_image = minetest.inventorycube("lottmapgen_black_water.png"), tiles = {"lottmapgen_black_water.png"}, special_tiles = { - -- New-style water source material (mostly unused) { name="lottmapgen_black_water_source_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}, @@ -103,6 +86,7 @@ minetest.register_node("lottmapgen:blacksource", { liquid_alternative_flowing = "lottmapgen:blackflowing", liquid_alternative_source = "lottmapgen:blacksource", liquid_viscosity = 1, + damage_per_second = 1, post_effect_color = {a=192, r=140, g=140, b=140}, groups = {water=3, liquid=3, puts_out_fire=1}, }) @@ -132,12 +116,13 @@ minetest.register_node("lottmapgen:blackflowing", { liquid_alternative_flowing = "lottmapgen:blackflowing", liquid_alternative_source = "lottmapgen:blacksource", liquid_viscosity = 1, + damage_per_second = 1, post_effect_color = {a=192, r=140, g=140, b=140},-- {a=224, r=31, g=56, b=8}, groups = {water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1}, }) minetest.register_node("lottmapgen:black_river_source", { - description = SL("Black River Source"), + description = S("Black River Source"), drawtype = "liquid", inventory_image = minetest.inventorycube("lottmapgen_black_water.png"), tiles = {"lottmapgen_black_water.png"}, @@ -154,6 +139,7 @@ minetest.register_node("lottmapgen:black_river_source", { liquid_viscosity = 1, liquid_renewable = false, liquid_range = 2, + damage_per_second = 1, post_effect_color = {a=192, r=140, g=140, b=140}, groups = {water=3, liquid=3, puts_out_fire=1}, }) @@ -189,11 +175,21 @@ minetest.register_node("lottmapgen:black_river_flowing", { groups = {water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1}, }) +bucket.register_liquid( + "lottmapgen:blacksource", + "lottmapgen:blackflowing", + "lottmapgen:bucket_mordor", + "lottmapgen_bucket_mordor_water.png", + S("Mordor Water Bucket") +) + -- Grasses minetest.register_node("lottmapgen:dunland_grass", { - description = SL("Dunland Grass"), - tiles = {"lottmapgen_dunland_grass.png", "default_dirt.png", {name = "default_dirt.png^lottmapgen_dunland_grass_side.png", tileable_vertical = false}}, + description = S("Dunland Grass"), + tiles = {"default_grass.png^[colorize:#35ba3c:50", "default_dirt.png", + {name = "default_dirt.png^(default_grass_side.png^[colorize:#35ba3c:50)", tileable_vertical = false} + }, is_ground_content = true, groups = {crumbly=3,soil=1, not_in_creative_inventory =1,grass=1,spreading_dirt_type=1}, drop = 'default:dirt', @@ -203,8 +199,10 @@ minetest.register_node("lottmapgen:dunland_grass", { }) minetest.register_node("lottmapgen:ironhill_grass", { - description = SL("Iron Hills Grass"), - tiles = {"lottmapgen_dunland_grass.png", "default_dirt.png", {name = "default_dirt.png^lottmapgen_dunland_grass_side.png", tileable_vertical = false}}, + description = S("Iron Hills Grass"), + tiles = {"default_grass.png^[colorize:#1cbca7:60", "default_dirt.png", + {name = "default_dirt.png^(default_grass_side.png^[colorize:#1cbca7:60)", tileable_vertical = false} + }, is_ground_content = true, groups = {crumbly=3,soil=1, not_in_creative_inventory =1,grass=1,spreading_dirt_type=1}, drop = 'default:dirt', @@ -214,7 +212,7 @@ minetest.register_node("lottmapgen:ironhill_grass", { }) minetest.register_node("lottmapgen:gondor_grass", { - description = SL("Gondor Grass"), + description = S("Gondor Grass"), tiles = {"default_grass.png", "default_dirt.png", {name = "default_dirt.png^default_grass_side.png", tileable_vertical = false}}, is_ground_content = true, groups = {crumbly=3,soil=1, not_in_creative_inventory =1,grass=1,spreading_dirt_type=1}, @@ -225,8 +223,10 @@ minetest.register_node("lottmapgen:gondor_grass", { }) minetest.register_node("lottmapgen:lorien_grass", { - description = SL("Lorien Grass"), - tiles = {"lottmapgen_lorien_grass.png", "default_dirt.png", {name = "default_dirt.png^lottmapgen_lorien_grass_side.png", tileable_vertical = false}}, + description = S("Lorien Grass"), + tiles = {"default_grass.png^[colorize:#5bf7ea:75", "default_dirt.png", + {name = "default_dirt.png^(default_grass_side.png^[colorize:#5bf7ea:75)", tileable_vertical = false} + }, is_ground_content = true, groups = {crumbly=3,soil=1, not_in_creative_inventory =1,grass=1,spreading_dirt_type=1}, drop = 'default:dirt', @@ -236,8 +236,10 @@ minetest.register_node("lottmapgen:lorien_grass", { }) minetest.register_node("lottmapgen:fangorn_grass", { - description = SL("Fangorn Grass"), - tiles = {"default_grass.png", "default_dirt.png", {name = "default_dirt.png^default_grass_side.png", tileable_vertical = false}}, + description = S("Fangorn Grass"), + tiles = {"default_grass.png^[colorize:#720e6f:30", "default_dirt.png", + {name = "default_dirt.png^(default_grass_side.png^[colorize:#720e6f:30)", tileable_vertical = false} + }, is_ground_content = true, groups = {crumbly=3,soil=1, not_in_creative_inventory =1,grass=1,spreading_dirt_type=1}, drop = 'default:dirt', @@ -247,8 +249,10 @@ minetest.register_node("lottmapgen:fangorn_grass", { }) minetest.register_node("lottmapgen:mirkwood_grass", { - description = SL("Mirkwood Grass"), - tiles = {"lottmapgen_mirkwood_grass.png", "default_dirt.png", {name = "default_dirt.png^lottmapgen_mirkwood_grass_side.png", tileable_vertical = false}}, + description = S("Mirkwood Grass"), + tiles = {"default_grass.png^[colorize:#331507:120", "default_dirt.png", + {name = "default_dirt.png^(default_grass_side.png^[colorize:#331507:120)", tileable_vertical = false} + }, is_ground_content = true, groups = {crumbly=3,soil=1, not_in_creative_inventory =1,grass=1,spreading_dirt_type=1}, drop = 'default:dirt', @@ -258,8 +262,10 @@ minetest.register_node("lottmapgen:mirkwood_grass", { }) minetest.register_node("lottmapgen:rohan_grass", { - description = SL("Rohan Grass"), - tiles = {"lottmapgen_rohan_grass.png", "default_dirt.png", {name = "default_dirt.png^lottmapgen_rohan_grass_side.png", tileable_vertical = false}}, + description = S("Rohan Grass"), + tiles = {"default_grass.png^[colorize:#af5301:95", "default_dirt.png", + {name = "default_dirt.png^(default_grass_side.png^[colorize:#af5301:95)", tileable_vertical = false} + }, is_ground_content = true, groups = {crumbly=3,soil=1, not_in_creative_inventory =1,grass=1,spreading_dirt_type=1}, drop = 'default:dirt', @@ -269,8 +275,10 @@ minetest.register_node("lottmapgen:rohan_grass", { }) minetest.register_node("lottmapgen:shire_grass", { - description = SL("Shire Grass"), - tiles = {"lottmapgen_shire_grass.png", "default_dirt.png", {name = "default_dirt.png^lottmapgen_shire_grass_side.png", tileable_vertical = false}}, + description = S("Shire Grass"), + tiles = {"default_grass.png^[colorize:#86ad06:105", "default_dirt.png", + {name = "default_dirt.png^(default_grass_side.png^[colorize:#86ad06:105)", tileable_vertical = false} + }, is_ground_content = true, groups = {crumbly=3,soil=1, grass=1, not_in_creative_inventory=1,spreading_dirt_type=1}, drop = 'default:dirt', @@ -280,8 +288,10 @@ minetest.register_node("lottmapgen:shire_grass", { }) minetest.register_node("lottmapgen:ithilien_grass", { - description = SL("Ithilien Grass"), - tiles = {"default_grass.png", "default_dirt.png", {name = "default_dirt.png^default_grass_side.png", tileable_vertical = false}}, + description = S("Ithilien Grass"), + tiles = {"default_grass.png^[colorize:#ba6f35:50", "default_dirt.png", + {name = "default_dirt.png^(default_grass_side.png^[colorize:#ba6f35:50)", tileable_vertical = false} + }, is_ground_content = true, groups = {crumbly=3,soil=1, grass=1, not_in_creative_inventory=1, spreading_dirt_type=1}, drop = 'default:dirt', diff --git a/mods/_lott/lottmapgen/textures/default_grass_side.png b/mods/_lott/lottmapgen/textures/default_grass_side.png deleted file mode 100644 index 73638ebd5..000000000 Binary files a/mods/_lott/lottmapgen/textures/default_grass_side.png and /dev/null differ diff --git a/mods/_lott/lottmapgen/textures/lottmapgen_bucket_mordor_water.png b/mods/_lott/lottmapgen/textures/lottmapgen_bucket_mordor_water.png new file mode 100644 index 000000000..829a2cbe5 Binary files /dev/null and b/mods/_lott/lottmapgen/textures/lottmapgen_bucket_mordor_water.png differ diff --git a/mods/_lott/lottmapgen/textures/lottmapgen_dunland_grass.png b/mods/_lott/lottmapgen/textures/lottmapgen_dunland_grass.png deleted file mode 100644 index db818e9ae..000000000 Binary files a/mods/_lott/lottmapgen/textures/lottmapgen_dunland_grass.png and /dev/null differ diff --git a/mods/_lott/lottmapgen/textures/lottmapgen_dunland_grass_side.png b/mods/_lott/lottmapgen/textures/lottmapgen_dunland_grass_side.png deleted file mode 100644 index 82b12654a..000000000 Binary files a/mods/_lott/lottmapgen/textures/lottmapgen_dunland_grass_side.png and /dev/null differ diff --git a/mods/_lott/lottmapgen/textures/lottmapgen_fog.png b/mods/_lott/lottmapgen/textures/lottmapgen_fog.png deleted file mode 100644 index 4801b8465..000000000 Binary files a/mods/_lott/lottmapgen/textures/lottmapgen_fog.png and /dev/null differ diff --git a/mods/_lott/lottmapgen/textures/lottmapgen_lorien_grass.png b/mods/_lott/lottmapgen/textures/lottmapgen_lorien_grass.png deleted file mode 100644 index 1f5d9a57b..000000000 Binary files a/mods/_lott/lottmapgen/textures/lottmapgen_lorien_grass.png and /dev/null differ diff --git a/mods/_lott/lottmapgen/textures/lottmapgen_lorien_grass_side.png b/mods/_lott/lottmapgen/textures/lottmapgen_lorien_grass_side.png deleted file mode 100644 index 1ab9d0d58..000000000 Binary files a/mods/_lott/lottmapgen/textures/lottmapgen_lorien_grass_side.png and /dev/null differ diff --git a/mods/_lott/lottmapgen/textures/lottmapgen_mirkwood_grass.png b/mods/_lott/lottmapgen/textures/lottmapgen_mirkwood_grass.png deleted file mode 100644 index 20721446f..000000000 Binary files a/mods/_lott/lottmapgen/textures/lottmapgen_mirkwood_grass.png and /dev/null differ diff --git a/mods/_lott/lottmapgen/textures/lottmapgen_mirkwood_grass_side.png b/mods/_lott/lottmapgen/textures/lottmapgen_mirkwood_grass_side.png deleted file mode 100644 index 0556bb8b3..000000000 Binary files a/mods/_lott/lottmapgen/textures/lottmapgen_mirkwood_grass_side.png and /dev/null differ diff --git a/mods/_lott/lottmapgen/textures/lottmapgen_rohan_grass.png b/mods/_lott/lottmapgen/textures/lottmapgen_rohan_grass.png deleted file mode 100644 index a441524f9..000000000 Binary files a/mods/_lott/lottmapgen/textures/lottmapgen_rohan_grass.png and /dev/null differ diff --git a/mods/_lott/lottmapgen/textures/lottmapgen_rohan_grass_side.png b/mods/_lott/lottmapgen/textures/lottmapgen_rohan_grass_side.png deleted file mode 100644 index 8098da007..000000000 Binary files a/mods/_lott/lottmapgen/textures/lottmapgen_rohan_grass_side.png and /dev/null differ diff --git a/mods/_lott/lottmapgen/textures/lottmapgen_shire_grass.png b/mods/_lott/lottmapgen/textures/lottmapgen_shire_grass.png deleted file mode 100644 index 5d48b3249..000000000 Binary files a/mods/_lott/lottmapgen/textures/lottmapgen_shire_grass.png and /dev/null differ diff --git a/mods/_lott/lottmapgen/textures/lottmapgen_shire_grass_side.png b/mods/_lott/lottmapgen/textures/lottmapgen_shire_grass_side.png deleted file mode 100644 index f9760a3f9..000000000 Binary files a/mods/_lott/lottmapgen/textures/lottmapgen_shire_grass_side.png and /dev/null differ diff --git a/mods/_lott/lottmapgen/textures/default_grass.png b/mods/lord/_overwrites/MTG/default/textures/default_grass.png similarity index 100% rename from mods/_lott/lottmapgen/textures/default_grass.png rename to mods/lord/_overwrites/MTG/default/textures/default_grass.png diff --git a/mods/lord/_overwrites/MTG/default/textures/default_grass_side.png b/mods/lord/_overwrites/MTG/default/textures/default_grass_side.png index cdab7695f..73638ebd5 100644 Binary files a/mods/lord/_overwrites/MTG/default/textures/default_grass_side.png and b/mods/lord/_overwrites/MTG/default/textures/default_grass_side.png differ