Rebalancing Create program times, crime exp gains

This commit is contained in:
Daniel Xie 2017-05-04 00:27:22 -05:00
parent a934205d08
commit 01f9bf14af
7 changed files with 55 additions and 35 deletions

@ -557,7 +557,7 @@
In the Slums you can commit crimes to earn money and experience. Crime attempts are not always In the Slums you can commit crimes to earn money and experience. Crime attempts are not always
successful. Your chance at successfully committing a crime is determined by your stats. successful. Your chance at successfully committing a crime is determined by your stats.
</p> </p>
<a href="3" id="location-slums-shoplift" class="a-link-button"> Shoplift </a> <a href="#" id="location-slums-shoplift" class="a-link-button"> Shoplift </a>
<a href="#" id="location-slums-mug" class="a-link-button"> Mug someone </a> <a href="#" id="location-slums-mug" class="a-link-button"> Mug someone </a>
<a href="#" id="location-slums-deal-drugs" class="a-link-button"> Deal Drugs </a> <a href="#" id="location-slums-deal-drugs" class="a-link-button"> Deal Drugs </a>
<a href="#" id="location-slums-traffic-arms" class="a-link-button"> Traffick Illegal Arms </a> <a href="#" id="location-slums-traffic-arms" class="a-link-button"> Traffick Illegal Arms </a>

@ -49,12 +49,18 @@ CONSTANTS = {
MillisecondsPer4Hours: 14400000, MillisecondsPer4Hours: 14400000,
GameCyclesPer4Hours: 14400000 / 200, GameCyclesPer4Hours: 14400000 / 200,
MillisecondsPer2Hours: 7200000,
GameCyclesPer2Hours: 7200000 / 200,
MillisecondsPerHour: 3600000, MillisecondsPerHour: 3600000,
GameCyclesPerHour: 3600000 / 200, GameCyclesPerHour: 3600000 / 200,
MillisecondsPerHalfHour: 1800000, MillisecondsPerHalfHour: 1800000,
GameCyclesPerHalfHour: 1800000 / 200, GameCyclesPerHalfHour: 1800000 / 200,
MillisecondsPerQuarterHour: 900000,
GameCyclesPerQuarterHour: 900000 / 200,
FactionWorkHacking: "Faction Hacking Work", FactionWorkHacking: "Faction Hacking Work",
FactionWorkField: "Faction Field Work", FactionWorkField: "Faction Field Work",
FactionWorkSecurity: "Faction Security Work", FactionWorkSecurity: "Faction Security Work",

@ -40,7 +40,7 @@ function displayCreateProgramContent() {
Player.hacking_skill >= 50) { Player.hacking_skill >= 50) {
bruteSshALink.style.display = "block"; bruteSshALink.style.display = "block";
bruteSshALink.addEventListener("click", function() { bruteSshALink.addEventListener("click", function() {
Player.startCreateProgramWork(Programs.BruteSSHProgram, CONSTANTS.MillisecondsPerHalfHour); Player.startCreateProgramWork(Programs.BruteSSHProgram, CONSTANTS.MillisecondsPerQuarterHour);
}); });
} }
@ -49,7 +49,7 @@ function displayCreateProgramContent() {
Player.hacking_skill >= 100) { Player.hacking_skill >= 100) {
ftpCrackALink.style.display = "block"; ftpCrackALink.style.display = "block";
ftpCrackALink.addEventListener("click", function() { ftpCrackALink.addEventListener("click", function() {
Player.startCreateProgramWork(Programs.FTPCrackProgram, CONSTANTS.MillisecondsPerHour); Player.startCreateProgramWork(Programs.FTPCrackProgram, CONSTANTS.MillisecondsHalfHour);
}); });
} }
@ -58,7 +58,7 @@ function displayCreateProgramContent() {
Player.hacking_skill >= 250) { Player.hacking_skill >= 250) {
relaySmtpALink.style.display = "block"; relaySmtpALink.style.display = "block";
relaySmtpAlink.addEventListener("click", function() { relaySmtpAlink.addEventListener("click", function() {
Player.startCreateProgramWork(Programs.RelaySMTPProgram. CONSTANTS.MillisecondsPer4Hours); Player.startCreateProgramWork(Programs.RelaySMTPProgram. CONSTANTS.MillisecondsPer2Hours);
}); });
} }
@ -67,7 +67,7 @@ function displayCreateProgramContent() {
Player.hacking_skill >= 500) { Player.hacking_skill >= 500) {
httpWormALink.style.display = "block"; httpWormALink.style.display = "block";
httpWormALink.addEventListener("click", function() { httpWormALink.addEventListener("click", function() {
Player.startCreateProgramWork(Programs.HTTPWormProgram, CONSTANTS.MillisecondsPer8Hours); Player.startCreateProgramWork(Programs.HTTPWormProgram, CONSTANTS.MillisecondsPer4Hours);
}); });
} }
@ -76,7 +76,7 @@ function displayCreateProgramContent() {
Player.hacking_skill >= 750) { Player.hacking_skill >= 750) {
sqlInjectALink.style.display = "block"; sqlInjectALink.style.display = "block";
sqlInjectALink.addEventListener("click", function() { sqlInjectALink.addEventListener("click", function() {
Player.startCreateProgramWork(Programs.SQLInjectProgram, CONSTANTS.MillisecondsPer10Hours); Player.startCreateProgramWork(Programs.SQLInjectProgram, CONSTANTS.MillisecondsPer8Hours);
}); });
} }
} }

