mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-22 22:22:26 +01:00
Merge pull request #991 from Tesseract1234567890/timeBasedAugment
Circadian Modulator - an augment based on the hour in which you install/reset
This commit is contained in:
commit
42935a217d
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user