Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
f348a315c5 | |||
7a09eea2b4 | |||
81b1069cf0 | |||
429d43df15 | |||
c81986d65e | |||
7bb988f716 |
@ -4,7 +4,7 @@
|
||||
|
||||
__author__ = """Eriks Karls"""
|
||||
__email__ = 'eriks@72.lv'
|
||||
__version__ = '0.22.3'
|
||||
__version__ = '0.22.3.2'
|
||||
|
||||
from erepublik import classes, utils, constants
|
||||
from erepublik.citizen import Citizen
|
||||
|
@ -161,8 +161,10 @@ class ErepublikAnniversaryAPI(CitizenBaseAPI):
|
||||
data = {'nodeId': node_id, '_token': self.token, "currencyCost": currency_amount}
|
||||
return self.post(f"{self.url}/main/map-rewards-speedup", data=data)
|
||||
|
||||
def _post_map_rewards_claim(self, node_id: int) -> Response:
|
||||
def _post_map_rewards_claim(self, node_id: int, extra: bool = False) -> Response:
|
||||
data = {'nodeId': node_id, '_token': self.token}
|
||||
if extra:
|
||||
data['claimExtra'] = 1
|
||||
return self.post(f"{self.url}/main/map-rewards-claim", data=data)
|
||||
|
||||
def _post_main_wheel_of_fortune_spin(self, cost) -> Response:
|
||||
|
@ -731,8 +731,8 @@ class CitizenAnniversary(BaseCitizen):
|
||||
def start_unlocking_map_quest_node(self, node_id: int):
|
||||
return self._post_map_rewards_unlock(node_id)
|
||||
|
||||
def collect_map_quest_node(self, node_id: int):
|
||||
return self._post_map_rewards_claim(node_id)
|
||||
def collect_map_quest_node(self, node_id: int, extra: bool = False):
|
||||
return self._post_map_rewards_claim(node_id, extra)
|
||||
|
||||
def speedup_map_quest_node(self, node_id: int):
|
||||
node = self.get_anniversary_quest_data().get('cities', {}).get(str(node_id), {})
|
||||
@ -1120,14 +1120,16 @@ class CitizenEconomy(CitizenTravel):
|
||||
if not constants.INDUSTRIES[industry]:
|
||||
self.write_log(f"Trying to sell unsupported industry {industry}")
|
||||
|
||||
final = industry in [1, 2, 4, 23]
|
||||
items = self.inventory['final' if final else 'raw'][constants.INDUSTRIES[industry]]
|
||||
if items[quality if final else 0]['amount'] < amount:
|
||||
self.update_inventory()
|
||||
items = self.inventory['final' if final else 'raw'][constants.INDUSTRIES[industry]]
|
||||
if items[quality if final else 0]['amount'] < amount:
|
||||
_inv_qlt = quality if industry in [1, 2, 3, 4, 23] else 0
|
||||
_kind = 'final' if industry in [1, 2, 4, 4, 23] else 'raw'
|
||||
inventory = self.get_inventory()
|
||||
items = inventory[_kind].get(constants.INDUSTRIES[industry], {_inv_qlt: {'amount': 0}})
|
||||
if items[_inv_qlt]['amount'] < amount:
|
||||
inventory = self.get_inventory(True)
|
||||
items = inventory[_kind].get(constants.INDUSTRIES[industry], {_inv_qlt: {'amount': 0}})
|
||||
if items[_inv_qlt]['amount'] < amount:
|
||||
self._report_action("ECONOMY_SELL_PRODUCTS", "Unable to sell! Not enough items in storage!",
|
||||
kwargs=dict(inventory=items[quality if final else 0], amount=amount))
|
||||
kwargs=dict(inventory=items[_inv_qlt], amount=amount))
|
||||
return False
|
||||
|
||||
data = {
|
||||
@ -2219,7 +2221,8 @@ class CitizenTasks(BaseCitizen):
|
||||
js = response.json()
|
||||
good_msg = ["already_worked", "captcha"]
|
||||
if not js.get("status") and not js.get("message") in good_msg:
|
||||
if js.get('message') == 'employee':
|
||||
if js.get('message') in ['employee', 'money']:
|
||||
self.resign_from_employer()
|
||||
self.find_new_job()
|
||||
self.update_citizen_info()
|
||||
self.work()
|
||||
|
@ -53,7 +53,7 @@ class Country:
|
||||
|
||||
|
||||
class Industries:
|
||||
__by_name = {'food': 1, 'weapon': 2, 'ticket':3, 'house': 4, 'aircraft': 23,
|
||||
__by_name = {'food': 1, 'weapon': 2, 'ticket': 3, 'house': 4, 'aircraft': 23,
|
||||
'foodraw': 7, 'weaponraw': 12, 'houseraw': 18, 'aircraftraw': 24, 'airplaneraw': 24,
|
||||
'frm': 7, 'wrm': 12, 'hrm': 18, 'arm': 24,
|
||||
'frm q1': 7, 'frm q2': 8, 'frm q3': 9, 'frm q4': 10, 'frm q5': 11,
|
||||
|
@ -1,5 +1,5 @@
|
||||
[bumpversion]
|
||||
current_version = 0.22.3
|
||||
current_version = 0.22.3.2
|
||||
commit = True
|
||||
tag = True
|
||||
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)\.?(?P<dev>\d+)?
|
||||
|
Reference in New Issue
Block a user