From c8839eda6882c2680fd415397f3fa245711aa7ed Mon Sep 17 00:00:00 2001 From: pleomorph Date: Thu, 10 Oct 2024 22:59:59 +0000 Subject: [PATCH] Add interaction for bedroom_vanity in map_campus_house_1 --- .../bedroomVanity.interaction.js | 31 +++++++++++++++++++ src/interactions/map_campus_house_1/index.js | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 src/interactions/map_campus_house_1/bedroomVanity.interaction.js diff --git a/src/interactions/map_campus_house_1/bedroomVanity.interaction.js b/src/interactions/map_campus_house_1/bedroomVanity.interaction.js new file mode 100644 index 0000000..876b6d4 --- /dev/null +++ b/src/interactions/map_campus_house_1/bedroomVanity.interaction.js @@ -0,0 +1,31 @@ +import { displayDialogue } from '../../utils'; +import { updateEnergyState } from '../../utils/energyUpdate'; + +const bedroomVanityDialog = [ + ` +
+

Mirror, mirror, on the wall...

+

+ Who's the best developer of them all? +

+

+ It's you! +

+
+`, +]; + +export const bedroomVanityInteractions = (player, k, map) => { + player.onCollide('bedroom_vanity', () => { + player.isInDialog = true; + displayDialogue({ + k, + player, + text: bedroomVanityDialog, + onDisplayEnd: () => { + player.isInDialog = false; + }, + }); + updateEnergyState(player.state, (player.state.energy + 10)); + }) +} \ No newline at end of file diff --git a/src/interactions/map_campus_house_1/index.js b/src/interactions/map_campus_house_1/index.js index a6811be..3fb0400 100644 --- a/src/interactions/map_campus_house_1/index.js +++ b/src/interactions/map_campus_house_1/index.js @@ -1,12 +1,14 @@ import { enterMapCityInteraction } from './enterMapCity.interactions'; import { bedInteractions } from './bed.interaction'; import { computerInteractions } from './computer.interaction'; +import { bedroomVanityInteractions } from './bedroomVanity.interaction'; const interactions = [ // Add more interactions here enterMapCityInteraction, bedInteractions, computerInteractions, + bedroomVanityInteractions ]; export default interactions;