mirror of
https://github.com/LostArtefacts/TRX.git
synced 2025-04-28 20:58:07 +03:00
s_clock: add a turbo cheat to increase the game speed (#509)
* s_clock: add a turbo cheat to increase the game speed Resolves #135.
This commit is contained in:
parent
73e1301246
commit
261e9a74fe
14 changed files with 57 additions and 20 deletions
|
@ -2,6 +2,7 @@
|
|||
- added the option to pause sound in the inventory screen (#309)
|
||||
- added the ability to pick up multiple items at once with walk to items enabled (#505)
|
||||
- added the ability to skip pictures during fade animation (#510)
|
||||
- added a cheat to increase the game speed (#135)
|
||||
- fixed ghost margins during fade animation on HiDPI screens (#438)
|
||||
- fixed music rolling over to the main menu if main menu music disabled (#490)
|
||||
- fixed Unfinished Business gameflow not using basic / detailed stats strings (#497, regression from 2.7)
|
||||
|
|
|
@ -203,6 +203,7 @@ Not all options are turned on by default. Refer to `Tomb1Main.json5` for details
|
|||
- added a fly cheat
|
||||
- added a level skip cheat
|
||||
- added a door open cheat (while in fly mode)
|
||||
- added a cheat to increase the game speed
|
||||
- added ability to adjust Lara's starting health
|
||||
- added ability to disable all medpacks
|
||||
- added ability to disable Magnums
|
||||
|
|
|
@ -535,9 +535,10 @@
|
|||
"KEYMAP_ROLL": "Roll",
|
||||
"KEYMAP_INVENTORY": "Inventory",
|
||||
"KEYMAP_PAUSE": "Pause",
|
||||
"KEYMAP_FLY_CHEAT": "Fly cheat",
|
||||
"KEYMAP_ITEM_CHEAT": "Item cheat",
|
||||
"KEYMAP_LEVEL_SKIP_CHEAT": "Level skip",
|
||||
"KEYMAP_FLY_CHEAT": "Fly Cheat",
|
||||
"KEYMAP_ITEM_CHEAT": "Item Cheat",
|
||||
"KEYMAP_LEVEL_SKIP_CHEAT": "Level Skip",
|
||||
"KEYMAP_TURBO_CHEAT": "Turbo Speed",
|
||||
"KEYMAP_CAMERA_UP": "Camera Up",
|
||||
"KEYMAP_CAMERA_DOWN": "Camera Down",
|
||||
"KEYMAP_CAMERA_LEFT": "Camera Left",
|
||||
|
|
|
@ -164,9 +164,10 @@
|
|||
"KEYMAP_ROLL": "Roll",
|
||||
"KEYMAP_INVENTORY": "Inventory",
|
||||
"KEYMAP_PAUSE": "Pause",
|
||||
"KEYMAP_FLY_CHEAT": "Fly cheat",
|
||||
"KEYMAP_ITEM_CHEAT": "Item cheat",
|
||||
"KEYMAP_LEVEL_SKIP_CHEAT": "Level skip",
|
||||
"KEYMAP_FLY_CHEAT": "Fly Cheat",
|
||||
"KEYMAP_ITEM_CHEAT": "Item Cheat",
|
||||
"KEYMAP_LEVEL_SKIP_CHEAT": "Level Skip",
|
||||
"KEYMAP_TURBO_CHEAT": "Turbo Speed",
|
||||
"KEYMAP_CAMERA_UP": "Camera Up",
|
||||
"KEYMAP_CAMERA_DOWN": "Camera Down",
|
||||
"KEYMAP_CAMERA_LEFT": "Camera Left",
|
||||
|
|
|
@ -5,6 +5,19 @@
|
|||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
#define MAX_TURBO_SPEED_MUL 3
|
||||
|
||||
static int16_t m_TurboSpeedMul = 1;
|
||||
|
||||
void Clock_CycleTurboSpeed(void)
|
||||
{
|
||||
if (m_TurboSpeedMul >= MAX_TURBO_SPEED_MUL) {
|
||||
m_TurboSpeedMul = 1;
|
||||
} else {
|
||||
m_TurboSpeedMul++;
|
||||
}
|
||||
}
|
||||
|
||||
bool Clock_Init(void)
|
||||
{
|
||||
return S_Clock_Init();
|
||||
|
@ -22,7 +35,7 @@ int32_t Clock_Sync(void)
|
|||
|
||||
int32_t Clock_SyncTicks(int32_t target)
|
||||
{
|
||||
return S_Clock_SyncTicks(target);
|
||||
return S_Clock_SyncTicks(target) * m_TurboSpeedMul;
|
||||
}
|
||||
|
||||
void Clock_GetDateTime(char *date_time)
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
void Clock_CycleTurboSpeed(void);
|
||||
bool Clock_Init(void);
|
||||
int32_t Clock_GetMS(void);
|
||||
int32_t Clock_Sync(void);
|
||||
|
|
|
@ -100,6 +100,7 @@ static GAME_STRING_ID GameFlow_StringToGameStringID(const char *str)
|
|||
{ "KEYMAP_FLY_CHEAT", GS_KEYMAP_FLY_CHEAT },
|
||||
{ "KEYMAP_ITEM_CHEAT", GS_KEYMAP_ITEM_CHEAT },
|
||||
{ "KEYMAP_LEVEL_SKIP_CHEAT", GS_KEYMAP_LEVEL_SKIP_CHEAT },
|
||||
{ "KEYMAP_TURBO_CHEAT", GS_KEYMAP_TURBO_CHEAT },
|
||||
{ "KEYMAP_PAUSE", GS_KEYMAP_PAUSE },
|
||||
{ "KEYMAP_CAMERA_UP", GS_KEYMAP_CAMERA_UP },
|
||||
{ "KEYMAP_CAMERA_DOWN", GS_KEYMAP_CAMERA_DOWN },
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "game/input.h"
|
||||
|
||||
#include "specific/s_input.h"
|
||||
#include "src/game/clock.h"
|
||||
|
||||
#define DELAY_FRAMES 12
|
||||
#define HOLD_FRAMES 3
|
||||
|
@ -47,4 +48,8 @@ void Input_Update(void)
|
|||
{
|
||||
g_Input = S_Input_GetCurrentState();
|
||||
g_InputDB = Input_GetDebounced(g_Input);
|
||||
|
||||
if (g_InputDB.turbo_cheat) {
|
||||
Clock_CycleTurboSpeed();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include "3dsystem/phd_math.h"
|
||||
#include "config.h"
|
||||
#include "game/camera.h"
|
||||
#include "game/clock.h"
|
||||
#include "game/collide.h"
|
||||
#include "game/control.h"
|
||||
#include "game/gameflow.h"
|
||||
|
|
|
@ -37,6 +37,7 @@ static const TEXT_COLUMN_PLACEMENT CtrlTextPlacementNormal[] = {
|
|||
{ INPUT_KEY_RIGHT, 0 },
|
||||
{ INPUT_KEY_STEP_L, 0 },
|
||||
{ INPUT_KEY_STEP_R, 0 },
|
||||
{ INPUT_KEY_LOOK, 0 },
|
||||
{ INPUT_KEY_CAMERA_UP, 0 },
|
||||
{ INPUT_KEY_CAMERA_DOWN, 0 },
|
||||
{ INPUT_KEY_CAMERA_LEFT, 0 },
|
||||
|
@ -47,13 +48,14 @@ static const TEXT_COLUMN_PLACEMENT CtrlTextPlacementNormal[] = {
|
|||
{ INPUT_KEY_JUMP, 1 },
|
||||
{ INPUT_KEY_ACTION, 1 },
|
||||
{ INPUT_KEY_DRAW, 1 },
|
||||
{ INPUT_KEY_LOOK, 1 },
|
||||
{ INPUT_KEY_ROLL, 1 },
|
||||
{ -1, 1 },
|
||||
{ INPUT_KEY_OPTION, 1 },
|
||||
{ INPUT_KEY_PAUSE, 1 },
|
||||
{ -1, 1 },
|
||||
{ -1, 1 },
|
||||
{ -1, 1 },
|
||||
{ -1, 1 },
|
||||
{ -1, 1 },
|
||||
// end
|
||||
{ -1, -1 },
|
||||
};
|
||||
|
@ -66,6 +68,7 @@ static const TEXT_COLUMN_PLACEMENT CtrlTextPlacementCheats[] = {
|
|||
{ INPUT_KEY_RIGHT, 0 },
|
||||
{ INPUT_KEY_STEP_L, 0 },
|
||||
{ INPUT_KEY_STEP_R, 0 },
|
||||
{ INPUT_KEY_LOOK, 0 },
|
||||
{ INPUT_KEY_CAMERA_UP, 0 },
|
||||
{ INPUT_KEY_CAMERA_DOWN, 0 },
|
||||
{ INPUT_KEY_CAMERA_LEFT, 0 },
|
||||
|
@ -76,13 +79,14 @@ static const TEXT_COLUMN_PLACEMENT CtrlTextPlacementCheats[] = {
|
|||
{ INPUT_KEY_JUMP, 1 },
|
||||
{ INPUT_KEY_ACTION, 1 },
|
||||
{ INPUT_KEY_DRAW, 1 },
|
||||
{ INPUT_KEY_LOOK, 1 },
|
||||
{ INPUT_KEY_ROLL, 1 },
|
||||
{ INPUT_KEY_OPTION, 1 },
|
||||
{ INPUT_KEY_PAUSE, 1 },
|
||||
{ -1, 1 },
|
||||
{ INPUT_KEY_FLY_CHEAT, 1 },
|
||||
{ INPUT_KEY_ITEM_CHEAT, 1 },
|
||||
{ INPUT_KEY_LEVEL_SKIP_CHEAT, 1 },
|
||||
{ INPUT_KEY_TURBO_CHEAT, 1 },
|
||||
// end
|
||||
{ -1, -1 },
|
||||
};
|
||||
|
|
|
@ -1075,6 +1075,7 @@ typedef enum GAME_STRING_ID {
|
|||
GS_KEYMAP_FLY_CHEAT,
|
||||
GS_KEYMAP_ITEM_CHEAT,
|
||||
GS_KEYMAP_LEVEL_SKIP_CHEAT,
|
||||
GS_KEYMAP_TURBO_CHEAT,
|
||||
GS_KEYMAP_PAUSE,
|
||||
GS_KEYMAP_CAMERA_UP,
|
||||
GS_KEYMAP_CAMERA_DOWN,
|
||||
|
@ -1935,6 +1936,7 @@ typedef union INPUT_STATE {
|
|||
uint32_t fly_cheat : 1;
|
||||
uint32_t item_cheat : 1;
|
||||
uint32_t level_skip_cheat : 1;
|
||||
uint32_t turbo_cheat : 1;
|
||||
uint32_t health_cheat : 1;
|
||||
uint32_t camera_up : 1;
|
||||
uint32_t camera_down : 1;
|
||||
|
@ -1961,13 +1963,14 @@ typedef enum INPUT_KEY {
|
|||
INPUT_KEY_FLY_CHEAT = 13,
|
||||
INPUT_KEY_ITEM_CHEAT = 14,
|
||||
INPUT_KEY_LEVEL_SKIP_CHEAT = 15,
|
||||
INPUT_KEY_PAUSE = 16,
|
||||
INPUT_KEY_CAMERA_UP = 17,
|
||||
INPUT_KEY_CAMERA_DOWN = 18,
|
||||
INPUT_KEY_CAMERA_LEFT = 19,
|
||||
INPUT_KEY_CAMERA_RIGHT = 20,
|
||||
INPUT_KEY_CAMERA_RESET = 21,
|
||||
INPUT_KEY_NUMBER_OF = 22,
|
||||
INPUT_KEY_TURBO_CHEAT = 16,
|
||||
INPUT_KEY_PAUSE = 17,
|
||||
INPUT_KEY_CAMERA_UP = 18,
|
||||
INPUT_KEY_CAMERA_DOWN = 19,
|
||||
INPUT_KEY_CAMERA_LEFT = 20,
|
||||
INPUT_KEY_CAMERA_RIGHT = 21,
|
||||
INPUT_KEY_CAMERA_RESET = 22,
|
||||
INPUT_KEY_NUMBER_OF = 23,
|
||||
} INPUT_KEY;
|
||||
|
||||
typedef enum INPUT_LAYOUT {
|
||||
|
|
|
@ -58,9 +58,10 @@ GAMEFLOW_DEFAULT_STRING g_GameFlowDefaultStrings[] = {
|
|||
{ GS_KEYMAP_ROLL, "Roll" },
|
||||
{ GS_KEYMAP_INVENTORY, "Inventory" },
|
||||
{ GS_KEYMAP_PAUSE, "Pause" },
|
||||
{ GS_KEYMAP_FLY_CHEAT, "Fly cheat" },
|
||||
{ GS_KEYMAP_ITEM_CHEAT, "Item cheat" },
|
||||
{ GS_KEYMAP_LEVEL_SKIP_CHEAT, "Level skip" },
|
||||
{ GS_KEYMAP_FLY_CHEAT, "Fly Cheat" },
|
||||
{ GS_KEYMAP_ITEM_CHEAT, "Item Cheat" },
|
||||
{ GS_KEYMAP_LEVEL_SKIP_CHEAT, "Level Skip" },
|
||||
{ GS_KEYMAP_TURBO_CHEAT, "Turbo Speed" },
|
||||
{ GS_KEYMAP_CAMERA_UP, "Camera Up" },
|
||||
{ GS_KEYMAP_CAMERA_DOWN, "Camera Down" },
|
||||
{ GS_KEYMAP_CAMERA_LEFT, "Camera Left" },
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "specific/s_clock.h"
|
||||
|
||||
#include "config.h"
|
||||
#include "global/vars.h"
|
||||
|
||||
#include <windows.h>
|
||||
|
|
|
@ -35,6 +35,7 @@ static S_INPUT_KEYCODE m_Layout[2][INPUT_KEY_NUMBER_OF] = {
|
|||
DIK_O, // INPUT_KEY_FLY_CHEAT,
|
||||
DIK_I, // INPUT_KEY_ITEM_CHEAT,
|
||||
DIK_L, // INPUT_KEY_LEVEL_SKIP_CHEAT,
|
||||
DIK_TAB, // INPUT_KEY_TURBO_CHEAT,
|
||||
DIK_P, // INPUT_KEY_PAUSE,
|
||||
DIK_W, // INPUT_KEY_CAMERA_UP
|
||||
DIK_S, // INPUT_KEY_CAMERA_DOWN
|
||||
|
@ -61,6 +62,7 @@ static S_INPUT_KEYCODE m_Layout[2][INPUT_KEY_NUMBER_OF] = {
|
|||
DIK_O, // INPUT_KEY_FLY_CHEAT,
|
||||
DIK_I, // INPUT_KEY_ITEM_CHEAT,
|
||||
DIK_L, // INPUT_KEY_LEVEL_SKIP_CHEAT,
|
||||
DIK_TAB, // INPUT_KEY_TURBO_CHEAT,
|
||||
DIK_P, // INPUT_KEY_PAUSE,
|
||||
DIK_W, // INPUT_KEY_CAMERA_UP
|
||||
DIK_S, // INPUT_KEY_CAMERA_DOWN
|
||||
|
@ -441,6 +443,7 @@ INPUT_STATE S_Input_GetCurrentState(void)
|
|||
linput.item_cheat = S_Input_Key(INPUT_KEY_ITEM_CHEAT);
|
||||
linput.fly_cheat = S_Input_Key(INPUT_KEY_FLY_CHEAT);
|
||||
linput.level_skip_cheat = S_Input_Key(INPUT_KEY_LEVEL_SKIP_CHEAT);
|
||||
linput.turbo_cheat = S_Input_Key(INPUT_KEY_TURBO_CHEAT);
|
||||
linput.health_cheat = KEY_DOWN(DIK_F11);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue