Compare commits
No commits in common. "master" and "v0.29.2.1" have entirely different histories.
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
__author__ = """Eriks Karls"""
|
__author__ = """Eriks Karls"""
|
||||||
__email__ = "eriks@72.lv"
|
__email__ = "eriks@72.lv"
|
||||||
__version__ = "0.29.2.3"
|
__version__ = "0.29.2.1"
|
||||||
|
|
||||||
from erepublik.citizen import Citizen
|
from erepublik.citizen import Citizen
|
||||||
|
|
||||||
|
@ -2349,7 +2349,7 @@ class _Citizen(
|
|||||||
self.update_citizen_info()
|
self.update_citizen_info()
|
||||||
self.update_companies()
|
self.update_companies()
|
||||||
wam_holdings: List[classes.Holding] = [
|
wam_holdings: List[classes.Holding] = [
|
||||||
holding for holding in self.my_companies.get_wam_holdings() if holding.wam_count
|
holding for holding in self.my_companies.holdings.values() if holding.wam_count
|
||||||
]
|
]
|
||||||
|
|
||||||
# Check for current region
|
# Check for current region
|
||||||
@ -2361,9 +2361,10 @@ class _Citizen(
|
|||||||
holding for holding in wam_holdings if not holding.region == self.details.current_region
|
holding for holding in wam_holdings if not holding.region == self.details.current_region
|
||||||
]
|
]
|
||||||
|
|
||||||
|
wam_holdings.sort(key=lambda h: -len(h.get_wam_companies(False)))
|
||||||
for holding in wam_holdings:
|
for holding in wam_holdings:
|
||||||
# Don't travel if not enough energy (either work in all holding factories or 2h energy worth)
|
# Don't travel if not enough energy
|
||||||
if self.energy.energy < 2 * self.energy.interval * 10 < holding.wam_count * 10:
|
if self.energy.energy < 2 * self.energy.interval * 10 < holding.wam_count:
|
||||||
break
|
break
|
||||||
raw_usage = holding.get_wam_raw_usage()
|
raw_usage = holding.get_wam_raw_usage()
|
||||||
free_storage = self.inventory.total - self.inventory.used
|
free_storage = self.inventory.total - self.inventory.used
|
||||||
@ -2375,6 +2376,9 @@ class _Citizen(
|
|||||||
self.update_companies()
|
self.update_companies()
|
||||||
|
|
||||||
wam_count = self.my_companies.get_total_wam_count()
|
wam_count = self.my_companies.get_total_wam_count()
|
||||||
|
# if wam_count:
|
||||||
|
# self.logger.debug(f"Wam ff lockdown is now {wam_count}, was {self.my_companies.ff_lockdown}")
|
||||||
|
# self.my_companies.ff_lockdown = wam_count
|
||||||
self.travel_to_residence()
|
self.travel_to_residence()
|
||||||
return bool(wam_count)
|
return bool(wam_count)
|
||||||
|
|
||||||
|
@ -411,12 +411,6 @@ class MyCompanies:
|
|||||||
def companies(self) -> Generator[Company, None, None]:
|
def companies(self) -> Generator[Company, None, None]:
|
||||||
return (c for c in self._companies)
|
return (c for c in self._companies)
|
||||||
|
|
||||||
def get_wam_holdings(self) -> Generator[Holding, None, None]:
|
|
||||||
for holding in sorted(
|
|
||||||
self.holdings.values(), key=lambda h: (-len(h.get_wam_companies(False)), -len(h.get_wam_companies()))
|
|
||||||
):
|
|
||||||
yield holding
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"MyCompanies: {sum(1 for _ in self.companies)} companies in {len(self.holdings)} holdings"
|
return f"MyCompanies: {sum(1 for _ in self.companies)} companies in {len(self.holdings)} holdings"
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
[bumpversion]
|
[bumpversion]
|
||||||
current_version = 0.29.2.3
|
current_version = 0.29.2.1
|
||||||
commit = True
|
commit = True
|
||||||
tag = True
|
tag = True
|
||||||
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)\.?(?P<dev>\d+)?
|
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)\.?(?P<dev>\d+)?
|
||||||
|
2
setup.py
2
setup.py
@ -49,6 +49,6 @@ setup(
|
|||||||
test_suite="tests",
|
test_suite="tests",
|
||||||
tests_require=test_requirements,
|
tests_require=test_requirements,
|
||||||
url="https://github.com/eeriks/erepublik/",
|
url="https://github.com/eeriks/erepublik/",
|
||||||
version="0.29.2.3",
|
version="0.29.2.1",
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user