"""The fort's rooms, cut away (Step 3f; Dillon, 2026-11-16: "some things need to be already constructed ... barracks, command room, armory, engineer bay, vehicle/garage bay, research facility, and Rec area. Provide me an overhaul blueprint of the base rather than a hallway"). Pure: the 3D cutaway (cutaway.py) draws what this says, and the facilities window (campaignview.py) uses does(). The seven built rooms come first. Then the fort's plots, D.MAX_PLOTS of them: a built facility, the one the crew is building, an empty cleared plot, or rubble (not cleared yet; it can't be used). Where each one sits in the cutaway is LAYOUT. Moving about costs no game days (Dillon, 2026-11-12). LEVEL 1 [ COMMAND ROOM ] [lift] [ GARAGE BAY ] (the ramp up to the surface) LEVEL 2 [ BARRACKS ][ REC ] [lift] [ ARMORY ][ ENGINEER ] LEVEL 3 [ RESEARCH ][ PLOT 1] [lift] [ PLOT 2 ][ PLOT 3 ] LEVEL 4 [ rock ][ PLOT 4] [lift] """ from __future__ import annotations from . import data as D # key, name, what's in there, the control it holds (None: nothing to work yet, or the command room, # which is its own scene: the war room's map table) FIXED = ( ("command", "Command room", "The map table: missions, regions, the unit's trips.", None), ("barracks", "Barracks", "Everyone in the unit: rank, weapon, state. Recruits, and skills to pick.", "roster"), ("armory", "Armory", "Weapons, armor and utility kit, soldier by soldier.", "roster"), ("engineering", "Engineer bay", "The build crew: facilities, and clearing the rubble.", "facilities"), ("garage", "Garage bay", "The convoy: mounts and machines, and the kit each one carries.", "convoy"), ("research", "Research", "Benches and a chalkboard. Closed for now: nothing to research yet.", None), ("rec", "Rec area", "The memorial wall: everyone the fort has lost, killed or missing, and how.", "memorial"), ) # where each room sits: key -> (level 0.. from the top, column 0..4, columns wide). Column 2 is the lift. LAYOUT = { "command": (0, 0, 2), "garage": (0, 3, 2), "barracks": (1, 0, 1), "rec": (1, 1, 1), "armory": (1, 3, 1), "engineering": (1, 4, 1), "research": (2, 0, 1), "plot:0": (2, 1, 1), "plot:1": (2, 3, 1), "plot:2": (2, 4, 1), "plot:3": (3, 1, 1), } LEVELS, COLUMNS, LIFT = 4, 5, 2 # the tabs along the bottom of the screen, in order: (key, label); "base" is the whole cutaway TABS = (("command", "Command"), ("barracks", "Barracks"), ("armory", "Armory"), ("engineering", "Engineering"), ("garage", "Garage"), ("research", "Research"), ("rec", "Rec"), ("base", "Base")) BUTTON = {"roster": "The roster", "convoy": "The convoy", "facilities": "Building", "memorial": "The memorial"} def does(f, level): """What one level of facility f does, in a few words (level: its entry in D.FACILITIES).""" L = level if "discount" in L: return f"gear and convoy {L['discount']}% cheaper" if "heal" in L: return f"wounds heal in {round(L['heal'] * 100)}% of the time" if "xp" in L: return f"+{L['xp']}% XP from every mission" return f"+{L['intel']} intel a week, missions wait {L['life']} day{'s' * (L['life'] > 1)} longer" def doors(c): """Every room in the fort, in order -> list of dicts: key, name, kind ("room", "facility", "building", "plot" or "rubble"), about, control (or None), enter (False: it can't be used), and for a facility or a build, facility. (Called doors since part 4; each is a room in the cutaway.)""" out = [dict(key=k, name=n, kind="room", about=a, control=ctl, enter=True) for k, n, a, ctl in FIXED] built = [f for f in D.FACILITIES if c.level(f)] p = c.project left = (p["done"] - c.day) if p else 0 days = f"{left} day{'s' * (left != 1)} left" new = p["what"] if p and p["what"] != "clear rubble" and not c.level(p["what"]) else None for i in range(D.MAX_PLOTS): key = f"plot:{i}" if i < len(built): f = built[i] lv = c.level(f) about = f"{f.capitalize()}, level {lv}: {does(f, D.FACILITIES[f]['levels'][lv - 1])}." if p and p["what"] == f: about += f" The crew is building level {p['level']}: {days}." out.append(dict(key=key, name=f"{f.capitalize()} {lv}", kind="facility", about=about, control="facilities", enter=True, facility=f)) elif i == len(built) and new: out.append(dict(key=key, name=f"{new.capitalize()} (building)", kind="building", about=f"The crew is building the {new} here: {days}.", control="facilities", enter=True, facility=new)) elif i < c.plots: out.append(dict(key=key, name="Empty plot", kind="plot", about="Cleared ground, ready for a facility. Build from here or the works office.", control="facilities", enter=True)) else: clearing = p and p["what"] == "clear rubble" and i == c.plots out.append(dict(key=key, name="Rubble", kind="rubble", control=None, enter=False, about=(f"Rubble, being cleared: {days}." if clearing else "Rubble: the way is blocked. Clear it from the works office."))) return out