diff options
author | Wuzzy <almikes@aol.com> | 2014-07-13 22:07:04 +0200 |
---|---|---|
committer | Wuzzy <almikes@aol.com> | 2014-07-13 22:07:04 +0200 |
commit | 85fbd146b145af79d5e197957caa5308f4101d66 (patch) | |
tree | 80f263f8a11845d88414fc2f819cd3b60a5f2175 /examples.lua | |
parent | bf505282280835c5ffbf124003003b1bfa72dbc8 (diff) |
Add support for hidden effects
Hidden effects are effects which are not exposed to the player’s HUD.
Diffstat (limited to 'examples.lua')
-rw-r--r-- | examples.lua | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/examples.lua b/examples.lua index 8f0ff67..69950fe 100644 --- a/examples.lua +++ b/examples.lua @@ -12,6 +12,21 @@ playereffects.register_effect_type("high_speed", "High speed", nil, {"speed"}, end ) +-- Makes the user faster (hidden effect) +playereffects.register_effect_type("high_speed_hidden", "High speed", nil, {"speed"}, + function(player) + player:set_physics_override(4,nil,nil) + end, + + function(effect) + local player = minetest.get_player_by_name(effect.playername) + player:set_physics_override(1,nil,nil) + end, + true +) + + + -- Slows the user down playereffects.register_effect_type("low_speed", "Low speed", nil, {"speed"}, function(player) @@ -69,6 +84,14 @@ minetest.register_chatcommand("fast", { playereffects.apply_effect_type("high_speed", 10, minetest.get_player_by_name(name)) end, }) +minetest.register_chatcommand("hfast", { + params = "", + description = "Makes you fast for a short time (hidden effect).", + privs = {}, + func = function(name, param) + playereffects.apply_effect_type("high_speed_hidden", 10, minetest.get_player_by_name(name)) + end, +}) minetest.register_chatcommand("slow", { params = "", description = "Makes you slow for a long time.", |