Merge branch 'danielyxie:dev' into dev

This commit is contained in:
QuantumByte 2021-06-06 12:42:28 -04:00
commit 687a2f8852
6 changed files with 115 additions and 29 deletions

@ -18,6 +18,8 @@ import { dialogBoxCreate } from "../../utils/DialogBox";
import { clearObject } from "../../utils/helpers/clearObject";
import { Money } from "../ui/React/Money";
import { WHRNG } from "../Casino/RNG";
import React from "react";
import ReactDOM from "react-dom";
@ -26,6 +28,64 @@ function AddToAugmentations(aug) {
Augmentations[name] = aug;
}
function getRandomBonus() {
var bonuses =
[
[
["hacking_chance_mult", 1.25],
["hacking_speed_mult", 1.15],
["hacking_money_mult", 1.25],
["hacking_grow_mult", 1.1],
],
[
["strength_exp_mult", 1.15],
["strength_exp_mult", 2]
],
[
["defense_mult", 1.15],
["defense_exp_mult", 2]
],
[
["dexterity_mult", 1.15],
["dexterity_exp_mult", 2]
],
[
["agility_mult", 1.15],
["agility_exp_mult", 2]
],
[
["charisma_mult", 1.15],
["charisma_exp_mult", 2]
],
[
["hacknet_node_money_mult", 1.2],
["hacknet_node_purchase_cost_mult", 0.85],
["hacknet_node_ram_cost_mult", 0.85],
["hacknet_node_core_cost_mult", 0.85],
["hacknet_node_level_cost_mult", 0.85]
],
[
["company_rep_mult", 1.25],
["faction_rep_mult", 1.15],
["work_money_mult", 1.3]
],
[
["crime_success_mult", 2],
["crime_money_mult", 2],
],
]
let randomNumber = (new WHRNG(Math.floor(Player.lastUpdate/3600000)));
for(let i = 0; i < 3; i++){
randomNumber.step();
}
return (bonuses[Math.floor(bonuses.length * randomNumber.random())]);
}
function initAugmentations() {
for (var name in Factions) {
if (Factions.hasOwnProperty(name)) {
@ -36,6 +96,31 @@ function initAugmentations() {
//Reset Augmentations
clearObject(Augmentations);
//Time-Based Augment Test
var randomBonuses = getRandomBonus();
const CircadianRhythm = new Augmentation({
name:AugmentationNames.CircadianRhythm, moneyCost: 1e9, repCost:4.5e3,
info:"A prototype injection which modifies your circadian rhythm, leading to varied effects.<br><br>" +
"This augmentation currently modifies these values:<br>"
});
for (let i = 0; i < randomBonuses.length; i++) {
console.log(`${randomBonuses[i]}`);
CircadianRhythm.mults[randomBonuses[i][0]] = randomBonuses[i][1];
CircadianRhythm.info += `${randomBonuses[i][0]} by ${Math.round(100 * randomBonuses[i][1].toFixed(2))}%<br>`
}
console.log(CircadianRhythm.info);
CircadianRhythm.addToFactions(["Speakers for the Dead"]);
if (augmentationExists(AugmentationNames.CircadianRhythm)) {
delete Augmentations[AugmentationNames.CircadianRhythm];
}
AddToAugmentations(CircadianRhythm);
//Combat stat augmentations
const HemoRecirculator = new Augmentation({
name:AugmentationNames.HemoRecirculator, moneyCost: 9e6, repCost:4e3,

@ -1,6 +1,7 @@
import { IMap } from "../../types";
export const AugmentationNames: IMap<string> = {
CircadianRhythm: "Circadian Modulator",
Targeting1: "Augmented Targeting I",
Targeting2: "Augmented Targeting II",
Targeting3: "Augmented Targeting III",

@ -48,10 +48,10 @@ export function PlayerMultipliers(): React.ReactElement {
if(!Player.canAccessBladeburner()) return (<></>);
return (<>
{MultiplierTable([
['Bladeburner Success Chance', Player.bladeburner_max_stamina_mult, Player.bladeburner_max_stamina_mult*mults.bladeburner_max_stamina_mult],
['Bladeburner Success Chance', Player.bladeburner_success_chance_mult, Player.bladeburner_success_chance_mult*mults.bladeburner_success_chance_mult],
['Bladeburner Max Stamina', Player.bladeburner_max_stamina_mult, Player.bladeburner_max_stamina_mult*mults.bladeburner_max_stamina_mult],
['Bladeburner Stamina Gain', Player.bladeburner_max_stamina_mult, Player.bladeburner_max_stamina_mult*mults.bladeburner_max_stamina_mult],
['Bladeburner Field Analysis', Player.bladeburner_max_stamina_mult, Player.bladeburner_max_stamina_mult*mults.bladeburner_max_stamina_mult],
['Bladeburner Stamina Gain', Player.bladeburner_stamina_gain_mult, Player.bladeburner_stamina_gain_mult*mults.bladeburner_stamina_gain_mult],
['Bladeburner Field Analysis', Player.bladeburner_analysis_mult, Player.bladeburner_analysis_mult*mults.bladeburner_analysis_mult],
])}<br />
</>);
}

@ -14,6 +14,7 @@ import { AllServers } from "./Server/AllServers";
import { GetServerByHostname } from "./Server/ServerHelpers";
import { hackWorldDaemon } from "./RedPill";
import { StockMarket } from "./StockMarket/StockMarket";
import { Bladeburner } from "./Bladeburner";
import { Stock } from "./StockMarket/Stock";
import { Engine } from "./engine";
import { saveObject } from "./SaveObject";
@ -145,6 +146,10 @@ class DevMenuComponent extends Component {
hackWorldDaemon(Player.bitNodeN, true);
}
quickHackW0r1dD43m0n() {
hackWorldDaemon(Player.bitNodeN, false, true);
}
hackW0r1dD43m0n() {
hackWorldDaemon(Player.bitNodeN);
}
@ -708,7 +713,6 @@ class DevMenuComponent extends Component {
contractTypes.push(<option key={name} value={name}>{name}</option>);
}
return (
<div className="col">
<div className="row">
@ -728,6 +732,7 @@ class DevMenuComponent extends Component {
<div className="row">
<button className="std-button" onClick={this.quickB1tFlum3}>Quick b1t_flum3.exe</button>
<button className="std-button" onClick={this.b1tflum3}>Run b1t_flum3.exe</button>
<button className="std-button" onClick={this.quickHackW0r1dD43m0n}>Quick w0rld_d34m0n</button>
<button className="std-button" onClick={this.hackW0r1dD43m0n}>Hack w0rld_d34m0n</button>
</div>
<div className="row">
@ -1066,6 +1071,7 @@ class DevMenuComponent extends Component {
</div>
</div>
{Player.bladeburner instanceof Bladeburner &&
<div className="row">
<div className="col">
<div className="row">
@ -1101,7 +1107,9 @@ class DevMenuComponent extends Component {
</table>
</div>
</div>
}
{Player.inGang() &&
<div className="row">
<div className="col">
<div className="row">
@ -1125,7 +1133,9 @@ class DevMenuComponent extends Component {
</table>
</div>
</div>
}
{Player.hasCorporation() &&
<div className="row">
<div className="col">
<div className="row">
@ -1152,6 +1162,7 @@ class DevMenuComponent extends Component {
</table>
</div>
</div>
}
<div className="row">
@ -1181,7 +1192,7 @@ class DevMenuComponent extends Component {
</div>
</div>
{Player.hasWseAccount &&
<div className="row">
<div className="col">
<div className="row">
@ -1208,8 +1219,9 @@ class DevMenuComponent extends Component {
</table>
</div>
</div>
}
{Player.sleeves.length > 0 &&
<div className="row">
<div className="col">
<div className="row">
@ -1231,6 +1243,7 @@ class DevMenuComponent extends Component {
</table>
</div>
</div>
}
<div className="row">
<div className="col">

@ -176,7 +176,7 @@ function prestigeAugmentation() {
// Prestige by destroying Bit Node and gaining a Source File
function prestigeSourceFile() {
function prestigeSourceFile(flume) {
initBitNodeMultipliers(Player);
updateSourceFileFlags(Player);
@ -350,7 +350,8 @@ function prestigeSourceFile() {
document.getElementById("world-menu-header").click();
// Gain int exp
Player.gainIntelligenceExp(300);
if(SourceFileFlags[5] !== 0 && !flume)
Player.gainIntelligenceExp(300);
resetPidCounter();
}

@ -134,7 +134,7 @@ function giveSourceFile(bitNodeNumber) {
} else {
var playerSrcFile = new PlayerOwnedSourceFile(bitNodeNumber, 1);
Player.sourceFiles.push(playerSrcFile);
if (bitNodeNumber === 5) { // Artificial Intelligence
if (bitNodeNumber === 5 && Player.intelligence === 0) { // Artificial Intelligence
Player.intelligence = 1;
}
dialogBoxCreate("You received a Source-File for destroying a Bit Node!<br><br>" +
@ -305,31 +305,17 @@ function createBitNodeYesNoEventListener(newBitNode, destroyedBitNode, flume=fal
yesBtn.addEventListener("click", function() {
if (!flume) {
giveSourceFile(destroyedBitNode);
if (newBitNode === 5) {
if(Player.intelligence === 0) {
Player.intelligence = 1;
Player.updateSkillLevels();
}
}
} else {
// If player used flume, subtract 300 int exp. The prestigeSourceFile()
// function below grants 300 int exp, so this allows sets net gain to 0
Player.gainIntelligenceExp(-300);
if(SourceFileFlags[5] === 0 || newBitNode !== 5) {
if(SourceFileFlags[5] === 0 && newBitNode !== 5) {
Player.intelligence = 0;
Player.intelligence_exp = 0;
Player.updateSkillLevels();
}
if (newBitNode === 5) {
if(Player.intelligence === 0) {
Player.intelligence = 1;
Player.updateSkillLevels();
}
}
}
if (newBitNode === 5 && Player.intelligence === 0) {
Player.intelligence = 1;
}
redPillFlag = false;
var container = document.getElementById("red-pill-content");
const container = document.getElementById("red-pill-content");
removeChildrenFromElement(container);
// Set new Bit Node
@ -341,7 +327,7 @@ function createBitNodeYesNoEventListener(newBitNode, destroyedBitNode, flume=fal
document.getElementById("terminal-input-td").innerHTML = '$ <input type="text" id="terminal-input-text-box" class="terminal-input" tabindex="1"/>';
$('input[class=terminal-input]').prop('disabled', false);
prestigeSourceFile();
prestigeSourceFile(flume);
yesNoBoxClose();
});
const noBtn = yesNoBoxGetNoButton();