diff --git a/core/nexus_full_api.py b/core/nexus_full_api.py index 80eb0c0..5b958a2 100644 --- a/core/nexus_full_api.py +++ b/core/nexus_full_api.py @@ -163,8 +163,6 @@ class NexusAttachment(NexusItem): # Get Economy data economy = props.get('Economy', {}) or {} - decay = safe_decimal(economy.get('Decay')) - efficiency = safe_decimal(economy.get('Efficiency')) # Determine attachment type from API type or name api_type = props.get('Type', '').lower() @@ -181,6 +179,16 @@ class NexusAttachment(NexusItem): else: attachment_type = api_type or 'unknown' + # Get decay - absorbers don't have decay, they have absorption + if attachment_type == 'absorber': + decay = Decimal("0") + absorption = safe_decimal(economy.get('Absorption')) + else: + decay = safe_decimal(economy.get('Decay')) + absorption = Decimal("0") + + efficiency = safe_decimal(economy.get('Efficiency')) + # Parse based on attachment type damage_bonus = Decimal("0") range_bonus = Decimal("0") diff --git a/ui/attachment_selector.py b/ui/attachment_selector.py index 420d491..e3cb006 100644 --- a/ui/attachment_selector.py +++ b/ui/attachment_selector.py @@ -251,8 +251,12 @@ class AttachmentSelectorDialog(QDialog): zoom_text = "-" item.setText(4, zoom_text) - # Column 5: Decay (in PEC) - item.setText(5, f"{att.decay:.3f}") + # Column 5: Decay (in PEC) or Absorption + if att.attachment_type == 'absorber' and att.absorption > 0: + decay_text = f"{att.absorption * 100:.0f}%" + else: + decay_text = f"{att.decay:.3f}" + item.setText(5, decay_text) # Column 6: Efficiency % if att.efficiency_bonus > 0: @@ -358,8 +362,13 @@ class AttachmentSelectorDialog(QDialog): self.preview_absorption.setText("-") self.preview_absorption.setStyleSheet("") - # Decay - self.preview_decay.setText(f"{attachment.decay:.4f} PEC") + # Decay or Absorption + if attachment.attachment_type == 'absorber' and attachment.absorption > 0: + self.preview_decay.setText(f"{attachment.absorption * 100:.1f}% absorption") + self.preview_decay.setStyleSheet("color: #9c27b0;") + else: + self.preview_decay.setText(f"{attachment.decay:.4f} PEC") + self.preview_decay.setStyleSheet("") # Efficiency if attachment.efficiency_bonus > 0: