Commit Graph

242 Commits

Author SHA1 Message Date
LemonNexus c7c16f65db fix: add missing Any import to armor_system.py 2026-02-09 20:17:06 +00:00
LemonNexus ff2ae329c1 fix: add safe decimal conversion to armor_system from_dict methods
- ProtectionProfile.from_dict now handles int/float/Decimal/string values
- ArmorPlate.from_dict uses safe_decimal for block_chance
- ArmorPiece.from_dict uses safe_decimal for decay_per_hp and weight
- Prevents 'Decimal + str' type errors when loading saved loadouts
2026-02-09 19:33:05 +00:00
LemonNexus a0211a8425 fix: handle both NexusArmorSet and ArmorSet types in _on_equip_full_set
- Check if pieces is a list (NexusArmorSet) or dict (ArmorSet)
- Route to API method for NexusArmorSet
- Keep hardcoded logic for ArmorSet from combo box
2026-02-09 19:30:48 +00:00
LemonNexus 32cebbc001 debug: add detailed debug info to armor set equip popup
- Shows set protection values (Impact, Cut, Stab, etc.)
- Shows each piece's assigned total protection
- Shows first equipped piece's actual protection value
- Helps trace where protection is getting lost
2026-02-09 19:28:27 +00:00
LemonNexus 343142162f fix: correct _on_armor_changed to handle NexusArmorSet type
- NexusArmorSet.pieces is List[str], not Dict
- Removed code that tried to call .items() on the list
- Now simply clears current_armor_set when pieces are modified
2026-02-09 19:27:09 +00:00
LemonNexus fa427188d9 fix: add error handling and validation to LoadoutConfig.from_dict
- Added try/except with logging around from_dict
- Added validation for armor_plates to handle non-dict values
- Added error handling for Decimal/int conversions
- Better error messages to diagnose loading issues
2026-02-09 19:25:56 +00:00
LemonNexus d265bc2113 debug: add logging to trace armor calculation issue
- Added debug logging to _get_current_config to see pieces found
- Added debug logging to _update_calculations to see equipped armor state
- This will help diagnose why armor shows 0 protection
2026-02-09 19:20:01 +00:00
LemonNexus 22b4e6e8bb fix(api): use armor set's total protection for each piece
- API returns 0 protection for individual armor pieces
- Protection values are only at the armor set level (Defense field)
- Now each piece gets the full set protection values assigned
- Removed equip_full_set call with wrong type (NexusArmorSet vs ArmorSet)
- Individual pieces now have correct protection for calculations
2026-02-09 19:16:55 +00:00
LemonNexus 437f6b3027 fix(ui): properly update ArmorSlotWidget UI when setting piece from API
- Fixed set_piece() to use protection_label instead of non-existent piece_name_label
- Now updates protection display when piece is set
- Adds piece to combo if not already present
- Properly stores current_piece and calls _update_total()
2026-02-09 19:08:35 +00:00
LemonNexus a349a85cbe fix(ui): use Decimal for armor decay calculation to avoid type error
- Fixed: Decimal * float is not supported
- Now using Decimal for all operands in decay calculation
2026-02-09 19:04:21 +00:00
LemonNexus 297552fd1c fix(ui): improve armor set piece slot detection
- Added name-based slot detection as fallback when Type field doesn't match
- Added more slot mapping variations (chest, armguards, thighguards, etc.)
- Added _get_slot_from_name() helper for name-based detection
- Now correctly equips all 7 pieces of armor sets like Frontier Adjusted
2026-02-09 19:01:23 +00:00
LemonNexus 4375a00f0f fix(api): correct NexusArmorSet parser for actual API structure
- Fixed field name: API uses 'Armors' not 'Pieces'
- Fixed protection location: API uses 'Defense' not per-piece protection
- Armors is array of arrays, now properly flattened
- Added set bonus parsing from EffectsOnSetEquip
2026-02-09 18:55:38 +00:00
LemonNexus f2d1162d27 fix(ui): correct attribute name for armor slots in loadout manager
- Changed self.armor_slots to self.slot_widgets to match actual attribute name
- Fixes AttributeError when selecting full armor sets
2026-02-09 18:52:00 +00:00
LemonNexus 3bdf86ab4c fix(api): handle absorber-specific fields (absorption instead of decay)
- Absorbers don't have Decay in Economy, only Absorption
- Updated parser to set decay=0 and absorption from Economy.Absorption for absorbers
- Updated UI to show absorption % in Decay column for absorbers
- Updated preview panel to display absorption for absorbers
2026-02-09 17:16:29 +00:00
LemonNexus 7f1e111a83 fix(ui): remove attachment_type overwrite in loader to preserve parsed type
- Removed code that was overwriting attachment_type for all items
- Type is now correctly parsed from API (scope vs sight)
- Sights tab now correctly shows items with Type='Sight'
2026-02-09 17:14:47 +00:00
LemonNexus c7afde4d41 chore: remove debug script 2026-02-09 17:12:58 +00:00
LemonNexus e8f0d7860e fix(api): correct attachment field parsing for all attachment types
- Fixed NexusAttachment.from_api() to parse correct API structure:
  - Amplifiers: Damage values from Properties.Damage
  - Scopes: Skill bonuses from Properties.SkillModification/SkillBonus, zoom from Properties.Zoom
  - Absorbers: Absorption from Economy.Absorption
