From a115c62887bf8e09fc4a7225d910ff79e5755dc2 Mon Sep 17 00:00:00 2001 From: Ziggeh Date: Wed, 25 Dec 2013 05:15:53 +0100 Subject: [PATCH] Items - Action and Health attributes --- src/services/EquipmentService.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/services/EquipmentService.java b/src/services/EquipmentService.java index 417bf093..f96e0e2c 100644 --- a/src/services/EquipmentService.java +++ b/src/services/EquipmentService.java @@ -141,9 +141,7 @@ public class EquipmentService implements INetworkDispatch { // TODO: Calculate actual armor values (REMINDER: Check if the player is wearing a jedi robe/cloak (look for force protection intensity). If they are, they shouldn't receive any additional protection from other items with armour.) // TODO: bio-link (assign it by objectID with setAttachment and then just display it as a character name). // TODO: item level requirement. if actorLevel >= itemLevel - // TODO: refactor equipable items that grant buffs. use setAttachment("itemBuff", "buffname") - example: object.setAttachment("itemBuff", "fs_buff_def_1_1") - // if(item.getAttachment("itemBuff") != null ) - // core.buffService.addBuffToCreature(actor, item.getAttachment("itemBuff")); + // TODO: refactor equipable items that grant buffs. use setAttachment("itemBuff", "buffname") if (actor.getSlotNameForObject(item).contentEquals("hold_r") == true) weaponCriticalToDisplay(actor, item, true); @@ -153,7 +151,13 @@ public class EquipmentService implements INetworkDispatch { for(Entry e : attributes.entrySet()) { if(e.getKey().startsWith("cat_skill_mod_bonus.@stat_n:")) { core.skillModService.addSkillMod(actor, e.getKey().replace("cat_skill_mod_bonus.@stat_n:", ""), Integer.parseInt((String) e.getValue())); - } + } + if(e.getKey().startsWith("cat_attrib_mod_bonus.attr_health")) { + actor.setMaxHealth(actor.getMaxHealth() + Integer.parseInt((String) e.getValue())); + } + if(e.getKey().startsWith("cat_attrib_mod_bonus.attr_action")) { + actor.setMaxAction(actor.getMaxAction() + Integer.parseInt((String) e.getValue())); + } } @@ -179,6 +183,12 @@ public class EquipmentService implements INetworkDispatch { if(e.getKey().startsWith("cat_skill_mod_bonus.@stat_n:")) { core.skillModService.deductSkillMod(actor, e.getKey().replace("cat_skill_mod_bonus.@stat_n:", ""), Integer.parseInt((String) e.getValue())); + } + if(e.getKey().startsWith("cat_attrib_mod_bonus.attr_health")) { + actor.setMaxHealth(actor.getMaxHealth() - Integer.parseInt((String) e.getValue())); + } + if(e.getKey().startsWith("cat_attrib_mod_bonus.attr_action")) { + actor.setMaxAction(actor.getMaxAction() - Integer.parseInt((String) e.getValue())); } }