"""room.py STEM SUBTYPE: a Rebirth room's spawns.""" import sys; sys.path.insert(0, 'tools'); import rebirth_rooms as R from collections import Counter for path in sorted(R.DUMP.glob('rooms/*.stb')): if sys.argv[1] not in path.stem: continue for room in R.rooms_load(path): if R.KINDS.get(room['kind']) == 'boss' and room['subtype'] == int(sys.argv[2]): print(path.stem, room['variant'], 'shape', room['shape'], 'w', room.get('width'), room.get('height')) c = Counter(tuple(s[0][:3]) for _, _, s in room['spawns']) print(c) print([(x, y, s[0][:3]) for x, y, s in room['spawns'] if s[0][0] < 1000 or s[0][0] >= 9000])