- Added zoom and absorption fields to NexusAttachment
- Updated attachment selector UI to show type-specific columns
- Added zoom and absorption to preview panel
2026-02-09 17:12:44 +00:00
LemonNexus 4ef03d96c8 fix(api): improve NexusAttachment field parsing for weapon amplifiers
- Updated from_api() to check multiple possible field names
- Added fallback checks for Damage, Range, Decay, Efficiency fields
- Type detection from both API Type field and item name
- Improved display formatting in attachment selector
2026-02-09 17:07:31 +00:00
LemonNexus 1be69b1879 feat(ui): add armor set selection to armor selector
- Added tabs to ArmorSelectorDialog: Individual Pieces and Full Sets
- Armor sets show total protection across all 7 pieces
- Selecting a full set auto-populates all 7 armor slots in loadout manager
- Added armor_set_selected signal for full set selection
- Shows summary of equipped pieces and any missing ones
2026-02-09 17:04:21 +00:00
LemonNexus 1ba8acb7e2 feat(db): add database migration script for loadout support
- migrate_db.py adds loadout_id, mindforce_cost_ped, hits_taken, heals_used columns
- Creates loadouts table if not exists
- Updates schema version to 3
2026-02-09 16:55:38 +00:00
LemonNexus 1b176b96a8 feat(hud): integrate loadout-based cost tracking in HUD
- Added LoadoutSelectionDialog for choosing loadout when starting session
- Added set_cost_tracker() method to HUDOverlay for SessionCostTracker integration
- Added new display row for loadout metrics: $/shot, $/hit, $/heal, hits, heals
- Added mindforce cost support
- Updated start_session() to accept loadout_id and per-action costs
- Updated _refresh_display() to show new cost metrics
2026-02-09 16:14:51 +00:00
LemonNexus af624b26e0 feat(core): add loadout-session integration and cost tracking
- Added loadouts table to schema with full gear configuration
- Created LoadoutDatabase for CRUD operations on loadouts
- Created SessionCostTracker for real-time cost tracking based on loadout
- Added cost per shot/hit/heal tracking to HUDStats
- Added mindforce cost support throughout
- Database schema updated with loadout_id foreign key in hunting_sessions
2026-02-09 16:11:15 +00:00
LemonNexus b58af87533 feat(loadout): add mindforce implant field and tier-based enhancers to LoadoutConfig
- Added mindforce_implant and mindforce_decay_pec fields
- Changed enhancers from list to Dict[int, NexusEnhancer] for tier-based system
- Updated get_total_decay_per_shot() to include enhancer and mindforce decay
- Max 10 tiers, 1 enhancer per tier
2026-02-09 16:01:16 +00:00
LemonNexus 1e115db548 feat(ui): add armor set and mindforce implant selectors
- Created ArmorSetSelectorDialog for browsing full armor sets
- Created MindforceImplantSelectorDialog for MF chips/implants
- Both dialogs integrate with Entropia Nexus API
- Filter by type, search, and preview functionality included
2026-02-09 15:59:29 +00:00
LemonNexus 6bcd0ca799 feat(api): add armor sets and mindforce implants endpoints
- Added NexusArmorSet dataclass with pieces list and total protection
- Added NexusMindforceImplant dataclass for MF chips/implants
- Added get_all_armor_sets() method using /armorsets endpoint
- Added get_all_mindforce_implants() method using /mindforceimplants endpoint
- Added cache variables for both new endpoints
2026-02-09 15:55:55 +00:00
LemonNexus a5f286a76b fix(ui): update attachment selector to use new API endpoints
- Updated AttachmentLoaderThread to fetch from separate endpoints:
  - /weaponamplifiers for amplifiers
  - /weaponvisionattachments for scopes
  - /absorbers for absorbers
- Fixed get_all_attachments() AttributeError
2026-02-09 15:49:11 +00:00
LemonNexus b8fc0a8033 fix(api): fix NexusPlate dataclass - add missing protection_acid and protection_electric fields
- Added protection_acid and protection_electric to NexusPlate dataclass
- Updated hardcoded plates to use individual protection fields
- Fixed plate selector crash when sorting by protection
2026-02-09 15:47:53 +00:00
LemonNexus cf95732fff fix(api): update endpoints to match Entropia Nexus API structure
- Plates: /plates → /armorplatings
- Absorbers: Now using /absorbers (was /attachments)
- Amplifiers: Now using /weaponamplifiers (was /attachments)
- Scopes: Now using /weaponvisionattachments (was /attachments)
- Healing: Now fetches both /medicaltools AND /medicalchips

