mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-23 14:30:08 +00:00
Show dice type/value on mouseover
This commit is contained in:
parent
8c6aba5f6f
commit
362c6f673f
@ -1153,6 +1153,12 @@ EX namespace dice {
|
|||||||
return isDie(c->wall) || isDie(c->monst);
|
return isDie(c->wall) || isDie(c->monst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EX string describe(cell *c) {
|
||||||
|
if (!data.count(c)) return "BUG: die data missing";
|
||||||
|
else if (!data[c].which) return "BUG: die data default-initialized";
|
||||||
|
else return XLAT("d%1 rolled %2", its(data[c].which->faces), its(data[c].val + 1));
|
||||||
|
}
|
||||||
|
|
||||||
EX void roll(movei mi) {
|
EX void roll(movei mi) {
|
||||||
auto &cto = mi.t;
|
auto &cto = mi.t;
|
||||||
auto &th = mi.s;
|
auto &th = mi.s;
|
||||||
|
7
help.cpp
7
help.cpp
@ -945,6 +945,9 @@ EX void describeMouseover() {
|
|||||||
|
|
||||||
if(c->wall == waRose) out += " (" + its(7-rosephase) + ")";
|
if(c->wall == waRose) out += " (" + its(7-rosephase) + ")";
|
||||||
if(c->wall == waTerraWarrior) out += " (" + its(c->landparam) + ")";
|
if(c->wall == waTerraWarrior) out += " (" + its(c->landparam) + ")";
|
||||||
|
#if CAP_COMPLEX2
|
||||||
|
if(isDie(c->wall)) out += " (" + dice::describe(c) + ")";
|
||||||
|
#endif
|
||||||
|
|
||||||
if((c->wall == waBigTree || c->wall == waSmallTree) && c->land != laDryForest)
|
if((c->wall == waBigTree || c->wall == waSmallTree) && c->land != laDryForest)
|
||||||
help =
|
help =
|
||||||
@ -972,6 +975,10 @@ EX void describeMouseover() {
|
|||||||
|
|
||||||
else if(c->monst) {
|
else if(c->monst) {
|
||||||
out += ", "; out += XLAT1(minf[c->monst].name);
|
out += ", "; out += XLAT1(minf[c->monst].name);
|
||||||
|
#if CAP_COMPLEX2
|
||||||
|
if(isDie(c->monst))
|
||||||
|
out += " (" + dice::describe(c) + ")";
|
||||||
|
#endif
|
||||||
if(hasHitpoints(c->monst))
|
if(hasHitpoints(c->monst))
|
||||||
out += " (" + its(c->hitpoints)+" HP)";
|
out += " (" + its(c->hitpoints)+" HP)";
|
||||||
if(isMutantIvy(c))
|
if(isMutantIvy(c))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user