Per player power patch
Before working more on this I'd like to discuss various implementations of this.
For now I just added a way to modify via LuckPerms how much power can each user have via factions.power.modifier.<number>, but we can go further by moving the power attribute from the Faction to the User and add methods to calculate and manipulate power in a faction (it would be similar to this branch' Faction#calculateMaxPower).
I'd like to hear your point of view on this change.
~~(also this branch is based on CamperSamu:placeholders-patch since some work is needed on the placeholders too)~~ (now based on master)
What is the use case for this? I don't really see a need for something like this
Servers might want to add extra power with roles (like VIPs or gamemode ranks), so adding a way to increase a player's power would be nice.
Instead, moving power to be per-player should prevent a faction's power to be completely drained by a single player committing suicide over and over.
Instead, moving power to be per-player should prevent a faction's power to be completely drained by a single player committing suicide over and over.
This is something I think should be fixed, so per-player power could be a nice feature.
Great! I'll start working on it again in the following days since during this week I won't be often at home.
This version of the patch is already testable. CI Builds are available on my branch under github actions.
https://github.com/CamperSamu/factions/actions/runs/2624887857
I am removing base power since with the per-player power it's not possible to really implemet, but if you want we can add the base power to the faction's owner or make it common power.
Also I (obviously) had to change the f admin command to make it edit players and not factions.
In the meantime I'm doing a bit of code cleanup (also doing it on the code-cleanup branch, not frequently updated) and refactoring of minor stuff
Starting to work on commands and placeholders, then I'll playtest everything a bit; if you want to try it out and point out issues and missing features you're welcome!
Last commit fixes broken factions by using f create on console and via /execute
now f info gives the player's power when used while not in a faction

(obviously the normal command stays unaffected)

Forgot to note, this includes the info command changes and the extra placeholders
The new placeholders are:
player_power_formatted- Shows the player power with a color that transitions between green and red
power_stats- Shows the current power stats
- If the player is not in a faction it will show
player power/player max power - If the player is in a faction, it will show
faction power/faction required power/faction max power
- If the player is not in a faction it will show
- Shows the current power stats
power_stats_formatted- The same as
power_stats, but with formatting like player power and the other pre-formatted placeholders
- The same as
(Not in a Faction)

(In a Faction)

Rebalanced the default power values:
- Each player has 20 power
- Death penalty is now 5
- Claim weight lowered to 2
- Survival reward raised to 3
This should make everything work better after the power changes.
I'd say that this is now ready for PR!
Play around with it and tell me if anything else needs to be changed. (Builds available in GH Actions)
Forgot to mention, I've enabled maintainer commits to the branch, so if there's a small adjustment that you are willing to do yourself you can just checkout to my branch (or do it inside the web editor) and make the adjustment before merging the branch.
Will work on it in the following days! Also I've noticed weird behavior when the survival power bonus is applied on my server while testing, will double check that code ASAP before merging
What problem was there with base power that caused you to remove it?
I am removing base power since with the per-player power it's not really possible to implemet elegantly, but if you want we can add the base power to the faction's owner or make it common power.
Base power doens't make sense in a system where the power belongs to single players; the only sensible place to put it would be in a common/faction power pool (that is against what this PR is trying to accomplish). Handling a common pool of power is not as straight forward as removing power from a single user; a possible solution would be to give extra power to the faction owner, another one might be to deplete that pool when a user with 0 power dies or to remove a portion of common power for each death.
In my opinion this is confusing and it's better to remove base power.
(also sorry if I'm not quick at responding/working lately but I am currently in vacation with my family, both internet and time are kind of unreliable)
Fixed the issue I had with power, I forgot to port the power cap checks to the penalty/reward
Currently very, very busy, idk when I'll be able to bring everything up to speed, but it will be done eventually.