Skip to content

Commit

Permalink
Baby Mode cheat
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlaux committed May 19, 2024
1 parent 5d02e64 commit 62904cc
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 40 deletions.
39 changes: 3 additions & 36 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,11 @@
## New Features

- Restored **_Selective Fuzz Darkening_** setting [by @ceski-1]
- **_Level Stats Format_** settings
- Removed _Kills % in Stats display_ setting in favor of them
- **Minimap zooming** (keyboard only)
- **NUGHUD:**
- Text-line stacks
- Replaced `x == -1` _Messages_ hack with dedicated `nughud_message_defx` toggle [1]
- Removed `nughud_time_sts` in favor of stacks [1]
- Status-Bar chunks
- User-chosen `hud_widget_layout` support
- **Automap color for trigger lines**
- **Key-binding for Computer Area Map cheat**
- Toggle to **disable the Killough-face easter egg**
- Toggle to **make attackers face fuzzy targets straight**
- Toggle to **allow Level Stats icons**
- **_'BABYMODE'_ cheat**, to toggle ITYTD benefits

## Changes

- **Merged changes from [Woof! 14.5.0](https://github.com/fabiangreffrath/woof/releases/tag/woof_14.5.0)**, note:
- Removed Nugget's `all` autoload folder in favor of Woof's `all-all`
- Changed `nughud_secret_y` default to match default Boom HUD
- **NUGHUD:**
- **Changed defaults** to make use of stacks and further match the default WOOFHUD [1]
- **Improved Y-position of standalone Chat**
- **Made Status Bar elements be drawn before HUD elements**, as was before 3.0.0 [1]
- **Rewind improvements:**
- Only delete key frames when rewinding within less than 0.6 seconds since the last rewind
- "Aligned" key-framing time
- **Adjusted spawning height of _Bloodier Gibbing_ blood splats**
- **Support for _Milestone Completion Announcements_ in multiplayer**
- **Lengthened FOV slider**
- **Removed temporary support for "Nugget 2.4.0" saves**
None.

## Bug Fixes

- **Sky being distorted by zoom effect**
- **_Show Stats/Time_ toggle affecting Automap instead of HUD when on Minimap**
- **NUGHUD view offset behaving incorrectly** (should now match pre-3.0.0 behavior) [1]
- **_Cycle Chasecam_ and _Toggle Crosshair_ inputs eating inputs**
- **Crosshair jumping vertically when changing screen size to Status Bar from NUGHUD with view offset**

**[1].** This may affect existing NUGHUDs.
None.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ All of these are CFG-Only, so their CVAR names are included.

### Cheats

- **_'BABYMODE'_** to toggle ITYTD benefits
- **_'FULLCLIP'_** for infinite ammo
- **_'VALIANT'_** for fast weapons [i.b. ZDoom]
- **_'BOBBERS'_** serves as a shortcut to toggle the two cheats mentioned above, plus IDFA
Expand Down
6 changes: 5 additions & 1 deletion docs/cheats.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ Toggle the display of rendering stats, including frame rate and the current numb

## New Nugget Doom cheats

Most of them were taken from or inspired by other ports - see `README.md` for credits.
Most of them were taken from or inspired by other ports -- see `README.md` for credits.

`BABYMODE`
Toggle benefits from the ITYTD skill on any skill level;
pickups give double ammo and damage dealt to the player is halved.

`FULLCLIP`
Toggle infinite ammo.
Expand Down
8 changes: 8 additions & 0 deletions src/d_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ boolean nomonsters; // working -nomonsters
boolean respawnparm; // working -respawn
boolean fastparm; // working -fast

// [Nugget]
boolean doubleammoparm;
boolean halfdamageparm;

boolean singletics = false; // debug flag to cancel adaptiveness

//jff 1/22/98 parms for disabling music and sound
Expand Down Expand Up @@ -2191,6 +2195,10 @@ void D_DoomMain(void)

devparm = M_CheckParm ("-devparm");

// [Nugget]
doubleammoparm = false;
halfdamageparm = false;

//!
// @category net
// @vanilla
Expand Down
8 changes: 8 additions & 0 deletions src/doomstat.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ extern boolean respawnparm; // checkparm of -respawn
extern boolean fastparm; // checkparm of -fast
extern boolean devparm; // DEBUG: launched with -devparm

// [Nugget]
extern boolean doubleammoparm;
extern boolean halfdamageparm;

extern int screenblocks; // killough 11/98

// -----------------------------------------------------
Expand Down Expand Up @@ -212,6 +216,10 @@ extern int timelimit;
// Nightmare mode flag, single player.
extern boolean respawnmonsters;

// [Nugget]
extern boolean doubleammo;
extern boolean halfdamage;

// Netgame? Only true if >1 player.
extern boolean netgame;
extern boolean solonet;
Expand Down
13 changes: 13 additions & 0 deletions src/g_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ int gameepisode;
int gamemap;
mapentry_t* gamemapinfo;

// [Nugget]
boolean doubleammo;
boolean halfdamage;

// If non-zero, exit the level after this number of minutes.
int timelimit;

Expand Down Expand Up @@ -4094,6 +4098,13 @@ void G_SetFastParms(int fast_pending)
}
}

