mirror of
https://github.com/exituser/Brewery.git
synced 2026-09-17 06:38:56 +00:00
Removed longer passing out/overdrinking
This commit is contained in:
@@ -34,7 +34,6 @@ public class BPlayer {
|
|||||||
|
|
||||||
private int quality = 0;// = quality of drunkeness * drunkeness
|
private int quality = 0;// = quality of drunkeness * drunkeness
|
||||||
private int drunkeness = 0;// = amount of drunkeness
|
private int drunkeness = 0;// = amount of drunkeness
|
||||||
private boolean passedOut = false;// if kicked because of drunkeness
|
|
||||||
private int offlineDrunk = 0;// drunkeness when gone offline
|
private int offlineDrunk = 0;// drunkeness when gone offline
|
||||||
private Vector push = new Vector(0, 0, 0);
|
private Vector push = new Vector(0, 0, 0);
|
||||||
private int time = 20;
|
private int time = 20;
|
||||||
@@ -43,11 +42,10 @@ public class BPlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// reading from file
|
// reading from file
|
||||||
public BPlayer(String name, int quality, int drunkeness, int offlineDrunk, Boolean passedOut) {
|
public BPlayer(String name, int quality, int drunkeness, int offlineDrunk) {
|
||||||
this.quality = quality;
|
this.quality = quality;
|
||||||
this.drunkeness = drunkeness;
|
this.drunkeness = drunkeness;
|
||||||
this.offlineDrunk = offlineDrunk;
|
this.offlineDrunk = offlineDrunk;
|
||||||
this.passedOut = passedOut;
|
|
||||||
players.put(name, this);
|
players.put(name, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -254,7 +252,6 @@ public class BPlayer {
|
|||||||
public void passOut(Player player) {
|
public void passOut(Player player) {
|
||||||
player.kickPlayer(P.p.languageReader.get("Player_DrunkPassOut"));
|
player.kickPlayer(P.p.languageReader.get("Player_DrunkPassOut"));
|
||||||
offlineDrunk = drunkeness;
|
offlineDrunk = drunkeness;
|
||||||
passedOut = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -272,11 +269,7 @@ public class BPlayer {
|
|||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (drunkeness <= 80) {
|
if (drunkeness <= 90) {
|
||||||
if (passedOut) {
|
|
||||||
// he has suffered enough. Let him through
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (Math.random() > 0.4) {
|
if (Math.random() > 0.4) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
@@ -284,12 +277,10 @@ public class BPlayer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (drunkeness <= 100) {
|
if (drunkeness <= 100) {
|
||||||
if (!passedOut) {
|
if (Math.random() > 0.6) {
|
||||||
if (Math.random() > 0.6) {
|
return 0;
|
||||||
return 0;
|
} else {
|
||||||
} else {
|
return 2;
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 3;
|
return 3;
|
||||||
@@ -331,7 +322,6 @@ public class BPlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
offlineDrunk = 0;
|
offlineDrunk = 0;
|
||||||
passedOut = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disconnecting() {
|
public void disconnecting() {
|
||||||
@@ -534,9 +524,6 @@ public class BPlayer {
|
|||||||
if (bPlayer.offlineDrunk != 0) {
|
if (bPlayer.offlineDrunk != 0) {
|
||||||
section.set("offDrunk", bPlayer.offlineDrunk);
|
section.set("offDrunk", bPlayer.offlineDrunk);
|
||||||
}
|
}
|
||||||
if (bPlayer.passedOut) {
|
|
||||||
section.set("passedOut", true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -443,9 +443,8 @@ public class P extends JavaPlugin {
|
|||||||
int quality = section.getInt(name + ".quality");
|
int quality = section.getInt(name + ".quality");
|
||||||
int drunk = section.getInt(name + ".drunk");
|
int drunk = section.getInt(name + ".drunk");
|
||||||
int offDrunk = section.getInt(name + ".offDrunk", 0);
|
int offDrunk = section.getInt(name + ".offDrunk", 0);
|
||||||
boolean passedOut = section.getBoolean(name + ".passedOut", false);
|
|
||||||
|
|
||||||
new BPlayer(name, quality, drunk, offDrunk, passedOut);
|
new BPlayer(name, quality, drunk, offDrunk);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user