Skip to content

Commit

Permalink
Hexen: Define skill 6 using l_sk_unm
Browse files Browse the repository at this point in the history
Hexen doesn't have Dehacked, so there is no need to use l_sk_unm mechanism for skill 6 definition.
But for consistency reason use l_sk_unm
  • Loading branch information
Dasperal committed Nov 11, 2023
1 parent dfa0a43 commit 4798286
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 50 deletions.
1 change: 1 addition & 0 deletions src/hexen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ if(RD_COMPILE_HEXEN)
ct_chat.h
d_net.c
f_finale.c
g_sk_unm.c
g_game.c
h2def.h
h2_main.c
Expand Down
61 changes: 11 additions & 50 deletions src/hexen/g_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@


#include <string.h>
#include "g_sk_unm.h"
#include "m_random.h"
#include "h2def.h"
#include "s_sound.h"
Expand Down Expand Up @@ -1938,59 +1939,19 @@ void G_InitNew(skill_t skill, int episode, int map)
usergame = true; // will be set false if a demo
}

// [JN] Ultra-Nightmare definitions
if (skill == sk_ultranm)
{
// Monster's speed // Old value Who
mobjinfo[MT_FIREDEMON].speed = 20; // 13 Affrit

// Monster's missiles speed // Old value What
mobjinfo[MT_FIREDEMON_FX6].speed = 13 * FRACUNIT; // 10 Affrit fireball
mobjinfo[MT_DEMON2FX1].speed = 18 * FRACUNIT; // 15 Brown Chaos Serpent fireball
mobjinfo[MT_BISH_FX].speed = 13 * FRACUNIT; // 10 Dark Bishop fireball
mobjinfo[MT_DEMONFX1].speed = 18 * FRACUNIT; // 15 Green Chaos Serpent fireball
mobjinfo[MT_WRAITHFX1].speed = 17 * FRACUNIT; // 14 Reiver fireball
mobjinfo[MT_CENTAUR_FX].speed = 23 * FRACUNIT; // 20 Slaughtaur fireball
mobjinfo[MT_SERPENTFX].speed = 18 * FRACUNIT; // 15 Stalker fireball
mobjinfo[MT_ICEGUY_FX].speed = 17 * FRACUNIT; // 14 Wendige fireball 1
mobjinfo[MT_ICEGUY_FX2].speed = 13 * FRACUNIT; // 10 Wendige fireball 2

// Monster's damage // Old value What
mobjinfo[MT_FIREDEMON_FX6].damage = 2; // 1 Fire Gargolye fireball
mobjinfo[MT_DEMON2FX1].damage = 6; // 5 Brown Chaos Serpent fireball
mobjinfo[MT_BISH_FX].damage = 2; // 1 Dark Bishop fireball
mobjinfo[MT_DEMONFX1].damage = 6; // 5 Green Chaos Serpent fireball
mobjinfo[MT_WRAITHFX1].damage = 6; // 5 Reiver fireball
mobjinfo[MT_CENTAUR_FX].damage = 5; // 4 Slaughtaur fireball
mobjinfo[MT_SERPENTFX].damage = 5; // 4 Stalker fireball
}
// [JN] Fallback to standard values
else
// [JN] Make sure speeds are really only applied once.
static boolean attrs_saved;
if (!attrs_saved)
{
// Monster's speed
mobjinfo[MT_FIREDEMON].speed = 13;

// Monster's missiles speed
mobjinfo[MT_FIREDEMON_FX6].speed = 10 * FRACUNIT;
mobjinfo[MT_DEMON2FX1].speed = 15 * FRACUNIT;
mobjinfo[MT_BISH_FX].speed = 10 * FRACUNIT;
mobjinfo[MT_DEMONFX1].speed = 15 * FRACUNIT;
mobjinfo[MT_WRAITHFX1].speed = 14 * FRACUNIT;
mobjinfo[MT_CENTAUR_FX].speed = 20 * FRACUNIT;
mobjinfo[MT_SERPENTFX].speed = 15 * FRACUNIT;
mobjinfo[MT_ICEGUY_FX].speed = 14 * FRACUNIT;
mobjinfo[MT_ICEGUY_FX2].speed = 10 * FRACUNIT;

// Monster's damage
mobjinfo[MT_FIREDEMON_FX6].damage = 1;
mobjinfo[MT_DEMON2FX1].damage = 5;
mobjinfo[MT_BISH_FX].damage = 1;
mobjinfo[MT_DEMONFX1].damage = 5;
mobjinfo[MT_WRAITHFX1].damage = 5;
mobjinfo[MT_CENTAUR_FX].damage = 4;
mobjinfo[MT_SERPENTFX].damage = 4;
// First, keep original info as separated values.
// FIXME: Move UNM_Save_Atters call to bootstrap sequence before game starts
UNM_Save_Atters();
attrs_saved = true;
}

