modname "mod_aio_pdplus"
modversion "6.0.0"
modauthor "Jonaeru / Atari-Dude"

# ==========================================================================
# mod_aio_pdplus
#
# DERIVED WORK - NOT ORIGINAL. Generated by tools/aio/layout.py from
# the Perfect Dark All in One 6.0 distribution (pd-aio-6.0), for the fojo
# modloader. It carries mod_allinone's level data and textures.
#
# Left out of this mod: the 166 C* / 68 G* models and 3 sequences every pack ships (see mod_aio_characters); the 6 L* text banks (they overwrite live vanilla text slots - names go in labels instead).
#
# Every credit and revision-history line from the source modconfig(s) is
# reproduced below unaltered. The level, model and texture work is the
# original authors'.
# ==========================================================================

# --- begin text carried over verbatim from pd-aio-6.0/mod_allinone/modconfig.txt ---
# Perfect Dark Plus & All Solos in Multi Mod v13
# Author: Jonaeru / Atari-Dude

# Perfect Dark Plus by Wreck
# http://n64vault.com/pd-multi-levels:perfect-dark-plus

# All Solos in Multi by 00dark
# http://n64vault.com/pd-multi-levels:all-solos-in-multi

# Suburb by Oofjay
# http://n64vault.com/pd-levels:suburb

# Training Day by MRKane

# Revision History
# v1: Fixed Skedar left arm, Dr. Carroll left arm hitbox. Thank you so much, Wreck. (June 2, 2024)
# v2: Merged All Solos in Multi Mod (August 23, 2024)
# v3: Added settings for coexistence with GoldenEye X, fixed texts (Lmpmenu) (August 29, 2024)
# v4: Fixed the collision in Carrington Villa Multi (can climb roof). Thank you so much, Atari-Dude.
#     Added "Random GoldenEye X" texts (Lmpmenu) (September 9, 2024)
# v5: Added "Kakariko Village" texts (Lmpmenu) (November 2, 2024)
# v6: Renamed Skedar, Dr. Carroll Models (November 3, 2024)
#     CtestchrZ -> Ccarroll2Z
#     Pttb_boxZ -> Cskedar2Z
#     PchrflashbangZ -> Ghand_carollZ
#     PdoorconsoleZ -> Ghand_skedarZ
# v7: Added "Dark Noon" texts (Lmpmenu) (November 22, 2024)
#     Added MP Weapon Random Choice
# v8: Added PAL texts (LmpmenuP, LoptionsP) (November 30, 2024)
# v9: Fixed arena texts (from GoldenEye X 6a), added reset settings (January 26, 2025)
# v10: Removed MP Weapon Random Choice settings (February 8, 2025)
# v11: Extend stage table for GoldenEye X, and fix level IDs accordingly (March 1, 2025)
# v12: Added "Suburb" and "Training Day" texts (April 10, 2025)
#      Replaced Skedar and Dr. Carroll Models last version by Wreck. Thank you so much, Wreck.
#      Merged Atari-Dude mod files (Carrington Institute Multi has been replaced with Jonaeru version) (April 10, 2025)
# v13: Fixed Subub settings (stage number) and removed GoldenEye X settings back to default.
#      Merged Atari-Dude mod files (July 20, 2025)

# Suburb
# --- end carried-over text ---

# --- stage declarations from tools/aio/stages/mod_aio_pdplus.txt (fojo-authored), re-slugged by slugmod ---
# --------------------------------------------------------------------------
# NOTE ON STAGE OWNERSHIP - read before adding stages here.
#
# STALE AS OF 2026-09-19: the counts and the unclaimed list below are the
# generator's output from before the slug conversion, when this file had one
# stage block. It now has 14, and none of the twelve solo campaign rows this
# list names is claimed any more - see the declaration block further down for
# what is actually claimed. The numbers are left exactly as the generator
# wrote them rather than hand-edited into a second, disagreeing answer.
#
# A stage block is what claims a stage for this mod: modConfigParseStage
# writes g_ModStageNums[stagenum] = modnum (port/src/mod.c:1530), and both
# bg geometry texture loading (src/game/bg.c:3050) and the active-mod file
# search (port/src/romdata.c) key off that. On a stage this mod does NOT
# claim, its bgdata and its textures are not consulted at all.
#
# This mod ships level data that belongs to 29 stage(s) by vanilla file
# mapping, of which 1 are claimed by a stage block below. The stage
# blocks below claim 1 stage(s) in total. The 28 unclaimed stages are
# listed here so that the decision to claim them is a deliberate one -
# claiming a stage another mounted mod also claims is a silent
# last-write-wins:
#   0x9  STAGE_MAIANSOS
#   0xc  STAGE_EXTRA7
#   0x10  STAGE_EXTRA11
#   0x16  STAGE_WAR
#   0x19  STAGE_ESCAPE
#   0x1a  STAGE_TEST_DEST
#   0x1c  STAGE_CRASHSITE
#   0x1d  STAGE_CHICAGO
#   0x1e  STAGE_G5BUILDING
#   0x21  STAGE_PELAGIC
#   0x22  STAGE_EXTRACTION
#   0x27  STAGE_AIRBASE
#   0x2a  STAGE_SKEDARRUINS
#   0x2c  STAGE_VILLA
#   0x2d  STAGE_DEFENSE
#   0x2f  STAGE_INFILTRATION
#   0x30  STAGE_DEFECTION
#   0x31  STAGE_AIRFORCEONE
#   0x33  STAGE_INVESTIGATION
#   0x34  STAGE_ATTACKSHIP
#   0x35  STAGE_RESCUE
#   0x37  STAGE_MBR
#   0x38  STAGE_DEEPSEA
#   0x3a  STAGE_TEST_MP2
#   0x3e  STAGE_TEST_MP6
#   0x50  STAGE_TEST_LAM
#   0x52  STAGE_EXTRA17
#   0x5a  STAGE_EXTRA25
# --------------------------------------------------------------------------
# (stage "STAGE_TEST_ARCH" dropped: allocation-only placeholder; replaced by pdplus_suburb in overrides)


