Feature: nutze richtige Rüstung in den einzelnen Zonen
This commit is contained in:
@@ -85,7 +85,8 @@ class Area:
|
||||
def __init__(self):
|
||||
self.__dict__['_content'] = {
|
||||
'children': [],
|
||||
'items': {}
|
||||
'items': {},
|
||||
'armor': 0,
|
||||
}
|
||||
|
||||
def __setattr__(self, key, value):
|
||||
@@ -154,5 +155,12 @@ class Mech(object):
|
||||
def set_item(self, key: tuple, item: Item):
|
||||
pass
|
||||
|
||||
def strike(self, area_name, param):
|
||||
pass
|
||||
def strike(self, area_name, hits: int):
|
||||
area = self._inner_structure.areas.get(area_name)
|
||||
if area.armor > hits:
|
||||
area.armor -= hits
|
||||
return
|
||||
hits_rest = hits - area.armor
|
||||
if area.inner_armor > hits_rest:
|
||||
area.inner_armor -= hits_rest
|
||||
area.armor = 0
|
||||
|
||||
Reference in New Issue
Block a user