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

# ==========================================================================
# mod_aio_kakariko
#
# 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_kakariko'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_kakariko/modconfig.txt ---
# Kakariko Village Mod for All in One Mod v4
# Author: Jonaeru / Atari-Dude

# Kakariko Village by Sogun
# http://n64vault.com/pd-multi-levels:kakariko-village

# Golden Nintendo Maps by Sogun
# http://n64vault.com/ge-multi-levels:nintendo-classic-maps

# Revision History
# v1: Fixed some textures. Thank you so much, Atari-Dude. (Novenber 3, 2024)
#     Added models for coexistence with Perfect Dark Plus Mod
#     - Ccarroll2Z (Dr. Caroll Body/Head File)
#     - Cskedar2Z (Skedar Body/Head File)
#     - Ghand_carollZ (Dr. Caroll Hand File)
#     - Ghand_skedarZ (Skedar Hand File)
#     - CheadgreyZ (Joanna Dark (JP version))
#     - Gm16Z (AR53 (AR33))
#     - Gmp5kZ (DMC (D5K))
#     - GskorpionZ (KLO1313 (KLOBB))
# v2: Fixed doorknobs and pot tops models and bgdata. Thank you so much, Atari-Dude. (Novenber 29, 2024)
# v3: Replaced Skedar and Dr. Carroll Models last version by Wreck. Thank you so much, Wreck.
#     Merged Atari-Dude mod files (April 10, 2025)
# v4: Merged Atari-Dude mod files (July 20, 2025)

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

# --- stage declarations from tools/aio/stages/mod_aio_kakariko.txt (fojo-authored), re-slugged by slugmod ---
# --------------------------------------------------------------------------
# NOTE ON STAGE OWNERSHIP - read before adding stages here.
#
# 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 12 stage(s) by vanilla file
# mapping, of which 0 are claimed by a stage block below. The stage
# blocks below claim 1 stage(s) in total. The 12 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:
#   0x5  STAGE_EXTRA1
#   0x6  STAGE_EXTRA2
#   0x17  STAGE_MP_RAVINE
#   0x1f  STAGE_MP_COMPLEX
#   0x45  STAGE_MP_VILLA
#   0x4c  STAGE_TEST_MP20
#   0x53  STAGE_EXTRA18
#   0x54  STAGE_EXTRA19
#   0x56  STAGE_EXTRA21
#   0x58  STAGE_EXTRA23
#   0x59  STAGE_EXTRA24
#   0x5b  STAGE_EXTRA26
# --------------------------------------------------------------------------

stage "STAGE_24" {
  bgfile "bgdata/bg_mp20_aio_kakariko.seg"
  tilesfile "bgdata/bg_mp20_tiles_aio_kakarikoZ"
  padsfile "bgdata/bg_mp20_pads_aio_kakarikoZ"
  setupfile "Usetupmp20Z"
  mpsetupfile "Ump_setupmp20_aio_kakarikoZ"
  allocation "-ml0 -me0 -mgfx200 -mvtx200 -ma400"
  weather {
    exclude_rooms {
      clear
      0x05 0x06 0x07 0x08 0x0A 0x0B 0x0C 0x0D
      0x37 0x5B 0x5F 0x60 0x5D 0x1D 0x1F 0x27
      0x50 0x2C 0x2F 0x30 0x11 0x24 0x33 0x34
      0x35 0x36 0x3C 0x46 0x47 0x49 0x55 0x56
      0x5E 0x63 0x69 0x0D 0x16 0x4F 0x4B 0x3F
      0x13 0x19
    }
  }
  # STAGE_24 is in neither g_MpArenas_Vanilla nor g_SoloStages. This block
  # already declares full geometry plus both setups, and Ump_setupmp20Z carries
  # 12 spawns, 4 case points and 5 hills, so it can start a match.
  # Name taken from the mod's own LmpmenuE string, not invented.
  kind mp
  arenaname "Kakariko Village"
  author "Sogun"
  # lifted 2026-09-20 (lift-out/lift.py rule 3d): langbank lang.c:156 (STAGE_24 -> LANGBANK_SEVX); env env.c:60 (STAGE_24 fog, 'Stormy (Fixed far from 10000 to 20000)')
  langbank SEVX
  env {
    fog 996 1000
    near 10
    far 20000
    distfade 4000 7200 10
    sky 0x45454f
    suns none
    clouds 1 5000 0 0xb7bda5
    water 0 0 0 0x000000
    cloudsheight 0
  }
}

