Skip to content

Commit

Permalink
Added set item bonuses to item details (see #21, #24)
Browse files Browse the repository at this point in the history
  • Loading branch information
collinsmith committed Mar 29, 2019
1 parent a0a09d1 commit 2981e52
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions core/src/com/riiablo/item/Item.java
Original file line number Diff line number Diff line change
Expand Up @@ -970,10 +970,29 @@ public int compare(Stat.Instance o1, Stat.Instance o2) {
add(new Label(text, font, Riiablo.colors.blue)).center().space(SPACING).row();
}
}
}

//PropertyList setProps = stats[SET_PROPS + 0]; // TODO: + num equipped set items
// TODO: add set property support
if (quality == SET) {
SetItems.Entry setItem = Riiablo.files.SetItems.get(qualityId);
int setId = Riiablo.files.Sets.index(setItem.set);
int numEquipped = owner.SETS_EQUIP.get(setId, 0);
assert numEquipped >= 1;
if (numEquipped >= 2) {
PropertyList setProps = stats[SET_PROPS + numEquipped - 2];
Array<Stat.Instance> aggregate = setProps.toArray();
aggregate.sort(new Comparator<Stat.Instance>() {
@Override
public int compare(Stat.Instance o1, Stat.Instance o2) {
return o2.entry.descpriority - o1.entry.descpriority;
}
});
for (Stat.Instance stat : aggregate) {
String text = stat.format(owner);
if (text == null) continue;
add(new Label(text, font, Riiablo.colors.green)).center().space(SPACING).row();
}
}
}
}

StringBuilder itemFlags = null;
if ((Item.this.flags & ETHEREAL) == ETHEREAL) {
Expand Down

0 comments on commit 2981e52

Please sign in to comment.