nerf investors fraud

This commit is contained in:
Olivier Gagnon 2022-04-13 18:08:35 -04:00
parent 49164b5d36
commit 88ae27e84d
3 changed files with 10 additions and 1 deletions

@ -45,6 +45,8 @@ export class Corporation {
upgrades: number[];
upgradeMultipliers: number[];
avgProfit = 0;
state = new CorporationState();
constructor(params: IParams = {}) {
@ -106,6 +108,8 @@ export class Corporation {
this.expenses = this.expenses + ind.lastCycleExpenses;
});
const profit = this.revenue - this.expenses;
this.avgProfit =
(this.avgProfit * (CorporationConstants.AvgProfitLength - 1) + profit) / CorporationConstants.AvgProfitLength;
const cycleProfit = profit * (marketCycles * CorporationConstants.SecsPerMarketCycle);
if (isNaN(this.funds) || this.funds === Infinity || this.funds === -Infinity) {
dialogBoxCreate(
@ -160,7 +164,7 @@ export class Corporation {
determineValuation(): number {
let val,
profit = this.revenue - this.expenses;
profit = this.avgProfit;
if (this.public) {
// Account for dividends
if (this.dividendPercentage > 0) {

@ -28,6 +28,7 @@ export const CorporationConstants: {
AllMaterials: string[];
FundingRoundShares: number[];
FundingRoundMultiplier: number[];
AvgProfitLength: number;
} = {
INITIALSHARES: 1e9, //Total number of shares you have at your company
SHARESPERPRICEUPDATE: 1e6, //When selling large number of shares, price is dynamically updated for every batch of this amount
@ -83,4 +84,6 @@ export const CorporationConstants: {
],
FundingRoundShares: [0.1, 0.35, 0.25, 0.2],
FundingRoundMultiplier: [4, 3, 3, 2.5],
AvgProfitLength: 20,
};

@ -1342,6 +1342,7 @@ export function NetscriptSingularity(player: IPlayer, workerScript: WorkerScript
(_nextBN: unknown, _callbackScript: unknown = ""): void => {
const nextBN = _ctx.helper.number("nextBN", _nextBN);
const callbackScript = _ctx.helper.string("callbackScript", _callbackScript);
_ctx.helper.checkSingularityAccess();
enterBitNode(Router, true, player.bitNodeN, nextBN);
if (callbackScript)
setTimeout(() => {
@ -1353,6 +1354,7 @@ export function NetscriptSingularity(player: IPlayer, workerScript: WorkerScript
(_nextBN: unknown, _callbackScript: unknown = ""): void => {
const nextBN = _ctx.helper.number("nextBN", _nextBN);
const callbackScript = _ctx.helper.string("callbackScript", _callbackScript);
_ctx.helper.checkSingularityAccess();
const hackingRequirements = (): boolean => {
const wd = GetServer(SpecialServers.WorldDaemon);