From c87592a9cf4ff5654cd0d58960c2bec945baa14b Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 6 Aug 2017 15:52:52 +0200 Subject: [PATCH 1/5] Fix typo in examples.lua --- examples.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples.lua b/examples.lua index 93c4980..0f5e35e 100644 --- a/examples.lua +++ b/examples.lua @@ -119,7 +119,7 @@ playereffects.register_effect_type("slowregen", "Slow Regeneration", "heart.png" ) --- Dummy effect for the stree test +-- Dummy effect for the stress test playereffects.register_effect_type("stress", "Stress Test Effect", nil, {}, function(player) end, From a043aadeff2e778d4c4e681409ec11a9c49af1a7 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 6 Aug 2017 16:09:33 +0200 Subject: [PATCH 2/5] Add standadized group names --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 808c2c3..311f12a 100644 --- a/README.md +++ b/README.md @@ -65,11 +65,19 @@ Normally you don’t need to read or edit fields of this table. Use `playereffec #### Effect group An effect group is basically a concept. Any effect type can be member of any number of effect groups. The main point of effect groups is to find effects which affect the same property. For example, an effect which makes you faster and another effect which makes you slower both affect the same property: speed. The group for that then would be the string `"speed"`. See also `examples.lua`, which includes the effects `high_speed` and `low_speed`. -Currently, the main rule of Player Effects requires that there can only be one effect in place. Don’t worry, Player Effects already does that job for you. Back to the example: it is possible to be fast and it is possible to be slow. But it is not possible to be fast `and` slow at the same time. Player Effects ensures that by cancelling all conflicting concepts before applying a new one. +Currently, the main rule of Player Effects requires that there can only be one effect in place. Player Effects already does that job for you. Back to the example: it is possible to be fast and it is possible to be slow. But it is not possible to be fast *and* slow at the same time. Player Effects ensures that by cancelling all conflicting concepts before applying a new one. The concept of groups may be changed or extended in the future. -You can invent effect groups (like the groups in Minetest) on the fly. A group is just a string. Practically, you should use groups which other people use. +The following effect group names have standardized meanings and should solely be used for their intended purpose: + +* `speed`: Affects the player speed set by the `speed` value of `set_physics_override` +* `gravity`: Affects the player gravity set by the `gravity` value of `set_physics_override` +* `jump`: Affects the player jump strength set by the `jump` value of `set_physics_override` +* `health`: Affects the player health +* `breath`: Affects the player breath + +You can also invent effect groups (like the groups in Minetest) on the fly. A group is just a string. Practically, you should use groups which other people use. #### Effect (`effect`) An effect is an current change of a player property (like speed, jump height, and so on). It is the realization of an effect type. All effects are temporary. There are currently two types of effects: Repeating and non-repeating. Non-repeating effects call their `apply` callback once when they are created. Repeating effects call their apply callback multiple times with a specified interval. By default, effects are non-repeating. From 51547f2e70492a67f5c21ce59871904b88c234f0 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 6 Aug 2017 16:40:01 +0200 Subject: [PATCH 3/5] Fix slowregen example --- examples.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples.lua b/examples.lua index 0f5e35e..5063ed1 100644 --- a/examples.lua +++ b/examples.lua @@ -115,7 +115,7 @@ playereffects.register_effect_type("slowregen", "Slow Regeneration", "heart.png" function(player) player:set_hp(player:get_hp()+1) end, - nil, nil, nil, 15 + nil, nil, nil, 3 ) From f8d70283d10f8d5077e53e9d43845d70ec369c20 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 22 Feb 2019 01:42:50 +0100 Subject: [PATCH 4/5] This mod is finished --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 311f12a..151a501 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Player Effects ## Summary -This is an framework for assigning temporary status effects to players. This mod is aimed to modders and maybe interested people. This framework is a work in progress and not finished. +This is an framework for assigning temporary status effects to players. This mod is aimed to modders and maybe interested people. ## Profile * Name: Player Effects From e1bc0e23c80ab5953fa6f0cb78989f45f7269af5 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 23 Jun 2019 13:09:16 +0200 Subject: [PATCH 5/5] Reduce debug log level for autosaving debug msgs --- init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 56df387..95aa1ea 100644 --- a/init.lua +++ b/init.lua @@ -355,7 +355,7 @@ function playereffects.save_to_file() if file then file:write(savestring) io.close(file) - minetest.log("action", "[playereffects] Wrote playereffects data into "..filepath..".") + minetest.log("info", "[playereffects] Wrote playereffects data into "..filepath..".") else minetest.log("error", "[playereffects] Failed to write playereffects data into "..filepath..".") end @@ -393,7 +393,7 @@ minetest.register_on_leaveplayer(function(player) end) minetest.register_on_shutdown(function() - minetest.log("action", "[playereffects] Server shuts down. Rescuing data into playereffects.mt") + minetest.log("info", "[playereffects] Server shuts down. Rescuing data into playereffects.mt") playereffects.save_to_file() end) @@ -427,7 +427,7 @@ minetest.register_globalstep(function(dtime) -- Autosave into file if(playereffects.use_autosave == true and playereffects.autosave_timer >= playereffects.autosave_time) then playereffects.autosave_timer = 0 - minetest.log("action", "[playereffects] Autosaving mod data to playereffects.mt ...") + minetest.log("info", "[playereffects] Autosaving mod data to playereffects.mt ...") playereffects.save_to_file() end end)