mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-05 07:07:50 +02:00
added logic to rewward and invite to infiltrators on infil completion
This commit is contained in:
@@ -75,6 +75,7 @@ export interface IPlayer {
|
||||
terminalCommandHistory: string[];
|
||||
lastUpdate: number;
|
||||
totalPlaytime: number;
|
||||
hasCompletedAnInfiltration: boolean;
|
||||
|
||||
// Stats
|
||||
hacking: number;
|
||||
|
||||
@@ -84,6 +84,7 @@ export class PlayerObject implements IPlayer {
|
||||
lastUpdate: number;
|
||||
lastSave: number;
|
||||
totalPlaytime: number;
|
||||
hasCompletedAnInfiltration: boolean;
|
||||
|
||||
// Stats
|
||||
hacking: number;
|
||||
@@ -466,6 +467,7 @@ export class PlayerObject implements IPlayer {
|
||||
this.lastUpdate = 0;
|
||||
this.lastSave = 0;
|
||||
this.totalPlaytime = 0;
|
||||
this.hasCompletedAnInfiltration = true;
|
||||
|
||||
this.playtimeSinceLastAug = 0;
|
||||
this.playtimeSinceLastBitnode = 0;
|
||||
@@ -483,11 +485,11 @@ export class PlayerObject implements IPlayer {
|
||||
// Let's get a hash of some semi-random stuff so we have something unique.
|
||||
this.identifier = cyrb53(
|
||||
"I-" +
|
||||
new Date().getTime() +
|
||||
navigator.userAgent +
|
||||
window.innerWidth +
|
||||
window.innerHeight +
|
||||
getRandomInt(100, 999),
|
||||
new Date().getTime() +
|
||||
navigator.userAgent +
|
||||
window.innerWidth +
|
||||
window.innerHeight +
|
||||
getRandomInt(100, 999),
|
||||
);
|
||||
|
||||
this.init = generalMethods.init;
|
||||
|
||||
@@ -2086,6 +2086,12 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] {
|
||||
return allCompanies.includes(companyName) && getCompanyRep(companyName) > repNeeded;
|
||||
}
|
||||
|
||||
//Infiltrators
|
||||
const InfiltratorsFac = Factions[FactionNames.Infiltrators];
|
||||
if (this.hasCompletedAnInfiltration && !InfiltratorsFac.isMember && !InfiltratorsFac.alreadyInvited) {
|
||||
invitedFactions.push(InfiltratorsFac);
|
||||
}
|
||||
|
||||
//Illuminati
|
||||
const illuminatiFac = Factions[FactionNames.Illuminati];
|
||||
if (
|
||||
|
||||
@@ -56,7 +56,7 @@ function possibleJobs(player: IPlayer, sleeve: Sleeve): string[] {
|
||||
|
||||
function possibleFactions(player: IPlayer, sleeve: Sleeve): string[] {
|
||||
// Array of all factions that other sleeves are working for
|
||||
const forbiddenFactions = [FactionNames.Bladeburners as string];
|
||||
const forbiddenFactions = [FactionNames.Bladeburners as string, FactionNames.Infiltrators as string];
|
||||
if (player.gang) {
|
||||
forbiddenFactions.push(player.gang.facName);
|
||||
}
|
||||
@@ -76,9 +76,9 @@ function possibleFactions(player: IPlayer, sleeve: Sleeve): string[] {
|
||||
}
|
||||
}
|
||||
|
||||
return factions.filter(faction => {
|
||||
return factions.filter((faction) => {
|
||||
const facInfo = Factions[faction].getInfo();
|
||||
return facInfo.offerHackingWork || facInfo.offerFieldWork || facInfo.offerSecurityWork
|
||||
return facInfo.offerHackingWork || facInfo.offerFieldWork || facInfo.offerSecurityWork;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ export function TaskSelector(props: IProps): React.ReactElement {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Select onChange={onS0Change} value={s0} sx={{ width: '100%' }}>
|
||||
<Select onChange={onS0Change} value={s0} sx={{ width: "100%" }}>
|
||||
{validActions.map((task) => (
|
||||
<MenuItem key={task} value={task}>
|
||||
{task}
|
||||
@@ -288,7 +288,7 @@ export function TaskSelector(props: IProps): React.ReactElement {
|
||||
</Select>
|
||||
{!(details.first.length === 1 && details.first[0] === "------") && (
|
||||
<>
|
||||
<Select onChange={onS1Change} value={s1} sx={{ width: '100%' }}>
|
||||
<Select onChange={onS1Change} value={s1} sx={{ width: "100%" }}>
|
||||
{details.first.map((detail) => (
|
||||
<MenuItem key={detail} value={detail}>
|
||||
{detail}
|
||||
@@ -299,7 +299,7 @@ export function TaskSelector(props: IProps): React.ReactElement {
|
||||
)}
|
||||
{!(details2.length === 1 && details2[0] === "------") && (
|
||||
<>
|
||||
<Select onChange={onS2Change} value={s2} sx={{ width: '100%' }}>
|
||||
<Select onChange={onS2Change} value={s2} sx={{ width: "100%" }}>
|
||||
{details2.map((detail) => (
|
||||
<MenuItem key={detail} value={detail}>
|
||||
{detail}
|
||||
|
||||
Reference in New Issue
Block a user