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

# ==========================================================================
# mod_aio_darknoon
#
# 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_dark_noon'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).
#
# 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_dark_noon/modconfig.txt ---
# Dark Noon Mod for All in One Mod v3
# Author: Jonaeru / Atari-Dude

# Dark Noon by MRKane

# Revision History
# v2: Replaced Skedar and Dr. Carroll Models last version by Wreck. Thank you so much, Wreck.
#     Merged Atari-Dude mod files (April 10, 2025)
# v3: Merged Atari-Dude mod files (July 20, 2025)
# --- end carried-over text ---

# --- stage declarations from tools/aio/stages/mod_aio_darknoon.txt (fojo-authored), re-slugged by slugmod ---
# ==========================================================================
# mod_darknoon_stages
#
# DERIVED WORK - NOT ORIGINAL. This mod is a repackaging of
# PD_AIO_March_2026/mod_dark_noon for the pd-fojo modloader. It carries the
# Dark Noon multiplayer arena:
#   - the stage declaration below
#   - level data: bgdata/, Ump_setupmp7Z, P* props
#   - the textures that stage uses
#
# Deliberately left out of this mod:
#   - 127 C* character models -> see mod_aio_characters / mod_gex_characters
#   - 38 G* gun and hand models -> byte-identical AIO baseline, not stage content
#
# The source modconfig declares NOTHING - it is comments only. Upstream runs
# this level by shipping bg_mp7 under the plain vanilla name, which collides
# with mod_gex_stages' own bg_mp7 and resolves by roster order. Every file
# here has been through slugmod, so that cannot happen: this mod's bytes are
# its own and the block below is what makes the level reachable.
#
# The block names the level rather than picking a stage row. There is no
# STAGE_EXTRA row labelled for Dark Noon, so it takes whichever free one the
# allocator gives it, recorded under [MpStageSlots] in pd.ini.
#
# Every credit line in the source modconfig.txt is reproduced below
# unaltered. The level work is the original author's.
# ==========================================================================

# --- begin credits and revision history carried over from
# --- PD_AIO_March_2026/mod_dark_noon/modconfig.txt, verbatim ---
# Dark Noon Mod for All in One Mod v3
# Author: Jonaeru / Atari-Dude

# Dark Noon by MRKane

# Revision History
# v2: Replaced Skedar and Dr. Carroll Models last version by Wreck. Thank you so much, Wreck.
#     Merged Atari-Dude mod files (April 10, 2025)
# v3: Merged Atari-Dude mod files (July 20, 2025)
# --- end carried-over credits ---

stage "darknoon" {
  bgfile "bgdata/bg_mp7_aio_darknoon.seg"
  tilesfile "bgdata/bg_mp7_tiles_aio_darknoonZ"
  padsfile "bgdata/bg_mp7_pads_aio_darknoonZ"
  mpsetupfile "Ump_setupmp7_aio_darknoonZ"
  kind mp
  arenaname "Valley"
  author "MRKane"
  # lifted 2026-09-20 (lift-out/lift.py rule 3c): langbank lang.c:198 (STAGE_TEST_MP7 -> LANGBANK_MP7); allocation pdmain.c:153 (STAGE_TEST_MP7); env env.c:160 (STAGE_TEST_MP7 nofog, 'Valley')
  langbank MP7
  allocation "-ml0 -me0 -mgfx200 -mvtx200 -ma400"
  env {
    near 10
    far 14096
    distfade 0 0 0
    sky 0x110015
    suns none
    clouds 0 3000 0 0x3a1100
    water 0 0 0 0x000000
    cloudsheight 0
    transparency 0
  }
}

# --- 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 "darknoon_mi6" {
  bgfile "bgdata/bg_crad_aio_darknoon.seg"
  tilesfile "bgdata/bg_crad_tiles_aio_darknoonZ"
  padsfile "bgdata/bg_crad_pads_aio_darknoonZ"
  mpsetupfile "Ump_setupcrad_aio_darknoonZ"
  kind mp
  arenaname "MI6"
  # from jonaeru @ d3e4205: row 0x5e STAGE_EXTRA34 (Additional); arena name L_MPMENU in the AIO LmpmenuE bank
  langbank CRAD   # lang.c:249
  allocation "-ml0 -me0 -mgfx200 -mvtx200 -ma400"   # pdmain.c:203
  # no env.c row for this stage upstream
}
#
stage "darknoon_submarine" {
  bgfile "bgdata/bg_oat_aio_darknoon.seg"
  tilesfile "bgdata/bg_oat_tiles_aio_darknoonZ"
  padsfile "bgdata/bg_oat_pads_aio_darknoonZ"
  mpsetupfile "Ump_setupoat_aio_darknoonZ"
  kind mp
  arenaname "Submarine"
  # from jonaeru @ d3e4205: row 0x5f STAGE_EXTRA35 (Additional); arena name L_MPMENU in the AIO LmpmenuE bank
  langbank OAT   # lang.c:250
  allocation "-ml0 -me0 -mgfx200 -mvtx200 -ma400"   # pdmain.c:204
  # no env.c row for this stage upstream
}
#
stage "darknoon_silo_surprise" {
  bgfile "bgdata/bg_mp3_aio_darknoon.seg"
  tilesfile "bgdata/bg_mp3_tiles_aio_darknoonZ"
  padsfile "bgdata/bg_mp3_pads_aio_darknoonZ"
  mpsetupfile "Ump_setupmp3_aio_darknoonZ"
  kind mp
  arenaname "Silo Surprise"
  # from jonaeru @ d3e4205: row 0x60 STAGE_EXTRA36 (Additional); arena name L_MPMENU in the AIO LmpmenuE bank
  langbank MP3   # lang.c:251
  allocation "-ml0 -me0 -mgfx200 -mvtx200 -ma400"   # pdmain.c:205
  # no env.c row for this stage upstream
}
#
# --- the bug where silo surprise's props came in at vanilla scale ---
# Ported from jonaeru/perfect_dark @ d3e4205. That tree gives Dark Noon its
# own copy of the prop table, g_DarkNoonModelStates
# (src/game/modeldata/general.c:1305), picked in objInitWithModelDef when
# g_ModNum == MOD_DARKNOON (src/game/propobj.c:2091). Diffed against vanilla
# g_ModelStates in the same file it differs in exactly these two rows, both
# tagged "// Silo Surprise" upstream; no file field differs. The work is
# jonaeru's; only the mechanism is ours.
#
# Without it the retina lock renders at vanilla 1.0, ten times too big, and
# the TTB box at vanilla 0x0066, about a quarter of its intended size.
#
# 0.099853515625 is exactly 409/4096 = 0x0199; the parser truncates, so see
# mod_aio_gex for why not 0.1. Like mod_aio_gex's, this block must stay LAST:
# a malformed ModelStates aborts the parse of everything after it.
ModelStates {
  0x0153 { Scale 0.099853515625 }   # PretinalockZ  vanilla 0x1000
  0x0193 { Scale 0.099853515625 }   # Pttb_boxZ     vanilla 0x0066
}
