mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-03-02 03:39:21 +00:00
Make belts balanced
This commit is contained in:
@@ -38,7 +38,7 @@ export const globalConfig = {
|
||||
|
||||
// Belt speeds
|
||||
// NOTICE: Update webpack.production.config too!
|
||||
beltSpeedItemsPerSecond: 1,
|
||||
beltSpeedItemsPerSecond: 5,
|
||||
itemSpacingOnBelts: 0.63,
|
||||
minerSpeedItemsPerSecond: 0, // COMPUTED
|
||||
|
||||
|
||||
@@ -118,11 +118,6 @@ export class ItemProcessorComponent extends Component {
|
||||
* @param {BaseItem} item
|
||||
*/
|
||||
tryTakeItem(item, sourceSlot, sourceDirection) {
|
||||
if (this.inputSlots.length >= this.inputsPerCharge) {
|
||||
// Already full
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check that we only take one item per slot
|
||||
for (let i = 0; i < this.inputSlots.length; ++i) {
|
||||
const slot = this.inputSlots[i];
|
||||
|
||||
@@ -98,7 +98,7 @@ export class ItemProcessorSystem extends GameSystemWithFilter {
|
||||
|
||||
// Check if we have an empty queue and can start a new charge
|
||||
if (processorComp.itemsToEject.length === 0) {
|
||||
if (processorComp.inputSlots.length === processorComp.inputsPerCharge) {
|
||||
if (processorComp.inputSlots.length >= processorComp.inputsPerCharge) {
|
||||
this.startNewCharge(entity);
|
||||
}
|
||||
}
|
||||
@@ -133,11 +133,13 @@ export class ItemProcessorSystem extends GameSystemWithFilter {
|
||||
switch (processorComp.type) {
|
||||
// SPLITTER
|
||||
case enumItemProcessorTypes.splitter: {
|
||||
let nextSlot = processorComp.nextOutputSlot++ % 2;
|
||||
const availableSlots = entity.components.ItemEjector.slots.length;
|
||||
|
||||
let nextSlot = processorComp.nextOutputSlot++ % availableSlots;
|
||||
for (let i = 0; i < items.length; ++i) {
|
||||
outItems.push({
|
||||
item: items[i].item,
|
||||
preferredSlot: (nextSlot + i) % 2,
|
||||
preferredSlot: (nextSlot + i) % availableSlots,
|
||||
});
|
||||
}
|
||||
break;
|
||||
@@ -255,7 +257,6 @@ export class ItemProcessorSystem extends GameSystemWithFilter {
|
||||
// PAINTER (DOUBLE)
|
||||
|
||||
case enumItemProcessorTypes.painterDouble: {
|
||||
console.log("YUP");
|
||||
const shapeItem1 = /** @type {ShapeItem} */ (itemsBySlot[0].item);
|
||||
const shapeItem2 = /** @type {ShapeItem} */ (itemsBySlot[1].item);
|
||||
const colorItem = /** @type {ColorItem} */ (itemsBySlot[2].item);
|
||||
|
||||
Reference in New Issue
Block a user