# --------------------------------------------------------------------------
# STAGE DECLARATIONS ADDED WITH THE SLUG CONVERSION, CORRECTED
#
# Every file in this mod now carries the mod's slug in its name and its path,
# and every manifest entry declares `source: self`. That is what stops two
# mods claiming one relative path - and it also means the loose-file walk no
# longer hands this mod's geometry to a stage row the mod never declared. A
# row this mod was dressing by path alone draws vanilla from here on unless
# it is declared below: modConfigParseStage writing g_ModStageNums[stagenum]
# is the only thing that makes this mod's level data and textures reachable
# (port/src/mod.c:2436).
#
# The first pass put twelve of those blocks on SOLO CAMPAIGN rows -
# STAGE_CRASHSITE, STAGE_CHICAGO, STAGE_G5BUILDING, STAGE_PELAGIC,
# STAGE_AIRBASE, STAGE_SKEDARRUINS, STAGE_VILLA, STAGE_INFILTRATION,
# STAGE_DEFECTION, STAGE_AIRFORCEONE, STAGE_INVESTIGATION, STAGE_DEEPSEA -
# and that was wrong twice over.
#
# Each block names mpsetupfile and no setupfile, so it replaced the
# campaign's GEOMETRY and left the campaign's vanilla solo setup in place.
# That is never new campaign content; it is a campaign mission rebuilt out of
# a multiplayer re-export of itself.
#
# And a stage block claims the whole stagenum. mod_fojo declares eleven of
# those same twelve (mod_fojo/modconfig.txt, `stage 0x1c` .. `stage 0x38`) to
# swap in its own setup files. Roster order is 0 mod_fojo, 4 mod_aio_stages,
# so g_ModStageNums took the row off mod_fojo on every one of them.
#
# These are solo maps repackaged as Combat Simulator arenas - this mod ships
# an Ump_setup*_aioZ with real spawn points for each - so each one moves onto
# a free STAGE_EXTRA* row and the campaign row goes back to stock geometry
# and to mod_fojo.
#
# Rows chosen (all free: not declared by any mod in data/mods, not in
# g_MpArenas_Vanilla or g_SoloStages, and not among the nine contested rows
# in stage-extra-rows.md, which includes STAGE_EXTRA25):
#
#   STAGE_EXTRA1  0x05   STAGE_EXTRA8  0x0d   STAGE_EXTRA15 0x15
#   STAGE_EXTRA4  0x08   STAGE_EXTRA9  0x0e   STAGE_EXTRA17 0x52
#   STAGE_EXTRA5  0x0a   STAGE_EXTRA10 0x0f   STAGE_EXTRA22 0x57
#   STAGE_EXTRA7  0x0c   STAGE_EXTRA13 0x12   STAGE_EXTRA23 0x58
#
# Every one is <= 0x7f. g_MpSetup.stagenum is persisted in 7 bits
# (mplayer.c:4692 write, :4615 read) with no clamp on the way back, so a
# stagenum over 127 would come back truncated. The highest STAGE_EXTRA* is
# STAGE_EXTRA26 at 0x5b, so no EXTRA row can hit that ceiling.
#
# Names are the STAGE_* spelling, never a bare number. `stage 0x18` above is
# a STAGENUM, not a g_Stages row index - stagenum 0x18 is row 0x04, not row
# 0x18 - and the name form resolves through stageGetIndexByName and cannot be
# read the wrong way (mod.c:2411).
#
# WHAT STILL COMES FROM THE VANILLA EXTRA ROW, and is not overridable here:
#
#   allocation.  g_StageAllocations8Mb (src/lib/main.c:90) is keyed by
#   stagenum and has NO row for any STAGE_EXTRA*. The lookup falls off the
#   end onto the terminator, `{ 0, "-ml0 -me0 -mgfx120 -mvtx98 -ma300" }` -
#   the smallest budget in the table. These twelve maps are budgeted
#   "-mgfx110 -mgfxtra80 -mvtx100 -ma700" as solo missions and the vanilla
#   Combat Simulator arenas get "-mgfx200 -mvtx200 -ma400". An `allocation`
#   key cannot fix it: mod.c:2534 refuses it for a stage with no row in that
#   table and says so in the log. Whether ma300 is enough for an MP session
#   of these maps is NOT established here - it needs a run, and this pass
#   could not build or run the game.
#
#   music.  g_StageTracks is keyed by stagenum and has no EXTRA rows either,
#   so these arenas get no stage track, and a `music` block would be refused
#   the same way (mod.c:765).
#
#   weather and fog.  g_FogEnvironments / g_NoFogEnvironments (src/game/env.c)
#   are keyed by stagenum. Of the rows above, EXTRA7, EXTRA8, EXTRA9 and
#   EXTRA10 carry a g_NoFogEnvironments row from the GoldenEye X level they
#   were wired for; the other eight are in neither table and fall back to
#   g_NoFogEnvironments[0] (env.c:410). No row above is in g_FogEnvironments,
#   which is where the sky and sun entries live. A `weather` block can still
#   override per stage if one of these ever needs it.
#
#   lang bank and the Eraser x-ray distances (unk2c / eraserpropdist /
#   unk30) stay the vanilla row's.
#
# The arena feature gate does NOT come from the row: mpArenasRebuild appends
# a fresh mparena with requirefeature taken from the stage registry, which a
# stage block always leaves 0, and challengeIsFeatureUnlocked(0) is true.
#
# THE ARENA NAMES ON THE TWELVE ARE PLACEHOLDERS. The pack names none of these
# levels. Searched the way the Suburb block above was named - this mod's own
# LmpmenuE_aio / LmpmenuP_aio / LoptionsE_aio strings and the comments in
# PD_AIO_March_2026/mod_allinone/modconfig.txt and README.txt. The pack names
# Suburb, Training Day and the GoldenEye X / Kakariko / Dark Noon / Goldfinger
# arenas, and names none of these twelve, so the names below are derived from
# the vanilla level the geometry actually is, slugged, with an `_aio` marker
# for the pack they came from. They are meant to be replaced by a human pass.
#
# DO NOT DELETE AN `arenaname` TO TIDY IT AWAY. A `kind mp` row with no
# arenaname draws NULL, not a fallback name. modConfigParseStage records the
# stage with the langid argument HARD-CODED 0 (mod.c:2615) and no modconfig key
# sets it; mpArenasRebuild copies that into the appended mparena, and the menu
# does `if (customname) return customname; return langGet(name)`
# (mplayer/setup.c:532-535). langGet(0) is bank 0 index 0, g_LangFiles[0] is 0
# (lang.c:75), so bank 0 is never loaded and it returns NULL. The placeholder
# string is the only thing keeping that path from being taken. Rename them;
# do not remove them.
# --------------------------------------------------------------------------

