From b9b04c2b9f3b05517ea6dd9796fc8e721dcabfc0 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Fri, 15 Mar 2024 11:25:19 -0400 Subject: [PATCH] More itembase refactor work --- src/engine/objects/AbstractCharacter.java | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/engine/objects/AbstractCharacter.java b/src/engine/objects/AbstractCharacter.java index 9ac52c58..18f0f63e 100644 --- a/src/engine/objects/AbstractCharacter.java +++ b/src/engine/objects/AbstractCharacter.java @@ -982,29 +982,31 @@ public abstract class AbstractCharacter extends AbstractWorldObject { public final float getRange() { - // Treb range does not appear to be set here - // what gives? - - if (this.getObjectType() == GameObjectType.Mob) { + Mob mob = (Mob) this; + if (mob.isSiege()) { return 300; } float range = 8; if (((Mob) this).getEquip().get(1) != null) { - range = ((Mob) this).getEquip().get(1).getItemBase().getRange(); + range = ((Mob) this).getEquip().get(1).template.item_weapon_max_range; } else if (((Mob) this).getEquip().get(2) != null) { - range = ((Mob) this).getEquip().get(2).getItemBase().getRange(); + range = ((Mob) this).getEquip().get(2).template.item_weapon_max_range; } - if (range > 80) { + + // TODO Is this clamp from live? + + if (range > 80) range = 80; - } + return range; } - if (this.rangeHandOne > this.rangeHandTwo) { + + if (this.rangeHandOne > this.rangeHandTwo) return this.rangeHandOne; - } + return this.rangeHandTwo; }