Add DTR (deaths til raidable) option for f show.

Will show 0 if they are raidable to prevent a negative number from showing.
This commit is contained in:
drtshock 2015-01-27 11:07:55 -06:00
parent f92d59e5c6
commit d888b320db
3 changed files with 9 additions and 1 deletions

View File

@ -57,10 +57,14 @@ public class CmdShow extends FCommand {
msg(TL.COMMAND_SHOW_JOINING.toString() + peaceStatus, (faction.getOpen() ? TL.COMMAND_SHOW_UNINVITED.toString() : TL.COMMAND_SHOW_INVITATION.toString()));
double powerBoost = faction.getPowerBoost();
String boost = (powerBoost == 0.0) ? "" : (powerBoost > 0.0 ? TL.COMMAND_SHOW_BONUS.toString():TL.COMMAND_SHOW_PENALTY.toString() + powerBoost + ")");
String boost = (powerBoost == 0.0) ? "" : (powerBoost > 0.0 ? TL.COMMAND_SHOW_BONUS.toString() : TL.COMMAND_SHOW_PENALTY.toString() + powerBoost + ")");
String raidable = faction.getLandRounded() > faction.getPowerRounded() ? TL.RAIDABLE_TRUE.toString() : TL.RAIDABLE_FALSE.toString();
msg(TL.COMMAND_SHOW_POWER, faction.getLandRounded(), faction.getPowerRounded(), faction.getPowerMaxRounded(), boost, raidable);
if (P.p.getConfig().getBoolean("hcf.raidable", false)) {
int dtr = Math.max(faction.getPowerRounded() - faction.getLandRounded(), 0);
msg(TL.COMMAND_SHOW_DEATHS_TIL_RAIDABLE, dtr);
}
if (faction.isPermanent()) {
msg(TL.COMMAND_SHOW_PERMANENT);
}

View File

@ -446,6 +446,7 @@ public enum TL {
COMMAND_SHOW_MEMBERSONLINE("Members online: "),
COMMAND_SHOW_MEMBERSOFFLINE("Members offline: "),
COMMAND_SHOW_COMMANDDESCRIPTION("Show faction information"),
COMMAND_SHOW_DEATHS_TIL_RAIDABLE("<i>DTR: %1$d"),
COMMAND_SHOWINVITES_PENDING("Players with pending invites: "),
COMMAND_SHOWINVITES_CLICKTOREVOKE("Click to revoke invite for %1$s"),

View File

@ -177,6 +177,9 @@ max-relations:
hcf:
raidable: false
# DTR (death til raidable) will be in /f show if enabled. Configure the message in the lang.yml
dtr: false
# Should we allow Factions to over claim if they are raidable (above has no effect on this)?
# This has always been true, allowing factions to over claim others.
overclaim: true