| 5079 | } |
| 5080 | |
| 5081 | public int hitPoints() |
| 5082 | { |
| 5083 | int total = 0; |
| 5084 | |
| 5085 | double iConMod = getStatBonusTo("HP", "BONUS"); |
| 5086 | |
| 5087 | for (PCClass pcClass : getClassSet()) |
| 5088 | { |
| 5089 | total += getClassHitPoints(pcClass, (int) iConMod); |
| 5090 | } |
| 5091 | |
| 5092 | total += (int) getTotalBonusTo("HP", "CURRENTMAX"); |
| 5093 | |
| 5094 | // |
| 5095 | // now we see if this PC is a Familiar |
| 5096 | final PlayerCharacter nPC = getMasterPC(); |
| 5097 | |
| 5098 | if (nPC == null) |
| 5099 | { |
| 5100 | return total; |
| 5101 | } |
| 5102 | |
| 5103 | if (masterFacet.getCopyMasterHP(id).isEmpty()) |
| 5104 | { |
| 5105 | return total; |
| 5106 | } |
| 5107 | // |
| 5108 | // In order for the BONUS's to work, the PC we want |
| 5109 | // to get the hit points for must be the "current" one. |
| 5110 | // |
| 5111 | int masterHP = nPC.hitPoints(); |
| 5112 | |
| 5113 | final String copyMasterHP = replaceMasterString(masterFacet.getCopyMasterHP(id), masterHP); |
| 5114 | masterHP = getVariableValue(copyMasterHP, "").intValue(); |
| 5115 | |
| 5116 | return masterHP; |
| 5117 | } |
| 5118 | |
| 5119 | private int getClassHitPoints(PCClass pcClass, int iConMod) |
| 5120 | { |