-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Per player power patch #71
base: master
Are you sure you want to change the base?
Conversation
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. |
This is something I think should be fixed, so per-player power could be a nice feature. |
Great! |
Sync to master (attempt 2)
Signed-off-by: Camper_Samu <[email protected]>
Signed-off-by: Camper_Samu <[email protected]>
This version of the patch is already testable. https://github.com/CamperSamu/factions/actions/runs/2624887857 |
# Conflicts: # src/main/java/io/icker/factions/api/persistents/Faction.java # src/main/java/io/icker/factions/command/InfoCommand.java # src/main/java/io/icker/factions/command/MemberCommand.java # src/main/java/io/icker/factions/core/FactionsManager.java # src/main/java/io/icker/factions/util/Migrator.java
Signed-off-by: Camper_Samu <[email protected]>
Signed-off-by: Camper_Samu <[email protected]>
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 |
…wer to prevent code duplication and missed formula changes (also this will allow for custom formulas in the future), NPE proofing in various commands and a bit of code annotation. Signed-off-by: Camper_Samu <[email protected]>
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! |
Signed-off-by: Camper_Samu <[email protected]>
Last commit fixes broken factions by using f create on console and via /execute |
Signed-off-by: Camper_Samu <[email protected]>
Signed-off-by: Camper_Samu <[email protected]>
…h penalty for every death (pveDeathPenalty, false by default) Signed-off-by: Camper_Samu <[email protected]>
Forgot to note, this includes the info command changes and the extra placeholders |
The new placeholders are:
|
Signed-off-by: Camper_Samu <[email protected]>
Signed-off-by: Camper_Samu <[email protected]>
Rebalanced the default power values:
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. |
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. |
…kEarlySend turned on Signed-off-by: Camper_Samu <[email protected]>
…-player-power-patch
Signed-off-by: Camper_Samu <[email protected]>
src/main/java/io/icker/factions/mixin/ServerPlayerEntityMixin.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks good, just a few things that need to be adjusted. Once thats done, I'm good to merge this.
Will work on it in the following days! |
What problem was there with base power that caused you to remove it? |
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). 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) |
(check power range before subtracting) Because of me changing how power is added the old code behaved in the wrong way. Now I moved the range check outside of the method and relocated it into the reward/penalty code. New Logic: - Penalty - Check if the power is less or zero - If the power is less or zero quit out the fuction - Before adding power, check if the penalty makes the power value negative - If so, instead of subtracting the power power penalty, subtract the remaining power - Otherwise subtract the power penalty like normal - Reward - Check if the power exceeds the max power - If the power exceeds the max power quit out the function - Before adding the reward, check if the current power + the reward overflows the max power - If so, add the remaining power (max power - power) - Otherwise, add power like normal.
Fixed the issue I had with power, I forgot to port the power cap checks to the penalty/reward |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything should be good
Currently very, very busy, idk when I'll be able to bring everything up to speed, but it will be done eventually. |
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 thepower
attribute from theFaction
to theUser
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)