@ -11,22 +11,22 @@ function commitMugCrime() {
function commitDealDrugsCrime() { function commitDealDrugsCrime() {
Player.crimeType = CONSTANTS.CrimeDrugs; Player.crimeType = CONSTANTS.CrimeDrugs;
Player.startCrime(0, 2, 2, 2, 2, 5, 1000, 10000); //$100 per sec Player.startCrime(0, 2, 2, 2, 2, 4, 1000, 10000); //$100 per sec
} }
function commitTraffickArmsCrime() { function commitTraffickArmsCrime() {
Player.crimeType = CONSTANTS.CrimeTraffickArms; Player.crimeType = CONSTANTS.CrimeTraffickArms;
Player.startCrime(0, 5, 5, 5, 5, 10, 2500, 20000); //$125 per sec Player.startCrime(0, 5, 5, 5, 5, 8, 2500, 20000); //$125 per sec
} }
function commitHomicideCrime() { function commitHomicideCrime() {
Player.crimeType = CONSTANTS.CrimeHomicide; Player.crimeType = CONSTANTS.CrimeHomicide;
Player.startCrime(0, 20, 20, 20, 20, 0, 300, 3000); //$100 per sec Player.startCrime(0, 15, 15, 15, 15, 0, 300, 3000); //$100 per sec
} }
function commitKidnapCrime() { function commitKidnapCrime() {
Player.crimeType = CONSTANTS.CrimeKidnap; Player.crimeType = CONSTANTS.CrimeKidnap;
Player.startCrime(0, 6, 6, 6, 6, 6, 10000, 60000); //$166.67 per sec Player.startCrime(0, 10, 10, 10, 10, 10, 10000, 60000); //$166.67 per sec
} }
function determineCrimeSuccess(crime, moneyGained) { function determineCrimeSuccess(crime, moneyGained) {

@ -834,6 +834,7 @@ displayLocationContent = function() {
slumsKidnap.style.display = "block"; slumsKidnap.style.display = "block";
slumsKidnap.innerHTML = "Kidnap and Ransom (" + (kidnapChance*100).toFixed(3) + "% chance of success)"; slumsKidnap.innerHTML = "Kidnap and Ransom (" + (kidnapChance*100).toFixed(3) + "% chance of success)";
break;
default: default:
console.log("ERROR: INVALID LOCATION"); console.log("ERROR: INVALID LOCATION");

@ -927,7 +927,7 @@ PlayerObject.prototype.startCrime = function(hackExp, strExp, defExp, dexExp, ag
this.workHackExpGained = hackExp * this.hacking_exp_mult; this.workHackExpGained = hackExp * this.hacking_exp_mult;
this.workStrExpGained = strExp * this.strength_exp_mult; this.workStrExpGained = strExp * this.strength_exp_mult;
this.workDefExpGained = defExp * this.defense_exp_mult; this.workDefExpGained = defExp * this.defense_exp_mult;
this.workDexExpGained = dexExp * this.dexteriy_exp_mult; this.workDexExpGained = dexExp * this.dexterity_exp_mult;
this.workAgiExpGained = agiExp * this.agility_exp_mult; this.workAgiExpGained = agiExp * this.agility_exp_mult;
this.workChaExpGained = chaExp * this.charisma_exp_mult; this.workChaExpGained = chaExp * this.charisma_exp_mult;
this.workMoneyGained = money; //TODO multiplier for this? this.workMoneyGained = money; //TODO multiplier for this?
@ -949,9 +949,11 @@ PlayerObject.prototype.startCrime = function(hackExp, strExp, defExp, dexExp, ag
Engine.loadWorkInProgressContent(); Engine.loadWorkInProgressContent();
} }
PlayerObject.prototype.commitCrime = function () { PlayerObject.prototype.commitCrime = function (numCycles) {
this.timeWorked += Engine._idleSpeed * numCycles; this.timeWorked += Engine._idleSpeed * numCycles;
if (this.timeWorked >= this.timeNeededToCompleteWork) {Player.finishCrime(false);}
var txt = document.getElementById("work-in-progress-text"); var txt = document.getElementById("work-in-progress-text");
txt.innerHTML = "You are attempting to " + Player.crimeType + ".<br>" + txt.innerHTML = "You are attempting to " + Player.crimeType + ".<br>" +
"Time remaining: " + convertTimeMsToTimeElapsedString(this.timeNeededToCompleteWork - this.timeWorked); "Time remaining: " + convertTimeMsToTimeElapsedString(this.timeNeededToCompleteWork - this.timeWorked);
@ -961,9 +963,6 @@ PlayerObject.prototype.finishCrime = function(cancelled) {
if (cancelled) { if (cancelled) {
//Do nothing //Do nothing
} else { } else {
this.gainWorkExp();
//Handle Karma and crime statistics //Handle Karma and crime statistics
switch(this.crimeType) { switch(this.crimeType) {
case CONSTANTS.CrimeShoplift: case CONSTANTS.CrimeShoplift:
@ -997,7 +996,16 @@ PlayerObject.prototype.finishCrime = function(cancelled) {
} }
//Determine crime success/failure //Determine crime success/failure
if (!cancelled) {
if (determineCrimeSuccess(this.crimeType, this.workMoneyGained)) { if (determineCrimeSuccess(this.crimeType, this.workMoneyGained)) {
//On a crime success, gain 2x exp
this.workHackExpGained *= 2;
this.workStrExpGained *= 2;
this.workDefExpGained *= 2;
this.workDexExpGained *= 2;
this.workAgiExpGained *= 2;
this.workChaExpGained *= 2;
dialogBoxCreate("Crime successful! <br><br>" + dialogBoxCreate("Crime successful! <br><br>" +
"You gained:<br>"+ "You gained:<br>"+
"$" + this.workMoneyGained + "<br>" + "$" + this.workMoneyGained + "<br>" +
@ -1015,6 +1023,9 @@ PlayerObject.prototype.finishCrime = function(cancelled) {
this.workDexExpGained + " dexterity experience<br>" + this.workDexExpGained + " dexterity experience<br>" +
this.workAgiExpGained + " agility experience<br>"); this.workAgiExpGained + " agility experience<br>");
} }
}
this.gainWorkExp();
var mainMenu = document.getElementById("mainmenu-container"); var mainMenu = document.getElementById("mainmenu-container");
mainMenu.style.visibility = "visible"; mainMenu.style.visibility = "visible";

@ -582,6 +582,8 @@ var Engine = {
Player.createProgramWork(numCycles); Player.createProgramWork(numCycles);
} else if (Player.workType == CONSTANTS.WorkTypeStudyClass) { } else if (Player.workType == CONSTANTS.WorkTypeStudyClass) {
Player.takeClass(numCycles); Player.takeClass(numCycles);
} else if (Player.workType == CONSTANTS.WorkTypeCrime) {
Player.commitCrime(numCycles);
} else { } else {
Player.work(numCycles); Player.work(numCycles);
} }
@ -608,7 +610,7 @@ var Engine = {
Counters: { Counters: {
autoSaveCounter: 300, //Autosave every minute autoSaveCounter: 300, //Autosave every minute
updateSkillLevelsCounter: 10, //Only update skill levels every 2 seconds. Might improve performance updateSkillLevelsCounter: 10, //Only update skill levels every 2 seconds. Might improve performance
updateDisplays: 4, //Update displays such as Active Scripts display and character display updateDisplays: 3, //Update displays such as Active Scripts display and character display
serverGrowth: 450, //Process server growth every minute and a half serverGrowth: 450, //Process server growth every minute and a half
checkFactionInvitations: 1500, //Check whether you qualify for any faction invitations every 5 minutes checkFactionInvitations: 1500, //Check whether you qualify for any faction invitations every 5 minutes
passiveFactionGrowth: 600, passiveFactionGrowth: 600,
@ -644,7 +646,7 @@ var Engine = {
updateHacknetNodesContent(); updateHacknetNodesContent();
} }
Engine.Counters.updateDisplays = 4; Engine.Counters.updateDisplays = 3;
} }
if (Engine.Counters.serverGrowth <= 0) { if (Engine.Counters.serverGrowth <= 0) {