# Not a campaign row: STAGE_TEST_DEST (row 0x06, stagenum 0x1a) is in neither
# g_SoloStages nor g_MpArenas_Vanilla, so nothing reaches it and there is
# nothing to vacate. It is the same case as STAGE_TEST_ARCH above, and the
# pack names it the same way: "Training Day" is L_MPMENU_325 in this mod's own
# LmpmenuE_aio, one slot after the "Suburb" string the block above uses, and
# "Training Day by MRKane" is a credit line in the carried-over header.
# Ump_setupdest_aioZ carries 10 spawns, 4 case points and 4 hills.
stage "STAGE_TEST_DEST" {
  bgfile "bgdata/bg_dest_aio_pdplus.seg"
  tilesfile "bgdata/bg_dest_tiles_aio_pdplusZ"
  padsfile "bgdata/bg_dest_pads_aio_pdplusZ"
  mpsetupfile "Ump_setupdest_aio_pdplusZ"
  kind mp
  arenaname "Training Day"
  author "MRKane"
  # lifted 2026-09-20 (lift-out/lift.py rule 3d): langbank lang.c:158 (STAGE_TEST_DEST -> LANGBANK_DEST); allocation pdmain.c:168 (STAGE_TEST_DEST)
  langbank DEST
  allocation "-ml0 -me0 -mgfx120 -mvtx98 -ma400"
}


