Added requirements whena pplying for promotion

This commit is contained in:
Daniel Xie 2017-04-25 02:14:24 -05:00
parent a11a319d72
commit 3519cd88f7
2 changed files with 23 additions and 5 deletions

@ -204,13 +204,13 @@ CompanyPositions = {
//Software //Software
SoftwareIntern: new CompanyPosition("Software Engineering Intern", 1, 0, 0, 0, 0, 0, 0, 1), SoftwareIntern: new CompanyPosition("Software Engineering Intern", 1, 0, 0, 0, 0, 0, 0, 1),
JuniorDev: new CompanyPosition("Junior Software Engineer", 50, 0, 0, 0, 0, 25, 9000, 5), JuniorDev: new CompanyPosition("Junior Software Engineer", 50, 0, 0, 0, 0, 1, 9000, 5),
SeniorDev: new CompanyPosition("Senior Software Engineer", 250, 0, 0, 0, 0, 75, 36000, 12), SeniorDev: new CompanyPosition("Senior Software Engineer", 250, 0, 0, 0, 0, 50, 36000, 12),
LeadDev: new CompanyPosition("Lead Software Developer", 400, 0, 0, 0, 0, 150, 144000, 15), LeadDev: new CompanyPosition("Lead Software Developer", 400, 0, 0, 0, 0, 150, 144000, 15),
//IT //IT
ITIntern: new CompanyPosition("IT Intern", 1, 0, 0, 0, 0, 1, 0, .8), ITIntern: new CompanyPosition("IT Intern", 1, 0, 0, 0, 0, 0, 0, .8),
ITAnalyst: new CompanyPosition("IT Analyst", 25, 0, 0, 0, 0, 1, 9000, 2), ITAnalyst: new CompanyPosition("IT Analyst", 25, 0, 0, 0, 0, 0, 9000, 2),
ITManager: new CompanyPosition("IT Manager", 150, 0, 0, 0, 0, 50, 36000, 8), ITManager: new CompanyPosition("IT Manager", 150, 0, 0, 0, 0, 50, 36000, 8),
SysAdmin: new CompanyPosition("Systems Administrator", 250, 0, 0, 0, 0, 75, 144000, 13), SysAdmin: new CompanyPosition("Systems Administrator", 250, 0, 0, 0, 0, 75, 144000, 13),
SecurityEngineer: new CompanyPosition("Security Engineer", 150, 0, 0, 0, 0, 25, 36000, 10), SecurityEngineer: new CompanyPosition("Security Engineer", 150, 0, 0, 0, 0, 25, 36000, 10),

@ -52,7 +52,25 @@ PlayerObject.prototype.applyForJob = function(entryPosType) {
if (currCompany != "") { if (currCompany != "") {
if (currCompany.companyName == company.companyName && if (currCompany.companyName == company.companyName &&
pos.positionName == currPositionName) { pos.positionName == currPositionName) {
dialogBoxCreate("Unfortunately, you do not qualify for a promotion"); var nextPos = getNextCompanyPosition(pos);
var offset = company.jobStatReqOffset;
var reqHacking = nextPos.requiredHacking > 0 ? nextPos.requiredHacking+offset : 0;
var reqStrength = nextPos.requiredStrength > 0 ? nextPos.requiredStrength+offset : 0;
var reqDefense = nextPos.requiredDefense > 0 ? nextPos.requiredDefense+offset : 0;
var reqDexterity = nextPos.requiredDexterity > 0 ? nextPos.requiredDexterity+offset : 0;
var reqAgility = nextPos.requiredDexterity > 0 ? nextPos.requiredDexterity+offset : 0;
var reqCharisma = nextPos.requiredCharisma > 0 ? nextPos.requiredCharisma+offset : 0;
var reqText = "(Requires ";
if (reqHacking > 0) {reqText += (reqHacking + " hacking, ");}
if (reqStrength > 0) {reqText += (reqStrength + " strength, ");}
if (reqDefense > 0) {reqText += (reqDefense + " defense, ");}
if (reqDexterity > 0) {reqText += (reqDexterity + " dexterity, ");}
if (reqAgility > 0) {reqText += (reqAgility + " agility, ");}
if (reqCharisma > 0) {reqText += (reqCharisma + " charisma, ");}
reqText = reqText.substring(0, reqText.length - 2);
reqText += ")";
dialogBoxCreate("Unfortunately, you do not qualify for a promotion", reqText);
return; //Same job, do nothing return; //Same job, do nothing
} }
} }