Skip to content

Commit

Permalink
Fixed everything
Browse files Browse the repository at this point in the history
  • Loading branch information
Daivuk committed Jul 31, 2023
1 parent d61e708 commit cfb6660
Show file tree
Hide file tree
Showing 10 changed files with 195 additions and 47 deletions.
Binary file modified APDOOM.WAD
Binary file not shown.
11 changes: 10 additions & 1 deletion ap_gen_tool/generate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,15 @@ int generate(game_t game)
has_ssg = true;
break;
}

total_item_count = 0;
total_loc_count = 0;
ap_items.clear();
ap_locations.clear();
item_name_groups.clear();
level_to_keycards.clear();
item_map.clear();

std::string cpp_out_dir = OArguments[3] + std::string("\\");
std::string pop_tracker_data_dir = OArguments[4] + std::string("\\");

Expand Down Expand Up @@ -521,7 +530,7 @@ int generate(game_t game)

add_item(lvl_name, -1, 1, PROGRESSION, "Levels", 0, level);
add_item(lvl_prefix + "Complete", -2, 1, PROGRESSION, "", 0, level);
add_item(lvl_prefix + "Computer area map", 2026, 1, FILLER, "", 0, level);
add_item(lvl_prefix + "Computer area map", 2026, 1, FILLER, "Computer area maps", 0, level);
}

OLog(std::to_string(total_loc_count) + " locations\n" + std::to_string(total_item_count - 3) + " items");
Expand Down
7 changes: 5 additions & 2 deletions create_release.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ REM REM Compiling launcher
MSBUILD Launcher\APDoomLauncher\APDoomLauncher.sln /t:APDoomLauncher /p:Configuration="Release"
COPY Launcher\APDoomLauncher\bin\Release\APDoomLauncher.exe Release\apdoom-launcher.exe

REM REM Archiving apworld
REM REM Archiving apworlds
DEL /F /Q ..\Archipelago\worlds\doom_1993\__pycache__
winrar a -afzip -ep1 -r Release\doom_1993.apworld ..\Archipelago\worlds\doom_1993

REM Generating default yaml
DEL /F /Q ..\Archipelago\worlds\doom_ii\__pycache__
winrar a -afzip -ep1 -r Release\doom_ii.apworld ..\Archipelago\worlds\doom_ii

REM Generating default yamls
python3 ..\Archipelago\Launcher.py "Generate Template Settings"
COPY "..\Archipelago\Players\Templates\DOOM 1993.yaml" "Release\DOOM 1993.yaml"
COPY "..\Archipelago\Players\Templates\DOOM II.yaml" "Release\DOOM II.yaml"
Expand Down
Binary file modified data/M_DOOM2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file renamed data/M_LVLSEL.png → data/M_KILL.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/archipelago/apdoom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,9 @@ void save_state()
if (!f.is_open())
{
printf("Failed to save AP state.\n");
#if WIN32
MessageBoxA(nullptr, "Failed to save player state. That's bad.", "Error", MB_OK);
#endif
return; // Ok that's bad. we won't save player state
}

Expand Down
2 changes: 1 addition & 1 deletion src/doom/g_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -2472,7 +2472,7 @@ void G_DoSaveGame (void)

char filename[260];

