Rebalancing crime exp and small UI improvements

This commit is contained in:
Daniel Xie 2017-05-04 02:05:43 -05:00
parent 01f9bf14af
commit b0bc7ed3c7
5 changed files with 54 additions and 48 deletions

@ -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;
}

@ -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;

@ -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",

@ -960,9 +960,9 @@ PlayerObject.prototype.commitCrime = function (numCycles) {
}
PlayerObject.prototype.finishCrime = function(cancelled) {
if (cancelled) {
//Do nothing
} else {
//Determine crime success/failure
if (!cancelled) {
if (determineCrimeSuccess(this.crimeType, this.workMoneyGained)) {
//Handle Karma and crime statistics
switch(this.crimeType) {
case CONSTANTS.CrimeShoplift:
@ -993,11 +993,7 @@ PlayerObject.prototype.finishCrime = function(cancelled) {
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)) {
//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<br>" +
this.workDefExpGained + " defense experience<br>" +
this.workDexExpGained + " dexterity experience<br>" +
this.workAgiExpGained + " agility experience<br>");
this.workAgiExpGained + " agility experience<br>" +
this.workChaExpGained + " charisma experience");
} else {
dialogBoxCreate("Crime failed! <br><br>" +
"You gained:<br>"+
@ -1021,7 +1018,8 @@ PlayerObject.prototype.finishCrime = function(cancelled) {
this.workStrExpGained + " strength experience<br>" +
this.workDefExpGained + " defense experience<br>" +
this.workDexExpGained + " dexterity experience<br>" +
this.workAgiExpGained + " agility experience<br>");
this.workAgiExpGained + " agility experience<br>" +
this.workChaExpGained + " charisma experience");
}
}

@ -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) {