2012-06-12 17:07:51 +02:00
|
|
|
package com.gmail.nossr50.skills.taming;
|
2012-03-07 00:48:24 +01:00
|
|
|
|
2013-02-23 00:47:34 +01:00
|
|
|
import org.bukkit.EntityEffect;
|
2013-02-22 23:55:15 +01:00
|
|
|
import org.bukkit.entity.AnimalTamer;
|
2013-03-01 21:49:24 +01:00
|
|
|
import org.bukkit.entity.EntityType;
|
2013-02-22 23:55:15 +01:00
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
import org.bukkit.entity.Tameable;
|
|
|
|
import org.bukkit.entity.Wolf;
|
|
|
|
|
2012-11-21 21:49:54 +01:00
|
|
|
import com.gmail.nossr50.config.AdvancedConfig;
|
2013-08-23 10:16:22 +02:00
|
|
|
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
2013-02-22 23:55:15 +01:00
|
|
|
import com.gmail.nossr50.locale.LocaleLoader;
|
2012-11-21 21:49:54 +01:00
|
|
|
|
2012-03-14 18:33:00 +01:00
|
|
|
public class Taming {
|
2013-01-22 16:48:10 +01:00
|
|
|
public static int environmentallyAwareUnlockLevel = AdvancedConfig.getInstance().getEnviromentallyAwareUnlock();
|
2013-03-01 06:52:01 +01:00
|
|
|
public static int holyHoundUnlockLevel = AdvancedConfig.getInstance().getHolyHoundUnlock();
|
2012-12-24 22:56:25 +01:00
|
|
|
|
2013-03-01 21:49:24 +01:00
|
|
|
public static int fastFoodServiceUnlockLevel = AdvancedConfig.getInstance().getFastFoodUnlock();
|
2013-01-22 16:48:10 +01:00
|
|
|
public static double fastFoodServiceActivationChance = AdvancedConfig.getInstance().getFastFoodChance();
|
2012-06-12 20:42:38 +02:00
|
|
|
|
2013-03-01 21:49:24 +01:00
|
|
|
public static int goreBleedTicks = AdvancedConfig.getInstance().getGoreBleedTicks();
|
2013-03-01 06:52:01 +01:00
|
|
|
public static int goreMaxBonusLevel = AdvancedConfig.getInstance().getGoreMaxBonusLevel();
|
2013-09-12 20:18:13 +02:00
|
|
|
public static double goreModifier = AdvancedConfig.getInstance().getGoreModifier();
|
2013-03-01 21:49:24 +01:00
|
|
|
public static double goreMaxChance = AdvancedConfig.getInstance().getGoreChanceMax();
|
2012-03-26 17:04:17 +02:00
|
|
|
|
2013-09-12 20:18:13 +02:00
|
|
|
public static int sharpenedClawsUnlockLevel = AdvancedConfig.getInstance().getSharpenedClawsUnlock();
|
|
|
|
public static double sharpenedClawsBonusDamage = AdvancedConfig.getInstance().getSharpenedClawsBonus();
|
2012-03-14 18:33:00 +01:00
|
|
|
|
2013-09-12 20:18:13 +02:00
|
|
|
public static int shockProofUnlockLevel = AdvancedConfig.getInstance().getShockProofUnlock();
|
|
|
|
public static double shockProofModifier = AdvancedConfig.getInstance().getShockProofModifier();
|
2012-03-14 18:33:00 +01:00
|
|
|
|
2013-09-12 20:18:13 +02:00
|
|
|
public static int thickFurUnlockLevel = AdvancedConfig.getInstance().getThickFurUnlock();
|
|
|
|
public static double thickFurModifier = AdvancedConfig.getInstance().getThickFurModifier();
|
2013-01-25 02:10:50 +01:00
|
|
|
|
2013-08-23 10:16:22 +02:00
|
|
|
public static int wolfXp = ExperienceConfig.getInstance().getTamingXPWolf();
|
|
|
|
public static int ocelotXp = ExperienceConfig.getInstance().getTamingXPOcelot();
|
2013-08-30 20:25:46 +02:00
|
|
|
public static int horseXp = ExperienceConfig.getInstance().getTamingXPHorse();
|
2013-02-22 23:55:15 +01:00
|
|
|
|
|
|
|
public static boolean canPreventDamage(Tameable pet, AnimalTamer owner) {
|
|
|
|
return pet.isTamed() && owner instanceof Player && pet instanceof Wolf;
|
|
|
|
}
|
|
|
|
|
2013-07-11 18:43:36 +02:00
|
|
|
public static double processThickFur(Wolf wolf, double damage) {
|
2013-02-23 00:47:34 +01:00
|
|
|
wolf.playEffect(EntityEffect.WOLF_SHAKE);
|
2013-02-22 23:55:15 +01:00
|
|
|
return damage / thickFurModifier;
|
|
|
|
}
|
|
|
|
|
2013-02-23 00:47:34 +01:00
|
|
|
public static void processThickFurFire(Wolf wolf) {
|
|
|
|
wolf.playEffect(EntityEffect.WOLF_SMOKE);
|
|
|
|
wolf.setFireTicks(0);
|
|
|
|
}
|
|
|
|
|
2013-07-11 18:43:36 +02:00
|
|
|
public static double processShockProof(Wolf wolf, double damage) {
|
2013-02-23 00:47:34 +01:00
|
|
|
wolf.playEffect(EntityEffect.WOLF_SHAKE);
|
2013-02-22 23:55:15 +01:00
|
|
|
return damage / shockProofModifier;
|
|
|
|
}
|
|
|
|
|
2013-07-11 18:43:36 +02:00
|
|
|
public static void processHolyHound(Wolf wolf, double damage) {
|
|
|
|
double modifiedHealth = Math.min(wolf.getHealth() + damage, wolf.getMaxHealth());
|
2013-02-23 00:47:34 +01:00
|
|
|
|
|
|
|
wolf.setHealth(modifiedHealth);
|
|
|
|
wolf.playEffect(EntityEffect.WOLF_HEARTS);
|
|
|
|
}
|
2013-03-01 21:49:24 +01:00
|
|
|
|
|
|
|
protected static String getCallOfTheWildFailureMessage(EntityType type) {
|
|
|
|
switch (type) {
|
|
|
|
case OCELOT:
|
|
|
|
return LocaleLoader.getString("Taming.Summon.Fail.Ocelot");
|
|
|
|
|
|
|
|
case WOLF:
|
|
|
|
return LocaleLoader.getString("Taming.Summon.Fail.Wolf");
|
2013-09-23 21:24:04 +02:00
|
|
|
|
|
|
|
case HORSE:
|
|
|
|
return LocaleLoader.getString("Taming.Summon.Fail.Horse");
|
2013-03-01 21:49:24 +01:00
|
|
|
|
|
|
|
default:
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
}
|
2012-03-07 00:48:24 +01:00
|
|
|
}
|