From eb621f184d601272faa3737570e23569db5b3bb5 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Thu, 28 Mar 2024 03:24:57 -0400 Subject: [PATCH] Update to skill_used logic --- src/engine/objects/AbstractCharacter.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/engine/objects/AbstractCharacter.java b/src/engine/objects/AbstractCharacter.java index ebe2cf92..2e41cd1e 100644 --- a/src/engine/objects/AbstractCharacter.java +++ b/src/engine/objects/AbstractCharacter.java @@ -956,25 +956,23 @@ public abstract class AbstractCharacter extends AbstractWorldObject { if (armor.template.item_skill_used.isEmpty()) return ib.item_defense_rating; - if(armor.template.item_skill_used.length() < 1){ - return ib.item_defense_rating; - } - CharacterSkill armorSkill = playerCharacter.skills.get(armor.template.item_skill_used); - if (armorSkill == null) { + + if (playerCharacter.getObjectType().equals(GameObjectType.PlayerCharacter) && armorSkill == null) { Logger.error("Player " + playerCharacter.getObjectUUID() + " has armor equipped without the nescessary skill to equip it"); return ib.item_defense_rating; } float def = ib.item_defense_rating; + //apply item defense bonuses + if (armor != null) { def += armor.getBonus(ModType.DR, SourceType.NONE); def *= (1 + armor.getBonusPercent(ModType.DR, SourceType.NONE)); } - return (def * (1 + ((int) armorSkill.getModifiedAmount() / 50f))); }