reworked some arguments
This commit is contained in:
@ -38,12 +38,10 @@ feature proc_args(int argc, char **argv,
|
|||||||
result |= FEATURE_NCURSES;
|
result |= FEATURE_NCURSES;
|
||||||
} else if (str == "-r") {
|
} else if (str == "-r") {
|
||||||
result |= FEATURE_RAND_MAP;
|
result |= FEATURE_RAND_MAP;
|
||||||
} else if (str == "-m") {
|
|
||||||
result |= FEATURE_MENU;
|
|
||||||
} else if (str == "-c") {
|
} else if (str == "-c") {
|
||||||
result |= FEATURE_ENEMIES_CHASE;
|
result |= FEATURE_ENEMIES_CHASE;
|
||||||
} else if (str == "-C") {
|
} else if (str == "-d") {
|
||||||
result |= FEATURE_COLORFUL;
|
result |= FEATURE_DOORS;
|
||||||
} else if (str == "-i") {
|
} else if (str == "-i") {
|
||||||
result |= FEATURE_INVENTORY;
|
result |= FEATURE_INVENTORY;
|
||||||
} else if (str == "-t") {
|
} else if (str == "-t") {
|
||||||
@ -167,8 +165,8 @@ void panic_args(feature panic) {
|
|||||||
void print_args_list() {
|
void print_args_list() {
|
||||||
static const char *ARGS_LIST = "-n : Use ncurses for I/O\n\
|
static const char *ARGS_LIST = "-n : Use ncurses for I/O\n\
|
||||||
-r : Randomly generate maps\n\
|
-r : Randomly generate maps\n\
|
||||||
-m : Enabled a main menu + options\n\
|
|
||||||
-c : Enemies chase the player (CAUTION: THEY CAN REALLY CHASE!!!)\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\
|
-i : Enable inventory (player can pick up potions)\n\
|
||||||
-t : Enable throw\n\
|
-t : Enable throw\n\
|
||||||
-R : Enable revisiting levels\n\
|
-R : Enable revisiting levels\n\
|
||||||
|
@ -114,12 +114,11 @@ static const feature FEATURE_THROW = 1 << 4;
|
|||||||
static const feature FEATURE_REVISIT = 1 << 5;
|
static const feature FEATURE_REVISIT = 1 << 5;
|
||||||
static const feature FEATURE_WALK_OVER = 1 << 6;
|
static const feature FEATURE_WALK_OVER = 1 << 6;
|
||||||
static const feature FEATURE_SEED = 1 << 7;
|
static const feature FEATURE_SEED = 1 << 7;
|
||||||
static const feature FEATURE_MENU = 1 << 8;
|
static const feature FEATURE_IN_FILE = 1 << 8;
|
||||||
static const feature FEATURE_IN_FILE = 1 << 9;
|
static const feature FEATURE_OUT_FILE = 1 << 9;
|
||||||
static const feature FEATURE_OUT_FILE = 1 << 10;
|
static const feature FEATURE_EXTRA_STUFF = 1 << 10;
|
||||||
static const feature FEATURE_EXTRA_STUFF = 1 << 11;
|
static const feature FEATURE_EXTRA_LEVELS = 1 << 11;
|
||||||
static const feature FEATURE_EXTRA_LEVELS = 1 << 12;
|
static const feature FEATURE_DOORS = 1 << 12;
|
||||||
static const feature FEATURE_COLORFUL = 1 << 13;
|
|
||||||
|
|
||||||
static const feature FEATURE_PANIC_SEED = 1 << 27;
|
static const feature FEATURE_PANIC_SEED = 1 << 27;
|
||||||
static const feature FEATURE_PANIC_FILE = 1 << 28;
|
static const feature FEATURE_PANIC_FILE = 1 << 28;
|
||||||
|
@ -28,7 +28,9 @@ long_result enemy_base::act(level *lvl, character *pc, bool hostile) {
|
|||||||
for (int i = 0; i < DIRECTION_CNT; ++i) {
|
for (int i = 0; i < DIRECTION_CNT; ++i) {
|
||||||
tmp = pos + MOVE[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(tmp, pc->get_pos()) <
|
||||||
distance_sqr(target, pc->get_pos()))
|
distance_sqr(target, pc->get_pos()))
|
||||||
target = tmp;
|
target = tmp;
|
||||||
@ -42,7 +44,7 @@ long_result enemy_base::act(level *lvl, character *pc, bool hostile) {
|
|||||||
position choices[DIRECTION_CNT];
|
position choices[DIRECTION_CNT];
|
||||||
|
|
||||||
for (int i = 0; i < DIRECTION_CNT; ++i)
|
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 ) &&
|
true : lvl->get_room(pos + MOVE[i]) == room_num ) &&
|
||||||
lvl->is_available(pos + MOVE[i])) {
|
lvl->is_available(pos + MOVE[i])) {
|
||||||
choices[choices_cnt] = pos + MOVE[i];
|
choices[choices_cnt] = pos + MOVE[i];
|
||||||
|
Reference in New Issue
Block a user