mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
Minor goal acceptor adjustments to help prevent backing up belts to complete (#1236)
* added the new splitter * Update base-en.yaml * added the new splitter Update changelog and update translation regarding 20 upgrade tiers, closes #907 * Update base-en.yaml * minor goal acceptor adjustments to help prevent backing up belts to complete * removed gap between completion and fill as it doesn't look nice * removed api override * fixed mistake with fill percentage * Allowed for copying acceptors to remember the required shape * further adjusted required items, so it looks a bit nicer
This commit is contained in:
parent
285dd3840d
commit
5fb7bb0586
@ -72,7 +72,7 @@ export const globalConfig = {
|
|||||||
|
|
||||||
readerAnalyzeIntervalSeconds: 10,
|
readerAnalyzeIntervalSeconds: 10,
|
||||||
|
|
||||||
goalAcceptorItemsRequired: 10,
|
goalAcceptorItemsRequired: 12,
|
||||||
goalAcceptorsPerProducer: 5,
|
goalAcceptorsPerProducer: 5,
|
||||||
puzzleModeSpeed: 3,
|
puzzleModeSpeed: 3,
|
||||||
puzzleMinBoundsSize: 2,
|
puzzleMinBoundsSize: 2,
|
||||||
|
@ -56,4 +56,12 @@ export class GoalAcceptorComponent extends Component {
|
|||||||
(globalConfig.puzzleModeSpeed * globalConfig.beltSpeedItemsPerSecond)
|
(globalConfig.puzzleModeSpeed * globalConfig.beltSpeedItemsPerSecond)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copy the current state to another component
|
||||||
|
* @param {GoalAcceptorComponent} otherComponent
|
||||||
|
*/
|
||||||
|
copyAdditionalStateTo(otherComponent) {
|
||||||
|
otherComponent.item = this.item;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,8 +67,9 @@ export class GoalAcceptorSystem extends GameSystemWithFilter {
|
|||||||
const staticComp = contents[i].components.StaticMapEntity;
|
const staticComp = contents[i].components.StaticMapEntity;
|
||||||
const item = goalComp.item;
|
const item = goalComp.item;
|
||||||
|
|
||||||
const requiredItemsForSuccess = globalConfig.goalAcceptorItemsRequired;
|
const requiredItems = globalConfig.goalAcceptorItemsRequired;
|
||||||
const percentage = clamp(goalComp.currentDeliveredItems / requiredItemsForSuccess, 0, 1);
|
|
||||||
|
const fillPercentage = clamp(goalComp.currentDeliveredItems / requiredItems, 0, 1);
|
||||||
|
|
||||||
const center = staticComp.getTileSpaceBounds().getCenter().toWorldSpace();
|
const center = staticComp.getTileSpaceBounds().getCenter().toWorldSpace();
|
||||||
if (item) {
|
if (item) {
|
||||||
@ -81,7 +82,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.translate(center.x, center.y);
|
||||||
parameters.context.rotate((staticComp.rotation / 180) * Math.PI);
|
parameters.context.rotate((staticComp.rotation / 180) * Math.PI);
|
||||||
@ -93,7 +94,7 @@ export class GoalAcceptorSystem extends GameSystemWithFilter {
|
|||||||
|
|
||||||
// progress arc
|
// 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 startAngle = Math.PI * 0.595;
|
||||||
const maxAngle = Math.PI * 1.82;
|
const maxAngle = Math.PI * 1.82;
|
||||||
|
Loading…
Reference in New Issue
Block a user