forked from zero-to-mastery/ZTM-Quest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbruno.interaction.js
More file actions
36 lines (35 loc) · 1.21 KB
/
Copy pathbruno.interaction.js
File metadata and controls
36 lines (35 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { interactionHandler } from '../handler.interactions';
import { displayDialogue } from '../../utils';
import { conversationBruno, bruno } from '../../constants';
import {
completeQuestObjective,
completeQuest,
playerHasQuest,
receiveQuest,
} from '../../utils/questHandler';
import { map_start_quests } from '../quests/constants.quests';
export const interactionWithBruno = (player, k, map) => {
interactionHandler(player, bruno.name, k, () => {
displayDialogue({
k,
player,
characterName: bruno.name,
text: conversationBruno,
onDisplayEnd: async () => {
if (!playerHasQuest(player, 'Start Interacting!')) {
await receiveQuest(
player,
map_start_quests['Start Interacting!']
);
}
await completeQuestObjective(
player,
'Start Interacting!',
'hasTalkedToBruno'
);
// Internally checks if all objectives are complete
await completeQuest(player, 'Start Interacting!');
},
});
});
};