diff --git a/src/Achievements/Achievements.ts b/src/Achievements/Achievements.ts index 2ee85897d..2085a031e 100644 --- a/src/Achievements/Achievements.ts +++ b/src/Achievements/Achievements.ts @@ -25,6 +25,7 @@ import * as data from "./AchievementData.json"; import { FactionNames } from "../Faction/data/FactionNames"; import { BlackOperationNames } from "../Bladeburner/data/BlackOperationNames"; import { isClassWork } from "../Work/ClassWork"; +import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers"; // Unable to correctly cast the JSON data into AchievementDataJson type otherwise... const achievementData = ((data)).achievements; @@ -383,7 +384,10 @@ export const achievements: IMap = { DONATION: { ...achievementData["DONATION"], Icon: "donation", - Condition: () => Object.values(Factions).some((f) => f.favor >= 150), + Condition: () => + Object.values(Factions).some( + (f) => f.favor >= Math.floor(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction), + ), }, TRAVEL: { ...achievementData["TRAVEL"], diff --git a/src/Faction/ui/FactionsRoot.tsx b/src/Faction/ui/FactionsRoot.tsx index 181cdb582..8e338a215 100644 --- a/src/Faction/ui/FactionsRoot.tsx +++ b/src/Faction/ui/FactionsRoot.tsx @@ -171,7 +171,7 @@ const FactionElement = (props: IFactionProps): React.ReactElement => { {props.joined && ( - {numeralWrapper.formatFavor(props.faction.favor)} favor + {numeralWrapper.formatFavor(Math.floor(props.faction.favor))} favor {numeralWrapper.formatReputation(props.faction.playerReputation)} rep diff --git a/src/NetscriptFunctions/Singularity.ts b/src/NetscriptFunctions/Singularity.ts index 586df03fd..8f3afd4cf 100644 --- a/src/NetscriptFunctions/Singularity.ts +++ b/src/NetscriptFunctions/Singularity.ts @@ -9,6 +9,7 @@ import { killWorkerScript } from "../Netscript/killWorkerScript"; import { CONSTANTS } from "../Constants"; import { isString } from "../utils/helpers/isString"; import { RunningScript } from "../Script/RunningScript"; +import { calculateAchievements } from "../Achievements/Achievements"; import { AugmentationStats, @@ -1275,12 +1276,11 @@ export function NetscriptSingularity(): InternalAPI { helpers.checkSingularityAccess(ctx); const nextBN = helpers.number(ctx, "nextBN", _nextBN); const callbackScript = helpers.string(ctx, "callbackScript", _callbackScript); - helpers.checkSingularityAccess(ctx); + const wd = GetServer(SpecialServers.WorldDaemon); + if (!(wd instanceof Server)) + throw new Error("WorldDaemon was not a normal server. This is a bug contact dev."); const hackingRequirements = (): boolean => { - const wd = GetServer(SpecialServers.WorldDaemon); - if (!(wd instanceof Server)) - throw new Error("WorldDaemon was not a normal server. This is a bug contact dev."); if (player.skills.hacking < wd.requiredHackingSkill) return false; if (!wd.hasAdminRights) return false; return true; @@ -1296,6 +1296,8 @@ export function NetscriptSingularity(): InternalAPI { return; } + wd.backdoorInstalled = true; + calculateAchievements(); enterBitNode(Router, false, player.bitNodeN, nextBN); if (callbackScript) setTimeout(() => {