mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-02-21 20:18:14 +07:00
Added support for aggregating socket item properties with parent item properties
This commit is contained in:
parent
207fe4fe97
commit
20b84c80b9
@ -929,6 +929,25 @@ public class Item extends Actor implements Disposable {
|
|||||||
PropertyList runeProps = stats[RUNE_PROPS];
|
PropertyList runeProps = stats[RUNE_PROPS];
|
||||||
if (magicProps != null) {
|
if (magicProps != null) {
|
||||||
PropertyList magicPropsAggregate = magicProps.copy();
|
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);
|
if (runeProps != null) magicPropsAggregate.addAll(runeProps);
|
||||||
magicPropsAggregate.reduce();
|
magicPropsAggregate.reduce();
|
||||||
System.out.println(Item.this.getName());
|
System.out.println(Item.this.getName());
|
||||||
|
Loading…
Reference in New Issue
Block a user