// [Nugget]
void G_SetBabyModeParms(const skill_t skill)
{
doubleammo = skill == sk_baby || skill == sk_nightmare || CASUALPLAY(doubleammoparm);
halfdamage = skill == sk_baby || CASUALPLAY(halfdamageparm);
}

mapentry_t *G_LookupMapinfo(int episode, int map)
{
int i;
Expand Down Expand Up @@ -4205,6 +4216,8 @@ void G_InitNew(skill_t skill, int episode, int map)

respawnmonsters = skill == sk_nightmare || respawnparm;

G_SetBabyModeParms(skill); // [Nugget]

// force players to be initialized upon first level load
for (i=0 ; i<MAXPLAYERS ; i++)
players[i].playerstate = PST_REBORN;
Expand Down
6 changes: 5 additions & 1 deletion src/g_game.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,18 @@ extern int bodyquesize, default_bodyquesize; // killough 2/8/98, 10/98
extern int pars[][10]; // hardcoded array size
extern int cpars[]; // hardcoded array size

// [Nugget] Rewind -----------------------------------------------------------
// [Nugget] ------------------------------------------------------------------

// Rewind
extern void G_SetRewindCountdown(int value);
extern void G_EnableRewind(void);
extern void G_Rewind(void);
extern void G_ClearExcessKeyFrames(void);
extern boolean G_KeyFrameRW(void);

// Misc
void G_SetBabyModeParms(const skill_t skill);

#endif

//----------------------------------------------------------------------------
Expand Down
15 changes: 15 additions & 0 deletions src/m_cheat.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ static void cheat_showfps(); // [FG] FPS counter widget

static void cheat_nomomentum();
static void cheat_fauxdemo(); // Emulates demo/net play state, for debugging
static void cheat_babymode(); // Toggles double ammo and half damage as in ITYTD
static void cheat_infammo(); // Infinite ammo cheat
static void cheat_fastweaps(); // Fast weapons cheat
static void cheat_bobbers(); // Shortcut to the two cheats above
Expand Down Expand Up @@ -382,6 +383,7 @@ struct cheat_s cheat[] = {

{"nomomentum", NULL, not_net | not_demo, {cheat_nomomentum} },
{"fauxdemo", NULL, not_net | not_demo, {cheat_fauxdemo} }, // Emulates demo/net play state, for debugging
{"babymode", NULL, not_net | not_demo, {cheat_babymode} }, // Toggles double ammo and half damage as in ITYTD
{"fullclip", NULL, not_net | not_demo, {cheat_infammo} }, // Infinite ammo cheat
{"valiant", NULL, not_net | not_demo, {cheat_fastweaps} }, // Fast weapons cheat
{"bobbers", NULL, not_net | not_demo, {cheat_bobbers} }, // Shortcut for the two above cheats
Expand Down Expand Up @@ -459,6 +461,17 @@ static void cheat_fauxdemo()
displaymsg("Fauxdemo %s", fauxdemo ? "ON" : "OFF");
}

// Toggles double ammo and half damage as in ITYTD
static void cheat_babymode()
{
static boolean status = false;

displaymsg("Baby Mode %s", (status = !status) ? "ON" : "OFF");

doubleammoparm = halfdamageparm = status;
G_SetBabyModeParms(gameskill);
}

// Infinite ammo
static void cheat_infammo()
{
Expand Down Expand Up @@ -1253,6 +1266,8 @@ static void cheat_skill(char *buf)

G_SetFastParms(fastparm || gameskill == sk_nightmare);
respawnmonsters = gameskill == sk_nightmare || respawnparm;

G_SetBabyModeParms(gameskill); // [Nugget]
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/p_inter.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ boolean P_GiveAmmo(player_t *player, ammotype_t ammo, int num)
num = clipammo[ammo]/2;

// give double ammo in trainer mode, you'll need in nightmare
if (gameskill == sk_baby || gameskill == sk_nightmare)
if (doubleammo) // [Nugget]
num <<= 1;

oldammo = player->ammo[ammo];
Expand Down Expand Up @@ -1000,7 +1000,7 @@ void P_DamageMobjBy(mobj_t *target,mobj_t *inflictor, mobj_t *source, int damage
target->momx = target->momy = target->momz = 0;

player = target->player;
if (player && gameskill == sk_baby)
if (player && halfdamage) // [Nugget]
damage >>= 1; // take half damage in trainer mode

// Some close combat weapons should not
Expand Down

0 comments on commit 62904cc

Please sign in to comment.