# --------------------------------------------------------------------------
# The twelve solo campaign maps, moved off the campaign.
#
# tilesfile is named on every block, which it was not before. On the campaign
# row an omitted tilesfile kept that level's own vanilla tiles; on a STAGE_EXTRA
# row it would keep the OTHER level's tiles - Ravine's tiles under Crash Site's
# geometry - so each block names the tiles explicitly. Eight of the twelve have
# no slugged tiles in this mod, and name the vanilla file instead; every mod
# row inherits the ROM's file names (port/src/romdata.c:1198), so the vanilla
# name resolves from this mod and the bytes are the ROM's.
#
# IF ONE OF THESE FALLS OVER, LOOK AT THE MEMORY BUDGET FIRST. No STAGE_EXTRA*
# has a row in g_StageAllocations8Mb (src/lib/main.c:90), so all twelve take
# the table terminator's `-ml0 -me0 -mgfx120 -mvtx98 -ma300` - the smallest in
# it - while these are campaign-sized maps budgeted `-ma700` as missions. An
# `allocation` key here cannot fix it; mod.c:2534 refuses it for a stage with
# no row in that table. Never played, so this is a hazard, not a report.
#
# Every `arenaname` below is a PLACEHOLDER for a human pass, not a name the
# pack gives the level. See the note above before removing one.
#
# THE ROW'S DRAW SCALE DOES NOT FOLLOW THE LEVEL, so three of these blocks
# state it. g_Stages[].unk18 is the row's world-to-graphics scale and bg.c:1771
# copies it into every player's scale_bg2gfx at stage load. Measured across all
# 87 rows it is 1 on 83 and 0.5 on four: STAGE_CRASHSITE (0x08, bg_azt),
# STAGE_AIRBASE (0x13, bg_cave), STAGE_VILLA (0x18, bg_eld) and STAGE_TEST_MP20
# (0x3c, bg_mp20). Every STAGE_EXTRA* row is 1.
#
# So Crash Site, Air Base and Carrington Villa - the three maps here whose
# geometry comes off a 0.5 row - inherited 1 when they moved, and drew at twice
# the graphics extent they were built for. The level's own proportions are
# unchanged, because the camera is scaled by the same number
# (player.c:6008); what goes wrong is everything measured against a fixed
# scale. The first-person weapon is drawn with the factor forced to 1
# (bondgun.c:11710-11846) so it reads half-size, and bg.c:6059 and env.c:231
# divide by this value to turn the fixed graphics-space far plane and fog band
# back into world units, so both reach half as far.
#
# `gfxscale` sets it per block. The other nine maps here come off rows that
# carry 1 and need no key - checked row by row against the bg file each block
# names, not assumed.
#
# Not declared here: STAGE_TEST_MP20 / row 0x3c is contested between
# mod_gex_stages and mod_kakariko_stages (stage-extra-rows.md), and whichever
# pack takes it will need `gfxscale 0.5` on whatever it puts there, or the
# level it displaces will have been the only thing keeping that row honest.
# --------------------------------------------------------------------------

# Crash Site -> STAGE_EXTRA1 (stagenum 0x05, row 0x3d, vanilla bg_arec)
# Ump_setupazt_aioZ: 28 spawns, 4 case points, 10 hills.
stage "pdplus_azt" {
  bgfile "bgdata/bg_azt_aio_pdplus.seg"
  tilesfile "bg_azt_tilesZ"
  padsfile "bgdata/bg_azt_pads_aio_pdplusZ"
  mpsetupfile "Ump_setupazt_aio_pdplusZ"
  # bg_azt is authored for 0.5: that is what its home row STAGE_CRASHSITE (row 0x08)
  # carries, and STAGE_EXTRA* rows all carry 1.
  gfxscale 0.5
  kind mp
  arenaname "Crash Site"
  # lifted 2026-09-20 (lift-out/lift.py rule 3b): langbank lang.c:186 (STAGE_CRASHSITE -> LANGBANK_AZT); allocation pdmain.c:128 (STAGE_CRASHSITE); env env.c:53 (STAGE_CRASHSITE fog)
  langbank AZT
  allocation "-ml0 -me0 -mgfx110 -mgfxtra80 -mvtx100 -ma700"
  env {
    fog 994 1000
    near 15
    far 10000
    distfade 0 0 0
    sky 0x9b2d1e
    suns crashsite
    clouds 1 1500 0 0xfafa00
    water 0 -5000 0 0x000000
    cloudsheight 0
  }
}

# Chicago -> STAGE_EXTRA4 (stagenum 0x08, row 0x40, vanilla bg_jun)
# Ump_setuppete_aioZ: 21 spawns, 4 case points, 5 hills.
stage "pdplus_pete" {
  bgfile "bgdata/bg_pete_aio_pdplus.seg"
  tilesfile "bg_pete_tilesZ"
  padsfile "bgdata/bg_pete_pads_aio_pdplusZ"
  mpsetupfile "Ump_setuppete_aio_pdplusZ"
  kind mp
  arenaname "Chicago"
  # lifted 2026-09-20 (lift-out/lift.py rule 3b): langbank lang.c:162 (STAGE_CHICAGO -> LANGBANK_PETE); allocation pdmain.c:120 (STAGE_CHICAGO); env env.c:128 (STAGE_CHICAGO nofog)
  langbank PETE
  allocation "-ml0 -me0 -mgfx110 -mgfxtra80 -mvtx100 -ma700"
  env {
    near 10
    far 10000
    distfade 0 0 0
    sky 0x000000
    suns none
    clouds 1 5000 0 0x50280a
    water 0 -5000 0 0x000000
    cloudsheight 0
    transparency 1
  }
}

