From 20b84c80b9c71432e48fb08d7b5cb3400104db0c Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Thu, 28 Mar 2019 02:33:40 -0700 Subject: [PATCH] Added support for aggregating socket item properties with parent item properties --- core/src/com/riiablo/item/Item.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/core/src/com/riiablo/item/Item.java b/core/src/com/riiablo/item/Item.java index 466f9035..6a4a4952 100644 --- a/core/src/com/riiablo/item/Item.java +++ b/core/src/com/riiablo/item/Item.java @@ -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());