Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skill Generation: Phenotype Bonus Applies to Proper Skills #3007

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -202,50 +202,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(final Campaign campaign, final Person person, final i
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(final Campaign campaign, final Person person, final i
generateDefaultSkills(person, secondaryRole, expLvl, bonus, mod);
}

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

SJuliez marked this conversation as resolved.
Show resolved Hide resolved
// roll small arms skill
if (!person.getSkills().hasSkill(SkillType.S_SMALL_ARMS)) {
Expand Down