added formula for cores cost, ram cost, and changed core cost formula

This commit is contained in:
Olivier Gagnon 2021-09-04 14:43:22 -04:00
parent 1241cc5128
commit c8dd17d573
3 changed files with 26 additions and 7 deletions

@ -43,8 +43,8 @@ export class Info extends React.Component<IProps, any> {
const favorGain = this.props.faction.getFavorGain()[0]; const favorGain = this.props.faction.getFavorGain()[0];
return (<> return (<>
You will have {Favor(this.props.faction.favor+favorGain)} faction favor after installing an Augmentation. You will have {Favor(this.props.faction.favor+favorGain)} faction favor after installing an Augmentation.
<MathComponent tex={String.raw`r = \text{total faction reputation}`} /> <MathComponent tex={String.raw`\large{r = \text{total faction reputation}}`} />
<MathComponent tex={String.raw`favor=\left\lfloor\log_{1.02}\left(\frac{r+25000}{25500}\right)\right\rfloor`} /> <MathComponent tex={String.raw`\large{favor=\left\lfloor\log_{1.02}\left(\frac{r+25000}{25500}\right)\right\rfloor}`} />
</>); </>);
} }
@ -59,8 +59,8 @@ export class Info extends React.Component<IProps, any> {
install an Augmentation. The amount of install an Augmentation. The amount of
favor you gain depends on the total amount of reputation you earned with this faction. favor you gain depends on the total amount of reputation you earned with this faction.
Across all resets. Across all resets.
<MathComponent tex={String.raw`r = reputation`} /> <MathComponent tex={String.raw`\large{r = reputation}`} />
<MathComponent tex={String.raw`\Delta r = \Delta r \times \frac{100+favor}{100}`} /> <MathComponent tex={String.raw`\large{\Delta r = \Delta r \times \frac{100+favor}{100}}`} />
</>; </>;

@ -12,7 +12,7 @@ import { purchaseRamForHomeComputer } from "../../Server/ServerPurchases";
import { StdButtonPurchased } from "../../ui/React/StdButtonPurchased"; import { StdButtonPurchased } from "../../ui/React/StdButtonPurchased";
import { StdButton } from "../../ui/React/StdButton"; import { StdButton } from "../../ui/React/StdButton";
import { Money } from "../../ui/React/Money"; import { Money } from "../../ui/React/Money";
import { MathComponent } from 'mathjax-react'; import { MathComponent } from 'mathjax-react';
type IProps = { type IProps = {
p: IPlayer; p: IPlayer;
@ -44,12 +44,29 @@ export function CoresButton(props: IProps): React.ReactElement {
homeComputer.cpuCores++; homeComputer.cpuCores++;
rerender(); rerender();
} }
//tooltip={<MathComponent tex={String.raw`cost = `} />} const settings = {
CommonHTML: {
scale: 90
},
"HTML-CSS": {
scale: 90
},
NativeMML: {
scale: 90
},
SVG: {
scale: 90
},
PreviewHTML: {
scale: 90
}
}
return (<StdButton return (<StdButton
disabled={!props.p.canAfford(cost)} disabled={!props.p.canAfford(cost)}
onClick={buy} onClick={buy}
style={btnStyle} style={btnStyle}
text={<>Upgrade 'home' cores ({homeComputer.cpuCores} -&gt; {homeComputer.cpuCores+1}) - <Money money={cost} player={props.p} /></>} text={<>Upgrade 'home' cores ({homeComputer.cpuCores} -&gt; {homeComputer.cpuCores+1}) - <Money money={cost} player={props.p} /></>}
tooltip={<MathComponent tex={String.raw`\large{cost = 10^9 \times 7.5 ^{\text{cores}}}`} />}
/>); />);
} }

@ -12,6 +12,7 @@ import { purchaseRamForHomeComputer } from "../../Server/ServerPurchases";
import { StdButtonPurchased } from "../../ui/React/StdButtonPurchased"; import { StdButtonPurchased } from "../../ui/React/StdButtonPurchased";
import { StdButton } from "../../ui/React/StdButton"; import { StdButton } from "../../ui/React/StdButton";
import { Money } from "../../ui/React/Money"; import { Money } from "../../ui/React/Money";
import { MathComponent } from 'mathjax-react';
type IProps = { type IProps = {
p: IPlayer; p: IPlayer;
@ -45,5 +46,6 @@ export function RamButton(props: IProps): React.ReactElement {
onClick={buy} onClick={buy}
style={btnStyle} style={btnStyle}
text={<>Upgrade 'home' RAM ({homeComputer.maxRam}GB -&gt; {homeComputer.maxRam*2}GB) - <Money money={cost} player={props.p} /></>} text={<>Upgrade 'home' RAM ({homeComputer.maxRam}GB -&gt; {homeComputer.maxRam*2}GB) - <Money money={cost} player={props.p} /></>}
tooltip={<MathComponent tex={String.raw`\large{3.2 \times 10^3 \times 1.58^{log_2{(ram)}}}`} />}
/>); />);
} }