Removing traps from fishing command

This commit is contained in:
nossr50 2019-01-27 20:27:48 -08:00
parent 67a57f7472
commit b2b623505d
7 changed files with 10 additions and 12 deletions

View File

@ -15,6 +15,8 @@ Version 2.1.2
(Skills) Fixed a bug where Salvage didn't calculate success and failure correctly (Skills) Fixed a bug where Salvage didn't calculate success and failure correctly
(Skills) Fixed a bug where Flux Mining didn't calculate success correctly (Skills) Fixed a bug where Flux Mining didn't calculate success correctly
(Skills) Tree Feller now works on Mushroom Stems (Skills) Tree Feller now works on Mushroom Stems
(Skills) Fixed a bug where magic chance would show as null
(Skills) Fixed a bug where Trap percentages were added to Fishing even though they no longer exist
(Experience) Wood blocks now give XP and are affected by Tree Feller (6 sided bark blocks) (Experience) Wood blocks now give XP and are affected by Tree Feller (6 sided bark blocks)
(API) Moved XPGainReason from skills to experience package (API) Moved XPGainReason from skills to experience package
(API) Added XpGainSource for tracking sources of XP (API) Added XpGainSource for tracking sources of XP

View File

@ -58,7 +58,6 @@ public class FishingCommand extends SkillCommand {
lootTier = fishingManager.getLootTier(); lootTier = fishingManager.getLootTier();
// Item drop rates // Item drop rates
trapTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.TRAP) / 100.0);
commonTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.COMMON) / 100.0); commonTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.COMMON) / 100.0);
uncommonTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.UNCOMMON) / 100.0); uncommonTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.UNCOMMON) / 100.0);
rareTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.RARE) / 100.0); rareTreasure = percent.format(TreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.RARE) / 100.0);
@ -70,7 +69,7 @@ public class FishingCommand extends SkillCommand {
double totalEnchantChance = 0; double totalEnchantChance = 0;
for (Rarity rarity : Rarity.values()) { for (Rarity rarity : Rarity.values()) {
if (rarity != Rarity.TRAP && rarity != Rarity.RECORD) { if (rarity != Rarity.RECORD) {
totalEnchantChance += TreasureConfig.getInstance().getEnchantmentDropRate(lootTier, rarity); totalEnchantChance += TreasureConfig.getInstance().getEnchantmentDropRate(lootTier, rarity);
} }
} }
@ -78,7 +77,7 @@ public class FishingCommand extends SkillCommand {
if(totalEnchantChance > 0) if(totalEnchantChance > 0)
magicChance = percent.format(totalEnchantChance / 100.0); magicChance = percent.format(totalEnchantChance / 100.0);
else else
magicChance = percent.format(magicChance); magicChance = percent.format(0);
} }
// FISHING_SHAKE // FISHING_SHAKE
@ -153,7 +152,6 @@ public class FishingCommand extends SkillCommand {
if (canTreasureHunt) { if (canTreasureHunt) {
messages.add(getStatMessage(false, true, SubSkillType.FISHING_TREASURE_HUNTER, String.valueOf(lootTier), String.valueOf(RankUtils.getHighestRank(SubSkillType.FISHING_TREASURE_HUNTER)))); messages.add(getStatMessage(false, true, SubSkillType.FISHING_TREASURE_HUNTER, String.valueOf(lootTier), String.valueOf(RankUtils.getHighestRank(SubSkillType.FISHING_TREASURE_HUNTER))));
messages.add(getStatMessage(true, true, SubSkillType.FISHING_TREASURE_HUNTER, messages.add(getStatMessage(true, true, SubSkillType.FISHING_TREASURE_HUNTER,
String.valueOf(trapTreasure),
String.valueOf(commonTreasure), String.valueOf(commonTreasure),
String.valueOf(uncommonTreasure), String.valueOf(uncommonTreasure),
String.valueOf(rareTreasure), String.valueOf(rareTreasure),

View File

@ -58,7 +58,7 @@ public class TreasureConfig extends ConfigLoader {
double enchantDropRate = config.getDouble("Enchantment_Drop_Rates." + tier + "." + rarity.toString()); double enchantDropRate = config.getDouble("Enchantment_Drop_Rates." + tier + "." + rarity.toString());
double itemDropRate = config.getDouble("Item_Drop_Rates." + tier + "." + rarity.toString()); double itemDropRate = config.getDouble("Item_Drop_Rates." + tier + "." + rarity.toString());
if ((enchantDropRate < 0.0 || enchantDropRate > 100.0) && rarity != Rarity.TRAP && rarity != Rarity.RECORD) { if ((enchantDropRate < 0.0 || enchantDropRate > 100.0) && rarity != Rarity.RECORD) {
reason.add("The enchant drop rate for " + tier + " items that are " + rarity.toString() + "should be between 0.0 and 100.0!"); reason.add("The enchant drop rate for " + tier + " items that are " + rarity.toString() + "should be between 0.0 and 100.0!");
} }
@ -311,7 +311,7 @@ public class TreasureConfig extends ConfigLoader {
private void loadEnchantments() { private void loadEnchantments() {
for (Rarity rarity : Rarity.values()) { for (Rarity rarity : Rarity.values()) {
if (rarity == Rarity.TRAP || rarity == Rarity.RECORD) { if (rarity == Rarity.RECORD) {
continue; continue;
} }

View File

@ -6,8 +6,7 @@ public enum Rarity {
EPIC, EPIC,
RARE, RARE,
UNCOMMON, UNCOMMON,
COMMON, COMMON;
TRAP;
public static Rarity getRarity(String string) { public static Rarity getRarity(String string) {
try { try {

View File

@ -67,7 +67,7 @@ public class FishingManager extends SkillManager {
long currentTime = System.currentTimeMillis(); long currentTime = System.currentTimeMillis();
boolean hasFished = (currentTime < fishingTimestamp + (FISHING_COOLDOWN_SECONDS * 10)); boolean hasFished = (currentTime < fishingTimestamp + (FISHING_COOLDOWN_SECONDS * 10));
if(hasFished == true) if(hasFished)
fishingTimestamp = currentTime; fishingTimestamp = currentTime;
Location targetLocation = targetBlock.getLocation(); Location targetLocation = targetBlock.getLocation();
@ -421,7 +421,7 @@ public class FishingManager extends SkillManager {
double diceRoll = Misc.getRandom().nextDouble() * 100; double diceRoll = Misc.getRandom().nextDouble() * 100;
for (Rarity rarity : Rarity.values()) { for (Rarity rarity : Rarity.values()) {
if (rarity == Rarity.TRAP || rarity == Rarity.RECORD) { if (rarity == Rarity.RECORD) {
continue; continue;
} }

View File

@ -6,7 +6,6 @@ import com.gmail.nossr50.datatypes.experience.XPGainSource;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.events.skills.secondaryabilities.SubSkillRandomCheckEvent;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.skills.SkillManager;

View File

@ -224,7 +224,7 @@ Fishing.Ability.Locked.2=LOCKED UNTIL {0}+ SKILL (MASTER ANGLER)
Fishing.SubSkill.TreasureHunter.Name=Treasure Hunter Fishing.SubSkill.TreasureHunter.Name=Treasure Hunter
Fishing.SubSkill.TreasureHunter.Description=Fish up misc. objects Fishing.SubSkill.TreasureHunter.Description=Fish up misc. objects
Fishing.SubSkill.TreasureHunter.Stat=Treasure Hunter Rank: [[GREEN]]{0}[[DARK_AQUA]]/[[GREEN]]{1} Fishing.SubSkill.TreasureHunter.Stat=Treasure Hunter Rank: [[GREEN]]{0}[[DARK_AQUA]]/[[GREEN]]{1}
Fishing.SubSkill.TreasureHunter.Stat.Extra=Drop Rate: [[DARK_RED]]Trap: [[YELLOW]]{0} [[GRAY]]Common: [[YELLOW]]{1} [[GREEN]]Uncommon: [[YELLOW]]{2}\n[[BLUE]]Rare: [[YELLOW]]{3} [[LIGHT_PURPLE]]Epic: [[YELLOW]]{4} [[GOLD]]Legendary: [[YELLOW]]{5} [[AQUA]]Record: [[YELLOW]]{6} Fishing.SubSkill.TreasureHunter.Stat.Extra=Drop Rate: [[GRAY]]Common: [[YELLOW]]{1} [[GREEN]]Uncommon: [[YELLOW]]{2}\n[[BLUE]]Rare: [[YELLOW]]{3} [[LIGHT_PURPLE]]Epic: [[YELLOW]]{4} [[GOLD]]Legendary: [[YELLOW]]{5} [[AQUA]]Record: [[YELLOW]]{6}
Fishing.SubSkill.MagicHunter.Name=Magic Hunter Fishing.SubSkill.MagicHunter.Name=Magic Hunter
Fishing.SubSkill.MagicHunter.Description=Find Enchanted Items Fishing.SubSkill.MagicHunter.Description=Find Enchanted Items
Fishing.SubSkill.MagicHunter.Stat=Magic Hunter Chance Fishing.SubSkill.MagicHunter.Stat=Magic Hunter Chance