Added 3 more crimes..home computer no longer reset on prestige

This commit is contained in:
Daniel Xie 2017-05-08 11:00:34 -05:00
parent 20d8a40e17
commit 94aafba04b
10 changed files with 163 additions and 22 deletions

@ -582,13 +582,34 @@
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.
</p>
<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-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-homicide" class="a-link-button"> Homicide </a>
<a href="#" id="location-slums-kidnap" class="a-link-button"> Kidnap and Ransom </a>
<a href="#" id="location-slums-shoplift" class="a-link-button tooltip"> Shoplift
<span class="tooltiptext"> Attempt to shoplift from a low-end retailers </span>
</a>
<a href="#" id="location-slums-mug" class="a-link-button tooltip"> Mug someone
<span class="tooltiptext"> Attempt to mug a random person on the street </span>
</a>
<a href="#" id="location-slums-deal-drugs" class="a-link-button tooltip"> Deal Drugs
<span class="tooltiptext"> Attempt to deal drugs </span>
</a>
<a href="#" id="location-slums-traffic-arms" class="a-link-button tooltip"> Traffick Illegal Arms
<span class="tooltiptext"> Attempt to smuggle illegal arms into the city and sell them to gangs and criminal organizations </span>
</a>
<a href="#" id="location-slums-homicide" class="a-link-button tooltip"> Homicide
<span class="tooltiptext"> Attempt to murder a random person on the street</span>
</a>
<a href="#" id="location-slums-gta" class="a-link-button tooltip"> Grand Theft Auto
<span class="tooltiptext"> Attempt to commit grand theft auto </span>
</a>
<a href="#" id="location-slums-kidnap" class="a-link-button tooltip"> Kidnap and Ransom
<span class="tooltiptext"> Attempt to kidnap and ransom a high-profile target </span>
</a>
<a href="#" id="location-slums-assassinate" class="a-link-button tooltip"> Assassinate
<span class="tooltiptext"> Attempt to assassinate a high-profile target </span>
</a>
<a href="#" id="location-slums-heist" class="a-link-button tooltip"> Heist
<span class="tooltiptext"> Attempt to pull off the ultimate heist </span>
</a>
</div>
<!-- Dialog Box, displays status text only -->

