Added support for aggregating socket item properties with parent item properties

This commit is contained in:
Collin Smith 2019-03-28 02:33:40 -07:00
parent 207fe4fe97
commit 20b84c80b9

View File

@ -929,6 +929,25 @@ public class Item extends Actor implements Disposable {
PropertyList runeProps = stats[RUNE_PROPS];
if (magicProps != null) {
PropertyList magicPropsAggregate = magicProps.copy();
for (Item socket : socketed) {
if (socket.type.is("gem") | socket.type.is("rune")) {
int socketType;
if (Item.this.type.is("weap")) {
socketType = WEAPON_PROPS;
} else if (Item.this.type.is("shld")) {
socketType = SHIELD_PROPS;
} else if (Item.this.type.is("helm")) {
socketType = HELM_PROPS;
} else {
assert Item.this.type.is("armo");
socketType = ARMOR_PROPS;
}
magicPropsAggregate.addAll(socket.stats[socketType]);
} else {
magicPropsAggregate.addAll(socket.stats[MAGIC_PROPS]);
}
}
if (runeProps != null) magicPropsAggregate.addAll(runeProps);
magicPropsAggregate.reduce();
System.out.println(Item.this.getName());