# G5 Building -> STAGE_EXTRA5 (stagenum 0x0a, row 0x41, vanilla bg_crad)
# Ump_setupdepo_aioZ: 16 spawns, 4 case points, 5 hills.
stage "pdplus_depo" {
  bgfile "bgdata/bg_depo_aio_pdplus.seg"
  tilesfile "bg_depo_tilesZ"
  padsfile "bgdata/bg_depo_pads_aio_pdplusZ"
  mpsetupfile "Ump_setupdepo_aio_pdplusZ"
  kind mp
  arenaname "G5 Building"
  # lifted 2026-09-20 (lift-out/lift.py rule 3b): langbank lang.c:163 (STAGE_G5BUILDING -> LANGBANK_DEPO); allocation pdmain.c:121 (STAGE_G5BUILDING); env env.c:129 (STAGE_G5BUILDING nofog)
  langbank DEPO
  allocation "-ml0 -me0 -mgfx110 -mgfxtra80 -mvtx100 -ma700"
  env {
    near 15
    far 10000
    distfade 0 0 0
    sky 0x000000
    suns none
    clouds 0 5000 0 0x50280a
    water 0 -5000 0 0x000000
    cloudsheight 0
    transparency 1
  }
}

# Pelagic II -> STAGE_EXTRA7 (stagenum 0x0c, row 0x43, vanilla bg_mp2)
# Ump_setupdam_aioZ: 28 spawns, 4 case points, 8 hills.
stage "pdplus_dam" {
  bgfile "bgdata/bg_dam_aio_pdplus.seg"
  tilesfile "bg_dam_tilesZ"
  padsfile "bgdata/bg_dam_pads_aio_pdplusZ"
  mpsetupfile "Ump_setupdam_aio_pdplusZ"
  kind mp
  arenaname "Pelagic II"
  # lifted 2026-09-20 (lift-out/lift.py rule 3b): langbank lang.c:153 (STAGE_PELAGIC -> LANGBANK_DAM); allocation pdmain.c:129 (STAGE_PELAGIC); env env.c:54 (STAGE_PELAGIC fog)
  langbank DAM
  allocation "-ml0 -me0 -mgfx110 -mgfxtra80 -mvtx100 -ma700"
  env {
    fog 995 1000
    near 15
    far 15000
    distfade 3333 4444 600
    sky 0x2d3e60
    suns none
    clouds 1 5000 0 0xf0f0f0
    water 0 -2000 0 0x14212b
    cloudsheight 0
  }
}

# Air Base -> STAGE_EXTRA8 (stagenum 0x0d, row 0x44, vanilla bg_mp3)
# Ump_setupcave_aioZ: 24 spawns, 4 case points, 10 hills.
stage "pdplus_cave" {
  bgfile "bgdata/bg_cave_aio_pdplus.seg"
  tilesfile "bg_cave_tilesZ"
  padsfile "bgdata/bg_cave_pads_aio_pdplusZ"
  mpsetupfile "Ump_setupcave_aio_pdplusZ"
  # bg_cave is authored for 0.5: that is what its home row STAGE_AIRBASE (row 0x13)
  # carries, and STAGE_EXTRA* rows all carry 1.
  gfxscale 0.5
  kind mp
  arenaname "Air Base"
  # lifted 2026-09-20 (lift-out/lift.py rule 3b): langbank lang.c:187 (STAGE_AIRBASE -> LANGBANK_CAVE); allocation pdmain.c:126 (STAGE_AIRBASE); env env.c:132 (STAGE_AIRBASE nofog)
  langbank CAVE
  allocation "-ml0 -me0 -mgfx110 -mgfxtra80 -mvtx100 -ma700"
  env {
    near 15
    far 20000
    distfade 0 0 0
    sky 0x001040
    suns airbase
    clouds 1 5000 0 0xffffff
    water 0 -5000 0 0x000000
    cloudsheight 0
    transparency 1
  }
}

# Skedar Ruins -> STAGE_EXTRA9 (stagenum 0x0e, row 0x45, vanilla bg_mp4)
# Ump_setupsho_aioZ: 24 spawns, 4 case points, 8 hills.
stage "pdplus_sho" {
  bgfile "bgdata/bg_sho_aio_pdplus.seg"
  tilesfile "bgdata/bg_sho_tiles_aio_pdplusZ"
  padsfile "bgdata/bg_sho_pads_aio_pdplusZ"
  mpsetupfile "Ump_setupsho_aio_pdplusZ"
  kind mp
  arenaname "Skedar Ruins"
  # lifted 2026-09-20 (lift-out/lift.py rule 3b): langbank lang.c:182 (STAGE_SKEDARRUINS -> LANGBANK_SHO); allocation pdmain.c:133 (STAGE_SKEDARRUINS); env env.c:121 (STAGE_SKEDARRUINS nofog)
  langbank SHO
  allocation "-ml0 -me0 -mgfx110 -mgfxtra80 -mvtx100 -ma700"
  env {
    near 15
    far 10000
    distfade 0 0 0
    sky 0x6565ff
    suns skedar
    clouds 0 5000 0 0xffffff
    water 0 0 0 0x000000
    cloudsheight 0
    transparency 1
  }
}

