This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#pragma once | ||
|
||
#include "../common.h" | ||
|
||
extern CONSOLE_COMMAND g_Console_Cmd_Die; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#include "game/console/cmd/die.h" | ||
|
||
#include "game/effects/exploding_death.h" | ||
#include "game/items.h" | ||
#include "game/lara/common.h" | ||
#include "game/objects/common.h" | ||
#include "game/objects/ids.h" | ||
#include "game/sound.h" | ||
|
||
static COMMAND_RESULT M_Entrypoint(const char *args); | ||
|
||
static COMMAND_RESULT M_Entrypoint(const char *const args) | ||
{ | ||
if (!Object_GetObject(O_LARA)->loaded) { | ||
return CR_UNAVAILABLE; | ||
} | ||
|
||
LARA_INFO *const lara = Lara_GetLaraInfo(); | ||
ITEM_INFO *const lara_item = Lara_GetItem(); | ||
if (lara_item->hit_points <= 0) { | ||
return CR_UNAVAILABLE; | ||
} | ||
|
||
Sound_Effect(SFX_LARA_FALL, &lara_item->pos, SPM_NORMAL); | ||
#if TR_VERSION == 1 | ||
Sound_Effect(SFX_EXPLOSION_CHEAT, &lara_item->pos, SPM_NORMAL); | ||
#endif | ||
Effect_ExplodingDeath(lara->item_num, -1, 1); | ||
|
||
lara_item->hit_points = 0; | ||
lara_item->flags |= IF_INVISIBLE; | ||
return CR_SUCCESS; | ||
} | ||
|
||
CONSOLE_COMMAND g_Console_Cmd_Die = { | ||
.prefix = "abortion|natlastinks", | ||
.proc = M_Entrypoint, | ||
}; |