From b0bc7ed3c7c31656690a24b7959a90e9510ec10f Mon Sep 17 00:00:00 2001 From: Daniel Xie Date: Thu, 4 May 2017 02:05:43 -0500 Subject: [PATCH] Rebalancing crime exp and small UI improvements --- css/menupages.css | 22 ++++++++++----- src/Crimes.js | 4 +-- src/Location.js | 2 +- src/Player.js | 72 +++++++++++++++++++++++------------------------ src/Terminal.js | 2 +- 5 files changed, 54 insertions(+), 48 deletions(-) diff --git a/css/menupages.css b/css/menupages.css index b1e5c50af..558f25dc6 100644 --- a/css/menupages.css +++ b/css/menupages.css @@ -117,8 +117,7 @@ /* Hacknet Nodes */ #hacknet-nodes-container { position: fixed; - padding-top: 10px; - padding-left: 10px; + padding: 10px; height: 100%; margin-left: 10%; width: 99%; @@ -297,21 +296,30 @@ padding-left: 10px; height: 100%; margin-left: 10%; - width: 99%; + width: 85%; } /* Location */ #location-container { color: #66ff33; position: fixed; - padding-top: 10px; - padding-left: 10px; - padding: 20px; + padding: 6px; height: 100%; margin-left: 10%; width: 99%; } +#location-slums-description { + width: 80%; + margin: 10px; +} + +#location-return-to-world-button { + margin: 10px; + padding: 6px; +} + #location-container * { margin: 10px 5px 10px 5px; -} \ No newline at end of file +} + diff --git a/src/Crimes.js b/src/Crimes.js index e01bd60cc..cf46eaf72 100644 --- a/src/Crimes.js +++ b/src/Crimes.js @@ -21,7 +21,7 @@ function commitTraffickArmsCrime() { function commitHomicideCrime() { Player.crimeType = CONSTANTS.CrimeHomicide; - Player.startCrime(0, 15, 15, 15, 15, 0, 300, 3000); //$100 per sec + Player.startCrime(0, 3, 3, 3, 3, 0, 300, 3000); //$100 per sec } function commitKidnapCrime() { @@ -54,7 +54,7 @@ function determineCrimeSuccess(crime, moneyGained) { dialogBoxCreate("ERR: Unrecognized crime type. This is probably a bug please contact the developer"); return; } - if (Math.random <= chance) { + if (Math.random() <= chance) { //Success Player.gainMoney(moneyGained); return true; diff --git a/src/Location.js b/src/Location.js index 248c3ddd8..3e5761efb 100644 --- a/src/Location.js +++ b/src/Location.js @@ -50,7 +50,7 @@ Locations = { Sector12JoesGuns: "Joe's Guns", Sector12IronGym: "Iron Gym", Sector12PowerhouseGym: "Powerhouse Gym", - Sector12Slums: "Sector12 Slums", + Sector12Slums: "Sector-12 Slums", //New Tokyo NewTokyoTravelAgency: "New Tokyo Travel Agency", diff --git a/src/Player.js b/src/Player.js index 0323a4f0a..a0f5f085d 100644 --- a/src/Player.js +++ b/src/Player.js @@ -960,44 +960,40 @@ PlayerObject.prototype.commitCrime = function (numCycles) { } PlayerObject.prototype.finishCrime = function(cancelled) { - if (cancelled) { - //Do nothing - } else { - //Handle Karma and crime statistics - switch(this.crimeType) { - case CONSTANTS.CrimeShoplift: - this.karma -= 0.1; - ++this.numTimesShoplifted; - break; - case CONSTANTS.CrimeMug: - this.karma -= 0.2; - ++this.numPeopleMugged; - break; - case CONSTANTS.CrimeDrugs: - ++this.numTimesDealtDrugs; - this.karma -= 0.5; - break; - case CONSTANTS.CrimeTraffickArms: - ++this.numTimesTraffickArms; - this.karma -= 1; - break; - case CONSTANTS.CrimeHomicide: - ++this.numPeopleKilled; - this.karma -= 3; - break; - case CONSTANTS.CrimeKidnap: - ++this.numTimesKidnapped; - this.karma -= 3; - break; - default: - dialogBoxCreate("ERR: Unrecognized crime type. This is probably a bug please contact the developer"); - return; - } - } - //Determine crime success/failure if (!cancelled) { if (determineCrimeSuccess(this.crimeType, this.workMoneyGained)) { + //Handle Karma and crime statistics + switch(this.crimeType) { + case CONSTANTS.CrimeShoplift: + this.karma -= 0.1; + ++this.numTimesShoplifted; + break; + case CONSTANTS.CrimeMug: + this.karma -= 0.2; + ++this.numPeopleMugged; + break; + case CONSTANTS.CrimeDrugs: + ++this.numTimesDealtDrugs; + this.karma -= 0.5; + break; + case CONSTANTS.CrimeTraffickArms: + ++this.numTimesTraffickArms; + this.karma -= 1; + break; + case CONSTANTS.CrimeHomicide: + ++this.numPeopleKilled; + this.karma -= 3; + break; + case CONSTANTS.CrimeKidnap: + ++this.numTimesKidnapped; + this.karma -= 3; + break; + default: + dialogBoxCreate("ERR: Unrecognized crime type. This is probably a bug please contact the developer"); + return; + } + //On a crime success, gain 2x exp this.workHackExpGained *= 2; this.workStrExpGained *= 2; @@ -1013,7 +1009,8 @@ PlayerObject.prototype.finishCrime = function(cancelled) { this.workStrExpGained + " strength experience
" + this.workDefExpGained + " defense experience
" + this.workDexExpGained + " dexterity experience
" + - this.workAgiExpGained + " agility experience
"); + this.workAgiExpGained + " agility experience
" + + this.workChaExpGained + " charisma experience"); } else { dialogBoxCreate("Crime failed!

" + "You gained:
"+ @@ -1021,7 +1018,8 @@ PlayerObject.prototype.finishCrime = function(cancelled) { this.workStrExpGained + " strength experience
" + this.workDefExpGained + " defense experience
" + this.workDexExpGained + " dexterity experience
" + - this.workAgiExpGained + " agility experience
"); + this.workAgiExpGained + " agility experience
" + + this.workChaExpGained + " charisma experience"); } } diff --git a/src/Terminal.js b/src/Terminal.js index dfd873717..84d3a8bf7 100644 --- a/src/Terminal.js +++ b/src/Terminal.js @@ -32,7 +32,7 @@ $(document).keydown(function(event) { //Terminal if (Engine.currentPage == Engine.Page.Terminal) { var terminalInput = document.getElementById("terminal-input-text-box"); - if (terminalInput != null && !event.ctrlKey) {terminalInput.focus();} + if (terminalInput != null && !event.ctrlKey && !event.shiftKey) {terminalInput.focus();} //Enter if (event.keyCode == 13) {