# Carrington Villa -> STAGE_EXTRA10 (stagenum 0x0f, row 0x46, vanilla bg_mp5)
# Ump_setupeld_aioZ: 28 spawns, 4 case points, 10 hills.
stage "pdplus_eld" {
  bgfile "bgdata/bg_eld_aio_pdplus.seg"
  tilesfile "bgdata/bg_eld_tiles_aio_pdplusZ"
  padsfile "bgdata/bg_eld_pads_aio_pdplusZ"
  mpsetupfile "Ump_setupeld_aio_pdplusZ"
  # bg_eld is authored for 0.5: that is what its home row STAGE_VILLA (row 0x18)
  # carries, and STAGE_EXTRA* rows all carry 1.
  gfxscale 0.5
  kind mp
  arenaname "Carrington Villa"
  # lifted 2026-09-20 (lift-out/lift.py rule 3b): langbank lang.c:173 (STAGE_VILLA -> LANGBANK_ELD); allocation pdmain.c:122 (STAGE_VILLA); env env.c:55 (STAGE_VILLA fog)
  langbank ELD
  allocation "-ml0 -me0 -mgfx110 -mgfxtra80 -mvtx100 -ma600"
  env {
    fog 981 1047
    near 15
    far 20000
    distfade 0 0 0
    sky 0x46a0ff
    suns villa
    clouds 1 5000 0 0xffffff
    water 0 -1850 1 0x00ffff
    cloudsheight 0
  }
}

# Infiltration -> STAGE_EXTRA13 (stagenum 0x12, row 0x49, vanilla bg_mp10)
# Ump_setuplue_aioZ: 28 spawns, 4 case points, 20 hills.
stage "pdplus_lue" {
  bgfile "bgdata/bg_lue_aio_pdplus.seg"
  tilesfile "bg_lue_tilesZ"
  padsfile "bgdata/bg_lue_pads_aio_pdplusZ"
  mpsetupfile "Ump_setuplue_aio_pdplusZ"
  kind mp
  arenaname "Area 51"
  # lifted 2026-09-20 (lift-out/lift.py rule 3b): langbank lang.c:179 (STAGE_INFILTRATION -> LANGBANK_LUE); allocation pdmain.c:123 (STAGE_INFILTRATION); env env.c:101 (STAGE_INFILTRATION nofog)
  langbank LUE
  allocation "-ml0 -me0 -mgfx110 -mgfxtra80 -mvtx100 -ma500"
  env {
    near 15
    far 12000
    distfade 0 0 0
    sky 0x000000
    suns area51
    clouds 0 5000 0 0xffffff
    water 0 0 0 0x000000
    cloudsheight 0
    transparency 1
  }
}

# Defection -> STAGE_EXTRA15 (stagenum 0x15, row 0x4b, vanilla bg_mp12)
# Ump_setupame_aioZ: 21 spawns, 4 case points, 5 hills.
stage "pdplus_ame" {
  bgfile "bgdata/bg_ame_aio_pdplus.seg"
  tilesfile "bg_ame_tilesZ"
  padsfile "bgdata/bg_ame_pads_aio_pdplusZ"
  mpsetupfile "Ump_setupame_aio_pdplusZ"
  kind mp
  arenaname "dataDyne Central"
  # lifted 2026-09-20 (lift-out/lift.py rule 3b): langbank lang.c:172 (STAGE_DEFECTION -> LANGBANK_AME); allocation pdmain.c:117 (STAGE_DEFECTION); env env.c:118 (STAGE_DEFECTION nofog)
  langbank AME
  allocation "-ml0 -me0 -mgfx110 -mgfxtra80 -mvtx100 -ma700"
  env {
    near 10
    far 10000
    distfade 0 0 0
    sky 0x000000
    suns none
    clouds 0 5000 0 0x3a1100
    water 0 0 0 0x000000
    cloudsheight 0
    transparency 1
  }
}

# Air Force One -> STAGE_EXTRA17 (stagenum 0x52, row 0x4d, vanilla bg_lee)
# Ump_setuprit_aioZ: 16 spawns, 4 case points, 5 hills.
stage "pdplus_rit" {
  bgfile "bgdata/bg_rit_aio_pdplus.seg"
  tilesfile "bgdata/bg_rit_tiles_aio_pdplusZ"
  padsfile "bgdata/bg_rit_pads_aio_pdplusZ"
  mpsetupfile "Ump_setuprit_aio_pdplusZ"
  kind mp
  arenaname "Air Force One"
  # lifted 2026-09-20 (lift-out/lift.py rule 3b): langbank lang.c:183 (STAGE_AIRFORCEONE -> LANGBANK_RIT); allocation pdmain.c:127 (STAGE_AIRFORCEONE); env env.c:130 (STAGE_AIRFORCEONE nofog)
  langbank RIT
  allocation "-ml0 -me0 -mgfx110 -mgfxtra80 -mvtx100 -ma700"
  env {
    near 15
    far 20000
    distfade 0 0 0
    sky 0x001040
    suns none
    clouds 1 5000 0 0xffffff
    water 1 -5000 2 0xffffff
    cloudsheight 0
    transparency 1
  }
}

