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

minor goal acceptor adjustments to help prevent backing up belts to complete

This commit is contained in:
Sense101 2021-06-24 21:48:31 +01:00
parent 2e4bbdac58
commit 1abf4ebd56
3 changed files with 17 additions and 11 deletions

View File

@ -72,7 +72,8 @@ export const globalConfig = {
readerAnalyzeIntervalSeconds: 10,
goalAcceptorItemsRequired: 10,
goalAcceptorItemsToFill: 10,
goalAcceptorItemsRequired: 13,
goalAcceptorsPerProducer: 5,
puzzleModeSpeed: 3,
puzzleMinBoundsSize: 2,

View File

@ -67,8 +67,13 @@ export class GoalAcceptorSystem extends GameSystemWithFilter {
const staticComp = contents[i].components.StaticMapEntity;
const item = goalComp.item;
const requiredItemsForSuccess = globalConfig.goalAcceptorItemsRequired;
const percentage = clamp(goalComp.currentDeliveredItems / requiredItemsForSuccess, 0, 1);
const requiredItems = globalConfig.goalAcceptorItemsRequired;
const fillPercentage = clamp(
goalComp.currentDeliveredItems / globalConfig.goalAcceptorItemsToFill,
0,
1
);
const center = staticComp.getTileSpaceBounds().getCenter().toWorldSpace();
if (item) {
@ -81,7 +86,7 @@ export class GoalAcceptorSystem extends GameSystemWithFilter {
);
}
const isValid = item && goalComp.currentDeliveredItems >= requiredItemsForSuccess;
const isValid = item && goalComp.currentDeliveredItems >= requiredItems;
parameters.context.translate(center.x, center.y);
parameters.context.rotate((staticComp.rotation / 180) * Math.PI);
@ -93,7 +98,7 @@ export class GoalAcceptorSystem extends GameSystemWithFilter {
// progress arc
goalComp.displayPercentage = lerp(goalComp.displayPercentage, percentage, 0.2);
goalComp.displayPercentage = lerp(goalComp.displayPercentage, fillPercentage, 0.2);
const startAngle = Math.PI * 0.595;
const maxAngle = Math.PI * 1.82;

View File

@ -24,12 +24,12 @@ export class ClientAPI {
}
getEndpoint() {
if (G_IS_DEV) {
return "http://localhost:15001";
}
if (window.location.host === "beta.shapez.io") {
return "https://api-staging.shapez.io";
}
//if (G_IS_DEV) {
// return "http://localhost:15001";
//}
//if (window.location.host === "beta.shapez.io") {
// return "https://api-staging.shapez.io";
//}
return "https://api.shapez.io";
}