# --------------------------------------------------------------------------
# NO STAGE DECLARATIONS WERE ADDED WITH THE SLUG CONVERSION
#
# Every file in this mod now carries the mod's slug in its name and its path,
# and every manifest entry declares `source: self`, so the loose-file walk no
# longer hands this mod's geometry to a stage row the mod never declared.
#
# All four levels this mod ships - bg_arec, bg_mp13, bg_mp20 and bg_ref - are
# also shipped by mod_gex_stages with different bytes, so each of the four
# primary rows (0x03 STAGE_MP_RAVINE, 0x35 STAGE_MP_VILLA, 0x3c
# STAGE_TEST_MP20, 0x0b STAGE_MP_COMPLEX) is claimed by two packs and the
# conversion declared none of them. They are listed in stage-extra-rows.md at
# the umbrella root, which is where that choice gets made.
#
# The stage 0x24 block above is untouched and still claims Kakariko Village.
# --------------------------------------------------------------------------


# =========================================================================
# 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 "kakariko_arec" {
  bgfile "bgdata/bg_arec_aio_kakariko.seg"
  tilesfile "bgdata/bg_arec_tiles_aio_kakarikoZ"
  padsfile "bgdata/bg_arec_pads_aio_kakarikoZ"
  mpsetupfile "Ump_setuparec_aio_kakarikoZ"
  kind mp
  arenaname "Targitzan's Temple"
  author "Sogun"
  # lifted 2026-09-20 (lift-out/lift.py rule 3a): langbank lang.c:235 (STAGE_EXTRA19 -> LANGBANK_AREC); allocation pdmain.c:199 (STAGE_EXTRA19); env env.c:189 (STAGE_EXTRA19 nofog, 'Targitzan's Temple')
  langbank AREC
  allocation "-ml0 -me0 -mgfx200 -mvtx200 -ma400"
  env {
    near 15
    far 10000
    distfade 0 0 0
    sky 0x000000
    suns none
    clouds 1 5000 0 0x50280a
    water 0 -31000 0 0x000000
    cloudsheight 0
    transparency 1
  }
}

stage "kakariko_mp13" {
  bgfile "bgdata/bg_mp13_aio_kakariko.seg"
  tilesfile "bgdata/bg_mp13_tiles_aio_kakarikoZ"
  padsfile "bgdata/bg_mp13_pads_aio_kakarikoZ"
  mpsetupfile "Ump_setupmp13_aio_kakarikoZ"
  kind mp
  arenaname "War Colors"
  author "Sogun"
  # lifted 2026-09-20 (lift-out/lift.py rule 3a): langbank lang.c:244 (STAGE_EXTRA26 -> LANGBANK_MP13); allocation pdmain.c:208 (STAGE_EXTRA26); env env.c:186 (STAGE_EXTRA26 nofog, 'War Colors (Same as Villa MP, far from 10000 to 20000)')
  langbank MP13
  allocation "-ml0 -me0 -mgfx200 -mvtx200 -ma400"
  env {
    near 15
    far 20000
    distfade 0 0 0
    sky 0x8888dc
    suns none
    clouds 1 5000 0 0xffaa2a
    water 0 -5000 0 0x000000
    cloudsheight 0
    transparency 0
  }
}

stage "kakariko_ref" {
  bgfile "bgdata/bg_ref_aio_kakariko.seg"
  tilesfile "bgdata/bg_ref_tiles_aio_kakarikoZ"
  padsfile "bgdata/bg_ref_pads_aio_kakarikoZ"
  mpsetupfile "Ump_setupref_aio_kakarikoZ"
  kind mp
  arenaname "Tawfret Ruins"
  author "Sogun"
  # lifted 2026-09-20 (lift-out/lift.py rule 3a): langbank lang.c:234 (STAGE_EXTRA18 -> LANGBANK_REF); allocation pdmain.c:198 (STAGE_EXTRA18); env env.c:188 (STAGE_EXTRA18 nofog, 'Tawfret Ruins')
  langbank REF
  allocation "-ml0 -me0 -mgfx200 -mvtx200 -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
  }
}