Added separate cache variables and methods for:
- _absorbers_cache, get_all_absorbers()
- _amplifiers_cache, get_all_amplifiers()
- _scopes_cache, get_all_scopes()
- _healing_chips_cache, get_all_healing_chips()
2026-02-09 15:35:54 +00:00
LemonNexus c38d577675 feat(api): add hardcoded plates data since API lacks plates endpoint
Added 20 common armor plates organized by protection type:
- Impact plates (Mk. 5B, 10A, 25A, 50A)
- Cut/Stab plates (Mk. 5C, 10C, 25C, 50C)
- Elemental plates (Electric, Burn, Acid, Cold)
- Shrapnel plates (Mk. 10S, 25S)
- Penetration plates (Mk. 10P, 25P)

Plates selector now works with fallback data.
2026-02-09 15:29:18 +00:00
LemonNexus cdadb7f081 fix(api): correct healing tools parser to use MaxHeal/MinHeal fields
API uses MaxHeal and MinHeal directly in Properties (not nested Heal object).
Parser now correctly reads heal amounts and calculates economy.
Also added type detection for chips vs FAPs based on item name.
2026-02-09 15:27:09 +00:00
LemonNexus 09e07984a0 fix(calc): correct PEC to PED conversion for cost/shot display
Cost per shot was showing PEC values labeled as PED (100x too high).
Now properly converts PEC to PED by dividing by 100 before display.

Before: 916.80 PEC displayed as 9.1680 PED (wrong)
After: 916.80 PEC displayed as 0.0917 PED (correct)
2026-02-09 15:12:39 +00:00
LemonNexus bd6abd60c2 refactor(ui): replace per-hour metrics with per-action cost metrics
Removed confusing per-hour calculations and replaced with practical
per-action metrics that players actually need:

New Metrics Displayed:
- ⚔️ Weapon: Cost/Shot (PED), DPS, DPP
- 🛡️ Armor: Cost/Hit (PED), Protection
- 💚 Healing: Cost/Heal (PED), HP/PEC

Removed:
- Activity Settings section (Shots/Hour, Hits/Hour, Heals/Hour)
- Per-hour cost calculations

The Break-Even calculator remains based on mob HP.

These metrics represent actual costs per action taken:
- Each shot fired costs X PED
- Each hit taken costs Y PED
- Each heal used costs Z PED

Much more intuitive for tracking hunt profitability.
2026-02-09 15:02:56 +00:00
LemonNexus 2183b79ce8 feat(ui): add separate Left/Right ring slots in loadout manager
- Split accessories section into Left Ring and Right Ring selectors
- Added Clothing and Pet buttons
- Updated AccessoriesSelectorDialog to accept slot_filter parameter
- Filter rings by Left Finger/Right Finger slot when selecting
- Store current_left_ring and current_right_ring in loadout
- Display ring effects (multi-effect support) in the UI

Ring effects like 'Decreased Critical Damage Taken 4%, Increased
Dodge Chance 4%' are now properly displayed.
2026-02-09 14:46:35 +00:00
LemonNexus 1db965f92a fix(ui): update ring selection to use effects dict
Fixed AttributeError in _on_ring_selected - NexusRing now uses
effects dict instead of effect_type/effect_value fields.
2026-02-09 14:39:50 +00:00
LemonNexus 9decd0ba5d fix(api): handle null/None values in API parsing
Added safe_decimal() helper to handle None/empty values from API
that were causing decimal.ConversionSyntax errors.

Fixed parsers:
- NexusHealingTool: Uses safe_decimal for decay/heal amounts
- NexusRing: Uses safe_decimal for max_tt/min_tt
- NexusClothing: Safely handles None buff values

Errors were occurring when API returned null for numeric fields
instead of 0.
2026-02-09 14:35:12 +00:00
LemonNexus ad3d8e535a fix(api): correct rings endpoint to /clothings with Type=Ring filter
- Changed endpoint from /rings to /clothings (correct plural form)
- Filter clothings for Type=Ring to get actual ring data
- Updated NexusRing dataclass to match API structure:
  - slot: 'Left Finger', 'Right Finger'
  - gender: 'Both', 'Male', 'Female'
  - effects: Dict of effect name -> value
  - max_tt/min_tt: PED values from Economy
