monoidal_effects/test_effects.lua

31 lines
810 B
Lua
Raw Normal View History

2016-01-13 16:54:37 -08:00
-- Static half speed
monoidal_effects.register_type("monoidal_effects:half_speed",
{ disp_name = "Half Speed",
2016-01-23 13:56:39 -08:00
tags = {test = true},
monoids = {speed = true},
2016-01-13 16:54:37 -08:00
cancel_on_death = true,
values = {speed = 0.5},
2016-01-13 16:54:37 -08:00
})
-- 3x speed plus heavy gravity
2016-01-23 15:22:05 -08:00
monoidal_effects.register_type("monoidal_effects:three_speed",
{ disp_name = "3x Speed",
tags = {test = true},
monoids = {speed = true, gravity = true},
2016-01-23 15:22:05 -08:00
cancel_on_death = true,
values = {speed = 3, gravity = 10},
2016-01-23 15:22:05 -08:00
})
2016-01-13 16:54:37 -08:00
minetest.register_on_joinplayer(function(player)
monoidal_effects.apply_effect("monoidal_effects:half_speed",
2016-01-23 15:22:05 -08:00
4,
player:get_player_name()
)
monoidal_effects.apply_effect("monoidal_effects:three_speed",
8,
2016-01-13 16:54:37 -08:00
player:get_player_name()
)
end)