This commit is contained in:
rderfler 2022-04-14 11:59:49 -04:00
parent 1239c7ad7f
commit 3886e31a45
2 changed files with 57 additions and 43 deletions

@ -1030,7 +1030,7 @@ export class Bladeburner implements IBladeburner {
cha: unweightedGain * action.weights.cha * skillMult, cha: unweightedGain * action.weights.cha * skillMult,
int: unweightedIntGain * action.weights.int * skillMult, int: unweightedIntGain * action.weights.int * skillMult,
money: 0, money: 0,
} };
} }
getDiplomacyEffectiveness(person: IPerson): number { getDiplomacyEffectiveness(person: IPerson): number {
@ -1053,7 +1053,7 @@ export class Bladeburner implements IBladeburner {
} }
sleeveSupport(joining: boolean): void { sleeveSupport(joining: boolean): void {
if(joining){ if (joining) {
this.sleeveSize += 1; this.sleeveSize += 1;
this.teamSize += 1; this.teamSize += 1;
} else { } else {
@ -1133,9 +1133,9 @@ export class Bladeburner implements IBladeburner {
} }
const losses = getRandomInt(0, max); const losses = getRandomInt(0, max);
this.teamSize -= losses; this.teamSize -= losses;
if(this.teamSize < this.sleeveSize) { if (this.teamSize < this.sleeveSize) {
const sup = player.sleeves.filter(x => x.bbAction == 'Support main sleeve'); const sup = player.sleeves.filter((x) => x.bbAction == "Support main sleeve");
for(let i = 0; i > (this.teamSize-this.sleeveSize); i--){ for (let i = 0; i > this.teamSize - this.sleeveSize; i--) {
const r = Math.floor(Math.random() * sup.length); const r = Math.floor(Math.random() * sup.length);
sup[r].takeDamage(sup[r].max_hp); sup[r].takeDamage(sup[r].max_hp);
sup.splice(r, 1); sup.splice(r, 1);
@ -1309,7 +1309,13 @@ export class Bladeburner implements IBladeburner {
const gain = addOffset(action.rankGain * rewardMultiplier * BitNodeMultipliers.BladeburnerRank, 10); const gain = addOffset(action.rankGain * rewardMultiplier * BitNodeMultipliers.BladeburnerRank, 10);
this.changeRank(person, gain); this.changeRank(person, gain);
if (isOperation && this.logging.ops) { if (isOperation && this.logging.ops) {
this.log(`${person.whoAmI()}: ` + action.name + " successfully completed! Gained " + formatNumber(gain, 3) + " rank"); this.log(
`${person.whoAmI()}: ` +
action.name +
" successfully completed! Gained " +
formatNumber(gain, 3) +
" rank",
);
} else if (!isOperation && this.logging.contracts) { } else if (!isOperation && this.logging.contracts) {
this.log( this.log(
`${person.whoAmI()}: ` + `${person.whoAmI()}: ` +
@ -1397,7 +1403,9 @@ export class Bladeburner implements IBladeburner {
teamLossMax = Math.ceil(teamCount / 2); teamLossMax = Math.ceil(teamCount / 2);
if (this.logging.blackops) { if (this.logging.blackops) {
this.log(`${person.whoAmI()}: ` + action.name + " successful! Gained " + formatNumber(rankGain, 1) + " rank"); this.log(
`${person.whoAmI()}: ` + action.name + " successful! Gained " + formatNumber(rankGain, 1) + " rank",
);
} }
} else { } else {
retValue = this.getActionStats(action, false); retValue = this.getActionStats(action, false);
@ -1437,9 +1445,9 @@ export class Bladeburner implements IBladeburner {
if (teamCount >= 1) { if (teamCount >= 1) {
const losses = getRandomInt(1, teamLossMax); const losses = getRandomInt(1, teamLossMax);
this.teamSize -= losses; this.teamSize -= losses;
if(this.teamSize < this.sleeveSize) { if (this.teamSize < this.sleeveSize) {
const sup = player.sleeves.filter(x => x.bbAction == 'Support main sleeve'); const sup = player.sleeves.filter((x) => x.bbAction == "Support main sleeve");
for(let i = 0; i > (this.teamSize-this.sleeveSize); i--){ for (let i = 0; i > this.teamSize - this.sleeveSize; i--) {
const r = Math.floor(Math.random() * sup.length); const r = Math.floor(Math.random() * sup.length);
sup[r].takeDamage(sup[r].max_hp); sup[r].takeDamage(sup[r].max_hp);
sup.splice(r, 1); sup.splice(r, 1);
@ -1448,7 +1456,9 @@ export class Bladeburner implements IBladeburner {
} }
this.teamLost += losses; this.teamLost += losses;
if (this.logging.blackops) { if (this.logging.blackops) {
this.log(`${person.whoAmI()}: ` + "You lost " + formatNumber(losses, 0) + " team members during " + action.name); this.log(
`${person.whoAmI()}: ` + "You lost " + formatNumber(losses, 0) + " team members during " + action.name,
);
} }
} }
} catch (e: any) { } catch (e: any) {
@ -1523,13 +1533,23 @@ export class Bladeburner implements IBladeburner {
retValue.cha = expGain; retValue.cha = expGain;
++this.teamSize; ++this.teamSize;
if (this.logging.general) { if (this.logging.general) {
this.log(`${person.whoAmI()}: ` + "Successfully recruited a team member! Gained " + formatNumber(expGain, 1) + " charisma exp"); this.log(
`${person.whoAmI()}: ` +
"Successfully recruited a team member! Gained " +
formatNumber(expGain, 1) +
" charisma exp",
);
} }
} else { } else {
const expGain = BladeburnerConstants.BaseStatGain * recruitTime; const expGain = BladeburnerConstants.BaseStatGain * recruitTime;
retValue.cha = expGain; retValue.cha = expGain;
if (this.logging.general) { if (this.logging.general) {
this.log(`${person.whoAmI()}: ` + "Failed to recruit a team member. Gained " + formatNumber(expGain, 1) + " charisma exp"); this.log(
`${person.whoAmI()}: ` +
"Failed to recruit a team member. Gained " +
formatNumber(expGain, 1) +
" charisma exp",
);
} }
} }
break; break;
@ -1542,7 +1562,9 @@ export class Bladeburner implements IBladeburner {
} }
if (this.logging.general) { if (this.logging.general) {
this.log( this.log(
`${person.whoAmI()}: Diplomacy completed. Chaos levels in the current city fell by ${numeralWrapper.formatPercentage(1 - eff)}`, `${person.whoAmI()}: Diplomacy completed. Chaos levels in the current city fell by ${numeralWrapper.formatPercentage(
1 - eff,
)}`,
); );
} }
break; break;
@ -1663,7 +1685,7 @@ export class Bladeburner implements IBladeburner {
} else if (action.name === BlackOperationNames.OperationDaedalus && this.blackops[action.name]) { } else if (action.name === BlackOperationNames.OperationDaedalus && this.blackops[action.name]) {
this.resetAction(); this.resetAction();
router.toBitVerse(false, false); router.toBitVerse(false, false);
} else if(this.action.type != ActionTypes["BlackOperation"] && this.action.type != ActionTypes["BlackOp"]) { } else if (this.action.type != ActionTypes["BlackOperation"] && this.action.type != ActionTypes["BlackOp"]) {
this.startAction(player, this.action); // Repeat action this.startAction(player, this.action); // Repeat action
} }
} }
@ -2144,7 +2166,7 @@ export class Bladeburner implements IBladeburner {
} }
} }
getActionTimeNetscriptFn(person: IPerson, type: string, name: string): number|string { getActionTimeNetscriptFn(person: IPerson, type: string, name: string): number | string {
const actionId = this.getActionIdFromTypeAndName(type, name); const actionId = this.getActionIdFromTypeAndName(type, name);
if (actionId == null) { if (actionId == null) {
return "bladeburner.getActionTime"; return "bladeburner.getActionTime";
@ -2175,11 +2197,7 @@ export class Bladeburner implements IBladeburner {
} }
} }
getActionEstimatedSuccessChanceNetscriptFn( getActionEstimatedSuccessChanceNetscriptFn(person: IPerson, type: string, name: string): [number, number] | string {
person: IPerson,
type: string,
name: string,
): [number, number]|string {
const actionId = this.getActionIdFromTypeAndName(type, name); const actionId = this.getActionIdFromTypeAndName(type, name);
if (actionId == null) { if (actionId == null) {
return "bladeburner.getActionEstimatedSuccessChance"; return "bladeburner.getActionEstimatedSuccessChance";

@ -72,12 +72,8 @@ export interface IBladeburner {
getGeneralActionNamesNetscriptFn(): string[]; getGeneralActionNamesNetscriptFn(): string[];
getSkillNamesNetscriptFn(): string[]; getSkillNamesNetscriptFn(): string[];
startActionNetscriptFn(player: IPlayer, type: string, name: string, workerScript: WorkerScript): boolean; startActionNetscriptFn(player: IPlayer, type: string, name: string, workerScript: WorkerScript): boolean;
getActionTimeNetscriptFn(person: IPerson, type: string, name: string): number|string; getActionTimeNetscriptFn(person: IPerson, type: string, name: string): number | string;
getActionEstimatedSuccessChanceNetscriptFn( getActionEstimatedSuccessChanceNetscriptFn(person: IPerson, type: string, name: string): [number, number] | string;
person: IPerson,
type: string,
name: string,
): [number, number]|string;
getActionCountRemainingNetscriptFn(type: string, name: string, workerScript: WorkerScript): number; getActionCountRemainingNetscriptFn(type: string, name: string, workerScript: WorkerScript): number;
getSkillLevelNetscriptFn(skillName: string, workerScript: WorkerScript): number; getSkillLevelNetscriptFn(skillName: string, workerScript: WorkerScript): number;
getSkillUpgradeCostNetscriptFn(skillName: string, workerScript: WorkerScript): number; getSkillUpgradeCostNetscriptFn(skillName: string, workerScript: WorkerScript): number;