1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-25 09:30:35 +00:00

crossbow:: crossbow icon works

This commit is contained in:
Zeno Rogue 2023-10-26 12:32:09 +02:00
parent f3398e70c3
commit 33d48a76b3
3 changed files with 26 additions and 4 deletions

View File

@ -548,15 +548,17 @@ EX void handleKeyNormal(int sym, int uni) {
if(sym == '.' || sym == 's') movepcto(-1, 1);
if((sym == SDLK_DELETE || sym == SDLK_KP_PERIOD || sym == 'g') && uni != 'G' && uni != 'G'-64)
movepcto(MD_DROP, 1);
if(sym == 't' && uni != 'T' && uni != 'T'-64 && canmove) {
if(sym == 't' && uni != 'T' && uni != 'T'-64 && canmove) {
cell *target = GDIM == 3 ? mouseover : centerover;
if(playermoved && items[itStrongWind]) {
cell *c = whirlwind::jumpDestination(cwt.at);
if(c) target = c;
}
targetRangedOrb(target, roKeyboard);
if(bow::fire_mode) bow::add_fire(target);
else targetRangedOrb(target, roKeyboard);
sym = 0; uni = 0;
}
if(sym == 'f') bow::switch_fire_mode();
}
if(sym == SDLK_KP5 && DEFAULTCONTROL && !game_keys_scroll) movepcto(-1, 1);
@ -613,7 +615,10 @@ EX void handleKeyNormal(int sym, int uni) {
actonrelease = false;
multi::cpid = 0;
if(mouseover &&
if(bow::fire_mode) {
if(mouseover) bow::add_fire(mouseover);
}
else if(mouseover &&
targetclick && (shmup::on ? numplayers() == 1 && !shmup::pc[0]->dead : true) && targetRangedOrb(mouseover, forcetarget ? roMouseForce : roMouse)) {
}
else if(forcetarget)

View File

@ -933,6 +933,11 @@ EX bool drawItemType(eItem it, cell *c, const shiftmatrix& V, color_t icol, int
queuepoly(Vit * spinptick(750, 0), cgi.shTriangle, darkena(icol, 0, 255));
}
else if(it == itCrossbow) {
queuepoly(Vit, cgi.shCrossbowIcon, getcs().bowcolor);
queuepoly(Vit, cgi.shCrossbowstringIcon, getcs().bowcolor2);
}
else if(it == itBabyTortoise) {
int bits = c ? tortoise::babymap[c] : tortoise::last;
int over = c && c->monst == moTortoise;

14
hud.cpp
View File

@ -46,6 +46,7 @@ EX int subclass(int i) {
#define GLYPH_TARGET 512
#define GLYPH_INSQUARE 1024
#define GLYPH_INLANDSCAPE 2048
#define GLYPH_ACTIVE 4096
#if HDR
enum eGlyphsortorder {
@ -68,6 +69,7 @@ int& ikmerge(int i) {
bool ikappear(int i) {
if(i == itInventory && inv::on) return true;
if(i == itCrossbow && bow::crossbow_mode()) return true;
return ikmerge(i);
}
@ -142,7 +144,11 @@ int glyphflags(int gid) {
int f = 0;
if(gid < ittypes) {
eItem i = eItem(gid);
if(itemclass(i) == IC_NAI && i != itFatigue) f |= GLYPH_NONUMBER;
if(itemclass(i) == IC_NAI && i != itFatigue && i != itCrossbow) f |= GLYPH_NONUMBER;
if(i == itCrossbow && items[i] == 0) {
if(bow::fire_mode) f |= GLYPH_ACTIVE;
f |= GLYPH_NONUMBER;
}
if(isElementalShard(i)) {
f |= GLYPH_LOCAL | GLYPH_INSQUARE;
if(i == localshardof(cwt.at->land)) f |= GLYPH_LOCAL2;
@ -229,6 +235,7 @@ bool displayglyph(int cx, int cy, int buttonsize, char glyph, color_t color, int
if(glyph == ']') bsize = bsize*1.5;
if(glyph == 'x') bsize = bsize*1.5;
if(it == itWarning) bsize *= 2;
if(it == itCrossbow) bsize *= 2;
if(it == itBombEgg || it == itTrollEgg || it == itDodeca) bsize = bsize*3/2;
int icol = color;
icol -= (color & 0xFCFCFC) >> 2;
@ -266,6 +273,7 @@ bool displayglyph(int cx, int cy, int buttonsize, char glyph, color_t color, int
if(flags & GLYPH_LOCAL2) fl += "+";
else if(flags & GLYPH_LOCAL) fl += "-";
if(flags & GLYPH_DEMON) fl += "X";
if(flags & GLYPH_ACTIVE) fl += "A";
if(flags & GLYPH_MARKOVER) str += "!";
if(fl != "")
@ -326,6 +334,10 @@ void displayglyph2(int cx, int cy, int buttonsize, int i) {
mouseovers += XLAT(" (click to use)");
getcstat = 'i';
}
if(it == itCrossbow) {
mouseovers += XLAT(" (click to use)");
getcstat = 'f';
}
if(imp & GLYPH_LOCAL) mouseovers += XLAT(" (local treasure)");
help = generateHelpForItem(it);
}