if (gamemode == commercial)
if (gamemode != commercial)
snprintf(filename, 260, "%s/save_E%iM%i.dsg", apdoom_get_seed(), gameepisode, gamemap);
else
snprintf(filename, 260, "%s/save_MAP%02i.dsg", apdoom_get_seed(), gamemap);
Expand Down
6 changes: 3 additions & 3 deletions src/doom/level_select.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ void play_level(int ep, int lvl)
{
// Check if level has a save file first
char filename[260];
if (gamemode == commercial)
if (gamemode != commercial)
snprintf(filename, 260, "%s/save_E%iM%i.dsg", apdoom_get_seed(), ep + 1, lvl + 1);
else
snprintf(filename, 260, "%s/save_MAP%02i.dsg", apdoom_get_seed(), lvl + 1);
Expand Down Expand Up @@ -471,8 +471,8 @@ void DrawEpisodicLevelSelectStats()
for (int i = 0; i < AP_LEVEL_COUNT; ++i)
{
level_pos_t* level_pos = &level_pos_infos[selected_ep][i];
ap_level_info_t* ap_level_info = ap_get_level_info(selected_ep + 1, i + i);
ap_level_state_t* ap_level_state = ap_get_level_state(selected_ep + 1, i + i);
ap_level_info_t* ap_level_info = ap_get_level_info(selected_ep + 1, i + 1);
ap_level_state_t* ap_level_state = ap_get_level_state(selected_ep + 1, i + 1);

x = level_pos->x;
y = level_pos->y;
Expand Down
33 changes: 29 additions & 4 deletions src/doom/m_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ static void M_ChooseSkill(int choice);
static void M_LoadGame(int choice);
static void M_SaveGame(int choice);
static void M_Options(int choice);
static void M_Kill(int choice);
static void M_EndGame(int choice);
static void M_ReadThis(int choice);
static void M_ReadThis2(int choice);
Expand Down Expand Up @@ -307,13 +308,15 @@ menu_t MainDef =
enum
{
ingamemenu_options,
ingamemenu_kill,
ingamemenu_quitdoom,
ingamemenu_end
} ingamemenu_e;

menuitem_t InGameMenu[]=
{
{1,"M_OPTION",M_Options,'o'},
{1,"M_KILL",M_Kill,'k'},
// Another hickup with Special edition.
{1,"M_QUITG",M_QuitDOOM,'q'}
};
Expand Down Expand Up @@ -1301,8 +1304,12 @@ void M_DrawMainMenu(void)
// [crispy] force status bar refresh
inhelpscreens = true;

V_DrawPatchDirect(94, 2,
W_CacheLumpName(DEH_String("M_DOOM"), PU_CACHE));
if (gamemode == commercial)
V_DrawPatchDirect(94, 2,
W_CacheLumpName(DEH_String("M_DOOM2"), PU_CACHE));
else
V_DrawPatchDirect(94, 2,
W_CacheLumpName(DEH_String("M_DOOM"), PU_CACHE));

draw_apdoom_version();
}
Expand All @@ -1316,8 +1323,12 @@ void M_InGameMenuDraw(void)
// [crispy] force status bar refresh
inhelpscreens = true;

V_DrawPatchDirect(94, 2,
W_CacheLumpName(DEH_String("M_DOOM"), PU_CACHE));
if (gamemode == commercial)
V_DrawPatchDirect(94, 2,
W_CacheLumpName(DEH_String("M_DOOM2"), PU_CACHE));
else
V_DrawPatchDirect(94, 2,
W_CacheLumpName(DEH_String("M_DOOM"), PU_CACHE));

draw_apdoom_version();
}
Expand Down Expand Up @@ -1732,6 +1743,20 @@ void M_Options(int choice)
M_SetupNextMenu(&OptionsDef);
}

void M_Kill(int choice)
{
if (players[consoleplayer].mo)
{
if (players[consoleplayer].mo->health > 0)
{
M_ClearMenus ();
P_KillMobj_Real(0, players[consoleplayer].mo, false);
return;
}
}
S_StartSoundOptional(NULL, sfx_mnusli, sfx_noway);
}

