mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 19:54:44 +02:00
Adding AdvancedConfig
This commit is contained in:
@ -2,24 +2,28 @@ package com.gmail.nossr50.skills.taming;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
|
||||
public class Taming {
|
||||
public static final int ENVIRONMENTALLY_AWARE_ACTIVATION_LEVEL = 100;
|
||||
static AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
|
||||
|
||||
public static final int ENVIRONMENTALLY_AWARE_ACTIVATION_LEVEL = advancedConfig.getEnviromentallyAwareUnlock();
|
||||
|
||||
public static final int FAST_FOOD_SERVICE_ACTIVATION_CHANCE = 50;
|
||||
public static final int FAST_FOOD_SERVICE_ACTIVATION_LEVEL = 50;
|
||||
public static final int FAST_FOOD_SERVICE_ACTIVATION_CHANCE = advancedConfig.getFastFoodChance();
|
||||
public static final int FAST_FOOD_SERVICE_ACTIVATION_LEVEL = advancedConfig.getFastFoodUnlock();
|
||||
|
||||
public static final int GORE_BLEED_TICKS = 2;
|
||||
public static final int GORE_MAX_BONUS_LEVEL = 1000;
|
||||
public static final int GORE_MULTIPLIER = 2;
|
||||
public static final int GORE_BLEED_TICKS = advancedConfig.getGoreBleedTicks();
|
||||
public static final int GORE_MAX_BONUS_LEVEL = advancedConfig.getGoreMaxBonusLevel();
|
||||
public static final int GORE_MULTIPLIER = advancedConfig.getGoreModifier();
|
||||
|
||||
public static final int SHARPENED_CLAWS_ACTIVATION_LEVEL = 750;
|
||||
public static final int SHARPENED_CLAWS_BONUS = 2;
|
||||
public static final int SHARPENED_CLAWS_ACTIVATION_LEVEL = advancedConfig.getSharpenedClawsUnlock();
|
||||
public static final int SHARPENED_CLAWS_BONUS = advancedConfig.getSharpenedClawsBonus();
|
||||
|
||||
public static final int SHOCK_PROOF_ACTIVATION_LEVEL = 500;
|
||||
public static final int SHOCK_PROOF_MODIFIER = 6;
|
||||
public static final int SHOCK_PROOF_ACTIVATION_LEVEL = advancedConfig.getShockProofUnlock();
|
||||
public static final int SHOCK_PROOF_MODIFIER = advancedConfig.getShockProofModifier();
|
||||
|
||||
public static final int THICK_FUR_ACTIVATION_LEVEL = 250;
|
||||
public static final int THICK_FUR_MODIFIER = 2;
|
||||
public static final int THICK_FUR_ACTIVATION_LEVEL = advancedConfig.getThickFurUnlock();
|
||||
public static final int THICK_FUR_MODIFIER = advancedConfig.getThickFurModifier();
|
||||
|
||||
private static Random random = new Random();
|
||||
|
||||
|
@ -8,6 +8,7 @@ import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
@ -101,14 +102,17 @@ public class TamingManager {
|
||||
}
|
||||
|
||||
GoreEventHandler eventHandler = new GoreEventHandler(this, event);
|
||||
|
||||
int randomChance = 1000;
|
||||
|
||||
int goreChanceMax = AdvancedConfig.getInstance().getGoreChanceMax();
|
||||
int goreMaxLevel = AdvancedConfig.getInstance().getGoreMaxBonusLevel();
|
||||
int randomChance = 100;
|
||||
|
||||
if (player.hasPermission("mcmmo.perks.lucky.taming")) {
|
||||
randomChance = (int) (randomChance * 0.75);
|
||||
}
|
||||
|
||||
if (Taming.getRandom().nextInt(randomChance) < eventHandler.skillModifier) {
|
||||
final float chance = (goreChanceMax / goreMaxLevel) * skillLevel;
|
||||
if (chance > Taming.getRandom().nextInt(randomChance)) {
|
||||
eventHandler.modifyEventDamage();
|
||||
eventHandler.applyBleed();
|
||||
eventHandler.sendAbilityMessage();
|
||||
|
Reference in New Issue
Block a user