4747import static mekhq .campaign .personnel .PersonnelOptions .COMPULSION_OTHER_FACTION_HATE ;
4848import static mekhq .campaign .personnel .PersonnelOptions .COMPULSION_PIRATE_HATE ;
4949import static mekhq .campaign .personnel .PersonnelOptions .FLAW_IN_FOR_LIFE ;
50- import static mekhq .campaign .personnel .skills .SkillType .EXP_ELITE ;
51- import static mekhq .campaign .personnel .skills .SkillType .EXP_GREEN ;
52- import static mekhq .campaign .personnel .skills .SkillType .EXP_HEROIC ;
53- import static mekhq .campaign .personnel .skills .SkillType .EXP_LEGENDARY ;
5450import static mekhq .campaign .personnel .skills .SkillType .EXP_REGULAR ;
55- import static mekhq .campaign .personnel .skills .SkillType .EXP_ULTRA_GREEN ;
5651import static mekhq .campaign .personnel .skills .SkillType .EXP_VETERAN ;
5752import static mekhq .utilities .MHQInternationalization .getFormattedTextAt ;
5853import static mekhq .utilities .ReportingUtilities .CLOSING_SPAN_TAG ;
@@ -1830,8 +1825,15 @@ private static void addBonus(Campaign campaign, Person person, Academy academy,
18301825 for (int i = 0 ; i < bonusCount ; i ++) {
18311826 int roll = randomInt (curriculum .size ());
18321827
1833- try {
1834- String skillParsed = Academy .skillParser (curriculum .get (roll ));
1828+ String skillName = curriculum .get (roll );
1829+ if (skillName .equalsIgnoreCase ("xp" )) {
1830+ person .awardXP (campaign , campaign .getCampaignOptions ().getCurriculumXpRate ());
1831+
1832+ campaign .addReport (PERSONNEL , String .format (resources .getString ("bonusXp.text" ),
1833+ person .getFirstName (),
1834+ campaign .getCampaignOptions ().getCurriculumXpRate ()));
1835+ } else if (!skillName .equalsIgnoreCase ("none" )) {
1836+ String skillParsed = Academy .skillParser (skillName );
18351837
18361838 // if 'person' already has a +1 bonus for the skill, we give them XP, instead
18371839 if (person .getSkill (skillParsed ).getBonus () < 1 ) {
@@ -1845,15 +1847,6 @@ private static void addBonus(Campaign campaign, Person person, Academy academy,
18451847 } else {
18461848 person .awardXP (campaign , campaign .getCampaignOptions ().getCurriculumXpRate ());
18471849
1848- campaign .addReport (PERSONNEL , String .format (resources .getString ("bonusXp.text" ),
1849- person .getFirstName (),
1850- campaign .getCampaignOptions ().getCurriculumXpRate ()));
1851- }
1852- } catch (Exception e ) {
1853- // if we get this, it means the 'skill' was XP or None
1854- if (curriculum .get (roll ).equalsIgnoreCase ("xp" )) {
1855- person .awardXP (campaign , campaign .getCampaignOptions ().getCurriculumXpRate ());
1856-
18571850 campaign .addReport (PERSONNEL , String .format (resources .getString ("bonusXp.text" ),
18581851 person .getFirstName (),
18591852 campaign .getCampaignOptions ().getCurriculumXpRate ()));
0 commit comments