Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
console/cmd: move /kill to libtrx
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Sep 20, 2024
1 parent 76dfd94 commit a9606f4
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 141 deletions.
1 change: 0 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ dll_sources = [
'src/game/console/cmd/exit_to_title.c',
'src/game/console/cmd/flipmap.c',
'src/game/console/cmd/fly.c',
'src/game/console/cmd/kill.c',
'src/game/console/cmd/load_game.c',
'src/game/console/cmd/play_demo.c',
'src/game/console/cmd/play_level.c',
Expand Down
124 changes: 0 additions & 124 deletions src/game/console/cmd/kill.c

This file was deleted.

5 changes: 0 additions & 5 deletions src/game/console/cmd/kill.h

This file was deleted.

2 changes: 1 addition & 1 deletion src/game/console/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "game/console/cmd/exit_to_title.h"
#include "game/console/cmd/flipmap.h"
#include "game/console/cmd/fly.h"
#include "game/console/cmd/kill.h"
#include "game/console/cmd/load_game.h"
#include "game/console/cmd/play_demo.h"
#include "game/console/cmd/play_level.h"
Expand All @@ -16,6 +15,7 @@
#include <libtrx/game/console/cmd/config.h>
#include <libtrx/game/console/cmd/give_item.h>
#include <libtrx/game/console/cmd/heal.h>
#include <libtrx/game/console/cmd/kill.h>
#include <libtrx/game/console/cmd/pos.h>
#include <libtrx/game/console/cmd/set_health.h>

Expand Down
2 changes: 1 addition & 1 deletion src/game/creature.c
Original file line number Diff line number Diff line change
Expand Up @@ -952,5 +952,5 @@ bool Creature_IsEnemy(const ITEM_INFO *const item)

bool Creature_IsAlly(const ITEM_INFO *const item)
{
return Object_IsObjectType(item->object_id, g_FriendObjects);
return Object_IsObjectType(item->object_id, g_AllyObjects);
}
6 changes: 0 additions & 6 deletions src/game/game_string.def
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,9 @@ GS_DEFINE(OSD_FLIPMAP_ON, "Flipmap set to ON")
GS_DEFINE(OSD_FLIPMAP_OFF, "Flipmap set to OFF")
GS_DEFINE(OSD_FLIPMAP_FAIL_ALREADY_ON, "Flipmap is already ON")
GS_DEFINE(OSD_FLIPMAP_FAIL_ALREADY_OFF, "Flipmap is already OFF")
GS_DEFINE(OSD_KILL_ALL, "Poof! %d enemies gone!")
GS_DEFINE(OSD_KILL_ALL_FAIL, "Uh-oh, there are no enemies left to kill...")
GS_DEFINE(OSD_KILL, "Bye-bye!")
GS_DEFINE(OSD_KILL_FAIL, "No enemy nearby...")
GS_DEFINE(OSD_COMPLETE_LEVEL, "Level complete!")
GS_DEFINE(OSD_PLAY_LEVEL, "Loading %s")
GS_DEFINE(OSD_INVALID_ROOM, "Invalid room: %d. Valid rooms are 0-%d")
GS_DEFINE(OSD_INVALID_OBJECT, "Invalid object")
GS_DEFINE(OSD_OBJECT_NOT_FOUND, "Object not found")
GS_DEFINE(OSD_INVALID_LEVEL, "Invalid level")
GS_DEFINE(OSD_INVALID_SAVE_SLOT, "Invalid save slot %d")
GS_DEFINE(OSD_UNKNOWN_COMMAND, "Unknown command: %s")
Expand Down
5 changes: 5 additions & 0 deletions src/game/items.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,3 +732,8 @@ int32_t Item_GetDistance(
{
return XYZ_32_GetDistance(&item->pos, target);
}

ITEM_INFO *Item_Get(const int16_t item_num)
{
return &g_Items[item_num];
}
2 changes: 1 addition & 1 deletion src/game/objects/vars.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const GAME_OBJECT_ID g_EnemyObjects[] = {
// clang-format on
};

const GAME_OBJECT_ID g_FriendObjects[] = {
const GAME_OBJECT_ID g_AllyObjects[] = {
// clang-format off
O_LARA,
O_WINSTON,
Expand Down
2 changes: 1 addition & 1 deletion src/game/objects/vars.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "global/types.h"

extern const GAME_OBJECT_ID g_EnemyObjects[];
extern const GAME_OBJECT_ID g_FriendObjects[];
extern const GAME_OBJECT_ID g_AllyObjects[];
extern const GAME_OBJECT_ID g_PickupObjects[];
extern const GAME_OBJECT_ID g_DoorObjects[];
extern const GAME_OBJECT_ID g_TrapdoorObjects[];
Expand Down

0 comments on commit a9606f4

Please sign in to comment.