mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-24 17:47:44 +01:00
parent
836877ff93
commit
37aebc1716
@ -25,6 +25,7 @@ Version 1.5.01-dev
|
||||
! Changed player data saving. Save tasks are now asynchronous
|
||||
! Vanished players no longer get hit by AoE effects
|
||||
! Changed Alchemy config option 'Prevent_Hopper_Transfer' renamed to 'Prevent_Hopper_Transfer_Ingredients'
|
||||
! Changed Alchemy XP distribution. XP is granted based on the stage of the potion.
|
||||
- Removed salvage ability from Repair, salvage has it's own (child) skill now
|
||||
|
||||
Version 1.5.00
|
||||
|
@ -13,6 +13,7 @@ import com.gmail.nossr50.config.AutoUpdateConfigLoader;
|
||||
import com.gmail.nossr50.datatypes.experience.FormulaType;
|
||||
import com.gmail.nossr50.datatypes.skills.MaterialType;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.alchemy.PotionStage;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
|
||||
public class ExperienceConfig extends AutoUpdateConfigLoader {
|
||||
@ -80,8 +81,10 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
|
||||
*/
|
||||
|
||||
/* Alchemy */
|
||||
if (getPotionXP() <= 0) {
|
||||
reason.add("Experience.Alchemy.Potion should be greater than 0!");
|
||||
for (PotionStage potionStage : PotionStage.values()) {
|
||||
if (getPotionXP(potionStage) < 0) {
|
||||
reason.add("Experience.Alchemy.Potion_Stage_" + potionStage.toNumerical() + " should be at least 0!");
|
||||
}
|
||||
}
|
||||
|
||||
/* Combat XP Multipliers */
|
||||
@ -201,7 +204,7 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
|
||||
public double getFeatherFallXPModifier() { return config.getDouble("Experience.Acrobatics.FeatherFall_Multiplier", 2.0); }
|
||||
|
||||
/* Alchemy */
|
||||
public double getPotionXP() { return config.getDouble("Experience.Alchemy.Potion", 150D); }
|
||||
public double getPotionXP(PotionStage stage) { return config.getDouble("Experience.Alchemy.Potion_Stage_" + stage.toNumerical(), 10D); }
|
||||
|
||||
/* Fishing */
|
||||
public int getFishXp(MaterialData data) {
|
||||
|
@ -0,0 +1,70 @@
|
||||
package com.gmail.nossr50.datatypes.skills.alchemy;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.Potion;
|
||||
|
||||
public enum PotionStage {
|
||||
FIVE(5),
|
||||
FOUR(4),
|
||||
THREE(3),
|
||||
TWO(2),
|
||||
ONE(1);
|
||||
|
||||
int numerical;
|
||||
|
||||
private PotionStage(int numerical) {
|
||||
this.numerical = numerical;
|
||||
}
|
||||
|
||||
public int toNumerical() {
|
||||
return numerical;
|
||||
}
|
||||
|
||||
private static PotionStage getPotionStageNumerical(int numerical) {
|
||||
for (PotionStage potionStage : values()) {
|
||||
if (numerical >= potionStage.toNumerical()) {
|
||||
return potionStage;
|
||||
}
|
||||
}
|
||||
|
||||
return ONE;
|
||||
}
|
||||
|
||||
public static PotionStage getPotionStage(AlchemyPotion input, AlchemyPotion output) {
|
||||
PotionStage potionStage = getPotionStage(output);
|
||||
if (getPotionStage(input) == potionStage) {
|
||||
potionStage = PotionStage.FIVE;
|
||||
}
|
||||
|
||||
return potionStage;
|
||||
}
|
||||
|
||||
public static PotionStage getPotionStage(AlchemyPotion alchemyPotion) {
|
||||
Potion potion = Potion.fromItemStack(new ItemStack(Material.POTION, 1, alchemyPotion.getDataValue()));
|
||||
|
||||
int stage = 1;
|
||||
|
||||
// Check if potion isn't awkward or mundane
|
||||
if (potion.getType() != null) {
|
||||
stage++;
|
||||
}
|
||||
|
||||
// Check if potion has a glowstone dust amplifier
|
||||
if (potion.getLevel() > 1) {
|
||||
stage++;
|
||||
}
|
||||
|
||||
// Check if potion has a redstone dust amplifier
|
||||
if (potion.hasExtendedDuration()) {
|
||||
stage++;
|
||||
}
|
||||
|
||||
// Check if potion has a gunpowder amplifier
|
||||
if (potion.isSplash()) {
|
||||
stage++;
|
||||
}
|
||||
|
||||
return PotionStage.getPotionStageNumerical(stage);
|
||||
}
|
||||
}
|
@ -9,6 +9,7 @@ import com.gmail.nossr50.config.skills.alchemy.PotionConfig;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.XPGainReason;
|
||||
import com.gmail.nossr50.datatypes.skills.alchemy.PotionStage;
|
||||
import com.gmail.nossr50.skills.SkillManager;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
|
||||
@ -64,7 +65,7 @@ public class AlchemyManager extends SkillManager {
|
||||
return Math.min(Alchemy.catalysisMaxSpeed, Alchemy.catalysisMinSpeed + (Alchemy.catalysisMaxSpeed - Alchemy.catalysisMinSpeed) * (skillLevel - Alchemy.catalysisUnlockLevel) / (Alchemy.catalysisMaxBonusLevel - Alchemy.catalysisUnlockLevel)) * (isLucky ? LUCKY_MODIFIER : 1.0);
|
||||
}
|
||||
|
||||
public void handlePotionBrewSuccesses(int amount) {
|
||||
applyXpGain((float) (ExperienceConfig.getInstance().getPotionXP() * amount), XPGainReason.PVE);
|
||||
public void handlePotionBrewSuccesses(PotionStage potionStage, int amount) {
|
||||
applyXpGain((float) (ExperienceConfig.getInstance().getPotionXP(potionStage) * amount), XPGainReason.PVE);
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ import com.gmail.nossr50.config.skills.alchemy.PotionConfig;
|
||||
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
|
||||
import com.gmail.nossr50.datatypes.skills.alchemy.AlchemyPotion;
|
||||
import com.gmail.nossr50.events.fake.FakeBrewEvent;
|
||||
import com.gmail.nossr50.datatypes.skills.alchemy.PotionStage;
|
||||
import com.gmail.nossr50.runnables.player.PlayerUpdateInventoryTask;
|
||||
import com.gmail.nossr50.runnables.skills.AlchemyBrewCheckTask;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
@ -122,7 +123,8 @@ public final class AlchemyPotionBrewer {
|
||||
inventory.setItem(i, output.toItemStack(item.getAmount()).clone());
|
||||
|
||||
if (player != null) {
|
||||
UserManager.getPlayer(player).getAlchemyManager().handlePotionBrewSuccesses(1);
|
||||
PotionStage potionStage = PotionStage.getPotionStage(input, output);
|
||||
UserManager.getPlayer(player).getAlchemyManager().handlePotionBrewSuccesses(potionStage, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +80,17 @@ Experience:
|
||||
# FeatherFall_Multiplier: Multiply Acrobatics XP by this value when wearing boots with the Feather Fall enchant
|
||||
FeatherFall_Multiplier: 2.0
|
||||
Alchemy:
|
||||
Potion: 120
|
||||
# Alchemy potion stages are based on the number of ingredients added
|
||||
# Potion_Stage_1 represents a base potion
|
||||
# Potion_Stage_2 represents a base potion with one ingredient
|
||||
# Potion_Stage_3 represents a base potion with one ingredient and one amplifier
|
||||
# Potion_Stage_4 represents a base potion with one ingredient and two amplifiers
|
||||
# Potion_Stage_5 represents a base potion with one ingredient where the amplifiers are swapped
|
||||
Potion_Stage_1: 15
|
||||
Potion_Stage_2: 30
|
||||
Potion_Stage_3: 60
|
||||
Potion_Stage_4: 120
|
||||
Potion_Stage_5: 0
|
||||
Fishing:
|
||||
Raw_Fish: 800
|
||||
Raw_Salmon: 800
|
||||
|
Loading…
Reference in New Issue
Block a user