(Kit aKit, PlayerCharacter aPC, List<String> warnings)
| 84 | } |
| 85 | |
| 86 | @Override |
| 87 | public boolean testApply(Kit aKit, PlayerCharacter aPC, List<String> warnings) |
| 88 | { |
| 89 | thePObject = null; |
| 90 | weaponProfs = null; |
| 91 | |
| 92 | PersistentTransitionChoice<WeaponProf> wpPTC = null; |
| 93 | if (isRacial()) |
| 94 | { |
| 95 | final Race pcRace = aPC.getRace(); |
| 96 | |
| 97 | if (pcRace == null) |
| 98 | { |
| 99 | warnings.add("PROF: PC has no race"); |
| 100 | |
| 101 | return false; |
| 102 | } |
| 103 | if (!aPC.hasBonusWeaponProfs(pcRace)) |
| 104 | { |
| 105 | warnings.add("PROF: Race has already selected bonus weapon proficiency"); |
| 106 | |
| 107 | return false; |
| 108 | } |
| 109 | thePObject = pcRace; |
| 110 | wpPTC = getPTC(pcRace); |
| 111 | if (wpPTC == null) |
| 112 | { |
| 113 | warnings.add("PROF: PC race has no WEAPONBONUS"); |
| 114 | |
| 115 | return false; |
| 116 | } |
| 117 | } |
| 118 | else |
| 119 | { |
| 120 | Collection<PCClass> pcClasses = aPC.getClassSet(); |
| 121 | if (pcClasses == null || pcClasses.isEmpty()) |
| 122 | { |
| 123 | warnings.add("PROF: No owning class found."); |
| 124 | |
| 125 | return false; |
| 126 | } |
| 127 | |
| 128 | // Search for a class that has bonusWeaponProfs. |
| 129 | PCClass pcClass = null; |
| 130 | for (PCClass aClass : pcClasses) |
| 131 | { |
| 132 | pcClass = aClass; |
| 133 | wpPTC = getPTC(pcClass); |
| 134 | if (wpPTC != null) |
| 135 | { |
| 136 | break; |
| 137 | } |
| 138 | } |
| 139 | if (wpPTC == null) |
| 140 | { |
| 141 | warnings.add("PROF: PC classes have no WEAPONBONUS"); |
| 142 | |
| 143 | return false; |
nothing calls this directly
no test coverage detected