1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Add underground belt tier 2

This commit is contained in:
tobspr
2020-05-16 23:48:56 +02:00
parent 5179488373
commit bce44188c8
27 changed files with 542 additions and 341 deletions

View File

@@ -10,6 +10,7 @@ import { enumDirection, enumDirectionToVector, Vector } from "../../core/vector"
import { MapChunkView } from "../map_chunk_view";
import { gMetaBuildingRegistry } from "../../core/global_registries";
import { MetaBeltBaseBuilding } from "../buildings/belt_base";
import { defaultBuildingVariant } from "../meta_building";
const BELT_ANIM_COUNT = 6;
@@ -91,10 +92,11 @@ export class BeltSystem extends GameSystemWithFilter {
} = metaBelt.computeOptimalDirectionAndRotationVariantAtTile(
this.root,
new Vector(x, y),
targetStaticComp.originalRotation
targetStaticComp.originalRotation,
defaultBuildingVariant
);
targetStaticComp.rotation = rotation;
metaBelt.updateRotationVariant(targetEntity, rotationVariant);
metaBelt.updateVariants(targetEntity, rotationVariant, defaultBuildingVariant);
}
}
}

View File

@@ -67,7 +67,7 @@ export class UndergroundBeltSystem extends GameSystemWithFilter {
for (
let searchOffset = 0;
searchOffset < globalConfig.undergroundBeltMaxTiles;
searchOffset < globalConfig.undergroundBeltMaxTilesByTier[undergroundComp.tier];
++searchOffset
) {
currentTile = currentTile.add(searchVector);
@@ -75,7 +75,10 @@ export class UndergroundBeltSystem extends GameSystemWithFilter {
const contents = this.root.map.getTileContent(currentTile);
if (contents) {
const receiverUndergroundComp = contents.components.UndergroundBelt;
if (receiverUndergroundComp) {
if (
receiverUndergroundComp &&
receiverUndergroundComp.tier === undergroundComp.tier
) {
const receiverStaticComp = contents.components.StaticMapEntity;
if (receiverStaticComp.rotation === targetRotation) {
if (receiverUndergroundComp.mode === enumUndergroundBeltMode.receiver) {