This commit is contained in:
nickofolas 2022-03-22 17:53:57 -05:00
parent d6e0180116
commit 3df3e04f9c
6 changed files with 35 additions and 16 deletions

@ -41,6 +41,7 @@ export const CONSTANTS: {
IntelligenceInfiltrationWeight: number;
IntelligenceCrimeBaseExpGain: number;
IntelligenceProgramBaseExpGain: number;
IntelligenceCraftBaseExpGain: number;
IntelligenceTerminalHackBaseExpGain: number;
IntelligenceSingFnBaseExpGain: number;
IntelligenceClassBaseExpGain: number;
@ -110,7 +111,7 @@ export const CONSTANTS: {
CodingContractBaseCompanyRepGain: number;
CodingContractBaseMoneyGain: number;
AugmentationCraftingCostMult: number;
AugmentationCraftingTimeMult: number;
AugmentationCraftingTimeBase: number;
EntropyEffect: number;
TotalNumBitNodes: number;
LatestUpdate: string;
@ -184,6 +185,7 @@ export const CONSTANTS: {
IntelligenceInfiltrationWeight: 0.1, // Weight for how much int affects infiltration success rates
IntelligenceCrimeBaseExpGain: 0.05,
IntelligenceProgramBaseExpGain: 0.1, // Program required hack level divided by this to determine int exp gain
IntelligenceCraftBaseExpGain: 0.05,
IntelligenceTerminalHackBaseExpGain: 200, // Hacking exp divided by this to determine int exp gain
IntelligenceSingFnBaseExpGain: 1.5,
IntelligenceClassBaseExpGain: 0.01,
@ -277,7 +279,7 @@ export const CONSTANTS: {
// Augmentation crafting multipliers
// TODO: Get these right
AugmentationCraftingCostMult: 1.2,
AugmentationCraftingTimeMult: 0.01,
AugmentationCraftingTimeBase: 3600000,
EntropyEffect: 0.99,

@ -1,3 +1,5 @@
import { sum } from "lodash";
import { Augmentation } from "../../Augmentation/Augmentation";
import { CONSTANTS } from "../../Constants";
@ -20,7 +22,10 @@ export class CraftableAugmentation {
}
get time(): number {
// CONSTANTS.AugmentationCraftingTimeMult
return 15000;
// Time = 1 hour * log_2(sum(aug multipliers) || 1) + 30 minutes
const antiLog = Math.max(sum(Object.values(this.augmentation.mults)), 1);
const mult = Math.log2(antiLog);
return CONSTANTS.AugmentationCraftingTimeBase * mult + CONSTANTS.MillisecondsPerHalfHour;
}
}

@ -108,7 +108,11 @@ export const GraftingRoot = (): React.ReactElement => {
}
/>
<Typography color={Settings.theme.info}>
<b>Time to Craft:</b> {convertTimeMsToTimeElapsedString(CraftableAugmentations[selectedAug].time)}
<b>Time to Craft:</b>{" "}
{convertTimeMsToTimeElapsedString(
CraftableAugmentations[selectedAug].time / (1 + (player.getIntelligenceBonus(3) - 1) / 3),
)}
{/* Use formula so the displayed creation time is accurate to player bonus */}
</Typography>
<Typography sx={{ maxHeight: 305, overflowY: "scroll" }}>
{(() => {

@ -1354,8 +1354,7 @@ export function craftAugmentationWork(this: IPlayer, numCycles: number): boolean
focusBonus = this.focus ? 1 : CONSTANTS.BaseFocusBonus;
}
// TODO: formula logic here (focus bonus and stuff)
let skillMult = 1;
let skillMult = 1 + (this.getIntelligenceBonus(3) - 1) / 3;
skillMult *= focusBonus;
this.timeWorked += CONSTANTS._idleSpeed * numCycles;
@ -1380,7 +1379,11 @@ export function finishCraftAugmentationWork(this: IPlayer, cancelled: boolean):
dialogBoxCreate(`You cancelled the crafting of ${augName}.<br>Your money was not returned to you.`)
}
// TODO: intelligence EXP stuff here later
// Intelligence gain
if (!cancelled) {
this.gainIntelligenceExp((CONSTANTS.IntelligenceCraftBaseExpGain * this.timeWorked) / 10000);
}
this.isWorking = false;
this.resetWorkStatus();
return `Crafting of ${augName} has ended.`

@ -199,8 +199,8 @@ function Work(): React.ReactElement {
header = <>Crafting an Augmentation</>;
innerText = (
<>
<strong>{convertTimeMsToTimeElapsedString(player.timeNeededToCompleteWork - player.timeWorkedCraftAugmentation)}</strong>
{" "}remaining
<strong>{((player.timeWorkedCraftAugmentation / player.timeNeededToCompleteWork) * 100).toFixed(2)}%</strong>
{" "}done
</>
);
}

@ -41,8 +41,8 @@ export function WorkInProgressRoot(): React.ReactElement {
return (
<>
<Typography variant="h4" color="primary">
You have not joined {player.currentWorkFactionName || "(Faction not found)"} yet or cannot work at this time,
please try again if you think this should have worked
You have not joined {player.currentWorkFactionName || "(Faction not found)"} yet or cannot work at this
time, please try again if you think this should have worked
</Typography>
<Button onClick={() => router.toFactions()}>Back to Factions</Button>
</>
@ -497,10 +497,15 @@ export function WorkInProgressRoot(): React.ReactElement {
<Grid item>
<Typography>
You are currently working on crafting {player.craftAugmentationName}.
<br /><br />
<br />
<br />
You have been working for {convertTimeMsToTimeElapsedString(player.timeWorked)}
<br /><br />
The augmentation will be done in {convertTimeMsToTimeElapsedString(player.timeNeededToCompleteWork - player.timeWorkedCraftAugmentation)}.<br />
<br />
<br />
The augmentation is{" "}
{((player.timeWorkedCraftAugmentation / player.timeNeededToCompleteWork) * 100).toFixed(2)}% done being
crafted.
<br />
If you cancel, your work will <b>not</b> be saved, and the money you spent will <b>not</b> be returned.
</Typography>
</Grid>
@ -511,7 +516,7 @@ export function WorkInProgressRoot(): React.ReactElement {
<Button onClick={unfocus}>Do something else simultaneously</Button>
</Grid>
</Grid>
)
);
}
if (!player.workType) router.toTerminal();