Skip to content

Commit

Permalink
Rage Increase
Browse files Browse the repository at this point in the history
Added a config option to be able to change the amount that damage is scaled by for Rage.
  • Loading branch information
TrueDarkLord committed Feb 24, 2024
1 parent 21b9c23 commit 61d3817
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ public class CrazyManager {
private boolean useUnsafeEnchantments;
private boolean breakRageOnDamage;
private boolean useRageBossBar;

private double rageIncrement;
private boolean enchantStackedItems;
private boolean maxEnchantmentCheck;
private boolean checkVanillaLimit;
Expand Down Expand Up @@ -183,8 +185,9 @@ public void load() {
this.checkVanillaLimit = config.getBoolean("Settings.EnchantmentOptions.IncludeVanillaEnchantments", false);
this.gkitzToggle = !config.contains("Settings.GKitz.Enabled") || config.getBoolean("Settings.GKitz.Enabled", true);
this.rageMaxLevel = config.getInt("Settings.EnchantmentOptions.MaxRageLevel", 4);
this.breakRageOnDamage = !config.contains("Settings.EnchantmentOptions.Break-Rage-On-Damage") || config.getBoolean("Settings.EnchantmentOptions.Break-Rage-On-Damage");
this.useRageBossBar = config.contains("Settings.EnchantmentOptions.Rage-Boss-Bar") && config.getBoolean("Settings.EnchantmentOptions.Rage-Boss-Bar");
this.breakRageOnDamage = config.getBoolean("Settings.EnchantmentOptions.Break-Rage-On-Damage", true);
this.useRageBossBar = config.getBoolean("Settings.EnchantmentOptions.Rage-Boss-Bar", false);
this.rageIncrement = config.getDouble("Settings.EnchantmentOptions.Rage-Increase", 0.1);
this.enchantStackedItems = config.contains("Settings.EnchantmentOptions.Enchant-Stacked-Items") && config.getBoolean("Settings.EnchantmentOptions.Enchant-Stacked-Items");
setDropBlocksBlast(config.getBoolean("Settings.EnchantmentOptions.Drop-Blocks-For-Blast", true));
setDropBlocksVeinMiner(config.getBoolean("Settings.EnchantmentOptions.Drop-Blocks-For-VeinMiner", true));
Expand Down Expand Up @@ -830,6 +833,10 @@ public boolean useRageBossBar() {
return this.useRageBossBar;
}

public double getRageIncrement() {
return this.rageIncrement;
}

/**
* Check if players can enchant a stack of items with an enchantment book.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ public void onPlayerDamage(EntityDamageByEntityEvent event) {
cePlayer.getRageTask().cancel();

if (cePlayer.getRageMultiplier() <= this.crazyManager.getRageMaxLevel())
cePlayer.setRageMultiplier(cePlayer.getRageMultiplier() + (enchantments.get(CEnchantments.RAGE.getEnchantment()) * 0.1));
cePlayer.setRageMultiplier(cePlayer.getRageMultiplier() + (enchantments.get(CEnchantments.RAGE.getEnchantment()) * crazyManager.getRageIncrement()));

int rageUp = cePlayer.getRageLevel() + 1;

if (cePlayer.getRageMultiplier().intValue() == rageUp) {
if (cePlayer.getRageMultiplier().intValue() >= rageUp) {
rageInformPlayer(damager, Messages.RAGE_RAGE_UP, Map.of("%Level%", String.valueOf(rageUp)), ((float) rageUp / (float) (this.crazyManager.getRageMaxLevel() + 1)));
cePlayer.setRageLevel(rageUp);
}
Expand Down
1 change: 1 addition & 0 deletions paper/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ Settings:
MaxRageLevel: 4 #The max amount of rage that scan stack when fighting.
Break-Rage-On-Damage: true #If the player is damaged while building rage, it will be broken if this is enabled.
Rage-Boss-Bar: false #If true, messages from rage will be displayed on a boss bar.
Rage-Increase: 0.1 #Rage will increase in damage by a multiple of enchantLevel*rageIncrease every hit.
Right-Click-Book-Description: true #Toggles whether when you right-click the enchantment book if it messages the player the description or not.
UnSafe-Enchantments: true #Having this set to true will allow players to use enchantments levels above the max level.
Blast-Full-Durability: true #Toggle if the item takes damage for every block it breaks or just one. True to take full damage or false to take only 1 damage.
Expand Down

0 comments on commit 61d3817

Please sign in to comment.