Get the modifier to the skill granted by the key attribute @param pc @return modifier
(Skill sk, PlayerCharacter pc)
| 118 | * @return modifier |
| 119 | */ |
| 120 | public static int getStatMod(Skill sk, PlayerCharacter pc) |
| 121 | { |
| 122 | CDOMSingleRef<PCStat> stat = sk.get(ObjectKey.KEY_STAT); |
| 123 | if (stat == null) |
| 124 | { |
| 125 | int statMod = 0; |
| 126 | if (Globals.getGameModeHasPointPool()) |
| 127 | { |
| 128 | ArrayList<Type> typeList = new ArrayList<>(); |
| 129 | SkillInfoUtilities.getKeyStatList(pc, sk, typeList); |
| 130 | for (Type type : typeList) |
| 131 | { |
| 132 | statMod += pc.getTotalBonusTo("SKILL", "TYPE." + type); |
| 133 | } |
| 134 | } |
| 135 | return statMod; |
| 136 | } |
| 137 | else |
| 138 | { |
| 139 | return pc.getStatModFor(stat.get()); |
| 140 | } |
| 141 | } |
| 142 | } |
no test coverage detected