# Investigation -> STAGE_EXTRA22 (stagenum 0x57, row 0x52, vanilla bg_crad)
# Ump_setupear_aioZ: 21 spawns, 4 case points, 5 hills.
stage "pdplus_ear" {
  bgfile "bgdata/bg_ear_aio_pdplus.seg"
  tilesfile "bg_ear_tilesZ"
  padsfile "bgdata/bg_ear_pads_aio_pdplusZ"
  mpsetupfile "Ump_setupear_aio_pdplusZ"
  kind mp
  arenaname "dataDyne Research"
  # lifted 2026-09-20 (lift-out/lift.py rule 3b): langbank lang.c:176 (STAGE_INVESTIGATION -> LANGBANK_EAR); allocation pdmain.c:118 (STAGE_INVESTIGATION); env env.c:133 (STAGE_INVESTIGATION nofog)
  langbank EAR
  allocation "-ml0 -me0 -mgfx110 -mgfxtra80 -mvtx100 -ma700"
  env {
    near 15
    far 10000
    distfade 0 0 0
    sky 0x000000
    suns none
    clouds 0 5000 0 0x1e1e1e
    water 0 -5000 0 0x000000
    cloudsheight 0
    transparency 1
  }
}

# Deep Sea -> STAGE_EXTRA23 (stagenum 0x58, row 0x53, vanilla bg_arec)
# Ump_setuppam_aioZ: 21 spawns, 4 case points, 5 hills.
stage "pdplus_pam" {
  bgfile "bgdata/bg_pam_aio_pdplus.seg"
  tilesfile "bgdata/bg_pam_tiles_aio_pdplusZ"
  padsfile "bgdata/bg_pam_pads_aio_pdplusZ"
  mpsetupfile "Ump_setuppam_aio_pdplusZ"
  kind mp
  arenaname "Deep Sea"
  # lifted 2026-09-20 (lift-out/lift.py rule 3b): langbank lang.c:181 (STAGE_DEEPSEA -> LANGBANK_PAM); allocation pdmain.c:130 (STAGE_DEEPSEA); env env.c:108 (STAGE_DEEPSEA nofog)
  langbank PAM
  allocation "-ml0 -me0 -mgfx110 -mgfxtra80 -mvtx100 -ma700"
  env {
    near 15
    far 10000
    distfade 0 0 0
    sky 0x050000
    suns none
    clouds 0 5000 0 0x9b9b9b
    water 0 0 0 0x000000
    cloudsheight 0
    transparency 0
  }
}


# =========================================================================
# Levels this pack ships that had no stage row of their own.
#
# Before the stage space was rowed out these had nowhere to go: the rows
# naming their bg files were already claimed, and claiming one anyway is
# how two packs end up fighting over a level. Each block below names its
# level instead of a row and takes a free STAGE_EXTRA row from the
# allocator, so nothing here contests anything.
#
# ARENA NAMES ARE PLACEHOLDERS in the house form <level>_<pack>, the same
# as cat_gex and crash_site_aio above. Nobody has booted these to see what
# they are. Renaming one is a single string.
#
# Kept at the end of the file on purpose: a bad value in a stage block
# aborts the whole modconfig with no rollback, so a mistake here can only
# cost what is below it.
# =========================================================================

stage "pdplus_lam" {
  bgfile "bgdata/bg_lam_aio_pdplus.seg"
  tilesfile "bgdata/bg_lam_tiles_aio_pdplusZ"
  padsfile "bgdata/bg_lam_pads_aio_pdplusZ"
  mpsetupfile "Ump_setuplam_aio_pdplusZ"
  kind mp
  arenaname "Apex"   # was "Egyptian/Villa?"; row 0x59 STAGE_EXTRA29; gex's lam is Grand Library
  # lifted 2026-09-20 (lift-out/lift.py rule 3c): langbank lang.c:191 (STAGE_TEST_LAM -> LANGBANK_LAM); allocation pdmain.c:174 (STAGE_TEST_LAM); env env.c:143 (STAGE_TEST_LAM nofog, 'Grand Library (Same as Library)')
  langbank LAM
  allocation "-ml0 -me0 -mgfx120 -mvtx98 -ma400"
  env {
    near 15
    far 10000
    distfade 0 0 0
    sky 0x020000
    suns none
    clouds 1 5000 0 0x82aac8
    water 0 -5000 0 0x000000
    cloudsheight 0
    transparency 0
  }
}