- Updated UI to display effects dict properly
- Maintained hardcoded fallback
2026-02-09 14:28:14 +00:00
LemonNexus 366104b5a6 feat(api): add hardcoded ring data since API lacks rings endpoint
Added 20 common rings (Ares, Hermetic, Courage, Perseus, Zeus, Apollo,
Artemis, Hephaestus, Aphrodite, Dionysus) with Limited variants.
Fallback when /rings endpoint returns 404.
2026-02-09 14:20:54 +00:00
LemonNexus 032245ccad fix(ui): emit LoadoutConfig object instead of just name
The loadout_saved signal was emitting a string (loadout name) but
on_loadout_selected expected an object with .name attribute.
Now emits the full LoadoutConfig so all gear data is available.
2026-02-09 14:18:19 +00:00
LemonNexus 499c4c7383 fix(ui): show message when rings/clothing API data unavailable
The Entropia Nexus API doesn't have /rings or /clothing endpoints (404).
Added placeholder messages in the accessories selector instead of showing
empty lists. Pets endpoint works correctly (84 pets loaded).
2026-02-09 14:17:06 +00:00
LemonNexus 4d7d4e7545 fix(ui): add missing QComboBox import in accessories_selector.py
Selector dialog was failing to open due to NameError on QComboBox.
2026-02-09 14:14:02 +00:00
LemonNexus 36bc075e95 fix(armor): correct decay_per_hit to decay_per_hp field name
Fixed AttributeError where code was referencing non-existent 'decay_per_hit'
instead of the correct 'decay_per_hp' field on ArmorPiece and ArmorPlate.

- ui/loadout_manager.py: _get_current_config() plate/piece copy
- core/armor_system.py: equip_armor_selection() piece copy
2026-02-09 14:13:07 +00:00
LemonNexus a903a65275 fix(api): fix remaining lowercase fields in NexusWeapon 2026-02-09 14:07:44 +00:00
LemonNexus 27c3e5ad6e fix(api): use TitleCase for API field names (Id, Name, Properties)
- Nexus API returns TitleCase keys, not lowercase
- Fixed all from_api() methods to use correct case
- Armor, Healing, Plate, Attachment, Enhancer, Ring, Clothing, Pet
2026-02-09 14:05:56 +00:00
LemonNexus d9921993c8 fix(ui): remove non-existent AttachmentManagerWidget from imports 2026-02-09 13:44:59 +00:00
LemonNexus 48bce51d0f fix(loadout): add missing Nexus imports
- NexusAttachment, NexusEnhancer, NexusRing, NexusClothing, NexusPet
2026-02-09 13:08:01 +00:00
LemonNexus ad9cd2cd4c fix(loadout): remove leftover code causing indentation error
- Removed old attachment selection dialog code
- Fixed _on_attach() method
2026-02-09 13:06:05 +00:00
LemonNexus 78234da448 feat(loadout): complete data model for all gear types
- LoadoutConfig now includes:
  - weapon_enhancers: List of up to 10 enhancer configs
  - armor_plates: Dict of plate configs per slot
  - left_ring, right_ring: Ring selections
  - clothing_items: List of clothing
  - pet: Selected pet

- Cost calculations updated:
  - get_total_decay_per_shot() includes enhancer decay
  - calculate_armor_cost_per_hour() includes plate decay

- Serialization updated:
  - to_dict() handles enhancers and plates
  - from_dict() handles all new fields with defaults
2026-02-09 12:05:16 +00:00
LemonNexus cf7c4ab5de feat(loadout): add plate search button to each armor slot
- Each armor slot now has a 🔍 button for plate selection
- Opens PlateSelectorDialog filtered by armor's highest protection type
- Selected plates from API are added to the slot's combo box
- Plates auto-selected after API selection
2026-02-09 11:59:06 +00:00
LemonNexus 88a3c8b551 feat(loadout): wire ALL selectors into LoadoutManager
- Attachment buttons now open AttachmentSelectorDialog (API-based)
- NEW: Enhancer selection button with warning about breakage
- NEW: Accessories section (Rings, Clothing, Pets)
- Methods for all selectors:
  - _on_select_attachment() - Amps, Scopes, Absorbers
  - _on_select_enhancer() - Weapon/Armor enhancers
  - _on_select_accessories() - Rings, Clothing, Pets
  - _on_ring_selected(), _on_clothing_selected(), _on_pet_selected()

Complete gear selection now available!
2026-02-09 11:57:27 +00:00
LemonNexus c490a84982 feat(selectors): add enhancer and accessories selectors
- NEW: ui/enhancer_selector.py - Weapon/Armor enhancer browser
  - Filter by type (Damage, Economy, Range, etc.)
  - Filter by tier (1-5+)
  - Risk level indicator (Low/Medium/High break chance)
  - Warning about enhancer breakage

- NEW: ui/accessories_selector.py - Rings, Clothing, Pets browser
  - Tabbed interface: Rings / Clothing / Pets
  - Rings: Limited items highlighted
  - Clothing: Buff display, cosmetic indicator
  - Pets: Effect display, level requirements
2026-02-09 11:54:00 +00:00