1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-13 13:04:03 +00:00

Processors speed upgrades

This commit is contained in:
Exund 2020-09-10 00:05:08 +02:00
parent 6612a58ff5
commit 4899651ebd
2 changed files with 17 additions and 5 deletions

View File

@ -192,7 +192,9 @@ export async function initMods() {
if (mod.processors) {
mod_infos += `${mod.processors.length} processors, `;
for (const processor of mod.processors) {
ModProcessors[processor.getType()] = processor;
const type = processor.getType();
ModProcessors[type] = processor;
globalConfig.buildingSpeeds[type] = processor.getBaseSpeed();
}
}
@ -240,9 +242,9 @@ export async function initMods() {
}
logger.log(mod_infos);
}
}
initShapes();
logger.log(`${Mods.length} mods loaded`);
}

View File

@ -8,6 +8,7 @@ import { GameRoot } from "./root";
import { ShapeDefinition, ShapeLayer } from "./shape_definition";
import { enumHubGoalRewards, tutorialGoals } from "./tutorial_goals";
import { UPGRADES } from "./upgrades";
import { ModProcessors } from "../GeoZ/main";
export class HubGoals extends BasicSerializableObject {
static getId() {
@ -440,8 +441,17 @@ export class HubGoals extends BasicSerializableObject {
globalConfig.buildingSpeeds[processorType]
);
}
default:
default: {
if (ModProcessors[processorType]) {
return (
globalConfig.beltSpeedItemsPerSecond *
this.upgradeImprovements.processors *
globalConfig.buildingSpeeds[processorType]
);
}
assertAlways(false, "invalid processor type: " + processorType);
}
}
return 1 / globalConfig.beltSpeedItemsPerSecond;