mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 03:34:43 +02:00
Adding AdvancedConfig
This commit is contained in:
@ -2,16 +2,20 @@ package com.gmail.nossr50.skills.swords;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
|
||||
public class Swords {
|
||||
public static final int BLEED_MAX_BONUS_LEVEL = 750;
|
||||
public static final int MAX_BLEED_TICKS = 3;
|
||||
public static final int BASE_BLEED_TICKS = 2;
|
||||
static AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
|
||||
|
||||
public static final int BLEED_MAX_BONUS_LEVEL = advancedConfig.getBleedMaxBonusLevel();
|
||||
public static final int MAX_BLEED_TICKS = advancedConfig.getBleedMaxTicks();
|
||||
public static final int BASE_BLEED_TICKS = advancedConfig.getBleedBaseTicks();
|
||||
|
||||
public static final int COUNTER_ATTACK_MAX_BONUS_LEVEL = 600;
|
||||
public static final int COUNTER_ATTACK_MODIFIER = 2;
|
||||
public static final int COUNTER_ATTACK_MAX_BONUS_LEVEL = advancedConfig.getCounterMaxBonusLevel();
|
||||
public static final int COUNTER_ATTACK_MODIFIER = advancedConfig.getCounterModifier();
|
||||
|
||||
public static final int SERRATED_STRIKES_MODIFIER = 4;
|
||||
public static final int SERRATED_STRIKES_BLEED_TICKS = 5;
|
||||
public static final int SERRATED_STRIKES_MODIFIER = advancedConfig.getSerratedStrikesModifier();
|
||||
public static final int SERRATED_STRIKES_BLEED_TICKS = advancedConfig.getSerratedStrikesTicks();
|
||||
|
||||
private static Random random = new Random();
|
||||
|
||||
|
@ -3,6 +3,7 @@ package com.gmail.nossr50.skills.swords;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
import com.gmail.nossr50.util.Combat;
|
||||
@ -41,13 +42,16 @@ public class SwordsManager {
|
||||
if (Combat.shouldBeAffected(player, defender)) {
|
||||
BleedEventHandler eventHandler = new BleedEventHandler(this, defender);
|
||||
|
||||
int randomChance = 1000;
|
||||
int bleedChanceMax = AdvancedConfig.getInstance().getBleedChanceMax();
|
||||
int bleedMaxLevel = AdvancedConfig.getInstance().getBleedMaxBonusLevel();
|
||||
int randomChance = 100;
|
||||
|
||||
if (player.hasPermission("mcmmo.perks.lucky.swords")) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
if (Swords.getRandom().nextInt(randomChance) < eventHandler.skillModifier) {
|
||||
final float chance = (bleedChanceMax / bleedMaxLevel) * skillLevel;
|
||||
if (chance > Swords.getRandom().nextInt(randomChance)) {
|
||||
eventHandler.addBleedTicks();
|
||||
eventHandler.sendAbilityMessages();
|
||||
}
|
||||
@ -69,14 +73,16 @@ public class SwordsManager {
|
||||
|
||||
if (eventHandler.isHoldingSword()) {
|
||||
eventHandler.calculateSkillModifier();
|
||||
|
||||
int randomChance = 2000;
|
||||
int counterChanceMax = AdvancedConfig.getInstance().getCounterChanceMax();
|
||||
int counterMaxLevel = AdvancedConfig.getInstance().getCounterMaxBonusLevel();
|
||||
int randomChance = 100;
|
||||
|
||||
if (player.hasPermission("mcmmo.perks.lucky.swords")) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
if (Swords.getRandom().nextInt(randomChance) < eventHandler.skillModifier) {
|
||||
final float chance = (counterChanceMax / counterMaxLevel) * skillLevel;
|
||||
if (chance > Swords.getRandom().nextInt(randomChance)) {
|
||||
eventHandler.dealDamage();
|
||||
eventHandler.sendAbilityMessages();
|
||||
}
|
||||
|
Reference in New Issue
Block a user