More party members = more XP share bonus

Sorry, broke your party settings in config.yml. So now when there are
more party members near, the party share bonus is increased. :)
This commit is contained in:
TfT_02 2013-02-04 17:20:45 +01:00
parent ac1d556895
commit 6d5ce1357e
3 changed files with 11 additions and 3 deletions

View File

@ -84,7 +84,9 @@ public class Config extends ConfigLoader {
/* PARTY SETTINGS */
public boolean getExpShareEnabled() { return config.getBoolean("Party.Sharing.ExpShare_enabled", true); }
public double getPartyShareBonus() { return config.getDouble("Party.Sharing.ExpShare_bonus", 1.1); }
public double getPartyShareBonusBase() { return config.getDouble("Party.Sharing.ExpShare_bonus_base", 1.1); }
public double getPartyShareBonusIncrease() { return config.getDouble("Party.Sharing.ExpShare_bonus_increase", 0.05); }
public double getPartyShareBonusCap() { return config.getDouble("Party.Sharing.ExpShare_bonus_cap", 1.5); }
public boolean getItemShareEnabled() { return config.getBoolean("Party.Sharing.ItemShare_enabled", true); }
public double getPartyShareRange() { return config.getDouble("Party.Sharing.Range", 75.0); }

View File

@ -50,7 +50,11 @@ public final class ShareHandler {
}
double partySize = nearMembers.size() + 1;
double splitXp = xp / partySize * Config.getInstance().getPartyShareBonus();
double shareBonus = Config.getInstance().getPartyShareBonusBase() + partySize * Config.getInstance().getPartyShareBonusIncrease();
if (shareBonus > Config.getInstance().getPartyShareBonusCap()) {
shareBonus = Config.getInstance().getPartyShareBonusCap();
}
double splitXp = xp / partySize * shareBonus;
int roundedXp = (int) Math.ceil(splitXp);
for (Player member : nearMembers) {

View File

@ -71,7 +71,9 @@ Items:
Party:
Sharing:
ExpShare_enabled: true
ExpShare_bonus: 1.1
ExpShare_bonus_base: 1.1
ExpShare_bonus_increase: 1.05
ExpShare_bonus_cap: 1.5
ItemShare_enabled: true
Range: 75.0