Hardcore mode can now be toggled for each skill individually

This commit is contained in:
TfT_02
2013-08-21 16:46:38 +02:00
parent ede0757d83
commit a6e7febf77
11 changed files with 235 additions and 52 deletions

View File

@ -88,4 +88,76 @@ public final class HardcoreManager {
victim.sendMessage(LocaleLoader.getString("Vampirism.Victim.Failure", killer.getName()));
}
}
/**
* Check if Hardcore Stat Loss is enabled for one or more skill types
*
* @return true if Stat Loss is enabled for one or more skill types
*/
public static boolean getHardcoreStatLossEnabled() {
boolean enabled = false;
for (SkillType skillType : SkillType.nonChildSkills()) {
if (skillType.getHardcoreStatLossEnabled()) {
enabled = true;
break;
}
}
return enabled;
}
/**
* Check if Hardcore Stat Loss is disabled for one or more skill types
*
* @return true if Stat Loss is disabled for one or more skill types
*/
public static boolean getHardcoreStatLossDisabled() {
boolean disabled = false;
for (SkillType skillType : SkillType.nonChildSkills()) {
if (!skillType.getHardcoreStatLossEnabled()) {
disabled = true;
break;
}
}
return disabled;
}
/**
* Check if Hardcore Vampirism is enabled for one or more skill types
*
* @return true if Vampirism is enabled for one or more skill types
*/
public static boolean getHardcoreVampirismEnabled() {
boolean enabled = false;
for (SkillType skillType : SkillType.nonChildSkills()) {
if (skillType.getHardcoreVampirismEnabled()) {
enabled = true;
break;
}
}
return enabled;
}
/**
* Check if Hardcore Vampirism is disabled for one or more skill types
*
* @return true if Vampirism is disabled for one or more skill types
*/
public static boolean getHardcoreVampirismDisabled() {
boolean disabled = false;
for (SkillType skillType : SkillType.nonChildSkills()) {
if (!skillType.getHardcoreVampirismEnabled()) {
disabled = true;
break;
}
}
return disabled;
}
}

View File

@ -43,8 +43,8 @@ public final class Motd {
* @param player Target player
*/
public static void displayHardcoreSettings(Player player) {
if (Config.getInstance().getHardcoreEnabled()) {
if (Config.getInstance().getHardcoreVampirismEnabled()) {
if (HardcoreManager.getHardcoreStatLossEnabled()) {
if (HardcoreManager.getHardcoreVampirismEnabled()) {
player.sendMessage(LocaleLoader.getString("MOTD.Hardcore.VampireOn"));
player.sendMessage(LocaleLoader.getString("MOTD.Hardcore.Stats", Config.getInstance().getHardcoreDeathStatPenaltyPercentage()));
player.sendMessage(LocaleLoader.getString("MOTD.Vampire.Stats", Config.getInstance().getHardcoreVampirismStatLeechPercentage()));