Compare commits

..

3 Commits

Author SHA1 Message Date
5a04858fc0 Merge remote-tracking branch 'upstream/master' 2023-11-22 23:27:58 +01:00
tenplus1
ad3a575257
Add support for Pova mod (#5) 2023-07-28 21:01:55 +02:00
David Leal
7aad47076e
Remove default as a dependency (#4)
"default" is no longer directly used by this mod.
2023-07-26 21:48:48 +02:00
2 changed files with 10 additions and 3 deletions

View File

@ -1,4 +1,5 @@
local has_monoids = minetest.global_exists("player_monoids")
local has_pova = minetest.global_exists("pova")
local function freeze(player)
local player_name = player:get_player_name()
@ -6,6 +7,9 @@ local function freeze(player)
player_monoids.speed:add_change(player, 0, "cozy:speed")
player_monoids.jump:add_change(player, 0, "cozy:jump")
player_monoids.gravity:add_change(player, 0, "cozy:gravity")
elseif has_pova then
pova.add_override(player_name, "force", {speed = 0, jump = 0, gravity = 0})
pova.do_override(player)
else
player:set_physics_override({speed = 0, jump = 0, gravity = 0})
end
@ -18,6 +22,9 @@ local function unfreeze(player)
player_monoids.speed:del_change(player, "cozy:speed")
player_monoids.jump:del_change(player, "cozy:jump")
player_monoids.gravity:del_change(player, "cozy:gravity")
elseif has_pova then
pova.del_override(player_name, "force")
pova.do_override(player)
else
player:set_physics_override({speed = 1, jump = 1, gravity = 1})
end

View File

@ -1,4 +1,4 @@
name = cozy
depends = default, player_api
optional_depends = player_monoids
description = Adds sitting down, and lying down player animations.
depends = player_api
optional_depends = player_monoids, pova
description = Adds sitting down, and lying down player animations.