Skip to content

Commit

Permalink
funnel debug flag
Browse files Browse the repository at this point in the history
  • Loading branch information
CarsonBurke committed Feb 13, 2024
1 parent f65301f commit dab8e17
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/constants/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1437,6 +1437,7 @@ export enum FlagNames {
mapVisuals = 'mapVisuals',
roomVisuals = 'roomVisuals',
deactivate = 'deactiveate',
debugFunneling = 'debugFunneling',
}

export const IDUpdateInterval = randomIntRange(50, 100)
Expand Down
12 changes: 11 additions & 1 deletion src/international/collective.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import {
RoomMemoryKeys,
minerals,
haulerUpdateDefault,
FlagNames,
} from '../constants/general'
import { CommuneUtils } from 'room/commune/communeUtils'
import { LogOps, LogTypes } from 'utils/logOps'

const periodicUpdateInterval = randomIntRange(100, 200)

Expand Down Expand Up @@ -342,7 +344,7 @@ export class CollectiveManager {
// How much energy we are allowed to distribute each tick of funneling
let funnelDistribution = 0
const funnelTargetQuotas: {[roomName: string]: number} = {}

const funnelOrder = this.getFunnelOrder()
funnelTargets.add(funnelOrder[0])

Expand All @@ -361,6 +363,10 @@ export class CollectiveManager {
funnelTargetQuotas[roomName] = maxUpgradeStrength
}

if (Game.flags[FlagNames.debugFunneling]) {
LogOps.log('Funnel quotas', `distribution: ${funnelDistribution}, quotas: ${JSON.stringify(funnelTargetQuotas)}`, { type: LogTypes.debug })
}

if (funnelDistribution === 0) return funnelTargets

for (const roomName in funnelTargetQuotas) {
Expand All @@ -372,6 +378,10 @@ export class CollectiveManager {
if (funnelDistribution <= 0) break
}

if (Game.flags[FlagNames.debugFunneling]) {
LogOps.log('Funnel Targets', `${JSON.stringify(funnelTargets)}`, { type: LogTypes.debug })
}

return funnelTargets
}

Expand Down

0 comments on commit dab8e17

Please sign in to comment.