From 54ef85e1a3696202688259155bfe1cf225d37117 Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Sat, 12 Jan 2013 23:09:42 +0100 Subject: [PATCH] Fishing in the rain gives you a higher chance of getting magical items! --- .../nossr50/commands/skills/FishingCommand.java | 12 ++++++++++-- .../com/gmail/nossr50/skills/gathering/Fishing.java | 4 ++++ src/main/resources/locale/locale_en_US.properties | 1 + 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java index 6dd34d35f..e12516bf6 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java @@ -16,6 +16,7 @@ public class FishingCommand extends SkillCommand { private int lootTier; private String magicChance; private String magicChanceLucky; + private String chanceRaining; private int shakeUnlockLevel; private String shakeChance; private String shakeChanceLucky; @@ -30,6 +31,7 @@ public class FishingCommand extends SkillCommand { private boolean canShake; private boolean canFishermansDiet; private boolean lucky; + private boolean raining; public FishingCommand() { super(SkillType.FISHING); @@ -37,9 +39,15 @@ public class FishingCommand extends SkillCommand { @Override protected void dataCalculations() { + raining = player.getWorld().hasStorm(); + chanceRaining = ""; //Treasure Hunter lootTier = Fishing.getFishingLootTier(profile); int magicChanceInt = (lootTier * magicHunterMultiplier); + if (raining) { + chanceRaining = LocaleLoader.getString("Fishing.Chance.Raining"); + magicChanceInt = (int) (magicChanceInt * 1.1D); + } magicChance = percent.format(magicChanceInt / 100D); if (magicChanceInt + (magicChanceInt * 0.3333D) >= 100D) magicChanceLucky = percent.format(1D); else magicChanceLucky = percent.format((magicChanceInt + (magicChanceInt * 0.3333D)) / 100D); @@ -107,9 +115,9 @@ public class FishingCommand extends SkillCommand { if (canMagicHunt) { if (lucky) - player.sendMessage(LocaleLoader.getString("Fishing.Enchant.Chance", new Object[] { magicChance }) + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { magicChanceLucky })); + player.sendMessage(LocaleLoader.getString("Fishing.Enchant.Chance", new Object[] { magicChance}) + chanceRaining + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { magicChanceLucky })); else - player.sendMessage(LocaleLoader.getString("Fishing.Enchant.Chance", new Object[] { magicChance })); + player.sendMessage(LocaleLoader.getString("Fishing.Enchant.Chance", new Object[] { magicChance}) + chanceRaining); } if (canShake) { diff --git a/src/main/java/com/gmail/nossr50/skills/gathering/Fishing.java b/src/main/java/com/gmail/nossr50/skills/gathering/Fishing.java index 1a1469beb..8ef2bfeba 100755 --- a/src/main/java/com/gmail/nossr50/skills/gathering/Fishing.java +++ b/src/main/java/com/gmail/nossr50/skills/gathering/Fishing.java @@ -150,6 +150,10 @@ public class Fishing { randomChance = (int) (randomChance * 0.75); } + if (player.getWorld().hasStorm()) { + randomChance = (int) (randomChance * 0.909); + } + /* CHANCE OF ITEM BEING ENCHANTED * 5% - Tier 1 * 10% - Tier 2 diff --git a/src/main/resources/locale/locale_en_US.properties b/src/main/resources/locale/locale_en_US.properties index 0f5bdcb78..5f0ff4bdc 100644 --- a/src/main/resources/locale/locale_en_US.properties +++ b/src/main/resources/locale/locale_en_US.properties @@ -113,6 +113,7 @@ Fishing.Effect.5=Shake items off of mobs w/ fishing pole Fishing.Effect.6=Fisherman's Diet Fishing.Effect.7=Improves hunger restored from fished foods Fishing.Enchant.Chance=[[RED]]Magic Hunter Chance: [[YELLOW]]{0} +Fishing.Chance.Raining=[[BLUE]] Rain Bonus Fishing.ItemFound=[[GRAY]]Treasure found! Fishing.Listener=Fishing: Fishing.MagicFound=[[GRAY]]You feel a touch of magic with this catch...