Implement three subprojects till completion

This commit is contained in:
Dennis Schoepf 2021-08-06 17:52:33 +02:00
parent b8023c0ef0
commit 677d729584
2 changed files with 8 additions and 13 deletions

View file

@ -72,12 +72,14 @@ export class DetailScene {
if ( if (
this.revealableObjects.every((revObj) => revObj.wasInteractedWith) && this.revealableObjects.every((revObj) => revObj.wasInteractedWith) &&
!(store.getState().companionState === CompanionState.ACTIVE) !(store.getState().companionState === CompanionState.ACTIVE) &&
!store.getState().infoMessageShown
) { ) {
store.setState((state) => ({ if (!store.getState().finishedSubProjects.includes(store.getState().currentSubproject)) {
finishedSubProjects: [...state.finishedSubProjects, state.currentSubproject], store.setState((state) => ({
})); finishedSubProjects: [...state.finishedSubProjects, state.currentSubproject],
}));
}
store.getState().addUserMessage({ store.getState().addUserMessage({
text: "Yaay! You've found all of the important parts of this part of the repository. You will be returned to the subproject overview now. Pick the next subproject you want to take a look at there.", text: "Yaay! You've found all of the important parts of this part of the repository. You will be returned to the subproject overview now. Pick the next subproject you want to take a look at there.",
inputWanted: false, inputWanted: false,

View file

@ -55,14 +55,7 @@ export class OverviewScene {
} }
private drawLocations() { private drawLocations() {
if ( if (store.getState().finishedSubProjects.length === 3 && !store.getState().finishedGame) {
store.getState().finishedSubProjects.every((fsp) => {
const edge = this.edges.filter((edge) => edge.name === fsp)[0];
return edge.finished;
}) &&
!store.getState().finishedGame &&
store.getState().finishedSubProjects.length > 0
) {
store.setState({ finishedGame: true }); store.setState({ finishedGame: true });
setTimeout(() => { setTimeout(() => {