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
49 lines
1.7 KiB
Python
49 lines
1.7 KiB
Python
import json
|
|
import pkgutil
|
|
import re
|
|
|
|
from BaseClasses import Item, ItemClassification
|
|
from .game_id import dc1_name
|
|
|
|
prog_map = json.loads(pkgutil.get_data(__name__, "data/progressive.json").decode())
|
|
|
|
progressive_item_list = {}
|
|
for prog_item in prog_map:
|
|
progressiveName = prog_map[prog_item]
|
|
if progressiveName not in progressive_item_list:
|
|
progressive_item_list[progressiveName] = []
|
|
progressive_item_list[progressiveName].append(prog_item)
|
|
|
|
class DarkCloudItem(Item):
|
|
game = dc1_name
|
|
|
|
class ItemData:
|
|
classification = ItemClassification.trap # Should never see a Trap currently
|
|
name = None
|
|
ap_id = 0
|
|
count = 0
|
|
|
|
def __init__(self, name: str, ap_id: int, classification: ItemClassification, counts):
|
|
self.name = name
|
|
self.ap_id = ap_id
|
|
self.counts = counts
|
|
self.classification = classification
|
|
|
|
def to_items(self, player: int, world) -> list[DarkCloudItem]:
|
|
items = []
|
|
|
|
for j in range(0, min(5, world.options.boss_goal)):
|
|
# Randomize the +x value for attack, speed, endurance, magic attachments on the server
|
|
if 971112000 < self.ap_id <= 971112033:
|
|
for i in range(self.counts[j]):
|
|
temp_ap_id = self.ap_id
|
|
rand = world.random.randint(0, 2)
|
|
temp_ap_id = temp_ap_id + rand
|
|
temp_name = re.search('(.*\\+)', self.name).group(0) + str(rand+1)
|
|
items.append(DarkCloudItem(temp_name, self.classification, temp_ap_id, player))
|
|
else:
|
|
for i in range(self.counts[j]):
|
|
items.append(DarkCloudItem(self.name, self.classification, self.ap_id, player))
|
|
|
|
return items
|