From 30229a8ce310c43dab210853889733433b2b1903 Mon Sep 17 00:00:00 2001 From: LemonNexus Date: Mon, 9 Feb 2026 11:22:35 +0000 Subject: [PATCH] fix(armor): add decay_per_hp field and ClassVar constants to ArmorPiece - Added decay_per_hp field for custom economy per piece - Added BASE_DECAY_FACTOR and MAX_DURABILITY as ClassVar - Added ClassVar to typing imports --- core/armor_system.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/core/armor_system.py b/core/armor_system.py index 815e1c7..91ff914 100644 --- a/core/armor_system.py +++ b/core/armor_system.py @@ -13,7 +13,7 @@ Implements Entropia Universe armor mechanics: from dataclasses import dataclass, field from decimal import Decimal -from typing import Optional, Dict, List, Tuple +from typing import Optional, Dict, List, Tuple, ClassVar from enum import Enum, auto @@ -232,14 +232,15 @@ class ArmorPiece: protection: ProtectionProfile = field(default_factory=ProtectionProfile) durability: int = 2000 # Durability affects economy weight: Decimal = Decimal("1.0") # Weight in kg - - # Base decay factor: 0.05 PEC per HP (20 hp/pec standard) - BASE_DECAY_FACTOR: Decimal = Decimal("0.05") - MAX_DURABILITY: int = 100000 + decay_per_hp: Decimal = Decimal("0.05") # PEC per HP absorbed (0.05 = 20 hp/pec) # Optional plate attachment attached_plate: Optional[ArmorPlate] = None + # Class constants (not instance fields) + BASE_DECAY_FACTOR: ClassVar[Decimal] = Decimal("0.05") + MAX_DURABILITY: ClassVar[int] = 100000 + def get_base_protection(self) -> ProtectionProfile: """Get base protection without plate.""" return self.protection