Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLADE: Adjust IV action to current-city affect rather than global #1586

Draft
wants to merge 9 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions src/Bladeburner/Bladeburner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,8 @@ export class Bladeburner {
}
} else if (chance <= 0.7) {
// Synthoid Riots (+chaos), 20%
sourceCity.chaos += 1;
sourceCity.chaos *= 1 + getRandomIntInclusive(5, 20) / 100;
sourceCity.changeChaosByCount(1);
sourceCity.changeChaosByPercentage(getRandomIntInclusive(5, 20));
if (this.logging.events) {
this.log("Tensions between Synthoids and humans lead to riots in " + sourceCityName + "! Chaos increased");
}
Expand Down Expand Up @@ -1201,11 +1201,9 @@ export class Bladeburner {
if (this.logging.general) {
this.log(`${person.whoAmI()}: Incited violence in the synthoid communities.`);
}
for (const cityName of Object.values(CityName)) {
const city = this.cities[cityName];
city.chaos += 10;
city.chaos += city.chaos / (Math.log(city.chaos) / Math.log(10));
}
const city = this.getCurrentCity();
city.changeChaosByCount(10);
city.changeChaosByCount(city.chaos / Math.log(city.chaos) / Math.log(10));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part is the logical change. The scaling stays the same in this PR, but the penalty now only affects the player's current city.

Also, the change to changeChaosByCount handles integer safety with a clamp that defaults to Number.MAX_VALUE.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To continue on the discord discussion: I vote for combining the two logics. This is not a perfect, final solution, but merely something that I'm confident will move this PR forward and allow us to make adjustments that have a positive effect on playability.

  • give the old, heavy penalty to the current city, but not others
  • apply the flat penalty to all cities

This way the cost of generating contracts remains global, but the escalating effect only stays on the one you are currently looking at (ie. you won't accidentally end up with your non-current city having 1e50 chaos in two days).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I request separating this commit out to a new PR and reverting it in this one so we can merge the surrounding refactors.

Faenre marked this conversation as resolved.
Show resolved Hide resolved
break;
}
default: {
Expand Down
2 changes: 1 addition & 1 deletion src/Bladeburner/data/GeneralActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ export const GeneralActions: Record<BladeGeneralActionName, GeneralAction> = {
getActionTime: () => 60,
desc:
"Purposefully stir trouble in the synthoid community in order to gain a political edge. This will generate " +
"additional contracts and operations, at the cost of increased Chaos.",
"additional contracts and operations. Completing this action will increase the Chaos level in your current city.",
}),
};
4 changes: 2 additions & 2 deletions src/DevMenu/ui/BladeburnerDev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ export function BladeburnerDev({ bladeburner }: { bladeburner: Bladeburner }): R
const wipeAllChaos = () => Object.values(CityName).forEach((city) => (bladeburner.cities[city].chaos = 0));
const wipeActiveCityChaos = () => (bladeburner.cities[bladeburner.city].chaos = 0);
const addAllChaos = (modify: number) => (chaos: number) => {
Object.values(CityName).forEach((city) => (bladeburner.cities[city].chaos += chaos * modify));
Object.values(CityName).forEach((city) => bladeburner.cities[city].changeChaosByCount(chaos * modify));
};
const addTonsAllChaos = () => {
Object.values(CityName).forEach((city) => (bladeburner.cities[city].chaos += bigNumber));
Object.values(CityName).forEach((city) => bladeburner.cities[city].changeChaosByCount(bigNumber));
};

// Skill functions
Expand Down
Loading