mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-11 18:00:34 +00:00
crossbow:: fire_mode can now be enabled even while reloading
This commit is contained in:
parent
85fc2773b1
commit
6b8adfde9e
11
crossbow.cpp
11
crossbow.cpp
@ -220,15 +220,14 @@ EX bool fire_mode;
|
||||
|
||||
EX void switch_fire_mode() {
|
||||
if(!crossbow_mode()) { addMessage(XLAT("You fire an angry glance at your enemies.")); return; }
|
||||
if(items[itCrossbow]) { addMessage(XLAT("You need more time to reload your crossbow!")); return; }
|
||||
if(!fire_mode) {
|
||||
addMessage(XLAT("Double-click tile to fire."));
|
||||
addMessage(items[itCrossbow] ? XLAT("Note: cannot fire again yet. Turns to reload: %1.", its(items[itCrossbow])) : XLAT("Fire crossbow! Click to aim, click again to confirm."));
|
||||
fire_mode = true;
|
||||
clear_bowpath();
|
||||
targets = {};
|
||||
}
|
||||
else if(fire_mode) {
|
||||
addMessage(XLAT("Firing cancelled."));
|
||||
addMessage(items[itCrossbow] ? XLAT("Fire mode disabled.") : XLAT("Firing cancelled."));
|
||||
fire_mode = false;
|
||||
clear_bowpath();
|
||||
}
|
||||
@ -238,6 +237,12 @@ EX void add_fire(cell *c) {
|
||||
bool emp = target_at.empty();
|
||||
auto& t = target_at[c->cpdist];
|
||||
if(t == c && !bow::bowpath.empty()) {
|
||||
if(items[itCrossbow]) {
|
||||
clear_bowpath();
|
||||
addMessage(XLAT("Cannot fire again yet. Turns to reload: %1.", its(items[itCrossbow])));
|
||||
fire_mode = false;
|
||||
return;
|
||||
}
|
||||
clear_bowpath();
|
||||
checked_move_issue = miVALID;
|
||||
pcmove pcm;
|
||||
|
13
hud.cpp
13
hud.cpp
@ -145,9 +145,9 @@ int glyphflags(int gid) {
|
||||
if(gid < ittypes) {
|
||||
eItem i = eItem(gid);
|
||||
if(itemclass(i) == IC_NAI && i != itFatigue && i != itCrossbow) f |= GLYPH_NONUMBER;
|
||||
if(i == itCrossbow && items[i] == 0) {
|
||||
if(i == itCrossbow) {
|
||||
if(items[i] == 0) f |= GLYPH_NONUMBER;
|
||||
if(bow::fire_mode) f |= GLYPH_ACTIVE;
|
||||
f |= GLYPH_NONUMBER;
|
||||
}
|
||||
if(isElementalShard(i)) {
|
||||
f |= GLYPH_LOCAL | GLYPH_INSQUARE;
|
||||
@ -335,7 +335,14 @@ void displayglyph2(int cx, int cy, int buttonsize, int i) {
|
||||
getcstat = 'i';
|
||||
}
|
||||
if(it == itCrossbow) {
|
||||
mouseovers += XLAT(" (click to use)");
|
||||
if(items[it])
|
||||
mouseovers += XLAT(" (turns to reload: %1)", its(items[it]));
|
||||
else if(items[it] && bow::fire_mode)
|
||||
mouseovers += XLAT(" (fire mode on / turns to reload: %1)", its(items[it]));
|
||||
else if(bow::fire_mode)
|
||||
mouseovers += XLAT(" (fire mode on)");
|
||||
else
|
||||
mouseovers += XLAT(" (click to fire)");
|
||||
getcstat = 'f';
|
||||
}
|
||||
if(imp & GLYPH_LOCAL) mouseovers += XLAT(" (local treasure)");
|
||||
|
Loading…
Reference in New Issue
Block a user