// [crispy] correctly handle inverted y-axis
static void M_Mouse(int choice)
{
Expand Down
180 changes: 144 additions & 36 deletions src/doom/p_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,20 @@ void P_LoadThings (int lump)
case 3006: // Lost soul
case 3005: // Cacodemon
case 3003: // Baron of hell

case 68: // Arachnotron
case 64: // Archvile
case 69: // Hell Knight
case 67: // Mancubus
case 71: // Pain Elemental
case 65: // Former Human Commando
case 66: // Revenant
case 84: // Wolf SS

//case 16: // Cyberdemon [Too big, keep them there]
//case 7: // Spiderdemon [Too big, keep them there]
//case 88: // Boss Brain
//case 89: // Boss Shooter
{
monsters[monster_count++] = mt->type;
indices[index_count++] = i;
Expand Down Expand Up @@ -629,6 +641,8 @@ void P_LoadThings (int lump)
case 3004: // Former Human
case 9: // Former Human Sergeant
case 3001: // Imp
case 65: // Former Human Commando
case 84: // Wolf SS
ratios[0]++;
total++;
indices[index_count++] = i;
Expand All @@ -638,16 +652,25 @@ void P_LoadThings (int lump)
case 58: // SPECTRE
case 3006: // Lost soul
case 3005: // Cacodemon
case 67: // Mancubus
case 71: // Pain Elemental
case 64: // Archvile
case 68: // Arachnotron
case 66: // Revenant
ratios[1]++;
total++;
indices[index_count++] = i;
break;

case 3003: // Baron of hell
case 69: // Hell Knight
ratios[2]++;
total++;
indices[index_count++] = i;
break;



}
}