@ -11,7 +11,7 @@ function Augmentation(name) {
//Level - Only applicable for some augmentations
// NeuroFlux Governor
this.level = 0;
this.level = 1;
}
Augmentation.prototype.setInfo = function(inf) {
@ -781,6 +781,7 @@ initAugmentations = function() {
delete Augmentations[AugmentationNames.NeuroFluxGovernor];
} else {
NeuroFluxGovernor.setRequirements(1000, 1000000);
NeuroFluxGovernor.level = 1;
}
NeuroFluxGovernor.setInfo("A device that is embedded in the back of the neck. The NeuroFlux Governor " +
"monitors and regulates nervous impulses coming to and from the spinal column, " +

@ -94,7 +94,10 @@ CONSTANTS = {
CrimeDrugs: "deal drugs",
CrimeTraffickArms: "traffick illegal arms",
CrimeHomicide: "commit homicide",
CrimeGrandTheftAuto: "commit grand theft auto",
CrimeKidnap: "kidnap someone for ransom",
CrimeAssassination: "assassinate a high-profile target",
CrimeHeist: "pull off the ultimate heist",
//Text that is displayed when the 'help' command is ran in Terminal
HelpText: "analyze Get statistics and information about current machine <br>" +

@ -24,9 +24,24 @@ function commitHomicideCrime() {
Player.startCrime(0, 2, 2, 2, 2, 0, 1000, 3000); //$333.3/s, 0.66 combat exp/s
}
function commitGrandTheftAutoCrime() {
Player.crimeType = CONSTANTS.CrimeGrandTheftAuto;
Player.startCrime(8, 8, 8, 40, 20, 150000, 80000); //$1875/2, .1 exp/s, .5 exp/s, .25 exp/s
}
function commitKidnapCrime() {
Player.crimeType = CONSTANTS.CrimeKidnap;
Player.startCrime(0, 20, 20, 20, 20, 20, 200000, 120000); //$1666.666/s. .167 exp/s
Player.startCrime(0, 20, 20, 20, 20, 20, 300000, 120000); //$2500/s. .167 exp/s
}
function commitAssassinationCrime() {
Player.crimeType = CONSTANTS.CrimeAssassination;
Player.startCrime(0, 75, 75, 75, 75, 0, 1000000, 300000); //$3333.33/s, .25 exp/s
}
function commitHeistCrime() {
Player.crimeType = CONSTANTS.CrimeHeist;
Player.startCrime(90, 90, 90, 90, 90, 90, 25000000, 600000); //$41,666.67/s, .15exp/s
}
function determineCrimeSuccess(crime, moneyGained) {
@ -47,9 +62,18 @@ function determineCrimeSuccess(crime, moneyGained) {
case CONSTANTS.CrimeHomicide:
chance = determineCrimeChanceHomicide();
break;
case CONSTANTS.CrimeGrandTheftAuto:
chance = determineCrimeChanceGrandTheftAuto();
break;
case CONSTANTS.CrimeKidnap:
chance = determineCrimeChanceKidnap();
break;
case CONSTANTS.CrimeAssassination:
chance = determineCrimeChanceAssassination();
break;
case CONSTANTS.CrimeHeist:
chance = determineCrimeChanceHeist();
break;
default:
dialogBoxCreate("ERR: Unrecognized crime type. This is probably a bug please contact the developer");
return;
@ -107,11 +131,39 @@ function determineCrimeChanceHomicide() {
return Math.min(chance, 1);
}
function determineCrimeChanceGrandTheftAuto() {
var chance = ((Player.hacking_skill / CONSTANTS.MaxSkillLevel +
Player.strength / CONSTANTS.MaxSkillLevel +
Player.defense / CONSTANTS.MaxSkillLevel +
4 * Player.dexterity / CONSTANTS.MaxSkillLevel +
Player.agility / CONSTANTS.MaxSkillLevel +
2 * Player.charisma / CONSTANTS.MaxSkillLevel)) / 8;
return Math.min(chance, 1);
}
function determineCrimeChanceKidnap() {
return ((Player.charisma / CONSTANTS.MaxSkillLevel +
Player.strength / CONSTANTS.MaxSkillLevel +
Player.defense / CONSTANTS.MaxSkillLevel +
Player.dexterity / CONSTANTS.MaxSkillLevel +
Player.agility / CONSTANTS.MaxSkillLevel)) / 4;
Player.agility / CONSTANTS.MaxSkillLevel)) / 6;
return Math.min(chance, 1);
}
function determineCrimeChanceAssassination() {
var chance = ((Player.strength / CONSTANTS.MaxSkillLevel +
Player.defense / CONSTANTS.MaxSkillLevel +
Player.dexterity / CONSTANTS.MaxSkillLevel +
Player.agility / CONSTANTS.MaxSkillLevel)) / 8;
return Math.min(chance, 1);
}
function determineCrimeChanceHeist() {
var chance = ((Player.hacking_skill / CONSTANTS.MaxSkillLevel +
Player.strength / CONSTANTS.MaxSkillLevel +
Player.defense / CONSTANTS.MaxSkillLevel +
Player.dexterity / CONSTANTS.MaxSkillLevel +
Player.agility / CONSTANTS.MaxSkillLevel +
Player.charisma / CONSTANTS.MaxSkillLevel)) / 18;
return Math.min(chance, 1);
}

@ -148,7 +148,10 @@ displayLocationContent = function() {
var slumsDealDrugs = document.getElementById("location-slums-deal-drugs");
var slumsTrafficArms = document.getElementById("location-slums-traffic-arms");
var slumsHomicide = document.getElementById("location-slums-homicide");
var slumsGta = document.getElementById("location-slums-gta");
var slumsKidnap = document.getElementById("location-slums-kidnap");
var slumsAssassinate = document.getElementById("location-slums-assassinate");
var slumsHeist = document.getElementById("location-slums-heist");
var loc = Player.location;
@ -223,7 +226,10 @@ displayLocationContent = function() {
slumsDealDrugs.style.display = "none";
slumsTrafficArms.style.display = "none";
slumsHomicide.style.display = "none";
slumsGta.style.display = "none";
slumsKidnap.style.display = "none";
slumsAssassinate.style.display = "none";
slumsHeist.style.display = "none";
//Check if the player is employed at this Location. If he is, display the "Work" button,
//update the job title, etc.
@ -819,7 +825,10 @@ displayLocationContent = function() {
var drugsChance = determineCrimeChanceDealDrugs();
var armsChance = determineCrimeChanceTraffickArms();
var homicideChance = determineCrimeChanceHomicide();
var gtaChance = determineCrimeChanceGrandTheftAuto();
var kidnapChance = determineCrimeChanceKidnap();
var assassinateChance = determineCrimeChanceAssassination();
var heistChance = determineCrimeChanceHeist();
slumsDescText.style.display = "block";
slumsShoplift.style.display = "block";
@ -832,9 +841,14 @@ displayLocationContent = function() {
slumsTrafficArms.innerHTML = "Traffick Illegal Arms (" + (armsChance*100).toFixed(3) + "% chance of success)";
slumsHomicide.style.display = "block";
slumsHomicide.innerHTML = "Homicide (" + (homicideChance*100).toFixed(3) + "% chance of success)";
slumsGta.style.display = "block";
slumsGta.innerHTML = "Grand Theft Auto (" + (gtaChance*100).toFixed(3) + "% chance of success)";
slumsKidnap.style.display = "block";
slumsKidnap.innerHTML = "Kidnap and Ransom (" + (kidnapChance*100).toFixed(3) + "% chance of success)";
slumsAssassinate.style.display = "block";
slumsAssassinate.innerHTML = "Assassinate (" + (assassinateChance*100).toFixed(3) + "% chance of success)";
slumsHeist.style.display = "block";
slumsHeist.innerHTML = "Heist (" + (heistChance*100).toFixed(3) + "% chance of success)";
break;
default:
console.log("ERROR: INVALID LOCATION");
@ -1307,7 +1321,10 @@ initLocationButtons = function() {
var slumsDealDrugs = document.getElementById("location-slums-deal-drugs");
var slumsTrafficArms = document.getElementById("location-slums-traffic-arms");
var slumsHomicide = document.getElementById("location-slums-homicide");
var slumsGta = document.getElementById("location-slums-gta");
var slumsKidnap = document.getElementById("location-slums-kidnap");
var slumsAssassinate = document.getElementById("location-slums-assassinate");
var slumsHeist = document.getElementById("location-slums-heist");
softwareJob.addEventListener("click", function() {
Player.applyForSoftwareJob();
@ -1474,10 +1491,25 @@ initLocationButtons = function() {
return false;
});
slumsGta.addEventListener("click", function() {
commitGrandTheftAutoCrime();
return false;
});
slumsKidnap.addEventListener("click", function() {
commitKidnapCrime();
return false;
});
slumsAssassinate.addEventListener("click", function() {
commitAssassinationCrime();
return false;
});
slumsHeist.addEventListener("click", function() {
commitHeistCrime();
return false;
});
}
travelToCity = function(destCityName, cost) {

@ -104,9 +104,15 @@ function PlayerObject() {
this.numPeopleKilled = 0;
this.numPeopleKilledTotal = 0;
this.numPeopleKilledLifetime = 0;
this.numTimesGrandTheftAuto = 0;
this.numTimesGrandTheftAutoTotal = 0;
this.numTimesGrandTheftAutoLifetime = 0;
this.numTimesKidnapped = 0;
this.numTimesKidnappedTotal = 0;
this.numTimesKidnappedLifetime = 0;
this.numTimesHeist = 0;
this.numTimesHeistTotal = 0;
this.numTimesHeistLifetime = 0;
//Achievements and achievement progress
@ -960,6 +966,7 @@ PlayerObject.prototype.commitCrime = function (numCycles) {
PlayerObject.prototype.finishCrime = function(cancelled) {
//Determine crime success/failure
if (!cancelled) {
var statusText = ""; //TODO, unique message for each crime when you succeed
if (determineCrimeSuccess(this.crimeType, this.workMoneyGained)) {
//Handle Karma and crime statistics
switch(this.crimeType) {
@ -983,9 +990,21 @@ PlayerObject.prototype.finishCrime = function(cancelled) {
++this.numPeopleKilled;
this.karma -= 3;
break;
case CONSTANTS.CrimeGrandTheftAuto:
++this.numTimesGrandTheftAuto;
this.karma -= 5;
break;
case CONSTANTS.CrimeKidnap:
++this.numTimesKidnapped;
this.karma -= 3;
this.karma -= 6;
break;
case CONSTANTS.CrimeAssassination:
++this.numPeopleKilled;
this.karma -= 10;
break;
case CONSTANTS.CrimeHeist:
++this.numTimesHeist;
this.karma -= 15;
break;
default:
dialogBoxCreate("ERR: Unrecognized crime type. This is probably a bug please contact the developer");
@ -1019,9 +1038,11 @@ PlayerObject.prototype.finishCrime = function(cancelled) {
formatNumber(this.workAgiExpGained, 4) + " agility experience<br>" +
formatNumber(this.workChaExpGained, 4) + " charisma experience");
}
}
this.gainWorkExp();
}
var mainMenu = document.getElementById("mainmenu-container");
mainMenu.style.visibility = "visible";

@ -32,9 +32,17 @@ function prestigeAugmentation() {
Player.numPeopleKilledTotal += Player.numPeopleKilled;
Player.numPeopleKilledLifetime += Player.numPeopleKilled;
Player.numPeopleKilled = 0;
Player.numTimesGrandTheftAutoTotal += Player.numTimesGrandTheftAuto;
Player.numTimesGrandTheftAutoLifetime += Player.numTimesGrandTheftAuto;
Player.numTimesGrandTheftAuto = 0;
Player.numTimesKidnappedTotal += Player.numTimesKidnapped;
Player.numTimesKidnappedLifetime += Player.numTimesKidnapped;
Player.numTimesKidnapped = 0;
Player.numTimesHeistTotal += Player.numTimesHeist;
Player.numTimesHeistLifetime += Player.numTimesHeist;
Player.numTimesHeist = 0;
Player.karma = 0;
//Reset stats
Player.hacking_skill = 1;
@ -99,22 +107,24 @@ function prestigeAugmentation() {
Player.lastUpdate = new Date().getTime();
var homeComp = null;
var homeComp = Player.getHomeComputer();
//Delete all servers except home computer
for (var member in AllServers) {
//Don't delete home computer
if (member == Player.homeComputer) {
homeComp = AllServers[member];
continue;
}
delete AllServers[member];
}
AllServers = {};
//Reset home computer (only the programs) and add to AllServers
homeComp.programs.length = 0;
homeComp.runningScripts = [];
homeComp.serversOnNetwork = [];
homeComp.isConnectedTo = true;
homeComp.isOnline = true;
homeComp.ramUsed = 0;
homeComp.programs.push(Programs.NukeProgram);
addToAllServers(homeComp);
Player.currentServer = homeComp.ip;
Player.homeComputer = homeComp.ip;
AddToAllServers(homeComp);
//Delete all running scripts objects
for (var i = 0; i < workerScripts.length; ++i) {

@ -121,7 +121,6 @@ Reviver.constructors.Server = Server;
//world_daemon: new Server(), //Final server for 2nd tier prestige. Discover that the world is a simulation
/* Initialization. Called only when loading a new game( no save file) */
initForeignServers = function() {
//MegaCorporations
var ECorpServer = new Server();

@ -765,7 +765,9 @@ var Terminal = {
post("Hostname IP Root Access");
for (var i = 0; i < Player.getCurrentServer().serversOnNetwork.length; i++) {
//Add hostname
var entry = Player.getCurrentServer().getServerOnNetwork(i).hostname;
var entry = Player.getCurrentServer().getServerOnNetwork(i);
if (entry == null) {continue;}
entry = entry.hostname;
//Calculate padding and add IP
var numSpaces = 21 - entry.length;

@ -458,7 +458,7 @@ var Engine = {
item.setAttribute("class", "installed-augmentation");
hElem.innerHTML = augName;
if (augName == AugmentationNames.NeuroFluxGovernor) {
hElem += " - Level " + (aug.level);
hElem.innerHTML += " - Level " + (aug.level);
}
pElem.innerHTML = aug.info;