// [JN] Ultra Nightmare definitions:
UNM_Apply_Restore_Atters(skill);

paused = false;
// [JN] Reset automap scale. Fixes:
// https://doomwiki.org/wiki/Automap_scale_preserved_after_warps_in_Heretic_and_Hexen
Expand Down
44 changes: 44 additions & 0 deletions src/hexen/g_sk_unm.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//
// Copyright(C) 2016-2023 Julian Nechaevsky
// Copyright(C) 2020-2023 Leonid Murin (Dasperal)
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//

#include "l_sk_unm.h"
#include "g_sk_unm.h"

#include "info.h"
#include "m_fixed.h"

#define ENUMERATE_UNM_CHANGES(O) \
/* Monster's speed */ \
O(MT_FIREDEMON, speed, + 7) /* Affrit (13 to 20) */ \
/* Monster's missiles speed */ \
O(MT_FIREDEMON_FX6, speed, + (3 * FRACUNIT)) /* Affrit fireball (10 to 13) */ \
O(MT_DEMON2FX1, speed, + (3 * FRACUNIT)) /* Brown Chaos Serpent fireball (15 to 18) */ \
O(MT_BISH_FX, speed, + (3 * FRACUNIT)) /* Dark Bishop fireball (10 to 13) */ \
O(MT_DEMONFX1, speed, + (3 * FRACUNIT)) /* Green Chaos Serpent fireball (15 to 18) */ \
O(MT_WRAITHFX1, speed, + (3 * FRACUNIT)) /* Reiver fireball (14 to 17) */ \
O(MT_CENTAUR_FX, speed, + (3 * FRACUNIT)) /* Slaughtaur fireball (20 to 23) */ \
O(MT_SERPENTFX, speed, + (3 * FRACUNIT)) /* Stalker fireball (15 to 18) */ \
O(MT_ICEGUY_FX, speed, + (3 * FRACUNIT)) /* Wendige fireball 1 (14 to 17) */ \
O(MT_ICEGUY_FX2, speed, + (3 * FRACUNIT)) /* Wendige fireball 2 (10 to 13) */ \
/* Monster's damage */ \
O(MT_FIREDEMON_FX6, damage, + 1) /* Fire Gargolye fireball (1 to 2) */ \
O(MT_DEMON2FX1, damage, + 1) /* Brown Chaos Serpent fireball (5 to 6) */ \
O(MT_BISH_FX, damage, + 1) /* Dark Bishop fireball (1 to 2) */ \
O(MT_DEMONFX1, damage, + 1) /* Green Chaos Serpent fireball (5 to 6) */ \
O(MT_WRAITHFX1, damage, + 1) /* Reiver fireball (5 to 6) */ \
O(MT_CENTAUR_FX, damage, + 1) /* Slaughtaur fireball (4 to 5) */ \
O(MT_SERPENTFX, damage, + 1) /* Stalker fireball (4 to 5) */

UNM_IMPLEMENT(ENUMERATE_UNM_CHANGES)

0 comments on commit 4798286

Please sign in to comment.