Expand All @@ -665,53 +688,138 @@ void P_LoadThings (int lump)
continue;
}
}
switch (mt->type)
if (gamemode == commercial)
{
case 3004: // Former Human
case 9: // Former Human Sergeant
case 3001: // Imp
case 3002: // Demon
case 58: // SPECTRE
case 3006: // Lost soul
case 3005: // Cacodemon
case 3003: // Baron of hell
switch (mt->type)
{
int rnd = rand() % total;
if (rnd < ratios[0])
case 3004: // Former Human
case 9: // Former Human Sergeant
case 3001: // Imp
case 3002: // Demon
case 58: // SPECTRE
case 3006: // Lost soul
case 3005: // Cacodemon
case 3003: // Baron of hell

case 68: // Arachnotron
case 64: // Archvile
case 69: // Hell Knight
case 67: // Mancubus
case 71: // Pain Elemental

case 66: // Revenant
case 65: // Former Human Commando
case 84: // Wolf SS
{
switch (rand()%3)
int rnd = rand() % total;
if (rnd < ratios[0])
{
case 0: things_type_remap[indices[i]] = 3004; break; // Former Human
case 1: things_type_remap[indices[i]] = 9; break; // Former Human Sergeant
case 2: things_type_remap[indices[i]] = 3001; break; // Imp
switch (rand()%4)
{
case 0:
if (rand()%3) things_type_remap[indices[i]] = 3004; // Former Human
else things_type_remap[indices[i]] = 65; // Former Human Commando
break;
case 1: things_type_remap[indices[i]] = 9; break; // Former Human Sergeant
case 2: things_type_remap[indices[i]] = 3001; break; // Imp
case 3: things_type_remap[indices[i]] = 84; break; // Wolf SS
}
}
}
else if (rnd < ratios[0] + ratios[1])
{
switch (rand()%8)
else if (rnd < ratios[0] + ratios[1])
{
switch (rand()%18)
{
case 0: things_type_remap[indices[i]] = 3002; break; // Demon
case 1: things_type_remap[indices[i]] = 3002; break; // Demon
case 2: things_type_remap[indices[i]] = 3002; break; // Demon
case 3: things_type_remap[indices[i]] = 3002; break; // Demon
case 4: things_type_remap[indices[i]] = 3002; break; // Demon
case 5: things_type_remap[indices[i]] = 3002; break; // Demon
case 6: things_type_remap[indices[i]] = 58; break; // SPECTRE
case 7: things_type_remap[indices[i]] = 58; break; // SPECTRE
case 8: things_type_remap[indices[i]] = 58; break; // SPECTRE
case 9: things_type_remap[indices[i]] = 58; break; // SPECTRE
case 10: things_type_remap[indices[i]] = 3005; break; // Cacodemon
case 11: things_type_remap[indices[i]] = 3005; break; // Cacodemon
case 12: things_type_remap[indices[i]] = 3005; break; // Cacodemon
case 13:
if (rand()%2) things_type_remap[indices[i]] = 3005; // Cacodemon
else things_type_remap[indices[i]] = 71; // Pain Elemental
break;
case 14: things_type_remap[indices[i]] = 3006; break; // Lost soul
case 15:
if (rand()%5) things_type_remap[indices[i]] = 3006; // Lost soul
else things_type_remap[indices[i]] = 64; // Archvile
break;

case 16: things_type_remap[indices[i]] = 68; break; // Arachnotron
case 17: things_type_remap[indices[i]] = 67; break; // Mancubus
}
}
else
{
case 0: things_type_remap[indices[i]] = 3002; break; // Demon
case 1: things_type_remap[indices[i]] = 3002; break; // Demon
case 2: things_type_remap[indices[i]] = 3002; break; // Demon
case 3: things_type_remap[indices[i]] = 58; break; // SPECTRE
case 4: things_type_remap[indices[i]] = 58; break; // SPECTRE
case 5: things_type_remap[indices[i]] = 3005; break; // Cacodemon
case 6: things_type_remap[indices[i]] = 3005; break; // Cacodemon
case 7: things_type_remap[indices[i]] = 3006; break; // Lost soul
if (rand()%3) things_type_remap[indices[i]] = 69; // Hell Knight
else things_type_remap[indices[i]] = 3003; // Baron of hell
}
break;
}
else
case 16: // Cyberdemon
case 7: // Spiderdemon
if (rand()%2) things_type_remap[indices[i]] = 16;
else things_type_remap[indices[i]] = 7;
break;
}
}
else
{
switch (mt->type)
{
case 3004: // Former Human
case 9: // Former Human Sergeant
case 3001: // Imp
case 3002: // Demon
case 58: // SPECTRE
case 3006: // Lost soul
case 3005: // Cacodemon
case 3003: // Baron of hell
{
barron_count++;
things_type_remap[indices[i]] = 3003; // Baron of hell
int rnd = rand() % total;
if (rnd < ratios[0])
{
switch (rand()%3)
{
case 0: things_type_remap[indices[i]] = 3004; break; // Former Human
case 1: things_type_remap[indices[i]] = 9; break; // Former Human Sergeant
case 2: things_type_remap[indices[i]] = 3001; break; // Imp
}
}
else if (rnd < ratios[0] + ratios[1])
{
switch (rand()%8)
{
case 0: things_type_remap[indices[i]] = 3002; break; // Demon
case 1: things_type_remap[indices[i]] = 3002; break; // Demon
case 2: things_type_remap[indices[i]] = 3002; break; // Demon
case 3: things_type_remap[indices[i]] = 58; break; // SPECTRE
case 4: things_type_remap[indices[i]] = 58; break; // SPECTRE
case 5: things_type_remap[indices[i]] = 3005; break; // Cacodemon
case 6: things_type_remap[indices[i]] = 3005; break; // Cacodemon
case 7: things_type_remap[indices[i]] = 3006; break; // Lost soul
}
}
else
{
barron_count++;
things_type_remap[indices[i]] = 3003; // Baron of hell
}
break;
}
break;
case 16: // Cyberdemon
case 7: // Spiderdemon
if (rand()%2) things_type_remap[indices[i]] = 16;
else things_type_remap[indices[i]] = 7;
break;
}
case 16: // Cyberdemon
case 7: // Spiderdemon
if (rand()%2) things_type_remap[indices[i]] = 16;
else things_type_remap[indices[i]] = 7;
break;
}
}
}
Expand Down

0 comments on commit cfb6660

Please sign in to comment.