Added "Master Angler" ability to Fishing.

This ability increases the chance that a fish will bite the line while
fishing.
This commit is contained in:
GJ
2013-04-09 11:32:07 -04:00
parent 7525de1a72
commit 4f87cb6446
7 changed files with 44 additions and 3 deletions

View File

@ -9,6 +9,7 @@ import java.util.Map;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Fish;
import org.bukkit.entity.Item;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
@ -41,6 +42,10 @@ public class FishingManager extends SkillManager {
return target instanceof LivingEntity && getSkillLevel() >= AdvancedConfig.getInstance().getShakeUnlockLevel() && Permissions.shake(getPlayer());
}
public boolean canMasterAngler() {
return Permissions.masterAngler(getPlayer());
}
/**
* Gets the loot tier
*
@ -86,6 +91,10 @@ public class FishingManager extends SkillManager {
return SkillUtils.handleFoodSkills(getPlayer(), skill, eventFoodLevel, Fishing.fishermansDietRankLevel1, Fishing.fishermansDietMaxLevel, rankChange);
}
public void masterAngler(Fish hook) {
hook.setBiteChance(Math.min(hook.getBiteChance() * (getSkillLevel() / 4.0), 1.0));
}
/**
* Process the results from a successful fishing trip
*