stage "pdplus_lee" {
  bgfile "bgdata/bg_lee_aio_pdplus.seg"
  # This pack ships no tiles for lee, so name the VANILLA ones explicitly.
  # Omitting the key does NOT fall back to vanilla - it inherits whatever the
  # allocated row carries, which is bg_ref's tiles, and the level renders as a
  # black void you fall straight out of.
  tilesfile "bg_lee_tilesZ"
  padsfile "bgdata/bg_lee_pads_aio_pdplusZ"
  mpsetupfile "Ump_setuplee_aio_pdplusZ"
  kind mp
  arenaname "Attack Ship"
  # lifted 2026-09-20 (lift-out/lift.py rule 3c): langbank lang.c:177 (STAGE_ATTACKSHIP -> LANGBANK_LEE); allocation pdmain.c:132 (STAGE_ATTACKSHIP); env env.c:100 (STAGE_ATTACKSHIP nofog)
  langbank LEE
  allocation "-ml0 -me0 -mgfx110 -mgfxtra80 -mvtx100 -ma700"
  env {
    near 15
    far 10000
    distfade 0 0 0
    sky 0x000000
    suns none
    clouds 0 5000 0 0xffffff
    water 0 0 0 0x000000
    cloudsheight 0
    transparency 0
  }
}

stage "pdplus_mp2" {
  bgfile "bgdata/bg_mp2_aio_pdplus.seg"
  tilesfile "bgdata/bg_mp2_tiles_aio_pdplusZ"
  padsfile "bgdata/bg_mp2_pads_aio_pdplusZ"
  mpsetupfile "Ump_setupmp2_aio_pdplusZ"
  kind mp
  arenaname "Stack"
  # lifted 2026-09-20 (lift-out/lift.py rule 3c): langbank lang.c:193 (STAGE_TEST_MP2 -> LANGBANK_MP2); allocation pdmain.c:151 (STAGE_TEST_MP2); env env.c:149 (STAGE_TEST_MP2 nofog, 'Stack')
  langbank MP2
  allocation "-ml0 -me0 -mgfx200 -mvtx200 -ma400"
  env {
    near 15
    far 20000
    distfade 0 0 0
    sky 0x000000
    suns none
    clouds 0 5000 0 0xffffff
    water 0 -5000 0 0x000000
    cloudsheight 0
    transparency 0
  }
}

stage "pdplus_mp6" {
  bgfile "bgdata/bg_mp6_aio_pdplus.seg"
  tilesfile "bgdata/bg_mp6_tiles_aio_pdplusZ"
  padsfile "bgdata/bg_mp6_pads_aio_pdplusZ"
  mpsetupfile "Ump_setupmp6_aio_pdplusZ"
  kind mp
  arenaname "Caves"
  # lifted 2026-09-20 (lift-out/lift.py rule 3c): langbank lang.c:197 (STAGE_TEST_MP6 -> LANGBANK_MP6); allocation pdmain.c:152 (STAGE_TEST_MP6); env env.c:159 (STAGE_EXTRA11 nofog, comment 'Caves')
  langbank MP6
  allocation "-ml0 -me0 -mgfx200 -mvtx200 -ma400"
  env {
    near 15
    far 20000
    distfade 0 0 0
    sky 0x001050
    suns none
    clouds 1 5000 0 0xffffff
    water 0 -5000 0 0x000000
    cloudsheight 0
    transparency 0
  }
}

stage "pdplus_stat" {
  bgfile "bgdata/bg_stat_aio_pdplus.seg"
  tilesfile "bgdata/bg_stat_tiles_aio_pdplusZ"
  padsfile "bgdata/bg_stat_pads_aio_pdplusZ"
  mpsetupfile "Ump_setupstat_aio_pdplusZ"
  kind mp
  arenaname "Offices"   # was "Offices?"; row 0x58 STAGE_EXTRA28; gex's stat is Paradox
  # lifted 2026-09-20 (lift-out/lift.py rule 3c): langbank stem bank (no source row); STAT exists as LANGBANK_STAT; allocation default for kind mp (no pdmain.c row)
  langbank STAT
  allocation "-ml0 -me0 -mgfx200 -mvtx200 -ma400"
}

# --- stage blocks added 2026-10-10 from jonaeru/perfect_dark @ d3e4205 (stagetable.c rows, g_MpArenas names, env.c/lang.c/pdmain.c params) for levels the 6.0 pack ships that the parked config never declared; pack attribution in aio6-stage-proposals.txt ---
stage "pdplus_suburb" {
  bgfile "bgdata/bg_arch_aio_pdplus.seg"
  tilesfile "bgdata/bg_arch_tiles_aio_pdplusZ"
  padsfile "bgdata/bg_arch_pads_aio_pdplusZ"
  mpsetupfile "Ump_setuparch_aio_pdplusZ"
  kind mp
  arenaname "Suburb"
  author "Oofjay"
  # from jonaeru @ d3e4205: row 0x04 STAGE_TEST_ARCH (vanilla table); arena name L_MPMENU in the AIO LmpmenuE bank
  langbank ARCH   # lang.c:181
  allocation "-ml0 -me0 -mgfx200 -mvtx200 -ma400"   # pdmain.c:162
  # env env.c:175 (nofog, 'Suburb (Same as Defection)')
  env {
    near 10
    far 10000
    distfade 0 0 0
    sky 0x000000
    suns none
    clouds 0 5000 0 0x3a1100
    water 0 0 0 0x000000
    cloudsheight 0
    transparency 1
  }
}


