Playtesting- fixed bugs

This commit is contained in:
Daniel Xie 2017-04-19 00:02:40 -05:00
parent 77f386d14a
commit 650bdf1f3f
7 changed files with 36 additions and 16 deletions

@ -67,6 +67,8 @@ TESTING TODO:
Seems to work fine
Tasks TODO:
Factions Info page isn't formatted correctly
Augmentations that decrease time to make programs
New server hostname in Purchase Server Pop-up Box needs limits..don't think the ones set in HTML work

@ -157,6 +157,11 @@
width: 90%;
}
#factions-list li {
padding: 6px;
margin: 6px;
}
#faction-hack-button-div, #faction-hack-text-div {
display:inline-block;
}

@ -22,6 +22,9 @@ CONSTANTS = {
MillisecondsPer20Hours: 72000000,
GameCyclesPer20Hours: 72000000 / 200,
MillisecondsPer10Hours: 36000000,
GameCyclesPer10Hours: 36000000 / 200,
MillisecondsPer8Hours: 28800000,
GameCyclesPer8Hours: 28800000 / 200,

@ -125,11 +125,10 @@ PlayerObject.prototype.checkForFactionInvitations = function() {
invitedFactions = []; //Array which will hold all Factions th eplayer should be invited to
var company = Companies[this.companyName];
if (company == null) {
return invitedFactions;
var companyRep = 0;
if (company != null) {
companyRep = company.playerReputation;
}
var companyRep = company.playerReputation;
//Illuminati
var illuminatiFac = Factions["Illuminati"];
@ -352,8 +351,10 @@ PlayerObject.prototype.checkForFactionInvitations = function() {
//CyberSec
var cybersecFac = Factions["CyberSec"];
console.log(this.hacking_skill + " " + cybersecFac.isMember + " " + cybersecFac.isBanned);
if (cybersecFac.isBanned == false && cybersecFac.isMember == false &&
this.hacking_skill >= 50) {
this.hacking_skill >= 5) {
console.log("Qualified for CyberSec");
invitedFactions.push(cybersecFac);
}
@ -446,7 +447,7 @@ displayFactionContent = function(factionName) {
return false;
});
newSecurityWorkButton("click", function() {
newSecurityWorkButton.addEventListener("click", function() {
Player.startFactionSecurityWork(faction);
return false;
});

@ -401,7 +401,7 @@ PlayerObject.prototype.work = function(numCycles) {
//If timeWorked == 8 hours, then finish. You can only gain 8 hours worth of exp and money
if (this.timeWorked >= CONSTANTS.MillisecondsPer8Hours) {
var maxCycles = CONSTANTS.GameCyclesPer8Hours; //Number of cycles in 8 hours
this.workHackExpGained = this.workhackExpGainRate * maxCycles;
this.workHackExpGained = this.workHackExpGainRate * maxCycles;
this.workStrExpGained = this.workStrExpGainRate * maxCycles;
this.workDefExpGained = this.workDefExpGainRate * maxCycles;
this.workDexExpGained = this.workDexExpGainRate * maxCycles;
@ -434,12 +434,12 @@ PlayerObject.prototype.work = function(numCycles) {
/* Working for Faction */
PlayerObject.prototype.finishFactionWork = function(cancelled, faction) {
this.hacking_exp += (this.workHackExpGained);
this.strength_exp += (this.workStrExpGained);
this.defense_exp += (this.workDefExpGained);
this.dexterity_exp += (this.workDexExpGained);
this.agility_exp += (this.workAgiExpGained);
this.charisma_exp += (this.workChaExpGained);
this.gainHackingExp(this.workHackExpGained);
this.gainStrengthExp(this.workStrExpGained);
this.gainDefenseExp(this.workDefExpGained);
this.gainDexterityExp(this.workDexExpGained);
this.gainAgilityExp(this.workAgiExpGained);
this.gainCharismaExp(this.workChaExpGained);
var faction = Factions[this.currentWorkFactionName];
faction.playerReputation += (this.workRepGained);
@ -563,7 +563,7 @@ PlayerObject.prototype.workForFaction = function(numCycles) {
//If timeWorked == 20 hours, then finish. You can only work for the faction for 20 hours
if (this.timeWorked >= CONSTANTS.MillisecondsPer20Hours) {
var maxCycles = CONSTANTS.GameCyclesPer20Hours; //Number of cycles in 20 hours
this.workHackExpGained = this.workhackExpGainRate * maxCycles;
this.workHackExpGained = this.workHackExpGainRate * maxCycles;
this.workStrExpGained = this.workStrExpGainRate * maxCycles;
this.workDefExpGained = this.workDefExpGainRate * maxCycles;
this.workDexExpGained = this.workDexExpGainRate * maxCycles;

@ -450,6 +450,12 @@ var Engine = {
displayFactionsInfo: function() {
var factionsList = document.getElementById("factions-list");
//Clear the list
while (factionsList.firstChild) {
factionsList.removeChild(factionsList.firstChild);
}
//Re-add a link for each faction you are a member of
for (var i = 0; i < Player.factions.length; ++i) {
var factionName = Player.factions[i];
@ -585,7 +591,8 @@ var Engine = {
updateSkillLevelsCounter: 10, //Only update skill levels every 2 seconds. Might improve performance
updateDisplays: 5, //Update displays such as Active Scripts display and character display
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
checkFactionInvitations: 50,
},
decrementAllCounters: function(numCycles = 1) {

@ -7,7 +7,9 @@
// off to that `fromJSON` fuunction, passing in the value.
function Reviver(key, value) {
var ctor;
//console.log("Reviver called with key: " + key + ", and value: " + value);
if (value == null) {
console.log("Reviver WRONGLY called with key: " + key + ", and value: " + value);
}
if (typeof value === "object" &&
typeof value.ctor === "string" &&
typeof value.data !== "undefined") {