Added boosts to Fishing chance depending on conditions. Also, the

kraken, now with 100% more sound!
This commit is contained in:
GJ
2013-05-01 21:57:42 -04:00
parent 5c026be0cd
commit e7c749ee3a
5 changed files with 47 additions and 4 deletions

View File

@ -7,6 +7,7 @@ import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.WeatherType;
import org.bukkit.World;
import org.bukkit.block.Biome;
@ -81,7 +82,8 @@ public class FishingManager extends SkillManager {
world.strikeLightningEffect(location);
world.strikeLightningEffect(location);
player.sendMessage("THE KRAKEN HAS BEEN UNLEASHED!");
mcMMO.p.getServer().broadcastMessage(player.getDisplayName() + ChatColor.RED + "has unleashed the kraken!");
world.playSound(location, Sound.GHAST_SCREAM, Misc.GHAST_VOLUME, Misc.getGhastPitch());
mcMMO.p.getServer().broadcastMessage(player.getDisplayName() + ChatColor.RED + " has unleashed the kraken!");
Squid kraken = (Squid) world.spawnEntity(player.getEyeLocation(), EntityType.SQUID);
kraken.setCustomName("The Kraken");
@ -187,7 +189,19 @@ public class FishingManager extends SkillManager {
}
public void masterAngler(Fish hook) {
hook.setBiteChance(Math.min(hook.getBiteChance() * Math.max((getSkillLevel() / 200.0), 1.0), 1.0));
Player player = getPlayer();
Biome biome = player.getLocation().getBlock().getBiome();
double biteChance = Math.min(hook.getBiteChance() * Math.max((getSkillLevel() / 200.0), 1.0), 1.0);
if (biome == Biome.RIVER || biome == Biome.OCEAN) {
biteChance = biteChance * 2.0;
}
if (player.isInsideVehicle() && player.getVehicle().getType() == EntityType.BOAT) {
biteChance = biteChance * 2.0;
}
hook.setBiteChance(biteChance);
}
/**