mirror of
https://github.com/DieReicheErethons/Brewery.git
synced 2024-09-29 04:07:30 +02:00
Bad Quality Drunkeness leads to more soulsand
This commit is contained in:
parent
fae2d15804
commit
c4a9ce0ba8
@ -524,18 +524,23 @@ public class BPlayer {
|
|||||||
// #### Puking ####
|
// #### Puking ####
|
||||||
|
|
||||||
// Chance that players puke on big drunkeness
|
// Chance that players puke on big drunkeness
|
||||||
// runs every 6 sec, average chance is 10%, so should puke about every 60 sec
|
// runs every 6 sec, average chance is 15%, so should puke about every 40 sec
|
||||||
// good quality can decrease the chance by up to 10%
|
// good quality can decrease the chance by up to 15%
|
||||||
public void drunkPuke(Player player) {
|
public void drunkPuke(Player player) {
|
||||||
if (drunkeness >= 80) {
|
if (drunkeness >= 90) {
|
||||||
if (drunkeness >= 90) {
|
// chance between 20% and 10%
|
||||||
if (Math.random() < 0.15f - (getQuality() / 100f)) {
|
if (Math.random() < 0.20f - (getQuality() / 100f)) {
|
||||||
addPuke(player, 20 + (int) (Math.random() * 40));
|
addPuke(player, 20 + (int) (Math.random() * 40));
|
||||||
}
|
}
|
||||||
} else {
|
} else if (drunkeness >= 80) {
|
||||||
if (Math.random() < 0.08f - (getQuality() / 100f)) {
|
// chance between 15% and 0%
|
||||||
addPuke(player, 10 + (int) (Math.random() * 30));
|
if (Math.random() < 0.15f - (getQuality() / 66f)) {
|
||||||
}
|
addPuke(player, 10 + (int) (Math.random() * 30));
|
||||||
|
}
|
||||||
|
} else if (drunkeness >= 70) {
|
||||||
|
// chance between 10% at 1 quality and 0% at 6 quality
|
||||||
|
if (Math.random() < 0.10f - (getQuality() / 60f)) {
|
||||||
|
addPuke(player, 10 + (int) (Math.random() * 20));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -551,6 +556,7 @@ public class BPlayer {
|
|||||||
if (event.isCancelled() || event.getCount() < 1) {
|
if (event.isCancelled() || event.getCount() < 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
BUtil.reapplyPotionEffect(player, PotionEffectType.HUNGER.createEffect(80, 4), true);
|
||||||
|
|
||||||
if (pTasks.isEmpty()) {
|
if (pTasks.isEmpty()) {
|
||||||
taskId = P.p.getServer().getScheduler().scheduleSyncRepeatingTask(P.p, BPlayer::pukeTask, 1L, 1L);
|
taskId = P.p.getServer().getScheduler().scheduleSyncRepeatingTask(P.p, BPlayer::pukeTask, 1L, 1L);
|
||||||
|
Loading…
Reference in New Issue
Block a user