mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-23 01:32:55 +02:00
convert faction work to new work system
This commit is contained in:
@@ -31,6 +31,8 @@ import { isClassWork } from "../../Work/ClassWork";
|
||||
import { CONSTANTS } from "../../Constants";
|
||||
import { isCreateProgramWork } from "../../Work/CreateProgramWork";
|
||||
import { isGraftingWork } from "../../Work/GraftingWork";
|
||||
import { isFactionWork } from "../../Work/FactionWork";
|
||||
import { ReputationRate } from "./ReputationRate";
|
||||
|
||||
interface IProps {
|
||||
save: () => void;
|
||||
@@ -172,6 +174,22 @@ function Work(): React.ReactElement {
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
if (isFactionWork(player.currentWork)) {
|
||||
const factionWork = player.currentWork;
|
||||
header = (
|
||||
<>
|
||||
Working for <strong>{factionWork.factionName}</strong>
|
||||
</>
|
||||
);
|
||||
innerText = (
|
||||
<>
|
||||
<Reputation reputation={factionWork.getFaction().playerReputation} /> rep
|
||||
<br />(
|
||||
<ReputationRate reputation={factionWork.getReputationRate(player) * (1000 / CONSTANTS._idleSpeed)} />)
|
||||
</>
|
||||
);
|
||||
}
|
||||
switch (player.workType) {
|
||||
case WorkType.CompanyPartTime:
|
||||
case WorkType.Company:
|
||||
@@ -191,23 +209,6 @@ function Work(): React.ReactElement {
|
||||
</>
|
||||
);
|
||||
break;
|
||||
case WorkType.Faction:
|
||||
details = (
|
||||
<>
|
||||
{player.factionWorkType} for <strong>{player.currentWorkFactionName}</strong>
|
||||
</>
|
||||
);
|
||||
header = (
|
||||
<>
|
||||
Working for <strong>{player.currentWorkFactionName}</strong>
|
||||
</>
|
||||
);
|
||||
innerText = (
|
||||
<>
|
||||
+<Reputation reputation={player.workRepGained} /> rep
|
||||
</>
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user