Add assistance to fire-command
Allows the fire-command to autowield a launcher; it will now do either swapweapon or wield an appropriate launcher, if you have ammo quivered. This assistance can be turned off with the fireassist boolean option. Adds a rudimentary command queue, which allows the code to add keys or extended commands into the queue, and they're executed as if the user did them. Time passes normally when doing the queue, and the queue will get cleared if hero is interrupted.
This commit is contained in:
@@ -644,6 +644,25 @@ struct _create_particular_data {
|
||||
#define LUA_VER_BUFSIZ 20
|
||||
#define LUA_COPYRIGHT_BUFSIZ 120
|
||||
|
||||
/*
|
||||
* Rudimentary command queue.
|
||||
* Allows the code to put keys and extended commands into the queue,
|
||||
* and they're executed just as if the user did them. Time passes
|
||||
* normally when doing queued actions. The queue will get cleared
|
||||
* if hero is interrupted.
|
||||
*/
|
||||
enum cmdq_cmdtypes {
|
||||
CMDQ_KEY = 0, /* a literal character, cmdq_add_key() */
|
||||
CMDQ_EXTCMD, /* extended command, cmdq_add_ec() */
|
||||
};
|
||||
|
||||
struct _cmd_queue {
|
||||
int typ;
|
||||
char key;
|
||||
const struct ext_func_tab *ec_entry;
|
||||
struct _cmd_queue *next;
|
||||
};
|
||||
|
||||
/*
|
||||
* 'g' -- instance_globals holds engine state that does not need to be
|
||||
* persisted upon game exit. The initialization state is well defined
|
||||
@@ -656,6 +675,8 @@ struct _create_particular_data {
|
||||
*/
|
||||
struct instance_globals {
|
||||
|
||||
struct _cmd_queue *command_queue;
|
||||
|
||||
/* apply.c */
|
||||
int jumping_is_magic; /* current jump result of magic */
|
||||
int polearm_range_min;
|
||||
|
||||
@@ -199,12 +199,17 @@ extern char randomkey(void);
|
||||
extern void random_response(char *, int);
|
||||
extern int rnd_extcmd_idx(void);
|
||||
extern int domonability(void);
|
||||
extern const struct ext_func_tab *ext_func_tab_from_func(int(*)(void));
|
||||
extern char cmd_from_func(int(*)(void));
|
||||
extern const char *cmdname_from_func(int(*)(void), char *, boolean);
|
||||
extern boolean redraw_cmd(char);
|
||||
extern const char *levltyp_to_name(int);
|
||||
extern void reset_occupations(void);
|
||||
extern void set_occupation(int(*)(void), const char *, int);
|
||||
extern void cmdq_add_ec(int(*)(void));
|
||||
extern void cmdq_add_key(char);
|
||||
extern struct _cmd_queue *cmdq_pop(void);
|
||||
extern void cmdq_clear(void);
|
||||
extern char pgetchar(void);
|
||||
extern void pushch(char);
|
||||
extern void savech(char);
|
||||
|
||||
@@ -293,6 +293,7 @@ struct instance_flags {
|
||||
#endif
|
||||
boolean clicklook; /* allow right-clicking for look */
|
||||
boolean cmdassist; /* provide detailed assistance for some comnds */
|
||||
boolean fireassist; /* autowield launcher when using fire-command */
|
||||
boolean time_botl; /* context.botl for 'time' (moves) only */
|
||||
boolean wizweight; /* display weight of everything in wizard mode */
|
||||
boolean wizmgender; /* test gender info from core in window port */
|
||||
|
||||
@@ -170,6 +170,8 @@ opt_##a,
|
||||
&iflags.extmenu)
|
||||
NHOPTB(female, 0, opt_in, set_in_config, Off, Yes, No, No, "male",
|
||||
&flags.female)
|
||||
NHOPTB(fireassist, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias,
|
||||
&iflags.fireassist)
|
||||
NHOPTB(fixinv, 0, opt_out, set_in_game, On, Yes, No, No, NoAlias,
|
||||
&flags.invlet_constant)
|
||||
NHOPTC(font_map, 40, opt_in, set_gameview, Yes, Yes, Yes, No, NoAlias,
|
||||
|
||||
Reference in New Issue
Block a user