Skip to content

Commit

Permalink
Applying phenotype bonus to the correct skills
Browse files Browse the repository at this point in the history
  • Loading branch information
Windchild292 committed Dec 15, 2021
1 parent 69ee624 commit 091bcb2
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,50 +201,52 @@ protected static void addSkill(Person person, String skillName, int experienceLe
* the primary role.
*/
protected int getPhenotypeBonus(Person person) {
if (person.isClanner()) {
// apply phenotype bonus only to primary skills
switch (person.getPrimaryRole()) {
case MECHWARRIOR:
case LAM_PILOT:
if (person.getPhenotype() == Phenotype.MECHWARRIOR) {
return 1;
}
break;
case GROUND_VEHICLE_DRIVER:
case NAVAL_VEHICLE_DRIVER:
case VTOL_PILOT:
case VEHICLE_GUNNER:
case VEHICLE_CREW:
if (person.getPhenotype() == Phenotype.VEHICLE) {
return 1;
}
break;
case AEROSPACE_PILOT:
case CONVENTIONAL_AIRCRAFT_PILOT:
if (person.getPhenotype() == Phenotype.AEROSPACE) {
return 1;
}
break;
case PROTOMECH_PILOT:
if (person.getPhenotype() == Phenotype.PROTOMECH) {
return 1;
}
case BATTLE_ARMOUR:
if (person.getPhenotype() == Phenotype.ELEMENTAL) {
return 1;
}
break;
case VESSEL_PILOT:
case VESSEL_GUNNER:
case VESSEL_CREW:
case VESSEL_NAVIGATOR:
if (person.getPhenotype() == Phenotype.NAVAL) {
return 1;
}
default:
break;
}
if (!person.isClanner()) {
return 0;
}

switch (person.getPrimaryRole()) {
case MECHWARRIOR:
case LAM_PILOT:
if (person.getPhenotype() == Phenotype.MECHWARRIOR) {
return 1;
}
break;
case GROUND_VEHICLE_DRIVER:
case NAVAL_VEHICLE_DRIVER:
case VTOL_PILOT:
case VEHICLE_GUNNER:
case VEHICLE_CREW:
if (person.getPhenotype() == Phenotype.VEHICLE) {
return 1;
}
break;
case AEROSPACE_PILOT:
case CONVENTIONAL_AIRCRAFT_PILOT:
if (person.getPhenotype() == Phenotype.AEROSPACE) {
return 1;
}
break;
case PROTOMECH_PILOT:
if (person.getPhenotype() == Phenotype.PROTOMECH) {
return 1;
}
case BATTLE_ARMOUR:
if (person.getPhenotype() == Phenotype.ELEMENTAL) {
return 1;
}
break;
case VESSEL_PILOT:
case VESSEL_GUNNER:
case VESSEL_CREW:
case VESSEL_NAVIGATOR:
if (person.getPhenotype() == Phenotype.NAVAL) {
return 1;
}
default:
break;
}

return 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void generateSkills(Person person, int expLvl) {
PersonnelRole secondaryRole = person.getSecondaryRole();
RandomSkillPreferences rskillPrefs = getSkillPreferences();

int bonus = 0;
int bonus = getPhenotypeBonus(person);
int mod = 0;

if (primaryRole.isLAMPilot()) {
Expand All @@ -55,7 +55,8 @@ public void generateSkills(Person person, int expLvl) {
generateDefaultSkills(person, secondaryRole, expLvl, bonus, mod);
}

bonus = getPhenotypeBonus(person);
// apply phenotype bonus only to primary skills
bonus = 0;

// roll small arms skill
if (!person.getSkills().hasSkill(SkillType.S_SMALL_ARMS)) {
Expand Down

0 comments on commit 091bcb2

Please sign in to comment.