]> git.lizzy.rs Git - Crafter.git/commitdiff
Suffocation & home priv
authorElias Fleckenstein <eliasfleckenstein@web.de>
Wed, 9 Dec 2020 17:58:15 +0000 (18:58 +0100)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Wed, 9 Dec 2020 17:58:15 +0000 (18:58 +0100)
mods/bow/textures/arrow_item.png
mods/player_mechanics/suffocation.lua [new file with mode: 0644]
mods/season/init.lua [new file with mode: 0644]
todo.old.txt [new file with mode: 0644]
todo.txt

index de90c569ea358fdaa28ee2299b8408ac4a8ac493..08009342b0b540e89f679e4328b687f06fcce87e 100644 (file)
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 (file)
index 0000000..36d4ff7
--- /dev/null
@@ -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 (file)
index 0000000..d39831c
--- /dev/null
@@ -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 (file)
index 0000000..d4110cb
--- /dev/null
@@ -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
index 8ee3cbfc1b9c44ebff046e7926bf23e46910b7d7..1f1308ca57a1dbc855729cc71d65cdb283050eb3 100644 (file)
--- 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