feature: verarbeite kritische Treffer
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import enum
|
||||
|
||||
from MechFabrik.bauteile.items import Item
|
||||
from MechFabrik.bauteile.items import Item, ItemStatus
|
||||
|
||||
|
||||
class ZoneNames(enum.Enum):
|
||||
@@ -131,12 +131,34 @@ class InnerStructure:
|
||||
self._areas[index] = area
|
||||
|
||||
@property
|
||||
def zones(self) -> dict[ZoneNames, Zone]:
|
||||
def zones(self) -> dict[ZoneNames, OuterAmor]:
|
||||
return self._zones
|
||||
|
||||
def add_zone(self, index: ZoneNames, zone: Zone):
|
||||
def add_zone(self, index: ZoneNames, zone: OuterAmor):
|
||||
self._zones[index] = zone
|
||||
|
||||
|
||||
class CriticalStrikeEvent:
|
||||
pass
|
||||
def __init__(self, zone: OuterAmor, index: tuple[int,int]):
|
||||
self.__dict__['_zone'] = zone
|
||||
self.__dict__['_area'] = zone.area
|
||||
self.__dict__['_index'] = index
|
||||
self.__dict__['_item_is_empty'] = None
|
||||
|
||||
@property
|
||||
def area(self) -> Area:
|
||||
return self.__dict__['_area']
|
||||
|
||||
def process_event(self) -> CriticalStrikeEvent:
|
||||
self.__dict__['_zone'].state = AreaStatus.DAMAGED
|
||||
self.__dict__['_area'].state = AreaStatus.DAMAGED
|
||||
item = self.__dict__['_area'].items[self.__dict__['_index']]
|
||||
if item is None:
|
||||
self.__dict__['_item_is_empty'] = True
|
||||
else:
|
||||
self.__dict__['_item_is_empty'] = False
|
||||
item.state = ItemStatus.DESTROYED
|
||||
return self
|
||||
|
||||
def is_empty(self):
|
||||
return self.__dict__['_item_is_empty']
|
||||
|
||||
Reference in New Issue
Block a user