mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-04 11:03:43 +01:00 
			
		
		
		
	Skill Ceiling removed
This commit is contained in:
		@@ -29,6 +29,8 @@ public class ConfigConstants {
 | 
			
		||||
    public final static String MAX_CHANCE_FIELD_NAME = "Max-Chance";
 | 
			
		||||
    public final static String STATIC_ACTIVATION_FIELD_NAME = "Activation-Chance";
 | 
			
		||||
    public final static String MAX_BONUS_LEVEL_FIELD_NAME = "Max-Bonus-Level";
 | 
			
		||||
    public final static String MAX_BONUS_LEVEL_DESCRIPTION = "This is the level at which full benefits for this skill will be reached." +
 | 
			
		||||
            "\nProperties of this skill may or may not scale with level, but those that do will gradually increase until max level is achieved.";
 | 
			
		||||
    public final static String MAX_BONUS_PERCENTAGE_FIELD_NAME = "Max-Bonus-Percentage";
 | 
			
		||||
    public final static String MAX_CHANCE_FIELD_DESCRIPTION = "The maximum probability for this skill to succeed.";
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -56,7 +56,6 @@ import com.gmail.nossr50.datatypes.party.PartyFeature;
 | 
			
		||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
 | 
			
		||||
import com.gmail.nossr50.datatypes.skills.properties.DamageProperty;
 | 
			
		||||
import com.gmail.nossr50.datatypes.skills.properties.MaxBonusLevel;
 | 
			
		||||
import com.gmail.nossr50.datatypes.skills.properties.SkillCeiling;
 | 
			
		||||
import com.gmail.nossr50.mcMMO;
 | 
			
		||||
import com.gmail.nossr50.skills.repair.repairables.Repairable;
 | 
			
		||||
import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;
 | 
			
		||||
@@ -273,7 +272,6 @@ public final class ConfigManager {
 | 
			
		||||
        customSerializers.registerType(TypeToken.of(MinecraftMaterialWrapper.class), new MinecraftMaterialWrapperSerializer());
 | 
			
		||||
        customSerializers.registerType(TypeToken.of(CustomXPPerk.class), new CustomXPPerkSerializer());
 | 
			
		||||
        customSerializers.registerType(TypeToken.of(DamageProperty.class), new DamagePropertySerializer());
 | 
			
		||||
        customSerializers.registerType(TypeToken.of(SkillCeiling.class), new SkillCeilingSerializer());
 | 
			
		||||
        customSerializers.registerType(TypeToken.of(SkillRankProperty.class), new SkillRankPropertySerializer());
 | 
			
		||||
        customSerializers.registerType(TypeToken.of(MaxBonusLevel.class), new MaxBonusLevelSerializer());
 | 
			
		||||
        customSerializers.registerType(TypeToken.of(PlayerNotificationSettings.class), new PlayerNotificationSerializer());
 | 
			
		||||
 
 | 
			
		||||
@@ -1,31 +0,0 @@
 | 
			
		||||
package com.gmail.nossr50.config.hocon.serializers;
 | 
			
		||||
 | 
			
		||||
import com.gmail.nossr50.datatypes.skills.properties.AbstractSkillCeiling;
 | 
			
		||||
import com.gmail.nossr50.datatypes.skills.properties.SkillCeiling;
 | 
			
		||||
import com.google.common.reflect.TypeToken;
 | 
			
		||||
import ninja.leaping.configurate.ConfigurationNode;
 | 
			
		||||
import ninja.leaping.configurate.objectmapping.ObjectMappingException;
 | 
			
		||||
import ninja.leaping.configurate.objectmapping.serialize.TypeSerializer;
 | 
			
		||||
import org.checkerframework.checker.nullness.qual.NonNull;
 | 
			
		||||
import org.checkerframework.checker.nullness.qual.Nullable;
 | 
			
		||||
 | 
			
		||||
public class SkillCeilingSerializer implements TypeSerializer<SkillCeiling> {
 | 
			
		||||
 | 
			
		||||
    private static final String STANDARD_MAX_LEVEL = "Standard-Max-Level";
 | 
			
		||||
    private static final String RETRO_MAX_LEVEL = "Retro-Max-Level";
 | 
			
		||||
 | 
			
		||||
    @Nullable
 | 
			
		||||
    @Override
 | 
			
		||||
    public SkillCeiling deserialize(@NonNull TypeToken<?> type, @NonNull ConfigurationNode value) throws ObjectMappingException {
 | 
			
		||||
        Integer standardCeiling = value.getNode(STANDARD_MAX_LEVEL).getValue(TypeToken.of(Integer.class));
 | 
			
		||||
        Integer retroCeiling = value.getNode(RETRO_MAX_LEVEL).getValue(TypeToken.of(Integer.class));
 | 
			
		||||
        AbstractSkillCeiling skillCeiling = new AbstractSkillCeiling(standardCeiling, retroCeiling);
 | 
			
		||||
        return skillCeiling;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void serialize(@NonNull TypeToken<?> type, @Nullable SkillCeiling obj, @NonNull ConfigurationNode value) throws ObjectMappingException {
 | 
			
		||||
        value.getNode(STANDARD_MAX_LEVEL).setValue(obj.getStandardMaxLevel());
 | 
			
		||||
        value.getNode(RETRO_MAX_LEVEL).setValue(obj.getRetroMaxLevel());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,9 +1,7 @@
 | 
			
		||||
package com.gmail.nossr50.config.hocon.skills.axes;
 | 
			
		||||
 | 
			
		||||
import com.gmail.nossr50.config.ConfigConstants;
 | 
			
		||||
import com.gmail.nossr50.datatypes.skills.properties.AbstractDamageProperty;
 | 
			
		||||
import com.gmail.nossr50.datatypes.skills.properties.AbstractSkillCeiling;
 | 
			
		||||
import com.gmail.nossr50.datatypes.skills.properties.DamageProperty;
 | 
			
		||||
import com.gmail.nossr50.datatypes.skills.properties.*;
 | 
			
		||||
import ninja.leaping.configurate.objectmapping.Setting;
 | 
			
		||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
 | 
			
		||||
 | 
			
		||||
@@ -16,9 +14,8 @@ public class ConfigAxesCriticalStrikes {
 | 
			
		||||
            "\nA value of 50.0 would mean at most the ability can only have a 50% chance to work at max skill level.")
 | 
			
		||||
    private double maxActivationChance = MAX_ACTIVATION_CHANCE_DEFAULT;
 | 
			
		||||
 | 
			
		||||
    @Setting(value = ConfigConstants.MAX_BONUS_LEVEL_FIELD_NAME, comment = "This is the level at which full benefits for this skill will be reached." +
 | 
			
		||||
            "\nProperties of this skill may or may not scale with level, but those that do will gradually increase until max level is achieved.")
 | 
			
		||||
    private AbstractSkillCeiling maximumProgressionLevel = new AbstractSkillCeiling(100, 1000);
 | 
			
		||||
    @Setting(value = ConfigConstants.MAX_BONUS_LEVEL_FIELD_NAME, comment = ConfigConstants.MAX_BONUS_LEVEL_DESCRIPTION)
 | 
			
		||||
    private AbstractMaxBonusLevel maximumProgressionLevel = new AbstractMaxBonusLevel(100);
 | 
			
		||||
 | 
			
		||||
    @Setting(value = "Damage-Modifiers", comment = "Damage dealt is multiplied by these values when this skill is successfully activated.")
 | 
			
		||||
    private DamageProperty damageProperty = new AbstractDamageProperty(1.5, 2.0);
 | 
			
		||||
@@ -27,10 +24,6 @@ public class ConfigAxesCriticalStrikes {
 | 
			
		||||
        return maxActivationChance;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public AbstractSkillCeiling getMaximumProgressionLevel() {
 | 
			
		||||
        return maximumProgressionLevel;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public DamageProperty getDamageProperty() {
 | 
			
		||||
        return damageProperty;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,5 @@
 | 
			
		||||
package com.gmail.nossr50.config.hocon.skills.axes;
 | 
			
		||||
 | 
			
		||||
import com.gmail.nossr50.datatypes.skills.properties.AbstractSkillCeiling;
 | 
			
		||||
import com.gmail.nossr50.datatypes.skills.properties.DamageProperty;
 | 
			
		||||
import ninja.leaping.configurate.objectmapping.Setting;
 | 
			
		||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
 | 
			
		||||
@@ -26,10 +25,6 @@ public class ConfigAxesSubSkills {
 | 
			
		||||
        return configAxesCriticalStrikes.getMaxActivationChance();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public AbstractSkillCeiling getCriticalStrikesMaximumProgressionLevel() {
 | 
			
		||||
        return configAxesCriticalStrikes.getMaximumProgressionLevel();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public double getGreaterImpactKnockBackModifier() {
 | 
			
		||||
        return configAxesGreaterImpact.getKnockBackModifier();
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -116,9 +116,9 @@ public class SkillPropertiesManager {
 | 
			
		||||
 | 
			
		||||
    private void attemptRegisterMaxBonusLevel(SubSkillType subSkillType, CommentedConfigurationNode childNode) {
 | 
			
		||||
        try {
 | 
			
		||||
            mcMMO.p.getLogger().info("Registering MaxBonusLevel for "+subSkillType.toString());
 | 
			
		||||
            MaxBonusLevel maxBonusLevel = childNode.getValue(TypeToken.of(MaxBonusLevel.class));
 | 
			
		||||
            registerMaxBonusLevel(subSkillType, maxBonusLevel);
 | 
			
		||||
            mcMMO.p.getLogger().info("Registered MaxBonusLevel for "+subSkillType.toString());
 | 
			
		||||
        } catch (ObjectMappingException e) {
 | 
			
		||||
            //This time a silent exception is fine
 | 
			
		||||
        }
 | 
			
		||||
@@ -126,9 +126,9 @@ public class SkillPropertiesManager {
 | 
			
		||||
 | 
			
		||||
    private void attemptRegisterMaxChance(SubSkillType subSkillType, CommentedConfigurationNode childNode) {
 | 
			
		||||
        try {
 | 
			
		||||
            mcMMO.p.getLogger().info("Registering MaxChance for "+subSkillType.toString());
 | 
			
		||||
            Double maxChance = childNode.getValue(TypeToken.of(Double.class));
 | 
			
		||||
            registerMaxChance(subSkillType, maxChance);
 | 
			
		||||
            mcMMO.p.getLogger().info("Registered MaxChance for "+subSkillType.toString());
 | 
			
		||||
        } catch (ObjectMappingException e) {
 | 
			
		||||
            //This time a silent exception is fine
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,23 +0,0 @@
 | 
			
		||||
package com.gmail.nossr50.datatypes.skills.properties;
 | 
			
		||||
 | 
			
		||||
public class AbstractSkillCeiling implements SkillCeiling {
 | 
			
		||||
 | 
			
		||||
    private int standardMaxLevel;
 | 
			
		||||
    private int retroMaxLevel;
 | 
			
		||||
 | 
			
		||||
    public AbstractSkillCeiling(int standardMaxLevel, int retroMaxLevel) {
 | 
			
		||||
        this.standardMaxLevel = standardMaxLevel;
 | 
			
		||||
        this.retroMaxLevel = retroMaxLevel;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public int getRetroMaxLevel() {
 | 
			
		||||
        return retroMaxLevel;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public int getStandardMaxLevel() {
 | 
			
		||||
        return standardMaxLevel;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -1,25 +0,0 @@
 | 
			
		||||
package com.gmail.nossr50.datatypes.skills.properties;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Represents the level at which skill properties for this skill that scale based on level will reach their maximum benefits
 | 
			
		||||
 * If a player is this level or higher, they will have the full-power version of this skill
 | 
			
		||||
 */
 | 
			
		||||
public interface SkillCeiling extends SkillProperty {
 | 
			
		||||
    /**
 | 
			
		||||
     * The maximum level for this skill in Retro
 | 
			
		||||
     * Defaults to 1000
 | 
			
		||||
     * @@return maximum level for this skill in Retro scaling (1-1000)
 | 
			
		||||
     */
 | 
			
		||||
    default int getRetroMaxLevel() {
 | 
			
		||||
        return 1000;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * The maximum level for this skill in Standard
 | 
			
		||||
     * Defaults to 100
 | 
			
		||||
     * @return maximum level for this skill in Standard scaling (1-100)
 | 
			
		||||
     */
 | 
			
		||||
    default int getStandardMaxLevel() {
 | 
			
		||||
        return 100;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user