forked from mirror/Archipelago
Some checks failed
Analyze modified files / flake8 (push) Failing after 2m28s
Build / build-win (push) Has been cancelled
Build / build-ubuntu2204 (push) Has been cancelled
ctest / Test C++ ubuntu-latest (push) Has been cancelled
ctest / Test C++ windows-latest (push) Has been cancelled
Analyze modified files / mypy (push) Has been cancelled
Build and Publish Docker Images / Push Docker image to Docker Hub (push) Successful in 5m4s
Native Code Static Analysis / scan-build (push) Failing after 5m2s
type check / pyright (push) Successful in 1m7s
unittests / Test Python 3.11.2 ubuntu-latest (push) Failing after 16m23s
unittests / Test Python 3.12 ubuntu-latest (push) Failing after 28m19s
unittests / Test Python 3.13 ubuntu-latest (push) Failing after 14m49s
unittests / Test hosting with 3.13 on ubuntu-latest (push) Successful in 5m0s
unittests / Test Python 3.13 macos-latest (push) Has been cancelled
unittests / Test Python 3.11 windows-latest (push) Has been cancelled
unittests / Test Python 3.13 windows-latest (push) Has been cancelled
43 lines
1.4 KiB
Python
43 lines
1.4 KiB
Python
from typing import Dict, List
|
|
from BaseClasses import Item
|
|
from .data import BASE_LOCATION_ID, LOCATIONS_DATA, BASE_ITEM_ID, ITEMS_DATA
|
|
|
|
|
|
def build_location_name_to_id_dict() -> Dict[str, int]:
|
|
location_name_to_id: Dict[str, int] = {}
|
|
current_index = BASE_LOCATION_ID
|
|
for loc_name in LOCATIONS_DATA:
|
|
location_name_to_id[loc_name] = current_index
|
|
current_index += 1
|
|
return location_name_to_id
|
|
|
|
|
|
def build_item_name_to_id_dict() -> Dict[str, int]:
|
|
item_name_to_id: Dict[str, int] = {}
|
|
current_index = BASE_ITEM_ID
|
|
for item_name in ITEMS_DATA.keys():
|
|
item_name_to_id[item_name] = current_index
|
|
msg = "%s => %d" % (item_name, current_index)
|
|
current_index += 1
|
|
return item_name_to_id
|
|
|
|
|
|
def build_item_id_to_name_dict() -> Dict[int, str]:
|
|
item_id_to_name: Dict[int, str] = {}
|
|
current_index = BASE_ITEM_ID
|
|
for item_name in ITEMS_DATA.keys():
|
|
item_id_to_name[current_index] = item_name
|
|
current_index += 1
|
|
return item_id_to_name
|
|
|
|
|
|
def get_prices_pool():
|
|
prices_pool = [300] # 1%
|
|
prices_pool.extend([200] * 7) # 8%
|
|
prices_pool.extend([100] * 15) # 50%
|
|
prices_pool.extend([80] * 15) # 65%
|
|
prices_pool.extend([60] * 42) # 80%
|
|
prices_pool.extend([40] * 15) # 95%
|
|
prices_pool.extend([20] * 4) # 99%
|
|
prices_pool.append(0) # 100%
|
|
return prices_pool |