FIX: #896 - Establish a base growth in Bladeburner (#899)

This commit is contained in:
Sphyxis 2023-11-05 02:43:33 -07:00 committed by GitHub
parent 99afd2ff2a
commit 0c4cf81f66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 1 deletions

@ -894,6 +894,9 @@ export class Bladeburner {
const count = Math.round(sourceCity.pop * percentage); const count = Math.round(sourceCity.pop * percentage);
sourceCity.pop -= count; sourceCity.pop -= count;
destCity.pop += count; destCity.pop += count;
if (destCity.pop < BladeburnerConstants.PopGrowthCeiling) {
destCity.pop += BladeburnerConstants.BasePopGrowth;
}
} }
triggerPotentialMigration(sourceCityName: CityName, chance: number): void { triggerPotentialMigration(sourceCityName: CityName, chance: number): void {
@ -926,6 +929,9 @@ export class Bladeburner {
const percentage = getRandomInt(10, 20) / 100; const percentage = getRandomInt(10, 20) / 100;
const count = Math.round(sourceCity.pop * percentage); const count = Math.round(sourceCity.pop * percentage);
sourceCity.pop += count; sourceCity.pop += count;
if (sourceCity.pop < BladeburnerConstants.PopGrowthCeiling) {
sourceCity.pop += BladeburnerConstants.BasePopGrowth;
}
if (this.logging.events) { if (this.logging.events) {
this.log("Intelligence indicates that a new Synthoid community was formed in a city"); this.log("Intelligence indicates that a new Synthoid community was formed in a city");
} }
@ -937,6 +943,9 @@ export class Bladeburner {
const percentage = getRandomInt(10, 20) / 100; const percentage = getRandomInt(10, 20) / 100;
const count = Math.round(sourceCity.pop * percentage); const count = Math.round(sourceCity.pop * percentage);
sourceCity.pop += count; sourceCity.pop += count;
if (sourceCity.pop < BladeburnerConstants.PopGrowthCeiling) {
sourceCity.pop += BladeburnerConstants.BasePopGrowth;
}
if (this.logging.events) { if (this.logging.events) {
this.log("Intelligence indicates that a new Synthoid community was formed in a city"); this.log("Intelligence indicates that a new Synthoid community was formed in a city");
} }
@ -949,7 +958,9 @@ export class Bladeburner {
const count = Math.round(sourceCity.pop * percentage); const count = Math.round(sourceCity.pop * percentage);
sourceCity.pop -= count; sourceCity.pop -= count;
destCity.pop += count; destCity.pop += count;
if (destCity.pop < BladeburnerConstants.PopGrowthCeiling) {
destCity.pop += BladeburnerConstants.BasePopGrowth;
}
if (this.logging.events) { if (this.logging.events) {
this.log( this.log(
"Intelligence indicates that a Synthoid community migrated from " + sourceCityName + " to some other city", "Intelligence indicates that a Synthoid community migrated from " + sourceCityName + " to some other city",
@ -961,6 +972,9 @@ export class Bladeburner {
const percentage = getRandomInt(8, 24) / 100; const percentage = getRandomInt(8, 24) / 100;
const count = Math.round(sourceCity.pop * percentage); const count = Math.round(sourceCity.pop * percentage);
sourceCity.pop += count; sourceCity.pop += count;
if (sourceCity.pop < BladeburnerConstants.PopGrowthCeiling) {
sourceCity.pop += BladeburnerConstants.BasePopGrowth;
}
if (this.logging.events) { if (this.logging.events) {
this.log( this.log(
"Intelligence indicates that the Synthoid population of " + sourceCityName + " just changed significantly", "Intelligence indicates that the Synthoid population of " + sourceCityName + " just changed significantly",

@ -33,6 +33,9 @@ export const BladeburnerConstants = {
BaseStatGain: 1, // Base stat gain per second BaseStatGain: 1, // Base stat gain per second
BaseIntGain: 0.003, // Base intelligence stat gain BaseIntGain: 0.003, // Base intelligence stat gain
BasePopGrowth: 100, // Base amount a population will grow by
PopGrowthCeiling: 1.5e9, // Amount of population a city can have before BasePopGrowth does not apply
ActionCountGrowthPeriod: 480, // Time (s) it takes for action count to grow by its specified value ActionCountGrowthPeriod: 480, // Time (s) it takes for action count to grow by its specified value
RankToFactionRepFactor: 2, // Delta Faction Rep = this * Delta Rank RankToFactionRepFactor: 2, // Delta Faction Rep = this * Delta Rank