reworked some arguments

This commit is contained in:
2024-07-15 15:26:28 -04:00
parent 9ad553706a
commit 55d269a220
3 changed files with 12 additions and 13 deletions

View File

@ -38,12 +38,10 @@ feature proc_args(int argc, char **argv,
result |= FEATURE_NCURSES;
} else if (str == "-r") {
result |= FEATURE_RAND_MAP;
} else if (str == "-m") {
result |= FEATURE_MENU;
} else if (str == "-c") {
result |= FEATURE_ENEMIES_CHASE;
} else if (str == "-C") {
result |= FEATURE_COLORFUL;
} else if (str == "-d") {
result |= FEATURE_DOORS;
} else if (str == "-i") {
result |= FEATURE_INVENTORY;
} else if (str == "-t") {
@ -167,8 +165,8 @@ void panic_args(feature panic) {
void print_args_list() {
static const char *ARGS_LIST = "-n : Use ncurses for I/O\n\
-r : Randomly generate maps\n\
-m : Enabled a main menu + options\n\
-c : Enemies chase the player (CAUTION: THEY CAN REALLY CHASE!!!)\n\
-d : Enemies can go through doors (CAUTION: DO NOT ENABLE WITH CHASING!)\n\
-i : Enable inventory (player can pick up potions)\n\
-t : Enable throw\n\
-R : Enable revisiting levels\n\

View File

@ -114,12 +114,11 @@ static const feature FEATURE_THROW = 1 << 4;
static const feature FEATURE_REVISIT = 1 << 5;
static const feature FEATURE_WALK_OVER = 1 << 6;
static const feature FEATURE_SEED = 1 << 7;
static const feature FEATURE_MENU = 1 << 8;
static const feature FEATURE_IN_FILE = 1 << 9;
static const feature FEATURE_OUT_FILE = 1 << 10;
static const feature FEATURE_EXTRA_STUFF = 1 << 11;
static const feature FEATURE_EXTRA_LEVELS = 1 << 12;
static const feature FEATURE_COLORFUL = 1 << 13;
static const feature FEATURE_IN_FILE = 1 << 8;
static const feature FEATURE_OUT_FILE = 1 << 9;
static const feature FEATURE_EXTRA_STUFF = 1 << 10;
static const feature FEATURE_EXTRA_LEVELS = 1 << 11;
static const feature FEATURE_DOORS = 1 << 12;
static const feature FEATURE_PANIC_SEED = 1 << 27;
static const feature FEATURE_PANIC_FILE = 1 << 28;

View File

@ -28,7 +28,9 @@ long_result enemy_base::act(level *lvl, character *pc, bool hostile) {
for (int i = 0; i < DIRECTION_CNT; ++i) {
tmp = pos + MOVE[i];
if (lvl->is_available(tmp) &&
if (((enabled_features & FEATURE_DOORS) ? true
: lvl->get_room(tmp) == room_num) &&
lvl->is_available(tmp) &&
distance_sqr(tmp, pc->get_pos()) <
distance_sqr(target, pc->get_pos()))
target = tmp;
@ -42,7 +44,7 @@ long_result enemy_base::act(level *lvl, character *pc, bool hostile) {
position choices[DIRECTION_CNT];
for (int i = 0; i < DIRECTION_CNT; ++i)
if (((enabled_features & FEATURE_ENEMIES_CHASE) ?
if (((enabled_features & FEATURE_DOORS) ?
true : lvl->get_room(pos + MOVE[i]) == room_num ) &&
lvl->is_available(pos + MOVE[i])) {
choices[choices_cnt] = pos + MOVE[i];