enviro: getting punched by player restores 50% of gravity

master
rnd1 2016-07-13 10:07:17 +02:00
parent d49f6ad867
commit f028f7d91d
2 changed files with 12 additions and 1 deletions

View File

@ -609,7 +609,6 @@ minetest.register_tool("basic_machines:ball_spell", {
minetest.register_craft({
output = "basic_machines:ball_spawner",
recipe = {

View File

@ -286,6 +286,18 @@ end)
-- end
-- });
minetest.register_on_punchplayer( -- bring gravity closer to normal with each punch
function(player, hitter, time_from_last_punch, tool_capabilities, dir, damage)
local gravity = player:get_physics_override().gravity;
if gravity<1 then
gravity = 0.5*gravity+0.5;
player:set_physics_override({gravity=gravity})
end
end
)