Cleanup of value handling

This commit is contained in:
2024-03-27 13:09:35 -04:00
parent 063f3081b5
commit a1f233723f
2 changed files with 14 additions and 4 deletions
+13 -3
View File
@@ -1152,10 +1152,20 @@ public class Item extends AbstractWorldObject {
*/
public int getValue() {
if (this.flags.contains(ItemFlags.Identified))
return this.magicValue;
int modifiedValue;
return this.value;
if (this.flags.contains(ItemFlags.Identified))
modifiedValue = this.magicValue;
else
modifiedValue = this.value;
if (this.template.item_initial_charges > 0)
modifiedValue = modifiedValue * (this.chargesRemaining / this.template.item_initial_charges);
if (this.template.combat_health_full > 0)
modifiedValue = (int) (modifiedValue * (this.combat_health_current / this.template.combat_health_full));
return modifiedValue;
}
/**