From 095f21c312bc2f55bdd97d6ceb232c4a8ae0642c Mon Sep 17 00:00:00 2001 From: paramat Date: Tue, 10 May 2016 05:53:14 +0100 Subject: [PATCH] Slabs not buildable-to. Change player skin on spacesuit status. Tune footstep and breath check chances --- README.txt | 46 ++++++++++++------------- init.lua | 39 ++++++++++++++++----- nodes.lua | 18 +++++++--- textures/moonrealm_character.png | Bin 0 -> 2754 bytes textures/moonrealm_space_character.png | Bin 0 -> 1038 bytes 5 files changed, 65 insertions(+), 38 deletions(-) create mode 100644 textures/moonrealm_character.png create mode 100644 textures/moonrealm_space_character.png 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 0000000000000000000000000000000000000000..05021781e03fbb71cb309d5ac233c6c90f332fda GIT binary patch literal 2754 zcmV;z3O)6SP)2uX*6~`Is8-X;*&E0SAO>&cvke%!y3xOmA1X`so?O2^U+G=e9kx~mtSV|M1>{}P0 z6tr}4X|WZxTJ;a`g>NiW*4CH)5y$g6w}*Qt8RupuDVh1s@A;i`o`-wBXM29k$@kY+ zT_PRjMY1?qD2r2t(os7`&f#QNIw0MOPIVqq za1wcI%A7}z-ffUgi-4)m>>tkJ+(1o8hIKux4lh^d-C3N67}m(qk7R9TP5{mkNiv~d zqu^LlRbo!w{QYUUaruZ`d*=oD_|4t&@ugjc>z5D9tv|jpV*+rFNRkO(X-VA0Xj9Cb zobyHh5q%uR>B%7djez%$$@O;+$kjK;4FCS^e!20xqjKvHFVFY~lKMD`)045HF?J6K zNKGZ6SEEk`7y(yKYqXCz0UG_E%fH^(i3|c}+5^adDFm!+ipywY?A{PSjkhas7RPx) z2v7P08F1}a6Y|NgC*<1Od*$j|d$b((%FXwWPbq=?r7-nxpvGz)XGwdW5WqL3Lz+Iy@oQ-#Y|IeJz25a`o-;Ss@^&$$6t=63`cDj9)wfbbbf`IGhV6 z!KWXcm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