mirror of
https://github.com/LostArtefacts/TRX.git
synced 2025-04-28 12:47:58 +03:00
cmd: add flood and drain console commands
This commit is contained in:
parent
a698d85202
commit
1a05a732a2
6 changed files with 41 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
## [Unreleased](https://github.com/LostArtefacts/TRX/compare/tr1-4.8.3...develop) - ××××-××-××
|
||||
- added quadrilateral interpolation (#354)
|
||||
- added `/flood` and `/drain` console commands
|
||||
- added support for `-l`/`--level` argument to play a single level
|
||||
- added support for custom levels to use `disable_floor` in the gameflow, similar to TR2's Floating Islands (#2541)
|
||||
- added drawing of object mesh spheres to the `/debug` console command
|
||||
|
|
|
@ -22,6 +22,10 @@ Currently supported commands:
|
|||
`/flip on`
|
||||
Switches the global flipmap on or off, turning the reality around you on its head.
|
||||
|
||||
- `/flood`
|
||||
`/drain`
|
||||
Floods or drains the current room at will. For when drowning is preferable to puzzles!
|
||||
|
||||
- `/give {item_name}`
|
||||
`/give {num} {item_name}`
|
||||
`/give all`
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
- added a `/cheats` console command
|
||||
- added a `/wireframe` console command (#2500)
|
||||
- added a `/fps` console command
|
||||
- added `/flood` and `/drain` console commands
|
||||
- added support for `-l`/`--level` argument to play a single level
|
||||
- added Italian localization to the config tool
|
||||
- changed injections to a new file format with a smaller footprint, improved applicability tests and similar feature support as TR1 (#1967)
|
||||
|
|
|
@ -21,6 +21,10 @@ Currently supported commands:
|
|||
`/flip on`
|
||||
Switches the global flipmap on or off, turning the reality around you on its head.
|
||||
|
||||
- `/flood`
|
||||
`/drain`
|
||||
Floods or drains the current room at will. For when drowning is preferable to puzzles!
|
||||
|
||||
- `/give {item_name}`
|
||||
`/give {num} {item_name}`
|
||||
`/give all`
|
||||
|
|
30
src/libtrx/game/console/cmd/flood.c
Normal file
30
src/libtrx/game/console/cmd/flood.c
Normal file
|
@ -0,0 +1,30 @@
|
|||
#include "game/console/registry.h"
|
||||
#include "game/lara/common.h"
|
||||
#include "game/rooms.h"
|
||||
#include "strings.h"
|
||||
|
||||
static COMMAND_RESULT M_Entrypoint(const COMMAND_CONTEXT *ctx);
|
||||
|
||||
static COMMAND_RESULT M_Entrypoint(const COMMAND_CONTEXT *const ctx)
|
||||
{
|
||||
if (!String_IsEmpty(ctx->args)) {
|
||||
return CR_BAD_INVOCATION;
|
||||
}
|
||||
|
||||
ITEM *const lara_item = Lara_GetItem();
|
||||
if (lara_item == nullptr) {
|
||||
return CR_UNAVAILABLE;
|
||||
}
|
||||
|
||||
if (String_Equivalent(ctx->prefix, "flood")) {
|
||||
Room_Get(lara_item->room_num)->flags |= RF_UNDERWATER;
|
||||
} else if (String_Equivalent(ctx->prefix, "drain")) {
|
||||
Room_Get(lara_item->room_num)->flags &= ~RF_UNDERWATER;
|
||||
} else {
|
||||
return CR_UNAVAILABLE;
|
||||
}
|
||||
|
||||
return CR_SUCCESS;
|
||||
}
|
||||
|
||||
REGISTER_CONSOLE_COMMAND("flood|drain", M_Entrypoint)
|
|
@ -98,6 +98,7 @@ sources = [
|
|||
'game/console/cmd/exit_game.c',
|
||||
'game/console/cmd/exit_to_title.c',
|
||||
'game/console/cmd/flipmap.c',
|
||||
'game/console/cmd/flood.c',
|
||||
'game/console/cmd/fly.c',
|
||||
'game/console/cmd/give_item.c',
|
||||
'game/console/cmd/heal.c',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue