diff --git a/README.txt b/README.txt index ae22c45..60a3771 100644 --- a/README.txt +++ b/README.txt @@ -1,25 +1,16 @@ -moonrealm 0.9.2 by paramat -For Minetest 0.4.12 or later +moonrealm 0.10.0 by paramat +For Minetest 0.4.14 or later Depends default Licenses: Code LGPL 2.1. Media CC BY-SA -Version changes: - -Hlsource crafting bugfix. -Remove moonrealm:sapling crafting. -Moonrealm:appleleaf drops more saplings. -More items given on spawn. -Cleanup code. - - Crafting -------- -Spacesuit. +Spacesuit To avoid drowning in the vacuum nodes put a spacesuit in your inventory. -Mesetinted helmet. +Mesetinted helmet -C- -G- -S- @@ -27,14 +18,14 @@ C = default mese crystal (mese tint) G = default glass S = default steel ingot -Lifesupport backpack. +Lifesupport backpack SSS S-S SMS S = default steel ingot M = default mese block (power source) -Spacesuit. +Spacesuit WHW -L- W-W @@ -42,28 +33,28 @@ W = wool white (fabric) H = moonrealm helmet L = moonrealm lifesupport -Moon stone brick x 4. +Moon stone brick x 4 MM MM M = moon stone -Moon stone stair x 4. +Moon stone stair x 4 M MM M = moon stone -Moon stone slab x 4. +Moon stone slab x 4 MM M = moon stone -Default furnace. +Default furnace You can cook moon dust to moonrealm glass, use mese crystal as fuel. MMM M-M MMM M = moon stone -Airgen. +Airgen Place in the centre of a sealed habitat. Moonrealm air will spread to a distance of roughly 16 nodes. SIS @@ -73,7 +64,7 @@ S = default steel ingot I = moonrealm waterice M = default mese block (power source) -Airlock with light source. +Airlock with light source Walk through it, life support air cannot pass through. S-S SMS @@ -88,12 +79,19 @@ GGG G = moonrealm glass M = default mese block (power source) -Default water source. -Ice spawns in dust at mid to low altitudes. +Light x 1 +GC +shapeless crafting +G = moonrealm glass +C = default mese crystal (power source) + +Default water source +Ice spawns in dust at mid to low altitudes I +shapeless crafting I = moonrealm waterice -Hydroponic liquid source. +Hydroponic liquid source Hydroponic liquid will saturate the 5x5 node area of dust around it, to a depth of 5 nodes, changing it to moonrealm soil. You can grow any farming mod crop in the soil. A depth of 2 soil nodes with moonrealm air above is needed for a moonrealm sapling to grow. diff --git a/init.lua b/init.lua index 4ea82b5..6f3b848 100644 --- a/init.lua +++ b/init.lua @@ -113,17 +113,27 @@ minetest.register_on_mapgen_init(function(mgparams) end) --- Player positions +-- Player positions, spacesuit texture status local player_pos = {} local player_pos_previous = {} +local player_spacesuit = {} minetest.register_on_joinplayer(function(player) player_pos_previous[player:get_player_name()] = {x = 0, y = 0, z = 0} + + if player:get_inventory():contains_item("main", "moonrealm:spacesuit") then + player:set_properties({textures = {"moonrealm_space_character.png"}}) + player_spacesuit[player:get_player_name()] = true + else + player:set_properties({textures = {"moonrealm_character.png"}}) + player_spacesuit[player:get_player_name()] = false + end end) minetest.register_on_leaveplayer(function(player) player_pos_previous[player:get_player_name()] = nil + player_spacesuit[player:get_player_name()] = nil end) @@ -131,8 +141,8 @@ end) minetest.register_globalstep(function(dtime) for _, player in ipairs(minetest.get_connected_players()) do - if player_pos_previous[player:get_player_name()] ~= nil and -- footprints - FOOT and math.random() < 0.3 then + if FOOT and math.random() < 0.2 and -- footprints + player_pos_previous[player:get_player_name()] ~= nil then local pos = player:getpos() player_pos[player:get_player_name()] = { x = math.floor(pos.x + 0.5), @@ -177,14 +187,25 @@ minetest.register_globalstep(function(dtime) } end - if math.random() < 0.1 then -- spacesuit restores breath - if player:get_inventory():contains_item("main", "moonrealm:spacesuit") and - player:get_breath() < 10 then - player:set_breath(10) + if math.random() < 0.04 then -- spacesuit restores breath, reset spacesuit texture + if player:get_inventory():contains_item("main", "moonrealm:spacesuit") then + if player:get_breath() < 10 then + player:set_breath(10) + end + + if player_spacesuit[player:get_player_name()] == false then -- if no spacesuit texture, add + player:set_properties({textures = {"moonrealm_space_character.png"}}) + player_spacesuit[player:get_player_name()] = true + end + else -- no spacesuit in inventory + if player_spacesuit[player:get_player_name()] == true then -- if spacesuit texture, remove + player:set_properties({textures = {"moonrealm_character.png"}}) + player_spacesuit[player:get_player_name()] = false + end end end - if math.random() > 0.99 then -- set gravity, skybox and override light + if math.random() < 0.01 then -- set gravity, skybox and override light local pos = player:getpos() if pos.y > YMIN and pos.y < YMAX then -- entering realm player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity @@ -377,7 +398,7 @@ minetest.register_on_generated(function(minp, maxp, seed) vm:write_to_map(data) local chugent = math.ceil((os.clock() - t1) * 1000) - print ("[moonrealm] "..chugent.." ms chunk ("..x0.." "..y0.." "..z0..")") + print ("[moonrealm] "..chugent.." ms") end) diff --git a/nodes.lua b/nodes.lua index 8fa5a9a..f3e86be 100644 --- a/nodes.lua +++ b/nodes.lua @@ -277,7 +277,8 @@ minetest.register_node("moonrealm:light", { minetest.register_node("moonrealm:stonebrick", { description = "Moon Stone Brick", - tiles = {"moonrealm_stonebricktop.png", "moonrealm_stonebrickbot.png", "moonrealm_stonebrick.png"}, + tiles = {"moonrealm_stonebricktop.png", "moonrealm_stonebrickbot.png", + "moonrealm_stonebrick.png"}, is_ground_content = false, groups = {cracky=3}, sounds = default.node_sound_stone_defaults(), @@ -285,12 +286,12 @@ minetest.register_node("moonrealm:stonebrick", { minetest.register_node("moonrealm:stoneslab", { description = "Moon Stone Slab", - tiles = {"moonrealm_stonebricktop.png", "moonrealm_stonebrickbot.png", "moonrealm_stonebrick.png"}, + tiles = {"moonrealm_stonebricktop.png", "moonrealm_stonebrickbot.png", + "moonrealm_stonebrick.png"}, drawtype = "nodebox", paramtype = "light", is_ground_content = false, - sunlight_propagates = true, - buildable_to = true, + --sunlight_propagates = true, node_box = { type = "fixed", fixed = { @@ -309,7 +310,8 @@ minetest.register_node("moonrealm:stoneslab", { minetest.register_node("moonrealm:stonestair", { description = "Moon Stone Stair", - tiles = {"moonrealm_stonebricktop.png", "moonrealm_stonebrickbot.png", "moonrealm_stonebrick.png"}, + tiles = {"moonrealm_stonebricktop.png", "moonrealm_stonebrickbot.png", + "moonrealm_stonebrick.png"}, drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", @@ -465,6 +467,12 @@ minetest.register_craft({ }, }) +minetest.register_craft({ + type = "shapeless", + output = "moonrealm:light 1", + recipe = {"moonrealm:glass", "default:mese_crystal"}, +}) + -- Cooking diff --git a/textures/moonrealm_character.png b/textures/moonrealm_character.png new file mode 100644 index 0000000..0502178 Binary files /dev/null and b/textures/moonrealm_character.png differ diff --git a/textures/moonrealm_space_character.png b/textures/moonrealm_space_character.png new file mode 100644 index 0000000..2285623 Binary files /dev/null and b/textures/moonrealm_space_character.png differ