Implement three subprojects till completion
This commit is contained in:
parent
b8023c0ef0
commit
677d729584
2 changed files with 8 additions and 13 deletions
|
|
@ -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
|
||||||
) {
|
) {
|
||||||
|
if (!store.getState().finishedSubProjects.includes(store.getState().currentSubproject)) {
|
||||||
store.setState((state) => ({
|
store.setState((state) => ({
|
||||||
finishedSubProjects: [...state.finishedSubProjects, state.currentSubproject],
|
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,
|
||||||
|
|
|
||||||
|
|
@ -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(() => {
|
||||||
|
|
|
||||||
Reference in a new issue