2019-04-14 11:08:10 +02:00
|
|
|
/**
|
|
|
|
* React component for general information about the faction. This includes the
|
|
|
|
* factions "motto", reputation, favor, and gameplay instructions
|
|
|
|
*/
|
|
|
|
import * as React from "react";
|
|
|
|
|
|
|
|
import { Faction } from "../../Faction/Faction";
|
|
|
|
import { FactionInfo } from "../../Faction/FactionInfo";
|
|
|
|
|
|
|
|
import { AutoupdatingParagraph } from "../../ui/React/AutoupdatingParagraph";
|
|
|
|
import { ParagraphWithTooltip } from "../../ui/React/ParagraphWithTooltip";
|
2021-03-31 06:45:21 +02:00
|
|
|
import { Reputation } from "../../ui/React/Reputation";
|
|
|
|
import { Favor } from "../../ui/React/Favor";
|
2021-09-02 09:10:12 +02:00
|
|
|
import { MathComponent } from 'mathjax-react'
|
2019-04-14 11:08:10 +02:00
|
|
|
|
|
|
|
type IProps = {
|
|
|
|
faction: Faction;
|
|
|
|
factionInfo: FactionInfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
type IInnerHTMLMarkup = {
|
|
|
|
__html: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
const blockStyleMarkup = {
|
|
|
|
display: "block",
|
|
|
|
}
|
|
|
|
|
|
|
|
const infoStyleMarkup = {
|
|
|
|
display: "block",
|
|
|
|
width: "70%",
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Info extends React.Component<IProps, any> {
|
2019-05-02 00:20:14 +02:00
|
|
|
constructor(props: IProps) {
|
|
|
|
super(props);
|
2019-04-14 11:08:10 +02:00
|
|
|
|
2021-03-31 06:45:21 +02:00
|
|
|
this.getFavorGainContent = this.getFavorGainContent.bind(this);
|
|
|
|
this.getReputationContent = this.getReputationContent.bind(this);
|
2019-05-02 00:20:14 +02:00
|
|
|
}
|
|
|
|
|
2021-03-31 06:45:21 +02:00
|
|
|
getFavorGainContent(): JSX.Element {
|
2019-04-14 11:08:10 +02:00
|
|
|
const favorGain = this.props.faction.getFavorGain()[0];
|
2021-09-03 23:12:55 +02:00
|
|
|
return (<>
|
|
|
|
You will earn {Favor(favorGain)} faction favor upon resetting after installing an Augmentation
|
|
|
|
<MathComponent tex={String.raw`r = \text{total faction reputation}`} />
|
|
|
|
<MathComponent tex={String.raw`favor=\left\lfloor\log_{1.02}\left(\frac{r+25000}{25500}\right)\right\rfloor`} />
|
|
|
|
</>);
|
2019-05-02 00:20:14 +02:00
|
|
|
}
|
|
|
|
|
2021-03-31 06:45:21 +02:00
|
|
|
getReputationContent(): JSX.Element {
|
|
|
|
return <>Reputation: {Reputation(this.props.faction.playerReputation)}</>
|
2019-05-02 00:20:14 +02:00
|
|
|
}
|
|
|
|
|
2021-05-01 09:17:31 +02:00
|
|
|
render(): React.ReactNode {
|
2021-09-02 09:10:12 +02:00
|
|
|
const favorTooltip = <>
|
|
|
|
Faction favor increases the rate at which you earn reputation for
|
|
|
|
this faction by 1% per favor. Faction favor is gained whenever you
|
|
|
|
reset after installing an Augmentation. The amount of
|
|
|
|
favor you gain depends on how much reputation you have with the faction
|
2021-09-03 23:12:55 +02:00
|
|
|
<MathComponent tex={String.raw`r = reputation`} />
|
|
|
|
<MathComponent tex={String.raw`\Delta r = \Delta r \times \frac{100+favor}{100}`} />
|
2021-09-02 09:10:12 +02:00
|
|
|
</>;
|
2019-04-14 11:08:10 +02:00
|
|
|
|
2021-09-03 23:12:55 +02:00
|
|
|
|
2019-04-14 11:08:10 +02:00
|
|
|
const infoText: IInnerHTMLMarkup = {
|
|
|
|
__html: this.props.factionInfo.infoText,
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div>
|
2019-04-15 11:49:49 +02:00
|
|
|
<pre>
|
|
|
|
<i className={"text"} dangerouslySetInnerHTML={infoText}></i>
|
|
|
|
</pre>
|
2019-04-14 11:08:10 +02:00
|
|
|
<p style={blockStyleMarkup}>-------------------------</p>
|
|
|
|
<AutoupdatingParagraph
|
|
|
|
intervalTime={5e3}
|
2021-03-31 06:45:21 +02:00
|
|
|
getContent={this.getReputationContent}
|
|
|
|
getTooltip={this.getFavorGainContent}
|
2019-04-14 11:08:10 +02:00
|
|
|
/>
|
|
|
|
<p style={blockStyleMarkup}>-------------------------</p>
|
|
|
|
<ParagraphWithTooltip
|
2021-03-31 06:45:21 +02:00
|
|
|
content={<>Faction Favor: {Favor(this.props.faction.favor)}</>}
|
2019-04-14 11:08:10 +02:00
|
|
|
tooltip={favorTooltip}
|
|
|
|
/>
|
|
|
|
<p style={blockStyleMarkup}>-------------------------</p>
|
|
|
|
<p style={infoStyleMarkup}>
|
|
|
|
Perform work/carry out assignments for your faction to help further its cause!
|
|
|
|
By doing so you will earn reputation for your faction. You will also gain
|
|
|
|
reputation passively over time, although at a very slow rate. Earning
|
|
|
|
reputation will allow you to purchase Augmentations through this faction, which
|
2021-06-08 14:31:56 +02:00
|
|
|
are powerful upgrades that enhance your abilities.
|
2019-04-14 11:08:10 +02:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|