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,
int: unweightedIntGain * action.weights.int * skillMult,
money: 0,
}
};
}
getDiplomacyEffectiveness(person: IPerson): number {
@ -1134,8 +1134,8 @@ export class Bladeburner implements IBladeburner {
const losses = getRandomInt(0, max);
this.teamSize -= losses;
if (this.teamSize < this.sleeveSize) {
const sup = player.sleeves.filter(x => x.bbAction == 'Support main sleeve');
for(let i = 0; i > (this.teamSize-this.sleeveSize); i--){
const sup = player.sleeves.filter((x) => x.bbAction == "Support main sleeve");
for (let i = 0; i > this.teamSize - this.sleeveSize; i--) {
const r = Math.floor(Math.random() * sup.length);
sup[r].takeDamage(sup[r].max_hp);
sup.splice(r, 1);
@ -1309,7 +1309,13 @@ export class Bladeburner implements IBladeburner {
const gain = addOffset(action.rankGain * rewardMultiplier * BitNodeMultipliers.BladeburnerRank, 10);
this.changeRank(person, gain);
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) {
this.log(
`${person.whoAmI()}: ` +
@ -1397,7 +1403,9 @@ export class Bladeburner implements IBladeburner {
teamLossMax = Math.ceil(teamCount / 2);
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 {
retValue = this.getActionStats(action, false);
@ -1438,8 +1446,8 @@ export class Bladeburner implements IBladeburner {
const losses = getRandomInt(1, teamLossMax);
this.teamSize -= losses;
if (this.teamSize < this.sleeveSize) {
const sup = player.sleeves.filter(x => x.bbAction == 'Support main sleeve');
for(let i = 0; i > (this.teamSize-this.sleeveSize); i--){
const sup = player.sleeves.filter((x) => x.bbAction == "Support main sleeve");
for (let i = 0; i > this.teamSize - this.sleeveSize; i--) {
const r = Math.floor(Math.random() * sup.length);
sup[r].takeDamage(sup[r].max_hp);
sup.splice(r, 1);
@ -1448,7 +1456,9 @@ export class Bladeburner implements IBladeburner {
}
this.teamLost += losses;
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) {
@ -1523,13 +1533,23 @@ export class Bladeburner implements IBladeburner {
retValue.cha = expGain;
++this.teamSize;
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 {
const expGain = BladeburnerConstants.BaseStatGain * recruitTime;
retValue.cha = expGain;
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;
@ -1542,7 +1562,9 @@ export class Bladeburner implements IBladeburner {
}
if (this.logging.general) {
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;
@ -2175,11 +2197,7 @@ export class Bladeburner implements IBladeburner {
}
}
getActionEstimatedSuccessChanceNetscriptFn(
person: IPerson,
type: string,
name: string,
): [number, number]|string {
getActionEstimatedSuccessChanceNetscriptFn(person: IPerson, type: string, name: string): [number, number] | string {
const actionId = this.getActionIdFromTypeAndName(type, name);
if (actionId == null) {
return "bladeburner.getActionEstimatedSuccessChance";

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