Skip to content

Commit

Permalink
Changed jDoom: Enhanced 'give' ccmd - "give h" to give health (amount…
Browse files Browse the repository at this point in the history
… given is the normal maxHealth amount i.e., 100 by default).
  • Loading branch information
danij committed Dec 18, 2008
1 parent bf9f5af commit 0974d3b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions doomsday/plugins/jdoom/src/m_cheat.c
Expand Up @@ -145,12 +145,12 @@ void Cht_Init(void)
/**
* Responds to user input to see if a cheat sequence has been entered.
*
* @param ev Ptr to the event to respond to.
* @param ev Ptr to the event to respond to.
*/
boolean Cht_Responder(event_t *ev)
boolean Cht_Responder(event_t* ev)
{
int i;
player_t *plr = &players[CONSOLEPLAYER];
player_t* plr = &players[CONSOLEPLAYER];

if(G_GetGameState() != GS_MAP)
return false;
Expand Down Expand Up @@ -446,7 +446,7 @@ boolean Cht_WarpFunc(player_t* plyr, char* buf)
P_SetMessage(plyr, STSTR_CLEV, false);
G_DeferedInitNew(gameSkill, epsd, map);

// Clear the menu if open
// Clear the menu if open.
Hu_MenuCommand(MCMD_CLOSE);
briefDisabled = true;
return true;
Expand Down Expand Up @@ -672,6 +672,7 @@ DEFCC(CCmdCheatGive)
Con_Printf(" b - berserk\n");
Con_Printf(" f - the power of flight\n");
Con_Printf(" g - light amplification visor\n");
Con_Printf(" h - health\n");
Con_Printf(" i - invulnerability\n");
Con_Printf(" k - key cards/skulls\n");
Con_Printf(" m - computer area map\n");
Expand Down Expand Up @@ -750,6 +751,11 @@ DEFCC(CCmdCheatGive)
Cht_PowerUpFunc(plyr, PT_INFRARED);
break;

case 'h':
Con_Printf("Health given.\n");
P_GiveBody(plyr, maxHealth);
break;

case 'i':
Con_Printf("You feel invincible!\n");
Cht_PowerUpFunc(plyr, PT_INVULNERABILITY);
Expand Down

0 comments on commit 0974d3b

Please sign in to comment.