Compare commits

...

2 Commits

Author SHA1 Message Date
magical 1913f51f00 fix items not being placed on bosses
bosses were considered unreachable when LimitArea was in effect because
they don't have a sector identifier (e.g. "S2") in their names.
2024-02-05 20:30:46 -08:00
magical ed0a382cbe add a script for building an executable zip file
see https://docs.python.org/3/library/zipapp.html
2024-02-05 20:24:15 -08:00
3 changed files with 26 additions and 1 deletions

View File

@ -27,6 +27,7 @@ class Game:
self.majorItemLocations = list()
self.minorItemLocations = list()
self.itemLocations = list()
self.itemArea = dict()
self.patcher = dict()
self.graph.clear()
self.areaConnections.clear()
@ -234,7 +235,8 @@ class Game:
for area in range(0, 7):
if 'S{}'.format(area) in start:
if 'S{}'.format(area) not in point:
return None
if self.itemArea.get(point) != area:
return None
edge = (start, point)
self.queue.append(edge)
while self.queue:

View File

@ -3127,6 +3127,7 @@ def start_randomizer(rom, settings):
BossLocations.append(name)
if 'Item' in name or nodeType == 'Boss' or nodeType == 'Data':
AreaItemLocations[areaIndex].append(name)
World.itemArea[name] = areaIndex
World.ConnectAllNodes()
StartLocation = 'S0-00'

22
build.sh 100755
View File

@ -0,0 +1,22 @@
#!/bin/bash
set -eu
mkdir -p myapp
if ! test -d myapp/bps; then
echo "Installing dependencies to ./myapp"
pip install -r requirements.txt --target myapp
rm -rf myapp/bin/ myapp/bps/test/ myapp/{bps,PySimpleGUI}/__pycache__/ myapp/*.dist-info/
fi
echo "Copying source files to ./myapp"
cp Fusion_Graph.py myapp/Fusion_Graph.py
cp Fusion_Items.py myapp/Fusion_Items.py
cp Randomizer.py myapp/Randomizer.py
cp GUI.py myapp/GUI.py
cp MFOR.py myapp/__main__.py
echo "Building MFOR.pyz"
python3 -m zipapp -o MFOR.pyz --python "/usr/bin/env python3" --compress myapp
echo "Done"