Witherless Rose mechanic reworked from halving wither damage to having a

25% chance (multiplicative) of negating the damage tick. This makes the
effect more noticeable to the player (previously the player still took
damage from every single wither tick no matter how many roses they had),
and also reduces the diminishing returns effect from holding multiple
roses.
dev
Nonoriri 11 years ago
parent 7db09a34a1
commit d775a20155
  1. 4
      BankEconomyMod/src/me/kaZep/Base/Main.java
  2. 7
      BankEconomyMod/src/me/kaZep/Base/PlayerListener.java

@ -5135,6 +5135,10 @@ public void payDay(int time)
return false;
}
/**
* @param p - The player which we're checking the rose count for
* @return - The number of Witherless Roses (Unwilting Flowers) in the player's inventory.
*/
public int getWitherlessRoseCount(Player p) {
int count = 0;
for (int m=0;m<p.getInventory().getContents().length;m++) {

@ -8693,7 +8693,12 @@ implements Listener
e.setDamage(e.getDamage()*2);
}
if (e.getCause()==DamageCause.WITHER) {
e.setDamage(e.getDamage()*Math.pow(0.5, this.plugin.getWitherlessRoseCount(p)));
// e.setDamage(e.getDamage()*Math.pow(0.5, this.plugin.getWitherlessRoseCount(p)));
// For each Witherless Rose, add a multiplicative 25% chance to negate this tick of wither damage.
if (Math.random() > Math.pow(0.75, this.plugin.getWitherlessRoseCount(p))) {
e.setCancelled(true);
}
}
Bukkit.getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() {
@Override

Loading…
Cancel
Save