Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions graph-item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ EX bool drawItemType(eItem it, cell *c, const shiftmatrix& V, color_t icol, int
}

else if(it == itBarrow && c) {
for(int i = 0; i<c->landparam; i++)
queuepolyat(Vit * spin(TAU * i / c->landparam) * xpush(.15 * cgi.scalefactor) * spinptick(1500, 0), *xsh, darkena(icol, 0, hidden ? 0x40 :
for(int i = 0; i<barrowCount(c); i++)
queuepolyat(Vit * spin(TAU * i / barrowCount(c)) * xpush(.15 * cgi.scalefactor) * spinptick(1500, 0), *xsh, darkena(icol, 0, hidden ? 0x40 :
(highwall(c) && wmspatial) ? 0x60 : 0xFF),
PPR::HIDDEN);
}
Expand Down
2 changes: 1 addition & 1 deletion help.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ EX void describeMouseover() {
if(c->item && !itemHiddenFromSight(c)) {
out += ", ";
out += XLAT1(iinf[c->item].name);
if(c->item == itBarrow) out += " (x" + its(c->landparam) + ")";
if(c->item == itBarrow) out += " (x" + its(barrowCount(c)) + ")";
#if CAP_COMPLEX2
if(c->land == laHunting) {
int i = ambush::size(c, c->item);
Expand Down
12 changes: 10 additions & 2 deletions items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ EX bool collectItem(cell *c2, cell *last, bool telekinesis IS(false)) {
int q_el = items[itElemental];

if(c2->item == itBarrow)
for(int i=0; i<c2->landparam; i++) gainItem(c2->item);
for(int i=0; i<barrowCount(c2); i++) gainItem(c2->item);
else if(c2->item) gainItem(c2->item);

if(c2->item && items[c2->item] > q && (vid.bubbles_all || (threshold_met(items[c2->item]) > threshold_met(q) && vid.bubbles_threshold))) {
Expand Down Expand Up @@ -742,7 +742,7 @@ EX void collectMessage(cell *c2, eItem which) {
addMessage(XLAT("A castle in the Crossroads..."));
else if(which == itShard) ;
else {
int qty = (which == itBarrow) ? c2->landparam : 1;
int qty = (which == itBarrow) ? barrowCount(c2) : 1;
string t;
if(which == itBarrow && items[which] < 25 && items[which] + qty >= 25)
t = XLAT("Your energy swords get stronger!");
Expand All @@ -758,4 +758,12 @@ EX bool itemHiddenFromSight(cell *c) {
&& !(shmup::on && shmup::boatAt(c)) && !(c->cpdist <= 1 && playerInWater());
}

EX int barrowCount(cell *c) {
// This should always be 2 or 3.
// Clamping to exactly that would make bugs go unnoticed.
// Not clamping at all would lead to freezes when it's absurdly large.
// Clamping to [1,4] means any incorrect values will be apparent but not game-breaking.
return min(max(c->landparam, 1), 4);
}

}