From: Elias Fleckenstein Date: Wed, 9 Dec 2020 17:58:15 +0000 (+0100) Subject: Suffocation & home priv X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=ccf391545eb2b37c7e5563d739526bb77675d5b6;p=Crafter.git Suffocation & home priv --- diff --git a/mods/bow/textures/arrow_item.png b/mods/bow/textures/arrow_item.png index de90c56..0800934 100644 Binary files a/mods/bow/textures/arrow_item.png and b/mods/bow/textures/arrow_item.png differ diff --git a/mods/player_mechanics/suffocation.lua b/mods/player_mechanics/suffocation.lua new file mode 100644 index 0000000..36d4ff7 --- /dev/null +++ b/mods/player_mechanics/suffocation.lua @@ -0,0 +1,35 @@ +local time = 0 + +minetest.register_globalstep(function(dtime) + time = time + dtime + + if time < 0.5 then + return + end + + time = 0 + + for _, player in ipairs(minetest.get_connected_players()) do + local name = player:get_player_name() + local pos = player:get_pos() + local node_head = minetest.get_node(vector.add(pos, vector.new(0, 1.5, 0))).name + + -- Is player suffocating inside node? (Only for solid full opaque cube type nodes + -- without group disable_suffocation=1) + local ndef = minetest.registered_nodes[node_head] + + if ndef + and (ndef.walkable == nil or ndef.walkable == true) + and (ndef.collision_box == nil or ndef.collision_box.type == "regular") + and (ndef.node_box == nil or ndef.node_box.type == "regular") + and (ndef.groups.disable_suffocation ~= 1) + and (node_head ~= "ignore") + and (not minetest.check_player_privs(name, {noclip = true})) then + if player:get_hp() > 0 then + player:set_hp(player:get_hp() - 1) + end + end + + end + +end) diff --git a/mods/season/init.lua b/mods/season/init.lua new file mode 100644 index 0000000..d39831c --- /dev/null +++ b/mods/season/init.lua @@ -0,0 +1,11 @@ +local dayofyear = os.date("*t").yday + +if dayofyear >= 79 and dayofyear < 172 then + season = "spring" +elseif dayofyear < 266 then + season = "summer" +elseif dayofyear < 355 then + season = "autumn" +else + season = "winter" +end diff --git a/todo.old.txt b/todo.old.txt new file mode 100644 index 0000000..d4110cb --- /dev/null +++ b/todo.old.txt @@ -0,0 +1,21 @@ +0) Make armor +1.5) make bookshelves +2.) make better enchanting +--find mod that has these? +3.) add cows +4.) add sheep +5.) add coloured wools using texture mods dynamically for pretty much infinite colours +6.) make enchanting use bookshelves +7.) overhaul enchanting gui +8.) make anvil to combine enchantments +9.) Make lapiz +10.) make inventory less crap +11.) make aura (heal randomly when eating enchanted food) +12.) make jetpack +13.) do all redstone todo items +14.) make steel +15.) Make waypoints +16.) Make the buildtest pipes actually work +17.) Make the quarry +432432.) fix the redstone piston bug https://forum.minetest.net/viewtopic.php?p=372505#p372505 +23432244.) overhaul redstone again https://forum.minetest.net/viewtopic.php?p=372654#p372654 diff --git a/todo.txt b/todo.txt index 8ee3cbf..1f1308c 100644 --- a/todo.txt +++ b/todo.txt @@ -1,4 +1,3 @@ -- Take damage when inside blocks - Bucket sounds - Background images for armor in inventory - Equip armor with rightclick @@ -8,7 +7,7 @@ - Sprinting - Rebalancing of ore generation probabilities and tool speeds - More sophisticated particle effects -- Season effects (only affecting visuals) +- Season effects (only affecting audiovisuals) - Add two new biomes, each with individual trees, exclusive mobs and structures and a boss fight - Fix creative inventory to not overstack items - Add Oil