Apply a wielded polearm with fire-command
Wield a polearm and use 'f'ire to automatically hit with it, if there's a single valid target. With fireassist-option, will swapweapon to a polearm. This only applies if quiver is empty and autoquiver is off.
This commit is contained in:
@@ -799,6 +799,7 @@ If your wielded weapon has the throw-and-return property, your quiver
|
|||||||
is empty, and
|
is empty, and
|
||||||
.op autoquiver
|
.op autoquiver
|
||||||
is false, you will throw that wielded weapon instead of filling the quiver.
|
is false, you will throw that wielded weapon instead of filling the quiver.
|
||||||
|
This will also automatically use a polearm if wielded.
|
||||||
If
|
If
|
||||||
.op fireassist
|
.op fireassist
|
||||||
is true, firing will automatically try to wield a launcher (for example,
|
is true, firing will automatically try to wield a launcher (for example,
|
||||||
@@ -1244,7 +1245,8 @@ You can set the
|
|||||||
.op paranoid_confirmation:quit
|
.op paranoid_confirmation:quit
|
||||||
option to require a response of \f(CRyes\fP instead.
|
option to require a response of \f(CRyes\fP instead.
|
||||||
.lp "#fire "
|
.lp "#fire "
|
||||||
Fire ammunition from quiver, possibly autowielding a launcher.
|
Fire ammunition from quiver, possibly autowielding a launcher,
|
||||||
|
or hit with a wielded polearm.
|
||||||
Default key is \(oqf\(cq.
|
Default key is \(oqf\(cq.
|
||||||
.lp "#force "
|
.lp "#force "
|
||||||
Force a lock.
|
Force a lock.
|
||||||
|
|||||||
@@ -896,6 +896,7 @@ computer pick something appropriate if {\it autoquiver\/} is true.
|
|||||||
If your wielded weapon has the throw-and-return property, your quiver
|
If your wielded weapon has the throw-and-return property, your quiver
|
||||||
is empty, and {\it autoquiver\/}
|
is empty, and {\it autoquiver\/}
|
||||||
is false, you will throw that wielded weapon instead of filling the quiver.
|
is false, you will throw that wielded weapon instead of filling the quiver.
|
||||||
|
This will also automatically use a polearm if wielded.
|
||||||
If {\it fireassist\/} is true, firing will automatically try to wield a launcher
|
If {\it fireassist\/} is true, firing will automatically try to wield a launcher
|
||||||
(for example, a bow or a sling) matching the ammo in the quiver; this might
|
(for example, a bow or a sling) matching the ammo in the quiver; this might
|
||||||
take multiple turns, and get interrupted by a monster.
|
take multiple turns, and get interrupted by a monster.
|
||||||
@@ -1348,7 +1349,8 @@ You can set the
|
|||||||
option to require a response of ``{\tt yes}'' instead.
|
option to require a response of ``{\tt yes}'' instead.
|
||||||
%.lp
|
%.lp
|
||||||
\item[\tb{\#fire}]
|
\item[\tb{\#fire}]
|
||||||
Fire ammunition from quiver, possibly autowielding a launcher.
|
Fire ammunition from quiver, possibly autowielding a launcher,
|
||||||
|
or hit with a wielded polearm.
|
||||||
Default key is `{\tt f}'.
|
Default key is `{\tt f}'.
|
||||||
%.lp
|
%.lp
|
||||||
\item[\tb{\#force}]
|
\item[\tb{\#force}]
|
||||||
|
|||||||
@@ -725,6 +725,7 @@ apply runmode delay to multiturn actions, not just running
|
|||||||
if a giant carrying a boulder was on ice that melted, it could be killed
|
if a giant carrying a boulder was on ice that melted, it could be killed
|
||||||
twice, first by drowning, then by boulder filling the resulting pool
|
twice, first by drowning, then by boulder filling the resulting pool
|
||||||
when it dropped inventory before being removed from the map
|
when it dropped inventory before being removed from the map
|
||||||
|
allow fire-command to automatically use a polearm, if wielding it
|
||||||
|
|
||||||
|
|
||||||
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
|
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ extern boolean catch_lit(struct obj *);
|
|||||||
extern void use_unicorn_horn(struct obj **);
|
extern void use_unicorn_horn(struct obj **);
|
||||||
extern boolean tinnable(struct obj *);
|
extern boolean tinnable(struct obj *);
|
||||||
extern void reset_trapset(void);
|
extern void reset_trapset(void);
|
||||||
|
extern int use_pole(struct obj *, boolean);
|
||||||
extern void fig_transform(union any *, long);
|
extern void fig_transform(union any *, long);
|
||||||
extern int unfixable_trouble_count(boolean);
|
extern int unfixable_trouble_count(boolean);
|
||||||
|
|
||||||
|
|||||||
23
src/apply.c
23
src/apply.c
@@ -30,7 +30,6 @@ static void use_stone(struct obj *);
|
|||||||
static int set_trap(void); /* occupation callback */
|
static int set_trap(void); /* occupation callback */
|
||||||
static int use_whip(struct obj *);
|
static int use_whip(struct obj *);
|
||||||
static void display_polearm_positions(int);
|
static void display_polearm_positions(int);
|
||||||
static int use_pole(struct obj *);
|
|
||||||
static int use_cream_pie(struct obj *);
|
static int use_cream_pie(struct obj *);
|
||||||
static int jelly_ok(struct obj *);
|
static int jelly_ok(struct obj *);
|
||||||
static int use_royal_jelly(struct obj *);
|
static int use_royal_jelly(struct obj *);
|
||||||
@@ -3076,8 +3075,8 @@ display_polearm_positions(int state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Distance attacks by pole-weapons */
|
/* Distance attacks by pole-weapons */
|
||||||
static int
|
int
|
||||||
use_pole(struct obj *obj)
|
use_pole(struct obj *obj, boolean autohit)
|
||||||
{
|
{
|
||||||
const char thump[] = "Thump! Your blow bounces harmlessly off the %s.";
|
const char thump[] = "Thump! Your blow bounces harmlessly off the %s.";
|
||||||
int res = 0, typ, max_range, min_range, glyph;
|
int res = 0, typ, max_range, min_range, glyph;
|
||||||
@@ -3125,7 +3124,8 @@ use_pole(struct obj *obj)
|
|||||||
g.polearm_range_max = max_range;
|
g.polearm_range_max = max_range;
|
||||||
|
|
||||||
/* Prompt for a location */
|
/* Prompt for a location */
|
||||||
pline(where_to_hit);
|
if (!autohit)
|
||||||
|
pline(where_to_hit);
|
||||||
cc.x = u.ux;
|
cc.x = u.ux;
|
||||||
cc.y = u.uy;
|
cc.y = u.uy;
|
||||||
if (!find_poleable_mon(&cc, min_range, max_range) && hitm
|
if (!find_poleable_mon(&cc, min_range, max_range) && hitm
|
||||||
@@ -3135,16 +3135,21 @@ use_pole(struct obj *obj)
|
|||||||
cc.x = hitm->mx;
|
cc.x = hitm->mx;
|
||||||
cc.y = hitm->my;
|
cc.y = hitm->my;
|
||||||
}
|
}
|
||||||
getpos_sethilite(display_polearm_positions, get_valid_polearm_position);
|
if (!autohit) {
|
||||||
if (getpos(&cc, TRUE, "the spot to hit") < 0)
|
getpos_sethilite(display_polearm_positions, get_valid_polearm_position);
|
||||||
return res; /* ESC; uses turn iff polearm became wielded */
|
if (getpos(&cc, TRUE, "the spot to hit") < 0)
|
||||||
|
return res; /* ESC; uses turn iff polearm became wielded */
|
||||||
|
}
|
||||||
|
|
||||||
glyph = glyph_at(cc.x, cc.y);
|
glyph = glyph_at(cc.x, cc.y);
|
||||||
if (distu(cc.x, cc.y) > max_range) {
|
if (distu(cc.x, cc.y) > max_range) {
|
||||||
pline("Too far!");
|
pline("Too far!");
|
||||||
return res;
|
return res;
|
||||||
} else if (distu(cc.x, cc.y) < min_range) {
|
} else if (distu(cc.x, cc.y) < min_range) {
|
||||||
pline("Too close!");
|
if (autohit && cc.x == u.ux && cc.y == u.uy)
|
||||||
|
pline("Don't know what to hit.");
|
||||||
|
else
|
||||||
|
pline("Too close!");
|
||||||
return res;
|
return res;
|
||||||
} else if (!cansee(cc.x, cc.y) && !glyph_is_poleable(glyph)) {
|
} else if (!cansee(cc.x, cc.y) && !glyph_is_poleable(glyph)) {
|
||||||
You(cant_see_spot);
|
You(cant_see_spot);
|
||||||
@@ -3948,7 +3953,7 @@ doapply(void)
|
|||||||
default:
|
default:
|
||||||
/* Pole-weapons can strike at a distance */
|
/* Pole-weapons can strike at a distance */
|
||||||
if (is_pole(obj)) {
|
if (is_pole(obj)) {
|
||||||
res = use_pole(obj);
|
res = use_pole(obj, FALSE);
|
||||||
break;
|
break;
|
||||||
} else if (is_pick(obj) || is_axe(obj)) {
|
} else if (is_pick(obj) || is_axe(obj)) {
|
||||||
res = use_pick_axe(obj);
|
res = use_pick_axe(obj);
|
||||||
|
|||||||
@@ -417,7 +417,7 @@ find_launcher(struct obj *ammo)
|
|||||||
return (struct obj *)0;
|
return (struct obj *)0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* f command -- fire: throw from the quiver */
|
/* f command -- fire: throw from the quiver or use wielded polearm */
|
||||||
int
|
int
|
||||||
dofire(void)
|
dofire(void)
|
||||||
{
|
{
|
||||||
@@ -445,8 +445,21 @@ dofire(void)
|
|||||||
if (!flags.autoquiver) {
|
if (!flags.autoquiver) {
|
||||||
if (uwep && AutoReturn(uwep, uwep->owornmask))
|
if (uwep && AutoReturn(uwep, uwep->owornmask))
|
||||||
obj = uwep;
|
obj = uwep;
|
||||||
else
|
else {
|
||||||
You("have no ammunition readied.");
|
/* if we're wielding a polearm, apply it */
|
||||||
|
if (uwep && is_pole(uwep))
|
||||||
|
return use_pole(uwep, TRUE);
|
||||||
|
else if (iflags.fireassist
|
||||||
|
&& uswapwep && is_pole(uswapwep)
|
||||||
|
&& !(uswapwep->cursed && uswapwep->bknown)) {
|
||||||
|
/* we have a known not-cursed polearm as swap weapon.
|
||||||
|
swap to it and retry */
|
||||||
|
cmdq_add_ec(doswapweapon);
|
||||||
|
cmdq_add_ec(dofire);
|
||||||
|
return 0;
|
||||||
|
} else
|
||||||
|
You("have no ammunition readied.");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
autoquiver();
|
autoquiver();
|
||||||
if ((obj = uquiver) == 0)
|
if ((obj = uquiver) == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user