Add settings for Bleed damage

Adds #2154
This commit is contained in:
TfT_02 2014-10-11 12:18:31 +02:00
parent 63b332216e
commit a5bc547c40
3 changed files with 13 additions and 4 deletions

View File

@ -802,6 +802,9 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
public int getSmeltingVanillaXPBoostMultiplier(Smelting.Tier tier) { return config.getInt("Skills.Smelting.VanillaXPMultiplier.Rank_" + tier.toNumerical()); }
/* SWORDS */
public double getBleedDamagePlayer() { return config.getDouble("Skills.Swords.Bleed.Damage_Player", 1.0); }
public double getBleedDamageMobs() { return config.getDouble("Skills.Swords.Bleed.Damage_Mobs", 2.0); }
public int getBleedMaxTicks() { return config.getInt("Skills.Swords.Bleed.MaxTicks", 3); }
public int getBleedBaseTicks() { return config.getInt("Skills.Swords.Bleed.BaseTicks", 2); }

View File

@ -9,6 +9,7 @@ import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.skills.CombatUtils;
import com.gmail.nossr50.util.skills.ParticleEffectUtils;
@ -28,10 +29,10 @@ public class BleedTimerTask extends BukkitRunnable {
continue;
}
int damage;
double damage;
if (entity instanceof Player) {
damage = 1;
damage = AdvancedConfig.getInstance().getBleedDamagePlayer();
Player player = (Player) entity;
if (!player.isOnline()) {
@ -44,14 +45,14 @@ public class BleedTimerTask extends BukkitRunnable {
ParticleEffectUtils.playBleedEffect(entity);
}
entry.setValue(entry.getValue() - damage);
entry.setValue(entry.getValue() - 1);
if (entry.getValue() <= 0) {
player.sendMessage(LocaleLoader.getString("Swords.Combat.Bleeding.Stopped"));
}
}
else {
damage = 2;
damage = AdvancedConfig.getInstance().getBleedDamageMobs();
// Anticipate the entity's death to prevent CME because of our EntityDeathEvent listener
if (entity.getHealth() - damage > 0) {

View File

@ -447,6 +447,11 @@ Skills:
ChanceMax: 75.0
MaxBonusLevel: 750
# Damage_Player: Bleeding damage dealt to players
# Damage_Mobs: Bleeding damage dealt to mobs
Damage_Player: 1.0
Damage_Mobs: 2.0
# These settings determine how long the Bleeding effect lasts
MaxTicks: 3
BaseTicks: 2