Compare commits

..

No commits in common. "master" and "nalc-1.0" have entirely different histories.

4 changed files with 6 additions and 8 deletions

2
description.txt Normal file
View File

@ -0,0 +1,2 @@
player_monoids is a library for managing global player state, such as physics
overrides or player visual size.

View File

@ -1,5 +1 @@
name = player_monoids
description = """
A library for managing global player state,
such as physics overrides or player visual size.
"""
name=player_monoids

View File

@ -63,6 +63,7 @@ player_monoids.jump = monoid({
end,
})
-- Gravity monoid. Effect values are gravity multipliers.
player_monoids.gravity = monoid({
combine = mult,
@ -75,6 +76,7 @@ player_monoids.gravity = monoid({
end,
})
-- Fly ability monoid. The values are booleans, which are combined by or. A true
-- value indicates having the ability to fly.
player_monoids.fly = monoid({
@ -102,6 +104,7 @@ player_monoids.fly = monoid({
end,
})
-- Noclip ability monoid. Works the same as fly monoid.
player_monoids.noclip = monoid({
combine = function(p, q) return p or q end,

View File

@ -4,7 +4,6 @@ local speed = player_monoids.speed
minetest.register_privilege("monoid_master", {
description = "Allows testing of player monoids.",
give_to_singleplayer = false,
give_to_admin = true,
})
local function test(player)
@ -14,8 +13,6 @@ local function test(player)
minetest.chat_send_player(p_name, "Your speed is: " .. speed:value(player))
minetest.after(3, function()
local player = minetest.get_player_by_name(p_name)
if not player then return end
speed:del_change(player, ch_id)
minetest.chat_send_player(p_name, "Your speed is: " .. speed:value(player))
end)