diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/load/DefaultMMOLoader.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/load/DefaultMMOLoader.java index 53458d1b..6be9b448 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/load/DefaultMMOLoader.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/load/DefaultMMOLoader.java @@ -35,7 +35,7 @@ public class DefaultMMOLoader extends MMOLoader { if (config.getKey().equals("levelup_skill")) return new LevelUpSkillTrigger(config); - if (config.getKey().equals("skill_buff")) + if (config.getKey().equals("skill_buff")||config.getKey().equals("skill_modifier")) return new SkillModifierTrigger(config); if (config.getKey().equals("message")) diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java index 291b0c6f..c0e3f489 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java @@ -190,7 +190,7 @@ public class PlayerData extends SynchronizedDataHolder implements OfflinePlayerD // Stat triggers setup for (SkillTree skillTree : MMOCore.plugin.skillTreeManager.getAll()) for (SkillTreeNode node : skillTree.getNodes()) - node.getExperienceTable().claimStatTriggers(this, node); + node.getExperienceTable().claimRemovableTrigger(this, node); } public int getPointSpent(SkillTree skillTree) { diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/profess/SavedClassInformation.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/profess/SavedClassInformation.java index b3376f54..4d973de9 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/profess/SavedClassInformation.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/profess/SavedClassInformation.java @@ -345,8 +345,8 @@ public class SavedClassInformation implements ClassDataContainer { // We claim back the stats triggers for all the skill tree nodes of the new class. for (SkillTree skillTree : profess.getSkillTrees()) for (SkillTreeNode node : skillTree.getNodes()) - node.getExperienceTable().claimStatTriggers(player, node); - profess.getExperienceTable().claimStatTriggers(player, profess); + node.getExperienceTable().claimRemovableTrigger(player, node); + profess.getExperienceTable().claimRemovableTrigger(player, profess); // Unload current class information player.unloadClassInfo(profess); diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/quest/trigger/SkillModifierTrigger.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/quest/trigger/SkillModifierTrigger.java index fca38336..817ff2cc 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/quest/trigger/SkillModifierTrigger.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/quest/trigger/SkillModifierTrigger.java @@ -52,7 +52,7 @@ public class SkillModifierTrigger extends Trigger implements Removable { } /** - * Used by skill slots to apply a skillBuff + * Used by skill slots to apply a skill modifier. * to a dynamically chosen skill handler. */ public void apply(PlayerData playerData, SkillHandler skill) { diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/experience/PlayerProfessions.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/experience/PlayerProfessions.java index 1a3b3b44..d442c0c4 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/experience/PlayerProfessions.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/experience/PlayerProfessions.java @@ -103,10 +103,10 @@ public class PlayerProfessions { for (Profession profession : MMOCore.plugin.professionManager.getAll()) { if (profession.hasExperienceTable()) - profession.getExperienceTable().claimStatTriggers(playerData, profession); + profession.getExperienceTable().claimRemovableTrigger(playerData, profession); } if (playerData.getProfess().hasExperienceTable()) - playerData.getProfess().getExperienceTable().claimStatTriggers(playerData, playerData.getProfess()); + playerData.getProfess().getExperienceTable().claimRemovableTrigger(playerData, playerData.getProfess()); } diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/experience/droptable/ExperienceItem.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/experience/droptable/ExperienceItem.java index 5955c390..1abf446f 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/experience/droptable/ExperienceItem.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/experience/droptable/ExperienceItem.java @@ -96,7 +96,7 @@ public class ExperienceItem { * @param professionLevel The profession level the player just reached * @param timesCollected Amount of times the exp item has already been claimed by the player * @return If the item should be claimed right now taking into - * account the randomness factor from the 'chance' parameter + * account the randomness factor from the 'chance' parameter */ public boolean roll(int professionLevel, int timesCollected) { @@ -136,8 +136,8 @@ public class ExperienceItem { * * @param playerData */ - public void applyStatTriggers(PlayerData playerData) { + public void applyRemovableTrigger(PlayerData playerData) { for (Trigger trigger : triggers) - if (trigger instanceof StatTrigger statTrigger) statTrigger.apply(playerData); + if (trigger instanceof Removable) trigger.apply(playerData); } } diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/experience/droptable/ExperienceTable.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/experience/droptable/ExperienceTable.java index ebcbcd91..690c2ba6 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/experience/droptable/ExperienceTable.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/experience/droptable/ExperienceTable.java @@ -80,16 +80,16 @@ public class ExperienceTable { /** - * Called when a player joins and all the statTriggers are all triggered back + * Called when a player joins and all the removable triggers get claimed back. * * @param data PlayerData * @param object Either profession, skillTreeNode or class leveling up */ - public void claimStatTriggers(PlayerData data, ExperienceObject object) { + public void claimRemovableTrigger(PlayerData data, ExperienceObject object) { for (ExperienceItem item : items) { int timesClaimed = data.getClaims(object, this, item); for (int i = 0; i < timesClaimed; i++) - item.applyStatTriggers(data); + item.applyRemovableTrigger(data); } } diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/skill/binding/BoundSkillInfo.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/skill/binding/BoundSkillInfo.java index a06b0d14..db8e2688 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/skill/binding/BoundSkillInfo.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/skill/binding/BoundSkillInfo.java @@ -29,9 +29,9 @@ public class BoundSkillInfo implements Closable { this.playerData = playerData; // Apply skill buffs associated to the slot - for (SkillModifierTrigger skillBuffTrigger : skillSlot.getSkillBuffTriggers()) - if (skillBuffTrigger.getTargetSkills().contains(classSkill.getSkill().getHandler())) - skillBuffTrigger.apply(playerData, classSkill.getSkill().getHandler()); + for (SkillModifierTrigger skillModifierTrigger : skillSlot.getSkillModifierTriggers()) + if (skillModifierTrigger.getTargetSkills().contains(classSkill.getSkill().getHandler())) + skillModifierTrigger.apply(playerData, classSkill.getSkill().getHandler()); if (classSkill.getSkill().getTrigger().isPassive()) { registered = classSkill.toPassive(playerData); @@ -67,6 +67,6 @@ public class BoundSkillInfo implements Closable { if (isPassive()) registered.unregister(playerData.getMMOPlayerData()); // Remove skill buffs associated to the slot - skillSlot.getSkillBuffTriggers().forEach(skillBuffTrigger -> skillBuffTrigger.remove(playerData, classSkill.getSkill().getHandler())); + skillSlot.getSkillModifierTriggers().forEach(skillBuffTrigger -> skillBuffTrigger.remove(playerData, classSkill.getSkill().getHandler())); } } diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/skill/binding/SkillSlot.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/skill/binding/SkillSlot.java index 08f58c90..0bfb11c1 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/skill/binding/SkillSlot.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/skill/binding/SkillSlot.java @@ -22,10 +22,10 @@ public class SkillSlot implements Unlockable { private final boolean isUnlockedByDefault; private final boolean canManuallyBind; - private final List skillBuffTriggers = new ArrayList<>(); + private final List skillModifierTriggers = new ArrayList<>(); private final Material item; - public SkillSlot(int slot, int modelData, String formula, String name, List lore, boolean isUnlockedByDefault, boolean canManuallyBind, List skillBuffTriggers) { + public SkillSlot(int slot, int modelData, String formula, String name, List lore, boolean isUnlockedByDefault, boolean canManuallyBind, List skillModifierTriggers) { this.slot = slot; this.modelData = modelData; this.formula = formula; @@ -34,7 +34,7 @@ public class SkillSlot implements Unlockable { this.item = null; this.canManuallyBind = canManuallyBind; this.isUnlockedByDefault = isUnlockedByDefault; - this.skillBuffTriggers.addAll(skillBuffTriggers); + this.skillModifierTriggers.addAll(skillModifierTriggers); } public SkillSlot(ConfigurationSection section) { @@ -49,7 +49,7 @@ public class SkillSlot implements Unlockable { if (section.contains("skill-buffs")) for (String skillBuff : section.getStringList("skill-buffs")) if (skillBuff.startsWith("skill_buff")) - skillBuffTriggers.add((SkillModifierTrigger) MMOCore.plugin.loadManager.loadTrigger(new MMOLineConfig(skillBuff))); + skillModifierTriggers.add((SkillModifierTrigger) MMOCore.plugin.loadManager.loadTrigger(new MMOLineConfig(skillBuff))); } public int getSlot() { @@ -81,8 +81,8 @@ public class SkillSlot implements Unlockable { return isUnlockedByDefault; } - public List getSkillBuffTriggers() { - return skillBuffTriggers; + public List getSkillModifierTriggers() { + return skillModifierTriggers; } public boolean canManuallyBind() {